Five-Stage Workflow
Move every feature deliberately through Discover, Specify, Plan, Build, and Review.
DevBro replaces unstructured single-prompt coding loops with five explicit stages. You can inspect earlier stages at any time and reopen them whenever nothing is running.
1. Discover
Describe what you want to build. Instead of guessing silently, the planning assistant asks clarifying questions rendered as structured question cards you answer in place (ctrl+⏎ submits the next action).
2. Specify
The assistant drafts a concrete Markdown specification (SPEC.md). Edit it directly (ctrl+s), request revisions, and approve it before any planning begins.
3. Plan
DevBro produces an ordered tasks.json contract where each task declares:
- Title, brief, and target files in scope
- Dependencies (
dependsOn) - Complexity and model tier (
small,medium,large) with a one-line reason - Attached skills with reasons and content hashes
- Executable checks with explicit expected results
Before you press Build, you can edit task briefs, switch model tiers, swap skills, or adjust checks. Fields you edit are marked setBy: "user" so re-planning never overwrites your choices.
4. Build
DevBro executes tasks sequentially — or up to 4 tasks in parallel when dependencies and target file scopes do not overlap.
Red-green checks in one task
A check is { command, expect } where expect is pass, fail, or fail with required output text. When a task defines a redCheck:
- Pre-check: DevBro verifies checks do not already pass and commands are not broken (exit
126/127or timeout). - Red turn: The assistant writes only the failing test; DevBro runs
redCheckand confirms it fails for the stated reason. - Green turn: The assistant implements the change; DevBro runs the full check suite and verifies exit
0. - No identical retries: If an attempt changes no files and fails with identical output, DevBro stops and asks you instead of looping.
Isolated worktrees & safe commits
When parallel execution is enabled, each task runs in its own git worktree under .code-buddy/worktrees/<session>/<task>/ on branch code-buddy/<session>/<task>.
- Git commit hooks always run — DevBro never uses
--no-verify. - Uncommitted user files are never touched or stashed.
- Secret-like files (
.env,*.pem,*.key,id_rsa*) are never staged. - On a merge conflict, DevBro runs
git merge --abort, preserves the task worktree, lists the conflicting files, and waits for your decision.
5. Review
Inspect every task’s diff, check results, token spend, skipped items, and proposed long-term memories before closing the session.