@tanstack/intent 0.0.7 → 0.0.9

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
@@ -19,33 +19,35 @@ pnpm add -D @tanstack/intent
19
19
  Set up skill-to-task mappings in your project's agent config files (CLAUDE.md, .cursorrules, etc.):
20
20
 
21
21
  ```bash
22
- npx intent install
22
+ npx @tanstack/intent install
23
23
  ```
24
24
 
25
25
  List available skills from installed packages:
26
26
 
27
27
  ```bash
28
- npx intent list
28
+ npx @tanstack/intent list
29
29
  ```
30
30
 
31
31
  ### For library maintainers
32
32
 
33
- Generate skills for your library using the guided scaffold workflow:
33
+ Generate skills for your library by telling your AI coding agent to run:
34
34
 
35
35
  ```bash
36
- npx intent scaffold
36
+ npx @tanstack/intent scaffold
37
37
  ```
38
38
 
39
+ 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.
40
+
39
41
  Validate your skill files:
40
42
 
41
43
  ```bash
42
- npx intent validate
44
+ npx @tanstack/intent validate
43
45
  ```
44
46
 
45
47
  Copy CI workflow templates into your repo:
46
48
 
47
49
  ```bash
48
- npx intent setup
50
+ npx @tanstack/intent setup
49
51
  ```
50
52
 
51
53
  ## CLI Commands
package/dist/cli.mjs CHANGED
@@ -57,7 +57,7 @@ async function cmdList(args) {
57
57
  console.log();
58
58
  }
59
59
  console.log(`Feedback:`);
60
- console.log(` After completing your task, collect feedback on skill usage.`);
60
+ console.log(` Submit feedback on skill usage to help maintainers improve the skills.`);
61
61
  console.log(` Load: node_modules/@tanstack/intent/meta/feedback-collection/SKILL.md`);
62
62
  console.log();
63
63
  if (result.warnings.length > 0) {
@@ -43,7 +43,7 @@ async function cmdList() {
43
43
  console.log();
44
44
  }
45
45
  console.log(`Feedback:`);
46
- console.log(` After completing your task, collect feedback on skill usage.`);
46
+ console.log(` Submit feedback on skill usage to help maintainers improve the skills.`);
47
47
  console.log(` Load: node_modules/@tanstack/intent/meta/feedback-collection/SKILL.md`);
48
48
  console.log();
49
49
  if (result.warnings.length > 0) {
@@ -31,7 +31,8 @@ before launch"). Domains are an intermediate conceptual grouping you use
31
31
  during analysis; the final skills emerge from the intersection of domains
32
32
  and developer tasks.
33
33
 
34
- There are five phases. Always run them in order.
34
+ There are five phases. Always run them in order — unless the lightweight
35
+ path applies (see below).
35
36
 
36
37
  1. **Quick scan** — orient yourself (autonomous)
37
38
  2. **High-level interview** — extract the maintainer's task map
@@ -39,6 +40,25 @@ There are five phases. Always run them in order.
39
40
  4. **Detail interview** — gap-targeted questions, AI-agent failures
40
41
  5. **Finalize artifacts**
41
42
 
43
+ ### Lightweight path (small libraries)
44
+
45
+ After Phase 1, if the library has **fewer than 5 client-facing skill
46
+ areas** (e.g. a focused utility library, a single-purpose tool, or a
47
+ library with only 2–3 distinct developer tasks), use a compressed flow:
48
+
49
+ 1. **Phase 1** — Quick scan (same as full flow)
50
+ 2. **Phase 2+4 combined** — Single interview round. Combine the
51
+ high-level task map questions (Phase 2) with gap-targeted and
52
+ AI-agent-specific questions (Phase 4) into one interview session
53
+ of 4–8 questions total. Skip the draft-review step since the skill
54
+ set is small enough to confirm in one pass.
55
+ 3. **Phase 3** — Deep read (same as full flow, but scope is smaller)
56
+ 4. **Phase 5** — Finalize artifacts (same as full flow)
57
+
58
+ The lightweight path produces identical output artifacts (domain_map.yaml
59
+ and skill_spec.md). It just avoids two separate interview rounds when the
60
+ library is small enough that one round covers everything.
61
+
42
62
  ---
43
63
 
44
64
  ## Phase 1 — Quick scan (autonomous, ~10 minutes)
@@ -356,9 +356,9 @@ updates preserve review effort and reduce diff noise.
356
356
 
357
357
  | Rule | Detail |
358
358
  |------|--------|
359
- | React adapter only (Phase 1) | No Vue, Solid, Svelte, Angular examples unless generating a framework skill for that adapter |
359
+ | Match the library's framework support | Generate framework skills only for adapters the library actually provides. If the library supports only React, only generate React examples. If it supports multiple frameworks, generate one skill per adapter. |
360
360
  | All imports use real package names | `@tanstack/react-query`, not `react-query` |
361
- | No placeholder code | No `// ...`, `[your value]`, or `...rest` |
361
+ | No placeholder code | No `// ...`, `[your value]`, or `...rest`. Idiomatic framework patterns like `{children}` or `{props.title}` in JSX are not placeholders — they are real code and are acceptable. |
362
362
  | Agent-first writing | Only write what the agent cannot already know |
363
363
  | Examples are minimal | No unnecessary boilerplate or wrapper components |
364
364
  | Failure modes are high-value | Focus on plausible-but-broken, not obvious errors |
@@ -41,7 +41,7 @@ jobs:
41
41
  - name: Check staleness
42
42
  id: stale
43
43
  run: |
44
- OUTPUT=$(npx intent stale --json 2>&1) || true
44
+ OUTPUT=$(npx @tanstack/intent stale --json 2>&1) || true
45
45
  echo "$OUTPUT"
46
46
 
47
47
  # Check if any skills need review
@@ -89,7 +89,7 @@ jobs:
89
89
  '1. Read the current SKILL.md file',
90
90
  '2. Check what changed in the library since the skill was last updated',
91
91
  '3. Update the skill content to reflect current APIs and behavior',
92
- '4. Run \`npx intent validate\` to verify the updated skill',
92
+ '4. Run \`npx @tanstack/intent validate\` to verify the updated skill',
93
93
  ].join('\n');
94
94
 
95
95
  // Write outputs
@@ -124,6 +124,24 @@ package directory (e.g. `packages/client/skills/core/SKILL.md`). Set the
124
124
  `package` field so generate-skill knows where to write the file. The domain
125
125
  map artifacts stay at the repo root.
126
126
 
127
+ ### Minimal library fast path
128
+
129
+ If the domain map contains **fewer than 5 skills** and no framework
130
+ adapter packages, skip the core overview + sub-skill registry pattern.
131
+ Instead:
132
+
133
+ - Use **flat structure** — each skill gets its own `skills/[skill-name]/SKILL.md`
134
+ - **No router skill** — the intent CLI `list` command is sufficient for discovery
135
+ - **No core overview skill** — go directly to individual skill files
136
+ - Each skill is type `core` (not `sub-skill`) and stands alone without
137
+ a parent registry
138
+ - Skip Step 2 (core overview) and Step 3 (sub-skills) — go directly to
139
+ writing individual skills as standalone core skills using Step 3's body
140
+ format
141
+
142
+ This avoids unnecessary scaffolding for focused libraries where the
143
+ overhead of a hierarchical skill tree exceeds the navigation benefit.
144
+
127
145
  ### Step 1 — Plan the file tree
128
146
 
129
147
  From the domain map, each entry in the `skills` list becomes a SKILL.md
@@ -229,7 +247,8 @@ table) is optional. If the intent CLI provides `list` and `show`
229
247
  commands, agents can discover skills directly without a router. Only
230
248
  create a router skill if the skill set is large enough (15+) that
231
249
  browsing the list is insufficient, or if the nested structure needs
232
- an entry point to guide agents to the right sub-skill.
250
+ an entry point to guide agents to the right sub-skill. Libraries with
251
+ fewer than 5 skills should never have a router skill.
233
252
 
234
253
  **Source repository layout for npm distribution:**
235
254
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/intent",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "Ship compositional knowledge for AI coding agents alongside your npm packages",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,6 +32,7 @@
32
32
  "tsdown": "^0.19.0"
33
33
  },
34
34
  "scripts": {
35
+ "prepack": "pnpm run build",
35
36
  "build": "tsdown src/index.ts src/cli.ts src/setup.ts src/intent-library.ts src/library-scanner.ts --format esm --dts",
36
37
  "test:lib": "vitest run",
37
38
  "test:types": "tsc --noEmit"