Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions .claude/skills/write-docs/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ AI Transport is the testbed for the new principles. Other Ably products will ali

Pick the template that matches the page you are writing.

**Templates describe structure, not headings.** The numbered items below are the *section shape* — what each section covers and roughly in what order. They are not the literal H2 text for the page. A concept-page template item like "Problem statement" becomes a descriptive imperative on the page itself: `## Why Runs exist`, `## Why sessions exist`. "Model" becomes `## Understand the Run lifecycle`, `## Understand sessions and channels`. "Code proof" becomes `## Trigger a Run`, `## Attach to a session`. Adapt the heading to the specific concept; never copy the template label verbatim. Use imperative or descriptive verb phrases per the writing-style guide.

### Feature page

A feature page maps to one developer JTBD. The section order below distils the structural pattern feature pages follow.
Expand Down Expand Up @@ -380,6 +382,13 @@ grep -rn -E "key\s*:\s*['\"][^'\"]+['\"]" "$P" | grep -v authUrl
# No "docs under construction" / WIP markers
grep -rni "under construction\|coming soon\|todo:\|wip\b" "$P"

# Every H2 carries an inline anchor (CLAUDE.md convention: `## Heading <a id="slug"/>`)
for f in "$P"/*.mdx; do
total=$(grep -c "^## " "$f")
anchored=$(grep -cE '^## .* <a id="[^"]+"' "$f")
[ "$total" != "$anchored" ] && echo "$f: $anchored/$total H2s anchored"
done

# No em dashes (style guide forbids)
grep -rn "—" "$P"

Expand Down Expand Up @@ -474,21 +483,23 @@ When reviewing someone else's docs PR (or your own at PR time), walk this list.
**Mechanics**

14. Frontmatter complete: `title`, `meta_description`, `meta_keywords`, `intro`, `redirect_from` where the page moved or merged. (Per-interface API reference pages omit `intro`.)
15. New page added to the relevant nav file under `src/data/nav/`.
16. `<Aside>` used sparingly and load-bearing. No decorative asides.
17. Internal links resolve. No references to URLs that only exist in `redirect_from` frontmatter.
15. Every H2 carries an inline anchor — `## Heading <a id="slug"/>`, per the CLAUDE.md convention. Use the H2-anchor grep above.
16. Section headings are descriptive imperatives or noun phrases tied to the specific content, not template labels copied verbatim (no `## The model`, `## The problem X solves`, `## Code proof`).
17. New page added to the relevant nav file under `src/data/nav/`.
18. `<Aside>` used sparingly and load-bearing. No decorative asides.
19. Internal links resolve. No references to URLs that only exist in `redirect_from` frontmatter.

**API reference pages only** (additional checks)

18. Method H2s use descriptive verb phrases (`## Create a client transport`), not bare method names. Anchor is JS-canonical kebab-case.
19. Every method H2 is followed by `<MethodSignature>{` … `}</MethodSignature>` (template-literal form for signatures with `<` or `>`).
20. Every method with parameters has `### Parameters <a id="{slug}-params"/>` with a 4-column `Parameter | Required | Description | Type` table.
21. Every method has `### Returns <a id="{slug}-returns"/>` unless it returns `void`/`Unit`.
22. Type tables default to hidden (`<Table id='X' hidden>`) referenced via `<Table id='X'/>`. Visible types only when they meet one of the four promotion criteria.
23. Hidden table audit passes. Every hidden has at least one inline reference; every reference has a definition.
24. Error type referenced via cross-page link to its canonical home (lowercase `#errorinfo` anchor).
25. Page ends with `## Example` showing end-to-end usage.
26. No same-page markdown anchor links to type anchors (`[X](#X)`). Type names in prose are backticked; cross-page references go to the type's own page.
20. Method H2s use descriptive verb phrases (`## Create a client transport`), not bare method names. Anchor is JS-canonical kebab-case.
21. Every method H2 is followed by `<MethodSignature>{` … `}</MethodSignature>` (template-literal form for signatures with `<` or `>`).
22. Every method with parameters has `### Parameters <a id="{slug}-params"/>` with a 4-column `Parameter | Required | Description | Type` table.
23. Every method has `### Returns <a id="{slug}-returns"/>` unless it returns `void`/`Unit`.
24. Type tables default to hidden (`<Table id='X' hidden>`) referenced via `<Table id='X'/>`. Visible types only when they meet one of the four promotion criteria.
25. Hidden table audit passes. Every hidden has at least one inline reference; every reference has a definition.
26. Error type referenced via cross-page link to its canonical home (lowercase `#errorinfo` anchor).
27. Page ends with `## Example` showing end-to-end usage.
28. No same-page markdown anchor links to type anchors (`[X](#X)`). Type names in prose are backticked; cross-page references go to the type's own page.

## When the SDK or product changes shape

Expand Down
3 changes: 1 addition & 2 deletions src/data/languages/languageData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ export default {
android: '1.2',
},
aiTransport: {
javascript: '0.1',
react: '0.1',
javascript: '0.2',
},
spaces: {
javascript: '0.5',
Expand Down
146 changes: 95 additions & 51 deletions src/data/nav/aitransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ export default {
},
],
},
{
name: 'Set up authentication',
link: '/docs/ai-transport/getting-started/authentication',
},
{
name: 'Enable channel rules',
link: '/docs/ai-transport/getting-started/channel-rules',
},
],
},
{
Expand Down Expand Up @@ -58,16 +66,24 @@ export default {
link: '/docs/ai-transport/concepts/sessions',
},
{
name: 'Conversation tree',
link: '/docs/ai-transport/concepts/conversation-tree',
name: 'Connections',
link: '/docs/ai-transport/concepts/connections',
},
{
name: 'Runs',
link: '/docs/ai-transport/concepts/runs',
},
{
name: 'Turns',
link: '/docs/ai-transport/concepts/turns',
name: 'Invocations',
link: '/docs/ai-transport/concepts/invocations',
},
{
name: 'Transport',
link: '/docs/ai-transport/concepts/transport',
name: 'Codecs',
link: '/docs/ai-transport/concepts/codecs',
},
{
name: 'Conversation tree',
link: '/docs/ai-transport/concepts/conversation-tree',
},
{
name: 'Authentication',
Expand Down Expand Up @@ -116,7 +132,7 @@ export default {
link: '/docs/ai-transport/features/history',
},
{
name: 'Conversation branching',
name: 'Branching, edit, and regenerate',
link: '/docs/ai-transport/features/branching',
},
{
Expand Down Expand Up @@ -182,61 +198,89 @@ export default {
name: 'JavaScript',
pages: [
{
name: 'Client transport',
link: '/docs/ai-transport/api/javascript/client-transport',
},
{
name: 'Server transport',
link: '/docs/ai-transport/api/javascript/server-transport',
},
{
name: 'Vercel integration',
link: '/docs/ai-transport/api/javascript/vercel',
name: 'Core SDK',
pages: [
{
name: 'Client session',
link: '/docs/ai-transport/api/javascript/core/client-session',
},
{
name: 'Agent session',
link: '/docs/ai-transport/api/javascript/core/agent-session',
},
{
name: 'Codec',
link: '/docs/ai-transport/api/javascript/core/codec',
},
],
},
{
name: 'Codec',
link: '/docs/ai-transport/api/javascript/codec',
name: 'Vercel',
pages: [
{
name: 'Chat transport',
link: '/docs/ai-transport/api/javascript/vercel/chat-transport',
},
{
name: 'Codec',
link: '/docs/ai-transport/api/javascript/vercel/codec',
},
{
name: 'Run outcome',
link: '/docs/ai-transport/api/javascript/vercel/run-outcome',
},
],
},
],
},
{
name: 'React',
pages: [
{
name: 'Providers',
link: '/docs/ai-transport/api/react/providers',
},
{
name: 'useClientTransport',
link: '/docs/ai-transport/api/react/use-client-transport',
},
{
name: 'useView',
link: '/docs/ai-transport/api/react/use-view',
},
{
name: 'useCreateView',
link: '/docs/ai-transport/api/react/use-create-view',
},
{
name: 'useTree',
link: '/docs/ai-transport/api/react/use-tree',
},
{
name: 'useActiveTurns',
link: '/docs/ai-transport/api/react/use-active-turns',
},
{
name: 'useAblyMessages',
link: '/docs/ai-transport/api/react/use-ably-messages',
},
{
name: 'useChatTransport',
link: '/docs/ai-transport/api/react/use-chat-transport',
name: 'Core SDK',
pages: [
{
name: 'Providers',
link: '/docs/ai-transport/api/react/core/providers',
},
{
name: 'useClientSession',
link: '/docs/ai-transport/api/react/core/use-client-session',
},
{
name: 'useView',
link: '/docs/ai-transport/api/react/core/use-view',
},
{
name: 'useCreateView',
link: '/docs/ai-transport/api/react/core/use-create-view',
},
{
name: 'useTree',
link: '/docs/ai-transport/api/react/core/use-tree',
},
{
name: 'useAblyMessages',
link: '/docs/ai-transport/api/react/core/use-ably-messages',
},
],
},
{
name: 'useMessageSync',
link: '/docs/ai-transport/api/react/use-message-sync',
name: 'Vercel',
pages: [
{
name: 'ChatTransportProvider',
link: '/docs/ai-transport/api/react/vercel/chat-transport-provider',
},
{
name: 'useChatTransport',
link: '/docs/ai-transport/api/react/vercel/use-chat-transport',
},
{
name: 'useMessageSync',
link: '/docs/ai-transport/api/react/vercel/use-message-sync',
},
],
},
],
},
Expand Down
Binary file not shown.
Binary file added src/images/content/diagrams/ait-cancellation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/content/diagrams/ait-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/content/diagrams/ait-tool-calling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading