.claude/skills/sagerstack-builder/SKILL.md
SDLC implementation with agent team. Executes implementation plans produced by /sagerstack:planner. Spawns a 2-member builder team (Software Developer + Code QA) to implement code via TDD and validate against acceptance criteria. Use when building a phase from planned artifacts, implementing stories, or executing implementation plans.
npx skillsauth add sagerstack/agentic-sdlc sagerstack:builderInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
<essential_principles>
These principles ALWAYS apply when executing implementation plans with the builder team.
The builder team executes ONLY what the implementation plan specifies. The plan is the single source of truth.
docs/phases/epic-{NNN}-{desc}/plans/story-{NNN}-{desc}-plan.mddocs/phases/epic-{NNN}-{desc}/stories/story-{NNN}-{desc}.md for AC referencedocs/phases/epic-{NNN}-{desc}/research/ when external APIs are involveddocs/phases/epic-{NNN}-{desc}/plans/story-{NNN}-{desc}-critical-analysis.md for documented risks[X.0][CATEGORY] becomes one TaskList item[X.Y] is executed within that TaskList item via TDDEvery subtask follows red-green-refactor. No exceptions.
The Software Developer agent has /sagerstack:software-engineering preloaded, which enforces:
Quality standards are enforced through skill preloading, not manual instruction.
| Agent | Preloaded Skills | Standards Enforced |
|-------|-----------------|-------------------|
| Software Developer | sagerstack:software-engineering, sagerstack:local-testing, project-memory | Architecture, TDD, coverage, Docker, env files |
| Code QA | sagerstack:code-qa, project-memory | AC validation, quality pipeline, UAT |
The Developer does not need to be told HOW to write code. The skills define the how. The impl plan defines the WHAT.
After ALL implementation tasks for a story are complete, Code QA validates:
QA operates as a zero-trust validator. It re-runs all tests independently and never trusts developer assertions.
When QA finds failures, remediation is TARGETED, not broad.
Both agents read and write project memory to maintain cross-session knowledge.
| Agent | Reads | Writes |
|-------|-------|--------|
| Software Developer | docs/project_notes/decisions.md, docs/project_notes/key_facts.md, docs/project_notes/bugs.md | docs/project_notes/bugs.md, docs/project_notes/key_facts.md |
| Code QA | docs/project_notes/bugs.md, docs/project_notes/decisions.md | docs/project_notes/bugs.md, docs/project_notes/issues.md |
| Mode | Behavior | When to Use |
|------|----------|-------------|
| single-epic (default) | Execute one epic, report completion, stop | Normal usage |
| --continue | After epic completes, auto-chain to next epic if plans exist | Multi-epic sprint |
With --continue, if next epic plans do not exist, prompt user to run /sagerstack:planner first.
</essential_principles>
<intake>Before executing, read the project context and available phase plans.
Step 1: Read project context
Read docs/project-context.md
Step 2: Scan for planned phases
Glob docs/phases/epic-*/plans/story-*-plan.md
Step 3: Identify current state
[x])?Step 4: Present to user
BUILDER STATUS:
Epics ready to build:
- epic-001-{desc}: {epic name} ({N} stories, {M} total tasks)
- epic-002-{desc}: {epic name} ({N} stories, {M} total tasks)
Epics already built:
- (none yet)
Which epic would you like to build?
Options:
1. epic-001-{desc} (recommended - first in dependency order)
2. epic-002-{desc}
3. Specific story within an epic
Execution mode:
- Default: single epic
- Add --continue to auto-chain epics
Wait for user to select epic/story and execution mode.
</intake> <routing>| User Intent | Action |
|-------------|--------|
| "build epic 001", "execute epic", "implement epic" | Read workflows/execute-phase.md, execute full epic |
| "build story 002 in epic 001", "implement story", "just story NNN" | Read workflows/execute-story.md, execute single story |
| "check status", "where are we", "what's done" | Scan impl plans for [x] markers, report progress |
| "resume", "continue from where we left off" | Read TaskList + impl plan [x] markers, resume from first incomplete task |
| "fix QA failures", "remediation" | Read workflows/remediation-loop.md, execute targeted fixes |
| "setup environment first" | Read workflows/setup-environment.md, prepare local dev |
<workflow_steps>
docs/project-context.md to understand milestones and epicsdocs/phases/ for available impl plansdocs/phases/epic-{NNN}-{desc}/plans/story-*-plan.mddocs/phases/epic-{NNN}-{desc}/stories/story-*.mddocs/phases/epic-{NNN}-{desc}/plans/story-*-critical-analysis.mddocs/phases/epic-{NNN}-{desc}/research/ (if exists)Create the builder team and spawn teammates.
TeamCreate(team_name="builder-epic-{NNN}", description="Building epic-{NNN}-{desc}: {epic name}")
Spawn Software Developer:
Task(
subagent_type="builder-developer",
team_name="builder-epic-{NNN}",
name="software-developer",
prompt="You are the Software Developer for epic-{NNN}-{desc}. Your skills (software-engineering, local-testing, project-memory) are preloaded. Follow TDD for every task. Read impl plans at: docs/phases/epic-{NNN}-{desc}/plans/. Read stories at: docs/phases/epic-{NNN}-{desc}/stories/. Work on branch: feature/epic-{NNN}-story-{NNN}. Await task assignments from Team Lead."
)
Spawn Code QA:
Task(
subagent_type="builder-qa",
team_name="builder-epic-{NNN}",
name="code-qa",
prompt="You are the Code QA for epic-{NNN}-{desc}. Your skills (code-qa, project-memory) are preloaded. You validate acceptance criteria, run the 9-check quality pipeline, and perform UAT. You NEVER modify source code. Read stories at: docs/phases/epic-{NNN}-{desc}/stories/. Read plans at: docs/phases/epic-{NNN}-{desc}/plans/. Await QA assignments from Team Lead."
)
Create task list from impl plans:
For each story (in dependency order), for each parent task [X.0][CATEGORY] in the impl plan:
TaskCreate(
subject="[US-{NNN}] [X.0][CATEGORY] {description}",
description="Implement all subtasks [X.1] through [X.N]. Impl plan: docs/phases/epic-{NNN}-{desc}/plans/story-{NNN}-{desc}-plan.md. Story: docs/phases/epic-{NNN}-{desc}/stories/story-{NNN}-{desc}.md."
)
Create QA validation task per story:
TaskCreate(
subject="[US-{NNN}] QA Validation",
description="Validate all AC for US-{NNN}. Run 9-check quality pipeline. Perform UAT."
)
TaskUpdate(qaTaskId, addBlockedBy=[all story N impl task IDs])
Before assigning implementation tasks, verify environment readiness.
Check for existing feature branch or create one:
git checkout -b feature/epic-{NNN}-story-{NNN}
If branch already exists (resuming), check it out.
Merge latest from main:
git merge main
Check local environment:
docker info)poetry install).env.local, tests/.env.test)Handle MANUAL tasks:
If impl plan contains [MANUAL] tasks:
For each story in the epic (in dependency order):
4a. Assign implementation tasks to Developer
For each parent task (SETUP first, then FR/TR/AC in impl plan order):
TaskUpdate(taskId, owner="software-developer")
SendMessage(
type="message",
recipient="software-developer",
content="TASK ASSIGNMENT:
- Task ID: {taskId}
- Subject: [X.0][CATEGORY] {description}
- Impl Plan: docs/phases/epic-{NNN}-{desc}/plans/story-{NNN}-{desc}-plan.md
- Story: docs/phases/epic-{NNN}-{desc}/stories/story-{NNN}-{desc}.md
- Instructions: Implement all subtasks [X.1] through [X.N] via TDD (red-green-refactor).
- After completing all subtasks: Run quality checks (pytest, coverage, mypy, ruff, bandit).
- If quality checks pass: Commit with descriptive message.
- Mark subtasks [x] in impl plan as you complete them.",
summary="Implement [X.0][CATEGORY] for US-{NNN}"
)
Wait for Developer to complete each task before assigning the next.
4b. Developer implements via TDD
Developer follows this cycle for each subtask:
poetry run pytest tests/ -vpoetry run pytest --cov=src --cov-fail-under=90poetry run mypy src/ --strictpoetry run ruff check src/ tests/poetry run bandit -r src/git add {relevant files}
git commit -m "{descriptive message}"
[x] in impl plan file4c. After all impl tasks for a story complete, assign QA
TaskUpdate(qaTaskId, owner="code-qa")
SendMessage(
type="message",
recipient="code-qa",
content="QA ASSIGNMENT:
- Story: docs/phases/epic-{NNN}-{desc}/stories/story-{NNN}-{desc}.md
- Impl Plan: docs/phases/epic-{NNN}-{desc}/plans/story-{NNN}-{desc}-plan.md
- Instructions: Validate ALL acceptance criteria. Run full 9-check quality pipeline. Perform UAT if docker-compose or app entry point exists. Generate QA report at docs/phases/epic-{NNN}-{desc}/qa/story-{NNN}-{desc}-qa-report.md.
- If ALL pass: Report PASS with summary.
- If ANY fail: Report FAIL with Failure-to-Task Mapping for targeted remediation.",
summary="QA validate US-{NNN}"
)
4d. Handle QA results
If QA PASSES:
If QA FAILS:
TaskCreate(
subject="[US-{NNN}] Remediation: {failure description}",
description="Fix: {specific issue}. Source: {file:line}. Related task: [X.0][CATEGORY]. Test that must pass: {test reference}."
)
TaskUpdate(remediationTaskId, owner="software-developer")
If QA fails after 2 retries, escalate to user:
ESCALATION: US-{NNN} in epic-{NNN}-{desc}
WHAT FAILED:
- {Concise description of remaining failures}
WHAT WAS ATTEMPTED:
- Retry 1: {what was tried and result}
- Retry 2: {what was tried and result}
REMAINING ISSUES:
- {Issue 1 with file/line reference}
- {Issue 2 with file/line reference}
RECOMMENDATION:
- {Suggested manual intervention}
ARTIFACTS:
- QA Report: docs/phases/epic-{NNN}-{desc}/qa/story-{NNN}-{desc}-qa-report.md
- Impl Plan: docs/phases/epic-{NNN}-{desc}/plans/story-{NNN}-{desc}-plan.md
After all stories in the epic pass QA:
Final verification:
[x]Update project status:
docs/project_notes/issues.mdReport to user:
EPIC COMPLETE: epic-{NNN}-{desc} - {epic name}
Stories completed: {N}/{N}
Total tasks executed: {X}
Test coverage: {N}%
QA retries: {N}
Feature branches: feature/epic-{NNN}-story-{NNN}
Next steps:
- Create PR(s) for feature branches
- Run /sagerstack:builder for next epic (if planned)
- Run /sagerstack:planner for next epic (if not yet planned)
Graceful shutdown:
SendMessage(type="shutdown_request", recipient="software-developer", content="Epic complete. Shutting down.")
SendMessage(type="shutdown_request", recipient="code-qa", content="Epic complete. Shutting down.")
Wait for shutdown confirmations
Delete team:
TeamDelete
Continuation mode check:
--continue flag was set:
docs/phases/epic-{next}/plans/ exists</workflow_steps>
<team_configuration>
| Role | Agent Name | Subagent Type | Permission Mode | Model | Skills Preloaded |
|------|-----------|---------------|-----------------|-------|-----------------|
| Team Lead | (main session) | N/A (delegate mode) | delegate | opus | N/A |
| Software Developer | software-developer | builder-developer | bypassPermissions | sonnet | sagerstack:software-engineering, sagerstack:local-testing, project-memory |
| Code QA | code-qa | builder-qa | plan | opus | sagerstack:code-qa, project-memory |
File: .claude/agents/builder-developer.md
---
name: builder-developer
description: >
Software Developer for the SDLC builder team. Implements code via TDD
following software-engineering and local-testing skill standards.
CamelCase naming, Vertical Slice + DDD, 90%+ coverage.
tools:
- Read
- Write
- Edit
- Glob
- Grep
- Bash
- SendMessage
- TaskUpdate
- TaskList
model: sonnet
permissionMode: bypassPermissions
maxTurns: 200
skills:
- sagerstack:software-engineering
- sagerstack:local-testing
- project-memory
---
File: .claude/agents/builder-qa.md
---
name: builder-qa
description: >
Code QA for the SDLC builder team. Validates acceptance criteria pass/fail,
runs quality check pipeline, performs flexible UAT. Zero-trust validator
that never modifies source code.
tools:
- Read
- Glob
- Grep
- Bash
- SendMessage
- TaskUpdate
- TaskList
- Write
model: opus
permissionMode: plan
maxTurns: 80
skills:
- sagerstack:code-qa
- project-memory
---
To prevent race conditions, each teammate owns specific files:
| Agent | Owns (write access) | Reads |
|-------|---------------------|-------|
| Software Developer | src/, tests/, impl plan [x] markers, developer log, CHANGELOG | All phase artifacts, codebase |
| Code QA | QA report files (docs/phases/epic-{NNN}-{desc}/qa/) only | src/, tests/, all epic artifacts (read-only) |
</team_configuration>
<reference_index>
All in references/:
Task Execution:
Logging:
Git Workflow:
Escalation:
</reference_index>
<workflows_index>
All in workflows/:
| File | Purpose | |------|---------| | execute-phase.md | Full phase execution with team orchestration | | execute-story.md | Single story execution within a phase | | remediation-loop.md | QA failure remediation with targeted fixes | | setup-environment.md | Pre-implementation local environment setup |
</workflows_index>
<verification>After completing an epic, verify:
poetry run pytest tests/ -v)poetry run pytest --cov=src --cov-fail-under=90)poetry run mypy src/ --strict)poetry run ruff check src/ tests/)poetry run bandit -r src/)[x]feature/epic-{NNN}-story-{NNN})git status clean)docs/project_notes/bugs.mddocs/project_notes/key_facts.mddocs/project_notes/issues.mddevelopment
Interactive UAT verification skill. Walks the user through acceptance criteria one at a time, records pass/fail/skip results, generates UAT report, and routes remediation gaps to /sagerstack:builder. Solo skill (no agent team).
development
Python code architecture with Vertical Slice + DDD and Clean Architecture. Use when designing Python projects, structuring code, creating domain models, defining bounded contexts, or reviewing architecture. Enforces strict domain purity, CamelCase naming, and proper layer separation.
data-ai
SDLC planning skill that spawns a 4-member agent team to plan one epic at a time from project-context.md. Produces epics, user stories with FR/TR/AC, implementation plans, and critical analyses. Use when planning an epic for full SDLC execution with agent teams.
testing
Testing infrastructure, local environment simulation, and deployment scripts. Use when setting up pytest fixtures, Docker Compose, LocalStack, mocking external services, or creating local deployment scripts. Focuses on HOW to test and run locally, not coding principles (TDD is in software-engineering).