Implement features via Codex MCP. Use when: writing new code from specs, implementing features, Codex-driven development. Not for: code review (use dhpk-change-review), architecture advice (use dhpk-codex-architect). Output: implemented code + review loop.
Scanned 9/2/2026
Install to Claude Code
npx -y skills add hmj1026/dhpk --skill dhpk-codex-implement --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Dhpk Codex Implement?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hmj1026-dhpk-codex-implement)More formats (shields.io, HTML) on the badges page.
---
name: dhpk-codex-implement
description: "Implement features via Codex MCP. Use when: writing new code from specs, implementing features, Codex-driven development. Not for: code review (use dhpk-change-review), architecture advice (use dhpk-codex-architect). Output: implemented code + review loop."
metadata:
dhpk-invocation-class: "implicit-eligible"
---
# Codex Implement Skill
## When NOT to Use
- Architecture advice only (use `/dhpk:dhpk-codex-architect`)
- Code review (use `/codex-review-fast`)
- Bug fix (use `/dhpk:dhpk-adaptive-dev-workflow` and select the Bug branch)
- Simple one-line change (edit directly)
## Workflow
```
Parse args → Decompose → Collect context → Iterate items → Review loop → Done
↕
codex → diff → confirm
↕
reject/modify → codex-reply
```
### Step 1: Parse & Decompose
**`--spec` provided**: Read spec/request doc, extract individual items.
**Arguments without `--spec`**: Use directly as single item.
**No arguments**: Ask user for requirement, target file, reference files.
Break into **implementation items** — each one logical unit (interface, method, endpoint), implementable in dependency order, small enough for one Codex call.
Present plan before starting:
```
| # | Item | Target File | Depends On |
|---|-------------------|----------------------|------------|
| 1 | Define interfaces | src/interface/x.ts | - |
| 2 | Core logic | src/service/x.ts | 1 |
| 3 | Controller/Route | src/controller/x.ts | 2 |
Proceed?
```
### Step 2: Collect Context (Claude, NOT Codex)
Claude researches the codebase before calling Codex:
1. Read `.claude/CLAUDE.md` (fallback `CLAUDE.md`) — tech stack, conventions, test commands
2. Read target file (if exists) and context files
3. Search similar implementations
4. Read 2-3 similar files for patterns
Summarize as `PROJECT_CONTEXT` for Codex.
### Step 3: Iterative Implementation
Implement **one item at a time**, in dependency order.
#### 3a: First item — new session
See `references/codex-prompts.md` for the full prompt template.
Call `mcp__codex__codex` with `sandbox: 'workspace-write'`, `approval-policy: 'on-failure'`.
**Save the returned `threadId`.**
#### 3b: Confirm each item
After each Codex call: `git diff` → ask user:
| Choice | Action |
|--------|--------|
| Accept | Proceed to next item (3c) |
| Reject | `git checkout .` affected files, re-attempt (max 2 retries, then ⛔) |
| Modify | `codex-reply` with feedback → loop back to 3b |
#### 3c: Subsequent items — same thread
Use `mcp__codex__codex-reply` with saved `threadId`. See `references/codex-prompts.md`.
Repeat 3b → 3c until all items done.
### Step 4: Final Confirmation
`git diff` full changeset → user confirms.
### Step 5: Review Loop (Codex-in-the-loop)
Auto-loop semantics: `${CLAUDE_PLUGIN_ROOT}/rules/execution-policy.md` §Anti-loop & output.
| Step | Command | On fail |
|------|---------|---------|
| 1 | `/codex-review-fast` | `codex-reply` to fix → re-review |
| 2 | `/precommit` | `codex-reply` to fix → re-run |
Issues found → **use same Codex thread to fix** (not manual). See `references/codex-prompts.md` for fix prompt.
Max 3 rounds per step. Still failing → report blocker.
#### Test Requirements
| Change Type | Required Tests |
|-------------|---------------|
| New service/provider | Unit (happy + error + edge) |
| New API endpoint | Unit + integration |
| Modified logic | Existing pass + new logic tests |
| Bug fix scenario | Regression test |
If Codex omitted tests → `codex-reply` to request them.
## Output
```markdown
## Codex Implementation Report
### Implementation Items
| # | Item | Target File | Status |
|---|------|-------------|--------|
| 1 | ... | ... | ✅/❌ |
### Change Summary
| File | Operation | Description |
|------|-----------|-------------|
| ... | Create/Modify | ... |
### Review Result
<codex-review-fast output>
### Gate
✅ Complete / ⛔ Needs modification
```
## Verification
- [ ] All items implemented and confirmed
- [ ] Tests included for each item
- [ ] `/codex-review-fast` passed
- [ ] `/precommit` passed
## Examples
```
/dhpk:dhpk-codex-implement "Add a method to calculate fees"
/dhpk:dhpk-codex-implement "Implement wallet service" --spec docs/features/wallet/2-tech-spec.md
/dhpk:dhpk-codex-implement "Add getUserBalance method" --target src/service/wallet.service.ts
/dhpk:dhpk-codex-implement "Implement cache logic" --target src/service/cache.ts --context src/service/redis.ts
```
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!