stackfit 0.0.0-stage → 0.1.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.
- package/CHANGELOG.md +10 -0
- package/LICENSE +21 -0
- package/README.md +185 -2
- package/bin/stackfit.mjs +125 -0
- package/package.json +43 -4
- package/schemas/project-config.schema.json +71 -0
- package/schemas/skill-sources.schema.json +97 -0
- package/schemas/stackfit.local.schema.json +132 -0
- package/schemas/stackfit.schema.json +110 -0
- package/src/audit.mjs +87 -0
- package/src/catalog.mjs +115 -0
- package/src/detect.mjs +110 -0
- package/src/projects.mjs +117 -0
- package/src/refresh.mjs +64 -0
- package/src/render.mjs +93 -0
- package/src/report.mjs +111 -0
- package/src/scaffold.mjs +88 -0
- package/src/sync.mjs +300 -0
- package/starter/.env.example +10 -0
- package/starter/README.md +12 -0
- package/starter/gitignore +4 -0
- package/starter/rules/defaults.mdc +11 -0
- package/starter/skill-sources.json +315 -0
- package/starter/skills/next-server-security/SKILL.md +63 -0
- package/starter/skills/playwright-e2e-testing/SKILL.md +34 -0
- package/starter/skills/stackfit/SKILL.md +121 -0
- package/starter/skills/stackfit/references/configuration.md +136 -0
- package/starter/skills/stackfit/references/recipes.md +182 -0
- package/starter/skills/stackfit/references/troubleshooting.md +37 -0
- package/starter/stackfit.json +171 -0
- package/starter/stackfit.local.example.json +20 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# stackfit configuration reference
|
|
2
|
+
|
|
3
|
+
All files are JSON. Schemas: `https://unpkg.com/stackfit/schemas/<name>.schema.json`.
|
|
4
|
+
|
|
5
|
+
## stackfit.json (catalog registry)
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"$schema": "https://unpkg.com/stackfit/schemas/stackfit.schema.json",
|
|
10
|
+
"schemaVersion": 3,
|
|
11
|
+
"projectConfigPath": "docs/agent/config.json",
|
|
12
|
+
"skills": ["grilling", "next-server-security", "shadcn", "my-checkout-rules"],
|
|
13
|
+
"packs": {
|
|
14
|
+
"core": { "description": "Every repo.", "always": true, "skills": ["grilling"] },
|
|
15
|
+
"nextjs": { "detect": { "dependencies": ["next"] }, "skills": ["next-server-security"] },
|
|
16
|
+
"shadcn": { "detect": { "files": ["components.json"] }, "skills": ["shadcn"] },
|
|
17
|
+
"shop": { "description": "Opt-in.", "skills": ["my-checkout-rules"] }
|
|
18
|
+
},
|
|
19
|
+
"adapters": {
|
|
20
|
+
"agents": ["reviewer.md"],
|
|
21
|
+
"commands": ["handoff.md"],
|
|
22
|
+
"rules": ["defaults.mdc"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- `skills`: the enabled catalog. A skill reaches a project only through a pack or a project's `skills` list.
|
|
28
|
+
- `packs.<name>.always`: every project gets it; cannot be excluded.
|
|
29
|
+
- `packs.<name>.detect.dependencies`: dependency names (case-insensitive) from `package.json` (all dependency fields), `requirements*.txt`, `pyproject.toml`, `go.mod` (module paths), `Cargo.toml`, `composer.json`.
|
|
30
|
+
- `packs.<name>.detect.files`: file or folder names present at the root, a top-level folder, or one level below it (`components.json`, `go.mod`, `release-please-config.json`).
|
|
31
|
+
- A pack with neither `always` nor `detect` is opt-in.
|
|
32
|
+
- `adapters`: files under `agents/`, `commands/`, `rules/` synced to every project.
|
|
33
|
+
|
|
34
|
+
## skill-sources.json (provenance and overrides)
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"schemaVersion": 2,
|
|
39
|
+
"skills": {
|
|
40
|
+
"my-checkout-rules": { "kind": "custom", "reviewed": "2026-10-26" },
|
|
41
|
+
"shadcn": {
|
|
42
|
+
"kind": "external",
|
|
43
|
+
"source": { "repository": "https://github.com/shadcn-ui/ui.git", "path": "skills/shadcn" },
|
|
44
|
+
"reviewed": "2026-10-26",
|
|
45
|
+
"render": {
|
|
46
|
+
"frontmatter": { "description": "Add, search, and style shadcn/ui components. Use with components.json." },
|
|
47
|
+
"exclude": ["evals/evals.json"]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- `kind`: `custom` (owned in the catalog) or `external` (vendored, refreshable).
|
|
55
|
+
- `source`: Git repository + folder holding `SKILL.md`. Required for `refresh`.
|
|
56
|
+
- `reviewed`: last date someone checked the skill is current and worth its context. `audit` warns after 180 days.
|
|
57
|
+
- `render.frontmatter`: replaces top-level SKILL.md frontmatter keys at sync time (`null` removes a key). Survives `refresh`. Typical: shorter `description`, `"disable-model-invocation": true`, `name` when the upstream folder name differs.
|
|
58
|
+
- `render.exclude`: skill-relative files never copied into projects (evals, READMEs, compiled `AGENTS.md` duplicates).
|
|
59
|
+
- `skill-sources.lock.json` (written by `refresh`): upstream commit of each vendored skill.
|
|
60
|
+
|
|
61
|
+
## docs/agent/config.json (per project, tracked)
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"schemaVersion": 1,
|
|
66
|
+
"packs": ["motion"],
|
|
67
|
+
"excludePacks": ["stripe"],
|
|
68
|
+
"skills": ["ui-ux-pro-max"],
|
|
69
|
+
"disabledSharedSkills": ["ponytail"],
|
|
70
|
+
"detect": true,
|
|
71
|
+
"overrides": { "skills": [], "agents": [], "commands": [], "rules": [] }
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
- `packs`: add packs (opt-in ones, or ones detection missed).
|
|
76
|
+
- `excludePacks`: drop detected packs (`core`/`always` packs stay).
|
|
77
|
+
- `skills`: add single catalog skills without their pack.
|
|
78
|
+
- `disabledSharedSkills`: remove single skills, applied last.
|
|
79
|
+
- `detect: false`: only `always` packs plus what is listed.
|
|
80
|
+
- `overrides.<kind>`: names of repo-owned components allowed to replace shared ones with the same name.
|
|
81
|
+
|
|
82
|
+
Repo-owned components (tracked in the project, synced next to shared ones):
|
|
83
|
+
- `docs/agent/skills/<name>/SKILL.md`
|
|
84
|
+
- `docs/agent/rules/<name>.md`: add `globs:` (becomes Claude `paths:`) or `alwaysApply: true`; otherwise it stays Cursor-only and is routed through `AGENTS.md`.
|
|
85
|
+
- `docs/agent/commands/<name>.md`, `docs/agent/agents/<name>.md`
|
|
86
|
+
|
|
87
|
+
## stackfit.local.json (per machine, gitignored)
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"schemaVersion": 1,
|
|
92
|
+
"machines": [
|
|
93
|
+
{
|
|
94
|
+
"id": "mac",
|
|
95
|
+
"match": { "platform": "darwin" },
|
|
96
|
+
"roots": ["~/code", "~/work"],
|
|
97
|
+
"projects": [
|
|
98
|
+
"shop-web",
|
|
99
|
+
{ "name": "client-site", "scaffold": false, "packs": ["motion"], "excludePacks": ["stripe"] }
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{ "id": "work-pc", "match": { "platform": "win32", "hostname": "WORK-PC" }, "roots": ["C:/dev"] }
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- `match.platform`: `darwin`, `win32`, or `linux`. `match.hostname` (optional) wins over platform-only entries.
|
|
108
|
+
- `roots`: absolute, `~/`, or relative to the catalog.
|
|
109
|
+
- `projects` (optional): only these folders under the roots. Without it, every Git repo directly under a root is synced.
|
|
110
|
+
- `scaffold: false`: adapter-only. stackfit never reads or creates the repo's `docs/agent/`, and keeps `CLAUDE.md` and `docs/agent/` git-excluded. Put that repo's pack choices here instead.
|
|
111
|
+
|
|
112
|
+
## Environment variables
|
|
113
|
+
|
|
114
|
+
| Variable | Purpose |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| `STACKFIT_CATALOG` | Catalog folder, so stackfit works from anywhere |
|
|
117
|
+
| `STACKFIT_LOCAL_CONFIG` | Another machine-profile file |
|
|
118
|
+
| `GITHUB_TOKEN` | Private repositories for `refresh` (sent as a header, never stored) |
|
|
119
|
+
| Anything else | Fills `{{env:NAME}}` in commands, rules, and agents |
|
|
120
|
+
|
|
121
|
+
Read from the shell, `./.env`, then the catalog's `.env`; shell values win. A missing variable prints a warning and leaves the placeholder.
|
|
122
|
+
|
|
123
|
+
## What gets written where
|
|
124
|
+
|
|
125
|
+
| Catalog item | Claude Code | Cursor | Codex |
|
|
126
|
+
| --- | --- | --- | --- |
|
|
127
|
+
| Skills | `.claude/skills` → `.agents/skills` | `.cursor/skills` → `.agents/skills` | `.agents/skills` |
|
|
128
|
+
| `alwaysApply` rule | `.claude/rules/<n>.md` | `.cursor/rules/<n>.mdc` | not auto-loaded; point to it from `AGENTS.md` |
|
|
129
|
+
| `globs` rule | `.claude/rules/<n>.md` with `paths:` | `.cursor/rules/<n>.mdc` | not auto-loaded |
|
|
130
|
+
| Description-only rule | not rendered | `.cursor/rules/<n>.mdc` | not auto-loaded |
|
|
131
|
+
| Command | `.claude/commands/<n>.md` (manual-only) | `.cursor/commands/<n>.md` | use a skill |
|
|
132
|
+
| Agent | `.claude/agents/<n>.md` (`model: inherit`) | `.cursor/agents/<n>.md` | n/a |
|
|
133
|
+
|
|
134
|
+
Links are symlinks on macOS/Linux and directory junctions on Windows (no admin rights needed).
|
|
135
|
+
|
|
136
|
+
Git: stackfit lists exactly the files it generates (plus `.agents/` and the two skill links) in a managed block in `.git/info/exclude`, so they never show up in `git status`, while the user's own files in `.claude/` or `.cursor/` stay visible. Files in `docs/agent/` are not excluded: commit them.
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# stackfit recipes
|
|
2
|
+
|
|
3
|
+
Each recipe lists the commands and files in order. Always run `status` before `sync` and show the user the result.
|
|
4
|
+
|
|
5
|
+
## 1. See what a repo loads, and why
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx stackfit report --project .
|
|
9
|
+
npx stackfit report --root ~/code # every Git repo directly under ~/code
|
|
10
|
+
npx stackfit report --all --json # machine profile, for scripts
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Explain each column:
|
|
14
|
+
- `skills` = skills this repo gets (catalog packs + its own `docs/agent/skills`).
|
|
15
|
+
- `skill listings` = estimated tokens of those skills' names + descriptions, loaded in every session (about 4 characters per token). Bodies load only when a skill is used; manual-only skills count 0.
|
|
16
|
+
- `rules` = always-on rules (Claude `.claude/rules` without `paths:`), loaded in full every session.
|
|
17
|
+
- `per session` = the two together.
|
|
18
|
+
- `packs` = why: each pack was `always`, detected, or requested.
|
|
19
|
+
- The `Global skills add ...` line is what `~/.claude/skills` and similar folders cost in every repo regardless of stackfit (`No global skill folders found` when there are none). Compare `per session` with it: that is the honest before/after once global copies are moved into the catalog. Note it before cleaning up globals.
|
|
20
|
+
|
|
21
|
+
If a pack looks wrong, find the signal: `grep -r '"<dependency>"' --include=package.json .` (or the matching manifest), or check for the marker file. Fix with recipe 4.
|
|
22
|
+
|
|
23
|
+
## 2. First-time setup
|
|
24
|
+
|
|
25
|
+
Follow "Set up stackfit for someone's repos" in SKILL.md (baseline → catalog → preview → write → machine profile → clean up globals → report). Extras:
|
|
26
|
+
|
|
27
|
+
- Keep the catalog in a private Git repo (`git init` in it, push it) so other machines and teammates can use it (recipes 5, 9).
|
|
28
|
+
- A catalog outside `~/.stackfit` is found via `--catalog <dir>`, `STACKFIT_CATALOG` (shell or `./.env`), or by running stackfit inside it.
|
|
29
|
+
- `npx stackfit init --project <repo>` adds a tracked `AGENTS.md`, `CLAUDE.md` (`@AGENTS.md`), and `docs/agent/` pages for repo-specific context. It never overwrites, but ask first: these are files the user will commit.
|
|
30
|
+
|
|
31
|
+
## 3. Migrate existing skills and rules into stackfit
|
|
32
|
+
|
|
33
|
+
Typical starting points: `~/.claude/skills/`, a repo's `.claude/skills/` or `.cursor/rules/`, an `.agents/skills/` folder from `npx skills add`.
|
|
34
|
+
|
|
35
|
+
1. Sort each item:
|
|
36
|
+
- Useful in many repos → catalog: `<catalog>/skills/<name>/SKILL.md` (or `rules/<name>.mdc`).
|
|
37
|
+
- Specific to one repo → that repo: `docs/agent/skills/<name>/SKILL.md` (or `docs/agent/rules/<name>.md`).
|
|
38
|
+
- Generic knowledge the model already has → suggest dropping it.
|
|
39
|
+
2. For catalog skills, copy the folder into `<catalog>/skills/<name>/` (copy, don't move: the global copy is handled by setup step 6), then register it:
|
|
40
|
+
- add the name to `skills` in `stackfit.json` and to a pack. Pick the pack by who needs it: an `always` pack (`core`) for every repo; a detect pack keyed on the base dependency for stack skills (`react` also covers Next.js repos, since they depend on `react`; use `next` only for Next-specific skills); an opt-in pack for occasional ones;
|
|
41
|
+
- in `skill-sources.json`: `{ "kind": "custom", "reviewed": "<today>" }` for the user's own skills. For one that came from GitHub, use `"kind": "external"` with its real `source` only if you can confirm it (the skill's README, metadata, or the user); never guess a repository path. If unknown, record it as `custom` with a `"note"` saying where it came from;
|
|
42
|
+
- `npx stackfit audit`.
|
|
43
|
+
3. Move or delete only the items you migrated, one at a time, after the user confirms:
|
|
44
|
+
```bash
|
|
45
|
+
mkdir -p <repo>/docs/agent/skills
|
|
46
|
+
mv <repo>/.claude/skills/<name> <repo>/docs/agent/skills/<name> # repo-specific skill
|
|
47
|
+
rmdir <repo>/.claude/skills 2>/dev/null # only if now empty
|
|
48
|
+
```
|
|
49
|
+
If `.claude/skills` was tracked in git, the user commits the move. Leave anything you did not migrate in place.
|
|
50
|
+
4. `npx stackfit status --project <repo>`, then `sync`.
|
|
51
|
+
|
|
52
|
+
Real example of the collision that step 3 prevents:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
stackfit: shop-web: unmanaged collision under .claude/skills: .claude/skills/my-own-skill/SKILL.md
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
After moving `my-own-skill` to `shop-web/docs/agent/skills/my-own-skill/`, the same sync succeeds and the skill appears next to the catalog ones in `.agents/skills/`.
|
|
59
|
+
|
|
60
|
+
Global skills in `~/.claude/skills/` still load in every repo. Once they are in the catalog, follow step 6 of the setup in SKILL.md (diff, check the pack reaches every repo that needs it, move to a backup folder). To keep a skill everywhere, put it in an `always` pack such as `core`.
|
|
61
|
+
|
|
62
|
+
## 4. Change what one repo gets
|
|
63
|
+
|
|
64
|
+
Tracked, shared with the team (`<repo>/docs/agent/config.json`):
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{ "schemaVersion": 1, "packs": ["motion"], "excludePacks": ["stripe"], "skills": ["ui-ux-pro-max"] }
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Local only, for repos you should not touch (on the project entry in `stackfit.local.json`):
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{ "name": "client-site", "scaffold": false, "packs": ["motion"], "excludePacks": ["stripe"] }
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Then `status` (removed skills show as `delete`, and their folders are pruned) and `sync`.
|
|
77
|
+
|
|
78
|
+
## 5. One or several machines
|
|
79
|
+
|
|
80
|
+
`stackfit.local.json` lives next to `stackfit.json` and is gitignored, so each computer has its own. Minimal, one machine:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{ "schemaVersion": 1, "machines": [ { "id": "laptop", "match": { "platform": "darwin" }, "roots": ["~/code"] } ] }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
- `platform`: `darwin`, `linux`, or `win32`. Add `"hostname": "WORK-PC"` to tell two machines with the same platform apart.
|
|
87
|
+
- Without `projects`, every Git repo directly under `roots` is included. With `projects`, only those folders (and each entry may carry `packs`, `excludePacks`, `skills`, `scaffold: false`).
|
|
88
|
+
- Don't copy `stackfit.local.example.json` unchanged: its sample project names won't exist and cause `Configured project ... not found`.
|
|
89
|
+
|
|
90
|
+
Several machines: put the catalog in a private Git repo, clone it on each, give each its own `stackfit.local.json`, then `npx stackfit sync --all`. Later `npx stackfit update --all` pulls the catalog and syncs (it refuses while the catalog has uncommitted changes).
|
|
91
|
+
|
|
92
|
+
## 6. Add a skill from GitHub
|
|
93
|
+
|
|
94
|
+
1. Find the folder holding its `SKILL.md`, for example `skills/react-best-practices` in `https://github.com/vercel-labs/agent-skills.git`.
|
|
95
|
+
2. In `skill-sources.json`:
|
|
96
|
+
```json
|
|
97
|
+
"vercel-react-best-practices": {
|
|
98
|
+
"kind": "external",
|
|
99
|
+
"source": { "repository": "https://github.com/vercel-labs/agent-skills.git", "path": "skills/react-best-practices" },
|
|
100
|
+
"reviewed": "2026-10-26",
|
|
101
|
+
"render": { "exclude": ["AGENTS.md", "README.md", "metadata.json"] }
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
If the upstream frontmatter `name` differs from the folder name you chose, add `"render": { "frontmatter": { "name": "<your-folder-name>" } }`.
|
|
105
|
+
3. Add the name to `skills` and to a pack in `stackfit.json`.
|
|
106
|
+
4. `npx stackfit refresh --skill vercel-react-best-practices`, then `audit`, then review the vendored files with the user before syncing.
|
|
107
|
+
|
|
108
|
+
Private repositories: set `GITHUB_TOKEN` in the shell or the catalog's `.env`.
|
|
109
|
+
|
|
110
|
+
## 7. Tame a long or noisy upstream skill
|
|
111
|
+
|
|
112
|
+
In `skill-sources.json`, under that skill:
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
"render": {
|
|
116
|
+
"frontmatter": {
|
|
117
|
+
"description": "One line on what it does. Use when <specific trigger>.",
|
|
118
|
+
"disable-model-invocation": true
|
|
119
|
+
},
|
|
120
|
+
"exclude": ["evals/evals.json"]
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- Shorter `description`: cheaper in every session; keep the trigger words.
|
|
125
|
+
- `disable-model-invocation: true`: costs nothing until the user calls it by name. Good for adoptions, migrations, releases.
|
|
126
|
+
- Overrides apply at sync time, so `refresh` never undoes them. Check the effect with `npx stackfit audit` (cost per pack).
|
|
127
|
+
|
|
128
|
+
## 8. Check it in CI
|
|
129
|
+
|
|
130
|
+
Generated files are never committed, so a fresh CI checkout has none of them, and `status --check` would always report changes there. In CI, check what *is* committed instead:
|
|
131
|
+
|
|
132
|
+
- **In each project's CI:** run `sync` against the pinned catalog. It exits 1 on real problems: an unknown pack or skill in `docs/agent/config.json`, a repo-owned skill clashing with a shared one, a malformed config.
|
|
133
|
+
- **In the catalog's CI:** run `audit`. It exits 1 on unknown or unvendored skills and broken adapters, and warns on stale or oversized ones.
|
|
134
|
+
|
|
135
|
+
GitHub Actions, project repo with a private catalog (store a read-only token as `CATALOG_TOKEN`):
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
- uses: actions/checkout@v5
|
|
139
|
+
- uses: actions/checkout@v5
|
|
140
|
+
with:
|
|
141
|
+
repository: your-org/agent-catalog
|
|
142
|
+
ref: v3 # pin a tag or commit so builds are reproducible
|
|
143
|
+
token: ${{ secrets.CATALOG_TOKEN }}
|
|
144
|
+
path: .stackfit-catalog
|
|
145
|
+
- uses: actions/setup-node@v5
|
|
146
|
+
with: { node-version: 22 }
|
|
147
|
+
- run: npx stackfit sync --project . --catalog .stackfit-catalog --quiet
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Catalog repo:
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
- uses: actions/checkout@v5
|
|
154
|
+
- uses: actions/setup-node@v5
|
|
155
|
+
with: { node-version: 22 }
|
|
156
|
+
- run: npx stackfit audit --catalog .
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`status --check` is for a developer's machine (for example before a release, or in a pre-push hook): exit 1 means the local generated files no longer match the catalog; `npx stackfit sync --project .` fixes it.
|
|
160
|
+
|
|
161
|
+
## 9. A team catalog
|
|
162
|
+
|
|
163
|
+
- One Git repo for the catalog; reviewers approve skill changes like code.
|
|
164
|
+
- Personal values stay out: use `{{env:NAME}}` in commands, rules, and agents, and document the names in the catalog's `.env.example`.
|
|
165
|
+
- `npx stackfit audit` in the catalog's CI catches unknown skills, missing sources, oversized descriptions, and skills not reviewed for 180 days.
|
|
166
|
+
- Everyone runs `npx stackfit update --all` to pull and sync.
|
|
167
|
+
|
|
168
|
+
## 10. Keep it lean over time
|
|
169
|
+
|
|
170
|
+
Quarterly, or when `audit` flags it:
|
|
171
|
+
1. `npx stackfit refresh --all` and review the diff.
|
|
172
|
+
2. Read anything `audit` calls stale; archive what no longer earns its context (move it to `skills/_archive/`, remove it from `stackfit.json` and `skill-sources.json`).
|
|
173
|
+
3. Update `reviewed` dates.
|
|
174
|
+
4. `npx stackfit report --all` and compare with last time.
|
|
175
|
+
|
|
176
|
+
## 11. Write a catalog skill that earns its place
|
|
177
|
+
|
|
178
|
+
- Only keep what a frontier model would otherwise get wrong: your conventions, a non-obvious workflow, version-specific framework behaviour, a tool's exact CLI. Generic knowledge costs context and adds nothing.
|
|
179
|
+
- `description` is what every session pays for: say what it does and exactly when to use it, in one or two sentences.
|
|
180
|
+
- Keep `SKILL.md` short; move long material into files it links to (loaded only when needed).
|
|
181
|
+
- Mark one-off workflows (migrations, adoptions, releases) `disable-model-invocation: true` so they cost nothing until called.
|
|
182
|
+
- Register it: `skills` + a pack in `stackfit.json`, `{ "kind": "custom", "reviewed": "<today>" }` in `skill-sources.json`, then `npx stackfit audit`.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# stackfit troubleshooting
|
|
2
|
+
|
|
3
|
+
Messages are printed as `stackfit: <message>` and exit with code 1.
|
|
4
|
+
|
|
5
|
+
| Message (start) | Cause | Fix |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| `No catalog found` | No `--catalog`, no `STACKFIT_CATALOG`, no `stackfit.json` above the current folder, no `~/.stackfit` | Expected on a first run. `npx stackfit catalog init` (own skills) or `--starter` (curated packs), or point at an existing catalog |
|
|
8
|
+
| `<repo>: unmanaged collision at <path>` / `under <path>` | A file stackfit did not create sits where it would write | Show the file to the user. Move it into the catalog or `docs/agent/` (recipes.md, recipe 3) and remove the old copy. Use `--force` only if the user confirms stackfit should take it over |
|
|
9
|
+
| `Skill '<name>' is enabled but not in the catalog` | Listed in `stackfit.json` but `skills/<name>/SKILL.md` is missing | `npx stackfit refresh --skill <name>` for external skills, or create the folder |
|
|
10
|
+
| `<repo>: unknown pack '<name>'` | Typo in `packs` / `excludePacks` | Use a pack name from `stackfit.json` |
|
|
11
|
+
| `<repo>: unknown shared skill '<name>'` | A project's `skills` lists something the catalog does not enable | Enable it in `stackfit.json`, or fix the name |
|
|
12
|
+
| `<repo>: repo-owned skill '<name>' conflicts with shared skills` | Same name in `docs/agent/skills/` and the catalog | Rename one, or add the name to `overrides.skills` in `docs/agent/config.json` to let the repo's version win |
|
|
13
|
+
| `Configured project '<name>' not found under machine roots` | `stackfit.local.json` lists a folder that is not there | Remove the entry or add the right root |
|
|
14
|
+
| `Machine '<id>' roots do not exist` | A root path is wrong on this machine | Fix `roots` for this machine |
|
|
15
|
+
| `No stackfit.local.json machine matches <platform> hostname=<host>` | No profile for this computer | Add a machine entry, or use `--root` / `--project` |
|
|
16
|
+
| `Choose --project <path>, --root <dir>, or --all` | No project selection given | Add one of them |
|
|
17
|
+
| `Catalog has local changes; commit or stash them before update` | `update` pulls with `--ff-only` | Commit or stash in the catalog, or use `sync` |
|
|
18
|
+
| `Could not clone <repo>` | No network to GitHub, private repo without token | Check network; set `GITHUB_TOKEN` for private repos |
|
|
19
|
+
| `<name> has no recorded upstream source` | `refresh` on a `custom` skill or one without `source` | Add `source` in `skill-sources.json`, or edit the skill directly |
|
|
20
|
+
| `warning: <file> uses {{env:NAME}} but NAME is not set` | Placeholder without a value | Add `NAME=...` to the catalog's `.env` (or the shell). The placeholder stays as-is until then |
|
|
21
|
+
|
|
22
|
+
## Audit warnings worth acting on
|
|
23
|
+
|
|
24
|
+
- `last reviewed <date> (<n> days ago)`: re-read the skill; refresh, shorten, or archive it, then update `reviewed`.
|
|
25
|
+
- `description is <n> chars`: shorten it with `render.frontmatter.description`; claude.ai rejects descriptions over 1024 characters.
|
|
26
|
+
- `enabled but in no pack`: it only reaches repos that list it under `skills`; add it to a pack or remove it.
|
|
27
|
+
- `external origin is not recorded`: add `source` so it can be refreshed.
|
|
28
|
+
|
|
29
|
+
## Behaviour that surprises people
|
|
30
|
+
|
|
31
|
+
- **Skills still load in a repo that should not have them.** Check `~/.claude/skills/` and other global folders: they apply to every repo regardless of stackfit.
|
|
32
|
+
- **A Claude rule does not load.** Rules with only a `description` are not rendered for Claude Code. Give them `alwaysApply: true` or `globs:`.
|
|
33
|
+
- **Codex ignores rules.** Codex reads `AGENTS.md` and `.agents/skills`, not rule files. Put must-follow rules in `AGENTS.md` or a skill.
|
|
34
|
+
- **Nothing in `git status` after a sync.** Expected: generated files are listed in a managed block in `.git/info/exclude`. Files you add under `docs/agent/` do show up and should be committed.
|
|
35
|
+
- **After upgrading to 0.1.1, new files appear in `git status` under `.claude/` or `.cursor/`.** Older versions excluded those whole folders; now only generated files are excluded. The newly visible files are the user's own: commit them or add them to `.gitignore`.
|
|
36
|
+
- **`status --check` fails in CI on a fresh checkout.** Generated files are never committed, so CI always sees them as missing. Use `sync` (validates config) in project CI and `audit` in catalog CI (recipe 8).
|
|
37
|
+
- **Project names look odd (for example `repo` in CI).** stackfit names a project after its folder.
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/stackfit/schemas/stackfit.schema.json",
|
|
3
|
+
"schemaVersion": 3,
|
|
4
|
+
"skills": [
|
|
5
|
+
"animation-vocabulary",
|
|
6
|
+
"apple-design",
|
|
7
|
+
"baseline-ui",
|
|
8
|
+
"emil-design-eng",
|
|
9
|
+
"fixing-accessibility",
|
|
10
|
+
"fixing-motion-performance",
|
|
11
|
+
"frontend-design",
|
|
12
|
+
"grilling",
|
|
13
|
+
"improve",
|
|
14
|
+
"improve-animations",
|
|
15
|
+
"interface-design",
|
|
16
|
+
"make-interfaces-feel-better",
|
|
17
|
+
"next-bundle-optimizer",
|
|
18
|
+
"next-cache-components-adoption",
|
|
19
|
+
"next-cache-components-optimizer",
|
|
20
|
+
"next-dev-loop",
|
|
21
|
+
"next-partial-prefetching-adoption",
|
|
22
|
+
"next-partial-prefetching-optimizer",
|
|
23
|
+
"next-server-security",
|
|
24
|
+
"playwright-e2e-testing",
|
|
25
|
+
"react-doctor",
|
|
26
|
+
"review-animations",
|
|
27
|
+
"shadcn",
|
|
28
|
+
"stackfit",
|
|
29
|
+
"stripe-best-practices",
|
|
30
|
+
"stripe-projects",
|
|
31
|
+
"ui-ux-pro-max",
|
|
32
|
+
"upgrade-stripe",
|
|
33
|
+
"vercel-composition-patterns",
|
|
34
|
+
"vercel-react-best-practices",
|
|
35
|
+
"vercel-react-view-transitions",
|
|
36
|
+
"web-design-guidelines"
|
|
37
|
+
],
|
|
38
|
+
"packs": {
|
|
39
|
+
"core": {
|
|
40
|
+
"description": "Every repository: managing this catalog, codebase review planning, decision grilling.",
|
|
41
|
+
"always": true,
|
|
42
|
+
"skills": [
|
|
43
|
+
"grilling",
|
|
44
|
+
"improve",
|
|
45
|
+
"stackfit"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"react": {
|
|
49
|
+
"description": "React performance, composition, and diagnostics.",
|
|
50
|
+
"detect": {
|
|
51
|
+
"dependencies": [
|
|
52
|
+
"react"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"skills": [
|
|
56
|
+
"react-doctor",
|
|
57
|
+
"vercel-composition-patterns",
|
|
58
|
+
"vercel-react-best-practices"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"nextjs": {
|
|
62
|
+
"description": "Next.js App Router: server security, runtime verification, bundle and navigation workflows (manual-only ones cost no context). Framework reference knowledge comes from node_modules/next/dist/docs (16.2+).",
|
|
63
|
+
"detect": {
|
|
64
|
+
"dependencies": [
|
|
65
|
+
"next"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
"skills": [
|
|
69
|
+
"next-bundle-optimizer",
|
|
70
|
+
"next-cache-components-adoption",
|
|
71
|
+
"next-cache-components-optimizer",
|
|
72
|
+
"next-dev-loop",
|
|
73
|
+
"next-partial-prefetching-adoption",
|
|
74
|
+
"next-partial-prefetching-optimizer",
|
|
75
|
+
"next-server-security",
|
|
76
|
+
"vercel-react-view-transitions"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"e2e": {
|
|
80
|
+
"description": "Playwright browser tests.",
|
|
81
|
+
"detect": {
|
|
82
|
+
"dependencies": [
|
|
83
|
+
"@playwright/test",
|
|
84
|
+
"playwright"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"skills": [
|
|
88
|
+
"playwright-e2e-testing"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"ui": {
|
|
92
|
+
"description": "Interface design, accessibility, and polish.",
|
|
93
|
+
"detect": {
|
|
94
|
+
"dependencies": [
|
|
95
|
+
"react-dom",
|
|
96
|
+
"vue",
|
|
97
|
+
"svelte",
|
|
98
|
+
"tailwindcss",
|
|
99
|
+
"@angular/core",
|
|
100
|
+
"solid-js"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"skills": [
|
|
104
|
+
"baseline-ui",
|
|
105
|
+
"fixing-accessibility",
|
|
106
|
+
"frontend-design",
|
|
107
|
+
"interface-design",
|
|
108
|
+
"make-interfaces-feel-better",
|
|
109
|
+
"web-design-guidelines"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"shadcn": {
|
|
113
|
+
"description": "shadcn/ui components and registries.",
|
|
114
|
+
"detect": {
|
|
115
|
+
"files": [
|
|
116
|
+
"components.json"
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
"skills": [
|
|
120
|
+
"shadcn"
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
"motion": {
|
|
124
|
+
"description": "Animation craft, review, and performance. Auto-detected from motion libraries; add it by hand for CSS-only motion work.",
|
|
125
|
+
"detect": {
|
|
126
|
+
"dependencies": [
|
|
127
|
+
"motion",
|
|
128
|
+
"framer-motion",
|
|
129
|
+
"gsap",
|
|
130
|
+
"@react-spring/web"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"skills": [
|
|
134
|
+
"animation-vocabulary",
|
|
135
|
+
"apple-design",
|
|
136
|
+
"emil-design-eng",
|
|
137
|
+
"fixing-motion-performance",
|
|
138
|
+
"improve-animations",
|
|
139
|
+
"review-animations"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"design-research": {
|
|
143
|
+
"description": "Large searchable UI/UX database (about 1.7 MB). Opt-in only.",
|
|
144
|
+
"skills": [
|
|
145
|
+
"ui-ux-pro-max"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"stripe": {
|
|
149
|
+
"description": "Stripe integrations and upgrades.",
|
|
150
|
+
"detect": {
|
|
151
|
+
"dependencies": [
|
|
152
|
+
"stripe",
|
|
153
|
+
"@stripe/stripe-js",
|
|
154
|
+
"@stripe/react-stripe-js"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
"skills": [
|
|
158
|
+
"stripe-best-practices",
|
|
159
|
+
"stripe-projects",
|
|
160
|
+
"upgrade-stripe"
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"adapters": {
|
|
165
|
+
"agents": [],
|
|
166
|
+
"commands": [],
|
|
167
|
+
"rules": [
|
|
168
|
+
"defaults.mdc"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/stackfit/schemas/stackfit.local.schema.json",
|
|
3
|
+
"schemaVersion": 1,
|
|
4
|
+
"machines": [
|
|
5
|
+
{
|
|
6
|
+
"id": "mac",
|
|
7
|
+
"match": { "platform": "darwin" },
|
|
8
|
+
"roots": ["~/code"],
|
|
9
|
+
"projects": [
|
|
10
|
+
"my-next-app",
|
|
11
|
+
{ "name": "client-site", "scaffold": false, "packs": ["motion"] }
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "windows",
|
|
16
|
+
"match": { "platform": "win32" },
|
|
17
|
+
"roots": ["C:/Users/you/code"]
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|