-
-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add compact skill resolution for install mappings #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 21 commits
0409018
8983f1c
44091b5
951c646
e90daaa
1269f41
b745316
c125e36
799bca2
7c7882c
1467d59
802428d
c8b395f
b6c9007
85ad196
360fd33
ee99caf
c580912
d193922
7e20e07
47a21a4
08a181d
c053ec8
88761d2
400c316
9a5224a
3b0ae0c
30d74f2
d1e0452
6f7aeb3
4e42356
f8523d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,33 +3,36 @@ title: intent list | |||||||||||||||||||||||||||||
| id: intent-list | ||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| `intent list` discovers skill-enabled packages and prints available skills. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||
| npx @tanstack/intent@latest list [--json] | ||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Options | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - `--json`: print JSON instead of text output | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## What you get | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - Scans project and workspace dependencies for intent-enabled packages and skills | ||||||||||||||||||||||||||||||
| - Intentionally includes accessible global packages when listing installed skills | ||||||||||||||||||||||||||||||
| - Includes warnings from discovery | ||||||||||||||||||||||||||||||
| - If no packages are discovered, prints `No intent-enabled packages found.` | ||||||||||||||||||||||||||||||
| - Summary line with package count, skill count, and detected package manager | ||||||||||||||||||||||||||||||
| - Package table columns: `PACKAGE`, `SOURCE`, `VERSION`, `SKILLS`, `REQUIRES` | ||||||||||||||||||||||||||||||
| `intent list` discovers skill-enabled packages and prints available skills. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||
| npx @tanstack/intent@latest list [--json] [--global] [--global-only] | ||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Options | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - `--json`: print JSON instead of text output | ||||||||||||||||||||||||||||||
| - `--global`: include global packages after project packages | ||||||||||||||||||||||||||||||
| - `--global-only`: list global packages only | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## What you get | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - Scans project and workspace dependencies for intent-enabled packages and skills | ||||||||||||||||||||||||||||||
| - Includes global packages only when `--global` or `--global-only` is passed | ||||||||||||||||||||||||||||||
| - Includes warnings from discovery | ||||||||||||||||||||||||||||||
| - If no packages are discovered, prints `No intent-enabled packages found.` | ||||||||||||||||||||||||||||||
| - Summary line with package count, skill count, and detected package manager | ||||||||||||||||||||||||||||||
| - Package table columns: `PACKAGE`, `SOURCE`, `VERSION`, `SKILLS`, `REQUIRES` | ||||||||||||||||||||||||||||||
| - Skill tree grouped by package | ||||||||||||||||||||||||||||||
| - Optional warnings section (`⚠ ...` per warning) | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| `REQUIRES` uses `intent.requires` values joined by `, `; empty values render as `–`. | ||||||||||||||||||||||||||||||
| `SOURCE` is a lightweight indicator showing whether the selected package came from local discovery or explicit global scanning. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## JSON output | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| `--json` prints the `ScanResult` object: | ||||||||||||||||||||||||||||||
| `REQUIRES` uses `intent.requires` values joined by `, `; empty values render as `–`. | ||||||||||||||||||||||||||||||
| `SOURCE` is a lightweight indicator showing whether the selected package came from local discovery or explicit global scanning. | ||||||||||||||||||||||||||||||
| When both local and global packages are scanned, local packages take precedence. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## JSON output | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| `--json` prints the `ScanResult` object: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ```json | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
|
|
@@ -55,16 +58,47 @@ npx @tanstack/intent@latest list [--json] | |||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||
| "warnings": ["string"] | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| `packages` are ordered using `intent.requires` when possible. When the same package exists both locally and globally, `intent list` prefers the local package. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Common errors | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - Scanner failures are printed as errors | ||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||
| "warnings": ["string"], | ||||||||||||||||||||||||||||||
| "conflicts": [ | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| "packageName": "string", | ||||||||||||||||||||||||||||||
| "chosen": { | ||||||||||||||||||||||||||||||
| "version": "string", | ||||||||||||||||||||||||||||||
| "packageRoot": "string" | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| "variants": [ | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| "version": "string", | ||||||||||||||||||||||||||||||
| "packageRoot": "string" | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||
| "nodeModules": { | ||||||||||||||||||||||||||||||
| "local": { | ||||||||||||||||||||||||||||||
| "path": "string", | ||||||||||||||||||||||||||||||
| "detected": true, | ||||||||||||||||||||||||||||||
| "exists": true, | ||||||||||||||||||||||||||||||
| "scanned": true | ||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
|
Comment on lines
+79
to
+85
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document
📝 Proposed fix "local": {
- "path": "string",
+ "path": "string | null",
"detected": true,
"exists": true,
"scanned": true📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| "global": { | ||||||||||||||||||||||||||||||
| "path": "string | null", | ||||||||||||||||||||||||||||||
| "detected": true, | ||||||||||||||||||||||||||||||
| "exists": true, | ||||||||||||||||||||||||||||||
| "scanned": false, | ||||||||||||||||||||||||||||||
| "source": "string (optional)" | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| `packages` are ordered using `intent.requires` when possible. | ||||||||||||||||||||||||||||||
| When the same package exists both locally and globally and global scanning is enabled, `intent list` prefers the local package. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ## Common errors | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - Scanner failures are printed as errors | ||||||||||||||||||||||||||||||
| - Unsupported environments: | ||||||||||||||||||||||||||||||
| - Yarn PnP without `node_modules` | ||||||||||||||||||||||||||||||
| - Deno projects without `node_modules` | ||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| --- | ||
| title: intent resolve | ||
| id: intent-resolve | ||
| --- | ||
|
|
||
| `intent resolve` resolves a compact skill identity to the skill file path reported by the current install. | ||
|
|
||
| ```bash | ||
| npx @tanstack/intent@latest resolve <package>#<skill> [--json] [--global] [--global-only] | ||
| ``` | ||
|
|
||
| ## Options | ||
|
|
||
| - `--json`: print structured JSON instead of only the path | ||
| - `--global`: resolve from project packages first, then global packages | ||
| - `--global-only`: resolve from global packages only | ||
|
|
||
| ## What you get | ||
|
|
||
| - Validates `<package>#<skill>` before scanning | ||
| - Scans project-local packages by default | ||
| - Includes global packages only when `--global` or `--global-only` is passed | ||
| - Prefers local packages when `--global` is used and the same package exists locally and globally | ||
| - Prints the resolved skill path by default | ||
| - Returns scanner-reported paths, including package-manager-internal paths for transitive installs | ||
|
|
||
| The package can be scoped or unscoped. The skill can include slash-separated sub-skill names. | ||
|
|
||
| Examples: | ||
|
|
||
| ```bash | ||
| npx @tanstack/intent@latest resolve @tanstack/query#fetching | ||
| npx @tanstack/intent@latest resolve @tanstack/query#core/fetching | ||
| npx @tanstack/intent@latest resolve some-lib#core | ||
| ``` | ||
|
|
||
| ## JSON output | ||
|
|
||
| `--json` prints: | ||
|
|
||
| ```json | ||
| { | ||
| "package": "@tanstack/query", | ||
| "skill": "fetching", | ||
| "path": "node_modules/@tanstack/query/skills/fetching/SKILL.md", | ||
| "source": "local", | ||
| "version": "5.0.0", | ||
| "warnings": [] | ||
| } | ||
| ``` | ||
|
|
||
| ## Common errors | ||
|
|
||
| - Missing separator: `Invalid skill use "@tanstack/query": expected <package>#<skill>.` | ||
| - Empty package: `Invalid skill use "#core": package is required.` | ||
| - Empty skill: `Invalid skill use "@tanstack/query#": skill is required.` | ||
| - Missing package: `Cannot resolve skill use "...": package "..." was not found.` | ||
| - Missing skill: `Cannot resolve skill use "...": skill "..." was not found in package "...".` | ||
|
|
||
| ## Related | ||
|
|
||
| - [intent list](./intent-list) | ||
| - [intent install](./intent-install) |
Uh oh!
There was an error while loading. Please reload this page.