@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,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-worktree
|
|
3
|
+
description: Lists linked worktrees with PR state and cleans up merged ones. Use when asked to "list worktrees", "clean up worktrees", or after shipping a PR to reclaim slots. Do NOT use to enter a worktree from scratch (use `claude-worktree`).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git worktree
|
|
7
|
+
|
|
8
|
+
List linked worktrees with their PR state and remove the merged ones. For entry, use `claude-worktree`.
|
|
9
|
+
|
|
10
|
+
## Shipping order
|
|
11
|
+
|
|
12
|
+
- Merge the branch with the smallest shared-file footprint first. A branch touching `CLAUDE.md`, a Claude context entry, or a regenerated `index.md` merges last.
|
|
13
|
+
- Rebase each sibling worktree on `origin/main` after a PR merges and before the next one merges. Never merge a stale branch.
|
|
14
|
+
- Run `cleanup` once a PR merges, so the worktree and its local branch go together
|
|
15
|
+
|
|
16
|
+
## Mode selection
|
|
17
|
+
|
|
18
|
+
Pick exactly one mode from the user's request:
|
|
19
|
+
|
|
20
|
+
- `list`: show every worktree with its branch, PR state, and dirtiness ("list worktrees", "what worktrees do I have")
|
|
21
|
+
- `cleanup`: remove worktrees whose branches are merged, then prune local branches ("clean up worktrees", "reclaim worktree slots")
|
|
22
|
+
|
|
23
|
+
## Context
|
|
24
|
+
|
|
25
|
+
Run in parallel:
|
|
26
|
+
|
|
27
|
+
- `git rev-parse --git-dir 2>/dev/null || echo "NO_REPO"`
|
|
28
|
+
- `git rev-parse --git-common-dir 2>/dev/null || echo "NO_REPO"`
|
|
29
|
+
- `git worktree list --porcelain 2>/dev/null || echo "NO_REPO"`
|
|
30
|
+
- `git fetch --prune origin 2>/dev/null || echo "NO_REMOTE"`
|
|
31
|
+
|
|
32
|
+
Resolve `MAIN_ROOT` from the first `worktree` line of `git worktree list --porcelain`.
|
|
33
|
+
|
|
34
|
+
## Guards
|
|
35
|
+
|
|
36
|
+
- If either `git-dir` command returned `NO_REPO`, stop: `❌ Not a git repository.`
|
|
37
|
+
|
|
38
|
+
## Enumeration (list and cleanup)
|
|
39
|
+
|
|
40
|
+
Parse `git worktree list --porcelain` into rows. Each row has `path`, `branch`, `head`. Skip the `bare` row if present.
|
|
41
|
+
|
|
42
|
+
For each row, determine merge state of its branch:
|
|
43
|
+
|
|
44
|
+
1. Skip the main-root row. Mark it `main` with no PR lookup.
|
|
45
|
+
2. Try `gh pr view <branch> --json state,number,url 2>/dev/null`:
|
|
46
|
+
- `MERGED`: state is `merged`, record PR number and URL.
|
|
47
|
+
- `OPEN`: state is `open`, record PR number and URL.
|
|
48
|
+
- `CLOSED`: state is `closed` (not merged), record PR number.
|
|
49
|
+
- Command fails or returns no PR: fall through.
|
|
50
|
+
3. Fallback: `git branch --merged main --format='%(refname:short)' 2>/dev/null | grep -qx "<branch>"` to detect linear-merge ancestry. On match, mark `merged (local)`. Otherwise `unmerged`. Match the name alone. Without `--format`, git decorates the current branch with `*` and every branch checked out in a linked worktree with `+`, which is the whole set being enumerated.
|
|
51
|
+
|
|
52
|
+
Determine dirtiness: `git -C <path> status --porcelain` non-empty means `dirty`.
|
|
53
|
+
|
|
54
|
+
Determine current: the row whose `path` equals `git rev-parse --show-toplevel`. Resolve the root rather than comparing `pwd`, which equals the worktree root only when the session sits at the top of it. A session in any subdirectory would match no row, and the current-worktree exclusion in `cleanup` would pass its own worktree into the remove set.
|
|
55
|
+
|
|
56
|
+
## `list` mode
|
|
57
|
+
|
|
58
|
+
Print the enumeration as a table, then stop. `list` has no final command.
|
|
59
|
+
|
|
60
|
+
```plaintext
|
|
61
|
+
| # | Path | Branch | State | PR | Notes |
|
|
62
|
+
| -- | ---------------------------------- | ----------------- | -------- | ------ | -------- |
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Notes column shows `current`, `dirty`, or empty. Show paths relative to `MAIN_ROOT` (`.claude/worktrees/<name>`).
|
|
66
|
+
|
|
67
|
+
After the table, append a one-line hint:
|
|
68
|
+
|
|
69
|
+
- If any row is `merged` and clean and not current: `Hint: /git-worktree cleanup to remove <count> merged worktrees.`
|
|
70
|
+
- Otherwise: `Hint: no worktrees ready for cleanup.`
|
|
71
|
+
|
|
72
|
+
## `cleanup` mode
|
|
73
|
+
|
|
74
|
+
From the enumeration, include a worktree in the remove set when all hold:
|
|
75
|
+
|
|
76
|
+
- Not the main row.
|
|
77
|
+
- Not the current session's worktree.
|
|
78
|
+
- State is `merged` or `merged (local)`.
|
|
79
|
+
- Working tree is clean.
|
|
80
|
+
|
|
81
|
+
Every other non-main row goes to the skip set with a one-word reason: `current`, `dirty`, `open`, `closed`, `unmerged`.
|
|
82
|
+
|
|
83
|
+
### Preview
|
|
84
|
+
|
|
85
|
+
```plaintext
|
|
86
|
+
**Removing:** <count>
|
|
87
|
+
|
|
88
|
+
| Path | Branch | PR |
|
|
89
|
+
| ---- | ------ | -- |
|
|
90
|
+
|
|
91
|
+
**Skipping:** <count>
|
|
92
|
+
|
|
93
|
+
| Path | Branch | Reason |
|
|
94
|
+
| ---- | ------ | ------ |
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
If the remove set is empty, stop with `❌ Nothing to remove. All linked worktrees are current, dirty, or unmerged.`
|
|
98
|
+
|
|
99
|
+
### Final command
|
|
100
|
+
|
|
101
|
+
After the preview, execute immediately. Claude Code's tool permission dialog is the confirmation gate. Do not wait for user input.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
git -C <MAIN_ROOT> worktree remove <path1> \
|
|
105
|
+
&& git -C <MAIN_ROOT> branch -D <branch1> \
|
|
106
|
+
&& git -C <MAIN_ROOT> worktree remove <path2> \
|
|
107
|
+
&& git -C <MAIN_ROOT> branch -D <branch2> \
|
|
108
|
+
&& git -C <MAIN_ROOT> worktree prune
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Chain one `worktree remove` + `branch -D` pair per row in the remove set, then a single `worktree prune` at the end.
|
|
112
|
+
|
|
113
|
+
## After execution
|
|
114
|
+
|
|
115
|
+
Respond with exactly one line:
|
|
116
|
+
|
|
117
|
+
- `list`: `✅ <n> worktrees listed`
|
|
118
|
+
- `cleanup`: `✅ Removed: <count> worktrees, <count> branches pruned`
|
|
119
|
+
|
|
120
|
+
Do not add any other text.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: migration-claude-md
|
|
3
|
+
description: Classifies each section of a target project's bloated `CLAUDE.md` into the three-tier context model and proposes moves to path-scoped rules or context entries, keeping only always-load behavior in `CLAUDE.md`. Use when asked to "slim CLAUDE.md", "migrate CLAUDE.md to rules", "rebalance CLAUDE.md", or when a project's `CLAUDE.md` has grown large. Do NOT move `docs/` files (that is `migration-context`) and do NOT auto-execute. Proposal only.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Claude md migrate
|
|
7
|
+
|
|
8
|
+
Rebalance a large `CLAUDE.md` so only always-load behavior stays in it, path-scoped behavior becomes a rule, and domain narrative becomes a context entry. Every move is a proposal the user applies by hand.
|
|
9
|
+
|
|
10
|
+
## Guards
|
|
11
|
+
|
|
12
|
+
- If no `CLAUDE.md` exists at `pwd`, stop: `❌ No CLAUDE.md found at the project root.`
|
|
13
|
+
- If `CLAUDE.md` has fewer than three `##` sections, stop: `✅ CLAUDE.md is already lean. Nothing to rebalance.`
|
|
14
|
+
|
|
15
|
+
## Step 1: discover
|
|
16
|
+
|
|
17
|
+
Run these in parallel from `pwd`:
|
|
18
|
+
|
|
19
|
+
- Read `CLAUDE.md`
|
|
20
|
+
- `ls .claude/rules/ 2>/dev/null`: existing rule subdirs and numbers for placement
|
|
21
|
+
- `ls .claude/context/ 2>/dev/null`: existing context entries for conflict checks
|
|
22
|
+
- `aitk claude seeds list --json 2>/dev/null`: the base seed set. Read the `CLAUDE.md` entry's `content` as the always-load baseline. Skip this input when `aitk` is not installed.
|
|
23
|
+
|
|
24
|
+
## Step 2: classify each section
|
|
25
|
+
|
|
26
|
+
Split `CLAUDE.md` by `##` heading. Score each section against this order:
|
|
27
|
+
|
|
28
|
+
1. **Always-load.** Stays in `CLAUDE.md`. Signals: cross-cutting behavior that applies every session, output and formatting rules, project-wide invariants, conventions with no file scope. A section that matches the seed baseline is always-load by definition. Keep it and propose no move.
|
|
29
|
+
2. **Path-scoped.** Propose a rule. Signals: behavior that only applies when working in a folder (`frontend/`, `backend/`) or on a file type, framework-specific conventions, "when editing X do Y" phrasing. Derive the glob from the named scope.
|
|
30
|
+
3. **Domain narrative.** Propose a context entry. Signals: prose describing how a system or domain is built, decisions, gotchas, structure. Not do-or-do-not rules.
|
|
31
|
+
4. **Mixed.** Both rule and narrative in one section. Flag as "needs manual split". Do not propose a single target.
|
|
32
|
+
|
|
33
|
+
## Step 3: resolve targets
|
|
34
|
+
|
|
35
|
+
For each section proposed for a move:
|
|
36
|
+
|
|
37
|
+
- Path-scoped: propose `.claude/rules/<subdir>/<n>-<slug>.md` with a `paths:` glob. Pick the subdir and a free number the way `create-rule` does. If `.claude/rules/<subdir>/` already holds a rule on the topic, mark as "conflict" and skip.
|
|
38
|
+
- Domain narrative: propose `.claude/context/<domain>.md`. If the entry already exists, propose appending rather than creating.
|
|
39
|
+
|
|
40
|
+
## Step 4: output
|
|
41
|
+
|
|
42
|
+
Print one grouped proposal block. Omit empty groups.
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
## Keep in CLAUDE.md
|
|
46
|
+
|
|
47
|
+
- `## <heading>` (<one-line reason: always-load behavior>)
|
|
48
|
+
|
|
49
|
+
## Extract to a path-scoped rule
|
|
50
|
+
|
|
51
|
+
- `## <heading>` → `.claude/rules/<subdir>/<n>-<slug>.md`, paths `<glob>` (<reason>)
|
|
52
|
+
|
|
53
|
+
## Extract to a context entry
|
|
54
|
+
|
|
55
|
+
- `## <heading>` → `.claude/context/<domain>.md` (<reason>)
|
|
56
|
+
|
|
57
|
+
## Needs manual split
|
|
58
|
+
|
|
59
|
+
- `## <heading>` (rule and narrative mixed)
|
|
60
|
+
|
|
61
|
+
## Conflicts
|
|
62
|
+
|
|
63
|
+
- `## <heading>` → `.claude/rules/<subdir>/<n>-<slug>.md` already exists. Skipping.
|
|
64
|
+
|
|
65
|
+
## Reminder
|
|
66
|
+
|
|
67
|
+
Scaffold each rule with create-rule and follow .claude/standards/rule.md.
|
|
68
|
+
Follow .claude/standards/context.md for each new context entry.
|
|
69
|
+
Run aitk indexes regen after adding context entries.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If every section classified as always-load, output: `✅ CLAUDE.md holds only always-load behavior. No moves proposed.`
|
|
73
|
+
|
|
74
|
+
Do not edit `CLAUDE.md`, and do not create the rule or context files. The user reviews the proposal, then applies each move by hand.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: migration-context
|
|
3
|
+
description: Classifies markdown files in a target project's `docs/` folder and proposes `git mv` commands to relocate agent-flavored content to `.claude/context/`. Use when asked to "migrate docs to context", "move docs to context", "split docs", or to align an existing project with the three-tier context model. Do NOT auto-execute moves or rewrite inbound links. Proposal only.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Claude context migrate
|
|
7
|
+
|
|
8
|
+
## Guards
|
|
9
|
+
|
|
10
|
+
- If no `docs/` directory exists at `pwd`, stop: `❌ No docs/ directory found.`
|
|
11
|
+
- If `docs/` contains no `.md` files at the top level, stop: `❌ No markdown files in docs/.`
|
|
12
|
+
- This skill operates on flat `docs/*.md` only. Subfolders under `docs/` are listed in the output as "manual review needed" and skipped.
|
|
13
|
+
|
|
14
|
+
## Step 1: discover
|
|
15
|
+
|
|
16
|
+
Run these in parallel from `pwd`:
|
|
17
|
+
|
|
18
|
+
- `ls docs/*.md 2>/dev/null`: list flat markdown files
|
|
19
|
+
- `ls docs/*/ 2>/dev/null`: detect subfolders for the manual-review note
|
|
20
|
+
- `ls .claude/context/ 2>/dev/null`: detect already-migrated content for conflict checks
|
|
21
|
+
- `aitk claude seeds list --json 2>/dev/null`: get the canonical seed list to identify seed-derived files
|
|
22
|
+
|
|
23
|
+
Read each discovered `docs/*.md` file in parallel.
|
|
24
|
+
|
|
25
|
+
## Step 2: classify
|
|
26
|
+
|
|
27
|
+
For each file, score against this rule order:
|
|
28
|
+
|
|
29
|
+
1. **Seed-derived.** Filename matches `development.md` or `ci.md` and content shape resembles the toolkit's base seed (frontmatter plus a Setup or Triggers section plus tables for scripts or checks). These belong to the seed-migration path. Do not propose a move here.
|
|
30
|
+
2. **Agent-flavored.** Score the following signals. Classify as agent-flavored when two or more match:
|
|
31
|
+
- Dense file paths in code fences
|
|
32
|
+
- Sections titled "Anti-patterns", "Layer responsibilities", "Conventions", or "Commands"
|
|
33
|
+
- Tables of CLI commands
|
|
34
|
+
- Explicit "do not" rules
|
|
35
|
+
3. **Human-only.** Default fallback when no agent signals match. Typical signals:
|
|
36
|
+
- Tutorial prose
|
|
37
|
+
- Sections titled "Welcome", "Getting started", "Contributing", or "Installation"
|
|
38
|
+
- Second-person narrative aimed at new contributors
|
|
39
|
+
4. **Mixed.** Both agent and human signals present. Flag as "needs manual split". Do not propose a move.
|
|
40
|
+
|
|
41
|
+
## Step 3: check conflicts and inbound links
|
|
42
|
+
|
|
43
|
+
For every file proposed for a move:
|
|
44
|
+
|
|
45
|
+
- If `.claude/context/<filename>` already exists, mark as "conflict" and skip the move.
|
|
46
|
+
- Run `git grep -n "docs/<filename>"` (or grep equivalent) to list inbound references in `CLAUDE.md`, `README.md`, and other markdown. Report each as a TODO line. Do not rewrite.
|
|
47
|
+
|
|
48
|
+
## Step 4: output
|
|
49
|
+
|
|
50
|
+
Print one grouped proposal block. Omit empty groups.
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
## Move to .claude/context/
|
|
54
|
+
|
|
55
|
+
- docs/<file>.md → .claude/context/<file>.md (<one-line reason>)
|
|
56
|
+
|
|
57
|
+
## Keep in docs/
|
|
58
|
+
|
|
59
|
+
- docs/<file>.md (<one-line reason>)
|
|
60
|
+
|
|
61
|
+
## Defer to claude-seed-sync
|
|
62
|
+
|
|
63
|
+
- docs/<file>.md (matches toolkit base seed)
|
|
64
|
+
|
|
65
|
+
## Needs manual split
|
|
66
|
+
|
|
67
|
+
- docs/<file>.md (mixed agent and human signals)
|
|
68
|
+
|
|
69
|
+
## Conflicts
|
|
70
|
+
|
|
71
|
+
- docs/<file>.md → .claude/context/<file>.md already exists. Skipping.
|
|
72
|
+
|
|
73
|
+
## Subfolders (manual review)
|
|
74
|
+
|
|
75
|
+
- docs/<subfolder>/
|
|
76
|
+
|
|
77
|
+
## Suggested git mv commands
|
|
78
|
+
|
|
79
|
+
git mv docs/<file>.md .claude/context/<file>.md
|
|
80
|
+
|
|
81
|
+
## Inbound links to fix after moves
|
|
82
|
+
|
|
83
|
+
- CLAUDE.md:42 references docs/<file>.md
|
|
84
|
+
- README.md:17 references docs/<file>.md
|
|
85
|
+
|
|
86
|
+
## Reminder
|
|
87
|
+
|
|
88
|
+
Run aitk indexes regen to update .claude/context/index.md.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
If every file classified as "Keep in docs/", output: `✅ All docs/ content is human-facing. No moves proposed.`
|
|
92
|
+
|
|
93
|
+
Do not execute the `git mv` commands. Do not edit `CLAUDE.md` or `README.md`. The user runs the commands and fixes the links manually after reviewing.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: migration-standards
|
|
3
|
+
description: Proposes `git mv` commands to relocate a target project's root `standards/` and `snippets/` folders into `.claude/standards/` and `.claude/snippets/`, the install layout newer toolkit versions expect. Use when asked to "relocate standards", "move standards to .claude", "migrate snippets to .claude", or after a toolkit upgrade leaves rules pointing at `.claude/standards/` while the files sit at the root. Do NOT auto-execute moves or edit rule files. Proposal only.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Claude standards relocate
|
|
7
|
+
|
|
8
|
+
## Guards
|
|
9
|
+
|
|
10
|
+
- If neither `standards/` nor `snippets/` exists at `pwd`, stop: `❌ No root standards/ or snippets/ to relocate.`
|
|
11
|
+
- If `pwd` is not a git work tree, stop: `❌ Not a git repository. git mv needs version control.`
|
|
12
|
+
|
|
13
|
+
## Step 1: discover
|
|
14
|
+
|
|
15
|
+
Run these in parallel from the project root:
|
|
16
|
+
|
|
17
|
+
- `ls standards/*.md 2>/dev/null`: root standards present
|
|
18
|
+
- `ls snippets/ 2>/dev/null`: root snippets present
|
|
19
|
+
- `ls .claude/standards/ 2>/dev/null`: detect an existing target copy
|
|
20
|
+
- `ls .claude/snippets/ 2>/dev/null`: detect an existing target copy
|
|
21
|
+
- `git status --short 2>/dev/null`: confirm a clean tree before proposing moves
|
|
22
|
+
|
|
23
|
+
## Step 2: check conflicts
|
|
24
|
+
|
|
25
|
+
- If `.claude/standards/` already holds `.md` files, mark standards as "already relocated" and skip its move.
|
|
26
|
+
- If `.claude/snippets/` already holds `.md` files, mark snippets as "already relocated" and skip its move.
|
|
27
|
+
- If `git status` is not clean, add a TODO line telling the user to commit or stash first. `git mv` on a dirty tree mixes the move with unrelated changes.
|
|
28
|
+
|
|
29
|
+
## Step 3: find author-owned inbound references
|
|
30
|
+
|
|
31
|
+
Toolkit-owned rules and skills are re-synced, so do not rewrite them. Surface only references the user authored:
|
|
32
|
+
|
|
33
|
+
- `git grep -n "standards/" -- 'CLAUDE.md' '.claude/rules/**' 'docs/**' 2>/dev/null`
|
|
34
|
+
- `git grep -n "snippets/" -- 'CLAUDE.md' '.claude/rules/**' 'docs/**' 2>/dev/null`
|
|
35
|
+
|
|
36
|
+
Report each hit as a TODO line. Exclude paths already under `.claude/standards/` or `.claude/snippets/`.
|
|
37
|
+
|
|
38
|
+
## Step 4: output
|
|
39
|
+
|
|
40
|
+
Print one grouped proposal block. Omit empty groups.
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
## Relocate
|
|
44
|
+
|
|
45
|
+
- standards/ → .claude/standards/ (<count> files)
|
|
46
|
+
- snippets/ → .claude/snippets/ (<count> files)
|
|
47
|
+
|
|
48
|
+
## Already relocated
|
|
49
|
+
|
|
50
|
+
- .claude/standards/ exists. Skipping.
|
|
51
|
+
|
|
52
|
+
## Suggested git mv commands
|
|
53
|
+
|
|
54
|
+
mkdir -p .claude
|
|
55
|
+
git mv standards .claude/standards
|
|
56
|
+
git mv snippets .claude/snippets
|
|
57
|
+
|
|
58
|
+
## Re-sync after moving
|
|
59
|
+
|
|
60
|
+
aitk standards sync .
|
|
61
|
+
aitk gov sync .
|
|
62
|
+
|
|
63
|
+
## Inbound references to verify
|
|
64
|
+
|
|
65
|
+
- CLAUDE.md:42 references standards/prose.md
|
|
66
|
+
- docs/contributing.md:8 references snippets/claude/feature
|
|
67
|
+
|
|
68
|
+
## Reminder
|
|
69
|
+
|
|
70
|
+
Re-syncing reinstalls toolkit-owned rules and standards at the new path. Author-owned references above need a manual one-line fix.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If both folders are already relocated, output: `✅ standards/ and snippets/ already live under .claude/. Nothing to relocate.`
|
|
74
|
+
|
|
75
|
+
Do not run the `git mv` commands. Do not edit `CLAUDE.md`, rule files, or docs. The user runs the commands and fixes author-owned references after reviewing.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-commands
|
|
3
|
+
description: Runs a command the project documents in `.claude/context/development.md` and stops there. Use when asked to "start the app", "start the dev server", "run the checks", "run the build", "spin it up", or "what commands does this project have". Do NOT use to confirm a change works in a running app, which needs verification past the launch. Do NOT use to deploy, publish, or release.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Project commands
|
|
7
|
+
|
|
8
|
+
Read `.claude/context/development.md` from the project root, run the command the user named, report where it landed, and stop.
|
|
9
|
+
|
|
10
|
+
The value is the stop. A launch that continues into log inspection, browser checks, or unrelated defects is the failure this skill exists to avoid.
|
|
11
|
+
|
|
12
|
+
## Guards
|
|
13
|
+
|
|
14
|
+
- Check that `.claude/context/development.md` exists before anything else. If it does not, stop: `❌ No .claude/context/development.md. This project has no documented dev loop.` Name the missing file and let the user decide. Do not read another file to reconstruct it, because a guess is worse than a stop when the user cannot see it was a guess.
|
|
15
|
+
- If the entry documents no command matching the request, stop and list what it does document. Do not infer a command from a filename or a framework.
|
|
16
|
+
- If the resolved command has an effect that outlives the process and stopping it does not undo, print it for the user to run and stop. Deploying, publishing, releasing, migrating, and resetting are the common shapes, and the test is the effect rather than the name. A script called `infra:apply` or `promote` qualifies.
|
|
17
|
+
|
|
18
|
+
## Step 1: read the entry
|
|
19
|
+
|
|
20
|
+
Read `.claude/context/development.md` from the project root, the whole entry rather than a named section. That file and no others. A second file is a discovery chain, and this skill has none.
|
|
21
|
+
|
|
22
|
+
## Step 2: resolve the command
|
|
23
|
+
|
|
24
|
+
Match the request against what the entry documents, reading the stated purpose and not only the command name. A project that documents two similar commands separately means the distinction, and the purpose column is where it says which is which.
|
|
25
|
+
|
|
26
|
+
When the request maps to more than one documented command, resolve all of them. A project that starts as a frontend and a backend has two rows in the table and one request covering both, and running one of the two reports success on half an app.
|
|
27
|
+
|
|
28
|
+
State the resolved command before running it. One line, no rationale.
|
|
29
|
+
|
|
30
|
+
## Step 3: run it
|
|
31
|
+
|
|
32
|
+
Run each resolved command as the entry writes it, from the project root. When a command only works from a subdirectory, the entry has to say so, since the table gives the skill nothing else to go on.
|
|
33
|
+
|
|
34
|
+
A command that terminates runs in the foreground. A command that stays up runs in the background, by setting the Bash tool's `run_in_background` parameter on the call. Nothing backgrounds a process on its own, and a foreground dev server blocks until the tool timeout kills it, which reports as a command that never came up and leaves nothing running.
|
|
35
|
+
|
|
36
|
+
Decide from what the entry says the command does, not from its name. When the entry does not say, treat a server, watcher, or preview as staying up.
|
|
37
|
+
|
|
38
|
+
- Read a backgrounded command's output back before checking anything against it. The call that starts it returns immediately and carries no port.
|
|
39
|
+
- Report the port or URL each command prints, and the log location when one exists
|
|
40
|
+
- Confirm a service came up with one check against what it reports listening on
|
|
41
|
+
- Leave a process the skill did not start alone. Never stop, restart, or reconfigure one.
|
|
42
|
+
- Do not tear down what the skill started. A session that starts a server and stops it has not done what was asked.
|
|
43
|
+
|
|
44
|
+
If a command fails or never comes up, report the failure and the last output. Do not retry with a different command, and do not abandon the others.
|
|
45
|
+
|
|
46
|
+
## Step 4: stop
|
|
47
|
+
|
|
48
|
+
Report and end the turn. Specifically do not:
|
|
49
|
+
|
|
50
|
+
- Run a second check after the first one passed
|
|
51
|
+
- Read the startup log for anything beyond a failure
|
|
52
|
+
- Open a browser, take a screenshot, or drive the running app
|
|
53
|
+
- Report a defect noticed while starting up, however real
|
|
54
|
+
|
|
55
|
+
Those belong to a verification request, which is a different ask. When one of them looks warranted, say so in one line and let the user decide.
|
|
56
|
+
|
|
57
|
+
## Output
|
|
58
|
+
|
|
59
|
+
```plaintext
|
|
60
|
+
▶️ <resolved command>
|
|
61
|
+
|
|
62
|
+
<what it reported: port, URL, or exit status>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
One block per command when the request resolved to more than one.
|
|
66
|
+
|
|
67
|
+
For a request with no command to run, list what the entry documents instead:
|
|
68
|
+
|
|
69
|
+
```plaintext
|
|
70
|
+
📋 Documented in .claude/context/development.md
|
|
71
|
+
|
|
72
|
+
- `<command>`: <purpose as the entry states it>
|
|
73
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: session-resume
|
|
3
|
+
description: Resumes a previous session by reading tracked work and relevant context. Use when starting a new session, or when asked to "pick up where we left off", "what was I working on", or "resume".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Session resume
|
|
7
|
+
|
|
8
|
+
## Step 1: read tracked work
|
|
9
|
+
|
|
10
|
+
Resolve `.claude/plans/`, `.claude/memory/`, and `.claude/tasks/` at the main worktree root per Worktrees in `CLAUDE.md`.
|
|
11
|
+
|
|
12
|
+
Read these in parallel, skipping any that do not exist:
|
|
13
|
+
|
|
14
|
+
- `.claude/tasks/index.md`: the backlog, one line per task. Read this before any individual task file.
|
|
15
|
+
- `.claude/plans/*.md`: execution detail for in-progress tasks
|
|
16
|
+
- `.claude/memory/MEMORY.md` and any memory files relevant to the top backlog item
|
|
17
|
+
|
|
18
|
+
Then read only the task files the summary needs, typically the top one. Do not read the whole folder.
|
|
19
|
+
|
|
20
|
+
If all three surfaces are absent or empty, stop: `✅ No tracked work found. Start a new task.`
|
|
21
|
+
|
|
22
|
+
## Step 2: summarize
|
|
23
|
+
|
|
24
|
+
Output three sections:
|
|
25
|
+
|
|
26
|
+
**Up next:** one line per entry in `.claude/tasks/index.md`, preserving order.
|
|
27
|
+
|
|
28
|
+
**Active plans:** one line per file in `.claude/plans/`, linking each to its task file in `.claude/tasks/`. Say "None" if empty.
|
|
29
|
+
|
|
30
|
+
**Relevant context:** two or three memory entries that inform the top backlog item. Skip if none apply.
|
|
31
|
+
|
|
32
|
+
## Step 3: recommend
|
|
33
|
+
|
|
34
|
+
End with one line: `Start with: <first Up next item>` and note whether it has a linked plan.
|
|
35
|
+
|
|
36
|
+
Do not offer to remove entries. A completed task is archived out of `.claude/tasks/` when work ships. The git log is the authoritative record of shipped work. Plan files are archived per the plan lifecycle rule in `CLAUDE.md`. Memory is updated only when a recorded fact becomes wrong, never on resume.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-gov
|
|
3
|
+
description: Detects a project's stack from its files and installs matching toolkit governance rules into `.claude/rules/`. Use after scaffolding a new project, when asked to "install gov rules", "install governance", "set up governance", or when a target project has no `.claude/rules/` yet. Assumes the `aitk` CLI is on PATH.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Gov install
|
|
7
|
+
|
|
8
|
+
Automates `aitk gov install` by inferring the stack and extras from the current project, then shelling out to the CLI with the resolved arguments.
|
|
9
|
+
|
|
10
|
+
## Read the catalog
|
|
11
|
+
|
|
12
|
+
Run this first to load the current stacks and rules. Never hardcode names. The catalog is the source of truth.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
aitk gov list --json 2>/dev/null
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Detect the stack
|
|
19
|
+
|
|
20
|
+
Read these from the project root in parallel:
|
|
21
|
+
|
|
22
|
+
- `package.json`: dependencies and devDependencies
|
|
23
|
+
- Root config files: `astro.config.*`, `next.config.*`, `vite.config.*`, `tailwind.config.*`, `tsconfig.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`
|
|
24
|
+
- `.claude/REQUIREMENTS.md` and `.claude/ARCHITECTURE.md` if present
|
|
25
|
+
- Directory structure via `ls -1` of the project root and `src/` if present
|
|
26
|
+
|
|
27
|
+
## Match
|
|
28
|
+
|
|
29
|
+
Match the detected evidence to the catalog:
|
|
30
|
+
|
|
31
|
+
- Pick the closest stack. Match detected runtime or framework against stack names in the catalog.
|
|
32
|
+
- Identify additional technologies not already covered by the picked stack. For each, find a rule whose `description` or `paths` points at that technology, then add it via `--add`.
|
|
33
|
+
- Dedupe extras against stack rules. Do not add a rule the stack already pulls in.
|
|
34
|
+
|
|
35
|
+
## Gap handling
|
|
36
|
+
|
|
37
|
+
If a detected technology has no matching rule, stop and surface the gap. Do not guess.
|
|
38
|
+
|
|
39
|
+
Present three options:
|
|
40
|
+
|
|
41
|
+
1. Author a new rule in the toolkit at `governance/rules/<domain>/<num>-<name>.md` following `.claude/standards/rule.md`, or `${CLAUDE_SKILL_DIR}/../../standards/rule.md` when the project does not have it, commit, then re-run install.
|
|
42
|
+
2. Install the matching non-<tech> rules and skip the tech-specific layer.
|
|
43
|
+
3. Abort.
|
|
44
|
+
|
|
45
|
+
Rules are authored in the toolkit repository, never in the target project on the fly.
|
|
46
|
+
|
|
47
|
+
## Preview
|
|
48
|
+
|
|
49
|
+
Before executing, output:
|
|
50
|
+
|
|
51
|
+
- **Detected:** each technology with the file that evidenced it
|
|
52
|
+
- **Stack:** picked stack name and total resolved rule count
|
|
53
|
+
- **Extras:** each `--add` rule with a one-line reason
|
|
54
|
+
- **Target:** resolved target path
|
|
55
|
+
- **Command:** the exact shell command to run
|
|
56
|
+
|
|
57
|
+
## Execute
|
|
58
|
+
|
|
59
|
+
Run with `AITK_NON_INTERACTIVE=1` so no CLI picker prompts appear. Claude Code's tool permission dialog is the confirmation gate.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
AITK_NON_INTERACTIVE=1 aitk gov install <stack> --add <extras> <target>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Response
|
|
66
|
+
|
|
67
|
+
After execution, report:
|
|
68
|
+
|
|
69
|
+
- Rule count installed
|
|
70
|
+
- Target path
|
|
71
|
+
- Any rules that failed to resolve (the CLI warns on missing rule files)
|