Coordinate Codex as a disciplined delivery system, not a one-shot generator.
Select both:
project_modegreenfield: build from scratchbrownfield: onboard and modernize an existing systemexecution_modeautonomous: proceed automatically when gates passgated: pause at every gate for user approvalNo code without a spec. This is non-negotiable.
Before any implementation, a written spec must exist with:
The coding agent MUST NOT:
If spec is unclear → STOP and ask. Never guess.
See references/spec-driven-development.md for full spec templates and enforcement rules.
Never skip gates silently. Never implement without a spec.
Read these references before running:
references/spec-driven-development.md (MANDATORY FIRST - governs all work)references/planning-questionnaire.mdreferences/modes.mdreferences/gate-checklists.mdreferences/testing-matrix.mdreferences/manual-test-templates.mdreferences/codex-runbook.mdreferences/gate-prompts.mdscripts/agent_exec.pyreferences/research-playbook.md (if research_mode=true)Initialize project artifacts:
python scripts/init_project_docs.py --root <project-path> --mode <greenfield|brownfield>
This creates/updates:
AGENTS.md (project workflow contract)docs/*.md planning/architecture/test/progress/change docs.orchestrator/status.json (machine-readable state).orchestrator/context.json (project/execution/research mode context)Before anything else, ask the user which coding agent to use (codex | claude | opencode | pi) and fallback agent.
Then ask all required questions from references/planning-questionnaire.md.
Minimum required answers:
project_modeexecution_modeIf research_mode=true, produce docs/research-notes.md and architecture recommendation before G2.
Must complete before G2:
Must complete before G2 (and authored by coding agent, not orchestrator):
Use gates G0 through G7 defined in references/gate-checklists.md.
Update gate state via script:
python scripts/gate_status.py set --root <project-path> --gate G3 --state PASS --note "slice-1 verified"
Validate status schema:
python scripts/gate_status.py validate --root <project-path>
Allowed states: PENDING | IN_PROGRESS | PASS | FAIL | BLOCKED.
By default, gate preconditions are enforced (sequence + mode-aware docs checks).
Use references/testing-matrix.md.
Mandatory checks per progression:
Also execute manual test scripts from references/manual-test-templates.md.
For each meaningful step:
docs/tasks.mddocs/progress.mddocs/change-log.mddocs/traceability.mddocs/test-results.mdFor user-requested changes, run:
python scripts/change_impact.py --root <project-path> --request "<change request>"
Then complete all TODOs it emits in impacted docs.
Use PTY/background for long runs. Follow command patterns in references/codex-runbook.md.
Critical rule: each run executes ONE task, not a whole project in one prompt.
For G4, maintain docs/g4-task-plan.md checklist and process tasks one by one.
Generate gate-specific prompts with:
python scripts/generate_gate_prompt.py --gate <G1..G7> --agent <codex|claude|opencode|pi> --project-mode <greenfield|brownfield> --execution-mode <autonomous|gated> --research-mode <true|false> --task "<single task summary>" --spec-ref "<spec ref when applicable>"
update_docs_step.py is now a fallback utility for recovery/manual bookkeeping only.
Primary expectation: the coding agent updates docs directly during each task.
Required loop:
Enforcement:
run_gate.py requires --spec-ref for G3/G4 tasks (implementation gates).run_gate.py requires coding agent + fallback agent context.--validate-cmd and/or --ui-review-note).--requires-browser-check must include --ui-review-note.status=PASS requires at least one --validate-cmd.status=PASS is blocked when --agent-dry-run is used.docs/g4-task-plan.md has no unchecked tasks.docs/validation-log.md.docs/agent-handoff.md.references/spec-driven-development.md.--auto-block-on-retry-exhaust auto-classifies gate as BLOCKED when retries are exhausted.Generate a quick status board:
python scripts/progress_dashboard.py --root <project-path>
This summarizes current gate, completion %, blockers, and recent activity.
Run a single-task gate step with one command:
python scripts/run_gate.py --root <project-path> --gate G2 --agent codex --fallback-agent claude --project-mode brownfield --execution-mode gated --research-mode true --task "architecture baseline refined for API routing" --status IN_PROGRESS --validate-cmd "npm run -s typecheck" --ui-review-note "N/A for architecture-only task"
Mark PASS only after all gate-level checklist items are complete:
python scripts/run_gate.py --root <project-path> --gate G2 --agent codex --task "architecture gate complete" --status PASS --validate-cmd "npm run -s typecheck"
For web/UI tasks, require browser verification by OpenClaw agent:
python scripts/run_gate.py ... --requires-browser-check --ui-review-note "Verified login + CRUD manually in browser via OpenClaw browser tools"
Package distributable skill artifact:
python scripts/package_skill.py --skill-dir . --out dist
At completion provide:
docs/progress.md at 100%.orchestrator/status.jsonIf blockers remain, mark as PARTIAL_COMPLETE with explicit blockers and owners.
共 1 个版本