Plan First (aiti-plan-first)
About 2 min
aiti-plan-first ยท Plan First
โ AI development: plan first, then act โ
What it is
The toolbar "๐ Plan First" button + a short non-modal dropdown. Push-listen architecture (zero polling, zero scanning in the steady state):
- Binding wizard: an md appears among this round's changes (plan-named prioritized: design/plan/spec/rfc/ๆนๆก/่ฎกๅ/่ฎพ่ฎก pop on new creation, bypassing the cooldown) โ asks "Is this the plan for this session?" (you can browse all mds to choose; obvious non-plans like skills/** and SKILL.md are excluded)
- Drift reminder: bound, and a single turn's changes โฅ threshold (default 3 files/3 ops) with the plan not updated โ pop a reminder with one-click insert of "Update the plan doc: @file"
- Ahead reminder: unbound + code or any non-ignored file changed โฅ 1 โ pop "Do the plan first" (independent 30min cooldown; writing skills also counts as changing code)
- Tags closed loop: teach (prompt/inserted text carries the front-matter tags convention, including status tags ๆนๆก/่ฏๅฎกไธญยทๅทฒๅฎๆฝยทๅทฒ่ฟๆถ) โ AI writes (front-matter is the source of truth; tags may be self-nominated, not limited to a vocabulary) โ self-check (status/doctags read the doc in real time + followed triggers a doc-center scan) โ manual (in the bound-state dropdown tags row: chips ร to remove / type + Enter to add, written back)
- List icon: the
sessionRowLeadingrow-leading extension slot (a new generic position in pi-web) โ bound session rows carry a persistent green ๐ badge; shown the same in the All Sessions panel and the doc-center ๐งต session view - Session-entry check (0.3.0 โ plan-document milestone number, not the package version): switching sessions / entering with
?session=โ POST /check evaluates the ledger once โ sessions missed while terminal-bridged or with the page absent also pop the binding wizard; the entry check's stale evaluation is the only automatic reminder channel for terminal-bridged sessions (their events can't cross the bridge) - Clickable suggest-md paths: suspected plan doc paths in reminders are buttons; clicking calls openFile to open a tab for verification
Event chain (push-listen, zero intrusion into git-trace)
pi extension appendRow ledger row โ globalThis.__aitiTraceEmit? (loosely coupled optional chaining; core ยง6 reserved hook โ the producer, the pi extension loader, sits outside the extension ctx system)
โ aiti-git-trace sink โ traceBus
โโ services.trace.onOp (v2 + onOp/SSE /events) โ in-process listening in this extension (main channel)
โโ GET /events (SSE) โ browser
โโ readOps โ seq-gap filling + downgrade, not the normal pathDesign essentials: cold-start seeding, seq-gap filling, three-tier degradation, buffer capacity, terminal-bridged session boundaries, etc.
Gating (extman feature switches)
| feature | Default | Notes |
|---|---|---|
| plan.toolbar | on | Toolbar button |
| plan.suggestMd | on | Binding wizard on md changes |
| plan.leadRemind | on | Ahead reminder (unbound + code changed pops "do the plan first") |
| plan.staleRemind | on | Big-change-without-plan-update reminder |
| plan.bigFiles / plan.bigOps | 3 / 3 | "a lot changed" threshold |
| plan.mdIgnores | empty | Additional md ignores (glob) |
| plan.autoCloseSuggestSec / autoCloseStaleSec / autoCloseLeadSec | 0 / 30 / 10 | Seconds before a reminder auto-dismisses (wizard/drift/ahead; 0 = stays until handled) |