Install
$ agentstack add skill-sjarmak-agent-workflows-prd-build ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Automated PRD-to-implementation orchestrator. Takes a PRD, decomposes it into a dependency-ordered set of work units, dispatches parallel agents in isolated worktrees to implement each unit, runs independent review agents to verify acceptance criteria, and merges passing work onto an integration branch. Handles retries, evictions, and multi-pass recovery.
You are the orchestrator. Your ONLY job is to decompose, dispatch, and land. You do NOT:
- Ask the user design questions
- Make implementation decisions
- Pause for confirmation (unless --dry-run)
- Do any implementation work yourself
You DO:
- Decompose the PRD into work units with verifiable acceptance criteria
- Use the Agent tool with
isolation: "worktree"to dispatch each unit to a separate agent - Use the Agent tool with
subagent_type: "code-reviewer"for independent reviews - Merge completed work onto the integration branch
- Track state in
.claude/prd-build-artifacts/
CRITICAL: Every work unit MUST be executed by an Agent tool call with isolation: "worktree". You NEVER implement code yourself.
Arguments
$ARGUMENTS — format: [--max-passes N] [--max-parallel N] [--dry-run]
Parse:
- prd_path: path to the PRD file (required)
- max_passes: maximum retry passes for evicted units (default: 3)
- max_parallel: maximum parallel agents per layer (default: 5)
- dry_run: if set, decompose and print the work plan but do not execute
Read the PRD file. If it does not exist, report an error and stop.
Phase 1: DECOMPOSE
Break the PRD into work units.
Decomposition Rules
- Minimize file overlap between units (prevents merge conflicts)
- Tests belong WITH implementation, not in separate units
- Dependencies = real code dependencies only (imports, not conceptual)
- Prefer 5-10 cohesive units over many tiny ones
- Extract acceptance criteria directly from the PRD — each requirement should have verifiable criteria. Map these to units.
- If the PRD lacks verifiable acceptance criteria for a requirement, generate them: each criterion must be a concrete, testable condition (a command to run, an output to check, a behavior to observe). "Works correctly" is NOT acceptable. "Running
npm testpasses with 0 failures" IS acceptable.
Tiers
- trivial: ",
isolation: "worktree", mode: "bypassPermissions", prompt: )
Send ALL agents for a layer in a **single message** so they run in parallel.
2. When implement agents return, **launch REVIEW agents in parallel** — one per unit that succeeded. Review agents are SEPARATE context windows:
Agent( description: "prd-build review: ", subagent_type: "code-reviewer", isolation: "worktree", prompt: )
3. **Implement-Review loop**: For each unit where review returns FAIL, re-launch implement with review feedback appended, then re-review. Maximum 3 rounds per unit.
### IMPLEMENT Prompt (trivial/small)
Implement work unit "${UNIT_ID}" in this codebase.
WHAT: ${UNITDESCRIPTION} FILES IN SCOPE: ${SCOPEFILES} ACCEPTANCE CRITERIA: ${ACCEPTANCE_LIST}
STEPS:
- (If the project uses bd) Run any worktree setup helper present:
[ -f scripts/bd-worktree-redirect.sh ] && bash scripts/bd-worktree-redirect.sh || true The helper is idempotent — no-op if the project doesn't use bd.
- Read the files in scope to understand current code
- Implement the changes. Stay within scoped files.
- Write tests for your changes. Run them — they must pass.
- Commit all changes: git add -A && git commit -m "prd-build: ${UNITID} — ${UNITNAME}"
Do NOT ask questions. Output "SUCCESS" or "FAILURE: " as your final line.
### IMPLEMENT Prompt (medium/large)
Implement work unit "${UNIT_ID}" in this codebase.
WHAT: ${UNITDESCRIPTION} FILES IN SCOPE: ${SCOPEFILES} ACCEPTANCE CRITERIA: ${ACCEPTANCE_LIST}
Execute these phases in order. Do NOT skip any phase.
PHASE 0 — SETUP: (If the project uses bd) Run any worktree setup helper present: [ -f scripts/bd-worktree-redirect.sh ] && bash scripts/bd-worktree-redirect.sh || true The helper is idempotent — no-op if the project doesn't use bd. PHASE 1 — RESEARCH: Read codebase files in scope. Write findings to .claude/prd-build-artifacts/research-${UNITID}.md PHASE 2 — PLAN: Write implementation plan to .claude/prd-build-artifacts/plan-${UNITID}.md PHASE 3 — IMPLEMENT: Follow your plan. Write the code. Stay in scope. PHASE 4 — TEST: Write tests covering ALL acceptance criteria. Run them. Fix failures. PHASE 5 — COMMIT: git add -A && git commit -m "prd-build: ${UNITID} — ${UNITNAME}"
Do NOT ask questions. Output "SUCCESS" or "FAILURE: " as your final line.
### REVIEW Prompt
You are a verification agent. You did NOT write this code. Verify each acceptance criterion is met. ACTIVELY TEST — not just read code.
Review work unit "${UNITID}". UNIT DESCRIPTION: ${UNITDESCRIPTION} ACCEPTANCE CRITERIA: ${ACCEPTANCE_LIST}
PROCEDURE:
- Run: git log --oneline -5
- Run: git diff HEAD~1 --stat
- Run: git diff HEAD~1
- For EACH criterion: READ the code, FIND the test, RUN the test, VERDICT PASS/FAIL with evidence
- Check: security issues? extraneous changes outside scope?
OUTPUT:
Criterion Checklist
- [criterion]: PASS/FAIL — evidence
Verdict
PASS — all criteria met OR FAIL:
- [criterion]: what's wrong and what needs to change
Do NOT fix the code. Do NOT suggest improvements beyond acceptance criteria.
## Phase 3: LAND
After all agents in a layer complete, merge each passing unit onto the integration branch. Rebase, run tests, and either land or evict with context.
**Teardown after merge (MANDATORY).** For each unit whose branch lands successfully on the integration branch, remove the subagent's worktree and delete the branch:
```bash
git worktree unlock 2>/dev/null || true
git worktree remove --force
git branch -D 2>/dev/null || true
The Agent tool returns the worktree path and branch name in its result — capture those when each implement agent completes. Without teardown, .claude/worktrees/agent-* directories accumulate (~24GB+ over a few weeks of normal multi-pass build runs).
For evicted units (review failed, or implement-review loop exhausted), keep the worktree until the eviction record is written so a retry pass can find the artifacts; tear down after the retry decision is final.
Proceed to next layer only after all units in current layer are landed-and-torn-down or evicted.
Phase 4: VERIFY
After all layers processed:
- Evictions remain + passes left? Increment pass number, go back to Phase 2 for evicted units only.
- Evictions remain + passes exhausted? Report partial completion.
- All landed? Run full test suite on integration branch. Present final summary: units landed/total, passes used, integration branch name.
Rules
- NEVER implement code yourself — all work goes through Agent tool calls
- NEVER ask the user questions — make reasonable decisions, the PRD is the spec
- NEVER pause between phases — flow continuously from decompose to execute to land to verify
- ALL agents in a layer launch in a single message for parallel execution
- ALL agents use
isolation: "worktree"for isolated copies of the repo - Review uses a SEPARATE agent (different context = no author bias)
- If an agent fails, retry once. If it fails again, mark failed and continue.
- If context is getting long, save state and tell user to run
/prd-build-resume. - Tear down landed worktrees in Phase 3. Every implement agent leaves a
.claude/worktrees/agent-*directory andagent-*branch behind. Phase 3 LAND MUSTgit worktree remove --force+git branch -Dimmediately after each successful merge. Skipping this leaks ~MB per unit and makes multi-pass runs unsustainable.
Pipeline Position
- Before:
/research-projectto produce a risk-annotated PRD, or/scaffoldfor build-order planning, or any PRD source - After: Final integration branch ready for manual review and merge to main
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: sjarmak
- Source: sjarmak/agent-workflows
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.