forge-workflow 1.0.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/.claude/commands/check.md +145 -0
- package/.claude/commands/dev.md +184 -0
- package/.claude/commands/merge.md +170 -0
- package/.claude/commands/plan.md +141 -0
- package/.claude/commands/research.md +125 -0
- package/.claude/commands/review.md +393 -0
- package/.claude/commands/ship.md +120 -0
- package/.claude/commands/sonarcloud.md +156 -0
- package/.claude/commands/status.md +76 -0
- package/.claude/commands/verify.md +185 -0
- package/.claude/rules/workflow.md +98 -0
- package/.claude/scripts/load-env.sh +32 -0
- package/.claude/skills/parallel-ai/README.md +135 -0
- package/.claude/skills/parallel-ai/SKILL.md +94 -0
- package/.claude/skills/parallel-ai/api-reference.md +141 -0
- package/.claude/skills/parallel-ai/quick-reference.md +100 -0
- package/.claude/skills/parallel-ai/research-workflows.md +77 -0
- package/.claude/skills/sonarcloud/SKILL.md +154 -0
- package/.claude/skills/sonarcloud/reference.md +466 -0
- package/README.md +205 -0
- package/bin/forge.js +140 -0
- package/docs/WORKFLOW.md +251 -0
- package/docs/research/TEMPLATE.md +292 -0
- package/install.sh +88 -0
- package/package.json +36 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Complete validation (type/lint/tests/security)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Run comprehensive validation including type checking, linting, code review, security review, and tests.
|
|
6
|
+
|
|
7
|
+
# Check
|
|
8
|
+
|
|
9
|
+
This command validates all code before creating a pull request.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
/check
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What This Command Does
|
|
18
|
+
|
|
19
|
+
### Step 1: Type Check
|
|
20
|
+
```bash
|
|
21
|
+
# Run your project's type check command
|
|
22
|
+
npm run typecheck # or: bun run typecheck, tsc, etc.
|
|
23
|
+
```
|
|
24
|
+
- Verify all TypeScript types are valid
|
|
25
|
+
- No `any` types allowed
|
|
26
|
+
- Strict mode enforcement
|
|
27
|
+
|
|
28
|
+
### Step 2: Lint
|
|
29
|
+
```bash
|
|
30
|
+
# Run your project's lint command
|
|
31
|
+
npm run lint # or: bun run lint, eslint ., etc.
|
|
32
|
+
```
|
|
33
|
+
- Linting rules
|
|
34
|
+
- Code style consistency
|
|
35
|
+
- Best practices compliance
|
|
36
|
+
|
|
37
|
+
### Step 3: Code Review (if available)
|
|
38
|
+
```bash
|
|
39
|
+
/code-review:code-review
|
|
40
|
+
```
|
|
41
|
+
- Static code analysis
|
|
42
|
+
- Code quality check
|
|
43
|
+
- Potential issues flagged
|
|
44
|
+
|
|
45
|
+
### Step 4: Security Review
|
|
46
|
+
|
|
47
|
+
**OWASP Top 10 Checklist**:
|
|
48
|
+
- A01: Broken Access Control
|
|
49
|
+
- A02: Cryptographic Failures
|
|
50
|
+
- A03: Injection
|
|
51
|
+
- A04: Insecure Design
|
|
52
|
+
- A05: Security Misconfiguration
|
|
53
|
+
- A06: Vulnerable Components
|
|
54
|
+
- A07: Authentication Failures
|
|
55
|
+
- A08: Data Integrity Failures
|
|
56
|
+
- A09: Logging & Monitoring Failures
|
|
57
|
+
- A10: Server-Side Request Forgery
|
|
58
|
+
|
|
59
|
+
**Automated Security Scan**:
|
|
60
|
+
```bash
|
|
61
|
+
# Run your project's security scan
|
|
62
|
+
npm audit # or: bun audit, snyk test, etc.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Manual Review**:
|
|
66
|
+
- Review security test scenarios (from research doc)
|
|
67
|
+
- Verify security mitigations implemented
|
|
68
|
+
- Check for sensitive data exposure
|
|
69
|
+
|
|
70
|
+
### Step 5: Tests
|
|
71
|
+
```bash
|
|
72
|
+
# Run your project's test command
|
|
73
|
+
npm run test # or: bun run test, jest, vitest, etc.
|
|
74
|
+
```
|
|
75
|
+
- All tests passing
|
|
76
|
+
- Includes security test scenarios
|
|
77
|
+
- TDD tests from /dev phase
|
|
78
|
+
|
|
79
|
+
### Step 6: Handle Failures
|
|
80
|
+
|
|
81
|
+
If any check fails:
|
|
82
|
+
```bash
|
|
83
|
+
# Create Beads issue for problems
|
|
84
|
+
bd create "Fix <issue-description>"
|
|
85
|
+
|
|
86
|
+
# Mark current issue as blocked
|
|
87
|
+
bd update <current-id> --status blocked --comment "Blocked by <new-issue-id>"
|
|
88
|
+
|
|
89
|
+
# Output what needs fixing
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
If all pass:
|
|
93
|
+
```
|
|
94
|
+
Ready for /ship
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Example Output (Success)
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
✓ Type check: Passed
|
|
101
|
+
✓ Lint: Passed
|
|
102
|
+
✓ Code review: No issues
|
|
103
|
+
✓ Security Review:
|
|
104
|
+
- OWASP Top 10: All mitigations verified
|
|
105
|
+
- Automated scan: No vulnerabilities
|
|
106
|
+
- Manual review: Security tests passing
|
|
107
|
+
✓ Tests: 15/15 passing (TDD complete)
|
|
108
|
+
|
|
109
|
+
Ready for /ship
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Example Output (Failure)
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
✗ Tests: 2/15 failing
|
|
116
|
+
- validation.test.ts: Assertion failed
|
|
117
|
+
- auth.test.ts: Timeout exceeded
|
|
118
|
+
|
|
119
|
+
✓ Beads issue created: bd-k8m3 "Fix validation test"
|
|
120
|
+
✓ Current issue marked: Blocked by bd-k8m3
|
|
121
|
+
|
|
122
|
+
Fix issues then re-run /check
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Integration with Workflow
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
1. /status → Understand current context
|
|
129
|
+
2. /research <name> → Research and document
|
|
130
|
+
3. /plan <feature-slug> → Create plan and tracking
|
|
131
|
+
4. /dev → Implement with TDD
|
|
132
|
+
5. /check → Validate (you are here)
|
|
133
|
+
6. /ship → Create PR
|
|
134
|
+
7. /review → Address comments
|
|
135
|
+
8. /merge → Merge and cleanup
|
|
136
|
+
9. /verify → Final documentation check
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Tips
|
|
140
|
+
|
|
141
|
+
- **All checks must pass**: Don't proceed to /ship with failures
|
|
142
|
+
- **Security is mandatory**: OWASP Top 10 review required for all features
|
|
143
|
+
- **Create issues for failures**: Track problems in Beads
|
|
144
|
+
- **TDD helps**: Tests should already pass from /dev phase
|
|
145
|
+
- **Fix before shipping**: Resolve all issues before creating PR
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: TDD development with parallel orchestration
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Implement features using Test-Driven Development with intelligent parallelization.
|
|
6
|
+
|
|
7
|
+
# Development
|
|
8
|
+
|
|
9
|
+
This command handles implementation with TDD as the default approach.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
/dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What This Command Does
|
|
18
|
+
|
|
19
|
+
### Step 1: Analyze Complexity & Dependencies
|
|
20
|
+
|
|
21
|
+
Read OpenSpec tasks.md (if strategic) and identify:
|
|
22
|
+
- All files to be created/modified
|
|
23
|
+
- **Independent files**: Can run in parallel tracks
|
|
24
|
+
- **Co-dependent files**: Must run sequentially
|
|
25
|
+
- **Shared foundation**: Create first, then parallelize
|
|
26
|
+
|
|
27
|
+
**Example Dependency Analysis**:
|
|
28
|
+
```
|
|
29
|
+
INDEPENDENT (Can Parallelize):
|
|
30
|
+
- Track A: API endpoint (/api/payments) → No dependencies
|
|
31
|
+
- Track B: UI components (PaymentForm.tsx) → No dependencies
|
|
32
|
+
- Track C: Database migration (add_payments.sql) → No dependencies
|
|
33
|
+
|
|
34
|
+
CO-DEPENDENT (Must Sequence):
|
|
35
|
+
- Step 1: Types (types/payment.ts) → FIRST
|
|
36
|
+
- Step 2: API uses types → AFTER Step 1
|
|
37
|
+
- Step 3: UI uses types → AFTER Step 1
|
|
38
|
+
|
|
39
|
+
Decision: Parallel tracks possible after types created
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Step 2: Create TodoWrite (TDD Pattern)
|
|
43
|
+
|
|
44
|
+
**TESTS WRITTEN UPFRONT** - Before implementation
|
|
45
|
+
|
|
46
|
+
Structure as RED-GREEN-REFACTOR cycles:
|
|
47
|
+
1. Write failing test (RED)
|
|
48
|
+
2. Implement minimal solution (GREEN)
|
|
49
|
+
3. Refactor and clean up
|
|
50
|
+
4. Repeat
|
|
51
|
+
|
|
52
|
+
### Step 3: Execute Development
|
|
53
|
+
|
|
54
|
+
**Option A: Sequential** (Simple, no parallelization needed)
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
TodoWrite (TDD):
|
|
58
|
+
1. ☐ Write test: payment-validation.test.ts (RED)
|
|
59
|
+
2. ☐ Implement: validation logic (GREEN)
|
|
60
|
+
3. ☐ Refactor: extract helpers
|
|
61
|
+
4. ☐ Write test: payment-errors.test.ts (RED)
|
|
62
|
+
5. ☐ Implement: error handling (GREEN)
|
|
63
|
+
6. ☐ Refactor: clean up
|
|
64
|
+
7. ☐ Write test: payment-db.test.ts (RED)
|
|
65
|
+
8. ☐ Implement: database layer (GREEN)
|
|
66
|
+
9. ☐ Refactor: optimize queries
|
|
67
|
+
10. ☐ Write test: payment-flow.e2e.ts (RED)
|
|
68
|
+
11. ☐ Implement: E2E integration (GREEN)
|
|
69
|
+
12. ☐ Refactor: final cleanup
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Option B: Parallel** (Complex, independent tracks)
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
Step 1: Create shared types (sequential)
|
|
76
|
+
TodoWrite (Foundation):
|
|
77
|
+
1. ☐ Write test: types.test.ts
|
|
78
|
+
2. ☐ Create: types/payment.ts
|
|
79
|
+
|
|
80
|
+
Step 2: Launch 3 parallel tracks
|
|
81
|
+
|
|
82
|
+
Track 1 (backend-architect):
|
|
83
|
+
TodoWrite (TDD):
|
|
84
|
+
1. ☐ Write test: api endpoint tests
|
|
85
|
+
2. ☐ Implement: /api/payments
|
|
86
|
+
3. ☐ Refactor
|
|
87
|
+
|
|
88
|
+
Track 2 (frontend-developer):
|
|
89
|
+
TodoWrite (TDD):
|
|
90
|
+
1. ☐ Write test: component tests
|
|
91
|
+
2. ☐ Implement: PaymentForm.tsx
|
|
92
|
+
3. ☐ Refactor
|
|
93
|
+
|
|
94
|
+
Track 3 (database-architect):
|
|
95
|
+
TodoWrite (TDD):
|
|
96
|
+
1. ☐ Write test: migration tests
|
|
97
|
+
2. ☐ Implement: add_payments.sql
|
|
98
|
+
3. ☐ Refactor
|
|
99
|
+
|
|
100
|
+
Step 3: Integration (sequential)
|
|
101
|
+
TodoWrite (TDD):
|
|
102
|
+
1. ☐ Write test: E2E flow
|
|
103
|
+
2. ☐ Integrate: all tracks
|
|
104
|
+
3. ☐ Refactor
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Step 4: Update Beads Throughout
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# When starting
|
|
111
|
+
bd update <id> --status in_progress
|
|
112
|
+
|
|
113
|
+
# Mid-session progress
|
|
114
|
+
bd update <id> --comment "API done, UI pending"
|
|
115
|
+
|
|
116
|
+
# If blocked
|
|
117
|
+
bd update <id> --status blocked --comment "Reason"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Step 5: Commit After Each GREEN Cycle
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
git add .
|
|
124
|
+
git commit -m "test: add payment validation tests"
|
|
125
|
+
|
|
126
|
+
git add .
|
|
127
|
+
git commit -m "feat: implement payment validation"
|
|
128
|
+
|
|
129
|
+
git add .
|
|
130
|
+
git commit -m "refactor: extract validation helpers"
|
|
131
|
+
|
|
132
|
+
# Regular pushes
|
|
133
|
+
git push
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Example Output (Sequential)
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
✓ TodoWrite: 12/12 TDD cycles completed
|
|
140
|
+
✓ Tests written first: 4 test files (42 test cases)
|
|
141
|
+
✓ Implementation: All tests passing
|
|
142
|
+
✓ Beads updated: bd-x7y2 in_progress → ready for review
|
|
143
|
+
✓ Commits: 12 commits (1 per TDD cycle)
|
|
144
|
+
|
|
145
|
+
Ready for /check
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Example Output (Parallel)
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
✓ Dependency Analysis: 3 independent tracks + 1 shared foundation
|
|
152
|
+
✓ Foundation: types/payment.ts created (tests passing)
|
|
153
|
+
✓ Parallel Execution:
|
|
154
|
+
- Track 1 (API): Completed (tests passing)
|
|
155
|
+
- Track 2 (UI): Completed (tests passing)
|
|
156
|
+
- Track 3 (DB): Completed (tests passing)
|
|
157
|
+
✓ Integration: E2E tests passing
|
|
158
|
+
✓ Beads updated: bd-x7y2 in_progress → ready for review
|
|
159
|
+
✓ Commits: 18 commits (from 3 tracks + integration)
|
|
160
|
+
|
|
161
|
+
Ready for /check
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Integration with Workflow
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
1. /status → Understand current context
|
|
168
|
+
2. /research <name> → Research and document
|
|
169
|
+
3. /plan <feature-slug> → Create plan and tracking
|
|
170
|
+
4. /dev → Implement with TDD (you are here)
|
|
171
|
+
5. /check → Validate
|
|
172
|
+
6. /ship → Create PR
|
|
173
|
+
7. /review → Address comments
|
|
174
|
+
8. /merge → Merge and cleanup
|
|
175
|
+
9. /verify → Final documentation check
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Tips
|
|
179
|
+
|
|
180
|
+
- **TDD is mandatory**: Always write tests first
|
|
181
|
+
- **Commit after each cycle**: RED → commit test, GREEN → commit impl, REFACTOR → commit cleanup
|
|
182
|
+
- **Parallel for independence**: Only parallelize truly independent tracks
|
|
183
|
+
- **Update Beads regularly**: Keep status current for handoffs
|
|
184
|
+
- **Tests must pass**: Don't move to /check with failing tests
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Update docs, merge PR, archive, cleanup
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Update project documentation, merge the pull request, archive proposals, and clean up.
|
|
6
|
+
|
|
7
|
+
# Merge
|
|
8
|
+
|
|
9
|
+
This command completes the feature by merging the PR and updating documentation.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
/merge <pr-number>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What This Command Does
|
|
18
|
+
|
|
19
|
+
### Step 1: Final Verification
|
|
20
|
+
```bash
|
|
21
|
+
gh pr checks <pr-number> # Ensure all checks pass
|
|
22
|
+
gh pr view <pr-number> --json reviewDecision # Check approval status
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Step 2: Update Project Documentation (BEFORE merge)
|
|
26
|
+
|
|
27
|
+
**A. Update PROGRESS.md**:
|
|
28
|
+
```bash
|
|
29
|
+
# Add feature to completed list with:
|
|
30
|
+
# - Feature name
|
|
31
|
+
# - Completion date
|
|
32
|
+
# - Beads issue ID
|
|
33
|
+
# - PR number
|
|
34
|
+
# - Research doc link
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**B. Update API_REFERENCE.md** (if API changes):
|
|
38
|
+
```bash
|
|
39
|
+
# Document:
|
|
40
|
+
# - New endpoints
|
|
41
|
+
# - Request/response schemas
|
|
42
|
+
# - Authentication requirements
|
|
43
|
+
# - Example requests
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**C. Update Architecture docs** (if strategic):
|
|
47
|
+
```bash
|
|
48
|
+
# Update:
|
|
49
|
+
# - docs/architecture/ diagrams
|
|
50
|
+
# - New patterns introduced
|
|
51
|
+
# - System architecture overview
|
|
52
|
+
# - Decision records (ADRs) if applicable
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**D. Update README.md** (if user-facing):
|
|
56
|
+
```bash
|
|
57
|
+
# Update:
|
|
58
|
+
# - Features list
|
|
59
|
+
# - Configuration options
|
|
60
|
+
# - Installation/setup steps
|
|
61
|
+
# - Usage examples
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**E. Update Testing docs** (if new patterns):
|
|
65
|
+
```bash
|
|
66
|
+
# Document:
|
|
67
|
+
# - New test utilities
|
|
68
|
+
# - Testing strategy
|
|
69
|
+
# - Examples
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**F. Commit documentation updates**:
|
|
73
|
+
```bash
|
|
74
|
+
git add docs/ README.md
|
|
75
|
+
git commit -m "docs: update project documentation for <feature-name>
|
|
76
|
+
|
|
77
|
+
- Updated PROGRESS.md: Marked <feature> as complete
|
|
78
|
+
- Updated API_REFERENCE.md: Added <endpoints> (if applicable)
|
|
79
|
+
- Updated architecture docs: <changes> (if applicable)
|
|
80
|
+
- Updated README.md: <changes> (if applicable)
|
|
81
|
+
|
|
82
|
+
Closes: <beads-id>
|
|
83
|
+
See: docs/research/<feature-slug>.md"
|
|
84
|
+
|
|
85
|
+
git push
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Step 3: Merge PR
|
|
89
|
+
```bash
|
|
90
|
+
gh pr merge <pr-number> --squash --delete-branch
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Step 4: Archive OpenSpec (if strategic)
|
|
94
|
+
```bash
|
|
95
|
+
openspec archive <feature-slug> --yes
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Step 5: Sync Beads
|
|
99
|
+
```bash
|
|
100
|
+
bd sync
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Step 6: Switch to Main
|
|
104
|
+
```bash
|
|
105
|
+
git checkout main
|
|
106
|
+
git pull
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Step 7: Verify Cleanup
|
|
110
|
+
- Documentation updated: ✓
|
|
111
|
+
- Branch deleted: ✓
|
|
112
|
+
- OpenSpec archived (if strategic): ✓
|
|
113
|
+
- Beads synced: ✓
|
|
114
|
+
|
|
115
|
+
## Example Output
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
✓ Documentation Updates:
|
|
119
|
+
- docs/planning/PROGRESS.md: Feature marked complete
|
|
120
|
+
- docs/reference/API_REFERENCE.md: 3 new endpoints documented
|
|
121
|
+
- docs/architecture/: Payment system diagram updated
|
|
122
|
+
- README.md: Billing features added
|
|
123
|
+
- Committed: docs: update project documentation
|
|
124
|
+
|
|
125
|
+
✓ PR checks: All passing
|
|
126
|
+
✓ PR approval: Approved by user
|
|
127
|
+
✓ PR merged: squash-merge to main
|
|
128
|
+
✓ Branch deleted: feat/stripe-billing
|
|
129
|
+
✓ OpenSpec archived: openspec/changes/stripe-billing/ (if strategic)
|
|
130
|
+
✓ Beads synced
|
|
131
|
+
✓ Switched to main
|
|
132
|
+
|
|
133
|
+
Merge complete!
|
|
134
|
+
|
|
135
|
+
Summary:
|
|
136
|
+
- Feature: Stripe billing integration
|
|
137
|
+
- Research: docs/research/stripe-billing.md
|
|
138
|
+
- Beads: bd-x7y2 (closed)
|
|
139
|
+
- OpenSpec: Archived (if strategic)
|
|
140
|
+
- PR: #123 (merged)
|
|
141
|
+
- Commits: 18 (across 3 parallel tracks + integration)
|
|
142
|
+
- Tests: 42 test cases, all passing
|
|
143
|
+
- Documentation: Updated across 4 files
|
|
144
|
+
|
|
145
|
+
Next: /verify (cross-check all documentation)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Integration with Workflow
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
1. /status → Understand current context
|
|
152
|
+
2. /research <name> → Research and document
|
|
153
|
+
3. /plan <feature-slug> → Create plan and tracking
|
|
154
|
+
4. /dev → Implement with TDD
|
|
155
|
+
5. /check → Validate
|
|
156
|
+
6. /ship → Create PR
|
|
157
|
+
7. /review → Address comments
|
|
158
|
+
8. /merge → Merge and cleanup (you are here)
|
|
159
|
+
9. /verify → Final documentation check
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Tips
|
|
163
|
+
|
|
164
|
+
- **Update docs BEFORE merge**: All documentation must be current
|
|
165
|
+
- **Verify PR approval**: Ensure user has approved the PR
|
|
166
|
+
- **Squash merge**: Keep main branch history clean
|
|
167
|
+
- **Archive OpenSpec**: Strategic proposals get archived after merge
|
|
168
|
+
- **Sync Beads**: Ensure Beads database is up-to-date
|
|
169
|
+
- **Switch to main**: Ready for next feature
|
|
170
|
+
- **Run /verify**: Final documentation verification step
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Write OpenSpec + Beads + tasks
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Create formal plan based on research, with optional OpenSpec proposal for strategic changes.
|
|
6
|
+
|
|
7
|
+
# Plan
|
|
8
|
+
|
|
9
|
+
This command creates a formal implementation plan after research is complete.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
/plan <feature-slug>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What This Command Does
|
|
18
|
+
|
|
19
|
+
### Step 1: Read Research
|
|
20
|
+
Load the research document:
|
|
21
|
+
```bash
|
|
22
|
+
cat docs/research/<feature-slug>.md
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Step 2: Determine Scope
|
|
26
|
+
|
|
27
|
+
**Tactical** (Quick fix, < 1 day):
|
|
28
|
+
- Skip OpenSpec
|
|
29
|
+
- Create Beads issue only
|
|
30
|
+
- Single-session work
|
|
31
|
+
|
|
32
|
+
**Strategic** (Major feature, architecture change):
|
|
33
|
+
- Create OpenSpec proposal first
|
|
34
|
+
- Wait for approval
|
|
35
|
+
- Then create Beads issue
|
|
36
|
+
- Multi-session or parallel work
|
|
37
|
+
|
|
38
|
+
### Step 3A: If Tactical
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Create Beads issue
|
|
42
|
+
bd create "<feature-name>"
|
|
43
|
+
bd show <id>
|
|
44
|
+
|
|
45
|
+
# Create branch
|
|
46
|
+
git checkout -b feat/<feature-slug>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Output**:
|
|
50
|
+
```
|
|
51
|
+
✓ Scope: Tactical (no OpenSpec needed)
|
|
52
|
+
✓ Beads Issue: bd-p8q1 "Fix login validation bug"
|
|
53
|
+
✓ Branch: feat/fix-login-validation
|
|
54
|
+
✓ Research: docs/research/fix-login-validation.md
|
|
55
|
+
|
|
56
|
+
Next: /dev
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Step 3B: If Strategic
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Create OpenSpec proposal
|
|
63
|
+
openspec proposal create <feature-slug>
|
|
64
|
+
|
|
65
|
+
# Write to openspec/changes/<feature-slug>/:
|
|
66
|
+
# - proposal.md (problem, solution, alternatives, impact)
|
|
67
|
+
# - tasks.md (implementation checklist, TDD-ordered)
|
|
68
|
+
# - design.md (technical decisions from research)
|
|
69
|
+
# - specs/<capability>/spec.md (delta changes)
|
|
70
|
+
|
|
71
|
+
# Validate
|
|
72
|
+
openspec validate <feature-slug> --strict
|
|
73
|
+
|
|
74
|
+
# Create Beads issue
|
|
75
|
+
bd create "<feature-name> (see openspec/changes/<feature-slug>)"
|
|
76
|
+
bd show <id>
|
|
77
|
+
|
|
78
|
+
# Create branch
|
|
79
|
+
git checkout -b feat/<feature-slug>
|
|
80
|
+
|
|
81
|
+
# Commit proposal
|
|
82
|
+
git add openspec/ docs/research/
|
|
83
|
+
git commit -m "proposal: <feature-name>
|
|
84
|
+
|
|
85
|
+
Research documented in docs/research/<feature-slug>.md
|
|
86
|
+
OpenSpec proposal in openspec/changes/<feature-slug>/"
|
|
87
|
+
|
|
88
|
+
git push -u origin feat/<feature-slug>
|
|
89
|
+
|
|
90
|
+
# Create proposal PR
|
|
91
|
+
gh pr create --title "Proposal: <feature-name>" \
|
|
92
|
+
--body "See openspec/changes/<feature-slug>/proposal.md"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Output**:
|
|
96
|
+
```
|
|
97
|
+
✓ Scope: Strategic (architecture change)
|
|
98
|
+
✓ OpenSpec Proposal: openspec/changes/stripe-billing/
|
|
99
|
+
- proposal.md: ✓ (references research doc)
|
|
100
|
+
- tasks.md: ✓ (8 steps, TDD-ordered)
|
|
101
|
+
- design.md: ✓ (8 key decisions documented)
|
|
102
|
+
- specs/payments/spec.md: ✓ (delta changes)
|
|
103
|
+
- Validation: PASSED
|
|
104
|
+
|
|
105
|
+
✓ Beads Issue: bd-x7y2 "Stripe billing (see openspec/changes/stripe-billing)"
|
|
106
|
+
✓ Branch: feat/stripe-billing
|
|
107
|
+
✓ Committed: Proposal + research doc
|
|
108
|
+
✓ PR created: https://github.com/.../pull/456
|
|
109
|
+
|
|
110
|
+
⏸️ WAITING FOR PROPOSAL APPROVAL
|
|
111
|
+
|
|
112
|
+
After approval, run: /dev
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Step 4: Link Beads to OpenSpec (if strategic)
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
bd update <id> --comment "OpenSpec: openspec/changes/<feature-slug>"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Integration with Workflow
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
1. /status → Understand current context
|
|
125
|
+
2. /research <name> → Research and document
|
|
126
|
+
3. /plan <feature-slug> → Create plan and tracking (you are here)
|
|
127
|
+
4. /dev → Implement with TDD
|
|
128
|
+
5. /check → Validate
|
|
129
|
+
6. /ship → Create PR
|
|
130
|
+
7. /review → Address comments
|
|
131
|
+
8. /merge → Merge and cleanup
|
|
132
|
+
9. /verify → Final documentation check
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Tips
|
|
136
|
+
|
|
137
|
+
- **Strategic vs Tactical**: When in doubt, start tactical. Refactor to strategic if needed.
|
|
138
|
+
- **OpenSpec for architecture**: Use proposals for anything that changes system design
|
|
139
|
+
- **Use research decisions**: Reference research doc in OpenSpec proposal
|
|
140
|
+
- **TDD-ordered tasks**: Order tasks.md by test dependencies
|
|
141
|
+
- **Link everything**: Connect Beads → OpenSpec → Research doc
|