Develop
Run a linear implementation loop with strict gates.
Input Schema
{
"goal": "required implementation objective",
"constraints": [
"optional constraints"
],
"done_when": "required acceptance statement"
}
Workflow (Exact Commands)
-
Create run directory.
TS=$(date -u +%Y-%m-%dT%H-%M-%SZ) OUT_DIR=".reports/codex/develop/$TS" mkdir -p "$OUT_DIR" -
Record baseline diff and branch.
git rev-parse --abbrev-ref HEAD >"$OUT_DIR/branch.txt" git diff --stat >"$OUT_DIR/before.diffstat" -
Define the narrowest reversible change, ownership, and acceptance criteria. If the task is 3+ steps or has design tradeoffs, update the plan before editing.
-
Run the anti-rationalization gate before editing.
- Existing code and tests for the target surface have been read.
- Failure mode or new behavior is captured by a failing doctest, pytest, or explicit acceptance check.
- Behavior-preserving refactors have characterization tests or an equivalent current-behavior safety net.
- The next edit is the smallest reversible step, not a speculative refactor.
-
Implement minimal change.
-
Run shared quality gates.
.codex/skills/_shared/run-gates.sh \ --out "$OUT_DIR" \ --lint "${LINT_CMD:-uv run --no-sync ruff check .}" \ --format "${FORMAT_CMD:-uv run --no-sync ruff format --check .}" \ --types "${TYPES_CMD:-uv run --no-sync mypy src/}" \ --tests "${TESTS_CMD:-uv run --no-sync pytest -q}" \ --review "${REVIEW_CMD:-git diff --check}" -
Review the changed files and the gate output before deciding pass/fail.
-
Classify findings using
../_shared/severity-map.md. -
Write mandatory result artifact.
.codex/skills/_shared/write-result.sh \ --out "$OUT_DIR/result.json" \ --status "$STATUS" \ --checks-run "lint,format,types,tests,review" \ --checks-failed "$CHECKS_FAILED" \ --critical "$CRITICAL" \ --high "$HIGH" \ --medium "$MEDIUM" \ --low "$LOW" \ --confidence "$CONFIDENCE" \ --artifact-path "$OUT_DIR/result.json"
Fail-fast Rules
- Missing
goalordone_when=> fail. - Shared gate script missing => fail.
- Any critical finding => fail.
- Ambiguous scope or missing ownership => fail.
- Missing failing doctest, pytest, or explicit acceptance check for changed behavior => fail.
- Result artifact missing => fail.
Output Contract
Use shared gate schema from ../_shared/quality-gates.md.
Minimum artifact payload:
{
"status": "pass|fail",
"checks_run": [
"lint",
"format",
"types",
"tests",
"review"
],
"checks_failed": [],
"findings": {
"critical": 0,
"high": 0,
"medium": 0,
"low": 0
},
"confidence": 0.0,
"artifact_path": ".reports/codex/develop/<timestamp>/result.json"
}