@gobing-ai/spur 0.3.40 → 0.3.42
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-plugin/marketplace.json +15 -0
- package/README.md +15 -1
- package/config/templates/AGENTS.md +5 -3
- package/config/workflows/task-pipeline.yaml +103 -12
- package/package.json +15 -12
- package/plugins/README.md +655 -0
- package/plugins/sp/README.md +621 -0
- package/plugins/sp/agents/expert-spur.md +109 -0
- package/plugins/sp/agents/super-coder.md +126 -0
- package/plugins/sp/agents/super-planner.md +283 -0
- package/plugins/sp/agents/super-reviewer.md +154 -0
- package/plugins/sp/commands/dev-arch.md +30 -0
- package/plugins/sp/commands/dev-brainstorm.md +40 -0
- package/plugins/sp/commands/dev-changelog.md +28 -0
- package/plugins/sp/commands/dev-daily.md +29 -0
- package/plugins/sp/commands/dev-debug.md +29 -0
- package/plugins/sp/commands/dev-dogfood.md +33 -0
- package/plugins/sp/commands/dev-featurechange.md +130 -0
- package/plugins/sp/commands/dev-find-conflict.md +51 -0
- package/plugins/sp/commands/dev-find-issue.md +76 -0
- package/plugins/sp/commands/dev-find-next.md +60 -0
- package/plugins/sp/commands/dev-fixall.md +33 -0
- package/plugins/sp/commands/dev-gitmsg.md +28 -0
- package/plugins/sp/commands/dev-gtd.md +97 -0
- package/plugins/sp/commands/dev-handover.md +26 -0
- package/plugins/sp/commands/dev-idea.md +50 -0
- package/plugins/sp/commands/dev-next.md +31 -0
- package/plugins/sp/commands/dev-parallel.md +30 -0
- package/plugins/sp/commands/dev-plan.md +46 -0
- package/plugins/sp/commands/dev-refine.md +48 -0
- package/plugins/sp/commands/dev-refineall.md +65 -0
- package/plugins/sp/commands/dev-refresh.md +32 -0
- package/plugins/sp/commands/dev-reverse.md +32 -0
- package/plugins/sp/commands/dev-review.md +31 -0
- package/plugins/sp/commands/dev-run.md +63 -0
- package/plugins/sp/commands/dev-runall.md +80 -0
- package/plugins/sp/commands/dev-simplify.md +39 -0
- package/plugins/sp/commands/dev-unit.md +29 -0
- package/plugins/sp/commands/dev-verify.md +48 -0
- package/plugins/sp/commands/dev-verifyall.md +72 -0
- package/plugins/sp/commands/dev-wrap.md +30 -0
- package/plugins/sp/commands/dev-wrapall.md +33 -0
- package/plugins/sp/commands/rule-add.md +18 -0
- package/plugins/sp/commands/rule-refine.md +18 -0
- package/plugins/sp/commands/rule-scan.md +18 -0
- package/plugins/sp/commands/spur-init.md +22 -0
- package/plugins/sp/commands/workflow-add.md +18 -0
- package/plugins/sp/commands/workflow-refine.md +18 -0
- package/plugins/sp/hooks/agent-hint.ts +60 -0
- package/plugins/sp/hooks/careful-guard.ts +147 -0
- package/plugins/sp/hooks/context-post-tool.ts +325 -0
- package/plugins/sp/hooks/context-session-start.ts +182 -0
- package/plugins/sp/hooks/context-session-stop.ts +95 -0
- package/plugins/sp/hooks/hooks.json +51 -0
- package/plugins/sp/hooks/pi/guard-extension.ts +341 -0
- package/plugins/sp/hooks/task-write-guard.ts +84 -0
- package/plugins/sp/plugin.json +8 -0
- package/plugins/sp/scripts/batch-preflight.ts +204 -0
- package/plugins/sp/scripts/daily-summary/daily-summary.ts +606 -0
- package/plugins/sp/scripts/daily-summary/logger.ts +28 -0
- package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +363 -0
- package/plugins/sp/scripts/dogfood-testing/validate-report.ts +168 -0
- package/plugins/sp/scripts/feature-sync-bounded.ts +451 -0
- package/plugins/sp/scripts/stage-registry-adapter.ts +1341 -0
- package/plugins/sp/scripts/task-size-precheck.ts +202 -0
- package/plugins/sp/scripts/validate-commands.ts +651 -0
- package/plugins/sp/scripts/validate-flag-contracts.ts +875 -0
- package/plugins/sp/skills/brainstorm/SKILL.md +361 -0
- package/plugins/sp/skills/brainstorm/agents/openai.yaml +14 -0
- package/plugins/sp/skills/brainstorm/examples/ideation-example.md +209 -0
- package/plugins/sp/skills/brainstorm/metadata.openclaw +7 -0
- package/plugins/sp/skills/brainstorm/references/grilling-interview.md +68 -0
- package/plugins/sp/skills/brainstorm/references/workflows.md +255 -0
- package/plugins/sp/skills/branch-workflow/SKILL.md +109 -0
- package/plugins/sp/skills/branch-workflow/references/branch-lifecycle.md +69 -0
- package/plugins/sp/skills/branch-workflow/references/worktree-patterns.md +100 -0
- package/plugins/sp/skills/code-implementation/SKILL.md +176 -0
- package/plugins/sp/skills/code-implementation/references/debugging.md +64 -0
- package/plugins/sp/skills/code-implementation/references/implementation-patterns.md +113 -0
- package/plugins/sp/skills/code-improvement/SKILL.md +231 -0
- package/plugins/sp/skills/code-improvement/references/deepening-signals.md +205 -0
- package/plugins/sp/skills/code-review/SKILL.md +112 -0
- package/plugins/sp/skills/code-review/references/receiving-code-review.md +70 -0
- package/plugins/sp/skills/code-review/references/review-lenses.md +117 -0
- package/plugins/sp/skills/code-review/references/self-review-checklist.md +53 -0
- package/plugins/sp/skills/code-review/references/verification-before-completion.md +68 -0
- package/plugins/sp/skills/code-simplification/SKILL.md +225 -0
- package/plugins/sp/skills/code-testing/SKILL.md +108 -0
- package/plugins/sp/skills/code-testing/references/stacks/bun-ts.md +165 -0
- package/plugins/sp/skills/code-testing/references/stacks/go.md +88 -0
- package/plugins/sp/skills/code-testing/references/stacks/python.md +117 -0
- package/plugins/sp/skills/code-testing/references/test-loop-breaker.md +37 -0
- package/plugins/sp/skills/code-testing/references/test-output-discipline.md +52 -0
- package/plugins/sp/skills/code-testing/references/unit-testing.md +212 -0
- package/plugins/sp/skills/code-verification/SKILL.md +535 -0
- package/plugins/sp/skills/code-verification/references/code-improvement.md +39 -0
- package/plugins/sp/skills/code-verification/references/secu-review.md +94 -0
- package/plugins/sp/skills/code-verification/references/verdict-schema.md +141 -0
- package/plugins/sp/skills/conflict-finding/SKILL.md +254 -0
- package/plugins/sp/skills/conflict-finding/references/authority-resolution.md +258 -0
- package/plugins/sp/skills/conflict-finding/references/comparison-protocol.md +277 -0
- package/plugins/sp/skills/conflict-finding/references/finding-contract.md +346 -0
- package/plugins/sp/skills/conflict-finding/references/remediation-routing.md +276 -0
- package/plugins/sp/skills/daily-summary/SKILL.md +171 -0
- package/plugins/sp/skills/daily-summary/agents/openai.yaml +13 -0
- package/plugins/sp/skills/doc-evolve/SKILL.md +175 -0
- package/plugins/sp/skills/doc-evolve/references/operations.md +93 -0
- package/plugins/sp/skills/dogfood-testing/SKILL.md +608 -0
- package/plugins/sp/skills/dogfood-testing/references/monitor-ledger.md +211 -0
- package/plugins/sp/skills/dogfood-testing/references/report-template.md +351 -0
- package/plugins/sp/skills/doubt-driven-development/SKILL.md +136 -0
- package/plugins/sp/skills/functional-review/SKILL.md +364 -0
- package/plugins/sp/skills/functional-review/references/verdict-schema.md +133 -0
- package/plugins/sp/skills/indexed-context/SKILL.md +164 -0
- package/plugins/sp/skills/issue-finding/SKILL.md +424 -0
- package/plugins/sp/skills/issue-finding/agents/openai.yaml +15 -0
- package/plugins/sp/skills/issue-finding/examples/expected-findings.json +27 -0
- package/plugins/sp/skills/issue-finding/examples/session-test-loop.jsonl +23 -0
- package/plugins/sp/skills/issue-finding/references/session-formats.md +121 -0
- package/plugins/sp/skills/next-feature/SKILL.md +125 -0
- package/plugins/sp/skills/next-feature/references/handoff-routing.md +92 -0
- package/plugins/sp/skills/next-feature/references/proposal-contract.md +49 -0
- package/plugins/sp/skills/next-feature/references/ranking-rubric.md +52 -0
- package/plugins/sp/skills/next-feature/references/signal-derivation.md +67 -0
- package/plugins/sp/skills/next-router/SKILL.md +181 -0
- package/plugins/sp/skills/next-router/references/messages.md +90 -0
- package/plugins/sp/skills/next-router/references/routing-table.md +216 -0
- package/plugins/sp/skills/parallel-execution/SKILL.md +148 -0
- package/plugins/sp/skills/parallel-execution/references/dispatch-surface.md +100 -0
- package/plugins/sp/skills/parallel-execution/references/fan-out-patterns.md +101 -0
- package/plugins/sp/skills/parallel-execution/references/result-synthesis.md +94 -0
- package/plugins/sp/skills/reverse-engineering/SKILL.md +375 -0
- package/plugins/sp/skills/reverse-engineering/agents/openai.yaml +18 -0
- package/plugins/sp/skills/source-driven-development/SKILL.md +124 -0
- package/plugins/sp/skills/spec-decomposition/SKILL.md +117 -0
- package/plugins/sp/skills/spec-decomposition/references/decomposition.md +539 -0
- package/plugins/sp/skills/spur-cli/SKILL.md +133 -0
- package/plugins/sp/skills/spur-cli/references/agent.md +179 -0
- package/plugins/sp/skills/spur-cli/references/features/acceptance-criteria.md +82 -0
- package/plugins/sp/skills/spur-cli/references/features/hierarchy-mece.md +177 -0
- package/plugins/sp/skills/spur-cli/references/features/roadmap-priority.md +84 -0
- package/plugins/sp/skills/spur-cli/references/features/verbs.md +122 -0
- package/plugins/sp/skills/spur-cli/references/features.md +234 -0
- package/plugins/sp/skills/spur-cli/references/init.md +119 -0
- package/plugins/sp/skills/spur-cli/references/message.md +98 -0
- package/plugins/sp/skills/spur-cli/references/rules/authoring-rules.md +212 -0
- package/plugins/sp/skills/spur-cli/references/rules/fine-tuning.md +148 -0
- package/plugins/sp/skills/spur-cli/references/rules/operations.md +228 -0
- package/plugins/sp/skills/spur-cli/references/rules/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/rules.md +209 -0
- package/plugins/sp/skills/spur-cli/references/serve.md +58 -0
- package/plugins/sp/skills/spur-cli/references/tasks/l3-guard-cheatsheet.md +98 -0
- package/plugins/sp/skills/spur-cli/references/tasks/section-editing.md +95 -0
- package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +361 -0
- package/plugins/sp/skills/spur-cli/references/tasks.md +278 -0
- package/plugins/sp/skills/spur-cli/references/team.md +133 -0
- package/plugins/sp/skills/spur-cli/references/workflows/authoring-workflows.md +226 -0
- package/plugins/sp/skills/spur-cli/references/workflows/operations.md +211 -0
- package/plugins/sp/skills/spur-cli/references/workflows/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/workflows.md +355 -0
- package/plugins/sp/skills/spur-dev/SKILL.md +224 -0
- package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +196 -0
- package/plugins/sp/skills/spur-dev/references/cross-cutting.md +664 -0
- package/plugins/sp/skills/spur-dev/references/decision-brief.md +80 -0
- package/plugins/sp/skills/spur-dev/references/dev-operations.md +546 -0
- package/plugins/sp/skills/spur-dev/references/done-housekeeping.md +164 -0
- package/plugins/sp/skills/spur-dev/references/execution-batch.md +727 -0
- package/plugins/sp/skills/spur-dev/references/execution-workflow.md +350 -0
- package/plugins/sp/skills/spur-dev/references/feature-link-helper.md +191 -0
- package/plugins/sp/skills/spur-dev/references/flag-glossary.md +417 -0
- package/plugins/sp/skills/spur-dev/references/gate-checklists.md +171 -0
- package/plugins/sp/skills/spur-dev/references/glossary.md +95 -0
- package/plugins/sp/skills/spur-dev/references/idea-evaluation.md +80 -0
- package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +88 -0
- package/plugins/sp/skills/spur-dev/references/planning-workflow.md +302 -0
- package/plugins/sp/skills/spur-dev/references/product-planning.md +206 -0
- package/plugins/sp/skills/spur-dev/references/section-batching.md +24 -0
- package/plugins/sp/skills/sys-architecture/SKILL.md +155 -0
- package/plugins/sp/skills/sys-architecture/references/decision-method.md +137 -0
- package/plugins/sp/skills/sys-architecture/references/upkeep-survey.md +75 -0
- package/plugins/sp/skills/sys-debugging/SKILL.md +228 -0
- package/plugins/sp/skills/sys-debugging/references/debugging-protocol.md +62 -0
- package/plugins/sp/skills/test-driven-development/SKILL.md +248 -0
- package/plugins/sp/skills/wayfinder/SKILL.md +292 -0
- package/spur.js +6093 -5180
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorm-workflows
|
|
3
|
+
description: "Detailed 3-phase workflow for sp:brainstorm - Input, Ideation, Output with delegation pointers"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Brainstorm 3-Phase Workflow
|
|
7
|
+
|
|
8
|
+
Detailed guidance for the sp:brainstorm ideation workflow.
|
|
9
|
+
|
|
10
|
+
## Phase 1: Input Processing
|
|
11
|
+
|
|
12
|
+
**Goal:** Parse and validate input, extract context
|
|
13
|
+
|
|
14
|
+
### Input Type Detection
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
IF input contains "/" or "\" AND ends with ".md":
|
|
18
|
+
→ Treat as file path
|
|
19
|
+
ELSE:
|
|
20
|
+
→ Treat as issue description
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Reading Task Files
|
|
24
|
+
|
|
25
|
+
When a file path is detected:
|
|
26
|
+
|
|
27
|
+
1. **Resolve path** — Convert relative paths to absolute
|
|
28
|
+
2. **Read content** — Use Read tool
|
|
29
|
+
3. **Parse frontmatter** — Extract YAML fields:
|
|
30
|
+
- `status`: Current task status
|
|
31
|
+
- `wbs`: Work breakdown structure number
|
|
32
|
+
- `name`: Task identifier
|
|
33
|
+
- `description`: Brief summary
|
|
34
|
+
4. **Extract sections** — Parse markdown body:
|
|
35
|
+
- Background context
|
|
36
|
+
- Requirements
|
|
37
|
+
- Existing solutions (if any)
|
|
38
|
+
|
|
39
|
+
### Validation Checklist
|
|
40
|
+
|
|
41
|
+
- [ ] Input is not empty
|
|
42
|
+
- [ ] File exists (if path provided)
|
|
43
|
+
- [ ] YAML frontmatter is valid
|
|
44
|
+
- [ ] Required fields present
|
|
45
|
+
- [ ] Content has meaningful length (>50 characters)
|
|
46
|
+
|
|
47
|
+
### Clarification via AskUserQuestion
|
|
48
|
+
|
|
49
|
+
**When to clarify:**
|
|
50
|
+
- Input < 20 characters
|
|
51
|
+
- Background section empty or missing key context
|
|
52
|
+
- Requirements vague or incomplete
|
|
53
|
+
- Technical terms undefined
|
|
54
|
+
- Multiple valid interpretations
|
|
55
|
+
|
|
56
|
+
**Example:**
|
|
57
|
+
```yaml
|
|
58
|
+
AskUserQuestion:
|
|
59
|
+
- question: "What type of authentication do you need?"
|
|
60
|
+
header: "Auth Type"
|
|
61
|
+
options:
|
|
62
|
+
- label: "JWT tokens"
|
|
63
|
+
description: "Stateless, good for APIs, requires careful key management"
|
|
64
|
+
- label: "Session-based"
|
|
65
|
+
description: "Server-managed, simpler, good for traditional web apps"
|
|
66
|
+
- label: "OAuth2/OIDC"
|
|
67
|
+
description: "Third-party login (Google, GitHub), more complex setup"
|
|
68
|
+
multiSelect: false
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Phase 2: Ideation (Delegated)
|
|
74
|
+
|
|
75
|
+
**Goal:** Generate 2-3 solution approaches with trade-offs
|
|
76
|
+
|
|
77
|
+
### Research Delegation
|
|
78
|
+
|
|
79
|
+
DO NOT implement research directly. Delegate to specialized skills:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
1. Invoke sp:source-driven-development for verification
|
|
83
|
+
- Use for any external claims
|
|
84
|
+
- Follow source-first protocol
|
|
85
|
+
|
|
86
|
+
2. Delegate research + synthesis inline by default
|
|
87
|
+
- Run in the current session; escalate to `spur agent run` only on a subprocess trigger
|
|
88
|
+
- Request confidence scoring
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Approach Generation
|
|
92
|
+
|
|
93
|
+
**Structure:**
|
|
94
|
+
```markdown
|
|
95
|
+
### Approach 1: [Descriptive Name] ⭐ Recommended
|
|
96
|
+
|
|
97
|
+
**Description:** 2-3 sentences explaining the approach
|
|
98
|
+
|
|
99
|
+
**Trade-offs:**
|
|
100
|
+
- **Pros:**
|
|
101
|
+
- Advantage 1
|
|
102
|
+
- Advantage 2
|
|
103
|
+
- **Cons:**
|
|
104
|
+
- Disadvantage 1
|
|
105
|
+
- Disadvantage 2
|
|
106
|
+
|
|
107
|
+
**Implementation Notes:**
|
|
108
|
+
- Key technical considerations
|
|
109
|
+
- Dependencies or prerequisites
|
|
110
|
+
|
|
111
|
+
**Confidence:** HIGH/MEDIUM/LOW
|
|
112
|
+
**Sources:** [Citations with dates]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Source Citation Format
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
**Sources:**
|
|
119
|
+
- [Title](URL) | **Verified**: YYYY-MM-DD
|
|
120
|
+
- [Title](URL) | **Verified**: YYYY-MM-DD
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Confidence Scoring
|
|
124
|
+
|
|
125
|
+
| Level | Range | Criteria |
|
|
126
|
+
|-------|-------|----------|
|
|
127
|
+
| **HIGH** | >90% | Direct quote from official docs (2025+) |
|
|
128
|
+
| **MEDIUM** | 70-90% | Synthesized from multiple sources |
|
|
129
|
+
| **LOW** | <70% | Uncertain, flag for review |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Phase 3: Structured Output
|
|
134
|
+
|
|
135
|
+
**Goal:** Format and deliver results
|
|
136
|
+
|
|
137
|
+
### Section Generation
|
|
138
|
+
|
|
139
|
+
1. **Overview** (100-150 words)
|
|
140
|
+
- Context and problem summary
|
|
141
|
+
- Why this matters
|
|
142
|
+
- Current state
|
|
143
|
+
|
|
144
|
+
2. **Approaches** (200-300 words each)
|
|
145
|
+
- 2-3 options with trade-offs
|
|
146
|
+
- Implementation considerations
|
|
147
|
+
- Confidence levels
|
|
148
|
+
|
|
149
|
+
3. **Recommendations** (100-150 words)
|
|
150
|
+
- Recommended approach with reasoning
|
|
151
|
+
- Key factors in decision
|
|
152
|
+
- When to consider alternatives
|
|
153
|
+
|
|
154
|
+
4. **Next Steps** (bulleted list)
|
|
155
|
+
- Potential task items
|
|
156
|
+
- Research needs
|
|
157
|
+
- Implementation prerequisites
|
|
158
|
+
|
|
159
|
+
### Output Template
|
|
160
|
+
|
|
161
|
+
```markdown
|
|
162
|
+
# Brainstorm: [Topic]
|
|
163
|
+
|
|
164
|
+
**Date:** YYYY-MM-DD
|
|
165
|
+
|
|
166
|
+
## Overview
|
|
167
|
+
|
|
168
|
+
[Context and problem summary]
|
|
169
|
+
|
|
170
|
+
## Approaches
|
|
171
|
+
|
|
172
|
+
### Approach 1: [Name] ⭐ Recommended
|
|
173
|
+
|
|
174
|
+
**Description:** [2-3 sentences]
|
|
175
|
+
|
|
176
|
+
**Trade-offs:**
|
|
177
|
+
- **Pros:**
|
|
178
|
+
- [Advantage 1]
|
|
179
|
+
- **Cons:**
|
|
180
|
+
- [Disadvantage 1]
|
|
181
|
+
|
|
182
|
+
**Implementation Notes:**
|
|
183
|
+
- [Technical considerations]
|
|
184
|
+
|
|
185
|
+
**Confidence:** HIGH/MEDIUM/LOW
|
|
186
|
+
**Sources:** [Citations]
|
|
187
|
+
|
|
188
|
+
### Approach 2: [Name]
|
|
189
|
+
|
|
190
|
+
[Same structure]
|
|
191
|
+
|
|
192
|
+
## Recommendations
|
|
193
|
+
|
|
194
|
+
[Recommended approach with reasoning]
|
|
195
|
+
|
|
196
|
+
## Next Steps
|
|
197
|
+
|
|
198
|
+
1. [Task item 1]
|
|
199
|
+
2. [Task item 2]
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
**Generated by:** sp:brainstorm
|
|
204
|
+
**Research delegation:** sp:source-driven-development, spur agent run
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Task Creation Delegation
|
|
210
|
+
|
|
211
|
+
When user confirms approach, delegate to sp:spur-dev:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
// Pseudocode: Delegate breakdown to sp:spur-dev
|
|
215
|
+
Skill(skill="sp:spur-dev", args="plan <recommended_approach>")
|
|
216
|
+
|
|
217
|
+
// Receive structured JSON output, then create tasks via sp:spur-cli
|
|
218
|
+
Bash: spur task batch-create --file decomposition.json # bare JSON array (see sp:spur-cli)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Task Extraction Criteria
|
|
222
|
+
|
|
223
|
+
**Task-worthy:**
|
|
224
|
+
- Concrete and executable
|
|
225
|
+
- Clear completion condition
|
|
226
|
+
- Can be assigned to someone
|
|
227
|
+
- Estimated effort >30 minutes
|
|
228
|
+
|
|
229
|
+
**Not task-worthy:**
|
|
230
|
+
- "Consider performance implications" (too vague)
|
|
231
|
+
- "Research options" (already done)
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Error Handling
|
|
236
|
+
|
|
237
|
+
| Error | Action |
|
|
238
|
+
|-------|--------|
|
|
239
|
+
| Empty input | Prompt for issue description or file path |
|
|
240
|
+
| File not found | Provide clear error with path |
|
|
241
|
+
| Invalid YAML | Report parsing error |
|
|
242
|
+
| Missing fields | List missing fields, ask if incomplete |
|
|
243
|
+
| Research unavailable | Continue, note reduced confidence |
|
|
244
|
+
| Save fails | Display output, suggest manual save |
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Graceful Degradation
|
|
249
|
+
|
|
250
|
+
When tools unavailable:
|
|
251
|
+
|
|
252
|
+
1. **Continue** with available tools
|
|
253
|
+
2. **Note** reduced confidence
|
|
254
|
+
3. **Suggest** manual fallback
|
|
255
|
+
4. **Save** intermediate state
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: branch-workflow
|
|
3
|
+
description: "Branch lifecycle discipline: create, worktree, commit, self-review, merge, cleanup."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
license: Apache-2.0
|
|
6
|
+
metadata:
|
|
7
|
+
author: spur
|
|
8
|
+
version: "1.0"
|
|
9
|
+
platforms: "claude-code,codex,openclaw,opencode,antigravity"
|
|
10
|
+
category: execution
|
|
11
|
+
interactions:
|
|
12
|
+
- technique
|
|
13
|
+
operations:
|
|
14
|
+
- create-branch
|
|
15
|
+
- worktree
|
|
16
|
+
- merge-prep
|
|
17
|
+
- cleanup
|
|
18
|
+
see_also:
|
|
19
|
+
- sp:spur-dev
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# sp:branch-workflow — Branch Lifecycle & Worktrees
|
|
23
|
+
|
|
24
|
+
The branch-lifecycle discipline: create → worktree (optional) → commit → self-review → merge → cleanup. This skill teaches the agent how to manage git branches cleanly alongside the Spur task lifecycle.
|
|
25
|
+
|
|
26
|
+
## The branch lifecycle
|
|
27
|
+
|
|
28
|
+
### 1. Create
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
git checkout -b feature/<slug> # or fix/<slug>, refactor/<slug>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Branch naming: `feature/`, `fix/`, `refactor/`, `docs/`, `chore/` — match the conventional commit type. Slug is the task title, lowercased, hyphenated, ≤50 chars.
|
|
35
|
+
|
|
36
|
+
### 2. Worktree (optional — parallel branches)
|
|
37
|
+
|
|
38
|
+
A git worktree gives you an isolated working directory for a branch without stashing or switching:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git worktree add ../<project>-<branch> <branch>
|
|
42
|
+
cd ../<project>-<branch>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**When to use worktrees:**
|
|
46
|
+
- Two parallel features that you switch between frequently
|
|
47
|
+
- Hotfix isolation — fix on `main` while feature work stays on its branch
|
|
48
|
+
- Review-in-progress — keep the review branch available while starting new work
|
|
49
|
+
|
|
50
|
+
**When NOT to use:**
|
|
51
|
+
- Single-branch workflow (overhead isn't worth it)
|
|
52
|
+
- Disk-space constrained environments (each worktree is a full checkout)
|
|
53
|
+
- CI/CD environments (ephemeral checkouts already handle this)
|
|
54
|
+
|
|
55
|
+
### 3. Commit
|
|
56
|
+
|
|
57
|
+
Atomic, conventional commits. One concern per commit.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
git add <files for one concern>
|
|
61
|
+
git commit -m "feat(scope): summary"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 4. Self-review
|
|
65
|
+
|
|
66
|
+
Run `sp:code-review`'s pre-commit self-review checklist before pushing. Fix findings before requesting review.
|
|
67
|
+
|
|
68
|
+
### 5. Merge
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
git checkout main
|
|
72
|
+
git pull --rebase
|
|
73
|
+
git merge --no-ff feature/<slug> -m "chore(<scope>): merge feature/<slug> into main"
|
|
74
|
+
git push
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Merge commit message.** The `commit-msg` hook runs `cog verify`, which rejects git's default `Merge branch 'x'` message *and* a `merge:` type — cocogitto's default type set has no `merge`. Always pass an explicit conventional `-m`. A rejected message leaves the merge staged but uncommitted; complete it with `git commit -m "chore(<scope>): …"`. Do not reach for `--no-verify` — the merge is valid, only the message token is not.
|
|
78
|
+
|
|
79
|
+
### 6. Cleanup
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
git branch -d feature/<slug> # Delete merged branch
|
|
83
|
+
git worktree remove ../<project>-feature-<slug> # Remove worktree if used
|
|
84
|
+
git worktree prune # Clean up stale worktree references
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## When to use
|
|
88
|
+
|
|
89
|
+
- Starting new work on a feature or fix.
|
|
90
|
+
- Managing parallel branches with git worktrees.
|
|
91
|
+
- Preparing to merge and cleaning up afterward.
|
|
92
|
+
- The operator says "start a branch", "create a worktree", or "merge this."
|
|
93
|
+
|
|
94
|
+
Do **not** use this skill for:
|
|
95
|
+
- Task lifecycle management — that is `sp:spur-dev`.
|
|
96
|
+
- Commit message generation — that is `/sp:dev-gitmsg`.
|
|
97
|
+
- Code review — that is `sp:code-review`.
|
|
98
|
+
|
|
99
|
+
## References
|
|
100
|
+
|
|
101
|
+
| Reference | Covers |
|
|
102
|
+
|-----------|--------|
|
|
103
|
+
| [branch-lifecycle.md](references/branch-lifecycle.md) | Full lifecycle with per-phase git commands, naming conventions, merge strategies |
|
|
104
|
+
| [worktree-patterns.md](references/worktree-patterns.md) | Worktree creation, parallel-branch strategies, cleanup, disk-space awareness |
|
|
105
|
+
|
|
106
|
+
## See also
|
|
107
|
+
|
|
108
|
+
- **`sp:spur-dev`** — the task lifecycle that runs alongside branch lifecycle.
|
|
109
|
+
- **`sp:code-review`** — pre-merge self-review workflow.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: branch-lifecycle
|
|
3
|
+
description: "Full branch lifecycle with per-phase git commands, branch-naming conventions, and merge-strategy guidance."
|
|
4
|
+
see_also:
|
|
5
|
+
- branch-workflow
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Branch Lifecycle — Full Reference
|
|
9
|
+
|
|
10
|
+
## Naming conventions
|
|
11
|
+
|
|
12
|
+
| Type | Prefix | Example |
|
|
13
|
+
|------|--------|---------|
|
|
14
|
+
| Feature | `feature/` | `feature/oauth-callback-handler` |
|
|
15
|
+
| Bug fix | `fix/` | `fix/null-check-login-session` |
|
|
16
|
+
| Refactor | `refactor/` | `refactor/extract-auth-middleware` |
|
|
17
|
+
| Documentation | `docs/` | `docs/api-endpoint-guide` |
|
|
18
|
+
| Chore | `chore/` | `chore/update-dependencies` |
|
|
19
|
+
|
|
20
|
+
Slug rules: lowercase, hyphenated, ≤50 chars, derived from task title. No WBS numbers in branch names — they're neither stable nor descriptive.
|
|
21
|
+
|
|
22
|
+
## Per-phase commands
|
|
23
|
+
|
|
24
|
+
### Create
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
git checkout main && git pull --rebase # Start from latest main
|
|
28
|
+
git checkout -b feature/my-feature # Create and switch
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Commit
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git add <files> # Stage one concern at a time
|
|
35
|
+
git commit -m "feat(auth): add OAuth callback handler" # Conventional commit
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Self-review
|
|
39
|
+
|
|
40
|
+
Run `sp:code-review` pre-commit checklist. Fix issues. Amend or add follow-up commits.
|
|
41
|
+
|
|
42
|
+
### Push
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
git push -u origin feature/my-feature # First push sets upstream
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Merge
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
git checkout main && git pull --rebase # Update main
|
|
52
|
+
git merge --no-ff feature/my-feature -m "chore(<scope>): merge feature/my-feature into main" # Merge with conventional message
|
|
53
|
+
git push # Push the merge commit
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Merge strategy:** `--no-ff` (no fast-forward) always — it preserves the feature branch as a visible unit in history, making it easy to revert the entire feature if needed. Squash merges lose per-commit granularity; rebase merges rewrite history. `--no-ff` is the safe default.
|
|
57
|
+
|
|
58
|
+
**Merge commit message.** The `commit-msg` hook runs `cog verify`, which rejects git's default `Merge branch 'x'` message *and* a `merge:` type — cocogitto's default type set has no `merge`. Always pass an explicit conventional `-m`. A rejected message leaves the merge staged but uncommitted; complete it with `git commit -m "chore(<scope>): …"`. Do not reach for `--no-verify` — the merge is valid, only the message token is not.
|
|
59
|
+
|
|
60
|
+
### Cleanup
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git branch -d feature/my-feature # Delete local (safe — refuses if unmerged)
|
|
64
|
+
git push origin --delete feature/my-feature # Delete remote
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Worktree integration
|
|
68
|
+
|
|
69
|
+
See [worktree-patterns.md](worktree-patterns.md) for the full parallel-branch workflow.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: worktree-patterns
|
|
3
|
+
description: "Git worktree patterns — when to use worktrees, creation/cleanup, parallel-branch strategies, and disk-space awareness."
|
|
4
|
+
see_also:
|
|
5
|
+
- branch-workflow
|
|
6
|
+
- branch-lifecycle
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Git Worktree Patterns
|
|
10
|
+
|
|
11
|
+
A git worktree gives you an isolated working directory linked to the same repository. Each worktree has its own checked-out branch — no stashing, no `git switch` churn.
|
|
12
|
+
|
|
13
|
+
## When to use worktrees
|
|
14
|
+
|
|
15
|
+
| Scenario | Worktree? | Why |
|
|
16
|
+
|----------|-----------|-----|
|
|
17
|
+
| Two parallel features | ✅ Yes | Switch instantly between isolated directories |
|
|
18
|
+
| Hotfix while feature in progress | ✅ Yes | Fix on main worktree, feature stays untouched |
|
|
19
|
+
| Review in progress | ✅ Yes | Keep review branch available while starting new work |
|
|
20
|
+
| Single-branch workflow | ❌ No | Overhead of managing extra directory isn't worth it |
|
|
21
|
+
| CI/CD | ❌ No | Ephemeral checkouts already handle isolation |
|
|
22
|
+
| Disk-constrained (<2GB free) | ❌ No | Each worktree costs ~500MB–2GB |
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
### Create
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git worktree add ../project-hotfix hotfix/critical-fix
|
|
30
|
+
cd ../project-hotfix && bun install --frozen-lockfile
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The worktree directory is created alongside the main project. Name it `<project>-<branch>` for clarity.
|
|
34
|
+
|
|
35
|
+
A fresh worktree has no `node_modules` (gitignored), so the first `bun test` or typecheck fails on the first workspace import. Run `bun install --frozen-lockfile` immediately after creation so the worktree matches `bun.lock`.
|
|
36
|
+
|
|
37
|
+
### List
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git worktree list
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Shows all worktrees with their branches and paths.
|
|
44
|
+
|
|
45
|
+
### Remove (when done)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git worktree remove ../project-hotfix
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Prune (clean up stale references)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git worktree prune
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Removes references to worktrees whose directories were manually deleted.
|
|
58
|
+
|
|
59
|
+
## Parallel-branch strategy
|
|
60
|
+
|
|
61
|
+
When running two branches in parallel:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
~/projects/my-project/ (main branch, feature A work in progress)
|
|
65
|
+
~/projects/my-project-feature-b/ (feature B in isolated worktree)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
1. Create feature B worktree.
|
|
69
|
+
2. Work on feature B in its isolated directory.
|
|
70
|
+
3. Commit and push from the worktree.
|
|
71
|
+
4. When switching back to feature A: `cd ~/projects/my-project` — no stash, no switch.
|
|
72
|
+
5. Remove worktree when feature B is merged.
|
|
73
|
+
|
|
74
|
+
## Disk-space awareness
|
|
75
|
+
|
|
76
|
+
Each worktree is a full checkout (~500MB–2GB depending on project size). Check disk space before creating:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
df -h . # Check available space
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
After removing a worktree, run `git worktree prune` and `git gc` to reclaim space:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
git worktree remove ../old-worktree
|
|
86
|
+
git worktree prune
|
|
87
|
+
git gc --aggressive
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## `spur` on PATH is not this checkout
|
|
91
|
+
|
|
92
|
+
`spur` (`~/.bun/bin/spur`) resolves to a *published* bundle in `~/node_modules/`, not to the repo you are standing in and not to the worktree. `resolveSpurBin()` propagates whichever binary you entered through into `vars.spurBin`, which the `task-lifecycle.yaml` guards run as `$spurBin task check` — so one wrong entry point silently gate-checks against the published bundle.
|
|
93
|
+
|
|
94
|
+
Inside a worktree, and in the monorepo whenever CLI behavior is under test, invoke the tree's own source:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
cd "<worktree>" && bun apps/cli/src/index.ts task check <wbs> --json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Confirm isolation by making a distinctive change in the worktree and checking that the command reflects it.
|