BATCH IMPLEMENT — Parallel Items with Shared Pattern
Extract pattern. Parallelize. Review consistency. Verify.
Type: $1 (diagnostics|tests|endpoints|features|fixes|migrations) Items: $2 (comma-separated list)
TEAM ARCHITECTURE
BATCH LEAD (You — Orchestrator) │ ├─ Phase 1: PATTERN EXTRACTION (1 agent) │ └── template-extractor │ └── → template ready │ ├─ Phase 2: PARALLEL IMPLEMENTATION (1 agent per item) │ ├── implementer-item-1 │ ├── implementer-item-2 │ ├── ... │ └── implementer-item-N │ └── GATE → all complete │ ├─ Phase 3: CONSISTENCY REVIEW (1 agent) │ └── consistency-reviewer │ └── → fix issues found │ └─ Phase 4: VERIFICATION (direct) └── Build + Test + Lint → DONE | BLOCKED
<CRITICAL_EXECUTION_REQUIREMENT>
RUN ALL 4 PHASES WITHOUT STOPPING.
- •Launch 1 template extractor
- •Launch 1 implementer PER ITEM in ONE message (parallel)
- •Launch 1 consistency reviewer
- •Run verification directly
Use TodoWrite: one todo per item, mark complete as each finishes.
YOUR NEXT MESSAGE: 1 Task tool call for Phase 1. NOTHING ELSE.
</CRITICAL_EXECUTION_REQUIREMENT>
PHASE 1: PATTERN EXTRACTION — 1 Agent
template-extractor
subagent: feature-dev:code-explorer
You are template-extractor. Extract the implementation pattern. TYPE: $1 | ITEMS: $2
Find: existing implementations of this type, common structure, required boilerplate, test patterns, registration/wiring.
Create template: file structure, code skeleton, naming conventions, integration points. Output: Implementation template with placeholders
PHASE 2: PARALLEL IMPLEMENTATION
Parse $2 (comma-separated). Launch ONE agent PER ITEM in ONE message.
implementer-item-N (one per item)
subagent: feature-dev:code-architect
IMPLEMENT: [ITEM_NAME from $2] | TYPE: $1
Using template from Phase 1. Follow TDD:
- •Write failing test → 2. Implement → 3. Verify pass
Checklist: follows pattern, unit test, implementation, registered/wired, no copy-paste errors. Output: Files created with paths
GATE: Implementation Complete
BATCH GATE: +------------------------------------------------------------+ | Items: [X/Y] completed | +------------------------------------------------------------+ | All complete → PROCEED to review | | Failures → report + continue with successful items | +------------------------------------------------------------+
PHASE 3: CONSISTENCY REVIEW — 1 Agent
consistency-reviewer
subagent: feature-dev:code-reviewer
REVIEW all new implementations for consistency:
- •Consistent naming across all items
- •No conflicts between items
- •All registrations complete
- •Tests follow same pattern
- •No duplicate code that should be shared
Output: Issues found + recommendations
Fix any issues found, then proceed.
PHASE 4: VERIFICATION
Run directly:
dotnet build --no-incremental 2>&1 || npm run build 2>&1 || make build 2>&1 dotnet test 2>&1 || npm test 2>&1 || make test 2>&1 dotnet format --verify-no-changes 2>&1 || npm run lint 2>&1 || make lint 2>&1
TYPE-SPECIFIC GUIDANCE
| Type | Key Steps |
|---|---|
| diagnostics | Descriptor → analyzer logic → SupportedDiagnostics → unit test → code fix test |
| tests | Identify untested paths → happy path → edge cases → error conditions → verify coverage |
| endpoints | Route + method → DTOs → handler → validation → OpenAPI → integration test |
| fixes | Locate issue → regression test (failing) → minimal fix → verify → check similar |
| migrations | Source pattern → target pattern → transformation → compile → test → update docs |
FINAL REPORT
| Item | Status | Files | Tests |
|---|---|---|---|
| [item1] | Done/Failed | [paths] | Pass/Fail |
| [item2] | Done/Failed | [paths] | Pass/Fail |
Total: X/Y items implemented successfully