.agents/rules/autogoal/README.md
Human-facing guide for using and maintaining the autogoal workflow.
autogoal is the lifecycle layer for long-running Codex work. It defines the
outcome, evidence, durable plan state, completion rule, and blocked rule.
It is not the place for repo commands, browser policy, PR policy, package
release rules, or lane-specific scorecards. Put those in derived skills or
docs/plans/templates/<template>.md.
Use autogoal when work is non-trivial and has an auditable finish line:
Do not use it for one-off answers, typo fixes, or tiny edits where the final response can carry the evidence.
micro: narrow outcome, one proof surface. Usually no plan unless repo rules
require one.normal: multi-step work. Use a docs/plans goal plan.major: architecture, migration, benchmark, public API, or pass-gated work.
Use a derived skill/template with stronger gates.There are three common flows:
one-shot execution: read the issue/spec, plan internally, implement, verify,
and hand off without a plan-review stop.agent-led plan hardening: the agent iterates on the plan, reviews and
improves it, then stops for one major user review when confidence is high.collaborative planning: agent and human shape the plan together until the
user accepts it.The flow controls when human review happens. It does not weaken evidence, blocked, or completion rules.
Define the finish line:
Create or continue the active goal with the Codex goal tool.
Choose composition:
task, docs, major-task,
slate-plan, etc.)docs, agent-native, browser,
package-api)Create a plan:
node .agents/rules/autogoal/scripts/create-goal-scratchpad.mjs \
--template "<template-name>" \
--with "<pack-name>" \
--title "<short title>"
Omit --with when no surface pack applies. Repeat it for multiple packs.
The helper copies pack rows into the generated plan; the plan is still the
single runtime truth.
Fill the plan before real work starts.
Work in slices. Update findings, decisions, failed attempts, evidence, and next owner as you go.
Verify the real outcome, not just the plan shape.
Run the completion check:
node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/<plan>.md
Mark the goal complete only when the outcome is true and the plan passes.
Use one primary template and optional packs:
--template docs--template task --with docs--template task --with agent-native--template task --with browser--template task --with package-api--template major-taskDo not model this as template inheritance. Packs are static fragments under
docs/plans/templates/packs/ that materialize into one concrete plan.
Core execution and review gates live in the primary templates; packs cover
optional touched surfaces only.
Use concrete proof:
command: command, cwd, resultsource-audit: exact file/search proofbrowser: route, action, screenshot or caveatartifact: generated file, report, PR body, issue commentreview: reviewer, accepted findings, fixesexternal-source: issue, docs, paper, connected-app resultN/A:<reason>: why a recurring gate does not applyBare N/A is not enough. The checker expects reasons.
Use autogoal repair <expectation> when a goal-backed workflow misses a
recurring expectation.
Pick one owner:
docs/plans/templates/<owner>.md.agents/rules/<owner>.mdc.agents/rules/autogoal/scripts/*.agents/rules/autogoal.mdcAfter editing .agents/rules/*.mdc, run:
pnpm install
Never hand-edit generated .agents/skills/*/SKILL.md.
A skill that wraps autogoal should state:
autogoalautogoal owns lifecycle. Derived skills own domain policy.
.agents/rules/autogoal.mdc: source rule for the autogoal skill.agents/skills/autogoal/SKILL.md: generated agent-facing skill.claude/skills/autogoal/SKILL.md: generated Claude-facing skill.agents/rules/autogoal/scripts/create-goal-scratchpad.mjs: instantiate a plan.agents/rules/autogoal/scripts/create-goal-template.mjs: create a reusable plan
template.agents/rules/autogoal/scripts/check-complete.mjs: validate a filled plandocs/plans/templates/*.md: reusable templatesdocs/plans/templates/packs/*.md: reusable surface packsdocs/plans/*.md: active or completed goal plans