brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
create-storyUse this skill when the user says 'create story', 'next story', 'implement STORY-XXX', 'pick up next ticket', 'what should I build next', 'story from PRD', or when the planning phase is done and implementation needs to start. This skill selects the next unimplemented story from the PRD backlog and produces a single, detailed implementation story file with a…
Independent GitHub snapshot · Automated classification · Original documentation governs
Generate a single, well-defined implementation story from the PRD backlog, complete with acceptance criteria, technical notes, and complexity estimate. Ready for immediate implementation. A well-crafted story tells a developer exactly what to build, how to verify it, and how it fits into the broader system — while leaving implementation details to the developer's judgment.
Stories are the bridge between product requirements and code. They translate "what the user needs" into "what the developer builds." A great story is small enough to complete quickly, precise enough to avoid ambiguity, and contextual enough to fit the system architecture.
Are there any blocked stories that need resolving?
|-- YES --> Select the highest-priority blocked story and resolve the blocker
|-- NO --> Are there stories in the highest-priority epic?
|-- YES --> Select the first unstarted story from that epic
|-- NO --> Move to next priority epic
Does the selected story have dependencies on incomplete stories?
|-- YES --> Can we implement the dependency first?
| |-- YES --> Select the dependency story instead
| |-- NO --> Mark as blocked, select next available story
|-- NO --> Proceed with this story
Is the story estimated at L or XL?
|-- YES --> Split into smaller stories before starting
|-- NO --> Proceed — story is appropriately sized
Can the story be completed in 1-3 days?
|-- YES --> Good to go
|-- NO --> Can it be split into vertical slices?
|-- YES --> Split into 2+ stories, each touching all layers
|-- NO --> Does it involve significant research?
|-- YES --> Create a spike story first, then implementation stories
|-- NO --> Challenge scope assumptions — is everything truly necessary?
Does the story describe work for multiple user roles?
|-- YES --> Split by user role — each role gets its own story
|-- NO --> Does the story contain "and" connecting separate actions?
|-- YES --> Split into separate stories per action
|-- NO --> Story scope is appropriate
What type of work is this?
|-- USER-FACING FEATURE --> Standard user story: "As a {role}, I want to..."
|-- TECHNICAL IMPROVEMENT --> Technical story: "As a {developer/system}, I want to..."
|-- BUG FIX --> Bug story: "Given {context}, when {action}, {unexpected result} occurs"
|-- RESEARCH/SPIKE --> Spike story: "Research {topic} and recommend {decision}"
|-- DATA MIGRATION --> Migration story: "Migrate {data} from {source} to {target}"
Is the story for a frontend feature?
|-- YES --> Include: component tree, state management, API integration, loading/error/empty states
|-- NO --> Is the story for a backend feature?
|-- YES --> Include: endpoint contracts, data models, validation, error handling, auth checks
|-- NO --> Full-stack: include both frontend and backend sections
Exact user phrases: "create story", "next story", "implement STORY-XXX", "pick up ticket", "what should I build next", "story from PRD", "next ticket", "what is next".
Before activating, verify:
docs/prd-{YYYY-MM-DD}.md exists. Read it.docs/stories/ directory exists. Read all existing STORY-*.md files to determine the next NNN and which stories are already defined or in progress.docs/specs/ directory may contain relevant specs. Check for the feature matching the next story.docs/decisions/ directory may contain relevant ADRs. Read any that apply to the story.Writes to docs/stories/STORY-{NNN}.md.
After saving, output exactly:
STORY-{NNN}: {title}
Epic: {epic name}
Complexity: {estimate}
Saved to docs/stories/STORY-{NNN}.md
Ready for implementation.
No preamble. No postamble. No explanations. No filler.
Confirmation: exactly 5 lines. Do not output the full story content unless the user explicitly asks.
Read docs/prd.md to understand epics and priority. Read docs/stories/ to see what has been done.
PRD analysis:
Existing stories analysis:
Selection order:
Selection heuristics:
# STORY-{NNN}: {Title}
## Status
Ready
## Epic
{parent epic name}
## User Story
As a {user role}, I want to {specific action} so that {specific value}.
## Acceptance Criteria
Happy path:
- Given {initial state} When {action} Then {expected result}
- Given {initial state} When {action} Then {expected result}
Edge cases:
- Given {edge condition} When {action} Then {expected handling}
- Given {edge condition} When {action} Then {expected handling}
Error cases:
- Given {error condition} When {action} Then {error response}
## Technical Notes
- {Specific files to create or modify}
- {Relevant patterns to follow, from stack-specific skills}
- {Database migrations needed, if any}
- {Auth/permissions requirements}
- {Performance considerations}
- Relevant ADRs: ADR-{NNN}, ADR-{NNN}
- {UI component references if frontend}
- {API contract references if backend}
## Dependencies
- STORY-{NNN}: {description of what must be done first}
- STORY-{NNN}: {optional dependency}
## Complexity
[XS | S | M | L | XL]
| Size | Effort | Example |
|------|--------|---------|
| XS | <2 hours | Config change, simple bug fix |
| S | 2-4 hours | Single endpoint, one component |
| M | 1-2 days | Full feature with DB changes |
| L | 3-5 days | Complex multi-step feature |
| XL | 1-2 weeks | Needs breakdown into multiple stories |
Acceptance criteria patterns by type:
Write to docs/stories/STORY-{NNN}.md.
File naming convention: STORY-{NNN}.md with sequential numbering. Use the story title within the file header, not the filename.
When: Feature touches all layers (DB, API, UI) Process: Write one story that spans all layers. Acceptance criteria cover the end-to-end behavior. Technical notes specify the changes needed at each layer. Benefits: One story = one complete feature. No integration surprises.
When: High uncertainty about implementation approach Process: Create a spike story first (timeboxed research). The spike output is a recommendation and implementation notes. Follow with implementation stories based on the spike findings. Output: Spike story + 1-N implementation stories.
When: Infrastructure or refactoring needed before feature work Process: Write stories that deliver value to developers rather than end users. "As a developer, I want a consistent error handling middleware so that API errors are predictable." Acceptance criteria define the developer experience. Audience: Developers, not end users.
When: Defect found in production or testing Process: Format acceptance criteria as reproduction steps. Include the expected behavior and actual behavior. Reference the environment and data where the bug was observed. Include regression test requirement.
A story that tries to do everything at once — multiple user roles, multiple actions, multiple outcomes. Anti-pattern signal: "and" in the story description, > 7 acceptance criteria.
Telling developers HOW to implement rather than WHAT to build. "Build a Redis cache" instead of "Pages load in under 2 seconds." Anti-pattern signal: technology names in the story description.
A story with no acceptance criteria or with vague criteria like "works correctly." No verifiable definition of done means the story is never truly complete. Anti-pattern signal: 0-1 acceptance criteria.
Acceptance criteria that only cover success scenarios. No error states, edge cases, or boundary conditions. Anti-pattern signal: all Given/When/Then statements use positive conditions.
A story that cannot be traced to an epic or an MVP feature. It exists in isolation without context. Anti-pattern signal: no epic reference, no link to PRD or brief.
Estimated at XL (1-2 weeks) but not split. These stories are impossible to track progress on — "90% done" for 2 weeks. Anti-pattern signal: complexity "XL" without a split note.
Technical notes that say "implement the feature" without referencing files, patterns, ADRs, or existing code. The developer starts from zero every time. Anti-pattern signal: no file references in technical notes.
See Step 3 template above.
# STORY-{NNN}: {Title}
## User Story
As a {user role}, I want to {action} so that {value}.
## Acceptance Criteria
- Given {state} When user {interacts} Then {UI response}
- Given {state} When user {interacts} Then {UI response}
## Component Tree
{ParentComponent} └── {ChildComponent} └── {ChildComponent}
## State Management
- {State slice}: {description of what is stored}
- {State slice}: {description of what is stored}
## API Integration
- {Endpoint}: {what it returns}
- {Endpoint}: {what it returns}
## UI States
- Loading: {what user sees}
- Empty: {what user sees}
- Error: {what user sees}
- Success: {what user sees}
# STORY-{NNN}: {Title}
## User Story
As a {user role}, I want to {action} so that {value}.
## Acceptance Criteria
- Given {state} When {action} Then {response}
- Given {state} When {action} Then {response}
## API Contract
**Endpoint:** {method} {path}
**Auth required:** {yes/no}
**Request body:** {schema reference}
**Response 200:** {schema reference}
**Error responses:** {status codes and conditions}
## Data Model Changes
- {Table/collection}: {new fields or modifications}
- {Table/collection}: {new fields or modifications}
## Validation Rules
- {Field}: {validation rule}
- {Field}: {validation rule}
## Audit Logging
- {Event}: {what to log}
| Metric | Target | How to Measure |
|---|---|---|
| Story generation time | < 15 minutes | From trigger to save |
| Story size compliance | > 80% are S or M | Count stories by size |
| Acceptance criteria count | > 75% have 3+ criteria | Audit |
| Rework rate | < 10% require changes after implementation | Post-implementation review |
| Blocked story rate | < 15% blocked due to missing dependencies | Track weekly |
A story that takes more than 3 days should be split. If you find yourself writing "and" in the description, it is likely multiple stories.
Developers need to know which files to touch, which patterns to follow, and which ADRs apply. Leaving this out causes rework.
"It works" is not testable. Every criterion must be verifiable by a human or automated test.
"Add a Redis cache" tells the developer HOW, not WHAT. The requirement is "Pages load in under 2 seconds."
Stories that only define happy path miss important implementation detail about error handling.
Telling developers exactly how to implement (specific libraries, line-by-line instructions) defeats the purpose of a story.
Using "Admin" in one story and "Super Admin" in another without defining the difference.
Starting a story without knowing what it depends on leads to blocked developers and wasted context switching.
| Artifact | Purpose | Detail Level | Audience |
|---|---|---|---|
| Epic | Feature area, multiple stories | High | Product, Stakeholders |
| Story | Single vertical slice of functionality | Medium | Dev, QA |
| Task | Implementation breakdown of a story | High | Developer |
| Bug | Defect report | Varies | Dev, QA |
| Spike | Research or exploration | Medium | Developer |
| Technical Spec | Full implementation plan | Very High | Developer, Architect |
Output: docs/stories/STORY-{NNN}.md
Next skill: stack-specific implementation skill
Carry forward: story content, acceptance criteria, technical notes, relevant ADRs and specs.
` interface EventObserver { onEvent(event: T): Promise; }
class EventBus { private observers: Set<EventObserver> = new Set(); subscribe(observer: EventObserver): void { this.observers.add(observer); } unsubscribe(observer: EventObserver): void { this.observers.delete(observer); } async emit(event: T): Promise { const results = Array.from(this.observers).map(o => o.onEvent(event)); await Promise.allSettled(results); } } `
config: defaults: timeout: 30s retryCount: 3 overrides: production: timeout: 60s retryCount: 5 development: timeout: 300s retryCount: 1
| Metric | Threshold | Severity | Action |
|---|---|---|---|
| Error rate | > 1% over 5min | Critical | Page on-call |
| p99 latency | > 2s over 5min | Warning | Investigate |
| Throughput drop | > 50% over 1min | Critical | Check upstream |
| Queue depth | > 1000 over 1min | Warning | Scale consumers |
| Disk usage | > 85% | Warning | Clean or expand |
| Memory usage | > 90% heap | Critical | Restart or scale |
| Anti-Pattern | Symptom | Root Cause | Solution |
|---|---|---|---|
| Premature optimization | Complex code for no measured benefit | Guessing instead of profiling | Measure first, optimize based on data |
| Copy-paste reuse | Duplicate code across codebase | Lack of abstraction | Extract shared logic into libraries |
| Gold-plating | Features with no current requirement | Over-engineering | YAGNI — build what's needed now |
| Magical thinking | Assumptions without validation | Skipping error handling | Handle all failure modes explicitly |
Cache hierarchy: L1 (in-memory local) → L2 (distributed Redis/Memcached) → L3 (CDN/Edge). Cache invalidation: TTL-based (simple, stale), event-based (complex, fresh), write-through (consistent, higher write latency), write-behind (fast writes, eventual consistency).