codex-maintenance
Maintains the internal configuration and structural files for Cascade/Codex agents. Use this to modify agent wiring, memory, or observability.
Install
mkdir -p .claude/skills/codex-maintenance && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17263" && unzip -o skill.zip -d .claude/skills/codex-maintenance && rm skill.zipInstalls to .claude/skills/codex-maintenance
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when changing or auditing Cascade surfaces such as skills, agents, AGENTS.md, CODEX.md, .codex/config.toml, hooks, MCP/tool guidance, memory, observability, evals, handoffs, file trees, or validators.Key capabilities
- →Update configuration surfaces like AGENTS.md and CODEX.md
- →Audit Codex surface choices
- →Change Codex-specific surfaces like `.codex/config.toml`
- →Maintain skills under `.codex/skills/`
- →Ensure agent definitions and validation gates are synchronized
How it works
The skill manages and audits Codex-specific surfaces, ensuring that agent definitions, skill configurations, and validation gates are synchronized with repository goals. It follows a defined source order and surface decision rules for changes.
Inputs & outputs
When to use codex-maintenance
- →Updating agent permissions or tool guidance
- →Auditing observability and eval wiring
- →Refactoring Codex file tree structure
- →Changing local role contracts or templates
About this skill
Codex Maintenance
Use this skill when maintaining Cascade itself, auditing Codex surface
choices, or changing Codex-specific surfaces: AGENTS.md, CODEX.md,
.codex/config.toml, .codex/skills/, .codex/agents/, hooks, MCP/tool
guidance, plugin guidance, permissions, memory, observability, evals, scope,
validator wiring, or docs that define how Codex agents gather context and hand
off work.
This skill keeps harness maintenance grounded in current Codex behavior while
preserving Cascade's local role contracts, templates, rules, invariants,
checklists, and validation gates. It does not patch product/runtime code unless
the user explicitly redirects the work through implement-change.
Source Order
- Latest user request, selected text, active goal, and explicit constraints.
- Current branch, diff, untracked files, and recent local edits.
- Complete file tree and reference inventory:
rg --files -uu --hidden -g '!/.git/**'git status --short- targeted
rg -nsearches for each skill, agent, path, command, or stale reference being changed.
- Current Cascade surfaces:
AGENTS.mdCODEX.md.codex/README.md.codex/config.toml.codex/skills/*/SKILL.md.codex/agents/*.toml.codex/agents/*/AGENT.md.codex/agents/*/skills.yamldocs/structure.mddocs/patterns/_index.mddocs/patterns/{entry}/index.mddocs/patterns/{entry}/*.pack.yamldocs/work/active.mddocs/specs/docs/product/docs/design/docs/brand/docs/backlog/_index.mdscripts/cascade/validate.ts
- Official Codex guidance when Codex behavior or file placement matters:
- best practices;
- skills;
AGENTS.md;- project
.codex/config.toml; - MCP/tool configuration;
- rules and permission policies;
- hooks;
- plugins;
- subagents and custom agent files.
agents-best-practicesfor provider-neutral harness invariants before adapting them to Codex/Cascade surfaces.- Existing templates, checklists, and validator invariants before adding new artifacts.
Surface Decision Rules
- Prompt or current thread: one-off task constraints and temporary context.
AGENTS.md: durable repo conventions, commands, verification steps, review expectations, and thin pointers only.CODEX.md: Cascade route, role references, work packet rules, and write targets..codex/config.toml: trusted project-scoped Codex settings plus Cascade Codex registry values. Do not place user-only provider, credential, notification, profile, or telemetry settings here.- Skill: reusable workflow with trigger, anti-trigger, source order, outputs,
artifacts, templates, checklists, and validation rules. In Cascade,
document and maintain skills under
.codex/skills/. Treat native Codex repo-skill or plugin layouts as packaging targets, not the primary harness documentation surface. - Agent role contract: local Cascade role behavior in
.codex/agents/{name}/AGENT.md, withskills.yamlfor the role skill map. - Codex custom subagent: every standalone
.codex/agents/{name}.tomlis loaded by Codex as spawned-session configuration and therefore requires top-levelname,description, anddeveloper_instructions. Keep Cascade-only scope, delegation, path, and workflow detail in the companionAGENT.mdandskills.yaml, not in unsupported TOML tables. - Hook: lifecycle enforcement around tool calls, prompts, compaction, subagent
starts/stops, or turn-stop events. Use
hooks.jsonor inline[hooks]next to an active config layer; project hooks load only for trusted projects. - Rule: command approval policy in
rules/*.rulesnext to an active config layer when the need is controlling commands outside the sandbox. - MCP server or connector: live external data, private workspace context, or
authorized tools. Configure MCP servers in
config.tomlwith narrow tool allow/deny lists and per-tool approval modes when needed. - Plugin: installable distribution bundle for skills plus optional MCP, hooks,
app integrations, or marketplace metadata. Plugin packages require
.codex-plugin/plugin.json; repo-local marketplace entries live under.agents/plugins/marketplace.json. - Docs/patterns: reusable project-neutral rules that do not belong to one skill
or role. Pattern entries are first-level folders with
index.mdand at least one*.pack.yamlcontaining summary, routing, graph-like documents, and selectable sections; usepattern-contextfor creation, retrieval, and context-pack assembly. - Validator: mechanical checks for required files, stale paths, registered skills, agent wiring, surface contracts, and packaging invariants.
Codex Audit Rules
For every proposed Codex surface, record:
- objective;
- autonomy level;
- risk level;
- state duration;
- tool surface;
- permission gate;
- validation signal;
- owning file or artifact.
Apply these rules before approving a harness design or file change:
- Separate model responsibility from harness responsibility. The model can propose and explain; schemas, permissions, hooks, tests, and validators enforce.
- Do not rely on prompt text for a rule that must always hold. Put durable
enforcement in
.codex/config.toml, a hook, a tool contract, orscripts/cascade/validate.ts. - Keep tool contracts narrow: typed inputs, typed results, explicit error states, permission checks, and source links for live or private data.
- Make each skill trigger-focused. The description should say when to load it, not summarize every rule inside it.
- Keep skills progressively disclosed. Add references, templates, checklists, or scripts only when they prevent a real missed step or make validation deterministic.
- Keep
AGENTS.mdthin. Route inventories, long architecture notes, product facts, learned rules, and active work to the dedicated docs tree. - Treat memory as scoped context, not authority. Required team rules belong in tracked files; memory can point to them or summarize recent state.
- Define compaction and rehydration paths when a workflow spans enough context to lose source references. Handoffs must name the source files that matter.
- Require source paths for product-sensitive work. Skills that benefit from
product specs must name the relevant
docs/specs/,docs/product/,docs/design/,docs/brand/,docs/work/, and backlog sources. - Use the shared Doc Routing Decision Matrix in
docs/patterns/workflow/index.mdwhen a harness change creates, changes, validates, or closes out durable facts across product, design, brand, specs, backlog, glossary, patterns, skills, agents, config, or validator wiring. - Add planning loops only when objective, budget, checkpoint cadence, and done condition are clear.
- Prefer direct replacement of stale names, paths, and routes unless a live compatibility contract requires a temporary bridge.
- Add observability before autonomy grows: command evidence, validator output, traceable tool calls, failure probes, evals, and launch gates.
- Keep handoffs scoped: changed surfaces, reference inventory, validation evidence, unresolved risks, and next workflow entry. A handoff never replaces the source docs it cites.
Codex Structure Invariants
- Every new skill has
SKILL.mdfrontmatter withnameand trigger-focuseddescription. - Every skill used by an agent appears in that agent's
skills.yamlwith an existingsourcepath. - Every Cascade agent has Codex-compatible standalone TOML identity,
AGENT.md,skills.yaml, delegation policy, use scope, and avoid scope. - Skill, agent, config, hook, MCP, plugin, subagent, and docs changes update
scripts/cascade/validate.tswhen they add a required surface or invariant. - File-tree and reference inventories are required for changes that can miss skills, agents, templates, docs, specs, work lanes, tools, or validator references.
- Product/spec/design/brand/backlog context must stay separated by source:
product facts in
docs/product/, design facts indocs/design/, brand facts indocs/brand/, normalized specs indocs/specs/{slice-slug}/, raw sources indocs/specs/source/, execution state indocs/work/, and candidates indocs/backlog/_index.md. - Shared doc routing decisions live in
docs/patterns/workflow/index.md; reusable closeout matrices use.codex/skills/closeout/templates/doc-routing-decision.md.
Codex Documentation Basis
Use current official Codex guidance as the external source of truth for Codex behavior and surface choice:
- Best practices: start with task context, keep durable guidance in
AGENTS.md, configure Codex for the workflow, turn repeated work into skills, and validate/review changes. - Skills: keep each skill focused, make the description trigger-focused for
implicit invocation, use
SKILL.mdas the primary contract, keep optionalagents/openai.yamlmetadata aligned when present, and add scripts only when deterministic tooling is needed. Cascade documents harness skills under.codex/skills/; if a skill must be mirrored into native Codex repo-skill or plugin packaging, record that as a packaging/migration decision. AGENTS.md: keep durable repo guidance concise, practical, and scoped by directory precedence. Codex loads global and project instructions once per run/session, closest files override broader files, and large instruction chains can hitproject_doc_max_bytes.- Config: keep project-scoped Codex settings in trusted project config and
personal defaults outside the repo. Project
.codex/config.tomlcannot own provider credentials, provider routing, profiles, notification commands, or telemetry settings; keep those in user/system config. - MCP/tools: use connectors or MCP servers for live external data or actions; keep server instructions narrow, configure tools in
Content truncated.
When not to use it
- →When patching product/runtime code without explicit redirection through `implement-change`
- →When relying on prompt text for a rule that must always hold
- →When adding a new agent when a skill cleanly owns the repeated workflow
Limitations
- →The skill does not patch product/runtime code unless explicitly redirected.
- →Durable enforcement rules are not to rely on prompt text.
- →New agents should not be added when a skill already owns the workflow.
How it compares
This skill provides a structured and audited approach to maintaining the Codex harness itself, ensuring consistency and adherence to internal standards, unlike ad-hoc modifications to configuration files.
Compared to similar skills
codex-maintenance side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| codex-maintenance (this skill) | 0 | 18d | No flags | Advanced |
| skill-builder | 4 | 5mo | Review | Beginner |
| skill-name | 0 | 7mo | Review | Advanced |
| opencode-cli | 14 | 7mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
skill-builder
ruvnet
Create new Claude Code Skills with proper YAML frontmatter, progressive disclosure structure, and complete directory organization. Use when you need to build custom skills for specific workflows, generate skill templates, or understand the Claude Skills specification.
skill-name
2025Emma
What it does + when to use (activation triggers).
opencode-cli
SpillwaveSolutions
This skill should be used when configuring or using the OpenCode CLI for headless LLM automation. Use when the user asks to "configure opencode", "use opencode cli", "set up opencode", "opencode run command", "opencode model selection", "opencode providers", "opencode vertex ai", "opencode mcp servers", "opencode ollama", "opencode local models", "opencode deepseek", "opencode kimi", "opencode mistral", "fallback cli tool", or "headless llm cli". Covers command syntax, provider configuration, Vertex AI setup, MCP servers, local models, cloud providers, and subprocess integration patterns.
claude-automation-recommender
anthropics
Analyze a codebase and recommend Claude Code automations (hooks, subagents, skills, plugins, MCP servers). Use when user asks for automation recommendations, wants to optimize their Claude Code setup, mentions improving Claude Code workflows, asks how to first set up Claude Code for a project, or wants to know what Claude Code features they should use.
mcp-integration
anthropics
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Provides comprehensive guidance for integrating Model Context Protocol servers into Claude Code plugins for external tool and service integration.
hook-development
anthropics
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.