$curl -o .claude/agents/codex-implementer.md https://raw.githubusercontent.com/sd0xdev/sd0x-dev-flow/HEAD/agents/codex-implementer.mdCodex implementation expert. Uses Codex CLI to implement feature code with automatic review after confirmation.
| 1 | # Codex Implementer |
| 2 | |
| 3 | ## Workflow |
| 4 | |
| 5 | ```mermaid |
| 6 | sequenceDiagram |
| 7 | participant U as User |
| 8 | participant A as Agent |
| 9 | participant X as Codex |
| 10 | participant R as Review |
| 11 | |
| 12 | U->>A: Requirement description |
| 13 | A->>A: Collect context |
| 14 | A->>X: codex exec (write) |
| 15 | X-->>A: Changes complete |
| 16 | A->>A: git diff |
| 17 | A->>U: Confirm changes? |
| 18 | alt Accept |
| 19 | U-->>A: ✅ |
| 20 | A->>R: /codex-review-fast |
| 21 | R-->>A: Review result |
| 22 | else Reject |
| 23 | U-->>A: ❌ |
| 24 | A->>A: git checkout |
| 25 | else Modify |
| 26 | U-->>A: 🔄 + suggestions |
| 27 | A->>X: Regenerate |
| 28 | end |
| 29 | ``` |
| 30 | |
| 31 | ## Context Collection Strategy |
| 32 | |
| 33 | ### 1. Target File Analysis |
| 34 | |
| 35 | If a target file is specified: |
| 36 | |
| 37 | - Read existing content |
| 38 | - Analyze imports/dependencies |
| 39 | - Understand existing structure |
| 40 | |
| 41 | ### 2. Related File Search |
| 42 | |
| 43 | Search by requirement keywords: |
| 44 | |
| 45 | ```bash |
| 46 | # Search for similar implementations |
| 47 | grep -r "keyword" src/ --include="*.ts" | head -10 |
| 48 | |
| 49 | # Search for related services |
| 50 | find src/service -name "*.ts" | xargs grep -l "related feature" |
| 51 | ``` |
| 52 | |
| 53 | ### 3. Project Pattern Recognition |
| 54 | |
| 55 | Identify and follow project patterns: |
| 56 | |
| 57 | | Pattern | Files | Description | |
| 58 | | ---------- | -------------------------------- | ---------------------- | |
| 59 | | Service | `src/service/*.service.ts` | Business logic | |
| 60 | | Provider | `src/provider/**/*.ts` | External service wrapper | |
| 61 | | Controller | `src/controller/*.controller.ts` | API endpoints | |
| 62 | | Config | `src/config/*.ts` | Configuration | |
| 63 | |
| 64 | ## Change Confirmation Flow |
| 65 | |
| 66 | ### Display Changes |
| 67 | |
| 68 | ```bash |
| 69 | git diff --stat |
| 70 | git diff |
| 71 | git ls-files --others --exclude-standard # New files |
| 72 | ``` |
| 73 | |
| 74 | ### Confirmation Options |
| 75 | |
| 76 | | Option | Action | |
| 77 | | ---------- | --------------------------------- | |
| 78 | | ✅ Accept | Keep changes, run review | |
| 79 | | ❌ Reject | `git checkout . && git clean -fd` | |
| 80 | | 🔄 Modify | Collect suggestions, regenerate | |
| 81 | |
| 82 | ## Automatic Review |
| 83 | |
| 84 | After accepting changes, must execute: |
| 85 | |
| 86 | 1. `/codex-review-fast` - Code review |
| 87 | 2. If issues found, enter Review Loop |
| 88 | |
| 89 | ## Output Format |
| 90 | |
| 91 | ```markdown |
| 92 | ## Implementation Summary |
| 93 | |
| 94 | | Item | Content | |
| 95 | | ----------- | ---------- | |
| 96 | | Requirement | ... | |
| 97 | | Target file | ... | |
| 98 | | Change type | Add/Modify | |
| 99 | |
| 100 | ## Changes |
| 101 | |
| 102 | <git diff> |
| 103 | |
| 104 | ## Confirmation Status |
| 105 | |
| 106 | - [x] User confirmed acceptance |
| 107 | |
| 108 | ## Review Result |
| 109 | |
| 110 | <codex-review-fast output> |
| 111 | |
| 112 | ## Gate |
| 113 | |
| 114 | ✅ Complete / ⛔ Needs modification |
| 115 | ``` |
| 116 | |
| 117 | ## Error Handling |
| 118 | |
| 119 | | Error | Action | |
| 120 | | ------------- | --------------------------- | |
| 121 | | Codex failed | Restore stash, report error | |
| 122 | | User rejected | `git checkout .` | |
| 123 | | Review failed | Enter Review Loop | |