mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-26 19:56:37 +08:00
feat: migrate all codex team skills from spawn_agents_on_csv to spawn_agent + wait_agent architecture
- Delete 21 old team skill directories using CSV-wave pipeline pattern (~100+ files) - Delete old team-lifecycle (v3) and team-planex-v2 - Create generic team-worker.toml and team-supervisor.toml (replacing tlv4-specific TOMLs) - Convert 19 team skills from Claude Code format (Agent/SendMessage/TaskCreate) to Codex format (spawn_agent/wait_agent/tasks.json/request_user_input) - Update team-lifecycle-v4 to use generic agent types (team_worker/team_supervisor) - Convert all coordinator role files: dispatch.md, monitor.md, role.md - Convert all worker role files: remove run_in_background, fix Bash syntax - Convert all specs/pipelines.md references - Final state: 20 team skills, 217 .md files, zero Claude Code API residuals Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
# Fix
|
||||
|
||||
Revision workflow for bug fixes and feedback-driven changes.
|
||||
|
||||
## Workflow
|
||||
|
||||
1. Read original task + feedback/revision notes from task description
|
||||
2. Load original implementation context (files modified, approach taken)
|
||||
3. Analyze feedback to identify specific changes needed
|
||||
4. Apply fixes:
|
||||
- Agent mode: Edit tool for targeted changes
|
||||
- CLI mode: Resume previous session with fix prompt
|
||||
5. Re-validate convergence criteria
|
||||
6. Report: original task, changes applied, validation result
|
||||
|
||||
## Fix Prompt Template (CLI mode)
|
||||
|
||||
```
|
||||
PURPOSE: Fix issues in <task.title> based on feedback
|
||||
TASK:
|
||||
- Review original implementation
|
||||
- Apply feedback: <feedback text>
|
||||
- Verify fixes address all feedback points
|
||||
MODE: write
|
||||
CONTEXT: @<modified files>
|
||||
EXPECTED: All feedback points addressed, convergence criteria met
|
||||
CONSTRAINTS: Minimal changes | No scope creep
|
||||
```
|
||||
|
||||
## Quality Rules
|
||||
|
||||
- Fix ONLY what feedback requests
|
||||
- No refactoring beyond fix scope
|
||||
- Verify original convergence criteria still pass
|
||||
- Report partial_completion if some feedback unclear
|
||||
@@ -0,0 +1,63 @@
|
||||
# Implement
|
||||
|
||||
Execute implementation from task JSON via agent or CLI delegation.
|
||||
|
||||
## Agent Mode
|
||||
|
||||
Direct implementation using Edit/Write/Bash tools:
|
||||
|
||||
1. Read task.files[] as target files
|
||||
2. Read task.implementation[] as step-by-step instructions
|
||||
3. For each step:
|
||||
- Substitute [variable] placeholders with pre_analysis results
|
||||
- New file -> Write tool; Modify file -> Edit tool
|
||||
- Follow task.reference patterns
|
||||
4. Apply task.rationale.chosen_approach
|
||||
5. Mitigate task.risks[] during implementation
|
||||
|
||||
Quality rules:
|
||||
- Verify module existence before referencing
|
||||
- Incremental progress -- small working changes
|
||||
- Follow existing patterns from task.reference
|
||||
- ASCII-only, no premature abstractions
|
||||
|
||||
## CLI Delegation Mode
|
||||
|
||||
Build prompt from task JSON, delegate to CLI:
|
||||
|
||||
Prompt structure:
|
||||
```
|
||||
PURPOSE: <task.title>
|
||||
<task.description>
|
||||
|
||||
TARGET FILES:
|
||||
<task.files[] with paths and changes>
|
||||
|
||||
IMPLEMENTATION STEPS:
|
||||
<task.implementation[] numbered>
|
||||
|
||||
PRE-ANALYSIS CONTEXT:
|
||||
<pre_analysis results>
|
||||
|
||||
REFERENCE:
|
||||
<task.reference pattern and files>
|
||||
|
||||
DONE WHEN:
|
||||
<task.convergence.criteria[]>
|
||||
|
||||
MODE: write
|
||||
CONSTRAINTS: Only modify listed files | Follow existing patterns
|
||||
```
|
||||
|
||||
CLI call:
|
||||
```
|
||||
Bash(`ccw cli -p "<prompt>" --tool <tool> --mode write --rule development-implement-feature`)
|
||||
```
|
||||
|
||||
Resume strategy:
|
||||
| Strategy | Command |
|
||||
|----------|---------|
|
||||
| new | --id <session>-<task_id> |
|
||||
| resume | --resume <parent_id> |
|
||||
|
||||
RoleSpec: `.codex/skills/team-lifecycle-v4/roles/executor/role.md`
|
||||
89
.codex/skills/team-lifecycle-v4/roles/executor/role.md
Normal file
89
.codex/skills/team-lifecycle-v4/roles/executor/role.md
Normal file
@@ -0,0 +1,89 @@
|
||||
---
|
||||
role: executor
|
||||
prefix: IMPL
|
||||
inner_loop: true
|
||||
message_types:
|
||||
success: impl_complete
|
||||
progress: impl_progress
|
||||
error: error
|
||||
---
|
||||
|
||||
# Executor
|
||||
|
||||
Code implementation worker with dual execution modes.
|
||||
|
||||
## Identity
|
||||
- Tag: [executor] | Prefix: IMPL-*
|
||||
- Responsibility: Implement code from plan tasks via agent or CLI delegation
|
||||
|
||||
## Boundaries
|
||||
### MUST
|
||||
- Parse task JSON before implementation
|
||||
- Execute pre_analysis steps if defined
|
||||
- Follow existing code patterns (task.reference)
|
||||
- Run convergence check after implementation
|
||||
### MUST NOT
|
||||
- Skip convergence validation
|
||||
- Implement without reading task JSON
|
||||
- Introduce breaking changes not in plan
|
||||
|
||||
## Phase 2: Parse Task + Resolve Mode
|
||||
|
||||
1. Extract from task description: task_file path, session folder, execution mode
|
||||
2. Read task JSON (id, title, files[], implementation[], convergence.criteria[])
|
||||
3. Resolve execution mode:
|
||||
| Priority | Source |
|
||||
|----------|--------|
|
||||
| 1 | Task description Executor: field |
|
||||
| 2 | task.meta.execution_config.method |
|
||||
| 3 | plan.json recommended_execution |
|
||||
| 4 | Auto: Low -> agent, Medium/High -> codex |
|
||||
4. Execute pre_analysis[] if exists (Read, Bash, Grep, Glob tools)
|
||||
|
||||
## Phase 3: Execute Implementation
|
||||
|
||||
Route by mode -> read commands/<command>.md:
|
||||
- agent / gemini / codex / qwen -> commands/implement.md
|
||||
- Revision task -> commands/fix.md
|
||||
|
||||
## Phase 4: Self-Validation + Report
|
||||
|
||||
| Step | Method | Pass Criteria |
|
||||
|------|--------|--------------|
|
||||
| Convergence check | Match criteria vs output | All criteria addressed |
|
||||
| Syntax check | tsc --noEmit or equivalent | Exit code 0 |
|
||||
| Test detection | Find test files for modified files | Tests identified |
|
||||
|
||||
1. Write discovery to `discoveries/{task_id}.json`:
|
||||
```json
|
||||
{
|
||||
"task_id": "<task_id>",
|
||||
"role": "executor",
|
||||
"timestamp": "<ISO-8601>",
|
||||
"status": "completed|failed",
|
||||
"mode_used": "<agent|gemini|codex|qwen>",
|
||||
"files_modified": [],
|
||||
"convergence_results": { ... }
|
||||
}
|
||||
```
|
||||
2. Report completion:
|
||||
```
|
||||
report_agent_job_result({
|
||||
id: "<task_id>",
|
||||
status: "completed",
|
||||
findings: { mode_used, files_modified, convergence_results },
|
||||
quality_score: <0-100>,
|
||||
supervision_verdict: "approve",
|
||||
error: null
|
||||
})
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| Agent mode syntax errors | Retry with error context (max 3) |
|
||||
| CLI mode failure | Retry or resume with --resume |
|
||||
| pre_analysis failure | Follow on_error (fail/continue/skip) |
|
||||
| CLI tool unavailable | Fallback: gemini -> qwen -> codex |
|
||||
| Max retries exceeded | Report via report_agent_job_result with status "failed" |
|
||||
Reference in New Issue
Block a user