AgentSkillsCN

batch-implement

若需同时实施多个相似项目,则采用此模式:先提取模式→并行实施(每个项目分配一名代理)→开展一致性审查→进行验证。适用于端点、测试、迁移与修复等场景。

SKILL.md
--- frontmatter
name: batch-implement
description: "IF implementing multiple similar items THEN use this. Pattern extraction→parallel implement (1 agent per item)→consistency review→verify. Endpoints, tests, migrations, fixes."
allowed-tools: Task, Bash, TodoWrite

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

text
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.

  1. Launch 1 template extractor
  2. Launch 1 implementer PER ITEM in ONE message (parallel)
  3. Launch 1 consistency reviewer
  4. 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:

  1. 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

text
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:

  1. Consistent naming across all items
  2. No conflicts between items
  3. All registrations complete
  4. Tests follow same pattern
  5. No duplicate code that should be shared

Output: Issues found + recommendations

Fix any issues found, then proceed.


PHASE 4: VERIFICATION

Run directly:

bash
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

TypeKey Steps
diagnosticsDescriptor → analyzer logic → SupportedDiagnostics → unit test → code fix test
testsIdentify untested paths → happy path → edge cases → error conditions → verify coverage
endpointsRoute + method → DTOs → handler → validation → OpenAPI → integration test
fixesLocate issue → regression test (failing) → minimal fix → verify → check similar
migrationsSource pattern → target pattern → transformation → compile → test → update docs

FINAL REPORT

ItemStatusFilesTests
[item1]Done/Failed[paths]Pass/Fail
[item2]Done/Failed[paths]Pass/Fail

Total: X/Y items implemented successfully