@gobing-ai/spur 0.3.41 → 0.3.43
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 +113 -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 +83 -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 +48 -0
- package/plugins/sp/commands/dev-wrapall.md +51 -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 +203 -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 +442 -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 +151 -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 +109 -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 +280 -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 +680 -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 +790 -0
- package/plugins/sp/skills/spur-dev/references/execution-workflow.md +352 -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 +120 -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 +6035 -4963
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorm
|
|
3
|
+
description: "Structured ideation: generate solution options with trade-offs and confidence scoring, then delegate to research/task-creation skills. Triggers: \"brainstorm ideas\", \"explore solutions\", \"consider options\", \"research approaches\", \"what are my options\", \"how should I approach X\"."
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
created_at: 2026-03-25
|
|
7
|
+
updated_at: 2026-03-25
|
|
8
|
+
type: technique
|
|
9
|
+
platform: sp
|
|
10
|
+
tags: [brainstorm, ideation, solution-generation, trade-offs, workflow-core]
|
|
11
|
+
metadata:
|
|
12
|
+
author: cc-agents
|
|
13
|
+
platforms: "claude-code,codex,antigravity,opencode,openclaw"
|
|
14
|
+
category: workflow-core
|
|
15
|
+
interactions:
|
|
16
|
+
- reviewer
|
|
17
|
+
- pipeline
|
|
18
|
+
severity_levels:
|
|
19
|
+
- high
|
|
20
|
+
- medium
|
|
21
|
+
- low
|
|
22
|
+
pipeline_steps:
|
|
23
|
+
- input
|
|
24
|
+
- ideate
|
|
25
|
+
- output
|
|
26
|
+
see_also:
|
|
27
|
+
- sp:source-driven-development
|
|
28
|
+
- sp:spur-cli
|
|
29
|
+
- sp:wayfinder
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
# sp:brainstorm — Structured Ideation Workflow
|
|
33
|
+
|
|
34
|
+
Generate solution options with trade-offs, recommendations, and confidence scoring. Delegates research to specialized skills.
|
|
35
|
+
|
|
36
|
+
**Key distinction:**
|
|
37
|
+
- **`sp:brainstorm`** = Ideation: generate approaches with trade-offs
|
|
38
|
+
- **`sp:wayfinder`** = Wayfinding: chart a multi-session map when the destination itself is foggy
|
|
39
|
+
- **research** = verify and synthesize information (delegate inline by default — see [inline-default contract](../spur-dev/references/cross-cutting.md#inline-default-execution-surface))
|
|
40
|
+
- **`sp:spur-dev`** = Task creation: structured task breakdown (planning half)
|
|
41
|
+
- **`sp:source-driven-development`** = Verification: source-first claim validation
|
|
42
|
+
|
|
43
|
+
## Overview
|
|
44
|
+
|
|
45
|
+
The `sp:brainstorm` skill generates multiple solution approaches with explicit trade-offs, confidence scoring, and source citations. It follows a structured 3-phase workflow: Input parsing, Ideation with research delegation, and structured Output. Unlike pure research or bare task creation, brainstorm focuses on ideation—generating and comparing options before committing to a solution path.
|
|
46
|
+
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
// Trigger: "I need to add real-time collaboration. What are my options?"
|
|
51
|
+
// Brainstorm generates 2-3 approaches with trade-offs, delegates research and task creation
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The 3-phase pipeline (Input → Ideate → Output) is diagrammed once, in [Workflow](#workflow) below.
|
|
55
|
+
|
|
56
|
+
## When to Use
|
|
57
|
+
|
|
58
|
+
Activate sp:brainstorm when:
|
|
59
|
+
|
|
60
|
+
| Trigger Phrase | Description |
|
|
61
|
+
|----------------|-------------|
|
|
62
|
+
| "brainstorm ideas" | User wants multiple solution options |
|
|
63
|
+
| "explore solutions" | User wants to evaluate alternatives |
|
|
64
|
+
| "consider options" | User wants trade-off analysis |
|
|
65
|
+
| "research approaches" | User wants evidence-backed options |
|
|
66
|
+
| "what are my options?" | User wants multiple solutions |
|
|
67
|
+
| "how should I approach X?" | User wants recommendation with reasoning |
|
|
68
|
+
| "wayfind" / "chart a course" | User needs a multi-session investigation map — escalate to `sp:wayfinder` (Phase 2) |
|
|
69
|
+
|
|
70
|
+
**NOT for:**
|
|
71
|
+
- Pure research (delegate to research skills inline by default; escalate via `spur agent run` only on a subprocess trigger)
|
|
72
|
+
- Task creation without ideation (use `sp:spur-dev` instead)
|
|
73
|
+
- Fact-checking or verification only (use `sp:source-driven-development` instead)
|
|
74
|
+
- Task file operations (use `sp:spur-cli` instead)
|
|
75
|
+
- Multi-session investigation when the destination itself is foggy (use `sp:wayfinder` instead)
|
|
76
|
+
|
|
77
|
+
## Core Principles
|
|
78
|
+
|
|
79
|
+
### 1. Two Input Modes, Clarify Before Ideating
|
|
80
|
+
|
|
81
|
+
A file-path input is read and its Background/Requirements extracted; a bare description is used
|
|
82
|
+
directly. Ambiguous or insufficient input (short, missing context, undefined terms, multiple valid
|
|
83
|
+
readings) gets one `AskUserQuestion` at a time, preferring multiple choice. Detection rule and
|
|
84
|
+
trigger list: [references/workflows.md](references/workflows.md#phase-1-input-processing). Frame each
|
|
85
|
+
clarification as a decision brief (question + stakes + recommendation + scored options): the SSOT is
|
|
86
|
+
[spur-dev/references/decision-brief.md](../spur-dev/references/decision-brief.md). When a structured-input
|
|
87
|
+
tool is available, call it directly with the decision-brief contents as its option array — do not
|
|
88
|
+
render the brief as markdown text and also call the tool. One channel per question; the tool wins,
|
|
89
|
+
markdown text is the fallback only.
|
|
90
|
+
|
|
91
|
+
### 2. Delegate Research
|
|
92
|
+
|
|
93
|
+
Don't implement research directly. Delegate to specialized skills:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
For verification → sp:source-driven-development
|
|
97
|
+
For synthesis → `spur agent run`
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Resolve the execution surface first.** Run synthesis in the current session by default. Use
|
|
101
|
+
`spur agent run` only for `--agent auto`, `--agent <name>`, or a named escalation trigger; report the
|
|
102
|
+
applied trigger or `operator override`. Never hardcode the agent — the selector flows from `--agent`.
|
|
103
|
+
See the [inline-default contract](../spur-dev/references/cross-cutting.md#inline-default-execution-surface).
|
|
104
|
+
|
|
105
|
+
### 3. Generate 2-3 Approaches
|
|
106
|
+
|
|
107
|
+
Always generate multiple options, each with description, trade-offs, confidence, and sources — full
|
|
108
|
+
per-approach template: [references/workflows.md](references/workflows.md#approach-generation).
|
|
109
|
+
|
|
110
|
+
### 4. Confidence Scoring
|
|
111
|
+
|
|
112
|
+
Every approach and every external claim carries a HIGH/MEDIUM/LOW confidence score plus a dated
|
|
113
|
+
source citation — table, thresholds, and citation format:
|
|
114
|
+
[references/workflows.md](references/workflows.md#confidence-scoring).
|
|
115
|
+
|
|
116
|
+
### 5. Task Delegation
|
|
117
|
+
|
|
118
|
+
When user confirms approach, delegate task creation:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
// Pseudocode: Delegate to sp:spur-dev for structured task breakdown
|
|
122
|
+
Skill(skill="sp:spur-dev", args="plan <approach>")
|
|
123
|
+
|
|
124
|
+
// Then use sp:spur-cli for file creation
|
|
125
|
+
Bash: spur task batch-create --file decomposition.json # bare JSON array (see sp:spur-cli)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Workflow
|
|
129
|
+
|
|
130
|
+
The 3 phases (Input → Ideation → Output) run in sequence; only the pattern applies at every
|
|
131
|
+
invocation, the step-by-step detail (validation checklist, `AskUserQuestion` example, output
|
|
132
|
+
template, source-citation format) is needed only inside each phase, not at the point of deciding
|
|
133
|
+
*whether* to invoke this skill — full detail: **[references/workflows.md](references/workflows.md)**.
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
1. INPUT → Parse (file path or issue description), extract context, clarify if ambiguous
|
|
137
|
+
2. IDEATE → Generate 2-3 approaches with trade-offs (delegate research inline; escalate via spur agent run on a trigger)
|
|
138
|
+
3. OUTPUT → Structured markdown (Overview → Approaches → Recommendations → Next Steps),
|
|
139
|
+
delivered incrementally; saved to docs/plans/YYYY-MM-DD-<topic>-brainstorm.md
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Design Approval Gate
|
|
143
|
+
|
|
144
|
+
The Design Approval Gate is the quality gate between brainstorm output and downstream consumption.
|
|
145
|
+
No downstream command (`/sp:dev-idea`, `/sp:dev-plan`, `sp:spec-decomposition`) proceeds without a
|
|
146
|
+
recorded design summary in the brainstorm artifact. This gate enforces six patterns drawn from the
|
|
147
|
+
Superpowers `brainstorming` and `writing-plans` competencies.
|
|
148
|
+
|
|
149
|
+
### The six patterns
|
|
150
|
+
|
|
151
|
+
1. **Hard design-summary gate.** Every brainstorm output MUST include a `## Design Summary` section
|
|
152
|
+
in the saved artifact. Downstream commands check for its presence; absence is a hard stop, not a
|
|
153
|
+
warning. The summary is the contract between ideation and execution.
|
|
154
|
+
2. **Nothing is too simple.** Every idea gets a design summary, even if the idea is trivial. A
|
|
155
|
+
one-paragraph summary is acceptable for trivial ideas; a one-line "too simple to design" note is
|
|
156
|
+
not. The pattern prevents skipping the design step under time pressure.
|
|
157
|
+
3. **Spec self-review.** Before handoff, the brainstorm artifact is self-reviewed for: placeholders
|
|
158
|
+
(`TODO`, `TBD`, `???`, empty sections), internal contradictions, scope creep beyond the stated
|
|
159
|
+
scope, and ambiguity that would force the decompose step to guess. Fix before declaring done.
|
|
160
|
+
4. **User review gate.** The operator reviews the written brainstorm doc before downstream commands
|
|
161
|
+
consume it. Under `--auto`, this taste gate is routed around only when the spec self-review
|
|
162
|
+
passes cleanly AND the design summary is non-trivial; otherwise it pauses. The operator's
|
|
163
|
+
override is recorded in the artifact.
|
|
164
|
+
5. **Incremental design presentation.** The brainstorm is presented incrementally — overview, then
|
|
165
|
+
approaches, then recommendation — with the operator confirming each stage before the next. This
|
|
166
|
+
formalizes the existing Phase 3 interactive delivery as a hard requirement, not a suggestion.
|
|
167
|
+
6. **Scope decomposition check.** The brainstorm outputs a `needs_design` boolean signal consumed
|
|
168
|
+
by `idea-pipeline.yaml`'s `system-design` step. This is the contract bridge between ideation and
|
|
169
|
+
the heavier `sp:sys-architecture` step.
|
|
170
|
+
|
|
171
|
+
### The `needs_design` signal
|
|
172
|
+
|
|
173
|
+
The signal is a boolean written to the brainstorm artifact's frontmatter and emitted to the calling
|
|
174
|
+
pipeline. It determines whether `idea-pipeline.yaml` runs the `system-design` state or routes
|
|
175
|
+
directly from `feature-check` to `decompose`.
|
|
176
|
+
|
|
177
|
+
| Signal | Criteria |
|
|
178
|
+
| --- | --- |
|
|
179
|
+
| `true` | multiple subsystems touched; schema/config/DTO change; new module/package/service; new transport or boundary; new dependency; cross-cutting convention |
|
|
180
|
+
| `false` | single-module fix; docs/chores; boundary-preserving refactor; existing pattern with no architectural impact |
|
|
181
|
+
|
|
182
|
+
**Ties lean design.** When the criteria are mixed or ambiguous, set `needs_design: true`. The cost
|
|
183
|
+
of an unnecessary design step is low; the cost of skipping a needed one is high.
|
|
184
|
+
|
|
185
|
+
**Flag overrides** (consumed by `idea-pipeline.yaml` / plan, not brainstorm itself):
|
|
186
|
+
|
|
187
|
+
- **Idea path (`/sp:dev-idea`) and plan path (`/sp:dev-plan`):** there is **no** `--design` force
|
|
188
|
+
flag. Design is **on by default**. Only **`--skip-design`** opts out (idea: skip system-design +
|
|
189
|
+
omit per-task `design`; plan: skip feature satellite + omit per-task `design`). Brainstorm design
|
|
190
|
+
summary is still recorded. Ties lean design (`needs_design` / seam heuristic). Refine is the
|
|
191
|
+
fallback for blank task Design.
|
|
192
|
+
|
|
193
|
+
### Idea-evaluation report (idea path)
|
|
194
|
+
|
|
195
|
+
When brainstorm runs under `idea-pipeline` discovery, it MUST also emit a filled
|
|
196
|
+
**idea-evaluation report** to `.spur/run/idea-eval-report.md` using the template SSOT
|
|
197
|
+
[`spur-dev/references/idea-evaluation.md`](../spur-dev/references/idea-evaluation.md):
|
|
198
|
+
|
|
199
|
+
- Enhanced idea statement (sidecar — does **not** overwrite the operator's original idea text)
|
|
200
|
+
- Urgency and necessity scores (0–5) with one-line rationales
|
|
201
|
+
- Premises, pros, cons, better alternatives (if any)
|
|
202
|
+
- Recommendation (`proceed` | `reshape` | `drop`) + stakes
|
|
203
|
+
- Approve / reject prompt for the `idea-eval` taste gate
|
|
204
|
+
|
|
205
|
+
This report is the terminal discovery artifact for the idea path alongside `idea-needs-design.json`
|
|
206
|
+
and the design summary. The pipeline `idea-eval` state is HITL-only; it does not re-author the
|
|
207
|
+
report.
|
|
208
|
+
|
|
209
|
+
### Auto-mode behavior
|
|
210
|
+
|
|
211
|
+
With `--auto`, objective routing into the Design Approval Gate is allowed only when the spec
|
|
212
|
+
self-review (pattern 3) passes cleanly. The brainstorm design summary is ALWAYS recorded — `--auto`
|
|
213
|
+
does not bypass pattern 1 or pattern 2. The taste component of the user review gate (pattern 4)
|
|
214
|
+
still pauses unless the operator has encoded prior approval in the workflow vars.
|
|
215
|
+
|
|
216
|
+
## Common Rationalizations
|
|
217
|
+
|
|
218
|
+
| Rationalization | Reality |
|
|
219
|
+
|---|---|
|
|
220
|
+
| "The first idea is good enough — just build it." | The first idea is a baseline, not a decision. Generate 2-3 approaches so the trade-offs are visible before committing. |
|
|
221
|
+
| "I understand the request — skip clarifying." | Ideating on a misread wastes the whole session. Validate input clarity and the two input modes before generating options. |
|
|
222
|
+
| "More options are always better." | Beyond ~3, options dilute focus and stall the decision. Cap at three and delegate deeper research instead. |
|
|
223
|
+
| "I'll design the architecture while I brainstorm." | Brainstorm generates and scores approaches; it does not lock the design. Route a chosen approach through the Design Approval Gate. |
|
|
224
|
+
| "Confidence scores are subjective — skip them." | An unscored option hides its risk. Cite sources and assign confidence so the operator compares on evidence, not vibes. |
|
|
225
|
+
|
|
226
|
+
## Red Flags
|
|
227
|
+
|
|
228
|
+
- Presenting a single approach with no alternatives or trade-offs.
|
|
229
|
+
- Starting ideation before the input is clarified.
|
|
230
|
+
- More than three approaches, or approaches with no confidence score / source.
|
|
231
|
+
- Skipping the task-delegation offer after the operator confirms a direction.
|
|
232
|
+
- Treating a brainstorm output as an approved design (bypassing the approval gate).
|
|
233
|
+
|
|
234
|
+
## Reference Files
|
|
235
|
+
|
|
236
|
+
- **`references/workflows.md`** — Detailed 3-phase workflow with examples and templates
|
|
237
|
+
- **`examples/ideation-example.md`** — Complete example with TypeScript/Bun implementation
|
|
238
|
+
|
|
239
|
+
## Platform Notes
|
|
240
|
+
|
|
241
|
+
### Claude Code
|
|
242
|
+
|
|
243
|
+
- Use `AskUserQuestion` for clarification prompts
|
|
244
|
+
- Use `Skill` to delegate to research skills
|
|
245
|
+
- Use `Bash` with `tasks` CLI for task creation
|
|
246
|
+
|
|
247
|
+
### Other Platforms
|
|
248
|
+
|
|
249
|
+
- Delegate research inline by default; escalate via `spur agent run` only on a subprocess trigger (see [inline-default contract](../spur-dev/references/cross-cutting.md#inline-default-execution-surface))
|
|
250
|
+
- Delegate tasks via `sp:spur-dev`
|
|
251
|
+
- Output format is platform-agnostic markdown
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Shipped commands
|
|
256
|
+
|
|
257
|
+
### `/sp:dev-brainstorm` — interactive solution design
|
|
258
|
+
|
|
259
|
+
The first shipped scenario-specific command. A thin wrapper (`plugins/sp/commands/dev-brainstorm.md`)
|
|
260
|
+
that adds a **grilling discovery interview** before the ideation phase: one question at a time,
|
|
261
|
+
always with a recommendation, exploring the codebase before asking the user. Then delegates to
|
|
262
|
+
this skill's `dev-brainstorm` operation for structured ideation.
|
|
263
|
+
|
|
264
|
+
**Operation: `dev-brainstorm`**
|
|
265
|
+
|
|
266
|
+
Invoked as `Skill(skill="sp:brainstorm", args="dev-brainstorm --context <decision-tree> --options <n>")`.
|
|
267
|
+
Accepts a pre-built decision-tree context from the discovery phase and skips the clarification step
|
|
268
|
+
(Phase 1 → Phase 2 transition in the skill's own workflow), going directly to structured ideation.
|
|
269
|
+
The discovery interview that produces this context (5-step grilling protocol, question format,
|
|
270
|
+
codebase-first rule, stop conditions, depth question budgets, smart positional detection) lives in
|
|
271
|
+
[references/grilling-interview.md](references/grilling-interview.md).
|
|
272
|
+
|
|
273
|
+
**Decision-tree context format** (free-form markdown passed as `--context`):
|
|
274
|
+
|
|
275
|
+
```
|
|
276
|
+
## Decision Tree
|
|
277
|
+
|
|
278
|
+
### Root: <top-level decision>
|
|
279
|
+
- **Resolved:** <chosen answer>
|
|
280
|
+
- **Rationale:** <why>
|
|
281
|
+
|
|
282
|
+
### Branch: <child decision>
|
|
283
|
+
- **Resolved:** <chosen answer>
|
|
284
|
+
- **Rationale:** <why>
|
|
285
|
+
- **Depends on:** <parent decision>
|
|
286
|
+
|
|
287
|
+
...
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
The skill uses this tree to:
|
|
291
|
+
1. **Constrain the option space** — each approach must be compatible with resolved decisions
|
|
292
|
+
2. **Generate decision-trace annotations** — each approach lists which decisions it depends on
|
|
293
|
+
3. **Calibrate confidence** — decisions resolved from codebase evidence get higher confidence
|
|
294
|
+
|
|
295
|
+
When `--skip-discovery` is used (no `--context`), the operation falls back to the standard
|
|
296
|
+
3-phase workflow with its own lightweight clarification step.
|
|
297
|
+
|
|
298
|
+
### Candidate commands (not yet shipped)
|
|
299
|
+
|
|
300
|
+
Remaining scenario-specific candidates from the delivery-doc §7.2 disposition (I05). Each would be
|
|
301
|
+
a thin wrapper invoking this skill with a pre-seeded scenario frame. Ship only those that convert
|
|
302
|
+
non-deterministic intent into a reliable sequence, not bare forwarders (ADR-016).
|
|
303
|
+
|
|
304
|
+
| Candidate command | Scenario it specializes for |
|
|
305
|
+
|---|---|
|
|
306
|
+
| `sp:brainstorm-arch` | Architecture/design-tradeoff exploration (coupling, scaling, blast radius) |
|
|
307
|
+
| `sp:brainstorm-fix` | Bug root-cause hypotheses → ranked fix approaches |
|
|
308
|
+
| `sp:brainstorm-feature` | Feature-shaping: scope options + AC sketches feeding `sp:spur-dev` |
|
|
309
|
+
| `sp:brainstorm-stack` | Library/dependency selection with evidence-backed trade-offs |
|
|
310
|
+
| `sp:brainstorm-refactor` | Refactor strategy options for a shallow/over-coupled module |
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Wayfinding Escalation (Phase 2)
|
|
315
|
+
|
|
316
|
+
When the discovery interview (Phase 1 of `/sp:dev-brainstorm`) surfaces that **the destination itself is foggy** — the spec can't be written in one session because too many decisions are unresolved — brainstorm escalates to `sp:wayfinder` instead of proceeding to ideation.
|
|
317
|
+
|
|
318
|
+
### Scope Check
|
|
319
|
+
|
|
320
|
+
At the end of Phase 1, before ideation begins, run this scope check:
|
|
321
|
+
|
|
322
|
+
> **"Can this be spec'd in one session, or is the destination itself still foggy?"**
|
|
323
|
+
|
|
324
|
+
**Signals that wayfinding is needed:**
|
|
325
|
+
- The topic touches ≥3 subsystems or unknown boundaries
|
|
326
|
+
- Key decisions depend on research not yet done
|
|
327
|
+
- The operator can describe the goal but not the shape of the solution
|
|
328
|
+
- Multiple "it depends" answers in the discovery interview
|
|
329
|
+
- The operator uses fog language: "I'm not sure yet", "we need to explore", "it depends on what we find"
|
|
330
|
+
|
|
331
|
+
**Signals that standard ideation suffices:**
|
|
332
|
+
- The destination is clear; only the approach is in question
|
|
333
|
+
- All key decisions can be made from existing knowledge
|
|
334
|
+
- The operator can enumerate the constraints and trade-offs
|
|
335
|
+
|
|
336
|
+
### Escalation Path
|
|
337
|
+
|
|
338
|
+
When the scope check indicates a foggy destination, offer the escalation:
|
|
339
|
+
|
|
340
|
+
> *"This is a multi-session investigation. Want me to chart a wayfinder map so we can work through it one decision at a time?"*
|
|
341
|
+
|
|
342
|
+
The operator **confirms** before wayfinding begins — never silently escalate. A 30-minute quick-answer need might touch a big domain without requiring a multi-session map.
|
|
343
|
+
|
|
344
|
+
On confirmation, delegate to `sp:wayfinder` for the "Chart the map" mode. The resolved decision tree from Phase 1 seeds the map's **## Notes** and initial **## Not yet specified** sections.
|
|
345
|
+
|
|
346
|
+
### `--wayfind` Flag
|
|
347
|
+
|
|
348
|
+
When `/sp:dev-brainstorm` is invoked with `--wayfind`, the scope check is **skipped** — the operator has pre-approved the escalation. After the discovery interview, proceed directly to `sp:wayfinder` charting without the confirmation prompt.
|
|
349
|
+
|
|
350
|
+
Use `--wayfind` when:
|
|
351
|
+
- The operator already knows this is a multi-session investigation
|
|
352
|
+
- A previous session recommended wayfinding
|
|
353
|
+
- The topic is explicitly exploratory ("explore the solution space for X")
|
|
354
|
+
|
|
355
|
+
### Integration with the Design Approval Gate
|
|
356
|
+
|
|
357
|
+
A wayfinding escalation **replaces** the standard ideation output. The map feature (with its destination, notes, fog, and child tickets) is the artifact. The `needs_design` signal is not emitted — wayfinding defers design until the route to the destination is clear. When the last ticket resolves, the final session hands off to standard `sp:brainstorm` → `sp:spec-decomposition` with a now-clear destination.
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
**Remember:** Ideation ≠ Research. Generate approaches with trade-offs. Delegate verification to `sp:source-driven-development`. Delegate synthesis/research inline (escalate to `spur agent run` only on a subprocess trigger). Delegate task creation to `sp:spur-dev`. When the destination itself is foggy, escalate to `sp:wayfinder` — never force a spec that isn't ready.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: brainstorm
|
|
2
|
+
description: "Structured ideation workflow for generating solution options with
|
|
3
|
+
trade-offs, confidence scoring, and delegation to research and task creation
|
|
4
|
+
skills. Triggers: brainstorm ideas, explore solutions, consider options,
|
|
5
|
+
research approaches, multiple solution options with trade-offs."
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
icon: 🛠️
|
|
8
|
+
category: debugging
|
|
9
|
+
tags:
|
|
10
|
+
- brainstorm
|
|
11
|
+
- ideation
|
|
12
|
+
- solution-generation
|
|
13
|
+
- trade-offs
|
|
14
|
+
- workflow-core
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorm-ideation-example
|
|
3
|
+
description: "Complete TypeScript/Bun example of brainstorming authentication implementation"
|
|
4
|
+
see_also:
|
|
5
|
+
- sp:brainstorm
|
|
6
|
+
- sp:source-driven-development
|
|
7
|
+
- spur agent run
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Brainstorm: User Authentication for API (TypeScript/Bun)
|
|
11
|
+
|
|
12
|
+
**Date:** 2026-03-25
|
|
13
|
+
**Input:** Issue description
|
|
14
|
+
**Runtime:** Bun + Hono
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
The current API lacks authentication, exposing all endpoints to unauthorized access. This poses security risks for production deployment. Need to implement authentication while maintaining API simplicity and performance.
|
|
19
|
+
|
|
20
|
+
**Current state:**
|
|
21
|
+
- Public API with no access control
|
|
22
|
+
- Hono framework already in use (Bun-compatible)
|
|
23
|
+
- JWT tokens preferred for stateless auth
|
|
24
|
+
- Need both user registration and login endpoints
|
|
25
|
+
|
|
26
|
+
## Approaches
|
|
27
|
+
|
|
28
|
+
### Approach 1: JWT with jose ⭐ Recommended
|
|
29
|
+
|
|
30
|
+
**Description:** Use the `jose` library for JWT handling with Hono's middleware system. Provides stateless authentication with standard OAuth2-compatible headers.
|
|
31
|
+
|
|
32
|
+
**Trade-offs:**
|
|
33
|
+
- **Pros:**
|
|
34
|
+
- Native Bun/Node.js compatibility
|
|
35
|
+
- JWT stateless - scales horizontally without session storage
|
|
36
|
+
- Standard OAuth2 Bearer token format
|
|
37
|
+
- jose supports Edge Runtime and Bun
|
|
38
|
+
- TypeScript-first with full type safety
|
|
39
|
+
- **Cons:**
|
|
40
|
+
- JWT revocation requires additional complexity
|
|
41
|
+
- Token storage management needed for refresh tokens
|
|
42
|
+
- Initial setup more complex than basic auth
|
|
43
|
+
|
|
44
|
+
**Implementation Notes:**
|
|
45
|
+
```typescript
|
|
46
|
+
// Dependencies: jose, @hono/node-server (for middleware compatibility)
|
|
47
|
+
// Password hashing with bcryptjs
|
|
48
|
+
// JWT expiration: 15 minutes for access, 7 days for refresh
|
|
49
|
+
|
|
50
|
+
import { SignJWT, jwtVerify } from 'jose';
|
|
51
|
+
import { hash, compare } from 'bcryptjs';
|
|
52
|
+
|
|
53
|
+
const JWT_SECRET = new TextEncoder().encode(process.env.JWT_SECRET!);
|
|
54
|
+
|
|
55
|
+
async function createToken(payload: Record<string, unknown>) {
|
|
56
|
+
return new SignJWT(payload)
|
|
57
|
+
.setProtectedHeader({ alg: 'HS256' })
|
|
58
|
+
.setIssuedAt()
|
|
59
|
+
.setExpirationTime('15m')
|
|
60
|
+
.sign(JWT_SECRET);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function verifyToken(token: string) {
|
|
64
|
+
const { payload } = await jwtVerify(token, JWT_SECRET);
|
|
65
|
+
return payload;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Middleware
|
|
69
|
+
async function authMiddleware(c: Context, next: Next) {
|
|
70
|
+
const token = c.req.header('Authorization')?.replace('Bearer ', '');
|
|
71
|
+
if (!token) return c.json({ error: 'Unauthorized' }, 401);
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
const payload = await verifyToken(token);
|
|
75
|
+
c.set('user', payload);
|
|
76
|
+
await next();
|
|
77
|
+
} catch {
|
|
78
|
+
return c.json({ error: 'Invalid token' }, 401);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Confidence:** HIGH
|
|
84
|
+
**Sources:**
|
|
85
|
+
- [jose Library Docs](https://github.com/panva/jose) | Verified: 2026-03-25
|
|
86
|
+
- [Hono Middleware Guide](https://hono.dev/docs/middleware/builtin/bearer-auth) | Verified: 2026-03-25
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### Approach 2: Third-Party Auth (Auth0 / Firebase)
|
|
91
|
+
|
|
92
|
+
**Description:** Integrate with managed authentication service for production-ready auth with minimal code maintenance.
|
|
93
|
+
|
|
94
|
+
**Trade-offs:**
|
|
95
|
+
- **Pros:**
|
|
96
|
+
- Battle-tested security - provider handles security updates
|
|
97
|
+
- Rich feature set - 2FA, social login, SSO out of box
|
|
98
|
+
- Reduced maintenance - no auth server to manage
|
|
99
|
+
- Built-in user management UI
|
|
100
|
+
- **Cons:**
|
|
101
|
+
- Vendor lock-in - migration complexity if changing providers
|
|
102
|
+
- Cost - free tier limits, paid plans for production
|
|
103
|
+
- Network dependency - API calls to provider on each auth
|
|
104
|
+
- Learning curve - provider-specific SDKs
|
|
105
|
+
|
|
106
|
+
**Implementation Notes:**
|
|
107
|
+
```typescript
|
|
108
|
+
// Recommended: Auth0 (generous free tier, good Bun/Edge examples)
|
|
109
|
+
// Alternative: Firebase Authentication (Google ecosystem)
|
|
110
|
+
|
|
111
|
+
// Auth0 example with Node.js/Bun
|
|
112
|
+
import { AuthenticationClient } from 'auth0';
|
|
113
|
+
|
|
114
|
+
const auth0 = new AuthenticationClient({
|
|
115
|
+
domain: process.env.AUTH0_DOMAIN!,
|
|
116
|
+
clientId: process.env.AUTH0_CLIENT_ID!,
|
|
117
|
+
clientSecret: process.env.AUTH0_CLIENT_SECRET!,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
async function handleLogin(username: string, password: string) {
|
|
121
|
+
const response = await auth0.oauth.passwordGrant({
|
|
122
|
+
username,
|
|
123
|
+
password,
|
|
124
|
+
realm: 'Username-Password-Authentication',
|
|
125
|
+
});
|
|
126
|
+
return response.data.access_token;
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Confidence:** MEDIUM
|
|
131
|
+
**Sources:**
|
|
132
|
+
- [Auth0 Node.js SDK v5](https://auth0.github.io/node-auth0/) | Verified: 2026-03-25
|
|
133
|
+
- [Firebase Admin Setup](https://firebase.google.com/docs/admin/setup) | Verified: 2026-03-15
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
### Approach 3: Simple API Keys
|
|
138
|
+
|
|
139
|
+
**Description:** Basic API key authentication for internal APIs or service-to-service communication. Uses `X-API-Key` header with hashed key storage.
|
|
140
|
+
|
|
141
|
+
**Trade-offs:**
|
|
142
|
+
- **Pros:**
|
|
143
|
+
- Simple implementation - minimal code
|
|
144
|
+
- No external dependencies
|
|
145
|
+
- Easy to understand and debug
|
|
146
|
+
- Works well for internal tools or service accounts
|
|
147
|
+
- **Cons:**
|
|
148
|
+
- API keys often long-lived - security risk if compromised
|
|
149
|
+
- No built-in user management
|
|
150
|
+
- No token expiration or refresh mechanism
|
|
151
|
+
- Not suitable for user-facing applications
|
|
152
|
+
|
|
153
|
+
**Implementation Notes:**
|
|
154
|
+
```typescript
|
|
155
|
+
// Store hashed API keys in database
|
|
156
|
+
import { hash, compare } from 'bcryptjs';
|
|
157
|
+
|
|
158
|
+
async function validateApiKey(apiKey: string, hashedKey: string) {
|
|
159
|
+
return compare(apiKey, hashedKey);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Middleware
|
|
163
|
+
async function apiKeyMiddleware(c: Context, next: Next) {
|
|
164
|
+
const apiKey = c.req.header('X-API-Key');
|
|
165
|
+
if (!apiKey) return c.json({ error: 'Missing API key' }, 401);
|
|
166
|
+
|
|
167
|
+
const user = await findUserByApiKey(apiKey);
|
|
168
|
+
if (!user) return c.json({ error: 'Invalid API key' }, 401);
|
|
169
|
+
|
|
170
|
+
c.set('user', user);
|
|
171
|
+
await next();
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Confidence:** MEDIUM
|
|
176
|
+
**Sources:**
|
|
177
|
+
- [Hono Bearer Auth Middleware](https://hono.dev/docs/middleware/builtin/bearer-auth) | Verified: 2026-03-25
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Recommendations
|
|
182
|
+
|
|
183
|
+
**Recommended:** Approach 1 (JWT with jose)
|
|
184
|
+
|
|
185
|
+
**Reasoning:**
|
|
186
|
+
- Best balance of security, simplicity, and maintainability
|
|
187
|
+
- Native Bun/TypeScript compatibility
|
|
188
|
+
- JWT standard enables future scalability
|
|
189
|
+
- No vendor lock-in or external dependencies
|
|
190
|
+
- Suitable for both user authentication and service accounts
|
|
191
|
+
- jose library is well-maintained and Edge Runtime compatible
|
|
192
|
+
|
|
193
|
+
**When to consider alternatives:**
|
|
194
|
+
- Use Approach 2 (Auth0/Firebase) if team lacks auth expertise or needs enterprise features immediately
|
|
195
|
+
- Use Approach 3 (API Keys) only for internal tools or machine-to-machine communication
|
|
196
|
+
|
|
197
|
+
## Next Steps (Potential Tasks)
|
|
198
|
+
|
|
199
|
+
1. **jwt-auth-setup** - Implement JWT authentication with jose library
|
|
200
|
+
2. **user-registration** - Create user registration endpoint with bcrypt password hashing
|
|
201
|
+
3. **token-refresh** - Implement access/refresh token flow
|
|
202
|
+
4. **protected-routes** - Add authentication middleware to existing endpoints
|
|
203
|
+
5. **auth-tests** - Write tests for authentication flow
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
**Generated by:** sp:brainstorm
|
|
208
|
+
**Research delegation:** sp:source-driven-development, spur agent run
|
|
209
|
+
**Confidence:** HIGH (official jose/Hono documentation, 2026)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
name: brainstorm
|
|
2
|
+
description: "Structured ideation workflow for generating solution options with
|
|
3
|
+
trade-offs, confidence scoring, and delegation to research and task creation
|
|
4
|
+
skills. Triggers: brainstorm ideas, explore solutions, consider options,
|
|
5
|
+
research approaches, multiple solution options with trade-offs."
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
emoji: 🛠️
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grilling-interview
|
|
3
|
+
description: "Phase-1 heuristic discovery interview for /sp:dev-brainstorm — 5-step grilling protocol, question format, codebase-first rule, stop conditions, depth question budgets, and smart positional detection."
|
|
4
|
+
see_also:
|
|
5
|
+
- brainstorm
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Grilling Interview — Heuristic Discovery Protocol
|
|
9
|
+
|
|
10
|
+
The discovery interview walks the decision tree **one question at a time**, resolving dependencies
|
|
11
|
+
between decisions before generating options. The goal is to surface hidden assumptions and map the
|
|
12
|
+
full decision space before ideation begins.
|
|
13
|
+
|
|
14
|
+
## Protocol
|
|
15
|
+
|
|
16
|
+
1. **Frame the problem** — restate what we're trying to decide in one sentence. Confirm with the user.
|
|
17
|
+
2. **Map the root** — identify the top-level decision (the root of the tree). Ask: what is the single most important choice here?
|
|
18
|
+
3. **Walk branches** — for each decision node, in dependency order:
|
|
19
|
+
a. **Explore first** — search the codebase for constraints, existing patterns, prior art. Answer from code when possible.
|
|
20
|
+
b. **Recommend** — provide your recommended answer with reasoning. Never ask a bare question.
|
|
21
|
+
c. **Resolve** — get the user's confirmation or counter. Lock the decision before moving to dependents.
|
|
22
|
+
4. **Recurse** — for each resolved decision, ask: what does this unlock? What new decisions does it create? Walk those branches next.
|
|
23
|
+
5. **Stop at depth** — `basic`: stop after the root + immediate children. `detailed`: walk 2-3 levels. `comprehensive`: exhaust the tree.
|
|
24
|
+
|
|
25
|
+
**Question format — every question follows this pattern:**
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
**Decision:** <what needs to be decided, one sentence>
|
|
29
|
+
|
|
30
|
+
**Recommendation:** <your recommended answer with 2-3 sentences of reasoning>
|
|
31
|
+
- Factor 1: ...
|
|
32
|
+
- Factor 2: ...
|
|
33
|
+
|
|
34
|
+
**Alternatives considered:** <1-2 alternatives and why they rank lower>
|
|
35
|
+
```
|
|
36
|
+
**Binding to a structured-input tool:** the question format above describes the *content* of each
|
|
37
|
+
question. The *channel* is a structured-input tool call, not rendered markdown. When a
|
|
38
|
+
structured-input tool (`AskUserQuestion` on Claude Code, or the platform equivalent) is available,
|
|
39
|
+
invoke it with the recommended answer as the pre-selected / recommended option and the alternatives
|
|
40
|
+
as the remaining options. Render the markdown block above only as a fallback when no such tool is
|
|
41
|
+
available. Option content (question, stakes, recommendation, scored options with pros/cons) follows
|
|
42
|
+
the decision-brief SSOT: [spur-dev/references/decision-brief.md](../../spur-dev/references/decision-brief.md).
|
|
43
|
+
|
|
44
|
+
**Codebase-first rule:** Before asking about any decision that might be constrained by existing code,
|
|
45
|
+
search the repo. If the answer is in the code, state it and skip the question. Examples of
|
|
46
|
+
codebase-answerable questions: "What database are we already using?", "Does this pattern already
|
|
47
|
+
exist in the codebase?", "What's the current auth mechanism?".
|
|
48
|
+
|
|
49
|
+
**Stop conditions:**
|
|
50
|
+
- Depth limit reached per `--depth`
|
|
51
|
+
- User signals done ("that's enough", "just give me options now")
|
|
52
|
+
- Decision tree is fully resolved (no more branches, or remaining branches don't change the options)
|
|
53
|
+
- 15 questions asked (hard cap — surface and offer to continue or proceed to ideation)
|
|
54
|
+
|
|
55
|
+
## Depth → Question Budget
|
|
56
|
+
|
|
57
|
+
| Depth | Max questions | Tree levels | Use when |
|
|
58
|
+
|-------|--------------|-------------|----------|
|
|
59
|
+
| `basic` | 5 | 1 (root + children) | Quick gut-check, familiar domain |
|
|
60
|
+
| `detailed` | 10 | 2-3 (resolve dependencies) | Standard design exploration |
|
|
61
|
+
| `comprehensive` | 15 | exhaustive | High-stakes decisions, unfamiliar domain |
|
|
62
|
+
|
|
63
|
+
## Smart Positional Detection
|
|
64
|
+
|
|
65
|
+
| Input Pattern | Detection | Example |
|
|
66
|
+
|---------------|-----------|---------|
|
|
67
|
+
| Ends with `.md` | Task file path — extract Background + Requirements as discovery seed | `docs/tasks2/0042_add-email-validation.md` |
|
|
68
|
+
| Plain text | Use as the problem statement directly | `Should we use Redis or Postgres for session storage?` |
|