codecruise 0.1.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 +111 -0
- package/bin/codecruise.js +68 -0
- package/config/CLAUDE.md +107 -0
- package/config/agents/analyst.md +48 -0
- package/config/agents/architect-reviewer.md +161 -0
- package/config/agents/architect.md +119 -0
- package/config/agents/critic.md +63 -0
- package/config/agents/developer.md +96 -0
- package/config/agents/devops.md +81 -0
- package/config/agents/orchestrator.md +91 -0
- package/config/agents/planner.md +139 -0
- package/config/agents/retro.md +52 -0
- package/config/agents/reviewer.md +101 -0
- package/config/agents/security-reviewer.md +57 -0
- package/config/agents/stack/expo/AGENT.md +473 -0
- package/config/agents/stack/expo/rules/critical.md +427 -0
- package/config/agents/stack/expo/rules/native.md +455 -0
- package/config/agents/stack/expo/rules/navigation.md +445 -0
- package/config/agents/stack/expo/rules/performance.md +415 -0
- package/config/agents/stack/fastify/AGENT.md +397 -0
- package/config/agents/stack/fastify/rules/api-design.md +283 -0
- package/config/agents/stack/fastify/rules/critical.md +232 -0
- package/config/agents/stack/fastify/rules/queues.md +303 -0
- package/config/agents/stack/fastify/rules/security.md +384 -0
- package/config/agents/stack/index.yaml +48 -0
- package/config/agents/stack/nextjs/AGENT.md +421 -0
- package/config/agents/stack/nextjs/rules/components.md +413 -0
- package/config/agents/stack/nextjs/rules/critical.md +391 -0
- package/config/agents/stack/nextjs/rules/performance.md +403 -0
- package/config/agents/stack/nextjs/rules/styling.md +334 -0
- package/config/agents/stack/shared-ts/AGENT.md +384 -0
- package/config/agents/stack/shared-ts/rules/critical.md +315 -0
- package/config/agents/stack/shared-ts/rules/patterns.md +384 -0
- package/config/agents/stack/shared-ts/rules/zod.md +427 -0
- package/config/agents/tester.md +79 -0
- package/config/commands/architect-discuss.md +366 -0
- package/config/commands/architect-list.md +160 -0
- package/config/commands/architect-review.md +111 -0
- package/config/commands/architect.md +118 -0
- package/config/commands/compact.md +118 -0
- package/config/commands/companion.md +279 -0
- package/config/commands/dashboard.md +152 -0
- package/config/commands/doctor.md +227 -0
- package/config/commands/dogfood-report.md +101 -0
- package/config/commands/flags/run-autonomous.md +110 -0
- package/config/commands/flags/run-pause.md +80 -0
- package/config/commands/ingest.md +173 -0
- package/config/commands/init.md +128 -0
- package/config/commands/metrics.md +87 -0
- package/config/commands/parallel.md +320 -0
- package/config/commands/pause.md +55 -0
- package/config/commands/plan-review.md +130 -0
- package/config/commands/plan.md +216 -0
- package/config/commands/production-check.md +308 -0
- package/config/commands/refine.md +323 -0
- package/config/commands/resume.md +72 -0
- package/config/commands/retro.md +121 -0
- package/config/commands/retry.md +75 -0
- package/config/commands/role.md +310 -0
- package/config/commands/run.md +417 -0
- package/config/commands/scope.md +85 -0
- package/config/commands/setup-permissions.md +104 -0
- package/config/commands/skip.md +75 -0
- package/config/commands/spec-forge.md +213 -0
- package/config/commands/spec-help.md +194 -0
- package/config/commands/spec-patch.md +342 -0
- package/config/commands/spec-resolve.md +110 -0
- package/config/commands/spec-review.md +153 -0
- package/config/commands/status.md +114 -0
- package/config/commands/sync.md +131 -0
- package/config/commands/task.md +138 -0
- package/config/commands/verify.md +124 -0
- package/config/hooks/README.md +632 -0
- package/config/hooks/activity-log.sh +187 -0
- package/config/hooks/anti-rationalize.sh +52 -0
- package/config/hooks/capture-verification.sh +112 -0
- package/config/hooks/collect-metrics.sh +135 -0
- package/config/hooks/enforce-file-scope.sh +75 -0
- package/config/hooks/enforce-state-machine.sh +161 -0
- package/config/hooks/enforce-tdd.sh +180 -0
- package/config/hooks/format.sh +40 -0
- package/config/hooks/lib/activity-helpers.sh +162 -0
- package/config/hooks/lib/read-settings.sh +71 -0
- package/config/hooks/load-context-skills.sh +95 -0
- package/config/hooks/notify.sh +81 -0
- package/config/hooks/pre-commit.sample +35 -0
- package/config/hooks/protect-files.sh +63 -0
- package/config/hooks/track-agents.sh +41 -0
- package/config/hooks/track-commands.sh +37 -0
- package/config/hooks/track-enforcement.sh +44 -0
- package/config/hooks/track-ooda.sh +77 -0
- package/config/hooks/validate-commit-msg.sh +35 -0
- package/config/hooks/validate-plan.sh +213 -0
- package/config/hooks/verify-criteria.sh +46 -0
- package/config/hooks/verify-todo-completion.sh +140 -0
- package/config/rules/comments.md +25 -0
- package/config/rules/decision-rules.md +308 -0
- package/config/rules/hygiene.md +247 -0
- package/config/rules/pattern-detection.md +372 -0
- package/config/rules/profiles.md +193 -0
- package/config/rules/recovery.md +83 -0
- package/config/rules/scope-detection.md +213 -0
- package/config/rules/standards.md +127 -0
- package/config/rules/workflow.md +121 -0
- package/config/schemas.md +767 -0
- package/config/settings.json +195 -0
- package/config/skills/backend/SKILL.md +734 -0
- package/config/skills/database/SKILL.md +426 -0
- package/config/skills/frontend/SKILL.md +434 -0
- package/config/skills/git/SKILL.md +396 -0
- package/config/skills/index.yaml +36 -0
- package/config/skills/observability/SKILL.md +430 -0
- package/config/skills/package-dev/SKILL.md +498 -0
- package/config/skills/performance/SKILL.md +378 -0
- package/config/skills/resilience/SKILL.md +573 -0
- package/config/skills/testing/SKILL.md +398 -0
- package/config/skills/testing-patterns/SKILL.md +276 -0
- package/config/skills/typescript/SKILL.md +152 -0
- package/config/templates/CLAUDE.md +70 -0
- package/config/templates/README.md +117 -0
- package/config/templates/steering/adr-template.md +102 -0
- package/config/templates/steering/product.md +60 -0
- package/config/templates/steering/rfc-template.md +159 -0
- package/config/templates/steering/structure.md +146 -0
- package/config/templates/steering/tech.md +85 -0
- package/package.json +40 -0
- package/src/install.js +163 -0
- package/src/report.js +310 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: init
|
|
3
|
+
description: Initialize or enhance a project with smart detection
|
|
4
|
+
model: sonnet
|
|
5
|
+
tools: Read, Write, Bash, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /init — Project Wizard
|
|
9
|
+
|
|
10
|
+
Initialize new projects or enhance existing ones with smart detection.
|
|
11
|
+
|
|
12
|
+
## Philosophy
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
Detect → Guide → Execute → Next Step
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Scenario Detection
|
|
19
|
+
|
|
20
|
+
| Scenario | Detection | Action |
|
|
21
|
+
|----------|-----------|--------|
|
|
22
|
+
| 1. Full Setup | CLAUDE.md + roadmap + progress | Resume from current TODO |
|
|
23
|
+
| 2. Docs Only | PRD/requirements, no code | Create structure, `/ingest` |
|
|
24
|
+
| 3. Code Only | Code exists, no CLAUDE.md | Analyze, create CLAUDE.md |
|
|
25
|
+
| 4. Empty | Nothing | Full wizard |
|
|
26
|
+
|
|
27
|
+
## Process
|
|
28
|
+
|
|
29
|
+
1. **Detect**: Check for CLAUDE.md, progress.yaml, roadmap/, code
|
|
30
|
+
2. **Assess Quality** (if exists): Score 0-100
|
|
31
|
+
3. **Present Findings**: Show what's missing
|
|
32
|
+
4. **Gather Info** (if new): Project name, domain, stack, quality_command
|
|
33
|
+
5. **Create/Enhance**: Apply templates
|
|
34
|
+
6. **Verify Git**: Warn uncommitted changes
|
|
35
|
+
7. **Speed Check**: Measure quality_command, warn if slow
|
|
36
|
+
|
|
37
|
+
## Quality Scoring
|
|
38
|
+
|
|
39
|
+
| Element | Points |
|
|
40
|
+
|---------|--------|
|
|
41
|
+
| Has subfeatures | +20 |
|
|
42
|
+
| Has dependencies | +20 |
|
|
43
|
+
| Has file mappings | +20 |
|
|
44
|
+
| Has rich descriptions | +15 |
|
|
45
|
+
| Has status tracking | +15 |
|
|
46
|
+
| Has spec references | +10 |
|
|
47
|
+
|
|
48
|
+
**70-100**: Strong → Add execution_state only
|
|
49
|
+
**30-69**: Weak → Suggest improvements
|
|
50
|
+
**0-29**: Minimal → Provide full defaults
|
|
51
|
+
|
|
52
|
+
## Files Created
|
|
53
|
+
|
|
54
|
+
**New Project**:
|
|
55
|
+
```
|
|
56
|
+
CLAUDE.md # Claude Code requirement (root, <100 lines)
|
|
57
|
+
.claude/
|
|
58
|
+
└── settings.json # Claude Code project settings
|
|
59
|
+
.codecruise/ # ALL CodeCruise artifacts
|
|
60
|
+
├── progress.yaml # Execution state
|
|
61
|
+
├── steering/
|
|
62
|
+
│ ├── product.md # What we're building
|
|
63
|
+
│ ├── tech.md # Tech stack & tools
|
|
64
|
+
│ └── structure.md # Architecture & conventions
|
|
65
|
+
├── canon/ # Created by /spec-forge
|
|
66
|
+
├── context/ # Created by /spec-forge
|
|
67
|
+
├── roadmap/
|
|
68
|
+
│ ├── README.md
|
|
69
|
+
│ └── phase-01.yaml
|
|
70
|
+
├── metrics/ # OODA events (created by /run)
|
|
71
|
+
└── cache/ # Temp files
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Enhanced Project**: Only adds missing pieces
|
|
75
|
+
|
|
76
|
+
**Minimal Mode** (`--minimal`): CLAUDE.md + .codecruise/progress.yaml only
|
|
77
|
+
|
|
78
|
+
## Wizard Chaining
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
/init → /ingest (if docs) → /plan (if requirements) → /run
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
User only needs `/init`. System guides from there.
|
|
85
|
+
|
|
86
|
+
## Options
|
|
87
|
+
|
|
88
|
+
| Flag | Description |
|
|
89
|
+
|------|-------------|
|
|
90
|
+
| `--minimal` | Only CLAUDE.md + progress.yaml |
|
|
91
|
+
| `--full` | Include RFC/ADR templates |
|
|
92
|
+
| `--assess` | Show assessment, don't modify |
|
|
93
|
+
| `--upgrade` | Force improvement suggestions |
|
|
94
|
+
| `--upgrade-schema` | Migrate progress.yaml v1 → v2 |
|
|
95
|
+
| `--no-steering` | Skip steering docs (product.md, tech.md, structure.md) |
|
|
96
|
+
|
|
97
|
+
## Speed Check
|
|
98
|
+
|
|
99
|
+
After detecting quality_command:
|
|
100
|
+
- < 10s: ✅ Fast feedback loop
|
|
101
|
+
- 10-30s: ⚠️ Consider Biome, oxlint, Bun
|
|
102
|
+
- > 30s: 🐢 Strongly recommend faster tools
|
|
103
|
+
|
|
104
|
+
## Domain Input
|
|
105
|
+
|
|
106
|
+
Ask for domain expertise to prime CLAUDE.md:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
Domain: fintech engineer
|
|
110
|
+
Expertise: Multi-currency, decimal precision, PCI compliance
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Output
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
✓ Project initialized: {name}
|
|
117
|
+
|
|
118
|
+
Created:
|
|
119
|
+
├── CLAUDE.md
|
|
120
|
+
├── progress.yaml
|
|
121
|
+
├── roadmap/
|
|
122
|
+
└── dashboard/
|
|
123
|
+
|
|
124
|
+
Next:
|
|
125
|
+
1. Edit roadmap/phase-01/phase.yaml
|
|
126
|
+
2. /plan to generate TODOs
|
|
127
|
+
3. /run to start execution
|
|
128
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: metrics
|
|
3
|
+
description: View execution metrics and success rates
|
|
4
|
+
model: haiku
|
|
5
|
+
tools: Read, Bash
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /metrics — View Execution Metrics
|
|
9
|
+
|
|
10
|
+
## Goal
|
|
11
|
+
|
|
12
|
+
Display collected metrics about codecruise execution: success rates, activity counts, and trends.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
/metrics # Show summary
|
|
18
|
+
/metrics --detailed # Show detailed event log
|
|
19
|
+
/metrics --reset # Clear metrics and start fresh
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Behavior
|
|
23
|
+
|
|
24
|
+
### 1. Read Metrics Summary
|
|
25
|
+
|
|
26
|
+
Read `.codecruise/metrics/summary.json` and display:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
╔════════════════════════════════════════════════════════════╗
|
|
30
|
+
║ CODECRUISE METRICS ║
|
|
31
|
+
╠════════════════════════════════════════════════════════════╣
|
|
32
|
+
║ ║
|
|
33
|
+
║ Tests ║
|
|
34
|
+
║ Passes: 42 Fails: 3 Success Rate: 93.33% ║
|
|
35
|
+
║ ║
|
|
36
|
+
║ Lint ║
|
|
37
|
+
║ Passes: 45 Fails: 0 Success Rate: 100% ║
|
|
38
|
+
║ ║
|
|
39
|
+
║ Activity ║
|
|
40
|
+
║ Commits: 12 Tests Written: 15 Code Written: 28 ║
|
|
41
|
+
║ ║
|
|
42
|
+
║ Last Updated: 2026-02-20T10:30:00Z ║
|
|
43
|
+
║ ║
|
|
44
|
+
╚════════════════════════════════════════════════════════════╝
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 2. Detailed View (--detailed)
|
|
48
|
+
|
|
49
|
+
Show recent events from `.codecruise/metrics/events.jsonl`:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
Recent Events (last 20):
|
|
53
|
+
────────────────────────────────────────────────
|
|
54
|
+
10:30:15 test_pass pnpm test
|
|
55
|
+
10:29:45 code_written src/auth/login.ts
|
|
56
|
+
10:29:30 test_written src/auth/login.test.ts
|
|
57
|
+
10:28:00 lint_pass pnpm lint
|
|
58
|
+
10:27:30 commit feat(auth): add login
|
|
59
|
+
...
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 3. Reset (--reset)
|
|
63
|
+
|
|
64
|
+
Clear all metrics:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
rm -rf .codecruise/metrics/
|
|
68
|
+
echo "Metrics cleared. Fresh start."
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## No Metrics Found
|
|
72
|
+
|
|
73
|
+
If `.codecruise/metrics/` doesn't exist:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
No metrics collected yet.
|
|
77
|
+
|
|
78
|
+
Metrics are collected automatically during /run execution.
|
|
79
|
+
Start with: /run <scope>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Implementation
|
|
83
|
+
|
|
84
|
+
1. Check if metrics directory exists
|
|
85
|
+
2. Read summary.json if present
|
|
86
|
+
3. Format and display based on flags
|
|
87
|
+
4. For --detailed, tail the events.jsonl file
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: parallel
|
|
3
|
+
description: Manage parallel execution with git worktrees
|
|
4
|
+
model: sonnet
|
|
5
|
+
tools: Read, Write, Bash, Glob
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /parallel — Parallel Execution Manager
|
|
9
|
+
|
|
10
|
+
Manage parallel feature execution using git worktrees. Run multiple features simultaneously without file conflicts.
|
|
11
|
+
|
|
12
|
+
## Why Worktrees?
|
|
13
|
+
|
|
14
|
+
Git worktrees create separate working directories from the same repository:
|
|
15
|
+
- Each worktree has its own branch
|
|
16
|
+
- No file conflicts between parallel work
|
|
17
|
+
- Independent Claude sessions per worktree
|
|
18
|
+
- Easy merge when features complete
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Simple syntax (recommended)
|
|
24
|
+
/parallel auth # Create worktree for auth feature
|
|
25
|
+
/parallel payments # Create another worktree
|
|
26
|
+
/parallel # Show status of all worktrees
|
|
27
|
+
/parallel merge auth # Merge auth back to main
|
|
28
|
+
/parallel cleanup # Remove finished worktrees
|
|
29
|
+
|
|
30
|
+
# Also supports feature IDs
|
|
31
|
+
/parallel 1.1 # Create worktree for feature-1.1
|
|
32
|
+
/parallel merge 1.1 # Merge feature-1.1
|
|
33
|
+
|
|
34
|
+
# Sync state (after merges)
|
|
35
|
+
/parallel sync # Pull main changes into worktrees
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Commands
|
|
39
|
+
|
|
40
|
+
### `/parallel <feature>` (Create Worktree)
|
|
41
|
+
|
|
42
|
+
Create a worktree for a single feature. Simple and focused.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
/parallel auth # Create worktree for 'auth'
|
|
46
|
+
/parallel 1.1 # Create worktree for feature-1.1
|
|
47
|
+
/parallel user-dashboard # Create worktree for 'user-dashboard'
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Process:**
|
|
51
|
+
|
|
52
|
+
1. **Resolve Feature**
|
|
53
|
+
- Find feature by name or ID in roadmap
|
|
54
|
+
- Get `file_scope` from feature definition
|
|
55
|
+
|
|
56
|
+
2. **Check for Conflicts**
|
|
57
|
+
- If other worktrees exist, check for file scope overlap
|
|
58
|
+
- FAIL if patterns conflict with existing worktrees
|
|
59
|
+
|
|
60
|
+
3. **Create Worktree**
|
|
61
|
+
```bash
|
|
62
|
+
git worktree add ../project-auth -b feature/auth
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
4. **Setup Isolation**
|
|
66
|
+
- Copy `progress.yaml` with scope filtered to this feature
|
|
67
|
+
- Create `.claude/file_scope.txt` with owned patterns
|
|
68
|
+
|
|
69
|
+
5. **Output**
|
|
70
|
+
```
|
|
71
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
72
|
+
║ ✓ Worktree created: auth ║
|
|
73
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
74
|
+
║ ║
|
|
75
|
+
║ Path: ../project-auth ║
|
|
76
|
+
║ Branch: feature/auth ║
|
|
77
|
+
║ Scope: src/auth/**, tests/auth/** ║
|
|
78
|
+
║ TODOs: 12 ║
|
|
79
|
+
║ ║
|
|
80
|
+
║ To start: ║
|
|
81
|
+
║ cd ../project-auth && claude "/run" ║
|
|
82
|
+
║ ║
|
|
83
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### `/parallel <f1> <f2> <f3>` (Multiple Worktrees)
|
|
87
|
+
|
|
88
|
+
Create multiple worktrees at once.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
/parallel auth payments dashboard
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Output:**
|
|
95
|
+
```
|
|
96
|
+
✓ Created 3 worktrees:
|
|
97
|
+
../project-auth → cd ../project-auth && claude "/run"
|
|
98
|
+
../project-payments → cd ../project-payments && claude "/run"
|
|
99
|
+
../project-dashboard → cd ../project-dashboard && claude "/run"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### `/parallel` (Status)
|
|
103
|
+
|
|
104
|
+
Show status of all parallel worktrees. Called without arguments.
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
108
|
+
║ PARALLEL EXECUTION STATUS ║
|
|
109
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
110
|
+
║ ║
|
|
111
|
+
║ Feature 1.1: Auth Feature 1.2: Payments ║
|
|
112
|
+
║ ════════════════ ═══════════════════ ║
|
|
113
|
+
║ Branch: feature/auth Branch: feature/payments ║
|
|
114
|
+
║ Status: 🟢 Running Status: 🟢 Running ║
|
|
115
|
+
║ Progress: ████████░░ 80% Progress: ██████░░░░ 60% ║
|
|
116
|
+
║ TODOs: 10/12 TODOs: 5/8 ║
|
|
117
|
+
║ Last commit: 5m ago Last commit: 12m ago ║
|
|
118
|
+
║ ║
|
|
119
|
+
║ Feature 1.3: Dashboard ║
|
|
120
|
+
║ ═════════════════════ ║
|
|
121
|
+
║ Status: 🟡 Blocked ║
|
|
122
|
+
║ Blocker: "Needs auth API types from feature-1.1" ║
|
|
123
|
+
║ ║
|
|
124
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
125
|
+
║ MERGE QUEUE ║
|
|
126
|
+
║ ○ feature/auth (ready when 100%) ║
|
|
127
|
+
║ ○ feature/payments (ready when 100%) ║
|
|
128
|
+
║ ○ feature/dashboard (blocked by feature/auth) ║
|
|
129
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### `/parallel merge <feature>`
|
|
133
|
+
|
|
134
|
+
Merge completed feature back to main branch.
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
/parallel merge auth # Merge auth feature
|
|
138
|
+
/parallel merge 1.1 # Merge by feature ID
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Process:**
|
|
142
|
+
|
|
143
|
+
1. Check feature is 100% complete
|
|
144
|
+
2. Run quality checks in worktree
|
|
145
|
+
3. Create PR from worktree branch
|
|
146
|
+
4. Merge PR
|
|
147
|
+
5. Pull changes to main worktree
|
|
148
|
+
6. Option to remove worktree
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
152
|
+
║ MERGE: feature/auth ║
|
|
153
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
154
|
+
║ ║
|
|
155
|
+
║ ✓ All TODOs complete (12/12) ║
|
|
156
|
+
║ ✓ Quality checks passing ║
|
|
157
|
+
║ ✓ No conflicts with main ║
|
|
158
|
+
║ ║
|
|
159
|
+
║ Ready to merge. ║
|
|
160
|
+
║ ║
|
|
161
|
+
║ [m] Merge to main ║
|
|
162
|
+
║ [p] Create PR only ║
|
|
163
|
+
║ [c] Cancel ║
|
|
164
|
+
║ ║
|
|
165
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### `/parallel cleanup [feature]`
|
|
169
|
+
|
|
170
|
+
Remove worktrees for completed/merged features.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
/parallel cleanup # Interactive - asks for each
|
|
174
|
+
/parallel cleanup auth # Remove specific worktree
|
|
175
|
+
/parallel cleanup --all # Remove all worktrees (careful!)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
180
|
+
║ CLEANUP WORKTREES ║
|
|
181
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
182
|
+
║ ║
|
|
183
|
+
║ ../project-auth ║
|
|
184
|
+
║ Status: Merged ✓ ║
|
|
185
|
+
║ [r] Remove [k] Keep ║
|
|
186
|
+
║ ║
|
|
187
|
+
║ ../project-payments ║
|
|
188
|
+
║ Status: In progress (60%) ║
|
|
189
|
+
║ [r] Remove [k] Keep (recommended) ║
|
|
190
|
+
║ ║
|
|
191
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### `/parallel sync`
|
|
195
|
+
|
|
196
|
+
Sync state files across worktrees.
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
/parallel sync # Sync progress.yaml updates
|
|
200
|
+
/parallel sync --from main # Pull main changes into worktrees
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Useful when:
|
|
204
|
+
- Dependencies between features resolved
|
|
205
|
+
- Need to unblock waiting features
|
|
206
|
+
- Main branch updated with fixes
|
|
207
|
+
|
|
208
|
+
## File Scope
|
|
209
|
+
|
|
210
|
+
Each worktree gets a `.claude/file_scope.txt`:
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
# This session can only edit files matching these patterns
|
|
214
|
+
src/auth/**/*
|
|
215
|
+
tests/auth/**/*
|
|
216
|
+
packages/shared/auth/**/*
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
The `enforce-file-scope.sh` hook blocks edits outside this scope.
|
|
220
|
+
|
|
221
|
+
### Defining Scope in Roadmap
|
|
222
|
+
|
|
223
|
+
Features should define their file scope:
|
|
224
|
+
|
|
225
|
+
```yaml
|
|
226
|
+
# roadmap/phase-01/feature-1.1.yaml
|
|
227
|
+
id: feature-1.1
|
|
228
|
+
name: User Authentication
|
|
229
|
+
file_scope:
|
|
230
|
+
- src/auth/**/*
|
|
231
|
+
- tests/auth/**/*
|
|
232
|
+
- packages/shared/auth/**/*
|
|
233
|
+
subfeatures:
|
|
234
|
+
# ...
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Conflict Detection
|
|
238
|
+
|
|
239
|
+
Before creating worktrees, `/parallel start` checks for overlaps:
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
243
|
+
║ ❌ FILE SCOPE CONFLICT ║
|
|
244
|
+
╠══════════════════════════════════════════════════════════════╣
|
|
245
|
+
║ ║
|
|
246
|
+
║ Cannot run features in parallel - file scope overlap: ║
|
|
247
|
+
║ ║
|
|
248
|
+
║ Feature 1.1 (auth) and Feature 1.2 (api): ║
|
|
249
|
+
║ Both claim: src/shared/types.ts ║
|
|
250
|
+
║ ║
|
|
251
|
+
║ Options: ║
|
|
252
|
+
║ 1. Run features sequentially ║
|
|
253
|
+
║ 2. Update file_scope in roadmap to remove overlap ║
|
|
254
|
+
║ 3. Create shared types as separate feature first ║
|
|
255
|
+
║ ║
|
|
256
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## State Management
|
|
260
|
+
|
|
261
|
+
### Main Worktree State
|
|
262
|
+
|
|
263
|
+
```yaml
|
|
264
|
+
# progress.yaml (main worktree)
|
|
265
|
+
parallel_execution:
|
|
266
|
+
active: true
|
|
267
|
+
started_at: 2026-02-19T10:00:00Z
|
|
268
|
+
worktrees:
|
|
269
|
+
- path: ../project-auth
|
|
270
|
+
branch: feature/auth
|
|
271
|
+
feature: feature-1.1
|
|
272
|
+
status: running
|
|
273
|
+
progress: 80
|
|
274
|
+
- path: ../project-payments
|
|
275
|
+
branch: feature/payments
|
|
276
|
+
feature: feature-1.2
|
|
277
|
+
status: running
|
|
278
|
+
progress: 60
|
|
279
|
+
- path: ../project-dashboard
|
|
280
|
+
branch: feature/dashboard
|
|
281
|
+
feature: feature-1.3
|
|
282
|
+
status: blocked
|
|
283
|
+
blocked_by: feature-1.1
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Feature Worktree State
|
|
287
|
+
|
|
288
|
+
```yaml
|
|
289
|
+
# progress.yaml (../project-auth)
|
|
290
|
+
execution_state:
|
|
291
|
+
scope: feature-1.1
|
|
292
|
+
is_parallel_worktree: true
|
|
293
|
+
main_worktree: /path/to/main
|
|
294
|
+
file_scope:
|
|
295
|
+
- src/auth/**/*
|
|
296
|
+
- tests/auth/**/*
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Integration
|
|
300
|
+
|
|
301
|
+
| Command | Integration |
|
|
302
|
+
|---------|-------------|
|
|
303
|
+
| `/status` | Shows parallel execution overview if active |
|
|
304
|
+
| `/dashboard` | Shows parallel feature progress |
|
|
305
|
+
| `/run` | Executes within worktree scope |
|
|
306
|
+
| `/compact` | Works per-worktree |
|
|
307
|
+
|
|
308
|
+
## Requirements
|
|
309
|
+
|
|
310
|
+
- Git 2.17+ (worktree support)
|
|
311
|
+
- Sufficient disk space for multiple worktrees
|
|
312
|
+
- `file_scope` defined in feature YAML
|
|
313
|
+
|
|
314
|
+
## Best Practices
|
|
315
|
+
|
|
316
|
+
1. **Define scope early** - Add `file_scope` when planning features
|
|
317
|
+
2. **No shared files** - If files must be shared, create them as separate feature first
|
|
318
|
+
3. **Sync regularly** - Use `/parallel sync` to keep worktrees updated
|
|
319
|
+
4. **Merge promptly** - Merge completed features to unblock dependencies
|
|
320
|
+
5. **Clean up** - Remove merged worktrees to save disk space
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pause
|
|
3
|
+
description: Pause OODA loop at safe checkpoint
|
|
4
|
+
model: haiku
|
|
5
|
+
tools: Read, Write
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /pause
|
|
9
|
+
|
|
10
|
+
Gracefully exit the OODA loop, preserving state for `/resume`.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
/pause # After current TODO completes
|
|
16
|
+
/pause --immediate # Pause now (may leave TODO incomplete)
|
|
17
|
+
/pause --reason "msg" # Record reason for pause
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Behavior
|
|
21
|
+
|
|
22
|
+
| Flag | When Pauses | TODO State |
|
|
23
|
+
|------|-------------|------------|
|
|
24
|
+
| (default) | After ACT completes | Done, clean |
|
|
25
|
+
| `--immediate` | Immediately | In-progress, needs /retry |
|
|
26
|
+
|
|
27
|
+
## State Saved
|
|
28
|
+
|
|
29
|
+
Updates `progress.yaml`:
|
|
30
|
+
```yaml
|
|
31
|
+
execution_state:
|
|
32
|
+
status: paused
|
|
33
|
+
paused_at: {timestamp}
|
|
34
|
+
pause_reason: "{reason}"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Output
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
⏸ PAUSED at todo-1.1b-004
|
|
41
|
+
|
|
42
|
+
Progress: 10/14 TODOs (71%)
|
|
43
|
+
|
|
44
|
+
Resume: /resume
|
|
45
|
+
Skip: /skip
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## OODA Integration
|
|
49
|
+
|
|
50
|
+
See `/run` command for:
|
|
51
|
+
- Full OODA loop documentation
|
|
52
|
+
- State transitions
|
|
53
|
+
- Checkpoint behavior
|
|
54
|
+
|
|
55
|
+
Pause saves OODA state (confidence, patterns) for seamless resume.
|