From codebrain
Use when starting a large feature, managing multi-ticket work, or tracking specs/tickets/decisions. Subcommands: create (specs + tickets with EARS requirements and Given/When/Then acceptance criteria), work (next ticket), status (progress).
npx claudepluginhub chrsmay/codebrain-plugin --plugin codebrainThis skill uses the workspace's default tool permissions.
Multi-artifact workflow for large features. Manages specs, tickets, decisions, and tracks progress across sessions.
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.
Multi-artifact workflow for large features. Manages specs, tickets, decisions, and tracks progress across sessions.
/codebrain:epic <subcommand> [args]
create <name> — Create a new epic with specs and ticketswork <slug> — Work on the next ticket in an epicstatus <slug> — Show epic progressBefore creating an epic, consider running the full lifecycle:
/codebrain:discover — Validate the problem is worth solving/codebrain:prd — Write the Product Requirements Document/codebrain:map-journeys — Enumerate all user paths and edge cases/codebrain:epic create — Generate tech specs and tickets from PRD + journeys/codebrain:epic work — Implement tickets one by one/codebrain:launch — Pre-launch checklist and rollout plan/codebrain:retro — Post-launch retrospective and next iterationYou can start at any phase. But the further upstream you start, the fewer surprises downstream.
Read .codebrain/config.json for linearSync and linearProjectId.
linearSync: "required" and Linear MCP is NOT connected: STOP with auth message.linearSync: "required" or "optional" (with Linear available): all subcommands sync with Linear.When Linear sync is active, Linear is the canonical source for:
Local .codebrain/epics/ files become a cache for offline fallback.
After generating specs and tickets locally (Step 7), perform these Linear operations:
Check for existing project:
list_projects filtering by epic namecreate_project with name, description (from PRD overview)Store specs as Linear project documents:
/codebrain:prd)Create Linear issues for each ticket:
create_issue for each ticket with:
codebrain, epic slug, ticket type (e.g., feature, test, refactor)linear_id: ISS-xxx)Create issue relations for dependencies:
depends_on in the ticket DAG:
Create project milestones (if tickets have execution phases):
Save Linear metadata to .codebrain/config.json:
{
"linearProjectId": "proj_xxx",
"linearTeamId": "team_xxx",
"linearIssueMap": {
"001-setup-database": "ISS-123",
"002-create-api": "ISS-124"
}
}
Before starting work on a ticket:
Read from Linear first (not local files):
get_issue with the ticket's Linear ID to get:
Update Linear status:
update_issue to set status to "In Progress" when startingAfter completion:
update_issue to set status to "Done" (or "In Review" if verification pending)create_comment with execution summary:
[SPEC_DEVIATION] markerslist_issues filtered by the Linear project ID.codebrain/ status (Linear is authoritative for status, local for file content)Read constitution. Load .codebrain/memory/constitution.md — all generated artifacts must comply.
Generate slug from the epic name (lowercase, hyphens, no special chars).
2b. Check for existing upstream artifacts:
.codebrain/epics/{slug}/discovery.md exists → load it (skip requirement questions).codebrain/epics/{slug}/prd.md exists → load it (use PRD requirements directly).codebrain/epics/{slug}/journeys.md exists → load it (incorporate edge cases into tickets)/codebrain:discover and /codebrain:prd first.Ask requirements — Ask 5-8 questions ONE AT A TIME. Do not batch questions. Wait for each answer before asking the next:
After each answer, if the answer is vague or raises new questions, ask a follow-up. Do NOT proceed until requirements are clear.
Spawn planner agent to generate spec artifacts using EARS notation:
specs/prd.md — Problem and outcomes
[NEEDS CLARIFICATION: description — option A | option B]specs/tech.md — Architecture and implementation approach
specs/design.md — User flows (only if UI work detected)specs/api.md — API contracts (only if API work detected)
Review for [NEEDS CLARIFICATION] markers. Before proceeding to tickets:
[NEEDS CLARIFICATION] markersAPI Research (if epic involves API routes or third-party integrations):
api-researcher agent for each API/SDK referenced in the specsSpawn planner agent again to generate tickets with Given/When/Then acceptance criteria:
Given [precondition]
When [action]
Then [expected result]
depends_on (references to other ticket IDs)execution_order (1, 2, 3...)[P] marker if the ticket can run in parallel with othersWrite all artifacts via MCP tools:
mcp__codebrain__codebrain_artifact_write for each spec and ticketepic.md overview with title, status, summarydecisions.md with decisions from the requirement gathering phaseSync with Linear (see "Linear Integration" section above for full details):
linearSync: "required" in configReport what was created — show the epic overview and ticket list.
Read constitution — hold principles in mind for all work.
Load epic status via mcp__codebrain__codebrain_epic_status.
Spawn bart agent to analyze state and recommend next ticket:
Present ticket board (Done / In Progress / Ready / Blocked) and bart's recommendation.
On ticket selection (user confirms or picks different):
/codebrain:plan scoped to that ticket's acceptance criteriaAfter completion — Spec Reconciliation:
done in the ticket fileexecutions/ directory[SPEC_DEVIATION: spec says X, code does Y — reason: Z]mcp__codebrain__codebrain_epic_status with the epic slug.[NEEDS CLARIFICATION] markers still unresolved[SPEC_DEVIATION] markers from recent work.codebrain/epics/{slug}/
├── epic.md # Title, status, summary
├── specs/
│ ├── prd.md # EARS requirements (FR-001, FR-002...) with [NEEDS CLARIFICATION] markers
│ ├── tech.md # Architecture with file:line references
│ ├── design.md # User flows (if applicable)
│ └── api.md # API contracts (if applicable)
├── tickets/
│ ├── 001-ticket-name.md # Given/When/Then acceptance criteria
│ ├── 002-ticket-name.md # [P] marker if parallelizable
│ └── ...
├── executions/
│ └── 001-ticket-name-execution.md # Includes [SPEC_DEVIATION] markers if any
└── decisions.md # Epic-scoped decisions from requirements + implementation