@erclx/aitk 0.8.0
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/LICENSE +21 -0
- package/README.md +99 -0
- package/claude/.claude-plugin/plugin.json +19 -0
- package/claude/skills/bash-script/SKILL.md +96 -0
- package/claude/skills/bash-script/references/patterns.md +349 -0
- package/claude/skills/ci-workflow/SKILL.md +52 -0
- package/claude/skills/ci-workflow/references/workflows.md +74 -0
- package/claude/skills/claude-address-review/SKILL.md +107 -0
- package/claude/skills/claude-autoship/SKILL.md +137 -0
- package/claude/skills/claude-design-extract/SKILL.md +69 -0
- package/claude/skills/claude-design-propose/SKILL.md +75 -0
- package/claude/skills/claude-diagram/SKILL.md +126 -0
- package/claude/skills/claude-docs/SKILL.md +204 -0
- package/claude/skills/claude-feature/REQUIREMENT.md +35 -0
- package/claude/skills/claude-feature/SKILL.md +148 -0
- package/claude/skills/claude-groundwork/SKILL.md +148 -0
- package/claude/skills/claude-groundwork/references/folder-format.md +107 -0
- package/claude/skills/claude-memory-capture/SKILL.md +80 -0
- package/claude/skills/claude-memory-review/REQUIREMENT.md +37 -0
- package/claude/skills/claude-memory-review/SKILL.md +206 -0
- package/claude/skills/claude-orchestrate/SKILL.md +125 -0
- package/claude/skills/claude-pr-review/SKILL.md +150 -0
- package/claude/skills/claude-review/SKILL.md +136 -0
- package/claude/skills/claude-roadmap/SKILL.md +61 -0
- package/claude/skills/claude-roadmap/references/roadmap.md +52 -0
- package/claude/skills/claude-screencast/SKILL.md +160 -0
- package/claude/skills/claude-seed-sync/SKILL.md +141 -0
- package/claude/skills/claude-slides-draft/SKILL.md +62 -0
- package/claude/skills/claude-standards-audit/REQUIREMENT.md +33 -0
- package/claude/skills/claude-standards-audit/SKILL.md +79 -0
- package/claude/skills/claude-standards-audit/references/branch.md +49 -0
- package/claude/skills/claude-standards-audit/references/pr.md +124 -0
- package/claude/skills/claude-tasks/SKILL.md +123 -0
- package/claude/skills/claude-ui-test/SKILL.md +75 -0
- package/claude/skills/claude-ux-audit/SKILL.md +78 -0
- package/claude/skills/claude-worktree/SKILL.md +79 -0
- package/claude/skills/cli-script/SKILL.md +47 -0
- package/claude/skills/cli-script/references/template.md +43 -0
- package/claude/skills/create-rule/SKILL.md +68 -0
- package/claude/skills/create-skill/REQUIREMENT.md +30 -0
- package/claude/skills/create-skill/SKILL.md +24 -0
- package/claude/skills/create-snippet/SKILL.md +28 -0
- package/claude/skills/create-snippet/references/snippets.md +57 -0
- package/claude/skills/create-standard/SKILL.md +31 -0
- package/claude/skills/create-standard/references/standard.md +52 -0
- package/claude/skills/docs-sync/SKILL.md +87 -0
- package/claude/skills/git-branch/REQUIREMENT.md +38 -0
- package/claude/skills/git-branch/SKILL.md +60 -0
- package/claude/skills/git-branch/references/branch.md +49 -0
- package/claude/skills/git-commit/REQUIREMENT.md +33 -0
- package/claude/skills/git-commit/SKILL.md +51 -0
- package/claude/skills/git-commit/references/commit.md +63 -0
- package/claude/skills/git-followup/REQUIREMENT.md +38 -0
- package/claude/skills/git-followup/SKILL.md +35 -0
- package/claude/skills/git-issue/REQUIREMENT.md +38 -0
- package/claude/skills/git-issue/SKILL.md +69 -0
- package/claude/skills/git-issue/references/issue.md +84 -0
- package/claude/skills/git-pr/REQUIREMENT.md +37 -0
- package/claude/skills/git-pr/SKILL.md +119 -0
- package/claude/skills/git-pr/references/branch.md +49 -0
- package/claude/skills/git-pr/references/pr.md +124 -0
- package/claude/skills/git-ship/REQUIREMENT.md +34 -0
- package/claude/skills/git-ship/SKILL.md +39 -0
- package/claude/skills/git-split/REQUIREMENT.md +38 -0
- package/claude/skills/git-split/SKILL.md +160 -0
- package/claude/skills/git-split/references/branch.md +49 -0
- package/claude/skills/git-split/references/pr.md +124 -0
- package/claude/skills/git-stage/REQUIREMENT.md +36 -0
- package/claude/skills/git-stage/SKILL.md +74 -0
- package/claude/skills/git-stage/references/commit.md +63 -0
- package/claude/skills/git-worktree/REQUIREMENT.md +37 -0
- package/claude/skills/git-worktree/SKILL.md +120 -0
- package/claude/skills/migration-claude-md/SKILL.md +74 -0
- package/claude/skills/migration-context/SKILL.md +93 -0
- package/claude/skills/migration-standards/SKILL.md +75 -0
- package/claude/skills/project-commands/SKILL.md +73 -0
- package/claude/skills/session-resume/SKILL.md +36 -0
- package/claude/skills/setup-gov/SKILL.md +71 -0
- package/claude/skills/setup-indexes/SKILL.md +148 -0
- package/claude/skills/setup-init/SKILL.md +114 -0
- package/claude/skills/setup-plugins/SKILL.md +81 -0
- package/claude/skills/setup-plugins/references/plugin-catalog.md +53 -0
- package/claude/skills/setup-verify/SKILL.md +51 -0
- package/claude/skills/systematic-debugging/SKILL.md +70 -0
- package/claude/skills/toolkit-cli/SKILL.md +38 -0
- package/claude/skills/toolkit-feedback/SKILL.md +80 -0
- package/claude/skills/toolkit-operator/SKILL.md +45 -0
- package/claude/skills/toolkit-triage/SKILL.md +63 -0
- package/claude/skills/youtube-transcripts/SKILL.md +34 -0
- package/docs/agents.md +371 -0
- package/docs/ai-workflow.md +157 -0
- package/docs/index.md +20 -0
- package/docs/operating-model.md +106 -0
- package/docs/target-projects.md +183 -0
- package/docs/visual-design-workflow.md +136 -0
- package/docs/zshrc-aliases.md +65 -0
- package/governance/rules/claude/500-prose.md +12 -0
- package/governance/rules/claude/510-context.md +16 -0
- package/governance/rules/claude/520-wireframes.md +12 -0
- package/governance/rules/claude/530-requirements.md +11 -0
- package/governance/rules/claude/540-architecture.md +11 -0
- package/governance/rules/claude/550-design.md +11 -0
- package/governance/rules/claude/555-tasks.md +12 -0
- package/governance/rules/claude/560-diagrams.md +11 -0
- package/governance/rules/claude/570-skill.md +18 -0
- package/governance/rules/claude/580-readme.md +11 -0
- package/governance/rules/claude/590-rule-authoring.md +12 -0
- package/governance/rules/core/000-constitution.md +30 -0
- package/governance/rules/core/010-testing.md +35 -0
- package/governance/rules/core/020-concurrency.md +22 -0
- package/governance/rules/core/030-error-handling.md +31 -0
- package/governance/rules/core/040-performance.md +20 -0
- package/governance/rules/core/050-logging.md +20 -0
- package/governance/rules/core/060-naming.md +19 -0
- package/governance/rules/core/070-planning.md +13 -0
- package/governance/rules/core/080-config-comments.md +22 -0
- package/governance/rules/framework/200-react.md +51 -0
- package/governance/rules/framework/210-astro.md +41 -0
- package/governance/rules/framework/220-fastapi.md +43 -0
- package/governance/rules/framework/230-nextjs.md +48 -0
- package/governance/rules/framework/250-tailwind.md +32 -0
- package/governance/rules/framework/260-shadcn.md +34 -0
- package/governance/rules/lang/100-typescript.md +40 -0
- package/governance/rules/lang/110-python.md +42 -0
- package/governance/rules/lib/300-testing-ts.md +38 -0
- package/governance/rules/lib/310-zod.md +25 -0
- package/governance/rules/lib/320-tanstack-query.md +32 -0
- package/governance/rules/lib/330-testing-py.md +44 -0
- package/governance/rules/lib/340-pydantic.md +38 -0
- package/governance/rules/lib/350-security-web.md +31 -0
- package/governance/rules/ui/400-ui.md +34 -0
- package/governance/rules/ui/410-a11y.md +44 -0
- package/governance/rules/ui/420-forms.md +34 -0
- package/governance/rules/ui/430-ux-completeness.md +62 -0
- package/governance/stacks/astro.toml +2 -0
- package/governance/stacks/base.toml +2 -0
- package/governance/stacks/node.toml +2 -0
- package/governance/stacks/python-fastapi.toml +2 -0
- package/governance/stacks/python.toml +2 -0
- package/governance/stacks/react.toml +2 -0
- package/package.json +67 -0
- package/scripts/config.sh +11 -0
- package/scripts/core/bootstrap.sh +81 -0
- package/scripts/core/check-plugin-boundary.sh +45 -0
- package/scripts/core/check-skill-paths.sh +25 -0
- package/scripts/core/clean.sh +36 -0
- package/scripts/core/install-check.sh +93 -0
- package/scripts/core/regen-claude-copies.sh +26 -0
- package/scripts/core/regen-indexes.sh +10 -0
- package/scripts/core/regen-skill-references.sh +27 -0
- package/scripts/core/snapshot.sh +132 -0
- package/scripts/core/update.sh +35 -0
- package/scripts/core/verify.sh +201 -0
- package/scripts/docs/list.sh +129 -0
- package/scripts/gov/list.sh +234 -0
- package/scripts/lib/frontmatter.sh +30 -0
- package/scripts/lib/gov.sh +14 -0
- package/scripts/lib/sandbox-fixtures.sh +109 -0
- package/scripts/lib/sandbox-git.sh +73 -0
- package/scripts/lib/tooling.sh +24 -0
- package/scripts/lib/ui.sh +173 -0
- package/scripts/lib/worktree.sh +20 -0
- package/scripts/manage-sandbox.sh +453 -0
- package/scripts/snippets/create.sh +156 -0
- package/scripts/standards/list.sh +91 -0
- package/scripts/tooling/create.sh +109 -0
- package/scripts/tooling/ref.sh +141 -0
- package/scripts/tooling/verify.sh +179 -0
- package/snippets/claude/decision-memo.md +39 -0
- package/snippets/claude/feature-recap.md +19 -0
- package/snippets/claude/figma-steps.md +18 -0
- package/snippets/claude/orchestrator-resume.md +23 -0
- package/snippets/claude/orchestrator-sweep.md +10 -0
- package/snippets/compact-summary.md +5 -0
- package/snippets/create-snippet.md +7 -0
- package/snippets/decision-help.md +6 -0
- package/snippets/meta-prompt.md +14 -0
- package/snippets/research-prompt.md +7 -0
- package/snippets/session-notes.md +11 -0
- package/snippets/snippets.toml +6 -0
- package/snippets/step-by-step.md +10 -0
- package/snippets/web-research.md +21 -0
- package/src/claude/gitignore.ts +51 -0
- package/src/claude/seeds-list.ts +47 -0
- package/src/claude/seeds.ts +124 -0
- package/src/claude/settings.ts +151 -0
- package/src/cli-run.ts +43 -0
- package/src/cli.ts +111 -0
- package/src/commands/claude.ts +349 -0
- package/src/commands/design.ts +39 -0
- package/src/commands/docs.ts +59 -0
- package/src/commands/feedback-format.ts +23 -0
- package/src/commands/feedback.ts +103 -0
- package/src/commands/gov.ts +268 -0
- package/src/commands/indexes.ts +182 -0
- package/src/commands/init.ts +117 -0
- package/src/commands/pass-through.ts +39 -0
- package/src/commands/sandbox.ts +315 -0
- package/src/commands/slides.ts +106 -0
- package/src/commands/snippets.ts +236 -0
- package/src/commands/standards.ts +89 -0
- package/src/commands/sync.ts +211 -0
- package/src/commands/tasks.ts +185 -0
- package/src/commands/tooling.ts +432 -0
- package/src/commands/transcripts.ts +48 -0
- package/src/commands/wiki.ts +101 -0
- package/src/copy.ts +30 -0
- package/src/design/parse.ts +79 -0
- package/src/design/render.ts +170 -0
- package/src/docs/read.ts +59 -0
- package/src/exec.ts +17 -0
- package/src/frontmatter.ts +13 -0
- package/src/github-format.ts +13 -0
- package/src/github.ts +20 -0
- package/src/gov/adapter.ts +73 -0
- package/src/gov/install.ts +103 -0
- package/src/gov/payload.ts +39 -0
- package/src/gov/stacks.ts +124 -0
- package/src/indexes/frontmatter.ts +46 -0
- package/src/indexes/regen.ts +84 -0
- package/src/indexes/render.ts +181 -0
- package/src/indexes/walk.ts +111 -0
- package/src/init/flags.ts +66 -0
- package/src/init/plan.ts +128 -0
- package/src/init/run.ts +46 -0
- package/src/init/steps.ts +91 -0
- package/src/sandbox/coverage.ts +115 -0
- package/src/sandbox/expect.ts +412 -0
- package/src/slides/layouts.ts +391 -0
- package/src/slides/open.ts +18 -0
- package/src/slides/parse.ts +84 -0
- package/src/slides/render.ts +88 -0
- package/src/slides/styles.ts +44 -0
- package/src/snippets/adapter.ts +34 -0
- package/src/snippets/categories.ts +59 -0
- package/src/snippets/install.ts +125 -0
- package/src/snippets/list.ts +32 -0
- package/src/snippets/presets.ts +50 -0
- package/src/standards/adapter.ts +51 -0
- package/src/standards/index-refresh.ts +44 -0
- package/src/standards/install.ts +52 -0
- package/src/sync/check.ts +269 -0
- package/src/sync/engine.ts +416 -0
- package/src/sync/git.ts +204 -0
- package/src/sync/stamp.ts +202 -0
- package/src/sync/target.ts +79 -0
- package/src/sync/workflow.ts +201 -0
- package/src/target.ts +43 -0
- package/src/tasks/archive.ts +304 -0
- package/src/tooling/gitignore.ts +122 -0
- package/src/tooling/inject.ts +214 -0
- package/src/tooling/list.ts +39 -0
- package/src/tooling/manifest.ts +178 -0
- package/src/tooling/package.ts +166 -0
- package/src/tooling/scan.ts +186 -0
- package/src/transcripts/fetch.ts +156 -0
- package/src/transcripts/metadata.ts +54 -0
- package/src/transcripts/vtt.ts +114 -0
- package/src/ui.ts +187 -0
- package/src/wiki/init.ts +85 -0
- package/standards/architecture.md +41 -0
- package/standards/bundled/branch.md +49 -0
- package/standards/bundled/commit.md +63 -0
- package/standards/bundled/issue.md +84 -0
- package/standards/bundled/pr.md +124 -0
- package/standards/bundled/roadmap.md +52 -0
- package/standards/bundled/snippets.md +57 -0
- package/standards/bundled/standard.md +52 -0
- package/standards/context.md +132 -0
- package/standards/design.md +31 -0
- package/standards/diagrams.md +55 -0
- package/standards/index.md +21 -0
- package/standards/prose.md +122 -0
- package/standards/readme.md +163 -0
- package/standards/requirements.md +61 -0
- package/standards/rule.md +79 -0
- package/standards/skill.md +257 -0
- package/standards/tasks.md +140 -0
- package/standards/versioning.md +47 -0
- package/standards/wireframes.md +67 -0
- package/tooling/astro/configs/astro.config.mjs +17 -0
- package/tooling/astro/configs/eslint.config.js +79 -0
- package/tooling/astro/configs/playwright.config.ts +25 -0
- package/tooling/astro/configs/tsconfig.json +12 -0
- package/tooling/astro/configs/vitest.config.ts +22 -0
- package/tooling/astro/manifest.toml +32 -0
- package/tooling/astro/reference.md +60 -0
- package/tooling/base/configs/.editorconfig +5 -0
- package/tooling/base/configs/.github/pull_request_template.md +18 -0
- package/tooling/base/configs/.github/workflows/verify.yml +35 -0
- package/tooling/base/configs/.husky/commit-msg +1 -0
- package/tooling/base/configs/.husky/post-merge +61 -0
- package/tooling/base/configs/.husky/post-rewrite +21 -0
- package/tooling/base/configs/.husky/pre-commit +1 -0
- package/tooling/base/configs/.husky/pre-push +1 -0
- package/tooling/base/configs/.prettierrc +12 -0
- package/tooling/base/configs/.shellcheckrc +1 -0
- package/tooling/base/configs/.vscode/extensions.json +9 -0
- package/tooling/base/configs/.vscode/settings.json +3 -0
- package/tooling/base/configs/commitlint.config.js +11 -0
- package/tooling/base/configs/scripts/clean.sh +45 -0
- package/tooling/base/configs/scripts/update.sh +49 -0
- package/tooling/base/configs/scripts/verify.sh +64 -0
- package/tooling/base/manifest.toml +32 -0
- package/tooling/base/reference.md +114 -0
- package/tooling/base/seeds/.claude/context/ci.md +27 -0
- package/tooling/base/seeds/.claude/context/development.md +32 -0
- package/tooling/base/seeds/.cspell/project-terms.txt +0 -0
- package/tooling/base/seeds/.cspell/tech-stack.txt +19 -0
- package/tooling/base/seeds/.lintstagedrc +8 -0
- package/tooling/base/seeds/.prettierignore +0 -0
- package/tooling/base/seeds/cspell.json +20 -0
- package/tooling/claude/manifest.toml +11 -0
- package/tooling/claude/reference.md +62 -0
- package/tooling/claude/seeds/.claude/ARCHITECTURE.md +13 -0
- package/tooling/claude/seeds/.claude/DESIGN.md +62 -0
- package/tooling/claude/seeds/.claude/REQUIREMENTS.md +18 -0
- package/tooling/claude/seeds/.claude/context/index.md +8 -0
- package/tooling/claude/seeds/.claude/hooks/index-reminder.sh +43 -0
- package/tooling/claude/seeds/.claude/hooks/scratch-guard.sh +45 -0
- package/tooling/claude/seeds/.claude/hooks/standards-audit.sh +61 -0
- package/tooling/claude/seeds/.claude/hooks/tasks-index.sh +60 -0
- package/tooling/claude/seeds/.claude/settings.json +39 -0
- package/tooling/claude/seeds/.claude/tasks/index.md +8 -0
- package/tooling/claude/seeds/.claude/wireframes/index.md +8 -0
- package/tooling/claude/seeds/CLAUDE.md +87 -0
- package/tooling/claude/user/settings.template.json +10 -0
- package/tooling/claude/user/statusline-command.sh +53 -0
- package/tooling/python/configs/.coveragerc +14 -0
- package/tooling/python/configs/.python-version +1 -0
- package/tooling/python/configs/mypy.ini +6 -0
- package/tooling/python/configs/pytest.ini +4 -0
- package/tooling/python/configs/ruff.toml +15 -0
- package/tooling/python/configs/scripts/verify.sh +77 -0
- package/tooling/python/manifest.toml +16 -0
- package/tooling/python/reference.md +66 -0
- package/tooling/python/seeds/.cspell/tech-stack.txt +19 -0
- package/tooling/python/seeds/tests/test_smoke.py +2 -0
- package/tooling/vite-react/configs/playwright.config.ts +25 -0
- package/tooling/vite-react/configs/tsconfig.json +35 -0
- package/tooling/vite-react/configs/vite.config.ts +14 -0
- package/tooling/vite-react/configs/vitest.config.ts +26 -0
- package/tooling/vite-react/manifest.toml +21 -0
- package/tooling/vite-react/reference.md +55 -0
- package/tooling/vite-react/seeds/.cspell/project-terms.txt +1 -0
- package/tooling/vite-react/seeds/.cspell/tech-stack.txt +1 -0
- package/tooling/web/configs/.github/workflows/verify.yml +134 -0
- package/tooling/web/configs/.vscode/extensions.json +13 -0
- package/tooling/web/configs/.vscode/settings.json +10 -0
- package/tooling/web/configs/e2e/home.spec.ts +6 -0
- package/tooling/web/configs/e2e/screenshot.ts +41 -0
- package/tooling/web/configs/eslint.config.js +82 -0
- package/tooling/web/configs/scripts/screenshot.sh +28 -0
- package/tooling/web/configs/scripts/verify.sh +80 -0
- package/tooling/web/configs/src/test/setup.ts +8 -0
- package/tooling/web/manifest.toml +57 -0
- package/tooling/web/reference.md +95 -0
- package/tooling/web/seeds/.cspell/tech-stack.txt +18 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-docs
|
|
3
|
+
description: Updates `.claude/` planning docs to reflect decisions made during the session, marks outcomes the diff shipped `[x]`, and archives the plans those tasks cite. Use when design or requirements changed mid-cycle, after discussing a pivot, or before shipping. Do NOT use to create a task file or move one out of the live folder. That is `claude-tasks`.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Claude docs
|
|
7
|
+
|
|
8
|
+
## Guards
|
|
9
|
+
|
|
10
|
+
- If no `.claude/` directory exists, stop: `❌ No .claude/ directory found. Run aitk claude init to set up the workflow.`
|
|
11
|
+
|
|
12
|
+
The bail on a session that changed nothing lives at the end of Step 2, because it needs the diff to decide.
|
|
13
|
+
|
|
14
|
+
## Diff baseline
|
|
15
|
+
|
|
16
|
+
Steps 2, 4, and 7 share one diff on the usable path. An unusable baseline splits them, per the rule below. Resolve the base ref once and reuse it:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main 2>/dev/null
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Take the union of `git diff --name-only <base> HEAD`, `git diff --name-only HEAD`, and `git ls-files --others --exclude-standard`. Read content with `git diff <base> HEAD` and `git diff HEAD`.
|
|
23
|
+
|
|
24
|
+
Prefer `origin/main` over local `main`. On `main` itself the local ref resolves to HEAD, so every committed change drops out of the set and the skill goes blind to the work it is meant to read.
|
|
25
|
+
|
|
26
|
+
The baseline is unusable in two cases:
|
|
27
|
+
|
|
28
|
+
- No merge base resolves against either ref.
|
|
29
|
+
- The base came from local `main` and equals HEAD. Nothing is pushed to compare against, so a narrow read reports no changes rather than admitting it cannot see them.
|
|
30
|
+
|
|
31
|
+
An unusable baseline costs only the committed half. `git diff <base> HEAD` is empty by definition once the base equals HEAD, while `git diff HEAD` and `git ls-files --others --exclude-standard` still report uncommitted and untracked work at correct scope.
|
|
32
|
+
|
|
33
|
+
**Step 2 recovers the committed half.** Read `git log -p -1`, widening to `git log -p -<n>` when the session spans several commits, and read the candidate task files against the working tree. That yields names and content both, which is what lets Step 2 decide on behavior rather than on filenames. A fresh `git init` on `main` with no remote is the ordinary shape of a scaffolded project, so this path carries the evidence rather than covering an edge case.
|
|
34
|
+
|
|
35
|
+
**Steps 4 and 7 keep the scoped set.** Run them on the working tree and untracked files alone, and skip only when that set comes out empty, each reporting the warning its own step names.
|
|
36
|
+
|
|
37
|
+
Never substitute the whole tree for a missing baseline, and do not reuse Step 2's commit read in these two for consistency. On a fresh `git init` project the last commit is the scaffold commit, so `git log -p -1` is the whole tree by another route. Step 2 tolerates that because it only reads, and it matches conservatively against outcomes already on the board. These two write, so the same set stubs a wireframe for every uncovered surface in the repository and rewrites every context entry that tree touches.
|
|
38
|
+
|
|
39
|
+
Widening what a step reads is safe. Widening what a step writes is not.
|
|
40
|
+
|
|
41
|
+
## Step 1: read current docs
|
|
42
|
+
|
|
43
|
+
Read these in parallel from the current worktree root (`pwd`), not the main worktree root. These are tracked files and edits must commit with the branch. Skip any that do not exist:
|
|
44
|
+
|
|
45
|
+
- `.claude/REQUIREMENTS.md`
|
|
46
|
+
- `.claude/ARCHITECTURE.md`
|
|
47
|
+
- `.claude/DESIGN.md`
|
|
48
|
+
- `.claude/wireframes/index.md` and every `.claude/wireframes/<surface>.md`
|
|
49
|
+
|
|
50
|
+
Read the task board from the main worktree root instead, per Worktrees in `CLAUDE.md`. It is gitignored scratch and never commits with the branch:
|
|
51
|
+
|
|
52
|
+
- `.claude/tasks/index.md` first, then the task files this session touched. That narrow read serves the marking step. Step 8 reads every file in the folder for its plans sweep and states that where it gives the instruction.
|
|
53
|
+
|
|
54
|
+
## Step 2: identify what changed
|
|
55
|
+
|
|
56
|
+
Two sources feed this step. The session carries judgments no diff can show. The diff carries facts about the repository the session may never have mentioned.
|
|
57
|
+
|
|
58
|
+
Review the session for decisions that diverged from the original plan:
|
|
59
|
+
|
|
60
|
+
- Requirements added, removed, or changed scope
|
|
61
|
+
- Architecture or technical decisions made or revised
|
|
62
|
+
- Design or UX decisions that differ from DESIGN.md or any `.claude/wireframes/<surface>.md`
|
|
63
|
+
- Tasks blocked or newly identified
|
|
64
|
+
|
|
65
|
+
Then resolve the diff baseline and match it against the board. From `.claude/tasks/index.md` at the main worktree root, pick the task files whose title or description relates to the changed paths and read the ones Step 1 skipped. Path matching only chooses which files to open. Behavior decides each outcome. For each unchecked outcome, decide whether the diff shipped the behavior that outcome names. Completion is the one judgment here that is a fact about the repository rather than a fact about the conversation, so the diff decides it and the session does not. Requirements, architecture, and design stay session-sourced.
|
|
66
|
+
|
|
67
|
+
Keep the match conservative:
|
|
68
|
+
|
|
69
|
+
- Mark only outcomes already written on the board. Never infer a new task from the diff.
|
|
70
|
+
- Match on the behavior an outcome describes, not on filenames or commit subjects. The path match above only narrowed which task files to open.
|
|
71
|
+
- Leave an outcome `[ ]` when the diff is ambiguous. An unmarked shipped outcome costs one manual edit, while a wrongly marked one hides work that never happened.
|
|
72
|
+
|
|
73
|
+
Stop here when the session shows no divergence **and** the diff matches no queued outcome: `✅ No doc updates needed. Session matched the original plan.` Both conditions have to hold. Shipping a queued task exactly as planned is the ordinary case and it reads as no divergence, so a session-only bail would stop the skill before it reaches the marking step.
|
|
74
|
+
|
|
75
|
+
## Step 3: update
|
|
76
|
+
|
|
77
|
+
For each doc with relevant changes, apply updates following these rules. Read a standard this skill names, here or in Step 7, from `${CLAUDE_SKILL_DIR}/../../standards/` when the project does not have it.
|
|
78
|
+
|
|
79
|
+
**`.claude/tasks/`**
|
|
80
|
+
|
|
81
|
+
- Mark completed outcomes `[x]` in place in the task's own file. Do not move or archive the file.
|
|
82
|
+
- Write a newly identified task as its own file, following `.claude/standards/tasks.md` for the filename and frontmatter.
|
|
83
|
+
- Do not touch task files this session did not change.
|
|
84
|
+
- Never hand-edit `.claude/tasks/index.md`. A hook regenerates it.
|
|
85
|
+
|
|
86
|
+
**REQUIREMENTS.md, ARCHITECTURE.md, DESIGN.md, `.claude/wireframes/<surface>.md`**
|
|
87
|
+
|
|
88
|
+
- Update only the sections affected by session decisions.
|
|
89
|
+
- Do not rewrite sections unrelated to what changed.
|
|
90
|
+
- Follow `.claude/standards/prose.md` for all edits.
|
|
91
|
+
|
|
92
|
+
Write each updated file immediately. Claude Code's tool permission dialog is the confirmation gate. Do not wait for user input.
|
|
93
|
+
|
|
94
|
+
## Step 4: wireframe coverage sweep
|
|
95
|
+
|
|
96
|
+
Skip this step silently when `.claude/wireframes/` does not exist or has no surface files. When the baseline is unusable, scope it to the working tree and untracked files, and skip it only when that set is empty, reporting `⚠ No diff to scope against. Skipped the wireframe sweep.`
|
|
97
|
+
|
|
98
|
+
Reuse the diff from the baseline above and filter for UI-affecting paths. UI-affecting paths are framework-dependent. Default heuristic: any file under a `components/`, `features/`, `pages/`, `app/`, `routes/`, or `screens/` folder, plus any `*.tsx`, `*.jsx`, `*.vue`, or `*.svelte` file anywhere in the diff.
|
|
99
|
+
|
|
100
|
+
For each UI-affecting path, derive a candidate surface slug from the file's basename and parent folder (e.g. `web/src/features/mock/MockDemoStrip.tsx` → `mock-demo-strip` or `mock`). Cross-reference against the surface files in `.claude/wireframes/`:
|
|
101
|
+
|
|
102
|
+
- **Contradicted sections:** when a surface file exists for a path in the diff and the diff renames or removes a literal string that appears in the wireframe prose (e.g. provider name, button label, copy string), output a one-line report entry and stop. Do not auto-rewrite prose. Operator resolves.
|
|
103
|
+
- **Uncovered surfaces:** when a UI-affecting path has no matching surface file by slug, write `.claude/wireframes/<slug>.md` with this stub:
|
|
104
|
+
|
|
105
|
+
```markdown
|
|
106
|
+
---
|
|
107
|
+
title: <Slug as title case>
|
|
108
|
+
description: TODO: describe the surface.
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
# <Slug as title case>
|
|
112
|
+
|
|
113
|
+
TODO: describe when and where this surface appears.
|
|
114
|
+
|
|
115
|
+
## Behavior
|
|
116
|
+
|
|
117
|
+
- TODO
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Skip the write when the slug would collide with an existing file (different surface, same slug). Surface the collision in the report instead.
|
|
121
|
+
|
|
122
|
+
Output one line per finding:
|
|
123
|
+
|
|
124
|
+
- `⚠ Wireframe drift in .claude/wireframes/<surface>.md: <contradicted string>`
|
|
125
|
+
- `📝 Stubbed: .claude/wireframes/<surface>.md`
|
|
126
|
+
- `⚠ Slug collision: <slug> matches existing <existing-surface>.md, review and rename`
|
|
127
|
+
|
|
128
|
+
If the sweep finds nothing, skip silently.
|
|
129
|
+
|
|
130
|
+
## Step 5: flag diagram staleness
|
|
131
|
+
|
|
132
|
+
If `.claude/DIAGRAMS.md` exists at `pwd` and this session edited any source `claude-diagram` reads (planning docs, deploy or infrastructure config, top-level component folders), surface a one-line warning:
|
|
133
|
+
|
|
134
|
+
`⚠ DIAGRAMS.md may be stale. Run /claude-diagram`
|
|
135
|
+
|
|
136
|
+
Do not regenerate inline. The author decides when to re-run the diagram skill. Skip the step silently when `.claude/DIAGRAMS.md` does not exist.
|
|
137
|
+
|
|
138
|
+
## Step 6: flag CLAUDE.md drift
|
|
139
|
+
|
|
140
|
+
If this session established or changed a cross-cutting behavior rule that belongs in root `CLAUDE.md` (a new always-on convention, a revised workflow rule), surface a one-line warning:
|
|
141
|
+
|
|
142
|
+
`⚠ CLAUDE.md may need a rule from this session. Review and edit by hand.`
|
|
143
|
+
|
|
144
|
+
Do not edit `CLAUDE.md` inline. Every `CLAUDE.md` change goes through the show-diff-and-approve gate, so this step only flags. Skip silently when the session made no cross-cutting behavior decision.
|
|
145
|
+
|
|
146
|
+
## Step 7: refresh context entries
|
|
147
|
+
|
|
148
|
+
Read `.claude/context/index.md` at `pwd` to see which domain entries exist. Skip this step silently if the directory does not exist or has no entries. When the baseline is unusable, scope it to the working tree and untracked files, and skip it only when that set is empty, reporting `⚠ No diff to scope against. Skipped the context refresh.`
|
|
149
|
+
|
|
150
|
+
Reuse the diff from the baseline above, names and content both. For each existing `.claude/context/<domain>.md`:
|
|
151
|
+
|
|
152
|
+
- Map the entry's section headings to the changed files. An entry is relevant when its prose references files, modules, or decisions touched by the diff.
|
|
153
|
+
- For each relevant entry, rewrite only the sections affected by the diff. Same pattern as `docs-sync`. Do not touch unrelated sections.
|
|
154
|
+
|
|
155
|
+
Do not create new entries automatically. New entries are a deliberate decision: the user invokes `claude-docs --new-context <domain>` (future flag) or hand-creates the file following `.claude/standards/context.md`. Auto-creation risks padding `.claude/context/` with low-signal entries.
|
|
156
|
+
|
|
157
|
+
Write each updated entry immediately. Output one line per file:
|
|
158
|
+
|
|
159
|
+
`✅ Context: .claude/context/<domain>.md`
|
|
160
|
+
|
|
161
|
+
The base lint-staged config runs `aitk indexes regen` on every committed `*.md`, so `.claude/context/index.md` refreshes automatically on commit. No manual step needed.
|
|
162
|
+
|
|
163
|
+
## Step 8: sweep consumed scratch
|
|
164
|
+
|
|
165
|
+
Sweep reviews this session consumed, and sweep plans across the whole board. Resolve all paths at the main worktree root, not the current worktree. See Worktrees in `CLAUDE.md`.
|
|
166
|
+
|
|
167
|
+
**Plans.** Scan every file in `.claude/tasks/`, not only the ones this session touched. For each task file whose outcomes are now all `[x]`, check for a `Plan:` line directly under the title and parse the target. The line carries a markdown link, so read the target out of the parentheses rather than taking the rest of the line. A task still carrying the older bare-path form parses the same way once the link is absent, so accept both. Resolve the target against `.claude/tasks/` before routing on it, which lands `../plans/x.md` and `.claude/plans/x.md` on the same file. The bullets below name resolved locations, so an unresolved target falls to the last one and no plan is ever archived. Never delete a plan. `CLAUDE.md` owns why a shipped plan is archived rather than removed.
|
|
168
|
+
|
|
169
|
+
Board-wide scope is the one place this sweep reaches past Step 3's rule against touching task files the session did not change. A board carrying a task that closed while an earlier run missed its archive is the defect this exists to clear, and skipping those tasks would preserve it. Reaching them is safe because the archive moves the plan and points the task at the new path, so a task from unrelated work ends up with a working pointer rather than a broken one.
|
|
170
|
+
|
|
171
|
+
Before moving anything, count the other citations. Scan every `.claude/tasks/*.md` file except the one being processed for a `Plan:` line naming the same plan. Compare the resolved target from the parse above, never the raw target string and never the filename alone. A board carrying one task written `../plans/x.md` and another written `.claude/plans/x.md` cites one plan, and a raw string comparison reads two, counts zero, and archives the file out from under a live task. Comparing filenames swaps that for the opposite error, since a live plan and an archived one share a basename whenever a closed task still points into `.claude/.tmp/plans-archive/`, and the count then reads a citation that does not exist and archives nothing.
|
|
172
|
+
|
|
173
|
+
Exclude the closing task explicitly. It sits on the board and cites the plan itself, so a scan that counts it never reaches zero and no plan is ever archived.
|
|
174
|
+
|
|
175
|
+
A plan can serve more than one task, and archiving on the first task to close strands every other task's pointer at a path that has moved. `.claude/plans/` is gitignored, so that retarget would be the only record and there is nothing to recover it from.
|
|
176
|
+
|
|
177
|
+
- Target resolves inside `.claude/plans/`, the file exists, and no other task file cites it: create `.claude/.tmp/plans-archive/`, move the file there under its original name, overwriting any file already sitting at that name. Then rewrite the task file's `Plan:` line to the archive path, so a completed task still leads to the reasoning behind it.
|
|
178
|
+
- Target resolves inside `.claude/plans/` and at least one other task file cites it: leave the plan where it is and retarget nothing. Report the shared citation.
|
|
179
|
+
- Target resolves inside `.claude/.tmp/plans-archive/`: skip silently. The plan was archived by an earlier pass and the task file is already correct.
|
|
180
|
+
- Any other resolved target outside `.claude/plans/`: warn and skip.
|
|
181
|
+
|
|
182
|
+
Write the retarget as a markdown link, `Plan: [feature-<slug>](../.tmp/plans-archive/feature-<slug>.md)`, updating both halves so the text and the target stay in step. This branch is the only writer that produces a `Plan:` line nobody authored by hand, so a retarget that emits a bare path converts every task to the old form as it closes and drifts the board back to two shapes on its own.
|
|
183
|
+
|
|
184
|
+
**Reviews.** Derive `<slug>` from the current branch name (replace `/` with `-`). If `.claude/review/review-<slug>.md` exists, delete it. `claude-review` writes with this convention. Do not sweep any other `review-*.md` file.
|
|
185
|
+
|
|
186
|
+
Do not sweep `ui-checklist-*.md` (pending human verification) or `ux-audit-*.md` (standalone deliverable).
|
|
187
|
+
|
|
188
|
+
Output one line per file swept:
|
|
189
|
+
|
|
190
|
+
- `📦 Archived: <path>` for a plan moved into `.claude/.tmp/plans-archive/`
|
|
191
|
+
- `⏭ Kept: <path>, still cited by <task-file>` for a plan another live task shares
|
|
192
|
+
- `🧹 Deleted: <path>` for a swept review
|
|
193
|
+
|
|
194
|
+
If nothing qualifies, skip this step silently.
|
|
195
|
+
|
|
196
|
+
## After completion
|
|
197
|
+
|
|
198
|
+
Output one line per file updated:
|
|
199
|
+
|
|
200
|
+
`✅ Updated: .claude/<filename>`
|
|
201
|
+
|
|
202
|
+
If no files were updated and nothing was swept, output:
|
|
203
|
+
|
|
204
|
+
`✅ No changes needed.`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-feature
|
|
3
|
+
description: What feature planning is for, the gaps it closes, and why it stops before implementing
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Claude feature requirement
|
|
7
|
+
|
|
8
|
+
## Gap
|
|
9
|
+
|
|
10
|
+
Without this skill, implementation starts before anyone knows what it touches. A session reads no project context and rediscovers a settled constraint halfway through, the file list emerges as the work goes rather than before it, and the ambiguities that needed a decision get resolved silently in whichever direction the first edit happened to go.
|
|
11
|
+
|
|
12
|
+
## Must
|
|
13
|
+
|
|
14
|
+
- Read the project's own Claude setup before scanning source, so the plan inherits decisions already made instead of reopening them
|
|
15
|
+
- Name every file the work touches with the reason it is touched
|
|
16
|
+
- Surface each unresolved ambiguity as a numbered question carrying a suggested answer and an empty answer slot, so the plan is decision-ready in one pass
|
|
17
|
+
- Scale the output to the work. A two-file change with nothing to decide should not produce a plan file.
|
|
18
|
+
- Stop at the plan and wait to be told to continue
|
|
19
|
+
|
|
20
|
+
## Must not
|
|
21
|
+
|
|
22
|
+
- Implement, or edit any file the plan describes
|
|
23
|
+
- Read directories speculatively. Context spent on files the feature does not touch is context the plan does not get.
|
|
24
|
+
- Bundle independent concerns into one plan, since a plan covering two things gets executed as neither
|
|
25
|
+
- Restate the plan in chat during follow-up rounds. The file is the source of truth and a chat copy of it goes stale immediately.
|
|
26
|
+
|
|
27
|
+
## Guards
|
|
28
|
+
|
|
29
|
+
- No feature description: stop and ask for one
|
|
30
|
+
|
|
31
|
+
## Out of scope
|
|
32
|
+
|
|
33
|
+
- Executing the plan, which is the ship pipeline
|
|
34
|
+
- Task-board state, which `claude-tasks` owns. A plan links to its task and does not create one.
|
|
35
|
+
- Reconciling the planning docs after the work lands, which `claude-docs` owns
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-feature
|
|
3
|
+
description: Plans a feature by reading the project's Claude setup and scanning relevant source files. Outputs which files to touch, risks, and ambiguities, then stops. Use before implementing anything, or when asked to "implement X", "add X", "build X", or "I want to add X". Do NOT implement. Plan only.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Claude feature
|
|
7
|
+
|
|
8
|
+
## Guards
|
|
9
|
+
|
|
10
|
+
- If no feature description is provided, stop: `❌ No feature description. Describe what you want to add.`
|
|
11
|
+
- Do not implement anything. Output the plan and stop.
|
|
12
|
+
- When the feature description spans two or more independent concerns, write one plan file per concern. Do not bundle them under a single slug.
|
|
13
|
+
|
|
14
|
+
## Step 1: read the Claude setup
|
|
15
|
+
|
|
16
|
+
Read these in parallel from the project root, skipping any that do not exist:
|
|
17
|
+
|
|
18
|
+
- `CLAUDE.md`: behavior rules, conventions, commands
|
|
19
|
+
- `.claude/REQUIREMENTS.md`: feature scope and non-goals
|
|
20
|
+
- `.claude/ARCHITECTURE.md`: decisions already made
|
|
21
|
+
- `.claude/tasks/index.md`: current scope and status, then any task file the feature relates to
|
|
22
|
+
|
|
23
|
+
Also read these when the feature touches code or UI. Skip them for prose, docs, catalog, or config-only changes:
|
|
24
|
+
|
|
25
|
+
- `.claude/DESIGN.md`: tokens, typography, spacing, and component rules
|
|
26
|
+
- `.claude/wireframes/index.md` + the surface files relevant to the feature: intended UI layout and behavior. Read `index.md` first, then load only the per-surface files (`.claude/wireframes/<surface>.md`) the feature actually touches. Do not read the whole folder speculatively. When the plan adds or revises a surface, the wireframe file follows `.claude/standards/wireframes.md`, or `${CLAUDE_SKILL_DIR}/../../standards/wireframes.md` when the project does not have it.
|
|
27
|
+
|
|
28
|
+
Coding standards live in `.claude/rules/`. Claude Code loads them automatically. Path-scoped rules apply to the files they match.
|
|
29
|
+
|
|
30
|
+
## Step 2: scan relevant source files
|
|
31
|
+
|
|
32
|
+
Based on the feature description, identify and read source files that are directly relevant. Do not read entire directories speculatively.
|
|
33
|
+
|
|
34
|
+
Measure against the tree rather than recall. Grep for each construct the plan will name and count the sites, so the plan carries the count the tree holds today. Confirm any work the plan sequences behind is still open, so it does not lead with an item that already shipped. Open each file before describing what is in it. A count or a claim carried from an earlier session, a summary, or another document is the most common way a plan ships the wrong scope.
|
|
35
|
+
|
|
36
|
+
## Step 3: build the plan
|
|
37
|
+
|
|
38
|
+
Construct the plan with these sections:
|
|
39
|
+
|
|
40
|
+
- **Summary:** three to five one-line bullets covering the goal, the main deliverables, and the key trade-off or decision. Aimed at humans scanning the plan, not agents executing it. Full mode only.
|
|
41
|
+
- **Constraints:** durable rules the work must respect (patterns to reuse, surfaces not to touch, platform limits). Optional. Include when an orchestrator or prior context supplies them, omit the section otherwise.
|
|
42
|
+
- **Files to touch:** each file with a one-line reason
|
|
43
|
+
- **Risks:** conflicts, coupling, or tricky spots. When the plan establishes a resource with more than one consumer, list the consumers and mark each read or write, because a policy stated over that resource has to hold for the writers and not just the consumer that prompted it. If none, use `None identified.`
|
|
44
|
+
- **Questions:** numbered list of things to resolve before starting. Each carries a `- Suggested:` line and an `- Answer:` slot (see Suggestions below). If none, use `None identified.`
|
|
45
|
+
|
|
46
|
+
Prefer `None identified.` over low-signal fillers. A small feature should produce a short plan, not a padded one. Small mode skips the summary since the plan is already short enough to scan in full.
|
|
47
|
+
|
|
48
|
+
### Suggestions
|
|
49
|
+
|
|
50
|
+
Attach a `- Suggested:` line to every question, then an empty `- Answer:` slot below it. A blank answer means accept the suggestion at execution time. This makes the plan decision-ready in one pass, with no separate decision-help round.
|
|
51
|
+
|
|
52
|
+
- Apply senior judgment: pick the best option and state it in one line with its reason or main tradeoff. No padding, no alternatives unless they change the pick.
|
|
53
|
+
- Suggest a real default when best practice, the codebase, or prior context points to one.
|
|
54
|
+
- When the answer hinges on the user's preference or their intent is unclear, write `- Suggested: needs your call, <why>` rather than fabricating a technical default.
|
|
55
|
+
|
|
56
|
+
When three or more questions remain, keep chat output to the file pointer plus a short summary. Inline chat is fine when two or fewer remain.
|
|
57
|
+
|
|
58
|
+
## Step 4: output
|
|
59
|
+
|
|
60
|
+
Decide the mode based on what Step 3 produced:
|
|
61
|
+
|
|
62
|
+
- **Small** when the plan touches 2 files or fewer, has no architectural or cross-cutting choices, and both Risks and Questions come out `None identified.`
|
|
63
|
+
- **Full** otherwise
|
|
64
|
+
|
|
65
|
+
A consumer list is a `Risks` entry, which already forces Full. Establishing a resource with more than one consumer, where at least one writes, is a cross-cutting choice wherever that list ends up living, so such a plan stays Full even at two files.
|
|
66
|
+
|
|
67
|
+
### Small mode
|
|
68
|
+
|
|
69
|
+
Output the plan to chat. Do not write a plan file.
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
**Files to touch:**
|
|
73
|
+
|
|
74
|
+
- `path/to/file`: reason
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
If real questions exist, include a numbered `**Questions:**` section below, each with a `- Suggested:` line and an `- Answer:` slot:
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
**Questions:**
|
|
81
|
+
|
|
82
|
+
1. <question>
|
|
83
|
+
- Suggested: <pick>, <reason or tradeoff>
|
|
84
|
+
- Answer:
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Omit empty sections. Do not print `None identified.` in chat.
|
|
88
|
+
|
|
89
|
+
### Full mode
|
|
90
|
+
|
|
91
|
+
Derive a 2-to-4-word kebab-case slug from the feature description. Write the full plan to `.claude/plans/feature-<slug>.md` at the main worktree root, not the current worktree. See Worktrees in `CLAUDE.md`. Create the directory if it does not exist.
|
|
92
|
+
|
|
93
|
+
File format:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
# Feature: <short title>
|
|
97
|
+
|
|
98
|
+
<feature description>
|
|
99
|
+
|
|
100
|
+
## Summary
|
|
101
|
+
|
|
102
|
+
- <one-line bullet covering the goal>
|
|
103
|
+
- <one-line bullet covering the main deliverables>
|
|
104
|
+
- <one-line bullet covering the key decision or trade-off>
|
|
105
|
+
|
|
106
|
+
**Constraints:**
|
|
107
|
+
|
|
108
|
+
- <durable rule the work must respect>
|
|
109
|
+
|
|
110
|
+
**Files to touch:**
|
|
111
|
+
|
|
112
|
+
- `path/to/file`: reason
|
|
113
|
+
|
|
114
|
+
**Risks:**
|
|
115
|
+
|
|
116
|
+
- <risk>
|
|
117
|
+
|
|
118
|
+
**Questions:**
|
|
119
|
+
|
|
120
|
+
1. <question>
|
|
121
|
+
- Suggested: <pick>, <reason or tradeoff>
|
|
122
|
+
- Answer:
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Then output in chat:
|
|
126
|
+
|
|
127
|
+
```markdown
|
|
128
|
+
📝 Wrote .claude/plans/feature-<slug>.md
|
|
129
|
+
|
|
130
|
+
**Questions:**
|
|
131
|
+
|
|
132
|
+
1. <question>
|
|
133
|
+
- Suggested: <pick>, <reason or tradeoff>
|
|
134
|
+
|
|
135
|
+
Next: /claude-worktree
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Show only the path line and the `Next:` line when there are no questions. The `.claude/plans/` directory is gitignored. Do not stage or commit the file.
|
|
139
|
+
|
|
140
|
+
Do not proceed to implementation until the user explicitly says to continue.
|
|
141
|
+
|
|
142
|
+
## Discussion rounds
|
|
143
|
+
|
|
144
|
+
After the plan is written, the user may re-ping with follow-up questions or pushback. Keep chat output to a decision-help shape.
|
|
145
|
+
|
|
146
|
+
- State each pick as one-line pick plus one-line reason. Do not use section headers, context blocks, or multi-section breakdowns in chat. Those belong in the plan file.
|
|
147
|
+
- Put numbered decisions to resolve at the bottom of the response, not interleaved with findings.
|
|
148
|
+
- When a finding needs more than two lines to explain, update `.claude/plans/feature-<slug>.md` in place with the detail and point the user at the file instead.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-groundwork
|
|
3
|
+
description: Opens and runs a numbered groundwork folder under `.claude/.tmp/groundwork/<slug>/` for a topic that has to be measured before it can be planned. Detects open, resume, and close from the folder itself. Use when asked to "research X", "dig into X", "work out what we should do about X", "measure this before we commit", or "open a groundwork folder". Do NOT use to write a feature plan or to implement. That is `claude-feature`.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Claude groundwork
|
|
7
|
+
|
|
8
|
+
Groundwork gathers and weighs. A plan commits. A groundwork folder costs nothing to throw away, which is what makes it the right container for a question nobody has answered yet.
|
|
9
|
+
|
|
10
|
+
Read `${CLAUDE_SKILL_DIR}/references/folder-format.md` before writing any file in the folder. It holds the reserved numbers, what each required file carries, the conventions, and the anti-patterns.
|
|
11
|
+
|
|
12
|
+
## Guards
|
|
13
|
+
|
|
14
|
+
- If no topic is given, stop: `❌ No topic. Name what needs measuring.`
|
|
15
|
+
- Apply the qualifying test before creating anything. Two of these three must hold: the current state is not known, more than one approach is live, and committing wrong costs more than a day of measuring. When one or fewer holds, stop: `❌ Already decided enough to plan. Run /claude-feature instead.`
|
|
16
|
+
- Do not pause for approval between steps. The write scope below is what makes that safe.
|
|
17
|
+
|
|
18
|
+
## Write scope
|
|
19
|
+
|
|
20
|
+
- Write only inside `.claude/.tmp/groundwork/<slug>/`. A feature plan, source changes, a standard, a rule, and a reference doc all live outside that folder, so this one rule forbids every one of them.
|
|
21
|
+
- One exception, at close only: write one task file recording what the track concluded.
|
|
22
|
+
- A second exception, for experiments: write a fixture a spike needs under `.claude/.tmp/groundwork-fixtures/<slug>/`. Keep it out of `.claude/.tmp/groundwork/` so mode detection never matches a fixture as a track. A fixture a headless run is pointed at goes outside the repository instead, per the rule in `## Running a spike`.
|
|
23
|
+
- Reading is not restricted. External research is in scope, so read documentation, comparable projects, and papers whenever a live question needs them.
|
|
24
|
+
- Every claim about a source outside the project carries a link to it. A source found and not read is listed as a lead and is never cited.
|
|
25
|
+
- Treat the folder as gitignored and unbacked. It dies with the machine, so `07-next-session.md` repeats what it needs instead of pointing at its siblings.
|
|
26
|
+
|
|
27
|
+
## Running a spike
|
|
28
|
+
|
|
29
|
+
A track may run an experiment to settle an open question without stopping to ask. What it takes depends on what the experiment does.
|
|
30
|
+
|
|
31
|
+
- Reading or computing: run it. Unrestricted reading already covers this, and it is what most spikes turn out to be.
|
|
32
|
+
- Writing a fixture this session reads or provisions itself: run it, under the fixtures path above. Provisioning is the usual blocker rather than spend, and it costs nothing.
|
|
33
|
+
- Spawning a billed headless session: run up to three, then ask before spawning more. The bound is a run count rather than a budget, because a headless run reports its total cost only after it finishes, so a dollar ceiling is reportable and not enforceable while a run count is checkable before spawning.
|
|
34
|
+
|
|
35
|
+
A fixture a headless run is pointed at goes outside the repository, under `mktemp -d`, and never under `.claude/.tmp/`. A session started anywhere beneath the project root loads that project's `CLAUDE.md`, `.claude/rules/`, and `.claude/standards/` through the ancestor chain, so an in-repo fixture measures the repository instead of the arm. Record the fixture as contaminated and re-run it outside if this is discovered after the fact, because the result reads as evidence either way.
|
|
36
|
+
|
|
37
|
+
Record method, result, measured cost, and caveats in `08-spikes.md`. Reach for a test harness the project already carries before building one, and copy how it isolates its fixture rather than only what it asserts.
|
|
38
|
+
|
|
39
|
+
## Step 1: detect the mode
|
|
40
|
+
|
|
41
|
+
List `.claude/.tmp/groundwork/` from the project root and match the topic against the tracks already there before deriving anything. A resume pass rarely phrases the topic the way the folder was named, so a fresh slug derived from the wording would miss a live track and restart it.
|
|
42
|
+
|
|
43
|
+
Never match against `.claude/.tmp/` itself. That directory is scratch shared with every other skill, so a topic matched there lands on a folder that was never a track.
|
|
44
|
+
|
|
45
|
+
With no match, derive a kebab-case slug named for the subject rather than the activity. Prefer `ts-migration` over `migration-research`. Then route on `.claude/.tmp/groundwork/<slug>/`:
|
|
46
|
+
|
|
47
|
+
- Folder absent: open
|
|
48
|
+
- Folder present without `06-decision.md`: resume
|
|
49
|
+
- Present folder the user judges ready: close
|
|
50
|
+
|
|
51
|
+
Detect the mode from the folder. Do not ask which one to run.
|
|
52
|
+
|
|
53
|
+
## Step 2: orient
|
|
54
|
+
|
|
55
|
+
Read these in parallel from the project root, skipping any that do not exist:
|
|
56
|
+
|
|
57
|
+
- `CLAUDE.md`: behavior rules, conventions, commands
|
|
58
|
+
- `.claude/REQUIREMENTS.md`: scope and non-goals
|
|
59
|
+
- `.claude/ARCHITECTURE.md`: decisions already made
|
|
60
|
+
- `.claude/tasks/index.md`: what is already tracked, and what a prior track concluded. Open a task file only when its entry looks related.
|
|
61
|
+
|
|
62
|
+
Then read only what a live question needs. Do not read entire directories speculatively. Where a folder carries an `index.md`, read it first and load only the files it points at.
|
|
63
|
+
|
|
64
|
+
Do not dispatch subagents. A groundwork track is a conversation, and fanning out loses the reasoning that makes the folder worth keeping. A search too large to run inline is a finding that the question is too broad.
|
|
65
|
+
|
|
66
|
+
## Open question format
|
|
67
|
+
|
|
68
|
+
Every open question carries a lean, wherever it appears: inside a topic file, in `00-scope.md`, and in the chat output. A bare numbered list hands the reader a quiz and defers the judgment the track exists to inform.
|
|
69
|
+
|
|
70
|
+
```markdown
|
|
71
|
+
1. <question>
|
|
72
|
+
- Leaning: <where the evidence currently points>
|
|
73
|
+
- Overturned by: <the finding that would change it>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- `Leaning:` is weaker than a plan's `- Suggested:`. It records the current read on a question still open by definition, not a decision to accept by default at execution time.
|
|
77
|
+
- Pair every lean with what would overturn it. A lean with no falsifier is an opinion.
|
|
78
|
+
- On a measurement rather than a judgment, write `- Leaning: none, needs measuring` and drop the overturn line. A guess at a number is worse than an admission.
|
|
79
|
+
|
|
80
|
+
## Open mode
|
|
81
|
+
|
|
82
|
+
1. Create `.claude/.tmp/groundwork/<slug>/`.
|
|
83
|
+
2. Write `README.md` first. Writing it first forces the question of what the track is for.
|
|
84
|
+
3. Write `01-current-state.md` by measuring now. Never carry a figure from a previous session or from recall without re-measuring it. Measure only what an open question in the folder needs. A number with no question attached is how groundwork turns into the work.
|
|
85
|
+
4. Write `00-scope.md` when the track is large enough to run away. Skip it on a small track.
|
|
86
|
+
5. Add topic files at `02` through `05` as the subject demands. Close each one with its open questions in the format above.
|
|
87
|
+
6. Keep going. Revise, reframe, and take correction as the questions move. The folder is meant to be rewritten.
|
|
88
|
+
|
|
89
|
+
## Resume mode
|
|
90
|
+
|
|
91
|
+
1. Read `README.md` and its file map first, then the numbered files in order.
|
|
92
|
+
2. Do not re-measure what `01-current-state.md` holds unless the project moved under it. When it did move, re-measure and mark what changed.
|
|
93
|
+
3. Continue from the open questions carried at the end of each file. Add or rewrite files as those questions move.
|
|
94
|
+
4. Update the file map in `README.md` whenever a file is added or retired.
|
|
95
|
+
|
|
96
|
+
## Close mode
|
|
97
|
+
|
|
98
|
+
1. Write `06-decision.md`. It states the problem once, names the goal, lists what to do, and lists what was considered and dropped.
|
|
99
|
+
2. Write `07-next-session.md` self-contained, so it survives a compaction that loses the conversation.
|
|
100
|
+
3. Update the file map in `README.md`.
|
|
101
|
+
4. Write one task file in `.claude/tasks/` recording what the track concluded, even when the conclusion is to do nothing. Follow `.claude/standards/tasks.md` for the filename and frontmatter, or `${CLAUDE_SKILL_DIR}/../../standards/tasks.md` when the project does not have it. Aside from an experiment fixture, this is the only write permitted outside the folder.
|
|
102
|
+
5. Report uncited external claims. Closing already reads every file in the folder, so list any statement about a source outside the project that carries neither a link nor a lead entry. Report and do not block, because judging whether a sentence makes an external claim is the call a checker gets wrong.
|
|
103
|
+
|
|
104
|
+
Do not close while an open question quietly fails an outcome. Resolve it, or record it in `06-decision.md` as knowingly accepted.
|
|
105
|
+
|
|
106
|
+
## Output
|
|
107
|
+
|
|
108
|
+
Emit the full relative path from the project root for every file written or updated. Bare filenames are not clickable.
|
|
109
|
+
|
|
110
|
+
Open and resume:
|
|
111
|
+
|
|
112
|
+
```plaintext
|
|
113
|
+
📂 Opened .claude/.tmp/groundwork/<slug>/
|
|
114
|
+
|
|
115
|
+
**Written:**
|
|
116
|
+
|
|
117
|
+
- `.claude/.tmp/groundwork/<slug>/README.md`
|
|
118
|
+
- `.claude/.tmp/groundwork/<slug>/01-current-state.md`
|
|
119
|
+
|
|
120
|
+
**Open questions:**
|
|
121
|
+
|
|
122
|
+
1. <question>
|
|
123
|
+
- Leaning: <where the evidence currently points>
|
|
124
|
+
- Overturned by: <the finding that would change it>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Use `📂 Resumed` in place of `📂 Opened` on a resume pass.
|
|
128
|
+
|
|
129
|
+
Close:
|
|
130
|
+
|
|
131
|
+
```plaintext
|
|
132
|
+
✅ Closed .claude/.tmp/groundwork/<slug>/
|
|
133
|
+
|
|
134
|
+
**Written:**
|
|
135
|
+
|
|
136
|
+
- `.claude/.tmp/groundwork/<slug>/06-decision.md`
|
|
137
|
+
- `.claude/.tmp/groundwork/<slug>/07-next-session.md`
|
|
138
|
+
|
|
139
|
+
**Uncited external claims:** <count, or none>
|
|
140
|
+
|
|
141
|
+
- `<file>`: <the claim>
|
|
142
|
+
|
|
143
|
+
<the decision in one line>
|
|
144
|
+
|
|
145
|
+
Next: /claude-feature
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Omit the uncited-claims block when the count is zero.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Groundwork folder reference
|
|
3
|
+
description: Reserved file numbers, required file contents, and anti-patterns for a .claude/.tmp/groundwork/ folder
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Groundwork folder reference
|
|
7
|
+
|
|
8
|
+
Applies to a groundwork folder at `.claude/.tmp/groundwork/<slug>/`. The numbering is the table of contents: a reader opens the folder and knows where to start and what follows, with no index maintained inside each file. Protect that first, because the instinct when adding a file mid-track is to name it for its topic instead.
|
|
9
|
+
|
|
10
|
+
The folder is gitignored and unbacked. It dies with the machine, which is why the handoff file has to be self-contained.
|
|
11
|
+
|
|
12
|
+
## Reserved numbers
|
|
13
|
+
|
|
14
|
+
Five slots carry a fixed meaning. The rest are free, which is what lets the middle of a folder follow its subject.
|
|
15
|
+
|
|
16
|
+
| Number | Holds | Required |
|
|
17
|
+
| ------------ | ----------------------------------------------- | --------------------------- |
|
|
18
|
+
| `00` | Scope: constraints, risks, question list | Large tracks only |
|
|
19
|
+
| `01` | Current state, measured | Always |
|
|
20
|
+
| `02` to `05` | Topic files, whatever the subject demands | As needed |
|
|
21
|
+
| `06` | Decision | To close |
|
|
22
|
+
| `07` | Handoff, self-contained | To close |
|
|
23
|
+
| `08` | Spikes: method, result, and cost per experiment | Tracks that run experiments |
|
|
24
|
+
|
|
25
|
+
A folder missing `06` and `07` is live. That is the only status marker, and no separate tracking is needed.
|
|
26
|
+
|
|
27
|
+
`08` sits after the closing files because it is an appendix. It holds evidence rather than a topic, so folding it into the `02` to `05` range buries it, and a track closes with or without one.
|
|
28
|
+
|
|
29
|
+
## README.md
|
|
30
|
+
|
|
31
|
+
Orients. Holds no findings.
|
|
32
|
+
|
|
33
|
+
- A one-line definition of the investigation
|
|
34
|
+
- The date opened
|
|
35
|
+
- A `## Why` section stating why the track is running now
|
|
36
|
+
- A file-map table of filename and what it holds, kept current as files are added or retired
|
|
37
|
+
- A `## Method` section splitting internal sources from external ones, naming which were used and which were not yet done, and listing under a leads heading any external source found but not opened
|
|
38
|
+
- A `## Prior art` section
|
|
39
|
+
- A `## Source citation` section stating the rule below, so a returning session picks it up from the folder
|
|
40
|
+
- The phase stated out loud in the first three lines, in the form `Groundwork phase. Nothing here is a feature plan.`
|
|
41
|
+
|
|
42
|
+
The file map is how a returning reader re-enters. After the decision, it is the highest-value thing in the folder.
|
|
43
|
+
|
|
44
|
+
Every claim about a source outside the project carries a link to it, wherever the claim appears in the folder. A sentence asserting that the vendor documents something reads the same whether it came from a fetched page or from recall, and a later reader can neither check it nor tell the two apart.
|
|
45
|
+
|
|
46
|
+
A source found and not read is listed as a lead and is never cited. That half is what keeps the rule from producing citation theater, because a link attached to a page nobody opened is worse than no link. Listing it still pays, since it stops a later pass re-searching for what this one already surfaced.
|
|
47
|
+
|
|
48
|
+
Where the track supersedes an earlier plan or an earlier folder, name it and say not to go looking for it. Without that, the old reasoning keeps circulating.
|
|
49
|
+
|
|
50
|
+
## 01-current-state.md
|
|
51
|
+
|
|
52
|
+
Facts before opinion. Verified measurement only, taken during this pass.
|
|
53
|
+
|
|
54
|
+
- Never carry a figure from a previous session without re-measuring. Stale ratios survive a sunset that invalidates them, and every number built on top of one is quietly wrong.
|
|
55
|
+
- Mark an inference as an inference where one is unavoidable.
|
|
56
|
+
- Measure only what an open question needs. A number with no question attached is the mechanism by which the groundwork becomes the work.
|
|
57
|
+
|
|
58
|
+
## 00-scope.md
|
|
59
|
+
|
|
60
|
+
Written when the subject is large enough to run away. Holds constraints, risks, the open question list, and the downstream surfaces a decision would touch. A small track skips it and carries its questions inside the topic files.
|
|
61
|
+
|
|
62
|
+
## 06-decision.md
|
|
63
|
+
|
|
64
|
+
Closes the folder. Everything above it is input.
|
|
65
|
+
|
|
66
|
+
- The problem stated once
|
|
67
|
+
- The goal
|
|
68
|
+
- The items to do
|
|
69
|
+
- What was considered and dropped
|
|
70
|
+
|
|
71
|
+
The dropped list pays off later. It is what stops a future session re-proposing something already rejected.
|
|
72
|
+
|
|
73
|
+
## 07-next-session.md
|
|
74
|
+
|
|
75
|
+
Written to survive a compaction that loses the conversation. It repeats facts held elsewhere in the folder rather than pointing at them. That duplication is correct here and wrong everywhere else.
|
|
76
|
+
|
|
77
|
+
## 08-spikes.md
|
|
78
|
+
|
|
79
|
+
Evidence by experiment, sitting beside the evidence by measurement `01-current-state.md` holds. Optional, and most tracks never open it, because measuring what is already there settles most questions.
|
|
80
|
+
|
|
81
|
+
Each spike carries four things:
|
|
82
|
+
|
|
83
|
+
- The open question it answers, named by file and number. A spike attached to no question is the same runaway the current-state file is capped against.
|
|
84
|
+
- The method, stated fully enough for a later reader to re-run it. Name the fixture and where it lived, the exact command, and how many repetitions were run. A headless arm pointed at a fixture inside the repository measured the repository, so the fixture location is part of whether the result stands.
|
|
85
|
+
- The result, and which question it closes. A spike that settles nothing is still recorded, so a later pass does not pay to learn the same thing twice.
|
|
86
|
+
- The measured cost, and the caveats that bound what the result proves.
|
|
87
|
+
|
|
88
|
+
Cost is a report rather than a limit, and it is what makes the next spike estimable before anyone commits to it. Record it even when it comes to a single read.
|
|
89
|
+
|
|
90
|
+
Reach for a test harness the project already carries before building one. A track that needs an experiment no existing harness can express has found a finding, and it belongs in the folder rather than in a new abstraction.
|
|
91
|
+
|
|
92
|
+
One method error is worth naming here, because it was made and corrected rather than imagined. Counting matches in a transcript overstates whether a file was read, since an instruction that names a path puts that path in the transcript whether or not anything opened it. The check is the tool call.
|
|
93
|
+
|
|
94
|
+
## Conventions
|
|
95
|
+
|
|
96
|
+
- Questions carry an open or answered marker, and open ones repeat at the end of the file they belong to. That gives `06-decision.md` its agenda for free.
|
|
97
|
+
- Every open question carries a lean and what would overturn it, in the open question format in `SKILL.md`. A measurement question records that it needs measuring instead of guessing.
|
|
98
|
+
- State a number with what it settles. The strongest sections are the ones where a measurement answers a named question and says so.
|
|
99
|
+
- Send findings that would change an existing standard or rule to a backlog. Only a demonstrated failure changes one.
|
|
100
|
+
- Let the file count follow the number of genuinely separable questions, not the importance of the topic. A large topic with one question is a small folder.
|
|
101
|
+
|
|
102
|
+
## Anti-patterns
|
|
103
|
+
|
|
104
|
+
- **The groundwork becomes the work.** Gathering expands until the measuring costs more than the change it justifies. Cap it, and drop any thread with no question attached.
|
|
105
|
+
- **Deciding by omission.** Closing a track while an unresolved question quietly fails an outcome. Resolve it or record it as knowingly accepted.
|
|
106
|
+
- **Recording a constraint discovered while defending a decision.** Check a constraint against the alternative design before writing it down, or a fact about the current shape gets written up as inherent to the problem.
|
|
107
|
+
- **A plan written before the groundwork.** Every track that has done this had to supersede the plan it wrote.
|