docs/plans/2026-05-24-goal-check-complete.md
Objective: Add deterministic goal-plan completion checking and align the goal skill workflow around it, complete only when source-owned goal rules/template/scripts and generated skill docs are updated, the checker passes on a valid sample and fails on an incomplete sample, script syntax checks pass, pnpm install syncs generated output, and lint:fix completes, while preserving docs/plans as the only durable goal-plan location and avoiding hooks or .tmp completion-check state.
Goal plan: docs/plans/2026-05-24-goal-check-complete.md
Completion threshold:
Verification surface:
Constraints:
Boundaries:
Blocked condition:
Completion rule:
update_goal(status: complete) while any required checklist item remains unchecked. If an item does not apply, check it and add N/A: <reason>.update_goal(status: complete) until the named verification evidence is recorded below and node .agents/rules/goal/scripts/check-complete.mjs docs/plans/2026-05-24-goal-check-complete.md passes.active goal state for this goal. This file plus the active goal are the durable state.Required checklist:
get_goal checked; create_goal called only when no active goal existed, or the active matching goal was recorded.learnings-researcher / docs/solutions checked, or marked N/A with reason. N/A: workflow skill/rule update, not product bug/feature reuse.docs/plans goal plan created before substantive edits.check run before PR create/update, or marked N/A with reason. N/A: no PR requested.node .agents/rules/goal/scripts/check-complete.mjs docs/plans/2026-05-24-goal-check-complete.md passes after final evidence is recorded.ce-compound evaluated after non-trivial verified work. N/A: the durable artifact is the skill/rule update itself.Phase / pass table:
| Phase | Status | Evidence | Next |
|---|---|---|---|
| Intake and source read | complete | read goal rule, template, helper, task guidance, pasted generated skill | done |
| Implementation | complete | added check-complete.mjs; updated goal rule/template; synced generated output | done |
| Verification | complete | node syntax checks, incomplete failure smoke, pnpm install, pnpm lint:fix, final checker pass | done |
| Closeout | complete | final response summarizes hybrid policy and evidence | done |
Findings:
.mjs is the better checker format here because the existing goal helper is Node and markdown validation is less brittle in JS than shell.Decisions and tradeoffs:
check-complete.mjs instead of check-complete.sh -> portable parsing and matches existing helper -> slightly more code than grep..agents/rules/goal/scripts -> survives pnpm install generation -> generated SKILL.md remains untouched by hand.Error attempts:
| Error / failed attempt | Count | Next different move | Resolution |
|---|---|---|---|
pnpm lint:fix rejected non-top-level regex literals in check-complete.mjs | 1 | Move regex literals to module constants | Fixed; rerun passed |
External/browser findings:
Timeline:
get_goal returned no goal and create_goal started this objective.pnpm install synced generated AGENTS.md and .agents/skills/goal/SKILL.md.pnpm lint:fix failed once on top-level-regex rules; script was fixed.Verification evidence:
node .agents/rules/goal/scripts/check-complete.mjs docs/plans/2026-05-24-goal-check-complete.md before closeout -> failed as expected on incomplete plan.node .agents/rules/goal/scripts/create-goal-scratchpad.mjs ... --path docs/plans/2026-05-24-smoke-incomplete-check.md -> created a new template plan with Goal plan: and embedded checker command.node .agents/rules/goal/scripts/check-complete.mjs docs/plans/2026-05-24-smoke-incomplete-check.md -> failed as expected on unchecked checklist, open phases, missing evidence, and pending risks.rm docs/plans/2026-05-24-smoke-incomplete-check.md -> removed temporary smoke file.node --check .agents/rules/goal/scripts/check-complete.mjs && node --check .agents/rules/goal/scripts/create-goal-scratchpad.mjs -> passed.pnpm install -> passed; skiller apply completed successfully.pnpm lint:fix -> passed after regex constant fix; Checked 3422 files in 5s. No fixes applied.node .agents/rules/goal/scripts/check-complete.mjs docs/plans/2026-05-24-goal-check-complete.md -> passes with [goal] complete: docs/plans/2026-05-24-goal-check-complete.md.Reboot status:
| Question | Answer |
|---|---|
| Where am I? | Closeout |
| Where am I going? | Report changed files and verification |
| What is the goal? | Add deterministic goal-plan completion checking and align goal workflow around it |
| What have I learned? | Hybrid policy is the right consistency point: real evidence plus mechanical plan gate |
| What have I done? | Added checker, updated goal source/template, synced generated output, verified smoke and lint |
Open risks: