mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +08:00
## Task -> Agent Replacement
- Replace all Task({}) calls with Agent({}) across .claude/ directory
- Update allowed-tools declarations from Task to Agent
- Update documentation references from "Task tool" to "Agent tool"
## Schema Compliance Fixes
### Agent Schema
- Add missing required `description` parameter in 6 files
- Add missing `run_in_background: false` for subagent calls
- Add missing `subagent_type` parameter
### AskUserQuestion Schema
- Fix issue-manage/SKILL.md: reduce options from 5 to 4 (max allowed)
### SendMessage Schema
- Fix team-worker.md: use correct params (type, content, summary)
- Remove invalid `team_name` parameter
### TaskCreate/TaskUpdate Schema
- Remove invalid `blockedBy`, `owner`, `status` from TaskCreate calls
- Use separate TaskUpdate calls for dependencies and ownership
- Fix TaskUpdate syntax to use object parameter
### TeamDelete Schema
- Remove parameters from TeamDelete() calls (should be no params)
### TaskOutput Schema
- Fix Python-style syntax to JavaScript object syntax
## Files Changed
- 146 files updated across commands/, skills/, skills_lib/, agents/
2.5 KiB
2.5 KiB
prefix, inner_loop, message_types
| prefix | inner_loop | message_types | ||||||
|---|---|---|---|---|---|---|---|---|
| TESTGEN | true |
|
Test Generator
Generate test code by layer (L1 unit / L2 integration / L3 E2E). Acts as the Generator in the Generator-Critic loop. Supports revision mode for GC loop iterations.
Phase 2: Context Loading
| Input | Source | Required |
|---|---|---|
| Task description | From task subject/description | Yes |
| Session path | Extracted from task description | Yes |
| Test strategy | /strategy/test-strategy.md | Yes |
| .msg/meta.json | /wisdom/.msg/meta.json | No |
- Extract session path and layer from task description
- Read test strategy:
Read("<session>/strategy/test-strategy.md")
-
Read source files to test (from strategy priority_files, limit 20)
-
Read .msg/meta.json for framework and scope context
-
Detect revision mode:
| Condition | Mode |
|---|---|
| Task subject contains "fix" or "revised" | Revision -- load previous failures |
| Otherwise | Fresh generation |
For revision mode:
- Read latest result file for failure details
- Read effective test patterns from .msg/meta.json
- Read wisdom files if available
Phase 3: Test Generation
Strategy selection by complexity:
| File Count | Strategy |
|---|---|
| <= 3 files | Direct: inline Write/Edit |
| 3-5 files | Single code-developer agent |
| > 5 files | Batch: group by module, one agent per batch |
Direct generation (per source file):
- Generate test path:
<session>/tests/<layer>/<test-file> - Generate test code: happy path, edge cases, error handling
- Write test file
Agent delegation (medium/high complexity):
Agent({
subagent_type: "code-developer",
run_in_background: false,
description: "Generate <layer> tests",
prompt: "Generate <layer> tests using <framework>...
<file-list-with-content>
<if-revision: previous failures + effective patterns>
Write test files to: <session>/tests/<layer>/"
})
Output verification:
Glob("<session>/tests/<layer>/**/*")
Phase 4: Self-Validation & State Update
Validation checks:
| Check | Method | Action on Fail |
|---|---|---|
| Syntax | tsc --noEmit or equivalent |
Auto-fix imports/types |
| File count | Count generated files | Report issue |
| Import resolution | Check broken imports | Fix import paths |
Update <session>/wisdom/.msg/meta.json under generator namespace:
- Merge
{ "generator": { test_files, layer, round, is_revision } }