Workflows Reference
All 12 development workflows β from feature delivery to code audits.
Table of contents
- What Are Workflows?
- π Feature Workflow β Single Agent (
/workflow-solo) - Phase 1: Research
- Phase 2: Implement
- Phase 3: Integrate
- Phase 3.5: E2E Test
- Phase 4: Verify
- Phase 5: Ship
- π§ Bug-Fix Workflow (
/bugfix) - π§ Refactor Workflow (
/refactor) - π§ Audit Workflow (
/audit) - π§ Performance Optimization Workflow (
/perf-optimize) - π Multi-Agent Pipeline (
/workflow-team)
What Are Workflows?
Workflows are structured, multi-phase development processes defined in .agents/workflows/. They chain rules and skills together into repeatable, quality-enforced development cycles.
Each workflow is invoked as a slash command (e.g., /workflow-solo, /bugfix) and guides the agent through specific phases with completion criteria at each step.
Choosing the Right Workflow
| Situation | Workflow |
|---|---|
| Building a new feature | /workflow-solo |
| Fixing a bug | /bugfix |
| Restructuring code | /refactor |
| Reviewing code quality | /audit |
| Optimizing performance | /perf-optimize |
| Multi-agent orchestration | /workflow-team |
π Feature Workflow β Single Agent (/workflow-solo)
File: .agents/workflows/workflow-solo.md
The primary workflow for building features. Treats the development lifecycle as a state machine β no phase can be skipped.
Flow
Research β Implement (TDD) β Integrate β E2E (conditional) β Verify β Ship
Phases
| Phase | Gate | Output |
|---|---|---|
| Research | Research log created | task.md + docs/research_logs/*.md |
| Implement | Unit tests pass | Production code + unit tests |
| Integrate | Integration tests pass | Integration tests (Testcontainers) |
| E2E (conditional) | E2E tests pass + screenshots | E2E tests + screenshots |
| Verify | All linters pass | Coverage report |
| Ship | Committed | Git commit |
Key Rules
- FORBIDDEN from skipping phases β each phase must complete before the next starts
- Agent acts as a βSenior Principal Engineer with a mandate for strict protocol adherenceβ
- Pre-implementation: scan
.agents/rules/, identify applicable rules, READ them - Tasks marked
[x]only after Phase 4 (Verify) passes
Error Handling
If a phase fails:
- Document the failure in task summary
- Do not proceed to next phase
- Fix the issue within current phase
- Re-run phase completion criteria
- Then proceed
Phase 1: Research
File: .agents/workflows/phase-research.md
Understand the request context and gather knowledge before writing any code.
Steps
- Analyze Request β parse requirements, identify scope
- Review Current Implementation β understand existing architecture
- Build Mental Model β requirements, constraints, integration points
- Define Scope β create
task.mdwith atomic tasks - Identify Research Topics β list all technologies involved
- Search Documentation β use Qurio or web search for each topic
- Document Findings β create
docs/research_logs/{feature}.md - Document Architecture Decisions β create ADRs using ADR Skill if needed
- Fallback β web search if documentation search fails
Skills Used
- Sequential Thinking β for complex design decisions
- ADR β for significant architecture decisions
Phase 2: Implement
File: .agents/workflows/phase-implement.md
Write production code following Test-Driven Development (TDD).
TDD Cycle
- Red β write a failing test
- Green β write minimal code to make it pass
- Refactor β improve structure while keeping tests green
Unit Test Requirements
- Mock all dependencies (interfaces)
- Test happy path, error paths, AND edge cases
- Target >85% coverage on domain logic
Skills Used
- Sequential Thinking β for complex refactoring
- Debugging Protocol β for non-obvious test failures
- Guardrails β pre-flight checklist before writing code
Phase 3: Integrate
File: .agents/workflows/phase-integrate.md
Test adapter implementations with real infrastructure using Testcontainers.
When Required
- Code that touches database (storage implementations)
- Code that calls external APIs
- Code that uses message queues, caches, etc.
Steps
- Setup Testcontainers (PostgreSQL, Redis, NSQ, etc.)
- Write integration tests (
*_integration_test.goor*.integration.spec.ts) - Run integration tests
- Optional manual verification
Phase 3.5: E2E Test
File: .agents/workflows/phase-e2e.md
Validate complete user journeys through the full system using Playwright MCP.
When Required
- UI components were added or modified
- API endpoints interact with frontend
- Critical user-facing flows were changed
When to Skip
- Pure backend/infrastructure changes
- Internal library refactoring
- Test-only changes
Steps
- Start services (docker compose or local dev)
- Create E2E test plan
- Execute with Playwright MCP (navigate, interact, screenshot)
- Document results with screenshots in
docs/e2e-screenshots/
Phase 4: Verify
File: .agents/workflows/phase-verify.md
Run all linters, static analysis, and tests to ensure code quality.
Backend Validation (Go)
gofumpt -l -e -w . && go vet ./... && staticcheck ./... && gosec -quiet ./... && go test -race ./...
Frontend Validation (TypeScript/Vue)
pnpm run lint --fix && npx vue-tsc --noEmit && pnpm run test
Build Check
# Backend
go build ./...
# Frontend
pnpm run build
Coverage Target
85% on domain logic.
If This Phase Fails
- Do NOT proceed to Ship
- Fix the issue (go back to Phase 2 or 3)
- Re-run full verification
- Only proceed when ALL checks pass
Phase 5: Ship
File: .agents/workflows/phase-commit.md
Commit completed work with proper conventional commit format.
Conventional Commit Format
<type>(<scope>): <description>
Types
| Type | Purpose | | βββ- | βββββββββββ | | feat | New feature | | fix | Bug fix | | docs | Documentation only | | refactor | Code change (no new feature/fix) | | test | Adding or updating tests | | chore | Maintenance, dependencies | | perf | Performance improvement | | ci | CI/CD configuration changes |
π§ Bug-Fix Workflow (/bugfix)
File: .agents/workflows/bugfix.md
Fix bugs of any size β from hotfixes to complex debugging sessions β without the overhead of a full feature workflow.
When to Use
- Bug fixes (any size, any complexity)
- Hotfixes for production issues
- Addressing review findings from
/audit - Regression fixes after deployments
- Flaky test fixes
Phases
- Diagnose β identify the bug, locate affected code, assess blast radius. Use Debugging Protocol for non-obvious causes, Sequential Thinking for multi-hypothesis evaluation
- Fix + Test (TDD) β write failing test, apply fix, verify existing tests pass, update integration tests if boundaries touched
- Verify + Ship β full validation suite, E2E if UI was touched, commit with
fixtype
π§ Refactor Workflow (/refactor)
File: .agents/workflows/refactor.md
Safely restructure existing code while preserving behavior.
When to Use
- Code restructuring (moving, renaming, splitting modules)
- Pattern migration (e.g., callbacks β async/await)
- Dependency upgrades with breaking changes
- Addressing tech debt or architectural improvements
Requires a Specific Goal
- β
/refactor extract storage interface in task feature - β
/refactor split user handler into separate auth handler - β
/refactor apps/backend(too vague β use/auditfirst)
Phases
- Impact Analysis β map blast radius, document existing behavior, identify risks
- Incremental Change (TDD) β one change at a time, tests pass at each step
- Parity Verification β full validation, compare coverage (equal or better)
- Ship β commit with
refactortype
Key Principle
Never break the build for more than one step at a time.
π§ Audit Workflow (/audit)
File: .agents/workflows/audit.md
Inspect existing code quality without writing new features. Produces structured findings for subsequent fix workflows.
When to Use
- After another agentβs feature is committed (cross-agent review)
- Periodic quality gates
- Before releases or deployments
- Verification without new code
Phases
- Code Review β invoke the Code Review Skill against specified files 1.5. Cross-Boundary Review β check integration seams that live between components, not inside any single file
- Automated Verification β full lint/test/build validation
- Findings Report β saved to
docs/audits/review-findings-{feature}-{date}-{HHmm}.md
Phase 1.5: Cross-Boundary Review
A menu of dimensions β activate only those that apply to the project, and state which you skipped and why.
| Dimension | Activate When |
|---|---|
| A. Integration Contracts | Project has both frontend and backend |
| B. Database & Schema | Project uses a relational/document database |
| C. Configuration & Environment | Always β universal |
| D. Dependency Health | Always β universal |
| E. Test Coverage Gaps | Always β universal |
| F. Mobile β Backend | Project has a mobile app and a backend |
Zero-Findings Guard: If the audit produces fewer than 3 findings, you MUST complete a βDimensions Coveredβ attestation table proving each dimension was explicitly examined before declaring a clean result.
Findings Triage
| Finding Type | Example | Follow-Up |
|---|---|---|
| Nit / minor | βRename x to userCountβ | Fix directly |
| Small isolated fix | βAdd input validationβ | /bugfix in new conversation |
| Structural change | βStorage not behind interfaceβ | /refactor in new conversation |
| Missing capability | βNo auth on admin routesβ | /workflow-solo in new conversation |
Best Practice
Run audits in a fresh conversation (not the one that wrote the code) to avoid confirmation bias.
π§ Performance Optimization Workflow (/perf-optimize)
File: .agents/workflows/perf-optimize.md
Profile-driven performance optimization. Always measure before optimizing β one fix at a time, independently benchmarked and committed.
When to Use
- User provides profiling data (pprof, flamegraph, Lighthouse)
- Benchmarks show regression
- User asks to optimize a specific component
Phases
| Phase | Output | Gate |
|---|---|---|
| Profile | Raw data + extracted markdown | Data collected |
| Analyze | docs/research_logs/{component}-perf-analysis.md | Top offenders identified |
| Prioritize | Implementation plan | User approved |
| Implement | Tests + code + benchmark per fix | Each fix passes tests |
| Verify | Full benchmark comparison | All checks pass |
| Ship | Conventional commits (perf(scope): ...) | User notified |
Key Rules
- One fix per commit β never batch optimizations
- TDD for each fix β write test, implement, benchmark
- Stop when remaining cost is in runtime internals, hardware-optimized assembly, or when improvement < 5%
- Loads the perf-optimization skill and relevant language module before starting
π Multi-Agent Pipeline (/workflow-team)
File: .agents/workflows/workflow-team.md
Dispatches specialized sub-agents across layers (research, design, build, review) with parallel execution support. The Pipeline Manager orchestrates β it never writes code itself.
When to Use
- Features requiring multiple specializations (backend + frontend + database)
- Tasks benefiting from parallel development
- Scenarios needing specialized review (security audit + QA + UX review)
- Large features that can be decomposed into independent work streams
Agent Roster (15 Personas)
Agents are organized into four layers with strict boundaries:
Research Layer (Read-only)
| Agent | Domain |
|---|---|
@scout | Codebase exploration, pattern discovery, technology research |
Design Layer (Read-only β produces decisions and contracts)
| Agent | Domain |
|---|---|
@architect | System design, ADRs, API contracts, dependency strategy |
Cross-layer participants can join DESIGN when needed: @ux-reviewer, @database-expert, @security-engineer, @performance-engineer.
Builder Layer (Write β run in Git worktrees)
| Agent | Domain |
|---|---|
@backend-engineer | APIs, business logic, concurrency, observability |
@frontend-engineer | Web UI, components, state management, a11y |
@mobile-engineer | Flutter/RN, widgets, platform APIs, offline-first |
@database-expert | Schema, migrations, queries, indexes |
@devops-engineer | CI/CD, containers, IaC, monitoring |
@technical-writer | Docs, API docs, changelogs, README |
@test-automation-engineer | E2E (UI+API), Playwright, test infra |
@performance-engineer | Profiling, benchmarks, load tests, optimization |
@refactoring-specialist | Code smell detection, safe transformation |
Reviewer Layer (Read-only β post-merge)
| Agent | Domain |
|---|---|
@qa-analyst | Code review, testing coverage, quality gates |
@security-engineer | Threats, vulnerabilities, auth, input validation |
@ux-reviewer | Design heuristics, interaction, a11y, responsive |
@incident-responder | Triage, RCA, mitigation, postmortems |
Composable Primitives
Workflows are built from composable primitives β each a stage in the pipeline:
| Primitive | Agents | Dependency |
|---|---|---|
| SCOUT | scout or domain agent | None |
| DESIGN | architect + optional experts | After SCOUT |
| PRE-MORTEM | incident-responder + optional experts | After DESIGN |
| BUILD | Implementation agents | After DESIGN |
| TEST | test-automation-engineer | After DESIGN |
| REVIEW | qa-analyst + security-engineer + optional | After BUILD/TEST |
| REMEDIATE | Fix agents | After REVIEW |
| OPTIMIZE | performance-engineer | After BUILD |
| REFACTOR | refactoring-specialist | After REVIEW/SCOUT |
| INCIDENT | incident-responder + engineers | Standalone |
| VERIFY | qa-analyst | After final merge |
| DOCUMENT | technical-writer | After VERIFY |
Workflow Templates
| Template | Pipeline |
|---|---|
| A: Full Feature | SCOUT β DESIGN β PRE-MORTEM β BUILD β REVIEW β REMEDIATE β VERIFY β DOCUMENT |
| B: Bug Fix | SCOUT β BUILD β REVIEW β VERIFY |
| C: Audit & Remediation | SCOUT(review) β REVIEW β REMEDIATE β REVIEW β VERIFY |
| D: Mobile Feature | SCOUT β DESIGN β BUILD β REVIEW β VERIFY |
| E: Performance | SCOUT(profile) β OPTIMIZE β BUILD β REVIEW β VERIFY |
| F: Security Hardening | SCOUT(security) β REMEDIATE β REVIEW β VERIFY |
| G: Infrastructure | DESIGN β BUILD β REVIEW β VERIFY |
| H: Documentation | SCOUT β DOCUMENT β REVIEW |
| I: Incident Response | INCIDENT β REMEDIATE β REVIEW β VERIFY β DOCUMENT |
| J: Tech Debt | SCOUT β REFACTOR β REVIEW β VERIFY |
| K: Security + Perf Audit | SCOUT β REVIEW β REMEDIATE β REVIEW β VERIFY |
| L: Pre-Mortem | DESIGN β PRE-MORTEM β DOCUMENT |
Parallel Execution
Two types of parallelism are supported:
- Cross-domain: Different agent types in parallel (e.g.,
@backend-engineer+@frontend-engineer). Always safe β disjoint domains. - Intra-domain: Multiple instances of the same agent type (e.g.,
@backend-engineer[auth]+@backend-engineer[tasks]). Requires MECE decomposition via parallel-dispatch skills.
# Single instance
@backend-engineer Build the auth feature
# Scoped parallel instances
@backend-engineer[auth] Implement auth handlers per scope card
@backend-engineer[tasks] Implement task CRUD per scope card
Git Worktree Lifecycle
BUILD agents work in isolated Git worktrees to prevent conflicts:
# Setup (before dispatch)
git worktree add .wt/<agent-name>-<scope> -b wt/<agent-name>-<scope>-$(date +%s) HEAD
# Merge (in dependency order, per parallel-dispatch-merge skill)
git merge --squash wt/<agent-name>-<scope>-<ts>
git commit -m "<type>(<scope>): <description>"
# Cleanup
git worktree remove .wt/<agent-name>-<scope>
git branch -D wt/<agent-name>-<scope>-<ts>
Circuit Breaker
- Sub-agent fails β retry ONCE with clarified context
- Fails again β STOP:
"BLOCKED: {agent_type}[{scope}] failed 2x on {task}. Need human input." - Max 2 attempts per sub-agent per task β non-negotiable