@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,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-ship
|
|
3
|
+
description: What the ship chain is for, the gaps it closes, and why it does not implement or review
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git ship requirement
|
|
7
|
+
|
|
8
|
+
## Gap
|
|
9
|
+
|
|
10
|
+
Without this skill, the post-feature sequence runs from memory. Doc sync gets skipped, so the pull request ships with planning docs describing the previous scope, or it runs after staging has already closed and its output never reaches a commit. Chaining by hand is also where a session narrates between steps, which turns one flow into a conversation and invites a decision at every boundary.
|
|
11
|
+
|
|
12
|
+
## Must
|
|
13
|
+
|
|
14
|
+
- Invoke each step through the Skill tool in the stated order and continue without waiting
|
|
15
|
+
- Stage after the sync skills write, so what they produced reaches a commit
|
|
16
|
+
- Emit no text between steps. The sequence is the unit and prose inside it reopens settled decisions.
|
|
17
|
+
- Watch continuous integration to a terminal state, and stop on a failure naming the check
|
|
18
|
+
- Stop memory work at the Propose phase
|
|
19
|
+
|
|
20
|
+
## Must not
|
|
21
|
+
|
|
22
|
+
- Auto-trigger. Shipping is a decision the user takes, which is what the disabled model invocation encodes.
|
|
23
|
+
- Fix a failing check. The stop is the point, since a green pull request reached by auto-fix hides what broke.
|
|
24
|
+
- Run the memory Apply phase. Promoting an entry changes how the agent operates and ships as its own change.
|
|
25
|
+
- Implement, verify, or review. This chain starts from work already believed done.
|
|
26
|
+
|
|
27
|
+
## Guards
|
|
28
|
+
|
|
29
|
+
- A failing check stops the sequence. This is the one place text is allowed between steps.
|
|
30
|
+
|
|
31
|
+
## Out of scope
|
|
32
|
+
|
|
33
|
+
- Implementation, verification, and review, which `claude-autoship` chains ahead of this same sequence. That skill is the full pipeline and this one is the resume point after a stop, which is why the two overlap by design.
|
|
34
|
+
- The behavior of each step, owned by the skill invoked. This skill owns the order and nothing else.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-ship
|
|
3
|
+
description: Runs the full post-feature workflow by syncing docs, staging commits, renaming the branch, and opening a PR. Use after implementing a feature, or when asked to "ship", "ship this", or "ship it".
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Ship
|
|
8
|
+
|
|
9
|
+
Run the full post-feature workflow by invoking each skill in sequence using the Skill tool. After each skill returns, invoke the next step immediately in the same response. Do not output any text between steps and do not wait for user input. Tool permission dialogs are the only interrupts allowed. The final output is `✅ Shipped`.
|
|
10
|
+
|
|
11
|
+
## Pre-check
|
|
12
|
+
|
|
13
|
+
Run `git diff --cached --name-only 2>/dev/null` to check for staged files. If output is empty and there are unstaged changes, run `git add -A` to stage everything before proceeding.
|
|
14
|
+
|
|
15
|
+
## Sequence
|
|
16
|
+
|
|
17
|
+
1. Invoke `aitk:claude-docs` to sync internal planning docs against session decisions
|
|
18
|
+
2. Invoke `aitk:docs-sync` to sync public docs against changes since main
|
|
19
|
+
3. Run `git add -A` to stage any files the sync skills wrote
|
|
20
|
+
4. Invoke `aitk:git-stage` to group staged changes and commit by concern
|
|
21
|
+
5. Invoke `aitk:git-branch` to rename branch to match conventional format
|
|
22
|
+
6. Invoke `aitk:git-pr` to push branch and open pull request
|
|
23
|
+
7. After the PR opens, watch CI. Poll `gh pr checks <number>` until no check is pending, then read the final status. On all-pass, continue. On any failure, stop the sequence and report the failing check with its URL. Do not auto-fix. This step may output on failure, the one exception to the no-text-between-steps rule.
|
|
24
|
+
8. Invoke `aitk:claude-memory-capture` to extract durable patterns from the session into `.claude/memory/`
|
|
25
|
+
9. If `claude-memory-capture` wrote or updated at least one entry this session, invoke `aitk:claude-memory-review` scoped to those entries to propose fixes while session context is fresh. If capture wrote nothing, skip this step.
|
|
26
|
+
|
|
27
|
+
Stop at the Propose phase. Do not run Apply. Promoting an entry to `CLAUDE.md` or a skill body ships as its own change, separate from this feature.
|
|
28
|
+
|
|
29
|
+
## After completion
|
|
30
|
+
|
|
31
|
+
Output up to three lines:
|
|
32
|
+
|
|
33
|
+
```plaintext
|
|
34
|
+
✅ Shipped
|
|
35
|
+
<N memories captured in .claude/memory/>
|
|
36
|
+
<Memory proposal at .claude/review/memory-review-<slug>.md>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Omit the second and third lines if `claude-memory-capture` wrote nothing this session, since no captures means no scoped review and no proposal.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-split
|
|
3
|
+
description: What branch splitting is for, the gaps it closes, and how it differs from grouping a staged diff
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git split requirement
|
|
7
|
+
|
|
8
|
+
## Gap
|
|
9
|
+
|
|
10
|
+
Without this skill, a branch carrying unrelated commits ships as one pull request, which a reviewer reads by skimming because no single concern holds it together. Split by hand, commits get cherry-picked in an order that leaves a branch missing something it depends on. Merge order is the sharpest failure: merging the wrong branch first lands every other branch's content on main and leaves the remaining pull requests empty after rebase, with no signal that anything went wrong.
|
|
11
|
+
|
|
12
|
+
## Must
|
|
13
|
+
|
|
14
|
+
- Refuse a dirty tree, since cherry-picking across branches abandons uncommitted work with no record of it
|
|
15
|
+
- Group by concern from both the commit messages and the file paths, preferring fewer branches over a branch per commit
|
|
16
|
+
- Classify the groups as independent or stacked before generating any command, because the base of every branch follows from that one call
|
|
17
|
+
- Account for every commit ahead of main in the preview
|
|
18
|
+
- State the merge order and the reason behind it, since the order is not recoverable from reading the pull requests afterward
|
|
19
|
+
- Carry the restack loop for stacked mode, where each branch is rebased onto main once the one below it merges
|
|
20
|
+
|
|
21
|
+
## Must not
|
|
22
|
+
|
|
23
|
+
- Split when one concern already covers the branch
|
|
24
|
+
- Rename a branch whose name already matches its concern
|
|
25
|
+
- Leave a commit unaccounted for. A dropped commit is silent and the branch it came from may already be gone.
|
|
26
|
+
- Merge the pull requests it opens
|
|
27
|
+
|
|
28
|
+
## Guards
|
|
29
|
+
|
|
30
|
+
- Dirty working tree: stop and name both recoveries
|
|
31
|
+
- On `main`: stop
|
|
32
|
+
- No commits ahead of main: stop
|
|
33
|
+
|
|
34
|
+
## Out of scope
|
|
35
|
+
|
|
36
|
+
- Partitioning a staged diff into commits, which `git-stage` owns. The two resemble each other and take different input: this one starts from commits that already exist and emits branches.
|
|
37
|
+
- The message on each commit, which `git-commit` owns
|
|
38
|
+
- Merging, which stays the user's call. The skill states the order and stops.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-split
|
|
3
|
+
description: Splits a mixed-commit branch into focused branches off main using cherry-pick. Use when a branch has unrelated commits, asking "split this branch", or needing to separate concerns into reviewable PRs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git split
|
|
7
|
+
|
|
8
|
+
Before proposing a split, read in parallel:
|
|
9
|
+
|
|
10
|
+
- `${CLAUDE_SKILL_DIR}/references/branch.md`: format, types, length limit, and constraints
|
|
11
|
+
- `${CLAUDE_SKILL_DIR}/references/pr.md`: PR title format, body sections, and content rules
|
|
12
|
+
|
|
13
|
+
Follow both exactly.
|
|
14
|
+
|
|
15
|
+
## Context
|
|
16
|
+
|
|
17
|
+
Run these commands in parallel to gather git context:
|
|
18
|
+
|
|
19
|
+
- `git status --porcelain 2>/dev/null || echo "NO_STATUS"`
|
|
20
|
+
- `git branch --show-current 2>/dev/null || echo "NO_BRANCH"`
|
|
21
|
+
- `git log main..HEAD --oneline --no-decorate --stat 2>/dev/null || echo "NO_COMMITS"`
|
|
22
|
+
|
|
23
|
+
## Guards
|
|
24
|
+
|
|
25
|
+
- If working tree is dirty (non-empty `git status --porcelain`), stop:
|
|
26
|
+
`❌ Working tree is dirty. Commit or stash changes before splitting.`
|
|
27
|
+
- If current branch is `main` or `master`, stop:
|
|
28
|
+
`❌ Already on main. Nothing to split.`
|
|
29
|
+
- If no commits ahead of main, stop:
|
|
30
|
+
`❌ No commits ahead of main. Nothing to split.`
|
|
31
|
+
|
|
32
|
+
## Grouping rules
|
|
33
|
+
|
|
34
|
+
- Group commits by concern using both commit messages and file paths.
|
|
35
|
+
- Prefer fewer branches: combine related commits into one branch.
|
|
36
|
+
- Only split into separate branches when concerns are clearly independent.
|
|
37
|
+
- Identify the primary concern of the current branch. Rename it using `git branch -m` if the current name does not already match. Skip the rename if it already matches. Secondary concerns are extracted as new focused branches via cherry-pick.
|
|
38
|
+
- If no single concern dominates (dumping-ground branch with no clear primary), split all commits into new focused branches and add `git branch -d <current>` to delete the original.
|
|
39
|
+
- Propose one new branch per secondary concern following branch.md format.
|
|
40
|
+
- Classify groups as independent or stacked before generating commands.
|
|
41
|
+
- Independent groups: each group's commits apply to `main` without the others. Base every branch on `main`.
|
|
42
|
+
- Stacked groups: groups are ordered and each depends on the commits before it. Base each branch on the previous group's branch. Cherry-pick only that group's commits onto it. The base branch already carries all prior commits.
|
|
43
|
+
|
|
44
|
+
## Response format
|
|
45
|
+
|
|
46
|
+
### Preview
|
|
47
|
+
|
|
48
|
+
**Current branch:** <branch_name>
|
|
49
|
+
**Total commits ahead of main:** <count>
|
|
50
|
+
**Mode:** Independent | Stacked
|
|
51
|
+
|
|
52
|
+
| Group | Branch | Base | Commits | Count |
|
|
53
|
+
| --------- | -------------------- | -------------- | ------- | ----- |
|
|
54
|
+
| <concern> | <type>/<description> | main | <shas> | <n> |
|
|
55
|
+
| <concern> | <type>/<description> | <prior-branch> | <shas> | <n> |
|
|
56
|
+
|
|
57
|
+
**All <total> commits accounted for.**
|
|
58
|
+
|
|
59
|
+
- For the primary concern (the current branch), show `<current_branch> → <new_name>` only when renaming. Show just `<current_branch>` if the existing name already matches the concern.
|
|
60
|
+
- For stacked mode, list rows in merge order: branches based on `main` first, then each layer above. For independent mode, list the primary concern first.
|
|
61
|
+
|
|
62
|
+
If Mode is Stacked, append this line to the preview:
|
|
63
|
+
|
|
64
|
+
`🔁 Sequential squash-merge loop. Squash-merge each PR bottom-up with --delete-branch. After each merge, signal me so I can restack the next branch onto main before you merge it.`
|
|
65
|
+
|
|
66
|
+
If Mode is Independent, append this line to the preview:
|
|
67
|
+
|
|
68
|
+
`🔁 Squash-merge secondaries first, primary last. The primary keeps every cherry-picked commit, so merging it first lands every secondary's content on main and leaves the secondary PRs empty after rebase.`
|
|
69
|
+
|
|
70
|
+
After outputting the preview, execute the final commands immediately. Claude Code's tool permission dialog is the confirmation gate. Do not wait for user input.
|
|
71
|
+
|
|
72
|
+
### Final commands
|
|
73
|
+
|
|
74
|
+
For independent mode, base every branch on `main`:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Rename current branch to reflect primary concern
|
|
78
|
+
git branch -m <current_branch> <new_name>
|
|
79
|
+
|
|
80
|
+
# Create, cherry-pick, push, and open PR for each secondary branch
|
|
81
|
+
mkdir -p .claude/.tmp/pr-split
|
|
82
|
+
git switch -c <branch> main && git cherry-pick <sha> <sha> \
|
|
83
|
+
&& git push -u origin <branch> \
|
|
84
|
+
&& (cat <<'BODY' > .claude/.tmp/pr-split/<branch>.md
|
|
85
|
+
<body following pr.md template, written from the cherry-picked commits>
|
|
86
|
+
BODY
|
|
87
|
+
) && gh pr create --title "<title>" --body-file .claude/.tmp/pr-split/<branch>.md \
|
|
88
|
+
&& rm .claude/.tmp/pr-split/<branch>.md
|
|
89
|
+
|
|
90
|
+
# Return to primary branch, push, and open its PR
|
|
91
|
+
git checkout <new_name> && git push -u origin <new_name> \
|
|
92
|
+
&& (cat <<'BODY' > .claude/.tmp/pr-split/<new_name>.md
|
|
93
|
+
<body following pr.md template, written from the primary's commits>
|
|
94
|
+
BODY
|
|
95
|
+
) && gh pr create --title "<title>" --body-file .claude/.tmp/pr-split/<new_name>.md \
|
|
96
|
+
&& rm .claude/.tmp/pr-split/<new_name>.md
|
|
97
|
+
|
|
98
|
+
# Clean up the body-file dir if all PRs succeeded (no-op when non-empty)
|
|
99
|
+
rmdir .claude/.tmp/pr-split 2>/dev/null || true
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
For stacked mode, base each branch on the previous and cherry-pick only that group's commits:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Rename current branch to reflect primary concern
|
|
106
|
+
git branch -m <current_branch> <new_name>
|
|
107
|
+
|
|
108
|
+
mkdir -p .claude/.tmp/pr-split
|
|
109
|
+
|
|
110
|
+
# Group 1: based on main
|
|
111
|
+
git switch -c <branch-1> main && git cherry-pick <g1-sha> <g1-sha> \
|
|
112
|
+
&& git push -u origin <branch-1> \
|
|
113
|
+
&& (cat <<'BODY' > .claude/.tmp/pr-split/<branch-1>.md
|
|
114
|
+
<body following pr.md template, written from the cherry-picked commits>
|
|
115
|
+
BODY
|
|
116
|
+
) && gh pr create --title "<title>" --body-file .claude/.tmp/pr-split/<branch-1>.md \
|
|
117
|
+
&& rm .claude/.tmp/pr-split/<branch-1>.md
|
|
118
|
+
|
|
119
|
+
# Group 2: based on <branch-1>, this group's commits only
|
|
120
|
+
git checkout -b <branch-2> && git cherry-pick <g2-sha> <g2-sha> \
|
|
121
|
+
&& git push -u origin <branch-2> \
|
|
122
|
+
&& (cat <<'BODY' > .claude/.tmp/pr-split/<branch-2>.md
|
|
123
|
+
<body following pr.md template, written from the cherry-picked commits>
|
|
124
|
+
BODY
|
|
125
|
+
) && gh pr create --title "<title>" --body-file .claude/.tmp/pr-split/<branch-2>.md \
|
|
126
|
+
&& rm .claude/.tmp/pr-split/<branch-2>.md
|
|
127
|
+
|
|
128
|
+
# Return to primary branch, push, and open its PR
|
|
129
|
+
git checkout <new_name> && git push -u origin <new_name> \
|
|
130
|
+
&& (cat <<'BODY' > .claude/.tmp/pr-split/<new_name>.md
|
|
131
|
+
<body following pr.md template, written from the primary's commits>
|
|
132
|
+
BODY
|
|
133
|
+
) && gh pr create --title "<title>" --body-file .claude/.tmp/pr-split/<new_name>.md \
|
|
134
|
+
&& rm .claude/.tmp/pr-split/<new_name>.md
|
|
135
|
+
|
|
136
|
+
# Clean up the body-file dir if all PRs succeeded (no-op when non-empty)
|
|
137
|
+
rmdir .claude/.tmp/pr-split 2>/dev/null || true
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## After execution
|
|
141
|
+
|
|
142
|
+
Respond with exactly one line:
|
|
143
|
+
|
|
144
|
+
`✅ Renamed: <old> → <new> | PRs: <primary-url>, <url1>, <url2>`
|
|
145
|
+
|
|
146
|
+
Do not add any other text.
|
|
147
|
+
|
|
148
|
+
## Stacked merge loop
|
|
149
|
+
|
|
150
|
+
When the user signals the previous stacked PR has merged, restack the next one.
|
|
151
|
+
|
|
152
|
+
1. Rebase and push. The own-commit-count comes from the original split table.
|
|
153
|
+
`git fetch origin main && git checkout <branch> && git rebase --onto origin/main HEAD~<own-commit-count> && git push --force-with-lease`
|
|
154
|
+
2. Verify the PR's base auto-retargeted to main with `gh pr view <num> --json baseRefName`. If not, `gh pr edit <num> --base main`.
|
|
155
|
+
3. Reply: `✅ <branch> rebased onto main. Ready for squash-merge.`
|
|
156
|
+
|
|
157
|
+
Edge cases:
|
|
158
|
+
|
|
159
|
+
- If this branch's commits modify a file added by an unmerged upstream PR, wait for that PR to merge before rebasing.
|
|
160
|
+
- If the PR was orphaned by base-branch deletion, recreate it with `gh pr create --base main --head <branch>` and a regenerated body.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Branch reference
|
|
3
|
+
description: Branch naming format and type conventions
|
|
4
|
+
consumers: git-branch, git-split, git-pr, claude-standards-audit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Branch reference
|
|
8
|
+
|
|
9
|
+
## Format
|
|
10
|
+
|
|
11
|
+
- Structure: `<type>/<description>` or `<type>/<ticket>-<description>`
|
|
12
|
+
- Length: 50 characters maximum
|
|
13
|
+
- Casing: kebab-case only, no underscores or camelCase
|
|
14
|
+
- Description: 2 words maximum, 3 only when genuinely needed for specificity
|
|
15
|
+
- Capture the core change, not the commit message verbatim
|
|
16
|
+
- For branches with multiple commits, use the unifying concern as the description.
|
|
17
|
+
- Do not duplicate type in description (e.g., `feat/feature-login`)
|
|
18
|
+
|
|
19
|
+
## Types
|
|
20
|
+
|
|
21
|
+
- `feat`: new feature or capability
|
|
22
|
+
- `fix`: bug fix
|
|
23
|
+
- `refactor`: structural changes (not a fix or feature)
|
|
24
|
+
- `docs`: documentation only (README)
|
|
25
|
+
- `chore`: maintenance tasks (deps, tooling, configs)
|
|
26
|
+
- `perf`: performance improvements
|
|
27
|
+
- `test`: add or modify tests
|
|
28
|
+
- `style`: code formatting (whitespace, semicolons)
|
|
29
|
+
- `build`: build system changes (webpack, npm scripts)
|
|
30
|
+
- `ci`: CI/CD pipeline changes (GitHub Actions)
|
|
31
|
+
- `revert`: revert a previous commit
|
|
32
|
+
|
|
33
|
+
## Examples
|
|
34
|
+
|
|
35
|
+
### Correct
|
|
36
|
+
|
|
37
|
+
```plaintext
|
|
38
|
+
feat/jwt-expiration # clear feature scope
|
|
39
|
+
fix/AUTH-123-connection-pool # includes ticket ID
|
|
40
|
+
refactor/remove-deprecated-endpoints # clear refactor intent
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Incorrect
|
|
44
|
+
|
|
45
|
+
```plaintext
|
|
46
|
+
feature/auth_stuff # wrong type + underscore
|
|
47
|
+
feat/feature-add-login # duplicates type in description
|
|
48
|
+
fix/DB-456-fix-the-database-connection-pool-memory-leak # exceeds 50 chars + verbatim message
|
|
49
|
+
```
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Pull request reference
|
|
3
|
+
description: Pull request title and body conventions
|
|
4
|
+
consumers: git-split, git-pr, claude-standards-audit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Pull request reference
|
|
8
|
+
|
|
9
|
+
## Title
|
|
10
|
+
|
|
11
|
+
- Format: `<type>(<scope>): <subject>`
|
|
12
|
+
- Casing: lowercase for `<type>`, `<scope>`, and first word of `<subject>`
|
|
13
|
+
- Length: 72 characters maximum
|
|
14
|
+
|
|
15
|
+
## Content
|
|
16
|
+
|
|
17
|
+
- Use imperative mood for all content (`add`, `fix`, `refactor`)
|
|
18
|
+
- Do not start with "This PR," "This commit," "Included are," or "I have"
|
|
19
|
+
- Do not use buzzwords (`seamless`, `robust`, `game-changer`, `enhanced`)
|
|
20
|
+
- Do not describe historical behavior or unchanged code. Describe new behavior only.
|
|
21
|
+
- Do not include future promises or speculative documentation
|
|
22
|
+
- Do not explain obvious changes (formatting, renaming variables)
|
|
23
|
+
- Do not duplicate commit messages verbatim
|
|
24
|
+
|
|
25
|
+
## Sections
|
|
26
|
+
|
|
27
|
+
- `## Summary`: 1-2 sentences following `<Action Verb> <Direct Object> to <Result>`, expand for clarity if needed
|
|
28
|
+
- `## Key Changes`: name actual files, functions, or modules (e.g., `AuthService.verify()` not "auth handler"). Always use bullet points, never prose.
|
|
29
|
+
- `## Technical Context` (optional): 1-2 lines of architectural reasoning explaining why, not what
|
|
30
|
+
- Omit Technical Context for docs, config, or trivial changes
|
|
31
|
+
- Use bullet points for multiple reasons, one sentence for a single reason
|
|
32
|
+
- `## Testing` (optional): specify exact commands or test cases run
|
|
33
|
+
- Omit Testing for docs, config, or trivial sync changes
|
|
34
|
+
- Use checkboxes, never prose. See Testing discipline for which box gets ticked.
|
|
35
|
+
- `## For the reviewer` (optional): what the reviewer should confirm, one bullet per request
|
|
36
|
+
- Visuals: include only when they clarify architecture, UI, or complex logic flows
|
|
37
|
+
|
|
38
|
+
## Testing discipline
|
|
39
|
+
|
|
40
|
+
- Run the check before writing its line. A `- [ ]` reports a check that has not run rather than one that is planned.
|
|
41
|
+
- Tick the box and state the observed result. `- [x] npm test passes, 42 tests` beats `- [ ] run npm test`.
|
|
42
|
+
- Quote the count or output the run reported, never a figure carried from elsewhere.
|
|
43
|
+
- Leave a box unchecked only when a human is required, and name which human and why on the same line.
|
|
44
|
+
- Human-only covers visual or aesthetic judgment, anything needing credentials or a live third-party service, anything needing a second machine or a fresh OS, and judgment about whether a boundary or an abstraction reads correctly. The agent runs everything else.
|
|
45
|
+
- Put a request for the reviewer under `## For the reviewer`. It is a request rather than unfinished testing, so it never appears as an unchecked Testing box.
|
|
46
|
+
|
|
47
|
+
## Formatting
|
|
48
|
+
|
|
49
|
+
- End every bullet point with a period
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
### Template
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
## Summary
|
|
57
|
+
|
|
58
|
+
<Action Verb> <Direct Object> to <Result>.
|
|
59
|
+
|
|
60
|
+
## Key Changes
|
|
61
|
+
|
|
62
|
+
- <Verb> <specific component/file/function> (<reason if non-obvious>)
|
|
63
|
+
- <Verb> <specific component/file/function>
|
|
64
|
+
|
|
65
|
+
## Technical Context
|
|
66
|
+
|
|
67
|
+
- <Architectural reasoning explaining why, not what>
|
|
68
|
+
|
|
69
|
+
## Testing
|
|
70
|
+
|
|
71
|
+
- [x] <Command run> <observed result>
|
|
72
|
+
- [x] <Edge case verified> <what was observed>
|
|
73
|
+
- [ ] <Human-only check> (<which human, why>)
|
|
74
|
+
|
|
75
|
+
## For the reviewer
|
|
76
|
+
|
|
77
|
+
- <What the reviewer should confirm>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Correct
|
|
81
|
+
|
|
82
|
+
```markdown
|
|
83
|
+
## Summary
|
|
84
|
+
|
|
85
|
+
Update auth middleware to enforce jwt expiration checks. # imperative + direct object + result
|
|
86
|
+
|
|
87
|
+
## Key Changes
|
|
88
|
+
|
|
89
|
+
- Add `verifyExpiration()` to `src/auth/validators.ts`. # specific function + file path
|
|
90
|
+
- Refactor `AuthService.authenticate()` to handle 401 codes. # named component + clear change
|
|
91
|
+
|
|
92
|
+
## Technical Context
|
|
93
|
+
|
|
94
|
+
- Migration to stateless session management for horizontal scalability. # why, not what
|
|
95
|
+
|
|
96
|
+
## Testing
|
|
97
|
+
|
|
98
|
+
- [x] `npm run test:auth` passes, 42 tests. # command run + observed result
|
|
99
|
+
- [x] Expired token rejected with a 401 against a local server. # edge case + what happened
|
|
100
|
+
- [ ] Staging smoke test (release owner, needs staging credentials). # unchecked + which human + why
|
|
101
|
+
|
|
102
|
+
## For the reviewer
|
|
103
|
+
|
|
104
|
+
- Confirm the 401 and 403 split reads correctly for the public API. # a request, not a test result
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Incorrect
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
## Summary
|
|
111
|
+
|
|
112
|
+
This PR updates the authentication system to be more robust. # "This PR" opener + buzzword
|
|
113
|
+
|
|
114
|
+
## Key Changes
|
|
115
|
+
|
|
116
|
+
- Updated auth middleware files # vague, no specific component, no period
|
|
117
|
+
- The old system used to check tokens differently # describes historical behavior
|
|
118
|
+
|
|
119
|
+
## Testing
|
|
120
|
+
|
|
121
|
+
- Tested manually # no specific command or case
|
|
122
|
+
- [ ] `npm run test:auth` # unchecked box for a check the agent can run
|
|
123
|
+
- [ ] Reviewer confirms the error split reads correctly # a reviewer request, belongs under `## For the reviewer`
|
|
124
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-stage
|
|
3
|
+
description: What commit grouping is for, the gaps it closes, and how it differs from splitting a branch
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git stage requirement
|
|
7
|
+
|
|
8
|
+
## Gap
|
|
9
|
+
|
|
10
|
+
Without this skill, a staged diff spanning several concerns lands as one commit, so a later revert takes unrelated work with it. A renamed file staged as two separate paths records an add and a delete, losing the rename git would otherwise detect. Commits also land in the order the files happened to be listed rather than the order they depend on, so a bisect stops on a commit that cannot build.
|
|
11
|
+
|
|
12
|
+
## Must
|
|
13
|
+
|
|
14
|
+
- Read the commit format reference and the prose standard before generating
|
|
15
|
+
- Derive the groups from the staged diff, with lockfiles excluded from the derivation context
|
|
16
|
+
- Account for every staged file in the preview, so a dropped file is visible before execution
|
|
17
|
+
- Order the commits so a dependency lands before the file that imports it
|
|
18
|
+
- Keep a rename pair in one group and restage both paths together, so git still detects the rename at commit time
|
|
19
|
+
- Unstage everything first, then restage per group, since the incoming staged set is one undifferentiated blob
|
|
20
|
+
- Count each subject against the length limit and shorten before executing
|
|
21
|
+
|
|
22
|
+
## Must not
|
|
23
|
+
|
|
24
|
+
- Stage a file the user did not stage. The staged set is the input and widening it changes what ships.
|
|
25
|
+
- Split a rename pair across groups
|
|
26
|
+
- Emit anything after the result line. This runs inside a longer flow and prose here buries the next step.
|
|
27
|
+
|
|
28
|
+
## Guards
|
|
29
|
+
|
|
30
|
+
- Nothing staged: stop and name the command that stages
|
|
31
|
+
|
|
32
|
+
## Out of scope
|
|
33
|
+
|
|
34
|
+
- Composing a single commit from the whole staged diff, which `git-commit` owns
|
|
35
|
+
- Splitting commits across branches, which `git-split` owns. The two partition different things: this one takes a staged diff and emits commits, that one takes commits and emits branches.
|
|
36
|
+
- Pushing and opening the pull request, which `git-pr` owns
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-stage
|
|
3
|
+
description: Groups staged files by concern and generates one conventional commit per group. Use when staged changes span multiple concerns and need to ship as separate commits.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git stage
|
|
7
|
+
|
|
8
|
+
Read these files in parallel:
|
|
9
|
+
|
|
10
|
+
- `${CLAUDE_SKILL_DIR}/references/commit.md`: format, types, scopes, and constraints
|
|
11
|
+
- `.claude/standards/prose.md` from the project root: prose conventions for all generated text
|
|
12
|
+
|
|
13
|
+
Read a standard from `${CLAUDE_SKILL_DIR}/../../standards/` instead when the project does not have it.
|
|
14
|
+
|
|
15
|
+
## Context
|
|
16
|
+
|
|
17
|
+
Run these commands in parallel to gather git context:
|
|
18
|
+
|
|
19
|
+
- `git diff --cached --name-status 2>/dev/null || echo "NO_STAGED_FILES"`
|
|
20
|
+
- `git diff --cached -- . ':(exclude)*.lock' ':(exclude)*-lock.json' 2>/dev/null || echo "NO_DIFF"`
|
|
21
|
+
|
|
22
|
+
## Guards
|
|
23
|
+
|
|
24
|
+
- If staged files output is `NO_STAGED_FILES`, stop and output:
|
|
25
|
+
`❌ No staged files. Stage files first with git add before committing.`
|
|
26
|
+
|
|
27
|
+
## Grouping rules
|
|
28
|
+
|
|
29
|
+
- Analyze the diff to understand what each file changes and why.
|
|
30
|
+
- Group files by shared concern. A group is a single commit.
|
|
31
|
+
- Files belong together when they implement or modify the same logical unit.
|
|
32
|
+
- A file that clearly stands alone is its own group.
|
|
33
|
+
- Order commits by dependency: commit dependencies before the files that import them.
|
|
34
|
+
- Prefix the full command sequence with `git restore --staged .` to unstage everything, then stage and commit each group in order.
|
|
35
|
+
- For `D` status files, use `git rm <file>`. For `A` or `M` files, use `git add <file>`.
|
|
36
|
+
- For `R<score>` status rows, `--name-status` emits three tab-separated fields: `R<score>\t<old>\t<new>`. Treat the pair as one file, keep both paths in the same group, and restage them together with `git add <old> <new>` so git detects the rename at commit time. Splitting the pair across groups produces an add-plus-delete pair instead of a rename.
|
|
37
|
+
|
|
38
|
+
## Response format
|
|
39
|
+
|
|
40
|
+
### Preview
|
|
41
|
+
|
|
42
|
+
**Staged files:** <total count>
|
|
43
|
+
**Proposed commits:** <group count>
|
|
44
|
+
|
|
45
|
+
| # | Commit | Files | Count |
|
|
46
|
+
| --- | ---------------------------- | ----------- | ----- |
|
|
47
|
+
| 1 | `<type>(<scope>): <subject>` | <filenames> | <n> |
|
|
48
|
+
| 2 | `<type>(<scope>): <subject>` | <filenames> | <n> |
|
|
49
|
+
|
|
50
|
+
**All <total> files accounted for.**
|
|
51
|
+
|
|
52
|
+
Count characters in each `<type>(<scope>): <subject>` line. Shorten any subject that exceeds 72 characters and update the table.
|
|
53
|
+
|
|
54
|
+
After outputting the preview, execute the final command immediately. Claude Code's tool permission dialog is the confirmation gate. Do not wait for user input.
|
|
55
|
+
|
|
56
|
+
### Final command
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git restore --staged .
|
|
60
|
+
# Commit 1: <subject>
|
|
61
|
+
git add <file1> <file2> && git commit -m "<type>(<scope>): <subject>"
|
|
62
|
+
# Commit 2: <subject>
|
|
63
|
+
git rm <deleted1> && git add <file3> && git commit -m "<type>(<scope>): <subject>"
|
|
64
|
+
# Commit 3 (rename): <subject>
|
|
65
|
+
git add <old> <new> && git commit -m "<type>(<scope>): <subject>"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## After execution
|
|
69
|
+
|
|
70
|
+
Respond with exactly one line:
|
|
71
|
+
|
|
72
|
+
`✅ Committed: <n> commits`
|
|
73
|
+
|
|
74
|
+
Do not add any other text.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Commit reference
|
|
3
|
+
description: Commit message format and type conventions
|
|
4
|
+
consumers: git-commit, git-stage
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Commit message reference
|
|
8
|
+
|
|
9
|
+
## Format
|
|
10
|
+
|
|
11
|
+
- Structure: `<type>(<scope>): <subject>`
|
|
12
|
+
- Casing: lowercase for `<type>`, `<scope>`, and first word of `<subject>`
|
|
13
|
+
- Subject: 72 characters maximum, no trailing period
|
|
14
|
+
|
|
15
|
+
## Types
|
|
16
|
+
|
|
17
|
+
- `feat`: new feature or capability
|
|
18
|
+
- `fix`: bug fix
|
|
19
|
+
- `refactor`: structural changes (not a fix or feature)
|
|
20
|
+
- `docs`: documentation only (README)
|
|
21
|
+
- `chore`: maintenance tasks (deps, tooling, configs)
|
|
22
|
+
- `perf`: performance improvements
|
|
23
|
+
- `test`: add or modify tests
|
|
24
|
+
- `style`: code formatting (whitespace, semicolons)
|
|
25
|
+
- `build`: build system changes (webpack, npm scripts)
|
|
26
|
+
- `ci`: CI/CD pipeline changes (GitHub Actions)
|
|
27
|
+
- `revert`: revert a previous commit
|
|
28
|
+
|
|
29
|
+
## Scope
|
|
30
|
+
|
|
31
|
+
- Single lowercase word representing a system component
|
|
32
|
+
- Prefer single word
|
|
33
|
+
- Use kebab-case only when two words are genuinely needed for specificity
|
|
34
|
+
- Do not use specific filenames as scopes
|
|
35
|
+
- Do not use a scope that duplicates the type
|
|
36
|
+
- Write scopes for release readability. They surface in `changelogithub` release notes.
|
|
37
|
+
|
|
38
|
+
## Subject
|
|
39
|
+
|
|
40
|
+
- Use imperative mood (`add` not `added`)
|
|
41
|
+
- Describe the actual technical change, not that something changed
|
|
42
|
+
- Do not use vague verbs (`improve`, `refine`, `enhance`)
|
|
43
|
+
- Do not repeat the scope in the subject line
|
|
44
|
+
- Use single quotes if quoting
|
|
45
|
+
- No backslash escaping or internal double quotes
|
|
46
|
+
- No conversational filler or introductory phrases
|
|
47
|
+
|
|
48
|
+
## Examples
|
|
49
|
+
|
|
50
|
+
### Correct
|
|
51
|
+
|
|
52
|
+
```plaintext
|
|
53
|
+
feat(api): add retry logic for failed webhooks # specific verb + clear change
|
|
54
|
+
fix(auth): update 'UserSession' validation logic # scoped + imperative + single quotes
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Incorrect
|
|
58
|
+
|
|
59
|
+
```plaintext
|
|
60
|
+
fix(user-auth): Fixed the redirect loop. # wrong casing + period + multi-word scope
|
|
61
|
+
docs(docs): update the readme. # duplicate scope + period
|
|
62
|
+
docs(api): improve documentation # vague verb + lacks specificity
|
|
63
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-worktree
|
|
3
|
+
description: What worktree listing and cleanup is for, the gaps it closes, and why entry lives elsewhere
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git worktree requirement
|
|
7
|
+
|
|
8
|
+
## Gap
|
|
9
|
+
|
|
10
|
+
Without this skill, linked worktrees accumulate past the point where any of them is remembered. Merge state does not appear in the worktree list, so a cleanup either removes a worktree still holding unmerged work or, lacking a way to tell, removes nothing. Removing a worktree also leaves its local branch behind, so the branch list keeps growing even when cleanup runs.
|
|
11
|
+
|
|
12
|
+
## Must
|
|
13
|
+
|
|
14
|
+
- Resolve merge state per branch from the pull request first, and fall back to local ancestry when no pull request exists
|
|
15
|
+
- Match the ancestry fallback against the branch name alone. `git branch --merged` decorates the current branch and every branch checked out in a linked worktree, which is the whole set this skill enumerates.
|
|
16
|
+
- Remove the worktree and its local branch together, since either one left alone is the state the skill exists to prevent
|
|
17
|
+
- Exclude the main root, the current session's worktree, and any dirty tree from the remove set
|
|
18
|
+
- Give every skipped row a one-word reason, so the skip is a decision the user can overturn rather than a silence
|
|
19
|
+
- Pick exactly one mode. Listing and removing are different requests and inferring both from one invocation removes worktrees the user meant to read about.
|
|
20
|
+
|
|
21
|
+
## Must not
|
|
22
|
+
|
|
23
|
+
- Enter or create a worktree. The description states the boundary so the model routes entry elsewhere rather than discovering it here.
|
|
24
|
+
- Remove a worktree with uncommitted work, whatever its merge state
|
|
25
|
+
- Remove the worktree the session is currently running in
|
|
26
|
+
- Emit anything after the result line
|
|
27
|
+
|
|
28
|
+
## Guards
|
|
29
|
+
|
|
30
|
+
- Not a git repository: stop
|
|
31
|
+
- Remove set is empty: stop and say why every row was held back
|
|
32
|
+
|
|
33
|
+
## Out of scope
|
|
34
|
+
|
|
35
|
+
- Entering a worktree, which `claude-worktree` owns. That skill derives the name and aligns the branch, and this one never creates.
|
|
36
|
+
- Deciding which features can run in parallel, which is a planning call rather than a git operation
|
|
37
|
+
- The pull request lifecycle, which `git-pr` and `git-followup` own. This skill reads pull request state and never writes it.
|