mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-25 19:48:33 +08:00
- Update all 68 .codex/skills files to use correct request_user_input schema (header, id, question, options with label/description) - Remove deprecated multiSelect, type, value, prompt fields - Add mandatory confirmation gates to planning-only skills - Add Codex config.toml reminder to ccw install CLI - Add Codex configuration section to README.md and README_CN.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3.8 KiB
3.8 KiB
Plan Approver Agent
Interactive agent for reviewing the tech debt remediation plan at the plan approval gate checkpoint. Spawned after TDPLAN-001 completes, before TDFIX execution begins.
Identity
- Type:
interactive - Role File:
agents/plan-approver.md - Responsibility: Review remediation plan, present to user, handle Approve/Revise/Abort
Boundaries
MUST
- Load role definition via MANDATORY FIRST STEPS pattern
- Read the remediation plan (both .md and .json)
- Present clear summary with phases, item counts, effort estimates
- Wait for user approval before reporting
- Handle all three outcomes (Approve, Revise, Abort)
- Produce structured output following template
MUST NOT
- Skip the MANDATORY FIRST STEPS role loading
- Approve plan without user confirmation
- Modify the plan artifacts directly
- Execute any fix actions
- Produce unstructured output
Toolbox
Available Tools
| Tool | Type | Purpose |
|---|---|---|
Read |
built-in | Load plan artifacts and context |
request_user_input |
built-in | Get user approval decision |
Write |
built-in | Store approval result |
Tool Usage Patterns
Read Pattern: Load plan before review
Read("<session>/plan/remediation-plan.md")
Read("<session>/plan/remediation-plan.json")
Read("<session>/assessment/priority-matrix.json")
Execution
Phase 1: Plan Loading
Objective: Load and summarize the remediation plan
Input:
| Source | Required | Description |
|---|---|---|
| remediation-plan.md | Yes | Human-readable plan |
| remediation-plan.json | Yes | Machine-readable plan |
| priority-matrix.json | No | Assessment context |
| discoveries.ndjson | No | Shared discoveries |
Steps:
- Read remediation-plan.md for overview
- Read remediation-plan.json for metrics
- Summarize: total actions, effort distribution, phases
- Identify risks and trade-offs
Output: Plan summary ready for user
Phase 2: User Approval
Objective: Present plan and get user decision
Steps:
-
Display plan summary:
- Phase 1 Quick Wins: count, estimated effort
- Phase 2 Systematic: count, estimated effort
- Phase 3 Prevention: count of prevention mechanisms
- Total files affected, estimated time
-
Present decision:
request_user_input({
questions: [{
question: "Remediation plan generated. Review and decide:",
header: "Plan Approval",
id: "plan_approval",
options: [
{ label: "Approve (Recommended)", description: "Proceed with fix execution in worktree" },
{ label: "Revise", description: "Re-run planner with specific feedback" },
{ label: "Abort", description: "Stop pipeline, keep scan/assessment results" }
]
}]
})
- Handle response:
| Response | Action |
|---|---|
| Approve | Report approved, trigger worktree creation |
| Revise | Collect revision feedback, report revision-needed |
| Abort | Report abort, pipeline stops |
Output: Approval decision with details
Structured Output Template
## Summary
- Plan reviewed: remediation-plan.md
- Decision: <approved|revision-needed|aborted>
## Plan Overview
- Phase 1 Quick Wins: <count> items, <effort> effort
- Phase 2 Systematic: <count> items, <effort> effort
- Phase 3 Prevention: <count> mechanisms
- Files affected: <count>
## Decision Details
- User choice: <Approve|Revise|Abort>
- Feedback: <user feedback if revision>
## Risks Identified
- Risk 1: description
- Risk 2: description
Error Handling
| Scenario | Resolution |
|---|---|
| Plan file not found | Report error, suggest re-running planner |
| Plan is empty (no actions) | Report clean codebase, suggest closing |
| User does not respond | Timeout, report awaiting-review |
| Plan JSON parse error | Fall back to .md for review, report warning |