@tanstack/intent 0.0.1

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.
Files changed (37) hide show
  1. package/README.md +66 -0
  2. package/dist/cli.d.mts +1 -0
  3. package/dist/cli.mjs +327 -0
  4. package/dist/feedback-DKreHfB1.mjs +300 -0
  5. package/dist/feedback-FIUBOL0g.mjs +3 -0
  6. package/dist/index.d.mts +61 -0
  7. package/dist/index.mjs +8 -0
  8. package/dist/init-DEzzXm9j.mjs +3 -0
  9. package/dist/init-DNxmjQfU.mjs +70 -0
  10. package/dist/intent-library.d.mts +1 -0
  11. package/dist/intent-library.mjs +123 -0
  12. package/dist/library-scanner-BrznE00j.mjs +111 -0
  13. package/dist/library-scanner.d.mts +16 -0
  14. package/dist/library-scanner.mjs +4 -0
  15. package/dist/scanner-BuWPDJ4P.mjs +4 -0
  16. package/dist/scanner-CpsJAHXT.mjs +147 -0
  17. package/dist/setup-CNGz26qL.mjs +116 -0
  18. package/dist/setup-N5dttGp_.d.mts +10 -0
  19. package/dist/setup.d.mts +2 -0
  20. package/dist/setup.mjs +3 -0
  21. package/dist/staleness-CnomT9Hm.mjs +72 -0
  22. package/dist/staleness-DyhsrqQ5.mjs +4 -0
  23. package/dist/types-kbQfN_is.d.mts +70 -0
  24. package/dist/utils-DjkEPBxu.mjs +39 -0
  25. package/meta/domain-discovery/SKILL.md +681 -0
  26. package/meta/generate-skill/SKILL.md +419 -0
  27. package/meta/skill-staleness-check/SKILL.md +282 -0
  28. package/meta/templates/oz/domain-discovery.md +53 -0
  29. package/meta/templates/oz/feedback-collection.md +69 -0
  30. package/meta/templates/oz/skill-update.md +47 -0
  31. package/meta/templates/oz/tree-generation.md +48 -0
  32. package/meta/templates/workflows/generate-skills-oz.yml +86 -0
  33. package/meta/templates/workflows/notify-playbooks.yml +52 -0
  34. package/meta/templates/workflows/update-skills-oz.yml +98 -0
  35. package/meta/templates/workflows/validate-skills.yml +52 -0
  36. package/meta/tree-generator/SKILL.md +859 -0
  37. package/package.json +38 -0
@@ -0,0 +1,53 @@
1
+ # Oz Prompt: Domain Discovery
2
+
3
+ Use this prompt with `oz agent run` (local) or `warpdotdev/oz-agent-action` (CI)
4
+ to run domain discovery for a library.
5
+
6
+ ## Usage
7
+
8
+ ### Local (interactive — includes maintainer interview)
9
+
10
+ ```bash
11
+ oz agent run --prompt "$(cat this-file.md)"
12
+ ```
13
+
14
+ ### CI (compressed — skips interview phases)
15
+
16
+ Use the `generate-skills-oz.yml` workflow template instead.
17
+
18
+ ---
19
+
20
+ ## Prompt
21
+
22
+ Read the meta-skill at `node_modules/@tanstack/intent/meta/domain-discovery/SKILL.md`
23
+ and follow its instructions for the library described below.
24
+
25
+ ### Library details
26
+
27
+ - **Package:** [PACKAGE_NAME]
28
+ - **Repository:** [REPO_URL]
29
+ - **Docs path:** [DOCS_PATH]
30
+ - **Primary framework:** [react | vue | solid | svelte | framework-agnostic]
31
+
32
+ ### Instructions
33
+
34
+ Run the full 5-phase domain discovery process:
35
+
36
+ 1. **Phase 1 — Quick scan:** Orient yourself in the library
37
+ 2. **Phase 2 — High-level interview:** Ask the maintainer about developer tasks
38
+ 3. **Phase 3 — Deep read:** Read docs and source, build concept inventory
39
+ 4. **Phase 4 — Detail interview:** Fill gaps with targeted questions
40
+ 5. **Phase 5 — Finalize:** Produce domain_map.yaml and skill_spec.md
41
+
42
+ Write the output artifacts to the repository root:
43
+
44
+ - `domain_map.yaml`
45
+ - `skill_spec.md`
46
+
47
+ ### After completion
48
+
49
+ Tell the user:
50
+
51
+ - "Domain discovery complete. Artifacts written to domain_map.yaml and skill_spec.md."
52
+ - "Next step: load the tree-generator meta-skill to generate SKILL.md files."
53
+ - "Run `npx intent feedback --meta --interactive` to share how this went."
@@ -0,0 +1,69 @@
1
+ # Oz Prompt: Meta-Skill Feedback Collection
2
+
3
+ Use this prompt to collect structured feedback about the meta-skill experience
4
+ and submit it to TanStack/intent.
5
+
6
+ ---
7
+
8
+ ## Prompt
9
+
10
+ You are collecting feedback about the TanStack Intent meta-skill experience.
11
+ The user just ran one or more meta-skills (domain-discovery, tree-generator,
12
+ generate-skill, or skill-staleness-check) and you need to capture what worked
13
+ and what didn't.
14
+
15
+ ### Questions to ask
16
+
17
+ Walk through these questions one at a time:
18
+
19
+ 1. **Which meta-skill(s) did you use?**
20
+ (domain-discovery, tree-generator, generate-skill, skill-staleness-check)
21
+
22
+ 2. **What library were you generating skills for?**
23
+ (package name and version)
24
+
25
+ 3. **Which AI agent ran the meta-skill?**
26
+ (oz, claude-code, cursor, copilot, codex, other)
27
+
28
+ 4. **How would you rate the generated artifacts?**
29
+ (good / mixed / bad)
30
+ - If domain-discovery: How were the interview questions? Did they surface
31
+ the right failure modes and domain structure?
32
+ - If tree-generator: Were the generated SKILL.md files usable? Did the
33
+ structure match your library?
34
+ - If generate-skill: Was the individual skill accurate and complete?
35
+
36
+ 5. **What worked well?**
37
+ (free text — what the meta-skill got right)
38
+
39
+ 6. **What failed or was inaccurate?**
40
+ (free text — what the agent got wrong, what needed manual fixing)
41
+
42
+ 7. **What's missing?**
43
+ (free text — suggestions for improving the meta-skill instructions)
44
+
45
+ 8. **Overall rating:** good / mixed / bad
46
+
47
+ ### After collecting answers
48
+
49
+ 1. Format the feedback as JSON matching the MetaFeedbackPayload schema:
50
+
51
+ ```json
52
+ {
53
+ "metaSkill": "domain-discovery",
54
+ "library": "@tanstack/query",
55
+ "agentUsed": "oz",
56
+ "artifactQuality": "good",
57
+ "interviewQuality": "mixed",
58
+ "failureModeQuality": "good",
59
+ "whatWorked": "...",
60
+ "whatFailed": "...",
61
+ "suggestions": "...",
62
+ "userRating": "mixed"
63
+ }
64
+ ```
65
+
66
+ 2. Save to `intent-meta-feedback.json`
67
+ 3. Run: `npx intent feedback --meta --file intent-meta-feedback.json`
68
+ 4. If `gh` CLI is available, this submits directly to TanStack/intent.
69
+ Otherwise, it saves a markdown file the user can paste into a GitHub Discussion.
@@ -0,0 +1,47 @@
1
+ # Oz Prompt: Skill Update (Staleness Check)
2
+
3
+ Use this prompt to check existing skills for staleness after a library
4
+ version change and surgically update any that are outdated.
5
+
6
+ ## Prerequisites
7
+
8
+ - Existing skills in `skills/` directory
9
+ - `@tanstack/intent` installed
10
+
11
+ ---
12
+
13
+ ## Prompt
14
+
15
+ Read the meta-skill at `node_modules/@tanstack/intent/meta/skill-staleness-check/SKILL.md`
16
+ and follow its instructions.
17
+
18
+ ### Context
19
+
20
+ - **Package:** [PACKAGE_NAME]
21
+ - **Previous version:** [OLD_VERSION] (check skill frontmatter `library_version`)
22
+ - **Current version:** [NEW_VERSION]
23
+ - **Changelog:** [CHANGELOG_PATH or URL]
24
+
25
+ ### Task
26
+
27
+ 1. Find all SKILL.md files under skills/
28
+ 2. Compare each skill's `library_version` against the current version
29
+ 3. Read the changelog/migration guide for changes between versions
30
+ 4. For each skill, classify the impact: no-impact, version-bump, content-update, breaking
31
+ 5. For content updates and breaking changes:
32
+ - Read the generate-skill meta-skill at
33
+ `node_modules/@tanstack/intent/meta/generate-skill/SKILL.md`
34
+ - Use regeneration mode — surgical updates, not full rewrites
35
+ - Add old patterns as new Common Mistake entries for breaking changes
36
+ 6. Bump `library_version` in all updated skill frontmatter
37
+ 7. Run `npx intent validate skills/` to verify
38
+
39
+ ### Output
40
+
41
+ If nothing needs updating, say so and exit.
42
+
43
+ If skills were updated, summarize:
44
+
45
+ - Which skills were updated and why
46
+ - What sections changed
47
+ - Any new Common Mistake entries added
@@ -0,0 +1,48 @@
1
+ # Oz Prompt: Tree Generation
2
+
3
+ Use this prompt with `oz agent run` (local) or `warpdotdev/oz-agent-action` (CI)
4
+ to generate a complete skill tree from domain discovery artifacts.
5
+
6
+ ## Prerequisites
7
+
8
+ - `domain_map.yaml` and `skill_spec.md` in the repo (from domain discovery)
9
+ - `@tanstack/intent` installed
10
+
11
+ ---
12
+
13
+ ## Prompt
14
+
15
+ Read the meta-skill at `node_modules/@tanstack/intent/meta/tree-generator/SKILL.md`
16
+ and follow Workflow A (Generate) instructions.
17
+
18
+ ### Inputs
19
+
20
+ - `domain_map.yaml` — in the repository root
21
+ - `skill_spec.md` — in the repository root
22
+ - Library source documentation is at [DOCS_PATH]
23
+
24
+ ### Task
25
+
26
+ 1. Read domain_map.yaml and skill_spec.md
27
+ 2. Plan the file tree based on the skill inventory
28
+ 3. Generate all SKILL.md files following the tree-generator spec
29
+ 4. Write files under `skills/` in the appropriate package directory
30
+ 5. Run `npx intent validate skills/` to verify all files pass
31
+ 6. Fix any validation errors
32
+
33
+ ### Output structure
34
+
35
+ Write skills following the structure recommended in the domain map.
36
+ Ensure every skill from domain_map.yaml has a corresponding SKILL.md file.
37
+
38
+ ### After completion
39
+
40
+ Tell the user:
41
+
42
+ - "Skill tree generated. [N] skills written to skills/."
43
+ - "Validation: [PASS/FAIL with details]"
44
+ - "Next steps:"
45
+ - "1. Review the generated skills for accuracy"
46
+ - "2. Add `\"skills\"` to your package.json `files` array"
47
+ - "3. Add the `intent` field to your package.json"
48
+ - "4. Run `npx intent feedback --meta --interactive` to share how this went"
@@ -0,0 +1,86 @@
1
+ # generate-skills-oz.yml — Drop this into your library repo's .github/workflows/
2
+ #
3
+ # Manual-trigger workflow that runs domain-discovery + tree-generator via
4
+ # Warp Oz to generate a complete skill tree for your library.
5
+ #
6
+ # Requirements:
7
+ # - WARP_API_KEY repository secret (from Warp Settings > Platform)
8
+ #
9
+ # Template variables (replaced by `intent setup`):
10
+ # {{PACKAGE_NAME}} — e.g. @tanstack/query
11
+ # {{REPO}} — e.g. TanStack/query
12
+ # {{DOCS_PATH}} — e.g. docs/
13
+
14
+ name: Generate Skills (Oz)
15
+
16
+ on:
17
+ workflow_dispatch:
18
+ inputs:
19
+ docs_path:
20
+ description: 'Path to library docs (default from intent config)'
21
+ required: false
22
+ default: '{{DOCS_PATH}}'
23
+ type: string
24
+ skip_interview:
25
+ description: 'Skip maintainer interview (compressed discovery)'
26
+ required: false
27
+ default: false
28
+ type: boolean
29
+
30
+ permissions:
31
+ contents: write
32
+ pull-requests: write
33
+
34
+ jobs:
35
+ generate:
36
+ name: Generate skill tree
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - name: Checkout
40
+ uses: actions/checkout@v4
41
+ with:
42
+ fetch-depth: 0
43
+
44
+ - name: Setup Node
45
+ uses: actions/setup-node@v4
46
+ with:
47
+ node-version: 20
48
+
49
+ - name: Install dependencies
50
+ run: npm install @tanstack/intent yaml
51
+
52
+ - name: Run Oz agent
53
+ uses: warpdotdev/oz-agent-action@v1
54
+ with:
55
+ prompt: |
56
+ You are generating AI coding agent skills for {{PACKAGE_NAME}}.
57
+
58
+ ## Setup
59
+
60
+ 1. Read the meta-skill at node_modules/@tanstack/intent/meta/domain-discovery/SKILL.md
61
+ 2. The library source is in this repo at {{DOCS_PATH}}
62
+ 3. The package name is {{PACKAGE_NAME}} and the repo is {{REPO}}
63
+
64
+ ## Task
65
+
66
+ Run the domain-discovery skill to produce domain_map.yaml and skill_spec.md.
67
+ Since this is a CI run with no interactive maintainer, use compressed
68
+ discovery mode (Phase 1 + Phase 3 only — skip interview phases).
69
+
70
+ After producing the domain map, read the meta-skill at
71
+ node_modules/@tanstack/intent/meta/tree-generator/SKILL.md and
72
+ run Workflow A to generate the complete skill tree under skills/.
73
+
74
+ ## Output
75
+
76
+ 1. Write domain_map.yaml and skill_spec.md to the repo root
77
+ 2. Write generated SKILL.md files under the appropriate skills/ directory
78
+ 3. Run `npx intent validate skills/` to verify all files pass
79
+ 4. Create a branch `skills/generate-{{PACKAGE_NAME}}` and open a PR with:
80
+ - Title: "feat: generate intent skills for {{PACKAGE_NAME}}"
81
+ - Body summarizing what was generated and any gaps flagged
82
+ - Co-Authored-By: Oz <oz-agent@warp.dev>
83
+
84
+ If validation fails, fix the issues before opening the PR.
85
+ warp_api_key: ${{ secrets.WARP_API_KEY }}
86
+ profile: ${{ vars.WARP_AGENT_PROFILE || '' }}
@@ -0,0 +1,52 @@
1
+ # notify-intent.yml — Drop this into your library repo's .github/workflows/
2
+ #
3
+ # Fires a repository_dispatch event to TanStack/intent whenever docs or
4
+ # source files change on merge to main. This triggers the skill staleness
5
+ # check workflow in the intent repo.
6
+ #
7
+ # Requirements:
8
+ # - A fine-grained PAT with contents:write on TanStack/intent stored
9
+ # as the INTENT_NOTIFY_TOKEN repository secret.
10
+ #
11
+ # Template variables (replaced by `intent setup`):
12
+ # {{PACKAGE_NAME}} — e.g. @tanstack/query
13
+ # {{DOCS_PATH}} — e.g. docs/**
14
+ # {{SRC_PATH}} — e.g. packages/query-core/src/**
15
+
16
+ name: Notify Intent
17
+
18
+ on:
19
+ push:
20
+ branches: [main]
21
+ paths:
22
+ - '{{DOCS_PATH}}'
23
+ - '{{SRC_PATH}}'
24
+
25
+ jobs:
26
+ notify:
27
+ name: Notify TanStack Intent
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - name: Checkout
31
+ uses: actions/checkout@v4
32
+ with:
33
+ fetch-depth: 2
34
+
35
+ - name: Collect changed files
36
+ id: changes
37
+ run: |
38
+ FILES=$(git diff --name-only HEAD~1 HEAD | jq -R -s -c 'split("\n") | map(select(length > 0))')
39
+ echo "files=$FILES" >> "$GITHUB_OUTPUT"
40
+
41
+ - name: Dispatch to intent repo
42
+ uses: peter-evans/repository-dispatch@v3
43
+ with:
44
+ token: ${{ secrets.INTENT_NOTIFY_TOKEN }}
45
+ repository: TanStack/intent
46
+ event-type: skill-check
47
+ client-payload: |
48
+ {
49
+ "package": "{{PACKAGE_NAME}}",
50
+ "sha": "${{ github.sha }}",
51
+ "changed_files": ${{ steps.changes.outputs.files }}
52
+ }
@@ -0,0 +1,98 @@
1
+ # update-skills-oz.yml — Drop this into your library repo's .github/workflows/
2
+ #
3
+ # Triggered on new version releases. Oz evaluates whether skills need
4
+ # updating based on changelog/migration guide changes, and opens PRs
5
+ # for any stale skills.
6
+ #
7
+ # Requirements:
8
+ # - WARP_API_KEY repository secret
9
+ # - Skills must already exist in the repo (run generate-skills-oz first)
10
+ #
11
+ # Template variables (replaced by `intent setup`):
12
+ # {{PACKAGE_NAME}} — e.g. @tanstack/query
13
+ # {{REPO}} — e.g. TanStack/query
14
+
15
+ name: Update Skills (Oz)
16
+
17
+ on:
18
+ release:
19
+ types: [published]
20
+
21
+ # Manual trigger for testing
22
+ workflow_dispatch:
23
+ inputs:
24
+ version:
25
+ description: 'Version to check against (e.g. 5.62.0)'
26
+ required: false
27
+ type: string
28
+
29
+ permissions:
30
+ contents: write
31
+ pull-requests: write
32
+
33
+ jobs:
34
+ update:
35
+ name: Check and update skills
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - name: Checkout
39
+ uses: actions/checkout@v4
40
+ with:
41
+ fetch-depth: 0
42
+
43
+ - name: Setup Node
44
+ uses: actions/setup-node@v4
45
+ with:
46
+ node-version: 20
47
+
48
+ - name: Install dependencies
49
+ run: npm install @tanstack/intent yaml
50
+
51
+ - name: Determine version
52
+ id: version
53
+ run: |
54
+ if [ -n "${{ inputs.version }}" ]; then
55
+ echo "version=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
56
+ else
57
+ echo "version=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
58
+ fi
59
+
60
+ - name: Run Oz agent
61
+ uses: warpdotdev/oz-agent-action@v1
62
+ with:
63
+ prompt: |
64
+ You are checking whether AI coding agent skills for {{PACKAGE_NAME}}
65
+ need updating after a new release.
66
+
67
+ ## Setup
68
+
69
+ 1. Read the meta-skill at node_modules/@tanstack/intent/meta/skill-staleness-check/SKILL.md
70
+ 2. The package is {{PACKAGE_NAME}} in repo {{REPO}}
71
+ 3. The new version is ${{ steps.version.outputs.version }}
72
+
73
+ ## Task
74
+
75
+ Follow the staleness check skill instructions:
76
+
77
+ 1. Find all SKILL.md files under skills/ in this repo
78
+ 2. Compare each skill's library_version against the new version
79
+ 3. Read the CHANGELOG or migration guide for changes between versions
80
+ 4. Classify each skill: no-impact, version-bump-only, content-update, or breaking-change
81
+ 5. For skills needing updates, read the generate-skill meta-skill at
82
+ node_modules/@tanstack/intent/meta/generate-skill/SKILL.md and
83
+ use regeneration mode (surgical updates, not full rewrites)
84
+
85
+ ## Output
86
+
87
+ If no skills need updating, exit silently — no PR, no noise.
88
+
89
+ If skills need updating:
90
+ 1. Update the affected SKILL.md files
91
+ 2. Run `npx intent validate skills/` to verify
92
+ 3. Create branch `skills/update-${{ steps.version.outputs.version }}`
93
+ 4. Open a PR with:
94
+ - Title: "skill: update for {{PACKAGE_NAME}}@${{ steps.version.outputs.version }}"
95
+ - Body with: what changed in the source, what changed in skills, review checklist
96
+ - Co-Authored-By: Oz <oz-agent@warp.dev>
97
+ warp_api_key: ${{ secrets.WARP_API_KEY }}
98
+ profile: ${{ vars.WARP_AGENT_PROFILE || '' }}
@@ -0,0 +1,52 @@
1
+ # validate-skills.yml — Drop this into your library repo's .github/workflows/
2
+ #
3
+ # Validates skill files on PRs that touch the skills/ directory.
4
+ # Ensures frontmatter is correct, names match paths, and files stay under
5
+ # the 500-line limit.
6
+
7
+ name: Validate Skills
8
+
9
+ on:
10
+ pull_request:
11
+ paths:
12
+ - 'skills/**'
13
+ - '**/skills/**'
14
+
15
+ jobs:
16
+ validate:
17
+ name: Validate skill files
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - name: Checkout
21
+ uses: actions/checkout@v4
22
+
23
+ - name: Setup Node
24
+ uses: actions/setup-node@v4
25
+ with:
26
+ node-version: 20
27
+
28
+ - name: Install intent CLI
29
+ run: npm install -g @tanstack/intent
30
+
31
+ - name: Find and validate skills
32
+ run: |
33
+ # Find all directories containing SKILL.md files
34
+ SKILLS_DIR=""
35
+ if [ -d "skills" ]; then
36
+ SKILLS_DIR="skills"
37
+ elif [ -d "packages" ]; then
38
+ # Monorepo — find skills/ under packages
39
+ for dir in packages/*/skills; do
40
+ if [ -d "$dir" ]; then
41
+ echo "Validating $dir..."
42
+ intent validate "$dir"
43
+ fi
44
+ done
45
+ exit 0
46
+ fi
47
+
48
+ if [ -n "$SKILLS_DIR" ]; then
49
+ intent validate "$SKILLS_DIR"
50
+ else
51
+ echo "No skills/ directory found — skipping validation."
52
+ fi