You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/blog/from-docs-to-agents.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,38 +3,38 @@ title: "From Docs to Agents: Shipping Knowledge That Travels With Your Package"
3
3
published: 2026-03-04
4
4
authors:
5
5
- Sarah Gerrard
6
-
- Kyle Matthews
6
+
- Kyle Mathews
7
7
---
8
8
9
9
Your docs are good. Your types are solid. Your agent still gets it wrong.
10
10
11
-
Not because it's dumb — because no pipeline connects what you know about your tool to what agents know. Docs target humans who browse. Types check individual API calls but can't encode intent. Training data snapshots the ecosystem as it *was*, mixing versions without flagging which one applies. The gap isn't content. It's lifecycle.
11
+
Not because it's dumb — because nothing connects what you know about your tool to what agents know. Docs target humans who browse. Types check individual API calls but can't encode intent. Training data snapshots the ecosystem as it *was*, mixing versions without flagging which applies. The gap isn't content. It's lifecycle.
12
12
13
13
## Skills as side quests
14
14
15
-
The ecosystem already moves toward agent-readable knowledge. Cursor rules, CLAUDE.md files, skills directories — the idea that agents need more than docs and types has landed. But the delivery mechanism hasn't caught up.
15
+
The ecosystem already moves toward agent-readable knowledge. Cursor rules, CLAUDE.md files, skills directories — everyone agrees agents need more than docs and types. But delivery hasn't caught up.
16
16
17
-
Right now, if you want your agent to understand TanStack Router, you hunt for a community-maintained rules file in some GitHub repo. Maybe it's in `awesome-cursorrules`. Maybe someone linked it in Discord. You copy it into your project's `.cursorrules` or `CLAUDE.md`. Then you repeat for TanStack Query. And TanStack Table. Each sourced from a different place, written by a different person, at a different point in time.
17
+
Right now, if you want your agent to understand TanStack Router, you hunt for a community-maintained rules file in some GitHub repo. Maybe it's in `awesome-cursorrules`. Maybe someone linked it in Discord. You copy it into `.cursorrules` or `CLAUDE.md`. Then you repeat for TanStack Query. And TanStack Table. Each from a different place, a different author, a different point in time.
18
18
19
-
Multiply that across every tool in your stack. You're managing a pile of copy-pasted knowledge files with no versioning, no update mechanism, and no staleness signal. Did TanStack Router ship a breaking change last week? Your rules file doesn't know. Is the Query skill you grabbed written for v4 or v5? Hope you checked.
19
+
Multiply that across every tool in your stack. You're managing copy-pasted knowledge files with no versioning, no update path, and no staleness signal. Did TanStack Router ship a breaking change last week? Your rules file doesn't know. Is the Query skill you grabbed written for v4 or v5? Hope you checked.
20
20
21
21
Finding skills is manual. Installing them is manual. Keeping them current is manual. When they drift — and they always drift — you discover it only when your agent starts producing subtly wrong code.
22
22
23
-
Library maintainers already have the knowledge agents need — in docs, migration guides, "common mistakes" GitHub discussions, Discord answers. But none of it reaches agents through a channel the maintainer controls. The knowledge exists. What's missing is a delivery mechanism tied to the package itself.
23
+
Library maintainers already have the knowledge agents need — in docs, migration guides, "common mistakes" GitHub discussions, Discord answers. But none of it reaches agents through a channel the maintainer controls. The knowledge exists. The delivery mechanism doesn't.
24
24
25
25

26
26
27
27
## Introducing `@tanstack/intent`
28
28
29
-
`@tanstack/intent` is the missing lifecycle layer — a toolkit for generating, discovering, and maintaining skills for your library, shipped as npm packages that travel with your code.
29
+
`@tanstack/intent` is the missing lifecycle layer — a toolkit for generating, discovering, and maintaining skills, shipped as npm packages that travel with your code.
30
30
31
31
```bash
32
32
pnpm add -D @tanstack/intent
33
33
```
34
34
35
-
The core idea: **intents are npm packages of skills.** They encode how tools compose, which patterns apply to which goals, and what to avoid. Skills travel with the tool via `npm update` — not the model's training cutoff, not community-maintained rules files, not prompt snippets in READMEs. Versioned knowledge the maintainer owns, shipped through npm, updated when the package updates.
35
+
The core idea: **intents are npm packages of skills.** They encode how tools compose, which patterns fit which goals, and what to avoid. Skills travel with the tool via `npm update` — not the model's training cutoff, not community-maintained rules files, not prompt snippets in READMEs. Versioned knowledge the maintainer owns, updated when the package updates.
36
36
37
-
A skill is a focused projection of knowledge you already maintain: the critical constraint, the flagged anti-pattern, the composition rule stated once and clearly. Each skill declares its source docs:
37
+
A skill is a focused projection of knowledge you already maintain: the critical constraint, the flagged anti-pattern, the composition rule stated once and clearly. Each declares its source docs:
38
38
39
39
```
40
40
---
@@ -50,17 +50,17 @@ metadata:
50
50
---
51
51
```
52
52
53
-
That `metadata.sources` field is load-bearing. When those docs change, the CLI flags the skill for review. You maintain one source of truth, with a derived artifact that stays in sync.
53
+
That `metadata.sources` field is load-bearing. When those docs change, the CLI flags the skill for review. One source of truth, one derived artifact that stays in sync.
54
54
55
55
## Generating and validating skills
56
56
57
-
You don't author skills from scratch. `intent scaffold`guides you through generating skills for your library:
57
+
You don't author skills from scratch. `intent scaffold`generates them from your library:
58
58
59
59
```bash
60
60
npx intent scaffold
61
61
```
62
62
63
-
The scaffold produces drafts you review, refine, and commit alongside your source. Once you have skills, `intent validate` checks that they're well-formed:
63
+
The scaffold produces drafts you review, refine, and commit. Once committed, `intent validate` checks that they're well-formed:
64
64
65
65
```bash
66
66
npx intent validate
@@ -72,21 +72,21 @@ npx intent validate
72
72
npx intent setup
73
73
```
74
74
75
-
The alternative — hoping model providers re-train on your latest docs — is not a strategy. Training data has a permanent version-mixing problem: once a breaking change ships, models contain *both* versions forever with no way to disambiguate. Skills bypass this entirely. They're versioned with your package, and `npm update` brings the latest knowledge with the latest code.
75
+
The alternative — hoping model providers re-train on your latest docs — is not a strategy. Training data has a permanent version-mixing problem: once a breaking change ships, models contain *both* versions forever with no way to disambiguate. Skills bypass this. They're versioned with your package, and `npm update` brings the latest knowledge with the latest code.
76
76
77
77

78
78
79
79
## The dependency graph does the discovery
80
80
81
-
When a developer runs `intent init`, the CLI discovers every intent-enabled package in the project and wires skills into the agent configuration — CLAUDE.md, .cursorrules, whatever the tooling expects.
81
+
When a developer runs `intent init`, the CLI discovers every intent-enabled package and wires skills into the agent configuration — CLAUDE.md, .cursorrules, whatever the tooling expects.
82
82
83
83
```bash
84
84
npx intent init
85
85
```
86
86
87
87

88
88
89
-
No per-library setup. No hunting for rules files. Install the package, run `intent init`, and the agent understands the tool. Update the package, and the skills update too. Knowledge travels through the same channel as code.
89
+
No per-library setup. No hunting for rules files. Install the package, run `intent init`, and the agent understands the tool. Update the package, and skills update too. Knowledge travels the same channel as code.
90
90
91
91
`intent list` shows you what's available:
92
92
@@ -103,39 +103,39 @@ npx intent meta
103
103
104
104
## From skills to playbooks
105
105
106
-
A single skill helps an agent use one tool correctly. But real development demands composition — routing *with* server state *with* a data grid *with* client-side storage. No individual skill covers how they fit together.
106
+
A single skill helps an agent use one tool correctly. Real development demands composition — routing *with* server state *with* a data grid *with* client-side storage. No single skill covers how they fit together.
107
107
108
-
Playbooks are the orchestration layer. A developer says "build a paginated data table with URL-synced filters" and the playbook loads the right skills in the right order — search params, loader/query integration, table columnDefs. Developer goals map to skill combinations.
108
+
Playbooks orchestrate. A developer says "build a paginated data table with URL-synced filters" and the playbook loads the right skills in the right order — search params, loader/query integration, table columnDefs. Goals map to skill combinations.
109
109
110
-
The more libraries in your stack that ship skills, the richer the composition story becomes.
110
+
The more libraries that ship skills, the richer composition becomes.
111
111
112
112
## Keeping it current
113
113
114
-
The real risk with any derived artifact is staleness. You update your docs, ship a new API, and skills silently drift. `@tanstack/intent` treats this as a first-class problem.
114
+
The real risk with any derived artifact is staleness. You update your docs, ship a new API, and skills silently drift. `@tanstack/intent` treats staleness as a first-class problem.
115
115
116
-
`intent stale` checks skills for version drift, flagging any that have fallen behind their source material:
116
+
`intent stale` checks for version drift, flagging skills that have fallen behind their sources:
117
117
118
118
```bash
119
119
npx intent stale # Human-readable report
120
120
npx intent stale --json # Machine-readable for CI
121
121
```
122
122
123
-
Run it in CI and you get a failing check when source material changes. The skill becomes part of your release checklist — not something you remember to update, but something your pipeline catches.
123
+
Run it in CI and you get a failing check when sources change. Skills become part of your release checklist — not something you remember to update, but something your pipeline catches.
124
124
125
125

126
126
127
-
The feedback loop runs both directions. `intent feedback` lets users submit structured reports when a skill produces wrong output — which skill, which version, what broke. That context flows back to you as a maintainer, and the fix ships to everyone on the next `npm update`.
127
+
The feedback loop runs both directions. `intent feedback` lets users submit structured reports when a skill produces wrong output — which skill, which version, what broke. That context flows back to you, and the fix ships to everyone on the next `npm update`.
128
128
129
129
```bash
130
130
npx intent feedback
131
131
```
132
132
133
-
Skills that keep needing the same workaround signal a deeper problem. Sometimes the fix is a better skill. Sometimes it's a better API. A skill that dissolves because the tool absorbed its lesson is the system working as designed.
133
+
Skills that keep needing the same workaround signal a deeper problem. Sometimes the fix is a better skill. Sometimes it's a better API. A skill that dissolves because the tool absorbed its lesson is the system working.
134
134
135
135
## The new job
136
136
137
-
Devtool makers have a new surface to maintain. You used to ship code, docs, and types. Now there's a fourth artifact: skills — knowledge encoded for the thing writing most of your code.
137
+
Devtool makers have a new surface to maintain. You shipped code, docs, and types. Now there's a fourth artifact: skills — knowledge encoded for the thing writing most of your code.
138
138
139
-
Tools that invest here will produce developers who build confidently from day one — not through tutorials or toy projects, but through correct patterns absorbed in the context of real work.
139
+
Tools that invest here produce developers who build confidently from day one — not through tutorials or toy projects, but through correct patterns absorbed in real work.
140
140
141
141
The lifecycle is: write your docs, generate skills, ship them with your package, validate and keep them current, learn from how they're used, make your tool better. Repeat.
0 commit comments