Codex-worker-patch-loop
Use Codex as a delegated worker to patch canonical skills or policy files directly, then verify and iterate from the main session.
Best use case
Codex-worker-patch-loop is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use Codex as a delegated worker to patch canonical skills or policy files directly, then verify and iterate from the main session.
Teams using Codex-worker-patch-loop should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/claude-worker-patch-loop/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Codex-worker-patch-loop Compares
| Feature / Agent | Codex-worker-patch-loop | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use Codex as a delegated worker to patch canonical skills or policy files directly, then verify and iterate from the main session.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Codex Worker Patch Loop
Use this when you want Codex to act as a specialist worker that directly edits files, while the main session stays as orchestrator/reviewer.
Best for:
- refining skills, workflows, policies, and route definitions
- applying a batch of structured documentation/process edits
- tightening a canonical file over several review/patch cycles
- using Codex for execution while Hermes keeps orchestration, verification, and synthesis
## When to use
Choose this pattern when:
- the work is non-trivial but file-local or small-batch
- you want Codex to make edits directly, not just give advice
- you already know the target file(s)
- you want an external worker to improve wording/structure while preserving orchestration discipline
Do not use this pattern when:
- the task needs user interaction mid-stream
- the file ownership is unclear
- many files have overlapping edits that require central conflict resolution first
## Core pattern
1. Orchestrate in the main session
- identify the exact target skill/file
- inspect current content first
- define the specific improvement scope
- keep the worker task self-contained
2. Delegate to Codex as worker
Use `delegate_task` with `acp_command: Codex` and tell Codex to:
- patch the target file directly
- avoid asking questions
- preserve current route/style
- return a concise change summary
Pass context that includes:
- exact skill/file path
- current conventions already present
- the exact sections to strengthen
- constraints such as “targeted edits only” and “do not bloat”
3. Prefer focused worker goals
Good worker goals:
- patch Step 4 with reviewer schema, synthesis, and re-review rules
- patch Step 5 with approval normalization and label discipline
- strengthen entry gate and verification-first closure path
Avoid vague goals like:
- improve this skill
- make it better
4. Verify from the main session after Codex returns
Always inspect the file after the worker completes.
Check for:
- intended sections actually present
- no accidental regressions in neighboring sections
- version/frontmatter updated if appropriate
- canonical names preserved
- wording consistent with the existing route style
Use `skill_view` and `search_files` to verify exact inserted section titles/phrases.
5. Iterate in small loops
If more improvements are needed:
- send Codex back for the next bounded patch
- do not bundle too many conceptual changes into one worker pass
- keep a verify step between worker passes
## Recommended delegate_task template
Use a worker task shaped like this:
- Goal:
Patch the canonical skill `<name>` to strengthen `<specific sections>`. Edit the file directly. Keep current style. Do not ask questions. Return a concise summary of exact changes made.
- Context:
Include:
- exact file/skill name
- current sections already present
- desired additions
- constraints like:
- preserve canonical route style
- targeted edits only
- avoid bloating too much
## Good verification pattern
After Codex returns:
1. `skill_view(name)` to inspect the current full skill
2. `search_files(pattern=...)` for the newly required section names
3. confirm version bump and description change if expected
4. synthesize the worker result into next-step recommendations
## What worked well in practice
This pattern worked well for canonical route refinement by having Codex directly patch:
- planning-route Step 4 and Step 5 gates
- execution-route early entry and verification-first checks
- delegation structure for agent-team packaging
- middle/late execution gates (TDD loop, targeted validation, adversarial review, commit/push, unified closeout)
- cross-route consistency cleanup between paired canonical skills
- creation of compact checklist companion skills derived from long canonical routes
Useful section-level additions Codex handled well:
- decision gates
- GitHub authority split
- zero-contention rules
- workstream split contracts
- reviewer output schemas
- verification-first closure checks
- prompt-pack vocabulary alignment
- closeout/result vocabulary alignment
- compact checklist extraction from canonical skills
### Paired-route pattern
For two closely related canonical files, use Codex in one of these ways:
- one worker for planning route, one worker for execution route in parallel
- then a follow-up Codex worker for cross-route consistency audit
This worked especially well for:
- `gh-work-planning`
- `gh-work-execution`
- their companion checklist skills
### Companion-checklist extraction pattern
After a canonical route becomes comprehensive, ask Codex to create a short checklist companion skill rather than over-compressing the main skill.
Use this when:
- the canonical skill is now the source of truth
- users need a live-execution checklist
- you want fast operational use without weakening the canonical route
Checklist companion rules:
- explicitly state the canonical skill remains authoritative
- keep the checklist action-oriented and short
- include trigger notes and one-screen live sequence
- do not duplicate the full decision framework
### Interrupted-worker recovery pattern
If a Codex delegate task is interrupted mid-audit or mid-review:
- launch a continuation delegate task with explicit "continue the interrupted audit" context
- keep the target files and audit scope the same
- ask for direct patches only where real inconsistencies exist
This worked well for a cross-route consistency pass after an interrupted audit.
## Pitfalls
- Do not assume the worker edited the right file without verification.
- Do not skip reading the current file first; give Codex concrete context.
- Do not ask Codex for broad “improvements” without explicit target sections.
- Do not let the worker own final synthesis; keep that in the main session.
- If a bulk patch fails, break the next worker request into smaller targeted edits.
## Decision rule
Use Codex as worker when:
- execution quality matters more than keeping all edits in the main context
- the task is patchable with clear scope
- you want the main session to remain the orchestrator and verifier
Keep Hermes as orchestrator for:
- deciding what to change next
- verifying edits
- reconciling multiple worker passes
- reporting the final state to the userRelated Skills
llm-wiki-audit-feedback-loop
Durable feedback loop for correcting llm-wiki pages without losing the correction to chat history. Use when (1) a human notices a wiki page is wrong, outdated, or contradicts a source, (2) processing the `audit/` inbox of a domain wiki, (3) reviewing what feedback has been resolved vs deferred, (4) needing to leave a comment on a specific text range that survives line- number drift. Implements the anchored-text audit file pattern from lewislulu/llm-wiki-skill, adapted for workspace-hub's domain-wiki layout under /mnt/local-analysis/llm-wiki/wikis/<domain>/. Extends the 5-op model (compile/ingest/query/lint) from research/llm-wiki with the missing `audit` op. Never silently delete feedback — rejected audits stay archived with rejection rationale.
verify-Codex-run-commit-vs-working-tree-before-closing
After a Codex implementation run, verify the claimed file set against the actual commit and working tree before treating the issue as fully complete.
extract-skills-from-Codex-sessions
Automatically extract reusable skills from Codex session transcripts using LLM analysis and wire them into a Stop hook
interactive-Codex-to-file-based-fallback
Switch from tmux/interactive Codex to file-based Codex -p execution when interactive runs fail with upstream errors or analysis-only stalls, then verify landing from git/GitHub state.
exclude-wiki-Codex-md-from-harness-line-limit-hook
Fix false-positive pre-commit failures where workspace-hub's AGENTS.md line-limit hook blocks edits to auto-generated wiki schema files under knowledge/wikis/.
overnight-worktree-Codex-noop-recovery
Recover overnight Codex worktree batches that appear to succeed but produce no artifacts; harden rerun prompts and launch commands.
codex-skill-loader-broken-symlink-recovery
Diagnose Codex startup failures in workspace-hub caused by a broken `.Codex/skills/skills` symlink and recover without misattributing the failure to issue scope.
Codex-quota-failover-to-codex-for-overnight-plan-lanes
Recover an overnight multi-worktree planning wave when some Codex lanes hit quota by relaunching only the failed lanes with Codex in the same isolated worktrees and prompt files.
background-Codex-worktree-absolute-path-launch
Prevent overnight/background Codex worker launch failures in git worktrees by using absolute prompt/log paths and immediate post-launch polling.
absolute-path-review-prompt-dispatch
Prevent adversarial review dispatch failures caused by relative prompt paths, superseded background sessions, and stale completion notices when launching Codex/Gemini review jobs.
absolute-path-review-dispatch-guard
Prevent Codex/Gemini adversarial review dispatch failures caused by relative prompt-file paths and background workdir drift.
kanban-worker
Pitfalls, examples, and edge cases for Hermes Kanban workers. The lifecycle itself is auto-injected into every worker's system prompt as KANBAN_GUIDANCE (from agent/prompt_builder.py); this skill is what you load when you want deeper detail on specific scenarios.