Arcgentic
This is the Codex-facing entry skill for Arcgentic V2.
Use this before build-feature, executing-plans, or direct coding whenever
the user asks to use Arcgentic.
Do not directly implement, test, or scaffold the requested feature from the
Orchestrator, even in a greenfield or empty project. Arcgentic work starts by
dispatching Planner.
Immediate behavior in Codex
- Treat the current thread as
Orchestrator and rename the current Codex
thread to exactly Orchestrator before dispatching any role.
- Determine whether the current thread has a real project/workspace root.
- If yes, continue with project-scoped orchestration.
- If no, stop and ask the user to open or create a saved project workspace.
- If this is the first Arcgentic V2 run in the project and no mode is already
stored, judge the user's idea before dispatching Planner:
Run:
arcgentic session-mode recommend-v2 --idea '<current user request>'
Present the recommended mode, confidence, reasons, and tradeoff in natural
language.
Ask the user to confirm the recommendation or override it.
Do not dispatch Planner until the user has chosen one project-level mode.
- The two V2 modes are:
single-session-subagent: faster and usually finishes sooner. Planner,
Developer, Test, and Auditor run as named subagents inside the current
Orchestrator session, so audit isolation is weaker. The first use of a
role creates that fixed named role identity; later rounds reuse it.
multi-session-subthread: slower. Planner, Developer, Test, and Auditor
run in fixed project threads, so role separation and external-audit
evidence are stronger.
- Use the chosen mode for the whole project. Do not ask again per round unless
the user explicitly starts a new project or requests a reset.
- In
multi-session-subthread, use the current project/workspace as the only
valid target for role threads after initialization.
- Do not create projectless Planner / Developer / Test / Auditor threads.
- Use the strongest available Codex model for real Planner / Developer /
Test / Auditor work. Do not default role threads to a lightweight or spark
model unless the user explicitly asks for a low-cost smoke test.
- Record the current thread as fixed role
Orchestrator in
.agentic-rounds/state.yaml before dispatching Planner. If the host cannot
provide the current Orchestrator thread id, stop because push-return cannot
work.
In Codex delegation-created threads, do not treat the delegation
source_thread_id as the current Orchestrator id. It identifies the upstream
supervising thread, not the project-scoped Orchestrator.
- Before reading implementation files, running tests, checking git log, or
summarizing prior work, initialize/check
.agentic-rounds/state.yaml and run
v2-session-plan.
- Initialize
.agentic-rounds/state.yaml if it does not exist.
If state exists and current_round.state is closed, treat the new user
request as input for Planner only when it asks for new work. Status,
inspection, review, or "is this complete?" requests are terminal idle and
must not rewrite active_user_request or dispatch Planner.
- Run
v2-session-plan with the user-selected mode on first use, or without
--mode after the mode is already stored:
arcgentic v2-session-plan \
--state .agentic-rounds/state.yaml \
--host codex \
--user-request '<current user request>' \
--mode <single-session-subagent|multi-session-subthread>
- If the plan is active and contains an action, dispatch that one role before
any verification or implementation inspection, then call
arcgentic v2-dispatch-role and end the Orchestrator turn in
multi-session-subthread, or create/reuse the named role agent directly in
single-session-subagent.
If state is closed and the plan has no actions, stop: the round is
terminal at the project level, all role threads are idle, and Orchestrator
should wait for a new user request.
- Load
codex-thread-orchestration and follow it.
Bootstrap if state is missing
Find the plugin root:
PLUGIN_ROOT="${ARCGENTIC_PLUGIN_ROOT:-$HOME/plugins/arcgentic}"
Then initialize state:
bash "$PLUGIN_ROOT/scripts/state/init.sh" \
--project-root . \
--project-name "$(basename "$PWD")" \
--round-naming "R<n>"
After init, update the state for V2 Codex mode:
python - <<'PY'
from pathlib import Path
import yaml
path = Path(".agentic-rounds/state.yaml")
state = yaml.safe_load(path.read_text(encoding="utf-8"))
state.setdefault("project", {})["arcgentic_v2"] = {
"host": "codex",
"role_sessions": {},
}
path.write_text(yaml.safe_dump(state, sort_keys=False), encoding="utf-8")
PY
Fail-closed rules
If arcgentic CLI is not available, report installation failure instead of
pretending Arcgentic is active.
If the current thread is projectless or cannot create project-scoped role
threads, stop.
If .agentic-rounds/state.yaml records delegation source_thread_id as the
Orchestrator session by mistake, do not create Planner. Repair only that
field with:
arcgentic v2-record-session \
--state .agentic-rounds/state.yaml \
--host codex \
--role orchestrator \
--thread-id <current-orchestrator-thread-id> \
--title Orchestrator \
--repair-current-orchestrator
If .agentic-rounds/state.yaml cannot be created or validated, stop.
If role threads cannot be created in the current project/workspace, stop.
If a role thread is slow, send at most one status/constraint-tightening
message. If it still does not return a valid RoleReturnSignal, stop with a
role-timeout status. Do not continue the workflow in the Orchestrator.
After dispatching a role prompt, call arcgentic v2-dispatch-role and end
the Orchestrator turn. The Orchestrator resumes only when the pending role
actively sends return information back to the Orchestrator thread.
If arcgentic v2-return-signal rejects the role output, stop and report the
rejected signal. Do not repair it by hand in the Orchestrator.
Do not silently fall back to "Arcgentic-style" hand-written evidence.
Do not treat "greenfield" or "empty repo" as permission for Orchestrator
implementation.
Do not verify, summarize, or inspect a previous closed round as the response
to a new implementation request. Route the request to Planner first.
Do not auto-dispatch Planner from project-level closed unless there is a
new user request. Closed without a new request means the project workflow is
stopped. Round-level PASS is not closed; it must advance through the stored
project plan.
Do not run ordinary coding work before Planner has produced or approved the
round plan.
Planner, Developer, Test, and Auditor must not mutate .agentic-rounds/state.yaml,
run transition commands, dispatch roles, consume RoleReturnSignal, or close
rounds. They write their role-owned artifacts and return natural-language
output plus one arcgentic-role-return footer for the Orchestrator to consume.
Role threads must not stop after acknowledging their role. They must complete
role-owned work in the same turn, using tools as needed, before returning
RoleReturnSignal. Developer, Test, and Auditor consume prior-role artifacts
from project.arcgentic_v2.last_signal.artifacts.
Role threads must actively wake the Orchestrator by sending their completed
natural-language output and machine footer to the recorded Orchestrator
thread. The Orchestrator must not poll role threads to discover completion.
Planner must do discovery before handoff: search GitHub or equivalent public
references for reliable comparable projects, scan local skills/plugins/MCP
servers/connectors/tools, then write the selected references and tools into a
detailed Markdown handoff. Each downstream role must read the handoff artifact
named in the Orchestrator prompt before acting.
Planner project-close returns must write a closeout artifact, create a local
closeout commit, include artifacts.closeout and artifacts.commit, and use
next_recommended_role: null. Closed projects are terminal idle unless the
user provides a genuinely new work request.
Auditor PASS fact rows must use lifecycle-stable evidence: committed
artifacts, fixed git hashes, artifact file contents, state history, and
test/build output. Do not use mutable live routing fields such as
current_round.state, project.arcgentic_v2.last_signal.role, or
project.arcgentic_v2.last_signal.state as PASS facts unless the command
reads an immutable committed snapshot.
Do not create source files, tests, handoff docs, self-audits, user-test
reports, or external audit verdicts from the Orchestrator. Those belong to
Planner, Developer, Test, and Auditor role threads.
Continue
Load and follow:
codex-thread-orchestration for Codex V2 fixed-role threads.
using-arcgentic for the general round-state vocabulary and state-machine
rules.
1---2name: arcgentic3description: Use when the user says Arcgentic, asks to use Arcgentic, or wants an idea taken through a complete plan → development → self-audit → external audit workflow in Codex.4---56# Arcgentic78This is the Codex-facing entry skill for Arcgentic V2.910Use this before `build-feature`, `executing-plans`, or direct coding whenever11the user asks to use Arcgentic.1213Do not directly implement, test, or scaffold the requested feature from the14Orchestrator, even in a greenfield or empty project. Arcgentic work starts by15dispatching Planner.1617## Immediate behavior in Codex18191. Treat the current thread as `Orchestrator` and rename the current Codex20 thread to exactly `Orchestrator` before dispatching any role.212. Determine whether the current thread has a real project/workspace root.22 - If yes, continue with project-scoped orchestration.23 - If no, stop and ask the user to open or create a saved project workspace.243. If this is the first Arcgentic V2 run in the project and no mode is already25 stored, judge the user's idea before dispatching Planner:26 - Run:2728 ```bash29 arcgentic session-mode recommend-v2 --idea '<current user request>'30 ```3132 - Present the recommended mode, confidence, reasons, and tradeoff in natural33 language.34 - Ask the user to confirm the recommendation or override it.35 - Do not dispatch Planner until the user has chosen one project-level mode.364. The two V2 modes are:37 - `single-session-subagent`: faster and usually finishes sooner. Planner,38 Developer, Test, and Auditor run as named subagents inside the current39 Orchestrator session, so audit isolation is weaker. The first use of a40 role creates that fixed named role identity; later rounds reuse it.41 - `multi-session-subthread`: slower. Planner, Developer, Test, and Auditor42 run in fixed project threads, so role separation and external-audit43 evidence are stronger.445. Use the chosen mode for the whole project. Do not ask again per round unless45 the user explicitly starts a new project or requests a reset.466. In `multi-session-subthread`, use the current project/workspace as the only47 valid target for role threads after initialization.487. Do not create projectless Planner / Developer / Test / Auditor threads.498. Use the strongest available Codex model for real Planner / Developer /50 Test / Auditor work. Do not default role threads to a lightweight or spark51 model unless the user explicitly asks for a low-cost smoke test.529. Record the current thread as fixed role `Orchestrator` in53 `.agentic-rounds/state.yaml` before dispatching Planner. If the host cannot54 provide the current Orchestrator thread id, stop because push-return cannot55 work.56 In Codex delegation-created threads, do not treat the delegation57 `source_thread_id` as the current Orchestrator id. It identifies the upstream58 supervising thread, not the project-scoped Orchestrator.5910. Before reading implementation files, running tests, checking git log, or60 summarizing prior work, initialize/check `.agentic-rounds/state.yaml` and run61 `v2-session-plan`.6211. Initialize `.agentic-rounds/state.yaml` if it does not exist.63 If state exists and `current_round.state` is `closed`, treat the new user64 request as input for Planner only when it asks for new work. Status,65 inspection, review, or "is this complete?" requests are terminal idle and66 must not rewrite `active_user_request` or dispatch Planner.6712. Run `v2-session-plan` with the user-selected mode on first use, or without68 `--mode` after the mode is already stored:6970 ```bash71 arcgentic v2-session-plan \72 --state .agentic-rounds/state.yaml \73 --host codex \74 --user-request '<current user request>' \75 --mode <single-session-subagent|multi-session-subthread>76 ```777813. If the plan is active and contains an action, dispatch that one role before79 any verification or implementation inspection, then call80 `arcgentic v2-dispatch-role` and end the Orchestrator turn in81 `multi-session-subthread`, or create/reuse the named role agent directly in82 `single-session-subagent`.83 If state is `closed` and the plan has no actions, stop: the round is84 terminal at the project level, all role threads are idle, and Orchestrator85 should wait for a new user request.8614. Load `codex-thread-orchestration` and follow it.8788## Bootstrap if state is missing8990Find the plugin root:9192```bash93PLUGIN_ROOT="${ARCGENTIC_PLUGIN_ROOT:-$HOME/plugins/arcgentic}"94```9596Then initialize state:9798```bash99bash "$PLUGIN_ROOT/scripts/state/init.sh" \100 --project-root . \101 --project-name "$(basename "$PWD")" \102 --round-naming "R<n>"103```104105After init, update the state for V2 Codex mode:106107```bash108python - <<'PY'109from pathlib import Path110import yaml111112path = Path(".agentic-rounds/state.yaml")113state = yaml.safe_load(path.read_text(encoding="utf-8"))114state.setdefault("project", {})["arcgentic_v2"] = {115 "host": "codex",116 "role_sessions": {},117}118path.write_text(yaml.safe_dump(state, sort_keys=False), encoding="utf-8")119PY120```121122## Fail-closed rules123124- If `arcgentic` CLI is not available, report installation failure instead of125 pretending Arcgentic is active.126- If the current thread is projectless or cannot create project-scoped role127 threads, stop.128- If `.agentic-rounds/state.yaml` records delegation `source_thread_id` as the129 Orchestrator session by mistake, do not create Planner. Repair only that130 field with:131132 ```bash133 arcgentic v2-record-session \134 --state .agentic-rounds/state.yaml \135 --host codex \136 --role orchestrator \137 --thread-id <current-orchestrator-thread-id> \138 --title Orchestrator \139 --repair-current-orchestrator140 ```141142- If `.agentic-rounds/state.yaml` cannot be created or validated, stop.143- If role threads cannot be created in the current project/workspace, stop.144- If a role thread is slow, send at most one status/constraint-tightening145 message. If it still does not return a valid `RoleReturnSignal`, stop with a146 role-timeout status. Do not continue the workflow in the Orchestrator.147- After dispatching a role prompt, call `arcgentic v2-dispatch-role` and end148 the Orchestrator turn. The Orchestrator resumes only when the pending role149 actively sends return information back to the Orchestrator thread.150- If `arcgentic v2-return-signal` rejects the role output, stop and report the151 rejected signal. Do not repair it by hand in the Orchestrator.152- Do not silently fall back to "Arcgentic-style" hand-written evidence.153- Do not treat "greenfield" or "empty repo" as permission for Orchestrator154 implementation.155- Do not verify, summarize, or inspect a previous closed round as the response156 to a new implementation request. Route the request to Planner first.157- Do not auto-dispatch Planner from project-level `closed` unless there is a158 new user request. Closed without a new request means the project workflow is159 stopped. Round-level PASS is not closed; it must advance through the stored160 project plan.161- Do not run ordinary coding work before Planner has produced or approved the162 round plan.163- Planner, Developer, Test, and Auditor must not mutate `.agentic-rounds/state.yaml`,164 run transition commands, dispatch roles, consume `RoleReturnSignal`, or close165 rounds. They write their role-owned artifacts and return natural-language166 output plus one `arcgentic-role-return` footer for the Orchestrator to consume.167- Role threads must not stop after acknowledging their role. They must complete168 role-owned work in the same turn, using tools as needed, before returning169 `RoleReturnSignal`. Developer, Test, and Auditor consume prior-role artifacts170 from `project.arcgentic_v2.last_signal.artifacts`.171- Role threads must actively wake the Orchestrator by sending their completed172 natural-language output and machine footer to the recorded Orchestrator173 thread. The Orchestrator must not poll role threads to discover completion.174- Planner must do discovery before handoff: search GitHub or equivalent public175 references for reliable comparable projects, scan local skills/plugins/MCP176 servers/connectors/tools, then write the selected references and tools into a177 detailed Markdown handoff. Each downstream role must read the handoff artifact178 named in the Orchestrator prompt before acting.179- Planner project-close returns must write a closeout artifact, create a local180 closeout commit, include `artifacts.closeout` and `artifacts.commit`, and use181 `next_recommended_role: null`. Closed projects are terminal idle unless the182 user provides a genuinely new work request.183- Auditor PASS fact rows must use lifecycle-stable evidence: committed184 artifacts, fixed git hashes, artifact file contents, state history, and185 test/build output. Do not use mutable live routing fields such as186 `current_round.state`, `project.arcgentic_v2.last_signal.role`, or187 `project.arcgentic_v2.last_signal.state` as PASS facts unless the command188 reads an immutable committed snapshot.189- Do not create source files, tests, handoff docs, self-audits, user-test190 reports, or external audit verdicts from the Orchestrator. Those belong to191 Planner, Developer, Test, and Auditor role threads.192193## Continue194195Load and follow:196197- `codex-thread-orchestration` for Codex V2 fixed-role threads.198- `using-arcgentic` for the general round-state vocabulary and state-machine199 rules.