Act as a meta-orchestrator with an approval gate. Assume that per-task session information and request information are managed by the base agent, and have this skill handle only pattern selection, architecture documentation, state storage, verification, and execution runner generation.
Core Workflow
- Interpret the request and confirm only the missing facts.
- Read only the necessary reference documents listed below to decide the pattern combination.
references/pattern-catalog.mdreferences/architecture-selection.mdreferences/domain-routing.mdreferences/source-index.md
command -v codex,command -v claude,command -v opencodeCheck whether it is installed.- In the current working directory,
.codex/agent-engineer/architecture.mdwrite the approval proposal to. scripts/render_architecture.pyRender the Mermaid and approval summary table with.- Present the approval proposal to the user.
- Do not create or execute an execution script before explicit approval.
- After approval,
scripts/build_runner.pygenerate the runner with. - After approval,
scripts/run_architecture.pyexecute the runner with.
Non-Negotiables
- Do not store session information and the full request text separately.
- The architecture must be
.codex/agent-engineer/architecture.mdrecorded only in. - Before approval,
build_runner.pyorrun_architecture.pydo not execute. - Do not modify the state JSON directly;
scripts/agent_state.pyuse only. - Do not improvise new state manipulation scripts.
- If the required functionality is not in the bundled scripts, separate it into a skill revision task after approval.
Path Contract
- Architecture:
.codex/agent-engineer/architecture.md - State store:
.codex/agent-engineer/store/ - State file:
.codex/agent-engineer/store/events.jsonl,.codex/agent-engineer/store/snapshot.json - Execution artifact:
.codex/agent-engineer/runs/<run-id>/
Architecture Authoring
architecture.mdis the single source of truth for human approval. Always place a machine-readable JSON code fence at the end of the document, and assume that the execution script parses only that JSON block.
The approval proposal must include the following.
- Selected base pattern and combination method
- Step-by-step execution order
- CLI used per step or role
- Model per step or role
- Degree of parallelism
- Verification policy
- Retry policy
- Delegation points
The JSON block must include the fields below.
versionapproval_statuscompositionselected_patternsenginesstepsparallel_policyretry_policyvalidation_policydelegation_policy
If the selected CLI is not installed, render_architecture.py display a warning in the output. In the current environment, codex와 claudeis usually a candidate, and opencodeselect only if installed.
Execution Discipline
After approval, the runner must enforce the invariants below.
- State changes are
agent_state.pyperformed only with. - Before and after each step,
verify_store.pycall. - Before verification passes, no task may
donetransition to. retry_policy.max_attemptsIf it exceeds,blockedtransition to and request user intervention.- Start parallel tasks only when there is no scope conflict.
- CLI or model combinations not in the approval are rejected by
invoke_agent.py.
Script Map
scripts/agent_state.py- The sole CRUD entry point of the state store
scripts/verify_store.py- Validates the event hash chain, snapshot regeneration, enums, referential integrity, approval gates, and completion transition rules
scripts/render_architecture.py- Generates Mermaid diagrams and summary tables for approval
scripts/build_runner.py- Creates the runner directory from the approved architecture
scripts/run_architecture.py- Runs the generated runner and validates the store before and after each step
scripts/invoke_agent.py- Using only approved CLI and model combinations, standardizes
codex exec,claude -p,opencodecalls
- Using only approved CLI and model combinations, standardizes
Domain Notes
Coding, research, documentation work, and operational analysis should all use the same storage structure but differ only in routing. Read only references/domain-routing.mdto decide the recommended patterns, worker roles, and validation methods per domain. For pattern selection criteria, prioritize references/architecture-selection.md.
Minimal Operating Procedure
When creating an architecture draft, follow this order.
- Classify the nature of the task.
- Select only the necessary patterns.
- Assign CLIs and models step by step.
- Determine the degree of parallelism and retry policy.
- Specify validation commands or how to prepare for validation.
render_architecture.pyAfter checking the results, request approval.
When executing, follow this order.
verify_store.pyCheck whether it passed.- Check whether the approval status is
approved. build_runner.pyto generate the runner.- After preparing the validation command, run
run_architecture.py. - Retry failed tasks only with the approved policy.