
Repo Task Proof Loop
- 37 installs
- 720 repo stars
- Updated April 1, 2026
- denissergeevitch/repo-task-proof-loop
Repo-local workflow that runs a spec-freeze, build, evidence, verify, and fix loop with fresh-session verification and per-task artifacts.
About
Initializes repo-local task artifacts and installs Codex/Claude subagents to run an auditable build-and-verify loop for large coding tasks. A developer uses it for non-trivial features, refactors, or migrations that need proof kept in the repo.
- Spec-freeze to fresh-session verify loop
- Installs project-scoped Codex and Claude subagents
Repo Task Proof Loop by the numbers
- 37 all-time installs (skills.sh)
- Ranked #1,169 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
- Data as of Jul 31, 2026 (Skillselion catalog sync)
npx skills add https://github.com/denissergeevitch/repo-task-proof-loop --skill repo-task-proof-loopAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 37 |
|---|---|
| repo stars | ★ 720 |
| Last updated | April 1, 2026 |
| Repository | denissergeevitch/repo-task-proof-loop ↗ |
What it does
Repo-local workflow that runs a spec-freeze, build, evidence, verify, and fix loop with fresh-session verification and per-task artifacts.
Files
Repo Task Proof Loop
Use this skill when the user wants a repeatable, auditable implementation workflow for a non-trivial coding task, especially a feature, refactor, migration, or bug fix that should leave repo-local proof in .agent/tasks/<TASK_ID>/.
All task artifacts created by this workflow must stay inside the repository.
When the examples below mention scripts/task_loop.py, that path is relative to this skill root. Run it while your shell working directory is inside the target repository.
What this skill does
1. Initializes a strict repo-local task folder under .agent/tasks/<TASK_ID>/ 2. Seeds or updates the required artifact files 3. Installs project-scoped Codex and Claude subagent templates into .codex/agents/ and .claude/agents/ 4. Updates the repo-root AGENTS.md Codex baseline plus the repo's Claude guide file (CLAUDE.md or .claude/CLAUDE.md) with a managed block that explains the workflow 5. Guides the agent through a strict loop:
- spec freeze
- builder implementation
- evidence packing
- fresh verification
- minimal fix
- fresh verification again until
PASS
See:
references/REFERENCE.mdreferences/COMMANDS.mdreferences/SUBAGENTS.mdreferences/SCHEMAS.md
Commands this skill supports
Treat the following words as commands when the user invokes this skill:
init <TASK_ID>: create.agent/tasks/<TASK_ID>/, install or refresh subagent templates, and updateAGENTS.mdplus the repo's Claude guide filefreeze <TASK_ID>: create or refinespec.mdfrom the user task, task file, and repo guidancebuild <TASK_ID>: implement the task against the frozen specevidence <TASK_ID>: create or refreshevidence.md,evidence.json, and raw artifacts without changing production codeverify <TASK_ID>: run a fresh verifier pass and writeverdict.json, plusproblems.mdwhen neededfix <TASK_ID>: apply the smallest safe fix set fromproblems.md, then refresh the evidence bundlerun <TASK_ID>: execute the full loop from spec freeze through verificationstatus <TASK_ID>: summarize current artifact status
If the user does not supply a command, infer the next step from repo state:
- If the task folder does not exist, run
initfirst. If the user clearly wants initialization only, stop there. Otherwise, afterinitsucceeds and.agent/tasks/<TASK_ID>/spec.mdexists, continue by re-evaluating repo state in the same turn. Do not overlapinitwithfreeze,build,evidence,verify,fix,validate,status, or subagent work. - If
spec.mdis missing or placeholder-only, dofreeze - If implementation is not yet complete, do
build - If evidence is stale or missing, do
evidence - If no fresh verdict exists, do
verify - If verdict is not
PASS, dofix
Initialization step
Run the bundled initializer from the repository root or current working directory inside the repo:
scripts/task_loop.py init --task-id <TASK_ID>Optional task seeding:
scripts/task_loop.py init --task-id <TASK_ID> --task-file path/to/task.md
scripts/task_loop.py init --task-id <TASK_ID> --task-text "User task text"The initializer will:
- resolve the repo root
- create
.agent/tasks/<TASK_ID>/ - create all required artifacts, including placeholders under
raw/ - install project-scoped subagent files
- insert or refresh managed workflow blocks in
AGENTS.mdand the repo's Claude guide file
For Codex, the initializer keeps its managed workflow block in the repo-root AGENTS.md. Codex also supports AGENTS.override.md and configured fallback guide filenames; nested files closer to the code still take precedence, and this skill intentionally does not overwrite them. If init creates or rewrites AGENTS.md during a running Codex session, start a new Codex session before relying on the updated instructions. Codex snapshots project-doc guidance at session start.
For Claude Code, the initializer keeps its managed workflow block in the repo-root CLAUDE.md. Claude Code also supports .claude/CLAUDE.md, .claude/rules/*.md, and CLAUDE.local.md, but this skill treats root CLAUDE.md as the primary project guide because Claude surfaces it directly.
In Claude Code, if init just wrote or refreshed .claude/agents/* during the current session, do not assume those updated agents are already available mid-session.
Treat init as a serial prerequisite. Never overlap it with freeze, build, evidence, verify, fix, validate, status, or child-agent spawning.
Heavy-task default workflow
For large tasks, keep the user-facing request simple. In Codex, continue serially unless the user explicitly asks for delegation or parallel agent work; after that authorization, the skill can choose the internal child setup automatically when the current product surface supports delegation and the task shape warrants it.
Preferred delegated sequence
1. Run init <TASK_ID> if needed. Wait for it to finish, then confirm .agent/tasks/<TASK_ID>/spec.md and the repo-local task structure exist before continuing. 2. Only after init completes, spawn exactly one spec-freezer subagent and wait for it 3. Spawn exactly one builder subagent and let it implement 4. Continue with the same builder session for evidence packing 5. Spawn exactly one fresh verifier subagent and wait for it 6. If verdict is not PASS, spawn exactly one fixer subagent 7. Spawn one fresh verifier subagent again 8. Repeat steps 6-7 until the verifier returns PASS or the user stops the loop
Codex adaptive fan-out
Use this only after the user has explicitly authorized Codex delegation and the task is broad enough to benefit from bounded parallel work. Use the simpler serial sequence above for narrow tasks.
Good fits:
- multiple independent codebase questions must be answered before the spec is stable
- implementation can be split into disjoint write scopes
- proof requires several independent read-only checks across different surfaces
Codex pattern:
1. init stays serial. 2. If the task is still ambiguous, fan out up to 3 built-in explorer children in parallel. Give each one a single question, subsystem, or path scope. Wait for them, then freeze the spec. 3. Spawn one spec-freezer child and wait for it. 4. Spawn one task-builder child as the integration owner. 5. If implementation splits cleanly, the parent may also spawn bounded built-in worker children in parallel. Each worker must have explicit file or module ownership and must not write evidence.md, evidence.json, verdict.json, or problems.md. 6. Use send_input or the equivalent follow-up surface to keep the integration builder alive for evidence packing. The builder remains the single owner of the evidence bundle. 7. If extra proof is needed, the parent may fan out a small bounded set of read-only explorer children to rerun disjoint checks or inspect separate proof gaps in parallel. Those children may report commands, outputs, and findings, but they do not write verdict.json. 8. Run exactly one fresh verifier child for each verify pass.
Platform behavior
- In Codex, keep the normal path serial and auto-mode-first after
init. Avoid surfacing delegation internals unless they materially affect the work. - In Codex, spawn bounded subagents only when the user explicitly asks for sub-agents, delegation, or parallel agent work.
- In Codex, once delegation is authorized, the skill may choose the matching child roles and whether to stay one-child-at-a-time or use bounded fan-out. The user should not need to name specific child roles or slash commands.
- In Codex, child spawning is still an explicit parent-orchestrator action. If the current Codex surface blocks delegation, say so briefly only when it materially affects the work, then continue serially.
- In Codex, keep the task tree shallow. The parent session should spawn research, builder, fixer, and verifier children directly instead of asking one custom task child to orchestrate more children.
- In Codex, once delegation is authorized, choose between one-child-at-a-time delegation and bounded fan-out from the frozen spec, repo shape, and current delegation surface. Keep
init, evidence ownership, and every verifier pass serialized either way. - In Codex, keep helper fan-out modest and wave-based. Prefer up to 3 parallel helper children at once, wait for that wave to finish, then decide the next phase.
- In Codex, built-in
exploreris the first choice for read-only repo discovery and proof probes. Built-inworkeris appropriate for bounded disjoint implementation or check reruns when you can assign explicit ownership. - In Codex, reuse the live builder child for evidence packing by sending it a follow-up instruction. Verifier passes must use a fresh child or fresh session; do not satisfy verifier freshness by resuming an earlier verifier. Builder and fixer children can be reused or resumed when you intentionally want that context back.
- In Codex, inspect the current child-thread list before reusing or resuming a child. Use
/agentin Codex CLI or any equivalent child-thread inventory surface available in the current Codex product surface. - In Codex, the plan/todo checklist UI from
update_planis optional session guidance only. It is useful for live progress display, but it is not the source of truth for this workflow. - In Claude Code, the skill should decide whether to stay on the main thread or let the main Claude session auto-delegate the current phase to a matching built-in or project subagent after
init. The user should not need to request a specific Claude subagent or delegation mode separately. - In Claude Code, TodoWrite or the visible task/todo UI is optional session-scoped progress display only. It can help with live tracking in the current session, but it is not the source of truth for this workflow.
- In Claude Code, prefer the installed project subagents from
.claude/agents/, with descriptions written as proactive trigger conditions for the matching proof-loop phase. Claude's main session routes by the task request, subagent descriptions, and current context, so keep each phase prompt clear in natural language. Reuse the same builder child for the evidence step by default. Only run a fresh builder in evidence-only mode if the original builder session is unavailable or you intentionally discarded it. Ifinitjust refreshed.claude/agents/*during the current Claude session, fall back to the main thread or already-visible agents instead of assuming the refreshed ones are available immediately. - In Claude Code, keep the orchestration flat: main-session auto-delegation is fine, but the proof-loop workflow agents themselves are leaf roles. The parent session should own the proof-loop phase transitions instead of asking one custom task agent to spawn another.
- In Claude Code, the canonical durable state is always the repo-local artifact set under
.agent/tasks/<TASK_ID>/, especiallyspec.md,evidence.md,evidence.json,verdict.json, andproblems.md. - If subagents are unavailable, preserve the same role separation across separate sessions or clear mode changes in the current session.
Use the exact role prompts from references/COMMANDS.md.
Spec freeze requirements
spec.md must contain at least:
- original task statement
- explicit acceptance criteria labeled
AC1,AC2, ... - constraints
- non-goals
It may also include:
- repo guidance sources
- verification plan
- assumptions resolved narrowly from the user request
Do not edit production code during spec freeze.
Evidence packing requirements
evidence.md and evidence.json must judge each acceptance criterion independently with one of:
PASSFAILUNKNOWN
Evidence packing may run missing checks, but it must not keep changing production code.
Every PASS must cite concrete proof such as:
- file paths
- commands run
- exit codes
- output summaries
- artifact paths under
raw/
Do not claim overall PASS in the evidence bundle unless every acceptance criterion is PASS.
Fresh verification requirements
The verifier must be a fresh session or fresh subagent. In Codex, do not satisfy this requirement by resuming a prior verifier child.
The verifier must judge the current repository state and current rerun results, not the builder narrative.
The verifier writes:
.agent/tasks/<TASK_ID>/verdict.json.agent/tasks/<TASK_ID>/problems.mdonly when overall verdict is notPASS
problems.md must include, for each non-PASS criterion:
- criterion id and text
- status
- why it is not proven
- minimal reproduction steps
- expected vs actual
- affected files
- smallest safe fix
- corrective hint in 1-3 sentences
The verifier must not modify production code or backfill the evidence bundle.
Fixer requirements
The fixer reads only:
spec.mdverdict.jsonproblems.md
The fixer must:
- reconfirm each listed problem in the codebase before editing
- make the smallest safe change set
- avoid regressing already-passing criteria
- regenerate
evidence.md,evidence.json, and raw artifacts - stop without writing final sign-off
Validation
Before claiming the workflow is correctly initialized or the artifact set is complete, run:
scripts/task_loop.py validate --task-id <TASK_ID>Run validate only after init has fully finished. If it reports initialization in progress, wait and rerun it instead of treating that result as stable task failure.
For a quick summary:
scripts/task_loop.py status --task-id <TASK_ID>Run status only after init has fully finished when you need stable task state. If it reports init_in_progress: true, treat that as a retry-later condition.
Guardrails
- Keep
.agent/tasks/<TASK_ID>/inside the repo - Treat the Codex todo/checklist UI as ephemeral progress only; the durable workflow state lives in
.agent/tasks/<TASK_ID>/ - Never claim task completion unless every acceptance criterion is
PASS - Separate evaluator and fixer roles
- Keep Codex fan-out shallow and bounded. Parallel helpers may inform the proof loop, but one builder still owns evidence and one fresh verifier still owns verdict.
- Keep the verifier fresh
- Prefer the smallest defensible diffs during fixes
- Preserve existing user guidance outside the managed blocks in
AGENTS.mdand the repo's chosen Claude guide file
.DS_Store
__pycache__/
*.py[cod]
.pytest_cache/
.agent/
.codex/
.claude/
.idea/
<!-- repo-task-proof-loop:start -->
Repo task proof loop
For substantial features, refactors, and bug fixes, use the repo-task-proof-loop workflow.
Required artifact path:
- Keep all task artifacts in
.agent/tasks/<TASK_ID>/inside this repository.
Required sequence: 1. Freeze .agent/tasks/<TASK_ID>/spec.md before implementation. 2. Implement against explicit acceptance criteria (AC1, AC2, ...). 3. Create evidence.md, evidence.json, and raw artifacts. 4. Run a fresh verification pass against the current codebase and rerun checks. 5. If verification is not PASS, write problems.md, apply the smallest safe fix, and reverify.
Hard rules:
- Do not claim completion unless every acceptance criterion is
PASS. - Verifiers judge current code and current command results, not prior chat claims.
- Fixers should make the smallest defensible diff.
- For broad Codex tasks, bounded fan-out is allowed only after
init, only when the user has explicitly asked for delegation or parallel agent work, and only when task shape warrants it: use boundedexplorerchildren before or after spec freeze, use boundedworkerchildren only after the spec is frozen, keep the task tree shallow, keep evidence ownership with one builder, and keep verdict ownership with one fresh verifier. - This root
AGENTS.mdblock is the repo-wide Codex baseline. More-specific nestedAGENTS.override.mdorAGENTS.mdfiles still take precedence for their directory trees. - Keep this block lean. If the workflow needs more Codex guidance, prefer nested
AGENTS.md/AGENTS.override.mdfiles or configured fallback guide docs instead of expanding this root block indefinitely.
Installed workflow agents:
.codex/agents/task-spec-freezer.toml.codex/agents/task-builder.toml.codex/agents/task-verifier.toml.codex/agents/task-fixer.toml
<!-- repo-task-proof-loop:end -->
interface:
display_name: "Repo Task Proof Loop"
short_description: "Init repo-local task artifacts, install role-specific subagents, and drive spec → build → evidence → verify → fix loops."
default_prompt: "Use $repo-task-proof-loop to initialize or inspect the matching repo-local task first. Treat init as a serial prerequisite. Do not run validate or status until init has fully finished. After init succeeds and .agent/tasks/<TASK_ID>/spec.md exists, freeze the spec before coding. In Codex, keep the normal path serial and auto-mode-first. Spawn child agents only if the user explicitly asks for sub-agents, delegation, or parallel agent work; once that authorization exists, choose the appropriate role, explorer, or worker children from the frozen spec, repo shape, and current delegation surface, keep one integration builder responsible for evidence, inspect existing child threads before reuse or resume, and keep every verifier pass fresh."
policy:
allow_implicit_invocation: false
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "EvidenceBundle",
"type": "object",
"required": [
"task_id",
"overall_status",
"acceptance_criteria",
"changed_files",
"commands_for_fresh_verifier",
"known_gaps"
],
"properties": {
"task_id": {
"type": "string"
},
"overall_status": {
"enum": [
"PASS",
"FAIL",
"UNKNOWN"
]
},
"acceptance_criteria": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"text",
"status",
"proof",
"gaps"
],
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"status": {
"enum": [
"PASS",
"FAIL",
"UNKNOWN"
]
},
"proof": {
"type": "array"
},
"gaps": {
"type": "array"
}
}
}
},
"changed_files": {
"type": "array",
"items": {
"type": "string"
}
},
"commands_for_fresh_verifier": {
"type": "array",
"items": {
"type": "string"
}
},
"known_gaps": {
"type": "array",
"items": {
"type": "string"
}
}
}
}{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "VerifierVerdict",
"type": "object",
"required": [
"task_id",
"overall_verdict",
"criteria",
"commands_run",
"artifacts_used"
],
"properties": {
"task_id": {
"type": "string"
},
"overall_verdict": {
"enum": [
"PASS",
"FAIL",
"UNKNOWN"
]
},
"criteria": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"status",
"reason"
],
"properties": {
"id": {
"type": "string"
},
"status": {
"enum": [
"PASS",
"FAIL",
"UNKNOWN"
]
},
"reason": {
"type": "string"
}
}
}
},
"commands_run": {
"type": "array",
"items": {
"type": "string"
}
},
"artifacts_used": {
"type": "array",
"items": {
"type": "string"
}
}
}
}---
name: task-builder
description: Use proactively when implementing a frozen repo-task-proof-loop task and when resuming that same task in evidence mode
disallowedTools: Agent
maxTurns: 200
---
You are the task-builder.
Supported modes:
1. BUILD
2. EVIDENCE
Interpret the parent instruction to determine the mode.
- If the instruction says `PACK EVIDENCE`, `EVIDENCE MODE`, or `EVIDENCE-ONLY`, switch to EVIDENCE mode.
- Otherwise assume BUILD mode.
- In Claude Code, expect the parent to resume this same agent for EVIDENCE mode unless that original builder session is unavailable.
- You are a leaf workflow role in a flat proof loop. Do not try to orchestrate other agents.
- TodoWrite or the visible task/todo UI is optional session-scoped progress display only. Do not treat it as the canonical record for this workflow.
- The canonical durable workflow state is the repo-local artifact set under `.agent/tasks/<TASK_ID>/`.
In BUILD mode:
- Read `.agent/tasks/<TASK_ID>/spec.md` and repo guidance files if present.
- Implement against the frozen spec.
- Make the smallest safe change set.
- Run focused checks as needed.
- Keep unrelated files untouched.
- Do not write `verdict.json` or `problems.md`.
- Do not claim final `PASS`.
In EVIDENCE mode:
- Do not change production code.
- Reuse prior command results from this same builder session when they are still relevant.
- Create or refresh `evidence.md`, `evidence.json`, and raw artifacts under `.agent/tasks/<TASK_ID>/`.
- For each acceptance criterion, emit `PASS`, `FAIL`, or `UNKNOWN`.
- Every `PASS` must cite concrete proof.
- Overall `PASS` only if every acceptance criterion is `PASS`.
Keep all workflow artifacts inside the repository under `.agent/tasks/`.
---
name: task-fixer
description: Use proactively when a repo-task-proof-loop verifier reports FAIL or UNKNOWN and a minimal repair plus refreshed evidence is needed
disallowedTools: Agent
maxTurns: 150
---
You are the task-fixer.
Read only:
- `.agent/tasks/<TASK_ID>/spec.md`
- `.agent/tasks/<TASK_ID>/verdict.json`
- `.agent/tasks/<TASK_ID>/problems.md`
Behavior:
- You are a leaf workflow role in a flat proof loop. Complete the repair directly instead of trying to hand off the task.
- Reconfirm each listed problem in the codebase before editing.
- Make the smallest safe change set.
- Avoid regressing already-passing criteria.
- Rerun only the relevant checks.
- TodoWrite or the visible task/todo UI is optional session-scoped progress display only. Do not treat it as the canonical record for this workflow.
- The canonical durable workflow state is the repo-local artifact set under `.agent/tasks/<TASK_ID>/`.
- Regenerate `evidence.md`, `evidence.json`, and raw artifacts.
- Do not write final sign-off.
- Do not write `verdict.json`.
Keep all workflow artifacts inside the repository under `.agent/tasks/`.
---
name: task-spec-freezer
description: Use proactively when a repo task needs `.agent/tasks/<TASK_ID>/spec.md` frozen before implementation with explicit acceptance criteria and constraints
disallowedTools: Agent
maxTurns: 50
---
You are the task-spec-freezer.
Primary output:
- `.agent/tasks/<TASK_ID>/spec.md`
Behavior:
- Read the task source, repo guidance (`AGENTS.md`, root `CLAUDE.md`, `.claude/CLAUDE.md`, and relevant `.claude/rules/*.md` files if present), and only the minimum relevant code needed to freeze the spec.
- Use the currently available Claude Code read/search tools in this session rather than assuming a fixed tool menu.
- You are a leaf workflow role in a flat proof loop. Complete only spec freeze for this task.
- TodoWrite or the visible task/todo UI is optional session-scoped progress display only. Do not treat it as the canonical record for this workflow.
- The canonical durable workflow state is the repo-local artifact set under `.agent/tasks/<TASK_ID>/`.
- Preserve the original task statement.
- Produce explicit acceptance criteria labeled `AC1`, `AC2`, ...
- Include constraints and non-goals.
- Add a concise verification plan.
- Resolve ambiguity narrowly and record assumptions.
- Do not change production code.
- Do not write `evidence.json`, `verdict.json`, or `problems.md`.
- Keep all workflow artifacts inside the repository under `.agent/tasks/`.
---
name: task-verifier
description: Use proactively when you need a fresh verification pass that judges the current codebase and writes verdict.json plus problems.md when needed
disallowedTools: Agent
maxTurns: 100
---
You are the task-verifier.
Primary outputs:
- `.agent/tasks/<TASK_ID>/verdict.json`
- `.agent/tasks/<TASK_ID>/problems.md` only when the overall verdict is not `PASS`
Behavior:
- You are not the implementer.
- You are a leaf workflow role in a flat proof loop. Complete verification directly instead of trying to hand off the task.
- Read `spec.md` and the evidence bundle, then independently inspect the current codebase and rerun verification.
- Use the currently available verification surface directly. Rerun commands, and if browser or MCP tools are available and relevant, use them.
- TodoWrite or the visible task/todo UI is optional session-scoped progress display only. Do not treat it as the canonical record for this workflow.
- The canonical durable workflow state is the repo-local artifact set under `.agent/tasks/<TASK_ID>/`.
- Judge the current repository state and current command results, not prior chat claims.
- `PASS` an acceptance criterion only if it is proven now.
- Use `FAIL` when contradicted, broken, or incomplete.
- Use `UNKNOWN` when it cannot be verified locally.
- Do not modify production code.
- Do not patch evidence files to make them look complete.
For each non-`PASS` acceptance criterion in `problems.md` include:
- criterion id and text
- status
- why it is not proven
- minimal reproduction steps
- expected vs actual
- affected files
- smallest safe fix
- corrective hint in 1-3 sentences
name = "task-builder"
description = "Use when the parent needs a frozen task implemented, or wants the same builder context to package evidence."
nickname_candidates = ["Builder", "Implementer", "Assembler"]
developer_instructions = """
You are the task-builder.
The parent message provides the active TASK_ID and mode. Treat `<TASK_ID>` as that value.
Follow the in-scope Codex project instructions already loaded for this child session.
If you move into a deeper directory or outside the parent's current scope, check for more-specific `AGENTS.override.md`, `AGENTS.md`, or configured fallback guide files that apply to the files you read or edit.
If the parent says you are the integration owner, you may consume findings from sibling `explorer` or `worker` children, but validate them before treating them as satisfied proof.
Supported modes:
1. BUILD
2. EVIDENCE
Interpret the parent instruction to determine the mode.
- If the instruction says PACK EVIDENCE, EVIDENCE MODE, or EVIDENCE-ONLY, switch to EVIDENCE mode.
- Otherwise assume BUILD mode.
In BUILD mode:
- Read .agent/tasks/<TASK_ID>/spec.md and repo guidance files if present.
- Implement against the frozen spec.
- Make the smallest safe change set.
- Run focused checks as needed.
- Keep unrelated files untouched.
- Do not write verdict.json or problems.md.
- Do not claim final PASS.
In EVIDENCE mode:
- Do not change production code.
- Reuse prior results from this same child session when they are still relevant.
- Stay the single writer of evidence.md and evidence.json even if sibling helpers gathered some of the raw outputs.
- Create or refresh evidence.md, evidence.json, and raw artifacts under .agent/tasks/<TASK_ID>/.
- For each acceptance criterion, emit PASS, FAIL, or UNKNOWN.
- Every PASS must cite concrete proof.
- Overall PASS only if every acceptance criterion is PASS.
Keep all workflow artifacts inside the repository under .agent/tasks/.
"""
name = "task-fixer"
description = "Use when the parent needs the smallest safe fix for verifier-reported gaps, then refreshed evidence."
nickname_candidates = ["Fixer", "Repair", "Patch"]
developer_instructions = """
You are the task-fixer.
The parent message provides the active TASK_ID. Treat `<TASK_ID>` as that value.
Read only:
- .agent/tasks/<TASK_ID>/spec.md
- .agent/tasks/<TASK_ID>/verdict.json
- .agent/tasks/<TASK_ID>/problems.md
Behavior:
- Follow the in-scope Codex project instructions already loaded for this child session.
- If you move into a deeper directory or outside the parent's current scope, check for more-specific `AGENTS.override.md`, `AGENTS.md`, or configured fallback guide files that apply to the files you inspect or edit.
- If the parent hands you narrowed findings from sibling helper children or a resumed fixer session, reconfirm them in the current repository before editing.
- Reconfirm each listed problem in the codebase before editing.
- Make the smallest safe change set.
- Avoid regressing already-passing criteria.
- Rerun only the relevant checks.
- Regenerate evidence.md, evidence.json, and raw artifacts.
- Do not write final sign-off.
- Do not write verdict.json.
- Treat verifier output as a claim to recheck, not as proof.
Keep all workflow artifacts inside the repository under .agent/tasks/.
"""
name = "task-spec-freezer"
description = "Use when the parent needs a repo-task-proof-loop spec frozen into spec.md before implementation."
nickname_candidates = ["Spec Freeze", "Requirements", "Scope"]
developer_instructions = """
You are the task-spec-freezer.
The parent message provides the active TASK_ID. Treat `<TASK_ID>` as that value.
Primary output:
- .agent/tasks/<TASK_ID>/spec.md
Behavior:
- Follow the in-scope Codex project instructions already loaded for this child session.
- If you move into a deeper directory or outside the parent's current scope, check for more-specific `AGENTS.override.md`, `AGENTS.md`, or configured fallback guide files that apply to the files you inspect.
- If the parent provides findings from sibling `explorer` children, treat them as inputs to reconcile with the repository, not as proof to copy through unchanged.
- Read the task source and only the minimum relevant code needed to freeze the spec.
- Preserve the original task statement.
- Produce explicit acceptance criteria labeled AC1, AC2, ...
- Include constraints and non-goals.
- Add a concise verification plan.
- Resolve ambiguity narrowly and record assumptions.
- Do not change production code.
- Do not write evidence.json, verdict.json, or problems.md.
- Keep all workflow artifacts inside the repository under .agent/tasks/.
"""
name = "task-verifier"
description = "Use when the parent needs a fresh verification pass against the current repository state."
nickname_candidates = ["Verifier", "Audit", "Judge"]
developer_instructions = """
You are the task-verifier.
The parent message provides the active TASK_ID. Treat `<TASK_ID>` as that value.
Primary outputs:
- .agent/tasks/<TASK_ID>/verdict.json
- .agent/tasks/<TASK_ID>/problems.md only when the overall verdict is not PASS
Behavior:
- This role is intended for a fresh verification pass. Do not treat any remembered builder or fixer narrative as proof.
- Follow the in-scope Codex project instructions already loaded for this child session.
- If you move into a deeper directory or outside the parent's current scope, check for more-specific `AGENTS.override.md`, `AGENTS.md`, or configured fallback guide files that apply to the files you inspect.
- You are not the implementer.
- Read spec.md and the evidence bundle, then independently inspect the current codebase and rerun verification.
- Treat any sibling helper-child reports or raw artifacts as hints, not as proof. Source of truth is the current repository state and current rerun results.
- Judge the current repository state and current command results, not prior chat claims.
- PASS an acceptance criterion only if it is proven now.
- Use FAIL when contradicted, broken, or incomplete.
- Use UNKNOWN when it cannot be verified locally.
- Do not modify production code.
- Do not patch evidence files to make them look complete.
For each non-PASS acceptance criterion in problems.md include:
- criterion id and text
- status
- why it is not proven
- minimal reproduction steps
- expected vs actual
- affected files
- smallest safe fix
- corrective hint in 1-3 sentences
"""
{
"task_id": "{{TASK_ID}}",
"overall_status": "UNKNOWN",
"acceptance_criteria": [
{
"id": "AC1",
"text": "TODO",
"status": "UNKNOWN",
"proof": [],
"gaps": [
"Not yet populated."
]
}
],
"changed_files": [],
"commands_for_fresh_verifier": [],
"known_gaps": [
"Evidence not yet populated."
]
}# Evidence Bundle: {{TASK_ID}}
## Summary
- Overall status: UNKNOWN
- Last updated: {{CREATED_AT}}
## Acceptance criteria evidence
### AC1
- Status: UNKNOWN
- Proof:
- TODO
- Gaps:
- TODO
## Commands run
- TODO
## Raw artifacts
- .agent/tasks/{{TASK_ID}}/raw/build.txt
- .agent/tasks/{{TASK_ID}}/raw/test-unit.txt
- .agent/tasks/{{TASK_ID}}/raw/test-integration.txt
- .agent/tasks/{{TASK_ID}}/raw/lint.txt
- .agent/tasks/{{TASK_ID}}/raw/screenshot-1.png
## Known gaps
- TODO
<!-- repo-task-proof-loop:start -->
## Repo task proof loop
For substantial features, refactors, and bug fixes, use the repo-task-proof-loop workflow.
Required artifact path:
- Keep all task artifacts in `.agent/tasks/<TASK_ID>/` inside this repository.
Required sequence:
1. Freeze `.agent/tasks/<TASK_ID>/spec.md` before implementation.
2. Implement against explicit acceptance criteria (`AC1`, `AC2`, ...).
3. Create `evidence.md`, `evidence.json`, and raw artifacts.
4. Run a fresh verification pass against the current codebase and rerun checks.
5. If verification is not `PASS`, write `problems.md`, apply the smallest safe fix, and reverify.
Hard rules:
- Do not claim completion unless every acceptance criterion is `PASS`.
- Verifiers judge current code and current command results, not prior chat claims.
- Fixers should make the smallest defensible diff.
- For broad Codex tasks, bounded fan-out is allowed only after `init`, only when the user has explicitly asked for delegation or parallel agent work, and only when task shape warrants it: use bounded `explorer` children before or after spec freeze, use bounded `worker` children only after the spec is frozen, keep the task tree shallow, keep evidence ownership with one builder, and keep verdict ownership with one fresh verifier.
- This root `AGENTS.md` block is the repo-wide Codex baseline. More-specific nested `AGENTS.override.md` or `AGENTS.md` files still take precedence for their directory trees.
- Keep this block lean. If the workflow needs more Codex guidance, prefer nested `AGENTS.md` / `AGENTS.override.md` files or configured fallback guide docs instead of expanding this root block indefinitely.
Installed workflow agents:
- `.codex/agents/task-spec-freezer.toml`
- `.codex/agents/task-builder.toml`
- `.codex/agents/task-verifier.toml`
- `.codex/agents/task-fixer.toml`
<!-- repo-task-proof-loop:end -->
<!-- repo-task-proof-loop:start -->
## Repo task proof loop
For substantial features, refactors, and bug fixes, use the repo-task-proof-loop workflow.
Required artifact path:
- Keep all task artifacts in `.agent/tasks/<TASK_ID>/` inside this repository.
Required sequence:
1. Freeze `.agent/tasks/<TASK_ID>/spec.md` before implementation.
2. Implement against explicit acceptance criteria (`AC1`, `AC2`, ...).
3. Create `evidence.md`, `evidence.json`, and raw artifacts.
4. Run a fresh verification pass against the current codebase and rerun checks.
5. If verification is not `PASS`, write `problems.md`, apply the smallest safe fix, and reverify.
Hard rules:
- Do not claim completion unless every acceptance criterion is `PASS`.
- Verifiers judge current code and current command results, not prior chat claims.
- Fixers should make the smallest defensible diff.
Installed workflow agents:
- `.claude/agents/task-spec-freezer.md`
- `.claude/agents/task-builder.md`
- `.claude/agents/task-verifier.md`
- `.claude/agents/task-fixer.md`
Claude Code note:
- If `init` just created or refreshed these files during the current Claude Code session, do not assume the refreshed workflow agents are already available.
- The main Claude session may auto-delegate to these workflow agents when the current proof-loop phase matches their descriptions. If automatic delegation is not precise enough, make the current proof-loop phase more explicit in natural language.
- TodoWrite or the visible task/todo UI is optional session-scoped progress display only. The canonical durable proof-loop state is the repo-local artifact set under `.agent/tasks/<TASK_ID>/`.
- Keep this workflow flat. These generated workflow agents are role endpoints, not recursive orchestrators.
- Keep this block in the root `CLAUDE.md`. If the workflow needs longer repo guidance, prefer `@path` imports or `.claude/rules/*.md` instead of expanding this block.
<!-- repo-task-proof-loop:end -->
# Problems: {{TASK_ID}}
_No verifier findings yet._
Use this file only when `verdict.json` is not `PASS`.
## Template for each non-PASS acceptance criterion
### ACX: <criterion text>
- Status: FAIL or UNKNOWN
- Why it is not proven:
- Minimal reproduction steps:
- Expected:
- Actual:
- Affected files:
- Smallest safe fix:
- Corrective hint:
No build output captured yet.
No lint output captured yet.
No integration test output captured yet.
No unit test output captured yet.
# Task Spec: {{TASK_ID}}
## Metadata
- Task ID: {{TASK_ID}}
- Created: {{CREATED_AT}}
- Repo root: {{REPO_ROOT}}
- Working directory at init: {{WORKING_DIR}}
## Guidance sources
{{GUIDANCE_SOURCES}}
## Original task statement
{{TASK_STATEMENT}}
## Acceptance criteria
- AC1: TODO
## Constraints
- TODO
## Non-goals
- TODO
## Verification plan
- Build:
- Unit tests:
- Integration tests:
- Lint:
- Manual checks:
{
"task_id": "{{TASK_ID}}",
"overall_verdict": "UNKNOWN",
"criteria": [
{
"id": "AC1",
"status": "UNKNOWN",
"reason": "Verifier has not run yet."
}
],
"commands_run": [],
"artifacts_used": []
}<!-- repo-task-proof-loop:start -->
Repo task proof loop
For substantial features, refactors, and bug fixes, use the repo-task-proof-loop workflow.
Required artifact path:
- Keep all task artifacts in
.agent/tasks/<TASK_ID>/inside this repository.
Required sequence: 1. Freeze .agent/tasks/<TASK_ID>/spec.md before implementation. 2. Implement against explicit acceptance criteria (AC1, AC2, ...). 3. Create evidence.md, evidence.json, and raw artifacts. 4. Run a fresh verification pass against the current codebase and rerun checks. 5. If verification is not PASS, write problems.md, apply the smallest safe fix, and reverify.
Hard rules:
- Do not claim completion unless every acceptance criterion is
PASS. - Verifiers judge current code and current command results, not prior chat claims.
- Fixers should make the smallest defensible diff.
Installed workflow agents:
.claude/agents/task-spec-freezer.md.claude/agents/task-builder.md.claude/agents/task-verifier.md.claude/agents/task-fixer.md
Claude Code note:
- If
initjust created or refreshed these files during the current Claude Code session, do not assume the refreshed workflow agents are already available. - The main Claude session may auto-delegate to these workflow agents when the current proof-loop phase matches their descriptions. If automatic delegation is not precise enough, make the current proof-loop phase more explicit in natural language.
- TodoWrite or the visible task/todo UI is optional session-scoped progress display only. The canonical durable proof-loop state is the repo-local artifact set under
.agent/tasks/<TASK_ID>/. - Keep this workflow flat. These generated workflow agents are role endpoints, not recursive orchestrators.
- Keep this block in the root
CLAUDE.md. If the workflow needs longer repo guidance, prefer@pathimports or.claude/rules/*.mdinstead of expanding this block.
<!-- repo-task-proof-loop:end -->
Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
!Banner
Repo Task Proof Loop
This skill was built from OpenClaw-RL: Train Any Agent Simply by Talking and applies its proven approach to agentic flows in a repo-local workflow.
"next-state signals are universal, and policy can learn from all of them simultaneously."
Repo Task Proof Loop is a repo-local workflow skill for non-trivial coding tasks.
It creates a durable task folder under .agent/tasks/<TASK_ID>/, installs project-scoped Codex and Claude subagents, updates repo guidance, and drives a strict loop:
spec freeze -> build -> evidence -> fresh verify -> minimal fix -> fresh verify
For Codex, that loop also supports an adaptive bounded fan-out path for explorer or worker children when the task splits cleanly.
The point is simple: keep proof inside the repository, separate implementation from verification, and make task state easy to resume or audit later.
!Repo Task Proof Loop Diagram
What It Creates
Inside the target repository:
.agent/tasks/<TASK_ID>/
spec.md
evidence.md
evidence.json
raw/
build.txt
test-unit.txt
test-integration.txt
lint.txt
screenshot-1.png
verdict.json
problems.md
.codex/agents/
task-spec-freezer.toml
task-builder.toml
task-verifier.toml
task-fixer.toml
.claude/agents/
task-spec-freezer.md
task-builder.md
task-verifier.md
task-fixer.mdIt also inserts managed workflow blocks into:
- the repo-root
AGENTS.mdCodex baseline - the repo's Claude guide file:
CLAUDE.mdor.claude/CLAUDE.md
Install
Install the skill as a project skill.
Codex
.agents/skills/repo-task-proof-loop/Claude Code
.claude/skills/repo-task-proof-loop/If you use both tools on the same repository, install it in both locations or keep one canonical copy and sync it.
Quick Prompts
Use this prompt for the normal flow:
Do Task
Use $repo-task-proof-loop to do the task described below in this repository. Reuse the matching repo-local task if it already exists; if not, initialize it first and then continue automatically after init completes. You are explicitly authorized to use subagents and bounded parallel helper work when it materially helps. Choose the best internal orchestration automatically from the current task shape and tool surface. Keep the proof-loop phase explicit as you work so matching project agents can be picked automatically when the product supports that, otherwise continue on the main thread. Keep the task tree shallow, keep one integration builder responsible for evidence, and keep every verifier pass fresh.
...For all prompts, replace ... with either Task file: <path/to/task-file.md> on the next line or the task text pasted on following lines.
This skill is intentionally proof-first, so init always comes before build.
For users, the intended interaction stays simple: run Codex, mention $repo-task-proof-loop, and describe the task.
Quick Start
1. Install the skill in the repository. 2. For the normal flow, use the Do Task prompt or mention Repo Task Proof Loop ($repo-task-proof-loop) and describe the task. 3. That's it.
Helper Script
The bundled helper script currently ships three CLI commands:
init- create the repo-local task folder, artifacts, guides, and subagentsvalidatestatus- inspect an existing initialized task
The workflow phases freeze, build, evidence, verify, fix, and run are skill-level commands for the agent, not direct CLI subcommands in this package.
Set SKILL_PATH to the installed skill directory:
Codex example
SKILL_PATH=.agents/skills/repo-task-proof-loopClaude Code example
SKILL_PATH=.claude/skills/repo-task-proof-loopInitialize a task:
python3 "$SKILL_PATH/scripts/task_loop.py" init \
--task-id feature-auth-hardening \
--task-file docs/tasks/auth-hardening.mdOr seed from inline text:
python3 "$SKILL_PATH/scripts/task_loop.py" init \
--task-id feature-auth-hardening \
--task-text "Implement auth hardening for session refresh and logout."Validate:
python3 "$SKILL_PATH/scripts/task_loop.py" validate \
--task-id feature-auth-hardeningRun validate only after init completes. If it reports initialization in progress, wait and rerun.
Status:
python3 "$SKILL_PATH/scripts/task_loop.py" status \
--task-id feature-auth-hardeningUse status after init completes when you want stable task state. If it returns init_in_progress: true, retry after init finishes.
Useful options:
--guides auto|agents|claude|both|none--install-subagents both|codex|claude|none--force
With --guides auto, the initializer preserves existing guide files, but it also ensures CLAUDE.md exists whenever Claude agents are being installed and AGENTS.md exists whenever Codex agents are being installed.
Validation
The package includes a smoke test:
python3 "$SKILL_PATH/scripts/verify_package.py"It checks the skill structure, initializes temporary repositories, installs the task artifacts and subagents, and verifies the generated task bundles and guide behavior.
More Detail
The exact role prompts and platform-specific guidance live in:
references/COMMANDS.mdreferences/SUBAGENTS.mdreferences/REFERENCE.mdSKILL.md
Commands and role prompts
Use these prompts as the parent-orchestrator language when running the workflow manually or through product-specific subagents.
Replace <TASK_ID> and any placeholder text.
Codex orchestration mapping:
spawn_agent: spawn one child withagent_typeset to the role name from.codex/agents/- built-in
explorer: preferred Codex role for bounded read-only discovery and proof probes - built-in
worker: appropriate for bounded disjoint implementation or check shards when explicit ownership is possible send_input: preferred way to reuse a live builder child for evidence packingresume_agent: available when you intentionally want an older builder or fixer child back; do not use it to satisfy verifier freshness- child-thread inventory: inspect the current child list before reusing or resuming a child. In Codex CLI, use
/agent; in other Codex surfaces, use the exposed thread inventory if available. update_plan: optional way to mirror the current proof-loop step in Codex's todo/checklist UI; do not treat it as the durable workflow record- CLI surfaces:
/agentinspects or switches child threads,/statusshows session config,/reviewreviews the working tree, and/initscaffolds a genericAGENTS.mdif you are not using this skill's managed block
Claude Code note:
- Claude can automatically delegate from the main session based on the request, subagent descriptions, and current context. Write Claude-facing proof-loop prompts so the current phase is obvious.
- Claude may use TodoWrite or show a task/todo list UI for multi-step work. Treat that as optional session-scoped progress display only, not as the durable workflow record.
- The canonical proof-loop state always lives in
.agent/tasks/<TASK_ID>/.... - Keep the Claude workflow flat. These custom workflow agents are role endpoints, not recursive orchestrators.
init
Parent action:
scripts/task_loop.py init --task-id <TASK_ID> [--task-file path/to/task.md | --task-text "task text"]init is a serial prerequisite. Never overlap it with freeze, build, evidence, verify, fix, validate, status, or child-agent spawning.
After init, inspect .agent/tasks/<TASK_ID>/spec.md and confirm the repo-local structure is present. In Codex, /init is optional and separate; this skill's initializer already manages the workflow block in AGENTS.md. In Claude Code, if init just created or refreshed .claude/agents/* during the current session, do not assume those refreshed agents are already available mid-session. In Claude Code, a TodoWrite list or visible task UI after init is optional session progress only. Do not treat it as a substitute for the repo-local task files. In Claude Code, after init, normal phase prompts should stay task-focused and let Claude auto-delegate. If delegation is not specific enough, restate the phase more explicitly in natural language rather than relying on out-of-band controls.
freeze
Parent prompt for a spec-freezer subagent
Codex note:
- The child already receives in-scope
AGENTS.override.md/AGENTS.mdinstructions automatically. - If the child moves into a deeper directory or a path outside the parent's current scope, it should check for any more-specific Codex guide files that apply there.
CLAUDE.mdis not a Codex project instruction file. Only treat it as source material when the parent explicitly wants cross-tool alignment.- If the parent previously fanned out
explorerchildren, treat their reports as inputs to reconcile, not as final proof.
You are in SPEC FREEZE mode for TASK_ID <TASK_ID>.
Read:
- .agent/tasks/<TASK_ID>/spec.md
- any user-provided task file or inline task text
- only the minimum relevant code needed to freeze the spec
Write or update:
- .agent/tasks/<TASK_ID>/spec.md
Requirements:
- Preserve the original task statement
- Produce explicit acceptance criteria labeled AC1, AC2, ...
- Include constraints
- Include non-goals
- Add a concise verification plan
- Resolve ambiguity narrowly and list assumptions
- Do not change production code
- Do not write evidence, verdict, or problems filesbuild
Parent prompt for a builder subagent
Codex note:
- The child already receives in-scope
AGENTS.override.md/AGENTS.mdinstructions automatically. - If the child moves into a deeper directory or a path outside the parent's current scope, it should check for any more-specific Codex guide files that apply there.
- If the parent used parallel helper children, treat their findings or diffs as scoped inputs to validate before claiming a criterion is satisfied.
You are in BUILD mode for TASK_ID <TASK_ID>.
Read:
- .agent/tasks/<TASK_ID>/spec.md
Your job:
- Implement the task against the frozen spec
- Make the smallest safe change set that satisfies the acceptance criteria
- Run focused checks as needed
- Keep unrelated files untouched
- Do not write verdict.json or problems.md
- Do not claim final completion yet
Return to the parent with:
- files changed
- checks run
- open risksCodex adaptive helpers
Use these only after Codex delegation is explicitly authorized by the user and the task clearly splits into bounded scopes. Otherwise stay on the simpler serial proof loop.
Parent prompt for parallel explorer children
Spawn up to 3 built-in `explorer` children for TASK_ID <TASK_ID>.
Before spawning, inspect the current child-thread list and reuse an already-live scoped explorer only if it is still the right fit.
Each explorer must get exactly one scope:
- path prefix or subsystem
- question to answer
- read-only boundary
Each explorer returns only:
- scope inspected
- findings
- risks
- recommended next checks
Wait for all explorers. Then fold their findings into one spec-freezer, builder, or verifier step.Parent prompt for parallel worker children
Spawn a bounded set of built-in `worker` children for TASK_ID <TASK_ID>.
Before spawning, inspect the current child-thread list and avoid duplicating an existing scoped worker unless you intentionally want a fresh child.
For each worker, define:
- exact file or module ownership
- acceptance criteria subset or check shard
- no-touch boundaries
Rules:
- do not write .agent/tasks/<TASK_ID>/evidence.md
- do not write .agent/tasks/<TASK_ID>/evidence.json
- do not write .agent/tasks/<TASK_ID>/verdict.json
- do not write .agent/tasks/<TASK_ID>/problems.md
- report files changed and checks run back to the parent
After the workers finish, continue the primary task-builder child so it can integrate the current repo state and own evidence packing.Parent prompts for built-in helper children in Codex adaptive fan-out
Use these when the task clearly benefits from bounded parallel work and the user has already explicitly asked for delegation or parallel agent work. Once delegation is authorized, choose them from task shape and current delegation availability, keep the task tree shallow, and keep proof-loop artifact ownership with the custom task-* roles. Keep helper fan-out modest and wave-based. Prefer up to 3 parallel helper children at once, then wait before the next phase.
Built-in explorer
Spawn one built-in `explorer` child for TASK_ID <TASK_ID>.
Scope:
- <one bounded question, subsystem, or path prefix>
Rules:
- Read relevant code, tests, and guides
- Do not edit production code
- Do not write proof-loop artifacts
- Do not spawn child agents
Return only:
- paths inspected
- constraints, risks, and existing patterns
- proof or verification gaps worth folding into the spec or evidence planBuilt-in worker
Spawn one built-in `worker` child for TASK_ID <TASK_ID>.
Scope:
- <one bounded implementation or check shard>
Allowed paths:
- <explicit paths or modules>
Rules:
- Edit only the allowed paths
- Do not write .agent/tasks/<TASK_ID>/evidence.md
- Do not write .agent/tasks/<TASK_ID>/evidence.json
- Do not write .agent/tasks/<TASK_ID>/verdict.json
- Do not write .agent/tasks/<TASK_ID>/problems.md
- Do not spawn child agents
Return only:
- files changed
- checks run
- residual integration risksevidence
Follow-up prompt to the same builder session
Codex note:
- In Codex, keep the builder child alive and send this as a follow-up instruction to that same child so it can reuse its own command results.
PACK EVIDENCE for TASK_ID <TASK_ID>.
Do not change production code.
Read:
- .agent/tasks/<TASK_ID>/spec.md
- the current repository state
- any prior command results from this builder session
Write or update:
- .agent/tasks/<TASK_ID>/evidence.md
- .agent/tasks/<TASK_ID>/evidence.json
- .agent/tasks/<TASK_ID>/raw/build.txt
- .agent/tasks/<TASK_ID>/raw/test-unit.txt
- .agent/tasks/<TASK_ID>/raw/test-integration.txt
- .agent/tasks/<TASK_ID>/raw/lint.txt
- .agent/tasks/<TASK_ID>/raw/screenshot-1.png when a screenshot is useful
Rules:
- For each AC, assign PASS, FAIL, or UNKNOWN
- Every PASS must cite concrete proof
- FAIL and UNKNOWN must explain the gap
- Overall PASS only if every AC is PASS
- If sibling `explorer` or `worker` children gathered raw outputs, fold them into the evidence bundle here instead of letting each child write its own parallel evidence file
- Prefer raw artifacts over narrative prose
Return only:
- overall_status
- created or updated files
- commands a fresh verifier should rerunIn Claude Code, this follow-up is the default path. Use the fallback below only if the original builder session is unavailable or you intentionally want a fresh evidence-only run.
Fallback prompt when the original builder session is unavailable
You are in EVIDENCE-ONLY mode for TASK_ID <TASK_ID>.
Read:
- .agent/tasks/<TASK_ID>/spec.md
- the current repository state
Write the same evidence bundle as above.
Do not change production code.verify
Parent prompt for a fresh verifier subagent
Codex note:
- Spawn a brand-new verifier child or a fresh standalone session for this step.
- Do not satisfy verifier freshness by resuming an older verifier child.
- If earlier helper children gathered raw outputs, treat them as hints only. The verifier still judges the current repository state and reruns whatever it needs.
You are a strict fresh-session verifier for TASK_ID <TASK_ID>. You are not the implementer.
Read in this order:
1. .agent/tasks/<TASK_ID>/spec.md
2. .agent/tasks/<TASK_ID>/evidence.md
3. .agent/tasks/<TASK_ID>/evidence.json
Then independently inspect the current codebase and rerun verification.
Source of truth is the current repository state and current command results, not prior chat claims.
Use the currently available verification surface directly. If browser or MCP tools are available and relevant, use them rather than narrowing yourself to code reading alone.
Write:
- .agent/tasks/<TASK_ID>/verdict.json
If overall verdict is not PASS, also write:
- .agent/tasks/<TASK_ID>/problems.md
Rules:
- PASS an AC only if it is proven in the current codebase now
- FAIL if contradicted, broken, or incomplete
- UNKNOWN if it cannot be verified locally
- Overall PASS only if every AC PASS
- Do not modify production code
- Do not edit the evidence bundle
`problems.md` requirements for each non-PASS AC:
- criterion id and text
- status
- why it is not proven
- minimal reproduction steps
- expected vs actual
- affected files
- smallest safe fix
- corrective hint in 1-3 sentences
Return only:
- overall_verdict
- created files
- one-line reason for each non-PASS ACfix
Parent prompt for a fixer subagent
Codex note:
- A fresh fixer is preferred for clean role separation, but Codex does not require fixer freshness.
- Reusing or resuming a fixer child is acceptable when you intentionally want that context back.
- If the parent hands the fixer narrowed findings from prior helper children, reconfirm them in the current repository before editing.
You are a repair agent for TASK_ID <TASK_ID>.
Read only:
- .agent/tasks/<TASK_ID>/spec.md
- .agent/tasks/<TASK_ID>/verdict.json
- .agent/tasks/<TASK_ID>/problems.md
Your job:
- Reconfirm each listed FAIL or UNKNOWN condition before editing
- Make the smallest safe change set
- Avoid regressing already-passing criteria
- Rerun only the relevant checks
- Regenerate:
- .agent/tasks/<TASK_ID>/evidence.md
- .agent/tasks/<TASK_ID>/evidence.json
- updated raw artifacts
Do not:
- write verdict.json
- claim final PASS without a fresh verifier
- make broad refactors unless required to satisfy a criterion
Return only:
- files changed
- checks rerun
- remaining risksrun
Default serial order
Run this sequence strictly in order.
1. init <TASK_ID>
2. wait for init to finish, then confirm .agent/tasks/<TASK_ID>/spec.md exists
3. freeze <TASK_ID> using one spec-freezer child
4. build <TASK_ID> using one builder child
5. evidence <TASK_ID> in the same builder child by default, otherwise in evidence-only mode
6. verify <TASK_ID> using one fresh verifier child
7. if verdict is PASS, stop
8. if verdict is FAIL or UNKNOWN, run fix <TASK_ID> using one fixer child, fresh by default
9. run verify <TASK_ID> again using one fresh verifier child
10. repeat 7-9 until PASS or user stops the loopCodex adaptive fan-out path
Choose between this path and the simpler serial order automatically from the frozen spec, repo shape, and current delegation surface. Keep init, evidence ownership, and each verifier pass serialized either way.
1. init <TASK_ID>
2. wait for init to finish, then confirm .agent/tasks/<TASK_ID>/spec.md exists
3. inspect the current child-thread list with /agent in the CLI or the current product's exposed child-thread inventory surface
4. if the spec is not stable yet, fan out up to 3 built-in `explorer` children in parallel with disjoint questions or path scopes
5. wait for those explorers, then freeze <TASK_ID> using one spec-freezer child
6. spawn one task-builder child as the integration owner
7. if implementation splits cleanly, fan out bounded built-in `worker` children in parallel with explicit file or module ownership
8. continue the live builder with send_input so it integrates the current repo state, reruns focused checks, and evidence <TASK_ID>
9. if proof still needs extra read-only probes, fan out bounded built-in `explorer` children in parallel to rerun disjoint checks or inspect separate proof gaps
10. wait for those proof explorers, then run verify <TASK_ID> using one fresh verifier child
11. if verdict is PASS, stop
12. if verdict is FAIL or UNKNOWN, run fix <TASK_ID> using one fixer child, then run verify <TASK_ID> again using one fresh verifier child
13. repeat 11-12 until PASS or user stops the loopstatus
Parent action:
scripts/task_loop.py status --task-id <TASK_ID>If the repo is not yet initialized, run init first. Do not run status or validate in parallel with init; wait for init to finish first. If status reports init_in_progress: true, retry later.
Reference
When the examples below mention scripts/task_loop.py, that path is relative to this skill root. Run it while your shell working directory is inside the target repository.
This skill is designed to be portable, but the repository-local artifacts and subagent files it creates must stay in the target repository.
Recommended install locations
Codex
Project skill:
.agents/skills/repo-task-proof-loop/
Personal skill:
$HOME/.agents/skills/repo-task-proof-loop/
Claude Code
Project skill:
.claude/skills/repo-task-proof-loop/
Personal skill:
~/.claude/skills/repo-task-proof-loop/
The same skill directory can be reused in either product. The initialization script writes repo-local workflow files into the current repository, not into the skill directory.
Claude Code note:
- This skill manages its workflow block in the project-root
CLAUDE.md. - Claude Code also loads
.claude/CLAUDE.md,.claude/rules/*.md, andCLAUDE.local.md, but those remain compatible add-ons outside this skill's managed block.
Repo files created by init
.agent/tasks/TASK_ID/
spec.md
evidence.md
evidence.json
raw/
build.txt
test-unit.txt
test-integration.txt
lint.txt
screenshot-1.png
verdict.json
problems.mdThe initializer also creates or refreshes these project-level integration files:
.codex/agents/
task-spec-freezer.toml
task-builder.toml
task-verifier.toml
task-fixer.toml
.claude/agents/
task-spec-freezer.md
task-builder.md
task-verifier.md
task-fixer.mdAnd it inserts a managed workflow block into:
- repo-root
AGENTS.md - one Claude guide file:
CLAUDE.mdor.claude/CLAUDE.md
If both Claude guide locations exist, the initializer updates the repo-root CLAUDE.md and leaves .claude/CLAUDE.md untouched. The managed block is replaced in place on re-run, so user-authored content outside the managed markers is preserved. For Codex, the managed block always lives in repo-root AGENTS.md. That file acts as the repo-wide baseline. More-specific nested AGENTS.override.md, AGENTS.md, or configured fallback filenames still take precedence in their directory trees, and the initializer does not rewrite them. If init creates or rewrites AGENTS.md during a running Codex session, start a new Codex session before relying on the updated instructions. In Claude Code, CLAUDE.md is the project guide file Claude checks during onboarding. When --guides auto is used together with --install-subagents claude or --install-subagents both, the initializer ensures CLAUDE.md exists even if the repo previously only had AGENTS.md.
Commands
Initialize workflow files
scripts/task_loop.py init --task-id my-taskCodex CLI also has /init to scaffold a generic AGENTS.md, but this skill's initializer already manages the workflow block and does not require /init.
In Claude Code, if init just created or refreshed .claude/agents/* during the current session, do not assume those refreshed agents are already available mid-session.
Seed the task from a task file:
scripts/task_loop.py init --task-id my-task --task-file docs/task.mdSeed the task from inline text:
scripts/task_loop.py init --task-id my-task --task-text "Implement feature X"Control which guide files are created or updated:
scripts/task_loop.py init --task-id my-task --guides auto
scripts/task_loop.py init --task-id my-task --guides both
scripts/task_loop.py init --task-id my-task --guides agents
scripts/task_loop.py init --task-id my-task --guides claude
scripts/task_loop.py init --task-id my-task --guides noneFor Claude Code, --guides auto updates an existing CLAUDE.md or .claude/CLAUDE.md. If neither exists and Claude subagents are being installed, it creates CLAUDE.md.
--guides auto keeps existing guide files up to date, creates both guides when none exist yet, and also creates the product-native guide when you install that product's agents (CLAUDE.md for Claude, AGENTS.md for Codex).
Control which project subagent sets are installed:
scripts/task_loop.py init --task-id my-task --install-subagents both
scripts/task_loop.py init --task-id my-task --install-subagents codex
scripts/task_loop.py init --task-id my-task --install-subagents claude
scripts/task_loop.py init --task-id my-task --install-subagents noneValidate the artifact set
scripts/task_loop.py validate --task-id my-taskRun validate only after init has finished. If it reports initialization in progress, wait and rerun instead of treating that output as the durable workflow state.
Summarize current status
scripts/task_loop.py status --task-id my-taskRun status only after init has finished when you need stable task state. If it returns init_in_progress: true, treat that as a retry-later signal.
Expected working pattern
1. Initialize the task folder 2. Freeze the spec 3. Implement 4. Pack evidence 5. Fresh verify 6. Fix if needed 7. Fresh verify again
Codex adaptive orchestration:
- Keep normal Codex usage auto-mode-first and serial by default. Users do not need child-management details unless they explicitly want delegated or parallel agent work.
- Only after the user has explicitly asked for sub-agents, delegation, or parallel agent work may the parent choose between the serial path above and bounded fan-out from the frozen spec, repo shape, and current delegation surface.
- Once delegation is authorized, the parent may fan out bounded built-in
explorerorworkerchildren in parallel when a large Codex task has independent research questions, disjoint write scopes, or several read-only proof probes. - Keep helper fan-out modest and wave-based. Prefer up to 3 parallel helper children at once, then wait before the next phase.
- Keep the task tree shallow. The parent session should orchestrate children directly instead of asking one custom task child to spawn more children.
- One integration builder still owns
evidence.mdandevidence.json. - One fresh verifier still owns
verdict.jsonandproblems.md.
For exact prompts to use with child agents, see references/COMMANDS.md.
Claude adaptive delegation:
- Let the main Claude Code session decide whether to auto-delegate the current proof-loop phase to a matching project subagent. Users should not need to name a specific Claude subagent for normal operation.
- Keep prompts phase-focused so the current need is obvious, for example “freeze the spec”, “run a fresh verification pass”, or “repair the non-PASS criteria”.
- If automatic delegation is not specific enough, tighten the natural-language prompt for the current proof-loop phase rather than relying on out-of-band controls.
- Keep the proof loop flat even when delegation is automatic. The parent session still owns phase transitions, the evidence bundle stays with one builder, and each verify pass stays fresh.
Notes
- The initializer does not write the final
spec.mdcontent for you. It creates the strict file structure and seeds the task statement when provided. The actual spec freeze is an agent step. evidence.jsonandverdict.jsonare created with valid placeholder content so validation can run immediately afterinit.raw/screenshot-1.pngis created as a tiny placeholder PNG so the required path exists from the start.- Guidance discovery for seeded task specs includes repo-visible
AGENTS.override.md,AGENTS.md, rootCLAUDE.md,.claude/CLAUDE.md, and.claude/rules/**/*.mdwhen present. - That seeded guidance list is a workflow artifact, not a literal dump of Codex's automatic project-doc context.
- Codex can also load extra fallback filenames configured via
project_doc_fallback_filenames. The initializer does not try to infer every user's Codex config layer, so treat the seeded guidance list as best-effort when custom fallback filenames matter. - Codex may also render an
update_planchecklist or todo list in the UI. Treat that as ephemeral session progress, not as durable proof-loop state. - Codex CLI surfaces most relevant to this workflow are
/agent,/status,/review, and/init(generic scaffold only). - Before reusing or resuming a Codex child, inspect the current child-thread list in
/agentin the CLI or the equivalent child-thread inventory surface exposed by the current Codex product surface. - Built-in
exploreris the preferred Codex role for read-only repo discovery and proof probes. Built-inworkeris appropriate for bounded disjoint implementation or check shards when explicit ownership is possible. - Claude Code also loads
.claude/rules/*.mdand.claude/CLAUDE.mdas project guidance. The initializer discovers those files when seeding guidance sources for the task. - After installing or refreshing
.claude/agents/in the current Claude Code session, do not assume the new agent list is already available. - Claude Code uses the subagent
descriptionfield to decide when the main session should delegate automatically. Phrase project agent descriptions as proactive trigger conditions when you want Claude to pick them on its own. - For this workflow, treat the generated Claude agents as flat role endpoints. Do not expect one workflow agent to recursively spawn another.
- Claude Code may also render TodoWrite or a task/todo UI for multi-step work. Treat that as optional session-scoped progress display only. The canonical durable workflow state is the repo-local artifact set under
.agent/tasks/<TASK_ID>/.
Artifact schemas
These are the required files for each task folder:
.agent/tasks/TASK_ID/
spec.md
evidence.md
evidence.json
raw/
build.txt
test-unit.txt
test-integration.txt
lint.txt
screenshot-1.png
verdict.json
problems.mdevidence.json
Required top-level keys:
task_idoverall_statusacceptance_criteriachanged_filescommands_for_fresh_verifierknown_gaps
Allowed status values:
PASSFAILUNKNOWN
Recommended shape:
{
"task_id": "my-task",
"overall_status": "UNKNOWN",
"acceptance_criteria": [
{
"id": "AC1",
"text": "Describe the criterion",
"status": "UNKNOWN",
"proof": [
{
"type": "command",
"path": ".agent/tasks/my-task/raw/test-unit.txt",
"command": "npm test -- --runInBand",
"exit_code": 0,
"summary": "Targeted unit tests passed."
}
],
"gaps": []
}
],
"changed_files": [],
"commands_for_fresh_verifier": [],
"known_gaps": []
}verdict.json
Required top-level keys:
task_idoverall_verdictcriteriacommands_runartifacts_used
Allowed status values:
PASSFAILUNKNOWN
Recommended shape:
{
"task_id": "my-task",
"overall_verdict": "UNKNOWN",
"criteria": [
{
"id": "AC1",
"status": "UNKNOWN",
"reason": "Not yet verified."
}
],
"commands_run": [],
"artifacts_used": []
}problems.md
Required sections for each non-PASS criterion:
- criterion id and text
- status
- why it is not proven
- minimal reproduction steps
- expected vs actual
- affected files
- smallest safe fix
- corrective hint in 1-3 sentences
Validation script
Run:
scripts/task_loop.py validate --task-id <TASK_ID>This checks:
- required file presence
- JSON parseability
- top-level key presence
- allowed status values
- task id consistency
Subagent integration
This skill installs project-scoped subagent templates for both Codex and Claude Code.
On the Codex side, these are custom agent TOML config layers, not a separate manifest format.
Installed files
Codex
.codex/agents/task-spec-freezer.toml
.codex/agents/task-builder.toml
.codex/agents/task-verifier.toml
.codex/agents/task-fixer.tomlClaude Code
.claude/agents/task-spec-freezer.md
.claude/agents/task-builder.md
.claude/agents/task-verifier.md
.claude/agents/task-fixer.mdThe agent files are intentionally narrow and role-specific.
Codex file shape
Codex custom agents under .codex/agents/ are standalone TOML config layers.
Each file in this skill defines:
namedescriptiondeveloper_instructions
The Codex templates also use nickname_candidates for cleaner UI labels when several spawned children are visible at once.
Other config.toml keys could be added later if needed, but this skill mostly inherits the parent session's model, sandbox, tools, and MCP configuration.
Codex also ships built-in default, worker, and explorer roles. This skill adds task-specific roles alongside those built-ins rather than replacing the general-purpose ones.
Built-in Codex roles in this workflow
- Use built-in
explorerfor bounded read-only discovery before spec freeze and for read-only proof probes after build. - Use built-in
workeronly when the task cleanly splits into disjoint implementation or check shards with explicit ownership. - Keep
task-builderas the integration owner. Even in broader-task Codex fan-out runs, that role remains the single writer forevidence.mdandevidence.json. - Keep
task-verifieras the single fresh judge. Parallel helper children may gather inputs, but they do not writeverdict.json.
Role definitions
task-spec-freezer
Purpose:
- Freeze the task into
.agent/tasks/<TASK_ID>/spec.md
Hard boundaries:
- May read repo guidance and relevant code
- Must not change production code
- Must not write verdict or problems files
task-builder
Purpose:
- Implement the task and later pack evidence
Modes:
BUILDEVIDENCE
Hard boundaries:
- In
BUILD, implement against the spec - In
EVIDENCE, do not change production code
task-verifier
Purpose:
- Fresh-session verification against the current codebase
Hard boundaries:
- Must not edit production code
- Must not patch the evidence bundle to make it look complete
- Must write
verdict.json - Must write
problems.mdonly when the verdict is notPASS
task-fixer
Purpose:
- Repair only what the verifier identified
Hard boundaries:
- Must reread the spec and verifier output
- Must reconfirm the problem before editing
- Must regenerate evidence after the fix
- Must not write final sign-off
Codex invocation pattern
Use explicit delegation language at the parent-orchestrator layer. The skill should spawn one named child, wait for it, and then continue when delegation is the right internal choice. Do not spawn any child until init <TASK_ID> has finished and .agent/tasks/<TASK_ID>/spec.md exists. Do not batch init with other commands or tool calls.
Codex-native expectations that matter here:
- The parent-orchestrator must explicitly spawn a new child, and in Codex it may do so only after the user has explicitly asked for sub-agents, delegation, or parallel agent work.
- Once delegation is authorized, the parent chooses the specific child roles. The user does not need to name the exact role or slash-command flow.
- Keep the task tree shallow. The parent session should orchestrate children directly instead of asking one custom task child to spawn more children.
- Inspect the current child-thread list with
/agentin the CLI or the equivalent child-thread inventory surface exposed by the current Codex product surface before respawning or resuming a child. - Use
send_inputto continue a live child. - Use
resume_agentonly when you intentionally want an older builder or fixer child back. Do not reuse or resume a verifier when freshness matters. - Before reusing or resuming a child, inspect the current child-thread list rather than assuming the needed child is gone.
Default Codex path for narrower tasks:
- One child per workflow role.
- Same builder child for evidence.
- Fresh verifier child for every verify pass.
Adaptive Codex fan-out path for broader tasks after delegation is explicitly authorized:
- Fan out up to 3
explorerchildren in parallel when the task needs parallel discovery before the spec is stable. - Keep one
task-builderchild as the integration owner. - If implementation splits cleanly, add bounded
workerchildren in parallel with explicit file or module ownership. - If proof needs multiple read-only probes, add bounded
explorerchildren in parallel, but keep verdict writing with one fresh verifier child.
Suggested shape:
Spawn one `task-spec-freezer` agent for TASK_ID <TASK_ID>. Wait for it. Tell it to freeze the spec in .agent/tasks/<TASK_ID>/spec.md using the repo guidance and the task source.Repeat the same pattern for task-builder, task-verifier, and task-fixer.
Keep delegation depth flat. The narrower-task path uses one child per role at a time; the broader-task path may fan out multiple bounded explorer or worker children in parallel.
Fan-out variant:
Spawn two `explorer` children in parallel for TASK_ID <TASK_ID>.
Explorer A scope:
- path prefix: <PATH_A>
- question: <QUESTION_A>
Explorer B scope:
- path prefix: <PATH_B>
- question: <QUESTION_B>
Wait for both. Then fold their findings into one spec-freezer or builder step.Claude Code invocation pattern
Use the installed project subagents from .claude/agents/. Claude Code can automatically delegate from the main session to a matching subagent based on the task request, the subagent description, and current context, so normal proof-loop prompts do not need to name an agent explicitly. Because this skill writes agent files directly on disk, if init just created or refreshed .claude/agents/* during the current Claude Code session, do not assume those refreshed agents are already available. Treat these agents as preferred workflow roles whose descriptions should encourage automatic delegation from the main session. If automatic delegation is not precise enough, make the current proof-loop phase more explicit in the prompt. Keep verifier freshness and same-builder evidence reuse as hard workflow constraints.
TodoWrite or the visible task/todo list UI is optional session-scoped progress tracking only.
Suggested automatic shape:
Freeze the repo-local spec for TASK_ID <TASK_ID> in `.agent/tasks/<TASK_ID>/spec.md` before any implementation. Use explicit acceptance criteria and constraints.For Claude Code, keep this distinction explicit:
- TodoWrite or the visible task/todo UI is optional live progress display for the current session.
.agent/tasks/<TASK_ID>/...is the canonical durable proof-loop state.
When you need a specific role outcome, prefer an explicit natural-language phase prompt:
Run a fresh verifier pass for TASK_ID <TASK_ID> against the current codebase and write `verdict.json`, plus `problems.md` if needed.For large tasks, prefer one workflow owner per role rather than handing the entire proof loop to one general-purpose child. Descriptions in the Claude agent templates should read as proactive trigger conditions so Claude can delegate more reliably. Prefer wording that starts with Use proactively when.... Keep the delegation flat. Main-session auto-delegation is the intended Claude path here; the workflow agents themselves are leaf roles, so the parent should orchestrate each role directly instead of asking one custom task agent to spawn another.
Same-session evidence packing
The preferred pattern is:
1. Spawn task-builder 2. Let it implement 3. Continue with the same child in EVIDENCE mode
In Codex, this same-session follow-up is the preferred path. Keep the builder child alive and send it a follow-up instruction for evidence packing so it can reuse its own command results and local context. If the parent used parallel explorers or workers earlier, the builder should still stay the single owner of evidence.md and evidence.json and cite those sibling results only after validating they still apply.
In Claude Code, this same-session follow-up is the default path. Only run a second task-builder child with an explicit EVIDENCE-ONLY prompt if the original builder session is unavailable or you intentionally want a fresh evidence-only run.
Verifier freshness is different. In Codex, each verification pass should use a fresh verifier child or a fresh standalone session, not a resumed verifier.
Why the roles stay separate
The workflow is designed to keep:
- implementation
- judgment
- correction
as separate roles. This reduces self-justification and makes failures easier to localize.
#!/usr/bin/env python3
"""Initialize and validate repo-local task proof loop artifacts."""
from __future__ import annotations
import argparse
import json
import os
from pathlib import Path
import re
import subprocess
import sys
from datetime import datetime, timezone
from typing import Any
SCRIPT_DIR = Path(__file__).resolve().parent
SKILL_ROOT = SCRIPT_DIR.parent
TEMPLATES_DIR = SKILL_ROOT / "assets" / "templates"
REQUIRED_TASK_FILES = [
"spec.md",
"evidence.md",
"evidence.json",
"verdict.json",
"problems.md",
"raw/build.txt",
"raw/test-unit.txt",
"raw/test-integration.txt",
"raw/lint.txt",
"raw/screenshot-1.png",
]
STATUS_VALUES = {"PASS", "FAIL", "UNKNOWN"}
INIT_SENTINEL_FILE = ".init-in-progress"
PNG_PLACEHOLDER = (
b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01"
b"\x08\x04\x00\x00\x00\xb5\x1c\x0c\x02\x00\x00\x00\x0bIDATx\xdac\xfc"
b"\xff\x1f\x00\x03\x03\x02\x00\xefe\xf6\xe4\x00\x00\x00\x00IEND\xaeB`\x82"
)
MANAGED_START = "<!-- repo-task-proof-loop:start -->"
MANAGED_END = "<!-- repo-task-proof-loop:end -->"
CODEX_GUIDE_CANDIDATES = (
Path("AGENTS.override.md"),
Path("AGENTS.md"),
)
CLAUDE_GUIDE_CANDIDATES = (
Path("CLAUDE.md"),
Path(".claude") / "CLAUDE.md",
)
def utc_now_iso() -> str:
return datetime.now(timezone.utc).replace(microsecond=0).isoformat()
def fail(message: str, exit_code: int = 1) -> None:
print(message, file=sys.stderr)
raise SystemExit(exit_code)
def validate_task_id(task_id: str) -> str:
if not task_id:
fail("TASK_ID cannot be empty.")
if "/" in task_id or "\\" in task_id or ".." in task_id:
fail("TASK_ID must not contain path separators or '..'.")
if not re.fullmatch(r"[A-Za-z0-9._-]+", task_id):
fail("TASK_ID may contain only letters, numbers, dot, underscore, and hyphen.")
return task_id
def discover_repo_root(start: Path) -> Path:
start = start.resolve()
try:
result = subprocess.run(
["git", "rev-parse", "--show-toplevel"],
cwd=start,
check=True,
capture_output=True,
text=True,
)
git_root = result.stdout.strip()
if git_root:
return Path(git_root).resolve()
except Exception:
pass
current = start
while True:
if (current / ".git").exists():
return current
if current.parent == current:
return start
current = current.parent
def relative_or_absolute(path: Path, base: Path) -> str:
try:
return str(path.resolve().relative_to(base.resolve()))
except Exception:
return str(path.resolve())
def path_chain(repo_root: Path, current: Path) -> list[Path]:
repo_root = repo_root.resolve()
current = current.resolve()
chain = [repo_root]
if repo_root == current:
return chain
try:
rel = current.relative_to(repo_root)
except ValueError:
return chain
cursor = repo_root
for part in rel.parts:
cursor = cursor / part
chain.append(cursor)
return chain
def guidance_candidates_for_directory(directory: Path) -> list[Path]:
candidates: list[Path] = []
for rel_path in (*CODEX_GUIDE_CANDIDATES, Path("CLAUDE.md"), Path(".claude") / "CLAUDE.md"):
candidate = directory / rel_path
if candidate.exists():
candidates.append(candidate)
rules_dir = directory / ".claude" / "rules"
if rules_dir.is_dir():
for candidate in sorted(path for path in rules_dir.rglob("*.md") if path.is_file()):
if candidate.is_file():
candidates.append(candidate)
return candidates
def discover_guidance_files(repo_root: Path, current: Path) -> list[Path]:
found: list[Path] = []
seen: set[Path] = set()
for directory in path_chain(repo_root, current):
for candidate in guidance_candidates_for_directory(directory):
if candidate.exists():
resolved = candidate.resolve()
if resolved not in seen:
found.append(candidate)
seen.add(resolved)
return found
def load_text_template(name: str) -> str:
path = TEMPLATES_DIR / name
return path.read_text(encoding="utf-8")
def render_template(text: str, mapping: dict[str, str]) -> str:
rendered = text
for key, value in mapping.items():
rendered = rendered.replace(f"{{{{{key}}}}}", value)
return rendered
def ensure_parent(path: Path) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
def init_sentinel_path(task_dir: Path) -> Path:
return task_dir / INIT_SENTINEL_FILE
def mark_init_in_progress(task_dir: Path) -> None:
sentinel = init_sentinel_path(task_dir)
sentinel.write_text(f"{utc_now_iso()}\n", encoding="utf-8")
def clear_init_in_progress(task_dir: Path) -> None:
sentinel = init_sentinel_path(task_dir)
try:
sentinel.unlink()
except FileNotFoundError:
pass
def has_managed_block(path: Path) -> bool:
if not path.exists():
return False
content = path.read_text(encoding="utf-8")
return MANAGED_START in content and MANAGED_END in content
def write_text_file(path: Path, content: str, *, force: bool = False) -> bool:
ensure_parent(path)
if path.exists() and not force:
return False
path.write_text(content, encoding="utf-8")
return True
def write_binary_file(path: Path, content: bytes, *, force: bool = False) -> bool:
ensure_parent(path)
if path.exists() and not force:
return False
path.write_bytes(content)
return True
def upsert_managed_block(path: Path, block: str) -> str:
ensure_parent(path)
if path.exists():
content = path.read_text(encoding="utf-8")
else:
content = ""
if MANAGED_START in content and MANAGED_END in content:
pattern = re.compile(
re.escape(MANAGED_START) + r".*?" + re.escape(MANAGED_END),
re.DOTALL,
)
new_content = pattern.sub(block.strip(), content).rstrip() + "\n"
action = "updated"
else:
if content.strip():
new_content = content.rstrip() + "\n\n" + block.strip() + "\n"
else:
new_content = block.strip() + "\n"
action = "created" if not path.exists() else "appended"
path.write_text(new_content, encoding="utf-8")
return action
def placeholder_task_statement(task_file: str | None, task_text: str | None) -> str:
if task_text:
return task_text.strip()
if task_file:
try:
return Path(task_file).read_text(encoding="utf-8").strip()
except Exception as exc:
return f"Unable to read task file `{task_file}` at init time: {exc}"
return "TODO: paste or summarize the original user task here."
def guidance_bullets(repo_root: Path, current: Path) -> str:
discovered = discover_guidance_files(repo_root, current)
if not discovered:
return "- None detected at init time."
return "\n".join(f"- {relative_or_absolute(path, repo_root)}" for path in discovered)
def choose_claude_guide_path(repo_root: Path) -> Path:
for rel_path in CLAUDE_GUIDE_CANDIDATES:
candidate = repo_root / rel_path
if has_managed_block(candidate):
return candidate
for rel_path in CLAUDE_GUIDE_CANDIDATES:
candidate = repo_root / rel_path
if candidate.exists():
return candidate
return repo_root / "CLAUDE.md"
def template_context(task_id: str, repo_root: Path, current: Path, task_file: str | None, task_text: str | None) -> dict[str, str]:
return {
"TASK_ID": task_id,
"CREATED_AT": utc_now_iso(),
"REPO_ROOT": str(repo_root.resolve()),
"WORKING_DIR": str(current.resolve()),
"GUIDANCE_SOURCES": guidance_bullets(repo_root, current),
"TASK_STATEMENT": placeholder_task_statement(task_file, task_text),
}
def install_task_files(task_dir: Path, context: dict[str, str], *, force: bool = False) -> list[str]:
created: list[str] = []
file_map = {
task_dir / "spec.md": render_template(load_text_template("spec.md.tmpl"), context),
task_dir / "evidence.md": render_template(load_text_template("evidence.md.tmpl"), context),
task_dir / "evidence.json": render_template(load_text_template("evidence.json.tmpl"), context),
task_dir / "verdict.json": render_template(load_text_template("verdict.json.tmpl"), context),
task_dir / "problems.md": render_template(load_text_template("problems.md.tmpl"), context),
task_dir / "raw" / "build.txt": load_text_template("raw.build.txt.tmpl"),
task_dir / "raw" / "test-unit.txt": load_text_template("raw.test-unit.txt.tmpl"),
task_dir / "raw" / "test-integration.txt": load_text_template("raw.test-integration.txt.tmpl"),
task_dir / "raw" / "lint.txt": load_text_template("raw.lint.txt.tmpl"),
}
for path, content in file_map.items():
if write_text_file(path, content, force=force):
created.append(str(path))
screenshot = task_dir / "raw" / "screenshot-1.png"
if write_binary_file(screenshot, PNG_PLACEHOLDER, force=force):
created.append(str(screenshot))
return created
def install_codex_agents(repo_root: Path) -> list[str]:
target_dir = repo_root / ".codex" / "agents"
target_dir.mkdir(parents=True, exist_ok=True)
written: list[str] = []
for template_name in (
"task-spec-freezer.toml.tmpl",
"task-builder.toml.tmpl",
"task-verifier.toml.tmpl",
"task-fixer.toml.tmpl",
):
content = (TEMPLATES_DIR / "codex" / template_name).read_text(encoding="utf-8")
target = target_dir / template_name.replace(".tmpl", "")
target.write_text(content, encoding="utf-8")
written.append(str(target))
return written
def install_claude_agents(repo_root: Path) -> list[str]:
target_dir = repo_root / ".claude" / "agents"
target_dir.mkdir(parents=True, exist_ok=True)
written: list[str] = []
for template_name in (
"task-spec-freezer.md.tmpl",
"task-builder.md.tmpl",
"task-verifier.md.tmpl",
"task-fixer.md.tmpl",
):
content = (TEMPLATES_DIR / "claude" / template_name).read_text(encoding="utf-8")
target = target_dir / template_name.replace(".tmpl", "")
target.write_text(content, encoding="utf-8")
written.append(str(target))
return written
def update_guides(repo_root: Path, guides: str, install_subagents: str) -> dict[str, str]:
actions: dict[str, str] = {}
if guides == "none":
return actions
agents_guide = repo_root / "AGENTS.md"
claude_guide = choose_claude_guide_path(repo_root)
existing_claude_guides = [
repo_root / rel_path
for rel_path in CLAUDE_GUIDE_CANDIDATES
if (repo_root / rel_path).exists()
]
want_codex = install_subagents in {"both", "codex"}
want_claude = install_subagents in {"both", "claude"}
include_agents = guides in {"both", "agents"}
include_claude = guides in {"both", "claude"}
if guides == "auto":
include_agents = agents_guide.exists()
include_claude = bool(existing_claude_guides)
if want_codex and not include_agents:
include_agents = True
if want_claude and not include_claude:
include_claude = True
if not include_agents and not include_claude:
include_agents = True
include_claude = True
guide_targets: list[tuple[Path, str]] = []
if include_agents:
guide_targets.append((agents_guide, load_text_template("managed-block-agents.md.tmpl")))
if include_claude:
guide_targets.append((claude_guide, load_text_template("managed-block-claude.md.tmpl")))
for path, template in guide_targets:
action = upsert_managed_block(path, template)
actions[str(path)] = action
return actions
def json_load(path: Path) -> Any:
return json.loads(path.read_text(encoding="utf-8"))
def validate_evidence(data: Any, task_id: str) -> list[str]:
errors: list[str] = []
required_keys = {
"task_id",
"overall_status",
"acceptance_criteria",
"changed_files",
"commands_for_fresh_verifier",
"known_gaps",
}
if not isinstance(data, dict):
return ["evidence.json must contain a JSON object."]
missing = sorted(required_keys - set(data.keys()))
if missing:
errors.append(f"evidence.json missing keys: {', '.join(missing)}")
if data.get("task_id") != task_id:
errors.append("evidence.json task_id does not match the requested TASK_ID.")
if data.get("overall_status") not in STATUS_VALUES:
errors.append("evidence.json overall_status must be PASS, FAIL, or UNKNOWN.")
criteria = data.get("acceptance_criteria")
if not isinstance(criteria, list):
errors.append("evidence.json acceptance_criteria must be a list.")
else:
for index, item in enumerate(criteria):
if not isinstance(item, dict):
errors.append(f"evidence.json acceptance_criteria[{index}] must be an object.")
continue
for key in ("id", "text", "status", "proof", "gaps"):
if key not in item:
errors.append(f"evidence.json acceptance_criteria[{index}] missing key: {key}")
if item.get("status") not in STATUS_VALUES:
errors.append(f"evidence.json acceptance_criteria[{index}].status must be PASS, FAIL, or UNKNOWN.")
return errors
def validate_verdict(data: Any, task_id: str) -> list[str]:
errors: list[str] = []
required_keys = {"task_id", "overall_verdict", "criteria", "commands_run", "artifacts_used"}
if not isinstance(data, dict):
return ["verdict.json must contain a JSON object."]
missing = sorted(required_keys - set(data.keys()))
if missing:
errors.append(f"verdict.json missing keys: {', '.join(missing)}")
if data.get("task_id") != task_id:
errors.append("verdict.json task_id does not match the requested TASK_ID.")
if data.get("overall_verdict") not in STATUS_VALUES:
errors.append("verdict.json overall_verdict must be PASS, FAIL, or UNKNOWN.")
criteria = data.get("criteria")
if not isinstance(criteria, list):
errors.append("verdict.json criteria must be a list.")
else:
for index, item in enumerate(criteria):
if not isinstance(item, dict):
errors.append(f"verdict.json criteria[{index}] must be an object.")
continue
for key in ("id", "status", "reason"):
if key not in item:
errors.append(f"verdict.json criteria[{index}] missing key: {key}")
if item.get("status") not in STATUS_VALUES:
errors.append(f"verdict.json criteria[{index}].status must be PASS, FAIL, or UNKNOWN.")
return errors
def cmd_init(args: argparse.Namespace) -> int:
current = Path(args.repo_root).resolve() if args.repo_root else Path.cwd().resolve()
repo_root = discover_repo_root(current)
task_id = validate_task_id(args.task_id)
task_dir = repo_root / ".agent" / "tasks" / task_id
task_dir.mkdir(parents=True, exist_ok=True)
mark_init_in_progress(task_dir)
try:
context = template_context(task_id, repo_root, current, args.task_file, args.task_text)
created_files = install_task_files(task_dir, context, force=args.force)
installed_agents: list[str] = []
if args.install_subagents in {"both", "codex"}:
installed_agents.extend(install_codex_agents(repo_root))
if args.install_subagents in {"both", "claude"}:
installed_agents.extend(install_claude_agents(repo_root))
guide_actions = update_guides(repo_root, args.guides, args.install_subagents)
result = {
"repo_root": str(repo_root),
"task_id": task_id,
"task_dir": str(task_dir),
"created_or_overwritten_task_files": created_files,
"installed_or_refreshed_subagent_files": installed_agents,
"guide_file_actions": guide_actions,
}
print(json.dumps(result, indent=2))
return 0
finally:
clear_init_in_progress(task_dir)
def cmd_validate(args: argparse.Namespace) -> int:
current = Path(args.repo_root).resolve() if args.repo_root else Path.cwd().resolve()
repo_root = discover_repo_root(current)
task_id = validate_task_id(args.task_id)
task_dir = repo_root / ".agent" / "tasks" / task_id
missing = [str(task_dir / rel) for rel in REQUIRED_TASK_FILES if not (task_dir / rel).exists()]
errors: list[str] = []
init_in_progress = init_sentinel_path(task_dir).exists()
if not task_dir.exists():
errors.append(f"Task directory does not exist: {task_dir}")
elif init_in_progress:
errors.append(
f"Task initialization is still in progress: {init_sentinel_path(task_dir)}. "
"Rerun validate after init completes."
)
evidence_path = task_dir / "evidence.json"
verdict_path = task_dir / "verdict.json"
if evidence_path.exists():
try:
evidence = json_load(evidence_path)
errors.extend(validate_evidence(evidence, task_id))
except Exception as exc:
errors.append(f"Failed to parse evidence.json: {exc}")
if verdict_path.exists():
try:
verdict = json_load(verdict_path)
errors.extend(validate_verdict(verdict, task_id))
except Exception as exc:
errors.append(f"Failed to parse verdict.json: {exc}")
valid = not missing and not errors
report = {
"repo_root": str(repo_root),
"task_id": task_id,
"task_dir": str(task_dir),
"init_in_progress": init_in_progress,
"valid": valid,
"missing_files": missing,
"errors": errors,
}
print(json.dumps(report, indent=2))
return 0 if valid else 1
def cmd_status(args: argparse.Namespace) -> int:
current = Path(args.repo_root).resolve() if args.repo_root else Path.cwd().resolve()
repo_root = discover_repo_root(current)
task_id = validate_task_id(args.task_id)
task_dir = repo_root / ".agent" / "tasks" / task_id
report: dict[str, Any] = {
"repo_root": str(repo_root),
"task_id": task_id,
"task_dir": str(task_dir),
"exists": task_dir.exists(),
"init_in_progress": init_sentinel_path(task_dir).exists(),
"required_files_present": {},
"evidence_overall_status": None,
"verdict_overall_status": None,
"non_pass_criteria": [],
}
for rel in REQUIRED_TASK_FILES:
report["required_files_present"][rel] = (task_dir / rel).exists()
evidence_path = task_dir / "evidence.json"
if evidence_path.exists():
try:
evidence = json_load(evidence_path)
report["evidence_overall_status"] = evidence.get("overall_status")
except Exception as exc:
report["evidence_overall_status"] = f"PARSE_ERROR: {exc}"
verdict_path = task_dir / "verdict.json"
if verdict_path.exists():
try:
verdict = json_load(verdict_path)
report["verdict_overall_status"] = verdict.get("overall_verdict")
criteria = verdict.get("criteria", [])
if isinstance(criteria, list):
for item in criteria:
if isinstance(item, dict) and item.get("status") in {"FAIL", "UNKNOWN"}:
report["non_pass_criteria"].append(
{
"id": item.get("id"),
"status": item.get("status"),
"reason": item.get("reason"),
}
)
except Exception as exc:
report["verdict_overall_status"] = f"PARSE_ERROR: {exc}"
print(json.dumps(report, indent=2))
return 0
def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description="Repo task proof loop helper.")
subparsers = parser.add_subparsers(dest="command", required=True)
init_parser = subparsers.add_parser("init", help="Initialize repo-local task artifacts and integration files.")
init_parser.add_argument("--task-id", required=True, help="Task identifier, e.g. feature-auth-hardening")
init_parser.add_argument("--task-file", help="Optional path to a task description file to seed spec.md")
init_parser.add_argument("--task-text", help="Optional inline task text to seed spec.md")
init_parser.add_argument("--repo-root", help="Optional working directory inside the repo. Defaults to the current directory.")
init_parser.add_argument(
"--guides",
choices=["auto", "agents", "claude", "both", "none"],
default="auto",
help="Which guide files to create or update.",
)
init_parser.add_argument(
"--install-subagents",
choices=["both", "codex", "claude", "none"],
default="both",
help="Which project-scoped subagent sets to install or refresh.",
)
init_parser.add_argument("--force", action="store_true", help="Overwrite existing task artifact templates.")
init_parser.set_defaults(func=cmd_init)
validate_parser = subparsers.add_parser("validate", help="Validate required task files and JSON structures.")
validate_parser.add_argument("--task-id", required=True, help="Task identifier to validate.")
validate_parser.add_argument("--repo-root", help="Optional working directory inside the repo. Defaults to the current directory.")
validate_parser.set_defaults(func=cmd_validate)
status_parser = subparsers.add_parser("status", help="Summarize current task artifact status.")
status_parser.add_argument("--task-id", required=True, help="Task identifier to summarize.")
status_parser.add_argument("--repo-root", help="Optional working directory inside the repo. Defaults to the current directory.")
status_parser.set_defaults(func=cmd_status)
return parser
def main() -> int:
parser = build_parser()
args = parser.parse_args()
return int(args.func(args))
if __name__ == "__main__":
raise SystemExit(main())
Verification
This package was smoke-tested before packaging.
Command run
python scripts/verify_package.pyWhat the smoke test checks
SKILL.mdfrontmatter exists and thenamematches the parent directory- the skill body is non-empty
scripts/task_loop.py init --task-id demo-task --task-text "Implement a demo task."succeeds inside a fresh temporary git repositoryscripts/task_loop.py validate --task-id demo-taskreturnsvalid: true- a task-local init sentinel makes
validatereport initialization-in-progress instead of only a misleading missing-files failure wheninitis still active scripts/task_loop.py status --task-id demo-taskreportsinit_in_progress: truewhen the init sentinel is present- the expected repo-local artifacts are created under
.agent/tasks/demo-task/ - project-scoped subagent files are created under
.codex/agents/and.claude/agents/ AGENTS.mdandCLAUDE.mdare created with managed workflow blocks- generated Codex agent files stay Codex-specific and do not tell Codex to read
CLAUDE.md - generated Codex AGENTS guidance mentions the bounded
explorer/workerfan-out path - generated Codex AGENTS guidance allows
explorerfan-out before or after spec freeze and keepsworkerfan-out post-freeze only - generated Codex task-builder template still defines a single integration owner for evidence
- the Codex-facing skill metadata prompt mentions the
explorer/workeradaptive fan-out path references/COMMANDS.mddocuments the Codex adaptive fan-out orchestration path, includes first-class built-inexplorer/workerhelper prompts, and mentions public child-thread inspection surfaces- seeded guidance discovery includes
AGENTS.override.mdbeforeAGENTS.md - seeded guidance discovery includes nested
.claude/rules/**/*.mdfiles --guides auto --install-subagents claudecreatesCLAUDE.mdeven if the repo previously only hadAGENTS.md--guides auto --install-subagents codexcreatesAGENTS.mdeven if the repo previously only hadCLAUDE.md
Last local result
PASS