@tanstack/intent 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,23 +1,23 @@
1
1
  # @tanstack/intent
2
2
 
3
- Ship compositional knowledge for AI coding agents alongside your npm packages.
3
+ A CLI for library maintainers to generate, validate, and ship [Agent Skills](https://agentskills.io) alongside their npm packages.
4
4
 
5
5
  ## The problem
6
6
 
7
7
  Your docs are good. Your types are solid. Your agent still gets it wrong.
8
8
 
9
- 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. Once a breaking change ships, models contain _both_ versions forever with no way to disambiguate.
9
+ 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 with no way to tell which applies. Once a breaking change ships, models develop a permanent split-brain — training data contains _both_ versions forever with no way to disambiguate.
10
10
 
11
11
  The ecosystem already moves toward agent-readable knowledge — Cursor rules, CLAUDE.md files, skills directories. But delivery is stuck in copy-paste: hunt for a community-maintained rules file, paste it into your config, repeat for every tool. No versioning, no update path, no staleness signal.
12
12
 
13
- ## Skills: the fourth artifact
13
+ ## Skills: versioned knowledge in npm
14
14
 
15
- You ship code, docs, and types. Skills are the fourth artifactknowledge encoded for the thing writing most of your code.
16
-
17
- Skills are npm packages of knowledge — encoding how tools compose, which patterns fit which goals, and what to avoid. When a library ships skills using `@tanstack/intent`, that knowledge travels with the tool via `npm update` — not the model's training cutoff. Versioned knowledge the maintainer owns, updated when the package updates.
15
+ A skill is a short, versioned document that tells agents how to use a specific capability of your library — correct patterns, common mistakes, and when to apply them. Skills ship inside your npm package and 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.
18
16
 
19
17
  Each skill declares its source docs. When those docs change, the CLI flags the skill for review. One source of truth, one derived artifact that stays in sync.
20
18
 
19
+ The [Agent Skills spec](https://agentskills.io) is an open standard already adopted by VS Code, GitHub Copilot, OpenAI Codex, Cursor, Claude Code, Goose, Amp, and others.
20
+
21
21
  ## Quick Start
22
22
 
23
23
  ### For library consumers
@@ -28,7 +28,7 @@ Set up skill-to-task mappings in your project's agent config files (CLAUDE.md, .
28
28
  npx @tanstack/intent install
29
29
  ```
30
30
 
31
- No per-library setup. No hunting for rules files. Install the package, run `intent install`, and the agent understands the tool. Update the package, and skills update too.
31
+ No per-library setup. No hunting for rules files. Install the package, run `npx @tanstack/intent install`, and the agent understands the tool. Update the package, and skills update too.
32
32
 
33
33
  List available skills from installed packages:
34
34
 
@@ -44,7 +44,7 @@ Generate skills for your library by telling your AI coding agent to run:
44
44
  npx @tanstack/intent scaffold
45
45
  ```
46
46
 
47
- This prints a prompt that walks the agent through domain discovery, skill tree generation, and skill creation — one step at a time with your review at each stage.
47
+ This walks the agent through domain discovery, skill tree generation, and skill creation — one step at a time with your review at each stage.
48
48
 
49
49
  Validate your skill files:
50
50
 
@@ -61,27 +61,27 @@ npx @tanstack/intent stale
61
61
  Copy CI workflow templates into your repo so validation and staleness checks run on every push:
62
62
 
63
63
  ```bash
64
- npx @tanstack/intent setup
64
+ npx @tanstack/intent setup-github-actions
65
65
  ```
66
66
 
67
67
  ## Keeping skills current
68
68
 
69
69
  The real risk with any derived artifact is staleness. `npx @tanstack/intent stale` flags skills whose source docs have changed, and CI templates catch drift before it ships.
70
70
 
71
- The feedback loop runs both directions. `npx @tanstack/intent feedback` lets users submit structured reports when a skill produces wrong output — which skill, which version, what broke. That context flows back to the maintainer, and the fix ships to everyone on the next `npm update`.
71
+ The feedback loop runs both directions. `npx @tanstack/intent feedback` lets users submit structured reports when a skill produces wrong output — which skill, which version, what broke. That context flows back to the maintainer, and the fix ships to everyone on the next `npm update`. Every support interaction produces an artifact that prevents the same class of problem for all future users — not just the one who reported it.
72
72
 
73
73
  ## CLI Commands
74
74
 
75
- | Command | Description |
76
- | ------------------------------------- | --------------------------------------------------- |
77
- | `npx @tanstack/intent install` | Set up skill-to-task mappings in agent config files |
78
- | `npx @tanstack/intent list [--json]` | Discover intent-enabled packages |
79
- | `npx @tanstack/intent meta` | List meta-skills for library maintainers |
80
- | `npx @tanstack/intent scaffold` | Print the guided skill generation prompt |
81
- | `npx @tanstack/intent validate [dir]` | Validate SKILL.md files |
82
- | `npx @tanstack/intent setup` | Copy CI templates, generate shim, create labels |
83
- | `npx @tanstack/intent stale [--json]` | Check skills for version drift |
84
- | `npx @tanstack/intent feedback` | Submit skill feedback |
75
+ | Command | Description |
76
+ | ------------------------------------------- | --------------------------------------------------- |
77
+ | `npx @tanstack/intent install` | Set up skill-to-task mappings in agent config files |
78
+ | `npx @tanstack/intent list [--json]` | Discover intent-enabled packages |
79
+ | `npx @tanstack/intent meta` | List meta-skills for library maintainers |
80
+ | `npx @tanstack/intent scaffold` | Print the guided skill generation prompt |
81
+ | `npx @tanstack/intent validate [dir]` | Validate SKILL.md files |
82
+ | `npx @tanstack/intent setup-github-actions` | Copy CI templates into your repo |
83
+ | `npx @tanstack/intent stale [--json]` | Check skills for version drift |
84
+ | `npx @tanstack/intent feedback` | Submit skill feedback |
85
85
 
86
86
  ## License
87
87
 
package/dist/cli.mjs CHANGED
@@ -65,12 +65,33 @@ async function cmdList(args) {
65
65
  for (const w of result.warnings) console.log(` ⚠ ${w}`);
66
66
  }
67
67
  }
68
- function cmdMeta() {
68
+ function cmdMeta(args) {
69
69
  const metaDir = getMetaDir();
70
70
  if (!existsSync(metaDir)) {
71
71
  console.error("Meta-skills directory not found.");
72
72
  process.exit(1);
73
73
  }
74
+ if (args.length > 0) {
75
+ const name = args[0];
76
+ if (name.includes("..") || name.includes("/") || name.includes("\\")) {
77
+ console.error(`Invalid meta-skill name: "${name}"`);
78
+ process.exit(1);
79
+ }
80
+ const skillFile = join(metaDir, name, "SKILL.md");
81
+ if (!existsSync(skillFile)) {
82
+ console.error(`Meta-skill "${name}" not found.`);
83
+ console.error(`Run \`npx @tanstack/intent meta\` to list available meta-skills.`);
84
+ process.exit(1);
85
+ }
86
+ try {
87
+ console.log(readFileSync(skillFile, "utf8"));
88
+ } catch (err) {
89
+ const msg = err instanceof Error ? err.message : String(err);
90
+ console.error(`Failed to read meta-skill "${name}": ${msg}`);
91
+ process.exit(1);
92
+ }
93
+ return;
94
+ }
74
95
  const entries = readdirSync(metaDir, { withFileTypes: true }).filter((e) => e.isDirectory()).filter((e) => existsSync(join(metaDir, e.name, "SKILL.md")));
75
96
  if (entries.length === 0) {
76
97
  console.log("No meta-skills found.");
@@ -290,7 +311,7 @@ This produces: individual SKILL.md files.
290
311
  3. For each publishable package, run: \`npx @tanstack/intent add-library-bin\`
291
312
  4. For each publishable package, run: \`npx @tanstack/intent edit-package-json\`
292
313
  5. Ensure each package has \`@tanstack/intent\` as a devDependency
293
- 6. Create a \`feedback:<skill-name>\` label on the GitHub repo for each skill (use \`gh label create\`)
314
+ 6. Create a \`skill:<skill-name>\` label on the GitHub repo for each skill (use \`gh label create\`)
294
315
  7. Add a README note: "If you use an AI agent, run \`npx @tanstack/intent install\`"
295
316
  `;
296
317
  console.log(prompt);
@@ -299,7 +320,7 @@ const USAGE = `TanStack Intent CLI
299
320
 
300
321
  Usage:
301
322
  intent list [--json] Discover intent-enabled packages
302
- intent meta List meta-skills for maintainers
323
+ intent meta [name] List meta-skills, or print one by name
303
324
  intent validate [<dir>] Validate skill files (default: skills/)
304
325
  intent install Print a skill that guides your coding agent to set up skill-to-task mappings
305
326
  intent scaffold Print maintainer scaffold prompt
@@ -314,7 +335,7 @@ switch (command) {
314
335
  await cmdList(commandArgs);
315
336
  break;
316
337
  case "meta":
317
- cmdMeta();
338
+ cmdMeta(commandArgs);
318
339
  break;
319
340
  case "validate":
320
341
  cmdValidate(commandArgs);
package/dist/index.mjs CHANGED
@@ -212,7 +212,7 @@ function submitMetaFeedback(payload, opts) {
212
212
  "--title",
213
213
  `Meta-Skill Feedback: ${payload.metaSkill} (${payload.userRating})`,
214
214
  "--label",
215
- `feedback:${payload.metaSkill}`,
215
+ `skill:${payload.metaSkill}`,
216
216
  "--body",
217
217
  "-"
218
218
  ], {
@@ -29,7 +29,17 @@ can be improved.
29
29
 
30
30
  Review your own session transcript. No human interaction needed yet.
31
31
 
32
- ### 1a: Gap detection
32
+ ### 1a: Skills inventory
33
+
34
+ Before analyzing gaps and errors, inventory all skills that were available
35
+ during the session:
36
+
37
+ - **Loaded and used:** Skills you read and actively followed.
38
+ - **Available but not loaded:** Skills that were installed (discoverable via
39
+ `intent list`) but you never read. This is important — many issues stem from
40
+ the agent not loading the right skill, not from the skill itself being wrong.
41
+
42
+ ### 1b: Gap detection
33
43
 
34
44
  Identify moments where the skill was silent and you had to bridge the gap
35
45
  yourself — via code reading, search, trial-and-error, or general knowledge.
@@ -40,7 +50,7 @@ For each gap, note:
40
50
  - What the skill should have told you
41
51
  - How you solved it (code reading, web search, guessing)
42
52
 
43
- ### 1b: Error/correction tracking
53
+ ### 1c: Error/correction tracking
44
54
 
45
55
  Identify moments where the skill prescribed an approach that produced an error.
46
56
 
@@ -50,7 +60,7 @@ For each error, note:
50
60
  - The error or incorrect behavior that resulted
51
61
  - The fix you applied
52
62
 
53
- ### 1c: Human intervention events
63
+ ### 1d: Human intervention events
54
64
 
55
65
  Identify moments where the human clarified, corrected, or overrode your approach.
56
66
 
@@ -60,7 +70,7 @@ For each intervention, note:
60
70
  - What the human said or changed
61
71
  - Whether the skill could have prevented this
62
72
 
63
- ### 1d: Step duration anomalies
73
+ ### 1e: Step duration anomalies
64
74
 
65
75
  Identify steps that consumed disproportionate effort compared to their apparent
66
76
  complexity. These signal that the skill should provide a template, snippet, or
@@ -107,21 +117,31 @@ referenced.
107
117
 
108
118
  [one-sentence summary of what the human asked you to do]
109
119
 
120
+ ## Skills Inventory
121
+
122
+ **Loaded and used:**
123
+
124
+ - [list each skill the agent read and actively followed during the session]
125
+
126
+ **Available but not loaded:**
127
+
128
+ - [list skills that were installed/available but the agent never read]
129
+
110
130
  ## What Worked
111
131
 
112
132
  [patterns/instructions from the skill that were accurate and helpful]
113
133
 
114
134
  ## What Failed
115
135
 
116
- [from 1b — skill instructions that produced errors]
136
+ [from 1c — skill instructions that produced errors]
117
137
 
118
138
  ## Missing
119
139
 
120
- [from 1a — gaps where the skill should have covered]
140
+ [from 1b — gaps where the skill should have covered]
121
141
 
122
142
  ## Self-Corrections
123
143
 
124
- [from 1b fixes + 1c human interventions, combined]
144
+ [from 1c fixes + 1d human interventions, combined]
125
145
 
126
146
  ## User Comments
127
147
 
@@ -136,10 +156,11 @@ referenced.
136
156
  | Package | The npm package the skill lives in (e.g. `@tanstack/query-intent`) |
137
157
  | Skill version | Frontmatter `metadata.version` or `library_version` |
138
158
  | Task | Summarize the human's original request in one sentence |
159
+ | Skills Inventory | Which skills were loaded vs. available but not loaded (see below) |
139
160
  | What Worked | List skill sections/patterns that were correct and useful |
140
- | What Failed | From 1b — skill instructions that produced errors |
141
- | Missing | From 1a — gaps where the skill was silent |
142
- | Self-Corrections | From 1b fixes + 1c human interventions, combined |
161
+ | What Failed | From 1c — skill instructions that produced errors |
162
+ | Missing | From 1b — gaps where the skill was silent |
163
+ | Self-Corrections | From 1c fixes + 1d human interventions, combined |
143
164
  | Rating | From Phase 2 sentiment analysis or explicit rating |
144
165
  | User Comments | From Phase 2 answers, keep brief |
145
166
 
@@ -177,7 +198,7 @@ not contain project-specific details. Before submission:
177
198
  Submit directly as a GitHub issue:
178
199
 
179
200
  ```bash
180
- gh issue create --repo [owner/repo] --title "Skill Feedback: [skill-name] ([rating])" --label "feedback:[skill-name]" --body-file intent-feedback.md
201
+ gh issue create --repo [owner/repo] --title "Skill Feedback: [skill-name] ([rating])" --label "skill:[skill-name]" --body-file intent-feedback.md
181
202
  ```
182
203
 
183
204
  If the label doesn't exist, omit the `--label` flag — don't let a missing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/intent",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Ship compositional knowledge for AI coding agents alongside your npm packages",
5
5
  "license": "MIT",
6
6
  "type": "module",