| description | argument-hint |
|---|---|
Start a brainstorming session to create a feature specification |
<feature-name> |
Start a collaborative session for: $ARGUMENTS
First, determine if this is a Feature Request or a Bug Report:
Bug indicators: Words like "bug", "error", "broken", "not working", "wrong", "incorrect", "fails", "crash", "issue", problem descriptions, error messages, unexpected behavior descriptions.
Feature indicators: Words like "add", "create", "implement", "new", "feature", capability descriptions.
If this is a bug report, follow this flow:
Before writing anything, thoroughly investigate the bug:
- Search the codebase for relevant code using
search_codeandGrep - Read the relevant files to understand the current implementation
- Trace the data flow to understand how the bug might occur
- Check tests to see what behavior is expected
- Look for similar patterns elsewhere in the codebase
- Check recent git commits that might have introduced the issue
Create the file at: specs/YYYY-MM-DD/{{bug_name}}/brainstorming.md
Use this structure:
# {{Bug Name}} - Investigation
**Date:** YYYY-MM-DD
**Status:** Investigating
**Reported Issue:** [Original bug description]
---
## 1. Bug Summary
**Symptom:** [What the user observed]
**Expected Behavior:** [What should happen]
**Actual Behavior:** [What actually happens]
---
## 2. Investigation Findings
### 2.1 Relevant Code Locations
| File | Line(s) | Purpose |
|------|---------|---------|
| `path/to/file.php` | 123-145 | Description |
### 2.2 Data Flow Analysis
[Trace how data flows through the system relevant to this bug]
### 2.3 Root Cause Analysis
**Hypothesis 1:** [Description]
- Evidence for: [...]
- Evidence against: [...]
**Hypothesis 2:** [Description]
- Evidence for: [...]
- Evidence against: [...]
**Most Likely Root Cause:** [Your assessment]
---
## 3. Fix Options
### Option A: [Name]
**Approach:** [Description]
**Pros:**
- [Pro 1]
**Cons:**
- [Con 1]
**Files to modify:**
- `path/to/file.php`
**Risk level:** Low/Medium/High
### Option B: [Name]
**Approach:** [Description]
**Pros:**
- [Pro 1]
**Cons:**
- [Con 1]
**Files to modify:**
- `path/to/file.php`
**Risk level:** Low/Medium/High
**Recommendation:** [Which option and why]
---
## 4. Clarifying Questions
[Questions that need user input before proceeding]
1. [Question 1]
2. [Question 2]
**Fabian's Comment:**
---
## 5. Reproduction Steps
[If identifiable, steps to reproduce]
1. Step 1
2. Step 2
3. Observe: [bug behavior]
---
## 6. Related Code & Tests
**Existing tests:** [List relevant test files]
**Similar implementations:** [Reference similar patterns in codebase]After creating the brainstorming file, summarize your findings and wait for user input on:
- Which fix option to pursue
- Answers to clarifying questions
- Any additional context
Once direction is confirmed, you can either:
- Create a
-specification.mdfor complex fixes (follow Feature mode Section 10+) - Proceed directly to implementation for simple fixes
If this is a feature request, follow the original feature brainstorming flow:
Every requirement must be explicit and verifiable. Use checkboxes for ALL requirements so completion can be objectively measured. Ambiguity leads to incomplete implementations.
Create the brainstorming file at: specs/YYYY-MM-DD/{{feature_name}}/brainstorming.md (use today's date and the feature name from
arguments, use hyphens for spaces in the folder name).
Start the Q&A file with this header:
# {{Feature Name}} - Q&A Session
**Date:** YYYY-MM-DD
**Status:** Brainstorming
---Write the first message asking about the general vision:
---
## Message 1: Understanding Your Vision
### The Feature
**My Current Understanding:**
[Brief summary of what you think this feature might be about based on the name]
**Questions:**
1. What problem does this feature solve?
2. Who will use this feature?
3. What does success look like?
**Fabian's Comment:**
---For each subsequent message, follow this structure:
---
## Message N: [Topic]
### [Sub-topic 1]
**My Current Understanding:**
[What you understand so far about this aspect]
**Questions:** (if needed)
- Question 1?
- Question 2?
**Recommendation:** (if applicable)
[Your recommendation with brief reasoning]
**Fabian's Comment:**
---
### [Sub-topic 2]
...When helpful, include ASCII diagrams or Mermaid diagrams to visualize:
- Data flow
- Component relationships
- User journeys
- Database schemas
Example:
**Architecture Concept:**
```mermaid
graph LR
A[User] --> B[Livewire Component]
B --> C[Action]
C --> D[Service]
### 6. Decision Tracking
Once a decision is made on a topic, update the Q&A file by adding a "Decisions Summary" section after the header (if not present):
```markdown
## Decisions Summary
| Topic | Decision |
|-------|----------|
| **Topic Name** | Brief decision statement |
When you need input on specific choices, format questions like this:
---
### Q1: [Topic Name]
[Brief context for the question]
- [ ] **A) Option 1** - Description
- [ ] **B) Option 2** - Description
- [ ] **C) Option 3** - Description
**Recommendation:** [Your recommendation]
**Fabian's Comment:**- Always append to the file - Never delete previous conversation
- Mark user comments inline - When Fabian adds comments, they stay in the "Fabian's Comment:" sections
- Update status as the spec progresses:
Brainstorming→In Discussion→Decisions Pending→Ready for Specification - Read the full Q&A file before each response to maintain context
- Ask one thing at a time - Don't overwhelm with too many questions
When all questions are answered, update the status to Ready for Specification and inform the user that you will now create the technical specification.
CRITICAL STEP: This step persists ALL knowledge from the Q&A session into a detailed technical document that can be used by any agent in any conversation.
Create the technical specification at: specs/YYYY-MM-DD/{{feature_name}}/specification.md
The specification MUST contain the following sections with COMPLETE details.
CRITICAL FORMAT RULES:
- ALL requirements MUST use checkboxes - Every single item that needs implementation gets a
- [ ]checkbox - Requirements must be atomic - One checkbox = one verifiable action
- No ambiguous language - Replace "should", "might", "could" with "must" or remove
- Include file paths - Every implementation item should specify the file to create/modify
- Group into phases - Each phase becomes one iteration during development
# {{Feature Name}} - Technical Specification
**Date:** YYYY-MM-DD
**Status:** Ready for Implementation
**Q&A Reference:** specs/YYYY-MM-DD/{{feature_name}}/brainstorming.md
---
## 1. Overview
### 1.1 Feature Summary
[2-3 sentence description of what this feature does]
### 1.2 Business Value
[Why this feature matters, what problem it solves]
### 1.3 Target Users
[Who will use this feature and how]
---
## 2. Requirements
### 2.1 Functional Requirements
- [ ] FR-1: [Requirement description]
- [ ] FR-2: [Requirement description]
- ...
### 2.2 Non-Functional Requirements
- [ ] NFR-1: [Performance/Security/Scalability requirement]
- ...
### 2.3 Out of Scope
- [What this feature explicitly does NOT include]
---
## 3. Architecture
### 3.1 Component Overview
[Diagram and description of components involved]
### 3.2 Data Flow
[Step-by-step data flow through the system]
### 3.3 Dependencies
[External services, packages, existing components needed]
---
## 4. Database Schema
### 4.1 New Tables
[For each new table:]
```sql
CREATE TABLE table_name (
-- columns with types and constraints
);[For each modified table:]
- Table:
table_name - Add column:
column_name(type) - [reason] - ...
[Describe all relationships between models]
[Any indexes needed for performance]
CRITICAL: Each phase = one development iteration. User invokes /dev {spec} continue for each phase.
Iteration scope: [Brief description of what this phase delivers]
- REQ-1.1: Create migration
database/migrations/YYYY_MM_DD_create_X_table.php - REQ-1.2: Create model
app/Models/X.phpwith relationships to Y, Z - REQ-1.3: Create factory
database/factories/XFactory.phpwith states: default, active, archived - REQ-1.4: Create action
app/Actions/Domain/DoSomething.phpthat [specific behavior] - REQ-1.5: Write test
tests/Feature/Actions/Domain/DoSomethingTest.phpcovering: [list scenarios]
// Key code snippets or patterns to followIteration scope: [Brief description]
- REQ-2.1: [Specific requirement with file path]
- REQ-2.2: [Specific requirement with file path]
Iteration scope: Final integration and comprehensive testing
- REQ-N.1: All tests pass (
php artisan test --parallel) - REQ-N.2: Code style validated (
vendor/bin/pint --dirty) - REQ-N.3: Manual testing completed via Playwright
| Method | Route | Controller/Action | Description |
|---|---|---|---|
| GET | /path | Controller@method | Description |
| Component | Purpose | Key Properties | Key Methods |
|---|---|---|---|
| ComponentName | What it does | $props | methods() |
| Class | Purpose | Input | Output |
|---|---|---|---|
| ActionName | What it does | Parameters | Return type |
[ASCII diagram or description of layout]
- User does X → System responds with Y
- ...
- Empty state: [description]
- Loading state: [description]
- Error state: [description]
- Success state: [description]
- [component] for [purpose]
- ...
| Test File | Test Cases |
|---|---|
tests/Unit/... |
- test case 1 |
| - test case 2 |
| Test File | Test Cases |
|---|---|
tests/Feature/... |
- test case 1 |
| - test case 2 |
- Happy Path: [Description]
- Edge Case: [Description]
- Error Case: [Description]
[Factories, seeders, or specific data needed]
- Models:
app/Models/ - Actions:
app/Actions/{Domain}/ - Flows:
app/Flows/ - Livewire:
app/Livewire/{Domain}/ - Views:
resources/views/livewire/{domain}/
- [Specific naming patterns for this feature]
- [Reference existing similar implementations]
- [Specific patterns required]
- [Any specific rules from CLAUDE.md that apply]
- All phase requirements implemented (checkboxes in Section 5)
- Architecture-guardian review passed
- Implementation-completeness-reviewer passed for phase
- Git commit created for phase
- ALL phases completed
- All tests pass (
php artisan test --parallel) - Code style validated (
vendor/bin/pint --dirty) - Manual testing via Playwright completed
- No gaps in -gaps.md file (or all addressed)
[Copy all key decisions from the Q&A session here with context]
| Decision | Rationale | Date |
|---|---|---|
| Decision 1 | Why this was chosen | YYYY-MM-DD |
[Any items identified but deferred for later]
### 11. Critical Specification Review (Sub-Agent Validation)
**MANDATORY:** After generating the specification, launch a fresh sub-agent to validate it.
Use the Task tool with `subagent_type=general-purpose` and the following prompt:
You are reviewing a technical specification for completeness and consistency.
Read these files:
- brainstorming document: specs/YYYY-MM-DD/{{feature_name}}/brainstorming.md
- Specification document: specs/YYYY-MM-DD/{{feature_name}}/specification.md
Verify:
- NO logical inconsistencies or gaps between Q&A decisions and specification
- ALL details discussed in Q&A are covered in the specification
- Implementation is technically feasible
- NO unnecessary tasks added that weren't mentioned in Q&A (scope creep)
- ALL requirements use checkbox format (- [ ])
- Requirements are atomic (one action per checkbox)
- Each requirement specifies a file path
- Phases are clearly separated for iterative development
Return ONE of:
- "READY TO GO" - Specification is complete and accurate
- "GAPS FOUND" - List specific issues that must be fixed
If GAPS FOUND, provide a numbered list of specific fixes required.
**Based on sub-agent response:**
- If "READY TO GO" → Proceed to user review
- If "GAPS FOUND" → Fix issues in specification and run validation again with a FRESH agent
- If fundamental problems → Delete specification, add clarifying questions to Q&A file, wait for user input
### 12. Final User Review
After sub-agent validation passes:
1. Present the specification to the user for review
2. Make any corrections requested
3. Update status to `Approved` when confirmed
4. Inform the user:
> "The technical specification is complete. To implement:
> - Use `/dev specs/YYYY-MM-DD/{{feature_name}}/specification.md` for each phase
> - After each phase, invoke `/dev {spec} continue` to proceed
> - When all phases complete, use `/verify-complete {spec}` for final validation"
**STOP HERE - DO NOT PROCEED TO IMPLEMENTATION**
The `/spec` command ends after presenting the specification. Do NOT:
- Start implementing the feature
- Run `/dev` automatically
- Create any implementation files
- Write any code
Wait for the user to explicitly invoke `/dev` to begin implementation.
---
Now create the Q&A file and begin the brainstorming session by asking about the vision for: **$ARGUMENTS**