| description | argument-hint |
|---|---|
Start a brainstorming session to create a feature specification (Codex, no sub-agents) |
<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
rg - 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
Directory Naming with Auto-Increment:
- Check
specs/YYYY-MM-DD/for existing directories - Find the highest number prefix (e.g., if
2-ui-foundationexists, next is3) - If no directories exist, start with
0 - Create:
specs/YYYY-MM-DD/{N}-{{bug_name}}/brainstorming.md
Example: If specs/2026-01-06/ contains 0-roadmap/, 1-core-domain/, 2-ui-foundation/, the next bug would be 3-{{bug_name}}/
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.
Directory Naming with Auto-Increment:
- Check
specs/YYYY-MM-DD/for existing directories - Find the highest number prefix (e.g., if
2-ui-foundationexists, next is3) - If no directories exist, start with
0 - Create:
specs/YYYY-MM-DD/{N}-{{feature_name}}/brainstorming.md
Use today's date, the next available number, and the feature name from arguments (use hyphens for spaces in the folder name).
Example: If specs/2026-01-06/ contains 0-roadmap/, 1-core-domain/, 2-ui-foundation/, the next feature would be 3-{{feature_name}}/
Start the Q&A file with this header:
# {{Feature Name}} - Q&A Session
**Date:** YYYY-MM-DD
**Status:** Brainstorming
---Before asking the first question, explore the codebase to find:
- Similar features - Search for existing implementations that solve related problems
- Patterns in use - Identify Actions, Flows, Services, Livewire components in the relevant domain
- Database schema - Check existing tables and relationships that might be relevant
- Test patterns - Look at how similar features are tested
Use this exploration to:
- Make informed recommendations during Q&A
- Reference existing patterns ("Similar to how X works...")
- Identify potential reuse opportunities
- Spot integration points early
Tools to use:
rgfor searchmcp__laravel-boost__database-schemafor existing tablesrg --filesfor finding files in relevant directories
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]
...IMPORTANT: After user responds to your message, you MUST:
- Update brainstorming.md with their response
- Regenerate specification.md (see Section 4b)
- Then write your next message
CRITICAL: After processing each user response, regenerate the specification file. DO NOT skip this step.
The specification represents the current "mental model" of the feature. It evolves from rough vision to detailed specs.
After each Q&A round:
- Read the full
brainstorming.mdto gather all accumulated decisions - Regenerate
specification.mdcompletely with:- All confirmed decisions as concrete requirements
- Undecided items marked with
[TBD]or[PENDING: <specific question>] - Assumptions marked with
[ASSUMPTION: <text>]
- Update status in frontmatter based on completeness
- Update completeness score - count defined vs total requirements
Status Progression (with Definition of Done):
| Status | Done When |
|---|---|
Draft - Initial Vision |
Section 1 (Overview) complete: problem, value, users defined |
Draft - Requirements Gathering |
Section 2 complete: all FR-/NFR- concrete and verifiable |
Draft - Architecture Design |
Sections 3-4 complete: components, data flow, schema specified |
Draft - Detailing |
Sections 5-9 complete: phases, UI/UX, tests have file paths |
Draft - QA Plan |
Section 13 complete: acceptance criteria and manual test scenarios defined |
Ready for Implementation |
Zero markers remain, Open Questions table empty, 100% completeness |
Marker Usage:
[TBD]- General "to be determined"[PENDING: How should X handle Y?]- Specific question blocking this item[ASSUMPTION: Users will always have Z]- Assumption made, needs validation
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 (see Section 4b for status definitions)
- 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
- Spec reflects mental model - brainstorming.md is the conversation log; specification.md is the current state
CHECKLIST - Execute after EVERY user response:
[ ] 1. Read user's comments in brainstorming.md
[ ] 2. Update Decisions Summary table with new decisions
[ ] 3. REGENERATE specification.md with current state (Section 4b)
[ ] 4. Write next message to brainstorming.md
When no [TBD] or [PENDING] markers remain in the specification and completeness is 100%, update the status to Ready for Implementation.
This template is used by Section 4b for iterative updates. The specification is regenerated after each Q&A round, evolving from rough vision to detailed implementation plan.
Create the specification at: specs/YYYY-MM-DD/{N}-{{feature_name}}/specification.md (same numbered directory as brainstorming.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
- Acceptance criteria required - Each FR must have Given/When/Then criteria for testing
# {{Feature Name}} - Technical Specification
**Date:** YYYY-MM-DD
**Status:** Draft - Initial Vision
**Q&A Reference:** specs/YYYY-MM-DD/{N}-{{feature_name}}/brainstorming.md
**Completeness:** 0/0 requirements defined (0%)
---
## Open Questions
| # | Question | Blocks Section |
|---|----------|----------------|
| 1 | [Question from Q&A] | [Section #.#] |
*Status can only be "Ready for Implementation" when this table is empty and completeness is 100%.*
**Markers Legend:**
- `[TBD]` - To be determined, needs discussion
- `[PENDING: X]` - Specific question X must be answered first
- `[ASSUMPTION: X]` - Assumed to be true, validate with user
---
## 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 Name]
- [ ] **Requirement:** [What the system must do]
- **Acceptance Criteria:**
- [ ] Given [context], when [action], then [expected result]
- [ ] Given [context], when [action], then [expected result]
#### FR-2: [Requirement Name]
- [ ] **Requirement:** [What the system must do]
- **Acceptance Criteria:**
- [ ] Given [context], when [action], then [expected result]
### 2.2 Non-Functional Requirements
- [ ] NFR-1: [Performance/Security/Scalability requirement]
- ...
### 2.3 Out of Scope
- [What this feature explicitly does NOT include]
### 2.4 Risks & Dependencies
| Risk | Impact | Mitigation | Owner |
|------|--------|------------|-------|
| [Risk description] | High/Medium/Low | [How to mitigate] | [TBD] |
**External Dependencies:**
- [ ] [Service/API name] - [What we need from it]
**Potential Blockers:**
- [Blocker description and resolution path]
---
## 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
- QA acceptance criteria from Section 13 verified by QA Analyst agent
- 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]
This section defines how a QA Analyst (LLM-powered agent) will verify the feature using the browser, CLI, application logs, and database inspection. These are manual/exploratory checks - distinct from the automated Pest tests in Section 8.
Each criterion is a concrete, verifiable statement the QA agent can confirm through direct interaction with the running application.
| # | Criterion | Verification Method |
|---|---|---|
| AC-1 | [User can do X and sees Y] | Browser |
| AC-2 | [Data is persisted correctly after action] | Database query |
| AC-3 | [CLI command produces expected output] | CLI |
| AC-4 | [No errors logged after flow completion] | Log inspection |
- Application is accessible at the site URL
- Required test data exists (seeded or created during test)
- User is authenticated as [role] (if applicable)
Goal: Verify the core feature works end-to-end as intended.
- Navigate to [URL/page]
- Perform [action]
- Verify (browser): [expected UI result]
- Verify (database): [expected data state via
database-query] - Verify (logs): No errors in
read-log-entriesorbrowser-logs
Goal: Verify the feature rejects invalid input gracefully.
- Navigate to [URL/page]
- Submit form with [invalid/empty/malformed data]
- Verify (browser): Validation errors display correctly
- Verify (database): No partial or corrupt data was saved
Goal: Verify the feature handles unusual but valid scenarios.
- [Scenario-specific steps]
- Verify: [expected behavior]
Goal: Verify unauthorized users cannot access or modify resources.
- Attempt action as [unauthenticated user / wrong role]
- Verify (browser): Access denied or redirect to login
- Verify (database): No unauthorized changes
- No new errors in application log (
read-log-entries) - No JavaScript console errors (
browser-logs) - Database state is consistent (no orphaned records, correct relationships)
| Tool | Use For |
|---|---|
browser_navigate / browser_snapshot |
Navigate pages and verify UI state |
browser-logs |
Check for JavaScript errors |
read-log-entries |
Check for PHP exceptions and application errors |
database-query |
Verify data persistence and integrity |
tinker |
Inspect model state or run assertions |
get-absolute-url |
Resolve correct application URLs |
### 11. Critical Specification Review (Self-Validation)
After generating the specification, validate it yourself against the checklist:
- No logical inconsistencies between Q&A and specification
- All details discussed in Q&A are covered in the specification
- Implementation is technically feasible
- No scope creep beyond Q&A
- All requirements use checkbox format
- Requirements are atomic
- Each requirement specifies a file path
- Phases are clearly separated
- No `[TBD]`, `[PENDING]`, or `[ASSUMPTION]` markers remain
- Open Questions table is empty
- Completeness is 100%
- Section 13 has concrete acceptance criteria (not just placeholders)
- Manual test scenarios cover happy path, validation, edge cases, and authorization
- Each test scenario specifies verification method (browser, database, logs, CLI)
If gaps remain, fix the specification and re-validate.
### 12. Final User Review
After 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/{N}-{{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**