Skip to content

Commit bae9dd6

Browse files
fix(intent): review stale skills against artifact coverage (#120)
* remove notify workflow template * harden check-skills * Add stale `signals` * Parse `_artifacts` * Add artifact consistency signals * Add missing package coverage and artifact ignore support * Fix workspace-root skill resolution and private package coverage noise * Add workflow update advisory * fix release script * changeset * ci: apply automated fixes * update docs * ci: apply automated fixes * rm empty codex file * fix up * small fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 68e076d commit bae9dd6

27 files changed

Lines changed: 2226 additions & 297 deletions

.changeset/ten-shrimps-bow.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@tanstack/intent': patch
3+
---
4+
5+
Improve `intent stale` for monorepos by checking repo `_artifacts` coverage, flagging uncovered public workspace packages, and ignoring private workspaces.
6+
7+
The generated skills workflow now opens one grouped review PR with maintainer prompts, includes a workflow version stamp, and `intent stale` warns when maintainers should rerun `intent setup`.

docs/cli/intent-scaffold.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ The prompt also includes a post-generation checklist:
2929
- Run `npx @tanstack/intent@latest validate` and fix issues
3030
- Commit generated `skills/` and `skills/_artifacts/`
3131
- Ensure `@tanstack/intent` is in `devDependencies`
32-
- Run setup commands as needed:
33-
- `npx @tanstack/intent@latest edit-package-json`
34-
- `npx @tanstack/intent@latest setup-github-actions`
32+
- Run setup commands as needed:
33+
- `npx @tanstack/intent@latest edit-package-json`
34+
- `npx @tanstack/intent@latest setup`
3535

3636
## Related
3737

docs/cli/intent-setup.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ title: setup commands
33
id: intent-setup
44
---
55

6-
Intent exposes setup as two separate commands.
7-
8-
```bash
9-
npx @tanstack/intent@latest edit-package-json
10-
npx @tanstack/intent@latest setup-github-actions
11-
```
6+
Intent exposes publishing setup as two commands.
7+
8+
```bash
9+
npx @tanstack/intent@latest edit-package-json
10+
npx @tanstack/intent@latest setup
11+
```
1212

1313
## Commands
1414

15-
- `edit-package-json`: add or normalize `package.json` entries needed to publish skills
16-
- `setup-github-actions`: copy workflow templates to `.github/workflows`
15+
- `edit-package-json`: add or normalize `package.json` entries needed to publish skills
16+
- `setup`: copy workflow templates to `.github/workflows`
17+
- `setup-github-actions`: legacy alias for `setup`
1718

1819
## What each command changes
1920

@@ -22,12 +23,11 @@ npx @tanstack/intent@latest setup-github-actions
2223
- Ensures `keywords` includes `tanstack-intent`
2324
- Ensures `files` includes required publish entries
2425
- Preserves existing indentation
25-
- `setup-github-actions`
26-
- Copies templates from `@tanstack/intent/meta/templates/workflows` to `.github/workflows`
27-
- Applies variable substitution (`PACKAGE_NAME`, `PACKAGE_LABEL`, `PAYLOAD_PACKAGE`, `REPO`, `DOCS_PATH`, `SRC_PATH`, `WATCH_PATHS`)
28-
- Detects the workspace root in monorepos and writes repo-level workflows there
29-
- Generates monorepo-aware watch paths for package `src/` and docs directories
30-
- Skips files that already exist at destination
26+
- `setup`
27+
- Copies templates from `@tanstack/intent/meta/templates/workflows` to `.github/workflows`
28+
- Applies variable substitution (`PACKAGE_NAME`, `PACKAGE_LABEL`, `PAYLOAD_PACKAGE`, `REPO`, `DOCS_PATH`, `SRC_PATH`, `WATCH_PATHS`)
29+
- Detects the workspace root in monorepos and writes repo-level workflows there
30+
- Skips files that already exist at destination
3131

3232
## Required `files` entries
3333

@@ -39,12 +39,12 @@ npx @tanstack/intent@latest setup-github-actions
3939
## Common errors
4040

4141
- Missing or invalid `package.json` when running `edit-package-json`
42-
- Missing template source when running `setup-github-actions`
42+
- Missing template source when running `setup`
4343

4444
## Notes
4545

46-
- `setup-github-actions` skips existing files
47-
- In monorepos, run `setup-github-actions` from either the repo root or a package directory; Intent writes workflows to the workspace root
46+
- `setup` skips existing files
47+
- In monorepos, run `setup` from either the repo root or a package directory; Intent writes workflows to the workspace root
4848

4949
## Related
5050

docs/cli/intent-stale.md

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,28 @@ npx @tanstack/intent@latest stale [--json]
1515

1616
## Behavior
1717

18-
- Checks the current package by default, or all skill-bearing packages in the current workspace when run from a monorepo root
19-
- When `dir` is provided, scopes the check to the targeted package or skills directory
20-
- Computes one staleness report per package
21-
- Prints text output by default or JSON with `--json`
22-
- If no packages are found, prints `No intent-enabled packages found.`
18+
- Checks the current package by default
19+
- From a monorepo root, checks workspace packages that ship skills and also reports public workspace packages with no skill or artifact coverage
20+
- When `dir` is provided, scopes the check to the targeted package or skills directory
21+
- Computes one staleness report per package
22+
- Reads repo-root `_artifacts/*domain_map.yaml` and `_artifacts/*skill_tree.yaml` when present
23+
- Flags public workspace packages that are not represented by generated skills or artifact coverage
24+
- Skips workspace packages with `"private": true`
25+
- Prints text output by default or JSON with `--json`
26+
- Prints a non-failing workflow update reminder when `.github/workflows/check-skills.yml` is missing the current `intent-workflow-version` stamp
27+
- If no packages are found, prints `No intent-enabled packages found.`
28+
29+
Artifact coverage ignores can be recorded in `_artifacts/*skill_tree.yaml` or `_artifacts/*domain_map.yaml`:
30+
31+
```yaml
32+
coverage:
33+
ignored_packages:
34+
- '@tanstack/internal-tooling'
35+
- name: packages/devtools-fixture
36+
reason: test fixture only
37+
```
38+
39+
Ignored packages are excluded from missing coverage signals. Private workspace packages are excluded automatically.
2340
2441
## JSON report schema
2542
@@ -32,41 +49,54 @@ npx @tanstack/intent@latest stale [--json]
3249
"currentVersion": "string | null",
3350
"skillVersion": "string | null",
3451
"versionDrift": "major | minor | patch | null",
35-
"skills": [
36-
{
37-
"name": "string",
38-
"reasons": ["string"],
39-
"needsReview": true
40-
}
41-
]
42-
}
43-
]
52+
"skills": [
53+
{
54+
"name": "string",
55+
"reasons": ["string"],
56+
"needsReview": true
57+
}
58+
],
59+
"signals": [
60+
{
61+
"type": "missing-package-coverage",
62+
"library": "string",
63+
"subject": "string",
64+
"reasons": ["string"],
65+
"needsReview": true,
66+
"packageName": "string",
67+
"packageRoot": "string"
68+
}
69+
]
70+
}
71+
]
4472
```
4573

4674
Report fields:
4775

4876
- `library`: package name
4977
- `currentVersion`: latest version from npm registry (or `null` if unavailable)
5078
- `skillVersion`: `library_version` from skills (or `null`)
51-
- `versionDrift`: `major | minor | patch | null`
52-
- `skills`: array of per-skill checks
79+
- `versionDrift`: `major | minor | patch | null`
80+
- `skills`: array of per-skill checks
81+
- `signals`: array of artifact and workspace coverage checks
5382

5483
Skill fields:
5584

5685
- `name`
5786
- `reasons`: one or more staleness reasons
5887
- `needsReview`: boolean (`true` when reasons exist)
5988

60-
Reason generation:
61-
62-
- `version drift (<skillVersion> → <currentVersion>)`
63-
- `new source (<path>)` when a declared source has no stored sync SHA
89+
Reason generation:
90+
91+
- `version drift (<skillVersion> → <currentVersion>)`
92+
- `new source (<path>)` when a declared source has no stored sync SHA
93+
- artifact parse warnings, unresolved artifact skill paths, source drift, artifact library version drift, and missing workspace package coverage
6494

6595
## Text output
6696

67-
- Report header format: `<library> (<skillVersion> → <currentVersion>) [<versionDrift> drift]`
68-
- When no skill reasons exist: `All skills up-to-date`
69-
- Otherwise: one warning line per stale skill (`⚠ <name>: <reason1>, <reason2>, ...`)
97+
- Report header format: `<library> (<skillVersion> → <currentVersion>) [<versionDrift> drift]`
98+
- When no skill reasons exist: `All skills up-to-date`
99+
- Otherwise: one warning line per stale skill or review signal (`⚠ <name>: <reason1>, <reason2>, ...`)
70100

71101
## Common errors
72102

docs/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"to": "cli/intent-validate"
5656
},
5757
{
58-
"label": "intent setup-github-actions",
58+
"label": "intent setup",
5959
"to": "cli/intent-setup"
6060
},
6161
{

docs/getting-started/quick-start-maintainers.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ Run these commands to prepare your package for skill publishing:
101101
# Update package.json with required fields
102102
npx @tanstack/intent@latest edit-package-json
103103

104-
# Copy CI workflow templates (validate + stale checks)
105-
npx @tanstack/intent@latest setup-github-actions
104+
# Copy CI workflow templates (validate + stale checks)
105+
npx @tanstack/intent@latest setup
106106
```
107107

108108
**What these do:**
@@ -112,7 +112,7 @@ npx @tanstack/intent@latest setup-github-actions
112112
- `files` array entries for `skills/`
113113
- For single packages: also adds `!skills/_artifacts` to exclude artifacts from npm
114114
- For monorepos: skips the artifacts exclusion (artifacts live at repo root)
115-
- `setup-github-actions` copies workflow templates to `.github/workflows/` for automated validation and staleness checking
115+
- `setup` copies workflow templates to `.github/workflows/` for automated validation and staleness checking
116116

117117
### 5. Ship skills with your package
118118

@@ -135,24 +135,19 @@ Consumers who install your library automatically get the skills. They discover l
135135

136136
### 6. Set up CI workflows
137137

138-
After running `setup-github-actions`, you'll have three workflows in `.github/workflows/`:
138+
After running `setup`, you'll have two workflows in `.github/workflows/`:
139139

140140
**validate-skills.yml** (runs on PRs touching `skills/`)
141141
- Validates SKILL.md frontmatter and structure
142142
- Ensures files stay under 500 lines
143143
- Runs automatically on every pull request that modifies skills
144144

145-
**check-skills.yml** (runs on release or manual trigger)
146-
- Automatically detects stale skills after you publish a new release
147-
- Opens a review PR with an agent-friendly prompt
148-
- Requires you to copy the prompt into Claude Code, Cursor, or your agent to update skills
149-
150-
**notify-intent.yml** (runs on docs/source changes to main)
151-
- Sends a webhook to TanStack/intent when your docs or source change
152-
- Enables cross-library skill staleness tracking
153-
- Requires a fine-grained GitHub token (`INTENT_NOTIFY_TOKEN`) secret
154-
155-
### 7. Update stale skills
145+
**check-skills.yml** (runs on release or manual trigger)
146+
- Automatically detects stale skills and coverage gaps after you publish a new release
147+
- Opens one grouped review PR with an agent-friendly prompt
148+
- Requires you to copy the prompt into Claude Code, Cursor, or your agent to update skills
149+
150+
### 7. Update stale skills
156151

157152
When you publish a new release, `check-skills.yml` automatically opens a PR flagging skills that need review.
158153

@@ -162,11 +157,25 @@ Manually check which skills need updates with:
162157
npx @tanstack/intent@latest stale
163158
```
164159

165-
When run from a package, this checks that package's shipped skills. When run from a monorepo root, it checks the workspace packages that ship skills.
166-
167-
This detects:
168-
- **Version drift** — skill targets an older library version than currently installed
169-
- **New sources** — sources declared in frontmatter that weren't tracked before
160+
When run from a package, this checks that package's shipped skills. When run from a monorepo root, it checks workspace packages with skills and flags public workspace packages missing skill or `_artifacts` coverage.
161+
162+
This detects:
163+
- **Version drift** — skill targets an older library version than currently installed
164+
- **New sources** — sources declared in frontmatter that weren't tracked before
165+
- **Artifact drift**`_artifacts` entries that no longer match generated skills
166+
- **Missing package coverage** — public workspace packages not represented by generated skills or artifact coverage
167+
168+
If a public workspace package is intentionally out of scope for skills, record that decision in repo-root `_artifacts`:
169+
170+
```yaml
171+
coverage:
172+
ignored_packages:
173+
- '@tanstack/internal-tooling'
174+
- name: packages/devtools-fixture
175+
reason: test fixture only
176+
```
177+
178+
Private workspace packages are skipped automatically.
170179
171180
**To update stale skills:**
172181
1. Review the PR opened by `check-skills.yml`

docs/registry.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ npx @tanstack/intent@latest stale
5959
Flags skills whose source docs have changed since the skill was last updated.
6060

6161
```bash
62-
npx @tanstack/intent@latest setup-github-actions
62+
npx @tanstack/intent@latest setup
6363
```
6464

65-
Copies CI workflow templates into your repo so validation and staleness checks run on every push. Catch drift before it ships.
65+
Copies CI workflow templates into your repo so validation and staleness checks run in GitHub Actions. Catch drift before it ships.
6666

6767
## Requesting a library
6868

packages/intent/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ npx @tanstack/intent@latest stale
9090

9191
From a monorepo root, `intent stale` checks every workspace package that ships skills. To scope it to one package, pass a directory like `intent stale packages/router`.
9292

93-
Copy CI workflow templates into your repo so validation and staleness checks run on every push:
93+
Copy CI workflow templates into your repo so validation and staleness checks can run in GitHub Actions:
9494

9595
```bash
96-
npx @tanstack/intent@latest setup-github-actions
96+
npx @tanstack/intent@latest setup
9797
```
9898

9999
## Compatibility
@@ -108,14 +108,14 @@ npx @tanstack/intent@latest setup-github-actions
108108

109109
## Monorepos
110110

111-
- Run `npx @tanstack/intent@latest setup-github-actions` from either the repo root or a package directory. Intent detects the workspace root and writes workflows to the repo-level `.github/workflows/` directory.
112-
- Generated workflows are monorepo-aware: validation loops over workspace packages with skills, staleness checks run from the workspace root, and notify workflows watch package `src/` and docs paths.
111+
- Run `npx @tanstack/intent@latest setup` from either the repo root or a package directory. Intent detects the workspace root and writes workflows to the repo-level `.github/workflows/` directory.
112+
- Generated workflows are monorepo-aware: validation loops over workspace packages with skills, and staleness checks run from the workspace root.
113113
- Run `npx @tanstack/intent@latest validate packages/<pkg>/skills` from the repo root to validate one package without root-level packaging warnings.
114-
- Run `npx @tanstack/intent@latest stale` from the repo root to check all workspace packages with skills, or `intent stale packages/<pkg>` to check one package.
114+
- Run `npx @tanstack/intent@latest stale` from the repo root to check workspace packages with skills and public workspace packages missing skill or `_artifacts` coverage, or `intent stale packages/<pkg>` to check one package.
115115

116116
## Keeping skills current
117117

118-
The real risk with any derived artifact is staleness. `npx @tanstack/intent@latest stale` flags skills whose source docs have changed, and CI templates catch drift before it ships.
118+
The real risk with any derived artifact is staleness. `npx @tanstack/intent@latest stale` flags skills whose source docs have changed, generated skills that drift from `_artifacts`, and public workspace packages missing coverage. CI templates catch drift before it ships.
119119

120120
The feedback loop runs both directions. `npx @tanstack/intent@latest 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 package 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.
121121

@@ -129,7 +129,7 @@ The feedback loop runs both directions. `npx @tanstack/intent@latest feedback` l
129129
| `npx @tanstack/intent@latest meta` | List meta-skills for library maintainers |
130130
| `npx @tanstack/intent@latest scaffold` | Print the guided skill generation prompt |
131131
| `npx @tanstack/intent@latest validate [dir]` | Validate SKILL.md files |
132-
| `npx @tanstack/intent@latest setup-github-actions` | Copy CI templates into your repo |
132+
| `npx @tanstack/intent@latest setup` | Copy CI templates into your repo |
133133
| `npx @tanstack/intent@latest stale [dir] [--json]` | Check skills for version drift |
134134
| `npx @tanstack/intent@latest feedback` | Submit skill feedback |
135135

0 commit comments

Comments
 (0)