docs/plans/2026-05-24-goal-start-completion-gates.md
Objective:
Add generic Start Gates and Completion Gates support to the goal workflow.
Project templates should carry the project-specific gate rows, while
check-complete.mjs enforces gate closure generically without knowing
project-specific command semantics.
Goal plan: docs/plans/2026-05-24-goal-start-completion-gates.md
Completion threshold:
docs/plans/templates/goal.md, slate-plan.md,
editor-test-harvester.md, and editor-harvest-plan.md include
Start Gates: and Completion Gates: tables.check-complete.mjs fails unresolved gate rows when gate tables are present..agents/rules/goal.mdc documents only generic gate semantics and keeps
project-specific commands out of the generic skill text.pnpm install, pnpm lint:fix, and this plan's check-complete.mjs pass.Verification surface:
rg -n "Start Gates|Completion Gates|Package exports or file layout changed|Goal plan complete" docs/plans/templates/*.md.node --check .agents/rules/goal/scripts/check-complete.mjs.docs/plans/2026-05-24-gate-smoke-test.md fails
check-complete.mjs with unresolved Start/Completion gate rows.pnpm install.pnpm lint:fix.node .agents/rules/goal/scripts/check-complete.mjs docs/plans/2026-05-24-goal-start-completion-gates.md.Constraints:
.agents/rules/goal.mdc generic for all projects.docs/plans/templates/.SKILL.md directly; sync with pnpm install.Boundaries:
.agents/rules/goal.mdc,
.agents/rules/goal/scripts/check-complete.mjs,
docs/plans/templates/*.md, generated .agents/skills/goal/SKILL.md via
sync, skills-lock.json, and this goal plan.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-start-completion-gates.md passes.active goal state for this goal. This
file plus the active goal are the durable state.Start Gates:
| Gate | Applies | Evidence |
|---|---|---|
| Skill analysis before edits | yes | Announced [Skills: goal]. |
| Active goal checked or created | yes | get_goal returned null; create_goal created this active goal. |
| Source of truth read before edits | yes | Read goal.mdc, check-complete.mjs, docs/plans/templates/goal.md, and .agents/AGENTS.md goal workflow. |
docs/solutions checked for non-trivial existing-code work | yes | Searched docs/solutions for goal, completion-check, check-complete, and planning; relevant old completion-check lessons confirmed why gate closure must stay explicit. |
| TDD decision before behavior change or bug fix | N/A | No runtime behavior bug or product behavior fix; this is workflow/template/checker enforcement. |
Completion Gates:
| Gate | Applies | Required action | Evidence |
|---|---|---|---|
| Named verification threshold | yes | Run the command, proof, source audit, or artifact check named in this plan | Template audit, checker syntax check, incomplete-plan smoke failure, sync, lint, and final plan check recorded below. |
| TypeScript or typed config changed | no | Run relevant typecheck | No .ts files or typed config changed. |
| Package exports or file layout changed | no | Run pnpm brl before final verification and keep generated barrel updates | No package exports, public files, or exported folder layout changed. |
| Package manifests, lockfile, or install graph changed | no | Run pnpm install and relevant package checks | No package manifests or package lockfile changed; pnpm install still ran for generated skill sync. |
| Agent rules or skills changed | yes | Run pnpm install and verify generated skill sync | pnpm install ran and skiller apply completed successfully. |
| Browser surface changed | no | Capture Browser Use proof | No browser route, UI, or browser behavior changed. |
| Package behavior or public API changed | no | Add a changeset or record why no changeset applies | No package behavior/API changed. |
| PR create or update | no | Run check before PR work | No PR created or updated. |
| Final lint | yes | Run pnpm lint:fix or scoped equivalent | Final pnpm lint:fix rerun passed after moving the markdown table separator regex to a top-level constant. |
| Goal plan complete | yes | Run node .agents/rules/goal/scripts/check-complete.mjs docs/plans/2026-05-24-goal-start-completion-gates.md | Passed with [goal] complete; rerun after this edit. |
| Knowledge extraction | no | Evaluate ce-compound; capture if useful | Evaluation done: the durable knowledge is encoded in goal.mdc, templates, and checker; no separate solution note needed. |
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.docs/plans goal plan created before substantive edits.check run before PR create/update, or marked N/A with reason.node .agents/rules/goal/scripts/check-complete.mjs docs/plans/2026-05-24-goal-start-completion-gates.md
passes after final evidence is recorded.ce-compound evaluated after non-trivial verified work.Phase / pass table:
| Phase | Status | Evidence | Next |
|---|---|---|---|
| Intake and source read | complete | read goal checker/templates/rule/guidance and relevant docs/solutions search results | patch workflow |
| Implementation | complete | added gate tables to templates, generic checker enforcement, and generic goal.mdc semantics | verification |
| Verification | complete | syntax check, template audit, smoke failure, and pnpm install completed; final lint/check pending below | closeout |
| Closeout | complete | plan updated with evidence and ready for final check | final |
Findings:
check-complete.mjs can stay generic by enforcing table shape and resolved
cells instead of knowing command names.Decisions and tradeoffs:
Start Gates and Completion Gates exactly.goal.mdc generic: it documents gate table semantics, not Plate command
rows such as pnpm brl.Error attempts:
| Error / failed attempt | Count | Next different move | Resolution |
|---|---|---|---|
| Incomplete generated smoke plan failed check-complete | 1 | Expected failure; use it as proof gate enforcement works | Removed temporary smoke plan after recording failure |
pnpm lint:fix found inline regex in isTableSeparatorRow | 1 | Move regex to a module-level constant | Fixed with TABLE_MARKDOWN_SEPARATOR_CELL_PATTERN; reran lint successfully |
rg command had an unmatched quote while checking generated goal skill text | 1 | Rerun with single-quoted pattern | Corrected command passed and confirmed generated skill text |
External/browser findings:
Timeline:
goal.get_goal; no active goal existed.goal.mdc, check-complete.mjs, current templates, and AGENTS goal
workflow.Start Gates and Completion Gates to all current project templates.check-complete.mjs to enforce gate rows generically when present.goal.mdc with project-agnostic gate semantics.pnpm install; skiller apply completed successfully.pnpm lint:fix; first run found a top-level-regex rule in the checker.TABLE_MARKDOWN_SEPARATOR_CELL_PATTERN.pnpm lint:fix; passed.check-complete.mjs; passed.pnpm lint:fix after final plan updates; passed.Verification evidence:
node --check .agents/rules/goal/scripts/check-complete.mjs: passed.rg -n "Start Gates|Completion Gates|Package exports or file layout changed|Goal plan complete" docs/plans/templates/*.md: confirmed all current project templates include the gate tables and the pnpm brl gate.node .agents/rules/goal/scripts/create-goal-scratchpad.mjs --path docs/plans/2026-05-24-gate-smoke-test.md --title "Gate Smoke Test" --force && node .agents/rules/goal/scripts/check-complete.mjs docs/plans/2026-05-24-gate-smoke-test.md: failed as expected with unresolved Start/Completion gate rows; temporary plan removed.rg -n "Start And Completion Gates|Start Gates:|Completion Gates:|project-specific commands" .agents/rules/goal.mdc: confirmed generic gate semantics and explicit project-specific-command exclusion.pnpm install: passed; skiller apply completed successfully.pnpm lint:fix: failed with lint/performance/useTopLevelRegex for
the table separator regex in isTableSeparatorRow.pnpm lint:fix: passed; Checked 3419 files in 5s. No fixes applied.pnpm lint:fix rerun: passed; Checked 3419 files in 5s. No fixes applied.rg -n 'Start And Completion Gates|project-specific commands|gate-row closure' .agents/rules/goal.mdc .agents/skills/goal/SKILL.md: passed and confirmed generic semantics in source and generated skill.node .agents/rules/goal/scripts/check-complete.mjs docs/plans/2026-05-24-goal-start-completion-gates.md: passed with [goal] complete.Reboot status:
| Question | Answer |
|---|---|
| Where am I? | Closeout |
| Where am I going? | Run final lint and check-complete |
| What is the goal? | Add Start Gates and Completion Gates to goal workflow |
| What have I learned? | See Findings |
| What have I done? | See Timeline |
Open risks: