用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/richfrem/Project_Sanctuary --skill spec-kitty-merge命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
ADR management skill. Auto-invoked for generating architecture decisions, documenting design rationale, and maintaining the decision record log. Uses native read/write tools to scaffold and update ADR markdown files.
(Industry standard: Parallel Agent) Primary Use Case: Work that can be partitioned into independent sub-tasks running concurrently across multiple agents. Parallel multi-agent execution pattern. Use when: work can be partitioned into independent tasks that N agents can execute simultaneously across worktrees. Includes routing (sequential vs parallel), merge verification, and correction loops.
Systematically analyze agent plugins and skills to extract design patterns, architectural decisions, and reusable techniques. Trigger with "analyze this plugin", "mine patterns from", "review plugin structure", "extract learnings from", "what patterns does this plugin use", or when examining any plugin or skill collection to understand its design.
基于 SOC 职业分类
正在显示 SKILL.md
| name | spec-kitty-merge |
| description | Merge a completed feature into the main branch and clean up worktree |
Version: 0.11.0+ Purpose: Merge ALL completed work packages for a feature into main branch.
In 0.11.0, each work package has its own worktree:
.worktrees/###-feature-WP01/.worktrees/###-feature-WP02/.worktrees/###-feature-WP03/Merge merges ALL WP branches at once (not incrementally one-by-one).
BEFORE PROCEEDING: You MUST be in a feature worktree, NOT the main repository.
Verify your current location:
pwd
git branch --show-current
Expected output:
pwd: Should end with .worktrees/###-feature-name-WP01 (or similar feature worktree)###-feature-name-WP01 (NOT main or release/*)If you see:
main or release/⛔ STOP - DANGER! You are in the wrong location!
Correct the issue:
cd .worktrees/###-feature-name-WP01git branch --show-currentException (main branch):
If you are on main and need to merge a workspace-per-WP feature, run:
spec-kitty merge --feature <feature-slug>
Before merging, verify you are in the correct working directory by running this validation:
python3 -c "
from specify_cli.guards import validate_worktree_location
result = validate_worktree_location()
if not result.is_valid:
print(result.format_error())
print('\nThis command MUST run from a feature worktree, not the main repository.')
print('\nFor workspace-per-WP features, run from ANY WP worktree:')
print(' cd /path/to/project/.worktrees/<feature>-WP01')
print(' # or any other WP worktree for this feature')
raise SystemExit(1)
else:
print('✓ Location verified:', result.branch_name)
"
What this validates:
001-feature-name or 001-feature-name-WP01main or any release branchFor workspace-per-WP features (0.11.0+):
.worktrees/014-feature-WP09/)Before running this command:
done lane (reviewed and approved)/spec-kitty.accept checksspec-kitty merge ###-feature-slug [OPTIONS]
Example:
cd /tmp/spec-kitty-test/test-project # Main repo root
spec-kitty merge 001-cli-hello-world
--dry-run and flags auto-resolvable status filesmain)git pull --ff-only)spec-kitty merge
This will:
# Squash all commits into one
spec-kitty merge --strategy squash
# Push to origin after merging
spec-kitty merge --push
# Keep the feature branch
spec-kitty merge --keep-branch
# Keep the worktree
spec-kitty merge --keep-worktree
# Merge into a different branch
spec-kitty merge --target develop
# See what would happen without doing it
spec-kitty merge --dry-run
# Run merge from main for a workspace-per-WP feature
spec-kitty merge --feature 017-feature-slug
# Feature complete, squash and push
spec-kitty merge --strategy squash --push
# Keep branch for reference
spec-kitty merge --keep-branch
# Merge into develop instead of main
spec-kitty merge --target develop --push
merge (default)Creates a merge commit preserving all feature branch commits.
spec-kitty merge --strategy merge
✅ Preserves full commit history ✅ Clear feature boundaries in git log ❌ More commits in main branch
squashSquashes all feature commits into a single commit.
spec-kitty merge --strategy squash
✅ Clean, linear history on main ✅ Single commit per feature ❌ Loses individual commit details
rebaseRequires manual rebase first (command will guide you).
spec-kitty merge --strategy rebase
✅ Linear history without merge commits ❌ Requires manual intervention ❌ Rewrites commit history
| Option | Description | Default |
|---|---|---|
--strategy | Merge strategy: merge, squash, or rebase | merge |
--delete-branch / --keep-branch | Delete feature branch after merge | delete |
--remove-worktree / --keep-worktree | Remove feature worktree after merge | remove |
--push | Push to origin after merge | no push |
--target | Target branch to merge into | main |
--dry-run | Show what would be done without executing | off |
--feature | Feature slug when merging from main branch | none |
--resume | Resume an interrupted merge | off |
Spec Kitty uses an opinionated worktree approach:
In the current model, each work package gets its own worktree:
my-project/ # Main repo (main branch)
├── .worktrees/
│ ├── 001-auth-system-WP01/ # WP01 worktree
│ ├── 001-auth-system-WP02/ # WP02 worktree
│ ├── 001-auth-system-WP03/ # WP03 worktree
│ └── 002-dashboard-WP01/ # Different feature
├── .kittify/
├── kitty-specs/
└── ... (main branch files)
Merge behavior for workspace-per-WP:
spec-kitty merge from any WP worktree for the featuremy-project/ # Main repo (main branch)
├── .worktrees/
│ ├── 001-auth-system/ # Feature 1 worktree (single)
│ ├── 002-dashboard/ # Feature 2 worktree (single)
│ └── 003-notifications/ # Feature 3 worktree (single)
├── .kittify/
├── kitty-specs/
└── ... (main branch files)
.worktrees/<feature-slug>/1. /spec-kitty.specify → Creates branch + worktree
2. cd .worktrees/<feature>/ → Enter worktree
3. /spec-kitty.plan → Work in isolation
4. /spec-kitty.tasks
5. /spec-kitty.implement
6. /spec-kitty.review
7. /spec-kitty.accept
8. /spec-kitty.merge → Merge + cleanup worktree
9. Back in main repo! → Ready for next feature
You're not on a feature branch. Switch to your feature branch first:
cd .worktrees/<feature-slug>
# or
git checkout <feature-branch>
Commit or stash your changes:
git add .
git commit -m "Final changes"
# or
git stash
Your main branch is behind origin:
git checkout main
git pull
git checkout <feature-branch>
spec-kitty merge
Resolve conflicts manually:
# Fix conflicts in files
git add <resolved-files>
git commit
# Then complete cleanup manually:
git worktree remove .worktrees/<feature>
git branch -d <feature-branch>
cd .worktrees/001-auth-system
/spec-kitty.accept
/spec-kitty.merge --push
spec-kitty merge --strategy squash --push
spec-kitty merge --keep-branch --push
spec-kitty merge --dry-run
After a successful merge, you're back on the main branch with:
--keep-branch)rm -f .kittify/workspaces/<feature-slug>-WP*.json)The typical flow is:
# 1. Run acceptance checks
/spec-kitty.accept --mode local
# 2. If checks pass, merge
/spec-kitty.merge --push
Or combine conceptually:
# Accept verifies readiness
/spec-kitty.accept --mode local
# Merge performs integration
/spec-kitty.merge --strategy squash --push
The /spec-kitty.accept command verifies your feature is complete.
The /spec-kitty.merge command integrates your feature into main.
Together they complete the workflow:
specify → plan → tasks → implement → review → accept → merge ✅