mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-05 16:13:08 +08:00
- Implemented the 'monitor' command for coordinator role to handle monitoring events, task completion, and pipeline management. - Created role specifications for the coordinator, detailing responsibilities, command execution protocols, and session management. - Added role specifications for the analyst, discussant, explorer, and synthesizer in the ultra-analyze skill, defining their context loading, analysis, and synthesis processes.
3.2 KiB
3.2 KiB
prefix, inner_loop, message_types
| prefix | inner_loop | message_types | ||||
|---|---|---|---|---|---|---|
| FIX | true |
|
Code Fixer
Fix code based on reviewed findings. Load manifest, plan fix groups, apply with rollback-on-failure, verify. Code-generation role -- modifies source files.
Phase 2: Context & Scope Resolution
| Input | Source | Required |
|---|---|---|
| Task description | From task subject/description | Yes |
| Session path | Extracted from task description | Yes |
| Fix manifest | /fix/fix-manifest.json | Yes |
| Review report | /review/review-report.json | Yes |
| .msg/meta.json | /.msg/meta.json | No |
- Extract session path, input path from task description
- Load manifest (scope, source report path) and review report (findings with enrichment)
- Filter fixable findings: severity in scope AND fix_strategy !== 'skip'
- If 0 fixable -> report complete immediately
- Detect quick path: findings <= 5 AND no cross-file dependencies
- Detect verification tools: tsc (tsconfig.json), eslint (package.json), jest (package.json), pytest (pyproject.toml), semgrep (semgrep available)
- Load wisdom files from
<session>/wisdom/
Phase 3: Plan + Execute
3A: Plan Fixes (deterministic, no CLI)
- Group findings by primary file
- Merge groups with cross-file dependencies (union-find)
- Topological sort within each group (respect fix_dependencies, append cycles at end)
- Sort groups by max severity (critical first)
- Determine execution path: quick_path (<=5 findings, <=1 group) or standard
- Write
<session>/fix/fix-plan.json:{plan_id, quick_path, groups[{id, files[], findings[], max_severity}], execution_order[], total_findings, total_groups}
3B: Execute Fixes
Quick path: Single code-developer agent for all findings. Standard path: One code-developer agent per group, in execution_order.
Agent prompt includes: finding list (dependency-sorted), file contents (truncated 8K), critical rules:
- Apply each fix using Edit tool in order
- After each fix, run related tests
- Tests PASS -> finding is "fixed"
- Tests FAIL ->
git checkout -- {file}-> mark "failed" -> continue - No retry on failure. Rollback and move on
- If finding depends on previously failed finding -> mark "skipped"
Agent returns JSON: {results:[{id, status: fixed|failed|skipped, file, error?}]}
Fallback: check git diff per file if no structured output.
Write <session>/fix/execution-results.json: {fixed[], failed[], skipped[]}
Phase 4: Post-Fix Verification
- Run available verification tools on modified files:
| Tool | Command | Pass Criteria |
|---|---|---|
| tsc | npx tsc --noEmit |
0 errors |
| eslint | npx eslint <files> |
0 errors |
| jest | npx jest --passWithNoTests |
Tests pass |
| pytest | pytest --tb=short |
Tests pass |
| semgrep | semgrep --config auto <files> --json |
0 results |
- If verification fails critically -> rollback last batch
- Write
<session>/fix/verify-results.json - Generate
<session>/fix/fix-summary.json:{fix_id, fix_date, scope, total, fixed, failed, skipped, fix_rate, verification} - Generate
<session>/fix/fix-summary.md(human-readable) - Update
<session>/.msg/meta.jsonwith fix results - Contribute discoveries to
<session>/wisdom/files