Get started scaffolding, validating, and shipping skills for your library.
npm i -D @tanstack/intentpnpm add -D @tanstack/intentyarn add -D @tanstack/intentbun add -d @tanstack/intentOr run commands without installing:
npx @tanstack/intent@latest scaffoldStart the scaffolding process with your AI agent:
npx @tanstack/intent@latest scaffoldThis prints a comprehensive prompt that walks you and your agent through three phases:
Phase 1: Domain Discovery
Scans your documentation, source code, and GitHub issues
Conducts an interactive interview to surface implicit knowledge
Produces domain_map.yaml and skill_spec.md artifacts
Phase 2: Tree Generation
Designs a skill taxonomy based on the domain map
Creates a hierarchical skill structure
Produces skill_tree.yaml artifact
Phase 3: Skill Generation
Writes complete SKILL.md files for each skill
Includes patterns, failure modes, and API references
Validates against the Intent specification
Note
This is a context-heavy process that involves domain discovery, GitHub issues analysis, and interactive maintainer interviews. The agent will scan your documentation, recent issues and discussions, and ask targeted questions to surface implicit knowledge and common failure modes. The more information you provide about your library's patterns, pitfalls, and real-world usage problems, the better the generated skills will be. Expect multiple rounds of refinement and regular context compaction before completion.
After scaffolding, validate that all SKILL.md files are well-formed:
npx @tanstack/intent@latest validateThis checks:
Valid YAML frontmatter in every SKILL.md
Required fields (name, description) are present
Skill name is a leaf segment matching its parent directory
Intent-specific scalars (type, library, library_version, framework) live under metadata, not at the top level
Description length <= 1024 characters
Line count limits (500 lines max per skill)
Framework skills have a requires array
Artifact files exist and are non-empty
If any artifacts are present (domain_map.yaml, skill_spec.md, skill_tree.yaml), they must parse as valid YAML.
Commit both generated skills and the artifacts used to create them:
skills/
core/SKILL.md
react/SKILL.md
_artifacts/
domain_map.yaml
skill_spec.md
skill_tree.yamlArtifacts enforce a consistent skill structure across versions, making it easier to audit, refresh, or extend the skill set without starting from scratch.
Run these commands to prepare your package for skill publishing:
# Update package.json with required fields
npx @tanstack/intent@latest edit-package-json
# Copy the CI workflow template
npx @tanstack/intent@latest setupWhat these do:
edit-package-json adds:
setup copies check-skills.yml to .github/workflows/ for automated validation and staleness checking
setup does not overwrite existing workflow files. To pick up newer generated workflows, delete or move the old generated files in .github/workflows/, then rerun npx @tanstack/intent@latest setup.
If your repo already has an older generated validate-skills.yml, remove it after adopting the current check-skills.yml; PR validation now runs from check-skills.yml.
Skills ship inside your npm package. When you publish:
npm publishConsumers who install your library automatically get the skills. They discover local installed skills with intent list, add loading guidance with intent install, and load matching skills with intent load.
Version alignment:
Skills version with your library releases
Agents always load the skill matching the installed library version
No drift between code and guidance
After running setup, you'll have check-skills.yml in .github/workflows/:
check-skills.yml (runs on PRs touching skills/artifacts, release, or manual trigger)
Validates SKILL.md frontmatter and structure
Ensures files stay under 500 lines
Automatically detects stale skills and coverage gaps after you publish a new release
Opens one grouped review PR with an agent-friendly prompt
Includes the reason each skill or package was flagged
Requires you to copy the prompt into Claude Code, Cursor, or your agent to update skills
When you publish a new release, check-skills.yml automatically opens a PR flagging skills that need review.
Manually check which skills need updates with:
npx @tanstack/intent@latest staleWhen 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.
This detects:
Version drift — skill targets an older library version than currently installed
New sources — sources declared in frontmatter that weren't tracked before
Artifact drift — _artifacts entries that no longer match generated skills
Missing package coverage — public workspace packages not represented by generated skills or artifact coverage
If a public workspace package is intentionally out of scope for skills, record that decision in repo-root _artifacts:
coverage:
ignored_packages:
- '@tanstack/internal-tooling'
- name: packages/devtools-fixture
reason: test fixture onlyPrivate workspace packages are skipped automatically.
To update stale skills:
Review the PR opened by check-skills.yml
Copy the agent prompt from the PR description
Paste it into Claude Code, Cursor, or your coding agent
The agent reads the stale skills and updates them based on library changes
Run npx @tanstack/intent@latest validate locally to verify
Commit and merge the PR
Note
Skills are updated through agent assistance, not full automation. The workflow detects what's stale and provides the prompt — your agent handles the actual updates.
Use --json output for CI integration or scripting.
As your library evolves:
When APIs change: Update relevant SKILL.md files with new patterns
When docs change: Run intent stale to identify affected skills
When issues are filed: Check if the failure mode should be added to "Common Mistakes"
After major releases: Consider re-running domain discovery to catch new patterns
Tip
Create GitHub issue labels matching your skill names (skill:core, skill:react). When users file issues, tag them with the relevant skill label to track which areas need the most improvement.