From codebrain
Use after /codebrain:discover to write a Product Requirements Document. Generates a structured PRD (<1200 words) with P0/P1/P2 requirements, user stories, success metrics, and non-goals. Validates against anti-patterns. Every P0 requirement traces to a user need. Outputs machine-readable acceptance criteria for AI agents.
npx claudepluginhub chrsmay/codebrain-plugin --plugin codebrainThis skill uses the workspace's default tool permissions.
Product Requirements Document generation. Defines WHAT to build and WHY — never HOW.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Product Requirements Document generation. Defines WHAT to build and WHY — never HOW.
/codebrain:prd [feature name]
/codebrain:prd from-discovery — generate PRD from an existing discovery document
Run /codebrain:discover first. If no discovery document exists, ask: "Should we run discovery first, or do you have enough context to write the PRD directly?"
.codebrain/memory/constitution.md — PRD must align with project principles..codebrain/epics/{slug}/discovery.md or .codebrain/active/discovery.md)..codebrain/memory/architecture.md — understand what already exists.If discovery is complete, extract requirements from it. If not, ask these questions ONE AT A TIME:
Output a structured PRD with exactly 7 sections, under 1,200 words total:
# PRD: [Feature Name]
**Author:** [user name]
**Date:** [today]
**Status:** Draft
**Appetite:** [from discovery — time budget]
## 1. Overview
[2-3 sentences: what this feature does and why it matters. No implementation details.]
## 2. Problem Statement
[Lead with user evidence — quotes, data, support tickets. Not opinions.]
- "[User quote about the pain point]"
- [Data point: "X% of users abandon at this step"]
- Current workaround: [how users solve this today]
## 3. Goals & Success Metrics
| Goal | Metric | Target |
|------|--------|--------|
| [Outcome 1] | [Measurable metric] | [Specific number] |
| [Outcome 2] | [Measurable metric] | [Specific number] |
## 4. User Stories
**Story 1: [Title]**
As a [specific user], I want to [capability] so that [benefit].
Acceptance Criteria:
- Given [precondition], When [action], Then [expected result]
- Given [precondition], When [action], Then [expected result]
**Story 2: [Title]**
...
**Story 3: [Title]**
...
## 5. Requirements
### P0 — Must Have (blocks launch)
- **REQ-001:** When [trigger], the system shall [behavior]. _Source: [user evidence]_
- **REQ-002:** ...
[NEEDS CLARIFICATION: any P0 requirements that are ambiguous — option A | option B]
### P1 — Should Have (launch without, add within 2 weeks)
- **REQ-010:** ...
### P2 — Nice to Have (backlog)
- **REQ-020:** ...
## 6. Non-Goals
[At least 3 things this feature explicitly does NOT do]
- NOT building [thing that's tempting but out of scope]
- NOT supporting [platform/use case that's not worth the cost]
- NOT optimizing for [metric that isn't the primary goal]
## 7. Open Questions
- [Unresolved question 1 — with default recommendation]
- [Unresolved question 2 — with default recommendation]
[NEEDS CLARIFICATION: any remaining ambiguities]
Before presenting the PRD, check for these anti-patterns:
| Anti-Pattern | Check | Action |
|---|---|---|
| Opinion over evidence | Does every P0 cite a user source? | Flag unsourced P0s |
| Too long | Over 1,200 words? | Trim — move details to separate docs |
| Implementation details | Does it say HOW to build? | Remove — that's for the tech spec |
| No non-goals | Fewer than 3 non-goals? | Add more — scope control requires explicit boundaries |
| Weak success metrics | Vague metrics like "improved UX"? | Replace with numbers |
| Missing appetite | No time budget? | Add from discovery or ask user |
| Unresolved clarifications | Any [NEEDS CLARIFICATION] markers? | Present to user for resolution |
[NEEDS CLARIFICATION] markers — resolve each one..codebrain/epics/{slug}/prd.md via MCP toolsmcp__codebrain__codebrain_artifact_write.codebrain/memory/decisions.md with any decisions made during PRD creationAfter PRD is approved, suggest the workflow:
/codebrain:map-journeys — enumerate all user paths and edge cases/codebrain:epic create — generate tech spec and tickets from the PRD/codebrain:design — create UI mockups (if feature has a UI)Before starting, check if Linear MCP tools are available (look for mcp__linear__* tools in the toolbox).
.codebrain/config.json for linearSync setting ("required" | "optional" | "off")linearSync: "required" and Linear MCP is NOT connected: STOP and tell the user: "Linear sync is required but Linear MCP is not connected. Run /mcp to authenticate with Linear."linearSync: "optional" and Linear is available: proceed with synclinearSync: "off" or not set: skip Linear integrationCheck for existing Linear project:
list_projects with name filter matching the feature namecreate_project with:
Create the PRD as a Linear project document:
Create P0 requirement issues:
create_issue with:
codebrain, p0, epic sluglist_teams (use first team, or ask user if multiple)Create P1/P2 as backlog issues:
p1p2Record Linear project ID in .codebrain/config.json:
{ "linearProjectId": "proj_xxx", "linearTeamId": "team_xxx" }
This allows all downstream skills (epic, plan, verify, launch, retro) to find the Linear project.
When linearSync is "required":
.codebrain/epics/{slug}/prd.md is a cachelist_documents + get_document to get the latest version[NEEDS CLARIFICATION] markers block tickets. Ambiguous PRDs create ambiguous code.