spec-kitty-cli 0.12.1__py3-none-any.whl
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.
- spec_kitty_cli-0.12.1.dist-info/METADATA +1767 -0
- spec_kitty_cli-0.12.1.dist-info/RECORD +242 -0
- spec_kitty_cli-0.12.1.dist-info/WHEEL +4 -0
- spec_kitty_cli-0.12.1.dist-info/entry_points.txt +2 -0
- spec_kitty_cli-0.12.1.dist-info/licenses/LICENSE +21 -0
- specify_cli/__init__.py +171 -0
- specify_cli/acceptance.py +627 -0
- specify_cli/agent_utils/README.md +157 -0
- specify_cli/agent_utils/__init__.py +9 -0
- specify_cli/agent_utils/status.py +356 -0
- specify_cli/cli/__init__.py +6 -0
- specify_cli/cli/commands/__init__.py +46 -0
- specify_cli/cli/commands/accept.py +189 -0
- specify_cli/cli/commands/agent/__init__.py +22 -0
- specify_cli/cli/commands/agent/config.py +382 -0
- specify_cli/cli/commands/agent/context.py +191 -0
- specify_cli/cli/commands/agent/feature.py +1057 -0
- specify_cli/cli/commands/agent/release.py +11 -0
- specify_cli/cli/commands/agent/tasks.py +1253 -0
- specify_cli/cli/commands/agent/workflow.py +801 -0
- specify_cli/cli/commands/context.py +246 -0
- specify_cli/cli/commands/dashboard.py +85 -0
- specify_cli/cli/commands/implement.py +973 -0
- specify_cli/cli/commands/init.py +827 -0
- specify_cli/cli/commands/init_help.py +62 -0
- specify_cli/cli/commands/merge.py +755 -0
- specify_cli/cli/commands/mission.py +240 -0
- specify_cli/cli/commands/ops.py +265 -0
- specify_cli/cli/commands/orchestrate.py +640 -0
- specify_cli/cli/commands/repair.py +175 -0
- specify_cli/cli/commands/research.py +165 -0
- specify_cli/cli/commands/sync.py +364 -0
- specify_cli/cli/commands/upgrade.py +249 -0
- specify_cli/cli/commands/validate_encoding.py +186 -0
- specify_cli/cli/commands/validate_tasks.py +186 -0
- specify_cli/cli/commands/verify.py +310 -0
- specify_cli/cli/helpers.py +123 -0
- specify_cli/cli/step_tracker.py +91 -0
- specify_cli/cli/ui.py +192 -0
- specify_cli/core/__init__.py +53 -0
- specify_cli/core/agent_context.py +311 -0
- specify_cli/core/config.py +96 -0
- specify_cli/core/context_validation.py +362 -0
- specify_cli/core/dependency_graph.py +351 -0
- specify_cli/core/git_ops.py +129 -0
- specify_cli/core/multi_parent_merge.py +323 -0
- specify_cli/core/paths.py +260 -0
- specify_cli/core/project_resolver.py +110 -0
- specify_cli/core/stale_detection.py +263 -0
- specify_cli/core/tool_checker.py +79 -0
- specify_cli/core/utils.py +43 -0
- specify_cli/core/vcs/__init__.py +114 -0
- specify_cli/core/vcs/detection.py +341 -0
- specify_cli/core/vcs/exceptions.py +85 -0
- specify_cli/core/vcs/git.py +1304 -0
- specify_cli/core/vcs/jujutsu.py +1208 -0
- specify_cli/core/vcs/protocol.py +285 -0
- specify_cli/core/vcs/types.py +249 -0
- specify_cli/core/version_checker.py +261 -0
- specify_cli/core/worktree.py +506 -0
- specify_cli/dashboard/__init__.py +28 -0
- specify_cli/dashboard/diagnostics.py +204 -0
- specify_cli/dashboard/handlers/__init__.py +17 -0
- specify_cli/dashboard/handlers/api.py +143 -0
- specify_cli/dashboard/handlers/base.py +65 -0
- specify_cli/dashboard/handlers/features.py +390 -0
- specify_cli/dashboard/handlers/router.py +81 -0
- specify_cli/dashboard/handlers/static.py +50 -0
- specify_cli/dashboard/lifecycle.py +541 -0
- specify_cli/dashboard/scanner.py +437 -0
- specify_cli/dashboard/server.py +123 -0
- specify_cli/dashboard/static/dashboard/dashboard.css +722 -0
- specify_cli/dashboard/static/dashboard/dashboard.js +1424 -0
- specify_cli/dashboard/static/spec-kitty.png +0 -0
- specify_cli/dashboard/templates/__init__.py +36 -0
- specify_cli/dashboard/templates/index.html +258 -0
- specify_cli/doc_generators.py +621 -0
- specify_cli/doc_state.py +408 -0
- specify_cli/frontmatter.py +384 -0
- specify_cli/gap_analysis.py +915 -0
- specify_cli/gitignore_manager.py +300 -0
- specify_cli/guards.py +145 -0
- specify_cli/legacy_detector.py +83 -0
- specify_cli/manifest.py +286 -0
- specify_cli/merge/__init__.py +63 -0
- specify_cli/merge/executor.py +653 -0
- specify_cli/merge/forecast.py +215 -0
- specify_cli/merge/ordering.py +126 -0
- specify_cli/merge/preflight.py +230 -0
- specify_cli/merge/state.py +185 -0
- specify_cli/merge/status_resolver.py +354 -0
- specify_cli/mission.py +654 -0
- specify_cli/missions/documentation/command-templates/implement.md +309 -0
- specify_cli/missions/documentation/command-templates/plan.md +275 -0
- specify_cli/missions/documentation/command-templates/review.md +344 -0
- specify_cli/missions/documentation/command-templates/specify.md +206 -0
- specify_cli/missions/documentation/command-templates/tasks.md +189 -0
- specify_cli/missions/documentation/mission.yaml +113 -0
- specify_cli/missions/documentation/templates/divio/explanation-template.md +192 -0
- specify_cli/missions/documentation/templates/divio/howto-template.md +168 -0
- specify_cli/missions/documentation/templates/divio/reference-template.md +179 -0
- specify_cli/missions/documentation/templates/divio/tutorial-template.md +146 -0
- specify_cli/missions/documentation/templates/generators/jsdoc.json.template +18 -0
- specify_cli/missions/documentation/templates/generators/sphinx-conf.py.template +36 -0
- specify_cli/missions/documentation/templates/plan-template.md +269 -0
- specify_cli/missions/documentation/templates/release-template.md +222 -0
- specify_cli/missions/documentation/templates/spec-template.md +172 -0
- specify_cli/missions/documentation/templates/task-prompt-template.md +140 -0
- specify_cli/missions/documentation/templates/tasks-template.md +159 -0
- specify_cli/missions/research/command-templates/merge.md +388 -0
- specify_cli/missions/research/command-templates/plan.md +125 -0
- specify_cli/missions/research/command-templates/review.md +144 -0
- specify_cli/missions/research/command-templates/tasks.md +225 -0
- specify_cli/missions/research/mission.yaml +115 -0
- specify_cli/missions/research/templates/data-model-template.md +33 -0
- specify_cli/missions/research/templates/plan-template.md +161 -0
- specify_cli/missions/research/templates/research/evidence-log.csv +18 -0
- specify_cli/missions/research/templates/research/source-register.csv +18 -0
- specify_cli/missions/research/templates/research-template.md +35 -0
- specify_cli/missions/research/templates/spec-template.md +64 -0
- specify_cli/missions/research/templates/task-prompt-template.md +148 -0
- specify_cli/missions/research/templates/tasks-template.md +114 -0
- specify_cli/missions/software-dev/command-templates/accept.md +75 -0
- specify_cli/missions/software-dev/command-templates/analyze.md +183 -0
- specify_cli/missions/software-dev/command-templates/checklist.md +286 -0
- specify_cli/missions/software-dev/command-templates/clarify.md +157 -0
- specify_cli/missions/software-dev/command-templates/constitution.md +432 -0
- specify_cli/missions/software-dev/command-templates/dashboard.md +101 -0
- specify_cli/missions/software-dev/command-templates/implement.md +41 -0
- specify_cli/missions/software-dev/command-templates/merge.md +383 -0
- specify_cli/missions/software-dev/command-templates/plan.md +171 -0
- specify_cli/missions/software-dev/command-templates/review.md +32 -0
- specify_cli/missions/software-dev/command-templates/specify.md +321 -0
- specify_cli/missions/software-dev/command-templates/tasks.md +566 -0
- specify_cli/missions/software-dev/mission.yaml +100 -0
- specify_cli/missions/software-dev/templates/plan-template.md +132 -0
- specify_cli/missions/software-dev/templates/spec-template.md +116 -0
- specify_cli/missions/software-dev/templates/task-prompt-template.md +140 -0
- specify_cli/missions/software-dev/templates/tasks-template.md +159 -0
- specify_cli/orchestrator/__init__.py +75 -0
- specify_cli/orchestrator/agent_config.py +224 -0
- specify_cli/orchestrator/agents/__init__.py +170 -0
- specify_cli/orchestrator/agents/augment.py +112 -0
- specify_cli/orchestrator/agents/base.py +243 -0
- specify_cli/orchestrator/agents/claude.py +112 -0
- specify_cli/orchestrator/agents/codex.py +106 -0
- specify_cli/orchestrator/agents/copilot.py +137 -0
- specify_cli/orchestrator/agents/cursor.py +139 -0
- specify_cli/orchestrator/agents/gemini.py +115 -0
- specify_cli/orchestrator/agents/kilocode.py +94 -0
- specify_cli/orchestrator/agents/opencode.py +132 -0
- specify_cli/orchestrator/agents/qwen.py +96 -0
- specify_cli/orchestrator/config.py +455 -0
- specify_cli/orchestrator/executor.py +642 -0
- specify_cli/orchestrator/integration.py +1230 -0
- specify_cli/orchestrator/monitor.py +898 -0
- specify_cli/orchestrator/scheduler.py +832 -0
- specify_cli/orchestrator/state.py +508 -0
- specify_cli/orchestrator/testing/__init__.py +122 -0
- specify_cli/orchestrator/testing/availability.py +346 -0
- specify_cli/orchestrator/testing/fixtures.py +684 -0
- specify_cli/orchestrator/testing/paths.py +218 -0
- specify_cli/plan_validation.py +107 -0
- specify_cli/scripts/debug-dashboard-scan.py +61 -0
- specify_cli/scripts/tasks/acceptance_support.py +695 -0
- specify_cli/scripts/tasks/task_helpers.py +506 -0
- specify_cli/scripts/tasks/tasks_cli.py +848 -0
- specify_cli/scripts/validate_encoding.py +180 -0
- specify_cli/task_metadata_validation.py +274 -0
- specify_cli/tasks_support.py +447 -0
- specify_cli/template/__init__.py +47 -0
- specify_cli/template/asset_generator.py +206 -0
- specify_cli/template/github_client.py +334 -0
- specify_cli/template/manager.py +193 -0
- specify_cli/template/renderer.py +99 -0
- specify_cli/templates/AGENTS.md +190 -0
- specify_cli/templates/POWERSHELL_SYNTAX.md +229 -0
- specify_cli/templates/agent-file-template.md +35 -0
- specify_cli/templates/checklist-template.md +42 -0
- specify_cli/templates/claudeignore-template +58 -0
- specify_cli/templates/command-templates/accept.md +141 -0
- specify_cli/templates/command-templates/analyze.md +253 -0
- specify_cli/templates/command-templates/checklist.md +352 -0
- specify_cli/templates/command-templates/clarify.md +224 -0
- specify_cli/templates/command-templates/constitution.md +432 -0
- specify_cli/templates/command-templates/dashboard.md +175 -0
- specify_cli/templates/command-templates/implement.md +190 -0
- specify_cli/templates/command-templates/merge.md +374 -0
- specify_cli/templates/command-templates/plan.md +171 -0
- specify_cli/templates/command-templates/research.md +88 -0
- specify_cli/templates/command-templates/review.md +510 -0
- specify_cli/templates/command-templates/specify.md +321 -0
- specify_cli/templates/command-templates/status.md +92 -0
- specify_cli/templates/command-templates/tasks.md +199 -0
- specify_cli/templates/git-hooks/pre-commit +22 -0
- specify_cli/templates/git-hooks/pre-commit-agent-check +37 -0
- specify_cli/templates/git-hooks/pre-commit-encoding-check +142 -0
- specify_cli/templates/plan-template.md +108 -0
- specify_cli/templates/spec-template.md +118 -0
- specify_cli/templates/task-prompt-template.md +165 -0
- specify_cli/templates/tasks-template.md +161 -0
- specify_cli/templates/vscode-settings.json +13 -0
- specify_cli/text_sanitization.py +225 -0
- specify_cli/upgrade/__init__.py +18 -0
- specify_cli/upgrade/detector.py +239 -0
- specify_cli/upgrade/metadata.py +182 -0
- specify_cli/upgrade/migrations/__init__.py +65 -0
- specify_cli/upgrade/migrations/base.py +80 -0
- specify_cli/upgrade/migrations/m_0_10_0_python_only.py +359 -0
- specify_cli/upgrade/migrations/m_0_10_12_constitution_cleanup.py +99 -0
- specify_cli/upgrade/migrations/m_0_10_14_update_implement_slash_command.py +176 -0
- specify_cli/upgrade/migrations/m_0_10_1_populate_slash_commands.py +174 -0
- specify_cli/upgrade/migrations/m_0_10_2_update_slash_commands.py +172 -0
- specify_cli/upgrade/migrations/m_0_10_6_workflow_simplification.py +174 -0
- specify_cli/upgrade/migrations/m_0_10_8_fix_memory_structure.py +252 -0
- specify_cli/upgrade/migrations/m_0_10_9_repair_templates.py +168 -0
- specify_cli/upgrade/migrations/m_0_11_0_workspace_per_wp.py +182 -0
- specify_cli/upgrade/migrations/m_0_11_1_improved_workflow_templates.py +173 -0
- specify_cli/upgrade/migrations/m_0_11_1_update_implement_slash_command.py +160 -0
- specify_cli/upgrade/migrations/m_0_11_2_improved_workflow_templates.py +173 -0
- specify_cli/upgrade/migrations/m_0_11_3_workflow_agent_flag.py +114 -0
- specify_cli/upgrade/migrations/m_0_12_0_documentation_mission.py +155 -0
- specify_cli/upgrade/migrations/m_0_12_1_remove_kitty_specs_from_gitignore.py +183 -0
- specify_cli/upgrade/migrations/m_0_2_0_specify_to_kittify.py +80 -0
- specify_cli/upgrade/migrations/m_0_4_8_gitignore_agents.py +118 -0
- specify_cli/upgrade/migrations/m_0_5_0_encoding_hooks.py +141 -0
- specify_cli/upgrade/migrations/m_0_6_5_commands_rename.py +169 -0
- specify_cli/upgrade/migrations/m_0_6_7_ensure_missions.py +228 -0
- specify_cli/upgrade/migrations/m_0_7_2_worktree_commands_dedup.py +89 -0
- specify_cli/upgrade/migrations/m_0_7_3_update_scripts.py +114 -0
- specify_cli/upgrade/migrations/m_0_8_0_remove_active_mission.py +82 -0
- specify_cli/upgrade/migrations/m_0_8_0_worktree_agents_symlink.py +148 -0
- specify_cli/upgrade/migrations/m_0_9_0_frontmatter_only_lanes.py +346 -0
- specify_cli/upgrade/migrations/m_0_9_1_complete_lane_migration.py +656 -0
- specify_cli/upgrade/migrations/m_0_9_2_research_mission_templates.py +221 -0
- specify_cli/upgrade/registry.py +121 -0
- specify_cli/upgrade/runner.py +284 -0
- specify_cli/validators/__init__.py +14 -0
- specify_cli/validators/paths.py +154 -0
- specify_cli/validators/research.py +428 -0
- specify_cli/verify_enhanced.py +270 -0
- specify_cli/workspace_context.py +224 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Merge a completed feature into the main branch and clean up worktree
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /spec-kitty.merge - Merge Feature to Main
|
|
6
|
+
|
|
7
|
+
**Version**: 0.11.0+
|
|
8
|
+
**Purpose**: Merge ALL completed work packages for a feature into main branch.
|
|
9
|
+
|
|
10
|
+
## CRITICAL: Workspace-per-WP Model (0.11.0)
|
|
11
|
+
|
|
12
|
+
In 0.11.0, each work package has its own worktree:
|
|
13
|
+
- `.worktrees/###-feature-WP01/`
|
|
14
|
+
- `.worktrees/###-feature-WP02/`
|
|
15
|
+
- `.worktrees/###-feature-WP03/`
|
|
16
|
+
|
|
17
|
+
**Merge merges ALL WP branches at once** (not incrementally one-by-one).
|
|
18
|
+
|
|
19
|
+
## ⛔ Location Pre-flight Check (CRITICAL)
|
|
20
|
+
|
|
21
|
+
**BEFORE PROCEEDING:** You MUST be in a feature worktree, NOT the main repository.
|
|
22
|
+
|
|
23
|
+
Verify your current location:
|
|
24
|
+
```bash
|
|
25
|
+
pwd
|
|
26
|
+
git branch --show-current
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Expected output:**
|
|
30
|
+
- `pwd`: Should end with `.worktrees/###-feature-name-WP01` (or similar feature worktree)
|
|
31
|
+
- Branch: Should show your feature branch name like `###-feature-name-WP01` (NOT `main` or `release/*`)
|
|
32
|
+
|
|
33
|
+
**If you see:**
|
|
34
|
+
- Branch showing `main` or `release/`
|
|
35
|
+
- OR pwd shows the main repository root
|
|
36
|
+
|
|
37
|
+
⛔ **STOP - DANGER! You are in the wrong location!**
|
|
38
|
+
|
|
39
|
+
**Correct the issue:**
|
|
40
|
+
1. Navigate to ANY worktree for this feature: `cd .worktrees/###-feature-name-WP01`
|
|
41
|
+
2. Verify you're on a feature branch: `git branch --show-current`
|
|
42
|
+
3. Then run this merge command again
|
|
43
|
+
|
|
44
|
+
**Exception (main branch):**
|
|
45
|
+
If you are on `main` and need to merge a workspace-per-WP feature, run:
|
|
46
|
+
```bash
|
|
47
|
+
spec-kitty merge --feature <feature-slug>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Location Pre-flight Check (CRITICAL for AI Agents)
|
|
53
|
+
|
|
54
|
+
Before merging, verify you are in the correct working directory by running this validation:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
python3 -c "
|
|
58
|
+
from specify_cli.guards import validate_worktree_location
|
|
59
|
+
result = validate_worktree_location()
|
|
60
|
+
if not result.is_valid:
|
|
61
|
+
print(result.format_error())
|
|
62
|
+
print('\nThis command MUST run from a feature worktree, not the main repository.')
|
|
63
|
+
print('\nFor workspace-per-WP features, run from ANY WP worktree:')
|
|
64
|
+
print(' cd /path/to/project/.worktrees/<feature>-WP01')
|
|
65
|
+
print(' # or any other WP worktree for this feature')
|
|
66
|
+
raise SystemExit(1)
|
|
67
|
+
else:
|
|
68
|
+
print('✓ Location verified:', result.branch_name)
|
|
69
|
+
"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**What this validates**:
|
|
73
|
+
- Current branch follows the feature pattern like `001-feature-name` or `001-feature-name-WP01`
|
|
74
|
+
- You're not attempting to run from `main` or any release branch
|
|
75
|
+
- The validator prints clear navigation instructions if you're outside the feature worktree
|
|
76
|
+
|
|
77
|
+
**For workspace-per-WP features (0.11.0+)**:
|
|
78
|
+
- Run merge from ANY WP worktree (e.g., `.worktrees/014-feature-WP09/`)
|
|
79
|
+
- The merge command automatically detects all WP branches and merges them sequentially
|
|
80
|
+
- You do NOT need to run merge from each WP worktree individually
|
|
81
|
+
|
|
82
|
+
## Prerequisites
|
|
83
|
+
|
|
84
|
+
Before running this command:
|
|
85
|
+
|
|
86
|
+
1. ✅ All work packages must be in `done` lane (reviewed and approved)
|
|
87
|
+
2. ✅ Feature must pass `/spec-kitty.accept` checks
|
|
88
|
+
3. ✅ Working directory must be clean (no uncommitted changes in main)
|
|
89
|
+
4. ✅ **You must be in main repository root** (not in a worktree)
|
|
90
|
+
|
|
91
|
+
## Command Syntax
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
spec-kitty merge ###-feature-slug [OPTIONS]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Example**:
|
|
98
|
+
```bash
|
|
99
|
+
cd /tmp/spec-kitty-test/test-project # Main repo root
|
|
100
|
+
spec-kitty merge 001-cli-hello-world
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## What This Command Does
|
|
104
|
+
|
|
105
|
+
1. **Detects** your current feature branch and worktree status
|
|
106
|
+
2. **Runs** pre-flight validation across all worktrees and the target branch
|
|
107
|
+
3. **Determines** merge order based on WP dependencies (workspace-per-WP)
|
|
108
|
+
4. **Forecasts** conflicts during `--dry-run` and flags auto-resolvable status files
|
|
109
|
+
5. **Verifies** working directory is clean (legacy single-worktree)
|
|
110
|
+
6. **Switches** to the target branch (default: `main`)
|
|
111
|
+
7. **Updates** the target branch (`git pull --ff-only`)
|
|
112
|
+
8. **Merges** the feature using your chosen strategy
|
|
113
|
+
9. **Auto-resolves** status file conflicts after each WP merge
|
|
114
|
+
10. **Optionally pushes** to origin
|
|
115
|
+
11. **Removes** the feature worktree (if in one)
|
|
116
|
+
12. **Deletes** the feature branch
|
|
117
|
+
|
|
118
|
+
## Usage
|
|
119
|
+
|
|
120
|
+
### Basic merge (default: merge commit, cleanup everything)
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
spec-kitty merge
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
This will:
|
|
127
|
+
- Create a merge commit
|
|
128
|
+
- Remove the worktree
|
|
129
|
+
- Delete the feature branch
|
|
130
|
+
- Keep changes local (no push)
|
|
131
|
+
|
|
132
|
+
### Merge with options
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Squash all commits into one
|
|
136
|
+
spec-kitty merge --strategy squash
|
|
137
|
+
|
|
138
|
+
# Push to origin after merging
|
|
139
|
+
spec-kitty merge --push
|
|
140
|
+
|
|
141
|
+
# Keep the feature branch
|
|
142
|
+
spec-kitty merge --keep-branch
|
|
143
|
+
|
|
144
|
+
# Keep the worktree
|
|
145
|
+
spec-kitty merge --keep-worktree
|
|
146
|
+
|
|
147
|
+
# Merge into a different branch
|
|
148
|
+
spec-kitty merge --target develop
|
|
149
|
+
|
|
150
|
+
# See what would happen without doing it
|
|
151
|
+
spec-kitty merge --dry-run
|
|
152
|
+
|
|
153
|
+
# Run merge from main for a workspace-per-WP feature
|
|
154
|
+
spec-kitty merge --feature 017-feature-slug
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Common workflows
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Feature complete, squash and push
|
|
161
|
+
spec-kitty merge --strategy squash --push
|
|
162
|
+
|
|
163
|
+
# Keep branch for reference
|
|
164
|
+
spec-kitty merge --keep-branch
|
|
165
|
+
|
|
166
|
+
# Merge into develop instead of main
|
|
167
|
+
spec-kitty merge --target develop --push
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Merge Strategies
|
|
171
|
+
|
|
172
|
+
### `merge` (default)
|
|
173
|
+
Creates a merge commit preserving all feature branch commits.
|
|
174
|
+
```bash
|
|
175
|
+
spec-kitty merge --strategy merge
|
|
176
|
+
```
|
|
177
|
+
✅ Preserves full commit history
|
|
178
|
+
✅ Clear feature boundaries in git log
|
|
179
|
+
❌ More commits in main branch
|
|
180
|
+
|
|
181
|
+
### `squash`
|
|
182
|
+
Squashes all feature commits into a single commit.
|
|
183
|
+
```bash
|
|
184
|
+
spec-kitty merge --strategy squash
|
|
185
|
+
```
|
|
186
|
+
✅ Clean, linear history on main
|
|
187
|
+
✅ Single commit per feature
|
|
188
|
+
❌ Loses individual commit details
|
|
189
|
+
|
|
190
|
+
### `rebase`
|
|
191
|
+
Requires manual rebase first (command will guide you).
|
|
192
|
+
```bash
|
|
193
|
+
spec-kitty merge --strategy rebase
|
|
194
|
+
```
|
|
195
|
+
✅ Linear history without merge commits
|
|
196
|
+
❌ Requires manual intervention
|
|
197
|
+
❌ Rewrites commit history
|
|
198
|
+
|
|
199
|
+
## Options
|
|
200
|
+
|
|
201
|
+
| Option | Description | Default |
|
|
202
|
+
|--------|-------------|---------|
|
|
203
|
+
| `--strategy` | Merge strategy: `merge`, `squash`, or `rebase` | `merge` |
|
|
204
|
+
| `--delete-branch` / `--keep-branch` | Delete feature branch after merge | delete |
|
|
205
|
+
| `--remove-worktree` / `--keep-worktree` | Remove feature worktree after merge | remove |
|
|
206
|
+
| `--push` | Push to origin after merge | no push |
|
|
207
|
+
| `--target` | Target branch to merge into | `main` |
|
|
208
|
+
| `--dry-run` | Show what would be done without executing | off |
|
|
209
|
+
| `--feature` | Feature slug when merging from main branch | none |
|
|
210
|
+
| `--resume` | Resume an interrupted merge | off |
|
|
211
|
+
|
|
212
|
+
## Worktree Strategy
|
|
213
|
+
|
|
214
|
+
Spec Kitty uses an **opinionated worktree approach**:
|
|
215
|
+
|
|
216
|
+
### Workspace-per-WP Model (0.11.0+)
|
|
217
|
+
|
|
218
|
+
In the current model, each work package gets its own worktree:
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
my-project/ # Main repo (main branch)
|
|
222
|
+
├── .worktrees/
|
|
223
|
+
│ ├── 001-auth-system-WP01/ # WP01 worktree
|
|
224
|
+
│ ├── 001-auth-system-WP02/ # WP02 worktree
|
|
225
|
+
│ ├── 001-auth-system-WP03/ # WP03 worktree
|
|
226
|
+
│ └── 002-dashboard-WP01/ # Different feature
|
|
227
|
+
├── .kittify/
|
|
228
|
+
├── kitty-specs/
|
|
229
|
+
└── ... (main branch files)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Merge behavior for workspace-per-WP**:
|
|
233
|
+
- Run `spec-kitty merge` from **any** WP worktree for the feature
|
|
234
|
+
- The command automatically detects all WP branches (WP01, WP02, WP03, etc.)
|
|
235
|
+
- Merges each WP branch into main in sequence
|
|
236
|
+
- Cleans up all WP worktrees and branches
|
|
237
|
+
|
|
238
|
+
### Legacy Pattern (0.10.x)
|
|
239
|
+
```
|
|
240
|
+
my-project/ # Main repo (main branch)
|
|
241
|
+
├── .worktrees/
|
|
242
|
+
│ ├── 001-auth-system/ # Feature 1 worktree (single)
|
|
243
|
+
│ ├── 002-dashboard/ # Feature 2 worktree (single)
|
|
244
|
+
│ └── 003-notifications/ # Feature 3 worktree (single)
|
|
245
|
+
├── .kittify/
|
|
246
|
+
├── kitty-specs/
|
|
247
|
+
└── ... (main branch files)
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### The Rules
|
|
251
|
+
1. **Main branch** stays in the primary repo root
|
|
252
|
+
2. **Feature branches** live in `.worktrees/<feature-slug>/`
|
|
253
|
+
3. **Work on features** happens in their worktrees (isolation)
|
|
254
|
+
4. **Merge from worktrees** using this command
|
|
255
|
+
5. **Cleanup is automatic** - worktrees removed after merge
|
|
256
|
+
|
|
257
|
+
### Why Worktrees?
|
|
258
|
+
- ✅ Work on multiple features simultaneously
|
|
259
|
+
- ✅ Each feature has its own sandbox
|
|
260
|
+
- ✅ No branch switching in main repo
|
|
261
|
+
- ✅ Easy to compare features
|
|
262
|
+
- ✅ Clean separation of concerns
|
|
263
|
+
|
|
264
|
+
### The Flow
|
|
265
|
+
```
|
|
266
|
+
1. /spec-kitty.specify → Creates branch + worktree
|
|
267
|
+
2. cd .worktrees/<feature>/ → Enter worktree
|
|
268
|
+
3. /spec-kitty.plan → Work in isolation
|
|
269
|
+
4. /spec-kitty.tasks
|
|
270
|
+
5. /spec-kitty.implement
|
|
271
|
+
6. /spec-kitty.review
|
|
272
|
+
7. /spec-kitty.accept
|
|
273
|
+
8. /spec-kitty.merge → Merge + cleanup worktree
|
|
274
|
+
9. Back in main repo! → Ready for next feature
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Error Handling
|
|
278
|
+
|
|
279
|
+
### "Already on main branch"
|
|
280
|
+
You're not on a feature branch. Switch to your feature branch first:
|
|
281
|
+
```bash
|
|
282
|
+
cd .worktrees/<feature-slug>
|
|
283
|
+
# or
|
|
284
|
+
git checkout <feature-branch>
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### "Working directory has uncommitted changes"
|
|
288
|
+
Commit or stash your changes:
|
|
289
|
+
```bash
|
|
290
|
+
git add .
|
|
291
|
+
git commit -m "Final changes"
|
|
292
|
+
# or
|
|
293
|
+
git stash
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### "Could not fast-forward main"
|
|
297
|
+
Your main branch is behind origin:
|
|
298
|
+
```bash
|
|
299
|
+
git checkout main
|
|
300
|
+
git pull
|
|
301
|
+
git checkout <feature-branch>
|
|
302
|
+
spec-kitty merge
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### "Merge failed - conflicts"
|
|
306
|
+
Resolve conflicts manually:
|
|
307
|
+
```bash
|
|
308
|
+
# Fix conflicts in files
|
|
309
|
+
git add <resolved-files>
|
|
310
|
+
git commit
|
|
311
|
+
# Then complete cleanup manually:
|
|
312
|
+
git worktree remove .worktrees/<feature>
|
|
313
|
+
git branch -d <feature-branch>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Safety Features
|
|
317
|
+
|
|
318
|
+
1. **Clean working directory check** - Won't merge with uncommitted changes
|
|
319
|
+
2. **Fast-forward only pull** - Won't proceed if main has diverged
|
|
320
|
+
3. **Graceful failure** - If merge fails, you can fix manually
|
|
321
|
+
4. **Optional operations** - Push, branch delete, and worktree removal are configurable
|
|
322
|
+
5. **Dry run mode** - Preview exactly what will happen
|
|
323
|
+
|
|
324
|
+
## Examples
|
|
325
|
+
|
|
326
|
+
### Complete feature and push
|
|
327
|
+
```bash
|
|
328
|
+
cd .worktrees/001-auth-system
|
|
329
|
+
/spec-kitty.accept
|
|
330
|
+
/spec-kitty.merge --push
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Squash merge for cleaner history
|
|
334
|
+
```bash
|
|
335
|
+
spec-kitty merge --strategy squash --push
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### Merge but keep branch for reference
|
|
339
|
+
```bash
|
|
340
|
+
spec-kitty merge --keep-branch --push
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Check what will happen first
|
|
344
|
+
```bash
|
|
345
|
+
spec-kitty merge --dry-run
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
## After Merging
|
|
349
|
+
|
|
350
|
+
After a successful merge, you're back on the main branch with:
|
|
351
|
+
- ✅ Feature code integrated
|
|
352
|
+
- ✅ Worktree removed (if it existed)
|
|
353
|
+
- ✅ Feature branch deleted (unless `--keep-branch`)
|
|
354
|
+
- ✅ Ready to start your next feature!
|
|
355
|
+
|
|
356
|
+
## Integration with Accept
|
|
357
|
+
|
|
358
|
+
The typical flow is:
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
# 1. Run acceptance checks
|
|
362
|
+
/spec-kitty.accept --mode local
|
|
363
|
+
|
|
364
|
+
# 2. If checks pass, merge
|
|
365
|
+
/spec-kitty.merge --push
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Or combine conceptually:
|
|
369
|
+
```bash
|
|
370
|
+
# Accept verifies readiness
|
|
371
|
+
/spec-kitty.accept --mode local
|
|
372
|
+
|
|
373
|
+
# Merge performs integration
|
|
374
|
+
/spec-kitty.merge --strategy squash --push
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
The `/spec-kitty.accept` command **verifies** your feature is complete.
|
|
378
|
+
The `/spec-kitty.merge` command **integrates** your feature into main.
|
|
379
|
+
|
|
380
|
+
Together they complete the workflow:
|
|
381
|
+
```
|
|
382
|
+
specify → plan → tasks → implement → review → accept → merge ✅
|
|
383
|
+
```
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Execute the implementation planning workflow using the plan template to generate design artifacts.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /spec-kitty.plan - Create Implementation Plan
|
|
6
|
+
|
|
7
|
+
**Version**: 0.11.0+
|
|
8
|
+
|
|
9
|
+
## 📍 WORKING DIRECTORY: Stay in MAIN repository
|
|
10
|
+
|
|
11
|
+
**IMPORTANT**: Plan works in the main repository. NO worktrees created.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Run from project root (same directory as /spec-kitty.specify):
|
|
15
|
+
# You should already be here if you just ran /spec-kitty.specify
|
|
16
|
+
|
|
17
|
+
# Creates:
|
|
18
|
+
# - kitty-specs/###-feature/plan.md → In main repository
|
|
19
|
+
# - Commits to main branch
|
|
20
|
+
# - NO worktrees created
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Do NOT cd anywhere**. Stay in the main repository root.
|
|
24
|
+
|
|
25
|
+
## User Input
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
$ARGUMENTS
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
You **MUST** consider the user input before proceeding (if not empty).
|
|
32
|
+
|
|
33
|
+
## Location Check (0.11.0+)
|
|
34
|
+
|
|
35
|
+
This command runs in the **main repository**, not in a worktree.
|
|
36
|
+
|
|
37
|
+
- Verify you're on `main` (or `master`) before scaffolding plan.md
|
|
38
|
+
- Planning artifacts live in `kitty-specs/###-feature/`
|
|
39
|
+
- The plan template is committed to the main branch after generation
|
|
40
|
+
|
|
41
|
+
**Path reference rule:** When you mention directories or files, provide either the absolute path or a path relative to the project root (for example, `kitty-specs/<feature>/tasks/`). Never refer to a folder by name alone.
|
|
42
|
+
|
|
43
|
+
## Planning Interrogation (mandatory)
|
|
44
|
+
|
|
45
|
+
Before executing any scripts or generating artifacts you must interrogate the specification and stakeholders.
|
|
46
|
+
|
|
47
|
+
- **Scope proportionality (CRITICAL)**: FIRST, assess the feature's complexity from the spec:
|
|
48
|
+
- **Trivial/Test Features** (hello world, simple static pages, basic demos): Ask 1-2 questions maximum about tech stack preference, then proceed with sensible defaults
|
|
49
|
+
- **Simple Features** (small components, minor API additions): Ask 2-3 questions about tech choices and constraints
|
|
50
|
+
- **Complex Features** (new subsystems, multi-component features): Ask 3-5 questions covering architecture, NFRs, integrations
|
|
51
|
+
- **Platform/Critical Features** (core infrastructure, security, payments): Full interrogation with 5+ questions
|
|
52
|
+
|
|
53
|
+
- **User signals to reduce questioning**: If the user says "use defaults", "just make it simple", "skip to implementation", "vanilla HTML/CSS/JS" - recognize these as signals to minimize planning questions and use standard approaches.
|
|
54
|
+
|
|
55
|
+
- **First response rule**:
|
|
56
|
+
- For TRIVIAL features: Ask ONE tech stack question, then if answer is simple (e.g., "vanilla HTML"), proceed directly to plan generation
|
|
57
|
+
- For other features: Ask a single architecture question and end with `WAITING_FOR_PLANNING_INPUT`
|
|
58
|
+
|
|
59
|
+
- If the user has not provided plan context, keep interrogating with one question at a time.
|
|
60
|
+
|
|
61
|
+
- **Conversational cadence**: After each reply, assess if you have SUFFICIENT context for this feature's scope. For trivial features, knowing the basic stack is enough. Only continue if critical unknowns remain.
|
|
62
|
+
|
|
63
|
+
Planning requirements (scale to complexity):
|
|
64
|
+
|
|
65
|
+
1. Maintain a **Planning Questions** table internally covering questions appropriate to the feature's complexity (1-2 for trivial, up to 5+ for platform-level). Track columns `#`, `Question`, `Why it matters`, and `Current insight`. Do **not** render this table to the user.
|
|
66
|
+
2. For trivial features, standard practices are acceptable (vanilla HTML, simple file structure, no build tools). Only probe if the user's request suggests otherwise.
|
|
67
|
+
3. When you have sufficient context for the scope, summarize into an **Engineering Alignment** note and confirm.
|
|
68
|
+
4. If user explicitly asks to skip questions or use defaults, acknowledge and proceed with best practices for that feature type.
|
|
69
|
+
|
|
70
|
+
## Outline
|
|
71
|
+
|
|
72
|
+
1. **Check planning discovery status**:
|
|
73
|
+
- If any planning questions remain unanswered or the user has not confirmed the **Engineering Alignment** summary, stay in the one-question cadence, capture the user's response, update your internal table, and end with `WAITING_FOR_PLANNING_INPUT`. Do **not** surface the table. Do **not** run the setup command yet.
|
|
74
|
+
- Once every planning question has a concrete answer and the alignment summary is confirmed by the user, continue.
|
|
75
|
+
|
|
76
|
+
2. **Setup**: Run `spec-kitty agent feature setup-plan --json` from the repository root and parse JSON for:
|
|
77
|
+
- `result`: "success" or error message
|
|
78
|
+
- `plan_file`: Absolute path to the created plan.md
|
|
79
|
+
- `feature_dir`: Absolute path to the feature directory
|
|
80
|
+
|
|
81
|
+
3. **Load context**: Read FEATURE_SPEC and `.kittify/memory/constitution.md` if it exists. If the constitution file is missing, skip Constitution Check and note that it is absent. Load IMPL_PLAN template (already copied).
|
|
82
|
+
|
|
83
|
+
4. **Execute plan workflow**: Follow the structure in IMPL_PLAN template, using the validated planning answers as ground truth:
|
|
84
|
+
- Update Technical Context with explicit statements from the user or discovery research; mark `[NEEDS CLARIFICATION: …]` only when the user deliberately postpones a decision
|
|
85
|
+
- If a constitution exists, fill Constitution Check section from it and challenge any conflicts directly with the user. If no constitution exists, mark the section as skipped.
|
|
86
|
+
- Evaluate gates (ERROR if violations unjustified or questions remain unanswered)
|
|
87
|
+
- Phase 0: Generate research.md (commission research to resolve every outstanding clarification)
|
|
88
|
+
- Phase 1: Generate data-model.md, contracts/, quickstart.md based on confirmed intent
|
|
89
|
+
- Phase 1: Update agent context by running the agent script
|
|
90
|
+
- Re-evaluate Constitution Check post-design, asking the user to resolve new gaps before proceeding
|
|
91
|
+
|
|
92
|
+
5. **STOP and report**: This command ends after Phase 1 planning. Report branch, IMPL_PLAN path, and generated artifacts.
|
|
93
|
+
|
|
94
|
+
**⚠️ CRITICAL: DO NOT proceed to task generation!** The user must explicitly run `/spec-kitty.tasks` to generate work packages. Your job is COMPLETE after reporting the planning artifacts.
|
|
95
|
+
|
|
96
|
+
## Phases
|
|
97
|
+
|
|
98
|
+
### Phase 0: Outline & Research
|
|
99
|
+
|
|
100
|
+
1. **Extract unknowns from Technical Context** above:
|
|
101
|
+
- For each NEEDS CLARIFICATION → research task
|
|
102
|
+
- For each dependency → best practices task
|
|
103
|
+
- For each integration → patterns task
|
|
104
|
+
|
|
105
|
+
2. **Generate and dispatch research agents**:
|
|
106
|
+
```
|
|
107
|
+
For each unknown in Technical Context:
|
|
108
|
+
Task: "Research {unknown} for {feature context}"
|
|
109
|
+
For each technology choice:
|
|
110
|
+
Task: "Find best practices for {tech} in {domain}"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
3. **Consolidate findings** in `research.md` using format:
|
|
114
|
+
- Decision: [what was chosen]
|
|
115
|
+
- Rationale: [why chosen]
|
|
116
|
+
- Alternatives considered: [what else evaluated]
|
|
117
|
+
|
|
118
|
+
**Output**: research.md with all NEEDS CLARIFICATION resolved
|
|
119
|
+
|
|
120
|
+
### Phase 1: Design & Contracts
|
|
121
|
+
|
|
122
|
+
**Prerequisites:** `research.md` complete
|
|
123
|
+
|
|
124
|
+
1. **Extract entities from feature spec** → `data-model.md`:
|
|
125
|
+
- Entity name, fields, relationships
|
|
126
|
+
- Validation rules from requirements
|
|
127
|
+
- State transitions if applicable
|
|
128
|
+
|
|
129
|
+
2. **Generate API contracts** from functional requirements:
|
|
130
|
+
- For each user action → endpoint
|
|
131
|
+
- Use standard REST/GraphQL patterns
|
|
132
|
+
- Output OpenAPI/GraphQL schema to `/contracts/`
|
|
133
|
+
|
|
134
|
+
3. **Agent context update**:
|
|
135
|
+
- Run `{AGENT_SCRIPT}`
|
|
136
|
+
- These scripts detect which AI agent is in use
|
|
137
|
+
- Update the appropriate agent-specific context file
|
|
138
|
+
- Add only new technology from current plan
|
|
139
|
+
- Preserve manual additions between markers
|
|
140
|
+
|
|
141
|
+
**Output**: data-model.md, /contracts/*, quickstart.md, agent-specific file
|
|
142
|
+
|
|
143
|
+
## Key rules
|
|
144
|
+
|
|
145
|
+
- Use absolute paths
|
|
146
|
+
- ERROR on gate failures or unresolved clarifications
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## ⛔ MANDATORY STOP POINT
|
|
151
|
+
|
|
152
|
+
**This command is COMPLETE after generating planning artifacts.**
|
|
153
|
+
|
|
154
|
+
After reporting:
|
|
155
|
+
- `plan.md` path
|
|
156
|
+
- `research.md` path (if generated)
|
|
157
|
+
- `data-model.md` path (if generated)
|
|
158
|
+
- `contracts/` contents (if generated)
|
|
159
|
+
- Agent context file updated
|
|
160
|
+
|
|
161
|
+
**YOU MUST STOP HERE.**
|
|
162
|
+
|
|
163
|
+
Do NOT:
|
|
164
|
+
- ❌ Generate `tasks.md`
|
|
165
|
+
- ❌ Create work package (WP) files
|
|
166
|
+
- ❌ Create `tasks/` subdirectories
|
|
167
|
+
- ❌ Proceed to implementation
|
|
168
|
+
|
|
169
|
+
The user will run `/spec-kitty.tasks` when they are ready to generate work packages.
|
|
170
|
+
|
|
171
|
+
**Next suggested command**: `/spec-kitty.tasks` (user must invoke this explicitly)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Perform structured code review and kanban transitions for completed task prompt files
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
**IMPORTANT**: After running the command below, you'll see a LONG work package prompt (~1000+ lines).
|
|
6
|
+
|
|
7
|
+
**You MUST scroll to the BOTTOM** to see the completion commands!
|
|
8
|
+
|
|
9
|
+
Run this command to get the work package prompt and review instructions:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
spec-kitty agent workflow review $ARGUMENTS --agent <your-name>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**CRITICAL**: You MUST provide `--agent <your-name>` to track who is reviewing!
|
|
16
|
+
|
|
17
|
+
If no WP ID is provided, it will automatically find the first work package with `lane: "for_review"` and move it to "doing" for you.
|
|
18
|
+
|
|
19
|
+
## Dependency checks (required)
|
|
20
|
+
|
|
21
|
+
- dependency_check: If the WP frontmatter lists `dependencies`, confirm each dependency WP is merged to main before you review this WP.
|
|
22
|
+
- dependent_check: Identify any WPs that list this WP as a dependency and note their current lanes.
|
|
23
|
+
- rebase_warning: If you request changes AND any dependents exist, warn those agents to rebase and provide a concrete command (example: `cd .worktrees/FEATURE-WP02 && git rebase FEATURE-WP01`).
|
|
24
|
+
- verify_instruction: Confirm dependency declarations match actual code coupling (imports, shared modules, API contracts).
|
|
25
|
+
|
|
26
|
+
**After reviewing, scroll to the bottom and run ONE of these commands**:
|
|
27
|
+
- ✅ Approve: `spec-kitty agent tasks move-task WP## --to done --note "Review passed: <summary>"`
|
|
28
|
+
- ❌ Reject: Write feedback to the temp file path shown in the prompt, then run `spec-kitty agent tasks move-task WP## --to planned --review-feedback-file <temp-file-path>`
|
|
29
|
+
|
|
30
|
+
**The prompt will provide a unique temp file path for feedback - use that exact path to avoid conflicts with other agents!**
|
|
31
|
+
|
|
32
|
+
**The Python script handles all file updates automatically - no manual editing required!**
|