Compare commits

..
83 changed files with 842 additions and 374 deletions

No files matched your search

@@ -45,7 +45,7 @@ One row per file of every game but Ghoul Rush (which has its own files: [core](.
| `public/activities/snake-music.js` | Snake's ten music tracks as data (no imports): `SNAKE_MUSIC`, `{ bpm, rush, voices, patterns, order }` each, named `snake<Place>` and listed in `MUSIC_TRACKS` in `snake.js`. A round deals them in a fresh order, one to each level, so a run hears a different track at every level and none twice. They were picked on the pages in `prototypes/music/snake` (rhythm-first folk and world tunes led by something plucked or reedy, mostly dark or modal), and their bars are not all sixteen steps: 6/8 is 12, 7/8 is 14, ten beats is 20, twelve beats is 24, each pattern a whole number of its bars; merged by `snake-sfx.js` |
| `public/activities/light-trails/1.mp3` to `5.mp3` | Light Trails' five background songs, named `trailsSong1` to `trailsSong5` under `songs` in `trails-sfx.js` and listed in `SERVABLE`; re-encoded for size with ffmpeg (80 kbps stereo MP3 at 44.1 kHz, loudness-normalized to -16 LUFS with `loudnorm`, metadata stripped), about 7.6 MB together, and copied into every skill with the rest of the console. The server leaves them out of its start-up cache warm |
| `public/activities/flock-dash/1.mp3` to `5.mp3` | Flock Dash's five background songs, named `flockSong1` to `flockSong5` under `songs` in `flock-sfx.js` and listed in `SERVABLE`; re-encoded for size with ffmpeg the way Light Trails' were (80 kbps stereo MP3 at 44.1 kHz, loudness-normalized to -16 LUFS with `loudnorm`, metadata stripped), about 6.4 MB together, and copied into every skill with the rest of the console. The server leaves them out of its start-up cache warm; `flock.js` deals all five in a fresh order each round with `dealMusic()`, plays each in full one after another and deals again after the last, never opening on the song that just ended |
| `public/screens/activities.js` | Activities: `#btn-activities` (the die right of the megaphone), `#activities-modal`, the one frame timer (`requestAnimationFrame`, swappable with `setTickSource()` for the page tests), the keys (arrows, W/A/S/D, space, P, Esc; stopped at the dialog so none reach the page behind; `CHEAT_CODE`, typed on a game's board, turns on endless lives through the game's `cheat(on)` until the round starts over, and `dropCheats()` turns it off on leaving for the picker or closing; `STAGE_CODE`, the same arrows then S, calls the game's `stageSelect()` where it has one, Ghoul Rush's practice stage select) and `pauseAll()`, which a new question, a finish, a hidden page, a window blur and a close all go through and which never resumes a game (it also sends a pointer game a cancel, dropping a drag). Canvas pointer events (down, move, up, cancel, with pointer capture) go to a game with `pointer()`, and key releases to a game with `release()`; a press on a paused board resumes without starting a drag. While paused, any game key or a board click resumes, except while a round is `held`: a question or finish that pauses a round on an open window holds it, the banner adds `#activities-unpause` (**Unpause game**) beside **Go to it**, and only that button plays on (`play()` refuses a held round), since a key or click already on its way used to dismiss the banner unread. Go to it, or closing the window any other way, lets the hold go, and a banner with nothing left to say drops it. Every start and play-on first counts down 3, 2, 1 (`COUNT_FROM`, 700 ms a number, `setCountdownMs()` for the page tests, which set 0 unless they test it): the game is already `running`, the frame timer just does not tick it, and game keys, overlay clicks and board presses wait, while P and Esc still pause. With two or more games listed the window opens on the picker (`view`: `"picker"` or `"game"`, `applyView()`): a picker of game rows in two columns (`drawPicker()`: an Order bar with **Recently played** and **A to Z**, saved in `activityOrder`, and the game count; one grid of `.activities-row` buttons from `orderGames()`, with never-picked games under a **Not played yet** heading that spans both columns; covers in `COVERS` drawn as SVG with `cv-*` token classes, since the page's policy refuses a style attribute) with each game's blurb, a best chip (thousands separators) and a **Last played** or **Paused at N** tag, arrows walking the rows and the course cards by position (`moveFocus()`: left and right through the list, up and down to the nearest button in the next line; an Order button keeps its arrows), and `#activities-back` (**All games**) back to it. One game at a time: `pick()` drops the last game from `games` when another is picked, and `openActivities()` goes straight back into a paused round. The last pick is kept as `lastActivity` and gets the focus; `lowerIsBetter` games keep the lowest round as the best; the header shows the current game's best (`paintTitle()`). `renderActivities()` in the render pass compares `myTurn()` and `finish()` with the last render and shows the banner with **Go to it**. Loads a game with `import()` when it is picked and keeps it until another is picked; `setActivityList()` lets a test list a stub second game, which brings up the picker |
| `public/screens/activities.js` | Activities: `#btn-activities` (the die, right of the text size control), `#activities-modal`, the one frame timer (`requestAnimationFrame`, swappable with `setTickSource()` for the page tests), the keys (arrows, W/A/S/D, space, P, Esc; stopped at the dialog so none reach the page behind; `CHEAT_CODE`, typed on a game's board, turns on endless lives through the game's `cheat(on)` until the round starts over, and `dropCheats()` turns it off on leaving for the picker or closing; `STAGE_CODE`, the same arrows then S, calls the game's `stageSelect()` where it has one, Ghoul Rush's practice stage select) and `pauseAll()`, which a new question, a finish, a hidden page, a window blur and a close all go through and which never resumes a game (it also sends a pointer game a cancel, dropping a drag). Canvas pointer events (down, move, up, cancel, with pointer capture) go to a game with `pointer()`, and key releases to a game with `release()`; a press on a paused board resumes without starting a drag. While paused, any game key or a board click resumes, except while a round is `held`: a question or finish that pauses a round on an open window holds it, the banner adds `#activities-unpause` (**Unpause game**) beside **Go to it**, and only that button plays on (`play()` refuses a held round), since a key or click already on its way used to dismiss the banner unread. Go to it, or closing the window any other way, lets the hold go, and a banner with nothing left to say drops it. Every start and play-on first counts down 3, 2, 1 (`COUNT_FROM`, 700 ms a number, `setCountdownMs()` for the page tests, which set 0 unless they test it): the game is already `running`, the frame timer just does not tick it, and game keys, overlay clicks and board presses wait, while P and Esc still pause. With two or more games listed the window opens on the picker (`view`: `"picker"` or `"game"`, `applyView()`): a picker of game rows in two columns (`drawPicker()`: an Order bar with **Recently played** and **A to Z**, saved in `activityOrder`, and the game count; one grid of `.activities-row` buttons from `orderGames()`, with never-picked games under a **Not played yet** heading that spans both columns; covers in `COVERS` drawn as SVG with `cv-*` token classes, since the page's policy refuses a style attribute) with each game's blurb, a best chip (thousands separators) and a **Last played** or **Paused at N** tag, arrows walking the rows and the course cards by position (`moveFocus()`: left and right through the list, up and down to the nearest button in the next line; an Order button keeps its arrows), and `#activities-back` (**All games**) back to it. One game at a time: `pick()` drops the last game from `games` when another is picked, and `openActivities()` goes straight back into a paused round. The last pick is kept as `lastActivity` and gets the focus; `lowerIsBetter` games keep the lowest round as the best; the header shows the current game's best (`paintTitle()`). `renderActivities()` in the render pass compares `myTurn()` and `finish()` with the last render and shows the banner with **Go to it**. Loads a game with `import()` when it is picked and keeps it until another is picked; `setActivityList()` lets a test list a stub second game, which brings up the picker |
| `public/styles/activities.css` | the Activities rules: the die in the top bar, the Notebook-sized dialog, the board and its state overlay, the your-turn banner in the highlight color, the picker and the notes |
**Building an Activities game:** the rules every game follows, so a new one plays like the rest.
@@ -4,7 +4,7 @@
Key design points:
- **First-run Welcome.** The first dashboard a person sees (after the wake-up finishes) opens `#welcome-modal`. Any close (button, Esc, backdrop) saves `looks.welcomeSeen: true` to `looks.json`, which survives "Reset this tab". The four columns teach Pick a card, Answer then Send, Watch the terminal (the in-app wording names the terminal panel) and Get help; the session meter's one-time tip lives in the meter popover (`looks.meterTipSeen`). `looks.skillLaunched` is set by the first skill launch from this machine (`launchSkill()`) and, like `welcomeSeen`, is never reset: until it is set the dashboard holds the role line and draws Learning "Not set up" at the bottom, and after it one quiet line offers the two optional extras. Help's first tab has a **Show the welcome again** link (`data-action="welcome"`). Logic: `maybeWelcome()` / `openWelcome()` in `screens/help-dialog.js`.
- **Top-bar icons.** `#btn-looks` (gear) opens `#looks-modal`, titled User Preferences (see User Preferences below). `#btn-feedback` (megaphone) is a plain link to `https://github.com/jparkerweb/plan2code/issues/new/choose`, backed by `.github/ISSUE_TEMPLATE/bug.yml` and `idea.yml` (`config.yml` sets `blank_issues_enabled: false`). `DEFAULT_ACCENT` in `palette.js` is `ocean`.
- **Top-bar icons.** `#btn-looks` (gear) opens `#looks-modal`, titled User Preferences (see User Preferences below). `#btn-feedback` (megaphone) is a plain link to `https://github.com/jparkerweb/plan2code/issues/new/choose`, backed by `.github/ISSUE_TEMPLATE/bug.yml` and `idea.yml` (`config.yml` sets `blank_issues_enabled: false`). `#text-size` (right of the megaphone, left of the die) is `[-]`, a size label and `[+]`: seven steps in `TEXT_SIZES` (`palette.js`, 80 to 150%), saved as `looks.textSize`, painted as `data-text-size` on `<html>` (the server writes it into the first paint too) and read by `tokens.css`, whose `--fs-*` steps multiply by `--text-scale`; the label returns to 100%, and a button at an end of the range is `aria-disabled`. `DEFAULT_ACCENT` in `palette.js` is `ocean`.
- **Version in Help.** `GET /version` reads `version.json` beside `server.mjs`, falling back to `../../version.json` for a run from `src/` (the `/version` route in `routes.mjs`). `renderHelpVersion()` in `screens/help-dialog.js` fills `#help-version`. `computeExpectedSkills()` in `install.js` injects the root `version.json` into every `references/web-console/`, so a version bump changes every skill.
- **User Preferences is four tabs in a side list.** Appearance (Theme, Card width, Highlight color, Role), Agents & models, System (Cleanup, and Desktop app inside the app only) and Sounds & activities (Sounds, Activities), a sideways strip below 720 px. The tabs are the static `<section class="prefs-panel">` panels in `#looks-modal`, each fieldset in exactly one (its `data-section`, listed in `PREFS_TABS`), wired by the shared `public/tabs.js` (`wireTabs()`, the same helper Help uses: `helpKeyTarget()` re-exports its `tabKeyTarget()`). `public/prefs.js` is the pure part: `PREFS_TABS`, `prefsOpenTab()` (the gear and the dashboard's Set up preferences both open Appearance; nothing is remembered between opens) and `prefsResetScope()` (Reset this tab, with an "Reset. Undo" mark for eight seconds, resets only the shown tab's looks keys, and is hidden on Agents & models and System). `screens/prefs-dialog.js` owns `openPrefs(tab)`, the one way in, the Saved mark and the unsaved prompt; `screens/looks.js` keeps the look and sound controls, which save to `looks.json` as they change; `screens/agents-view.js` mounts the Agents & models tab, a master-detail split over today's `models.json` and `agents.json` (formats unchanged) whose per-agent form has its own Save and Discard: Save sends the last saved list with only that form's draft swapped in, so another form's half-typed edit is never written. The split's components live under `screens/agents/` (data, list editor, summary, form); the mount owns all state and every fetch and hands them one `ctx`.
- **Models in User Preferences.** `GET` / `POST /models` in `routes.mjs` read the shipped `~/.plan2code/bin/models.json` and read/write the user's `~/.plan2code/models.json` (`SHIPPED_MODELS_FILE` / `USER_MODELS_FILE` in `files.mjs`), edited from each built-in agent's form on the Agents & models tab. `PLAN2CODE_MODELS_DIR` relocates both for tests. The launcher reads the same two files for its model menu.
@@ -16,10 +16,11 @@ Key design points:
- **`GET /agents-doc` is the other route that reads a project file** (the dashboard's AGENTS.md tab, right after Dashboard, shown while the project has an `AGENTS.md`). A dashboard session only; it serves `AGENTS.md` or one markdown file directly under `.agents-docs/` (`?file=`, default `AGENTS.md`; `readAgentsDoc()` in `sessions.mjs` allows exactly those two shapes and `realpath`s the file inside the root), as `text/markdown` with `no-store`, or a `204` for anything else. The page links `.agents-docs/` files in place through `md()`'s `link` option (`renderAgentsDoc()` in `screens/docs.js`).
- **`GET /overview` reads a project file too.** It serves `<spec>/overview.md` as `text/markdown` with `cache-control: no-store` (so the Overview tab is always fresh), or with `?file=map` / `?file=draft` the spec's `pathfinder/map.md` / live `PLAN-DRAFT-*.md` (the dashboard's Map and Plan draft tabs, shown only while the spec has no overview; `readSpecFile()` picks the file and names it in `x-spec-file`), or an empty `204` when there is no such file (normal for most specs, and no failed request in the browser console). A dashboard session honors `?spec=` only when it equals a `dir` in `state.scan.specs`; every other workflow uses `state.specDir` and ignores the query. The root is `state.worktree` (fallback `state.project`), and `readSpecFile()` (which `readOverview()` wraps) resolves and `realpath`s the file and refuses anything outside the root's realpath, so `../`, absolute paths and outward symlinks all get the same 204, as do an unscanned `?spec=` and an unknown `?file=`.
- **The Prototypes tab reads a spec's `prototypes/` folder.** `GET /prototypes` lists its `.md` and `.html` files (204 when none), `GET /prototype?name=` serves one `.md`, and `POST /open-prototype` (origin-checked) hands one `.html` to the system's default opener through `openFile()` in `open-link.mjs` (one argument, no shell). The spec is chosen as `/overview` chooses it (`specInView()`); `listPrototypes()`, `readPrototype()` and `prototypeHtmlPath()` in `sessions.mjs` take a bare file name only and refuse any file whose realpath is not directly in the folder. The page shows the tab after the spec file tabs, on the dashboard and in a session alike (`loadPrototypes()`, called from `loadOverview()`).
- **Month-old sessions are deleted whole.** `open` lists `staleSessions()` (directories matching the session-id pattern whose `state.json` mtime is older than 30 days, never the sid being opened — no exceptions for paused sessions or unread sends) and `staleScratch()` (top-level regular `.json` / `.mjs` files in the console folder older than 30 days, never `looks.json` or `console-dir` — `PROTECTED_CONSOLE_FILES` — never a directory or symlink) before it prints, and removes them after; `removeSessions()` / `removeScratch()` re-check every name against the session-id pattern / the scratch-name rule before deleting — not the age, the skipped sid or the file type, which the `stale*` listing already decided, so never hand them names that did not come from it. `console.md` tells agents to write temporary payload files into the session's own folder so they go with it.
- **Month-old sessions are deleted whole.** `open` lists `staleSessions()` (directories matching the session-id pattern whose `state.json` mtime is older than 30 days, never the sid being opened — no exceptions for paused sessions or unread sends) and `staleScratch()` (top-level regular `.json` / `.mjs` files in the console folder older than 30 days, never `looks.json`, `interface.json` or `console-dir` — `PROTECTED_CONSOLE_FILES` — never a directory or symlink) before it prints, and removes them after; `removeSessions()` / `removeScratch()` re-check every name against the session-id pattern / the scratch-name rule before deleting — not the age, the skipped sid or the file type, which the `stale*` listing already decided, so never hand them names that did not come from it. `console.md` tells agents to write temporary payload files into the session's own folder so they go with it.
- **User Preferences → System → Cleanup deletes on demand, from a list the server makes.** `POST /cleanup` (origin-checked) with `{ scan: true }` returns `cleanupFindings()`: `{ items: [{ id, where, name, kind, bytes, folder? }], bytes }` (`folder` on `notepad:` items only), ids `session:<sid>` (the `staleSessions()` rule, and every file in the folder that old too, never the serving sid), `console:<name>` (anything at the top of the console home but `PROTECTED_CONSOLE_FILES`, `sessions` and `runtime`, directories too) and `root:<name>` (anything at the top of `~/.plan2code` but `KEPT_PLAN2CODE_ENTRIES`: `console`, `bin`, `launcher.json`, `install.json`, `models.json`, `handoffs`, `notepads`, `app`, `app.json`, `agents.json`, `prototypes`, `learning`), `notepad:<key>` (a month-old notepad, whole; see Notebook below) and `completed:<name>` (each folder or link directly under the session worktree's `specs--completed/` whose newest mtime is older than the session age, 30 days; loose files there stay; the server passes `project: sessionWorktree() || PROJECT`, and without a `project` the archive is never scanned). Both stray kinds must be untouched for `STRAY_GRACE_MS` (an hour, by the newest `lstat` mtime anywhere inside, since rewriting a file never moves its folder's mtime; unreadable reads as fresh): the same folders hold `workspaces.json.lock` and `writeJsonAtomic()`'s `<file>.<pid>.tmp`, which live for milliseconds. `root:` is only scanned when the console home is `<PLAN2CODE_MODELS_DIR or ~/.plan2code>/console`, so a test or dev home never reaches the real folder. Paths never go to the page. `{ delete: [id] }` runs `removeCleanup()`, which re-scans and removes only ids still on the fresh list (symlinks unlinked, never followed), returning `{ removed, bytes, failed, refused, refusal }`. So Cleanup is the one place the server deletes in a project, and it keeps a completed spec git could not give back: `completedSpecs()` marks each `completed:` item `tracked` only when `git ls-files` lists it and `git ls-files --others` lists nothing inside (outside a repository, or gitignored as `specs--completed/` is by default, it is untracked), and `removeCleanup()` refuses an untracked one into `refused`, with `refusal` the line the page's status shows. Nothing records a backup copy, so tracked by git is the only way through. The page always shows the list before **Delete these**.
- **The console's path is stated, not searched for.** Each Interface line names `references/web-console/` beside the SKILL.md and the `~/.plan2code/console/console-dir` fallback; the prompts with room (all but pathfinder, plan, document and finalize, which sit near the char limit) also name the canonical global install path `~/.agents/skills/<skill>/references/web-console/` (the skills CLI's real store; every agent dir links into it), and every `console.mjs open` writes `HERE` to `~/.plan2code/console/console-dir` (only `open`, so a `help` or dev run from `src/` never repoints it) so a later session can read the path from a fixed place. Without these the agent hunts the skill install dirs on every session.
- **`open` needs no payload, and runs first.** `--file` and `--title` are optional (the title defaults to the folder name). Every skill's Interface line puts `node "<D>/console.mjs" open --workflow <w>` BEFORE reading console.md or the project, and a test (`every skill opens the console before it reads anything`) keeps it that way; a blank session renders a starting screen ("Starting Pathfinder", Planny in flight) until the first post. Every skill replaces the flight with its own animated pose (init — init-update borrows it — pathfinder, plan — revise-plan borrows it — document, implement — implement-review borrows it — finalize, quick-task, review, handoff; only the dashboard keeps the flight), cloned by `startStage()` in `screens/starting.js` from `<template id="start-poses">` in `index.html` and animated under `.pose` in `styles/poses.css`; each `SKILLS` entry's `pose` in `skills.js` is the list (`START_POSES`/`startPose()` in `answers.js` read it), and a test keeps the template in sync with it and every catalog workflow mapped to a pose. The same pose stands above the waiting pane (`.waiting-pane`, agent working with an `activity` and nothing to ask). `posePane()` keeps the pane on screen across renders when the pose is unchanged — `renderMain()` holds any `:scope > [data-pose]` child back from the clear — so the SVG never leaves the DOM, its animations never restart on a state frame, and Planny carries unbroken from launching → starting → waiting. The dashboard's launch hand-off resumes first and reads the launched skill's file after.
- **Terminal or web console is remembered, not asked every run.** Each of the 21 non-dashboard skill Interface lines runs `node "<D>/console.mjs" interface` first and follows the `rule` it prints: a cue in the request (`--web`, `Use the web console for this session.`, `--terminal`, or plain words asking for one) wins for that session, then the saved default, and only with neither does the agent ask, saving the answer with `interface --set web|terminal` (`ask` clears it). The default is one per-user file, `INTERFACE_FILE` = `~/.plan2code/console/interface.json` (`{ interface, at }`, read by `savedInterface()` in `files.mjs`; anything unreadable or unknown reads as `null`). It is deliberately not a `looks.json` key: the page re-POSTs its whole in-memory looks object, which would put back a stale value. The rule text lives only in `interfaceRule()` in `cmd-small.mjs`, so every prompt shares one copy that cannot drift; mid-session switching is `console-interface.md` → Switching mid-session. Tests: `interface …` and `every skill but the dashboard picks its interface through the interface command`. Next-step commands a prompt prints (NEXT STEP lines, resume footers and Pathfinder's `trail.md`) stay bare with an "add `--web` for the web console" note beside them: a baked-in `--web` would override a terminal default. The page's `handoffText()` appends `--web` itself for console sessions.
- **`open` needs no payload, and runs first.** `--file` and `--title` are optional (the title defaults to the folder name). Every skill's Interface line puts `node "<D>/console.mjs" open --workflow <w>` (after `interface`, before anything else) BEFORE reading console.md or the project, and a test (`every skill opens the console before it reads anything`) keeps it that way; a blank session renders a starting screen ("Starting Pathfinder", Planny in flight) until the first post. Every skill replaces the flight with its own animated pose (init — init-update borrows it — pathfinder, plan — revise-plan borrows it — document, implement — implement-review borrows it — finalize, quick-task, review, handoff; only the dashboard keeps the flight), cloned by `startStage()` in `screens/starting.js` from `<template id="start-poses">` in `index.html` and animated under `.pose` in `styles/poses.css`; each `SKILLS` entry's `pose` in `skills.js` is the list (`START_POSES`/`startPose()` in `answers.js` read it), and a test keeps the template in sync with it and every catalog workflow mapped to a pose. The same pose stands above the waiting pane (`.waiting-pane`, agent working with an `activity` and nothing to ask). `posePane()` keeps the pane on screen across renders when the pose is unchanged — `renderMain()` holds any `:scope > [data-pose]` child back from the clear — so the SVG never leaves the DOM, its animations never restart on a state frame, and Planny carries unbroken from launching → starting → waiting. The dashboard's launch hand-off resumes first and reads the launched skill's file after.
- **The dashboard scan knows whether the folder is a git repository.** `scanProject()` returns `{ hasAgents, isGit, pending, specs }`; `isGit` comes from `insideGitRepo()`, the same filesystem walk `findRoots()` does (no `git` process, linked worktrees and submodules count, a set `GIT_DIR` / `GIT_WORK_TREE` / `GIT_COMMON_DIR` counts as a repo). The Git card is never grayed, since a clean tree still has branches to switch, pull and push. When `isGit` is `false` the card shows `GIT_INIT_NOTE` ("Not a git repository yet: it offers to start one") as its detail line; a scan with no `isGit` counts as a repo. In a repo, `pending` is `pendingFiles()` in `sessions.mjs`, which calls `countPending()` in `git-repo.mjs`: one bounded `git status --porcelain -z` under `GIT_OPTIONAL_LOCKS=0` (`null` when git cannot say) counting modified, staged, deleted and untracked paths. Above `0` the detail line is `pendingNote(n)` ("3 files to commit"); `0` and `null` show no note. A finish with `commit: true` puts a **Commit it now** button on the finished screen (`commitOffer()`, `renderCommitOffer()`); its `__commit` press makes the agent resume as `git` in the same session and run the commit flow above the board. `open --resume` treats any switch into `git` (this press, or Changelog's "Commit this now?") as a hop, like a dashboard launch: `switchWorkflow()` blanks the page, finish and the last run's `state.git` included, and `draft.json` goes. Without that, the old finish outlived the switch, and the page sat on the old ending above the new questions and the board. A confirm item may carry `files: [{ path, state }]`, drawn as a collapsed table by `filesTable()`. Subagents is **on** by default for the sixteen opted-in skills (`defaultSetting()`); a saved Off stays off.
- **The start path is timed, and `open` is built around it.** Measure with `node scripts/bench-web-console.mjs` (`--browser-delay 900` for a real Chrome launch, `--roundtrip` for Send→agent and post→page, `PLAN2CODE_CONSOLE_TRACE=1` on `open` for a step timeline). Four things make it fast, and each is load-bearing:
- **No git process.** `repoRoots()` in `sessions.mjs` finds the common dir and worktree top by walking to `.git` (following `gitdir:` and `commondir` files) — each `git rev-parse` cost 150ms+ on Windows. It asks git only when `GIT_DIR`/`GIT_WORK_TREE`/`GIT_COMMON_DIR` relocate the repo, and uses the native realpath so an 8.3 short name keys the same project git would.
+2 -2
View File
@@ -9,7 +9,7 @@ Optional local browser UI shipped with **every** skill. Source lives in `src/web
| File | Role |
|---|---|
| `console.mjs` | the CLI the agent drives: `open`, `post`, `wait`, `chat` (the instant Quick question check), `keep`, `forget` (copy a cited note attachment into `specs/<idea>/attachments/`), `delete-spec`, `handoff new`, `delete-handoff` (both on `handoffs.mjs`), `status`, `stop`, `help` (a compact summary for an agent that found the binary but not `console.md`; `help <topic>` prints one contract file, `help topics` lists them). `post --wait <N>` posts and waits in one command |
| `console.mjs` | the CLI the agent drives: `open`, `post`, `wait`, `chat` (the instant Quick question check), `keep`, `forget` (copy a cited note attachment into `specs/<idea>/attachments/`), `delete-spec`, `handoff new`, `delete-handoff` (both on `handoffs.mjs`), `status`, `stop`, `interface` (the saved terminal or web console default and the rule each skill follows; `--set` changes it), `help` (a compact summary for an agent that found the binary but not `console.md`; `help <topic>` prints one contract file, `help topics` lists them). `post --wait <N>` posts and waits in one command |
| `server.mjs` | HTTP server, spawned **detached** by `open` (never as a harness background task, which get killed on compaction and at assorted timeouts) |
| `cmd-chat.mjs` | the `chat` command: hand over Quick questions now, never waiting |
| `cmd-help.mjs` | the `help` command: the CLI's usage and the contract's topic files; the usage's workflow list and its build sessions come from `WORKFLOWS` and `isBuild()` in `skills.js` |
@@ -46,6 +46,6 @@ Optional local browser UI shipped with **every** skill. Source lives in `src/web
| `picker.mjs` | the per-OS native folder picker behind **Browse…** (`pickerCommand()` → `{ command, args, env }` or `null`; `pickFolder()` runs it with async `spawn`, so the server keeps serving while the dialog is open). Copied from `src/launcher/plan2code.js` (self-contained CommonJS, so it cannot be shared) with the prompt as a parameter; a drift test keeps the two in step |
| `update-check.mjs` | the dashboard's release check, server-only (never in `SERVABLE`): `compareVersions()` (numeric X.Y.Z, `null` otherwise), `latestTag()` (the highest `refs/tags/vX.Y.Z`, peeled `^{}` and pre-release tags skipped), `checkForUpdate({ installed, cacheFile, now, run })` (never throws) and `runLsRemote()` (`git ls-remote --tags` on the repo: no shell, `GIT_TERMINAL_PROMPT=0`, `GCM_INTERACTIVE=never`, SSH `BatchMode` when `GIT_SSH_COMMAND` is unset, `windowsHide`, killed at 10 s; git authenticates itself, the console never touches a credential). The answer, failures included, is cached for an hour in `~/.plan2code/console/update-check.json` (`UPDATE_CHECK_FILE`, in `PROTECTED_CONSOLE_FILES` so no sweep removes it). `server.mjs` starts it after the ready line and never awaits it; `stateFrame()` carries `update: { installed, latest }` only when a newer release exists (its `latest` is part of `haveKey()`, so a page that connected first still gets it), and `GET /version` returns `{ version, latest }`. Tests seed a fresh cached failure in every console home, so no test server reaches the network. The `plan2code` launcher reads the same cache for its terminal release notice (a copy of this module sits in `~/.plan2code/bin/`) |
| `console.md` | the core of the agent-facing contract, read once per conversation (every skill ships the same copy, so a dashboard hop never re-reads it): starting, the turn (`post --wait`, the exit codes, handling a send, `settle`), posting, the payload and its kinds, documents (including `file` blocks), the house rules, and an index of the topic files below with the moment each is read. A test caps it at 24,000 characters |
| `console-finish.md` · `console-stop.md` · `console-chat.md` · `console-workspace.md` · `console-subagents.md` · `console-launches.md` · `console-meter.md` · `console-attachments.md` · `console-trouble.md` | topic files, each read only when its moment first comes: finishing (the finish and its buttons), stop requests (the way home mid-workflow, `stopWarning`, resuming a pause), Quick questions, the Workspace, standing instructions and helper reports, dashboard launches and the menu payload, the session meter's `run` events (read only when a `run` is refused: the notes inline every `run`), keeping a cited note attachment, and recovery |
| `console-finish.md` · `console-stop.md` · `console-chat.md` · `console-workspace.md` · `console-subagents.md` · `console-launches.md` · `console-meter.md` · `console-attachments.md` · `console-trouble.md` · `console-interface.md` | topic files, each read only when its moment first comes: finishing (the finish and its buttons), stop requests (the way home mid-workflow, `stopWarning`, resuming a pause), Quick questions, the Workspace, standing instructions and helper reports, dashboard launches and the menu payload, the session meter's `run` events (read only when a `run` is refused: the notes inline every `run`), keeping a cited note attachment, recovery, and the interface pick (when to ask, switching mid-session) |
| `notes/<workflow>.md` | per-workflow notes (`init` for both inits, `pathfinder` with Briefs, `plan`, `revise-plan`, `document`, `implement` for both builds, `loop` for a build the desktop app's Implementation Loop runs with `--loop` (where it reports a `loopOutcome` instead of asking for sign-off), `quick-task`, `review`, `finalize`, `handoff`, `changelog`, `git`, `xray`, `diagnose`, `pr-prep`, `test`, `dead-code`, `ui-prototype`). Each skill's Interface line reads `<D>/console.md` and its own notes file right after `open`; a test checks every skill names one that exists |
| `building.md` · `building-review.md` | the build half of the contract, for `implement`, `implement-review` and `quick-task`: progress posts (`agent.activity`, `agent.quietMinutes`, `file` blocks re-read with `refresh`), the chat check between tasks, questions mid-build and stop requests; `building-review.md` is the review run on the page (the sign-off's `review` verdict, **Review it now**, Implement + Review's Stage 2, Finalize's Step 2.5), read only when asked for |
@@ -33,9 +33,9 @@ If `devin` is on PATH (`command -v devin` in bash, `Get-Command devin` in PowerS
devin models list
```
Show its raw output to the maintainer before any interpretation — the format is not a stable contract. The output is long (hundreds of ids across about twenty families), so save it to a scratch file outside the repo, say where, and show the family headings in full. From it, take the explicit ids at Low, Medium and High effort only, plus `adaptive`. Skip every id the Validation rules forbid (`xhigh`, `max`, `fast`, `priority` endings), and also skip `none`-effort ids, ids with no effort suffix (such as `swe-1-7`, which is a Max model), and `fusion-*` combinations.
Show its raw output to the maintainer before any interpretation — the format is not a stable contract. The output is long (hundreds of ids across about twenty families), so save it to a scratch file outside the repo, say where, and show the family headings in full. From it, take the explicit ids at Low, Medium and High effort only, plus `adaptive`. Skip every id the Validation rules forbid (`xhigh`, `max`, `fast`, `priority` endings), and also skip `none`-effort ids, ids with no effort suffix (such as `swe-1-7`, which is a Max model), and `fusion-*` combinations. A `fusion-*` id the file already ships still counts as offered while the output lists it verbatim, so it is never reported **gone**.
The 30-entry cap means the file can never hold every family at three efforts. Propose additions by family — newest and most-used first — and say how many entries that leaves.
The 30-entry cap means the file can never hold every family at three efforts. List every family the file lacks, and propose an addition only when independent evidence supports it: third-party coding-agent benchmarks and real user reports, not the vendor's launch claims or the release date. Name the deciding sources. A model too new for that evidence waits for a later run. At the cap, propose what to drop to make room (superseded or weaker-evidenced entries, Low efforts first), and say how many entries that leaves. Never answer "no change" only because the list is full.
If `devin` is not on PATH or the command fails, say so with the error, and switch to **guided manual edits** for Devin: ask the maintainer which ids to add, remove or relabel, one at a time, and carry those into Step 7 as the proposed list.
@@ -51,7 +51,7 @@ Look up Codex's current model documentation (locate it on each run). Propose `co
### Step 4c: Check the strengths mapping
`models.json` also has a top-level `strengths` object: for an agent id, the loop's `thrifty`, `balanced` and `best` words, each `{ "model", "effort"? }`. After Steps 3 to 4b settled the refreshed lists, check that every `strengths` row still names a `model` that is in that agent's refreshed list (an `effort` is kept only for an agent that takes one, and is `low`, `medium` or `high`). For a row whose model is **gone**, propose a replacement from the same family, one step lighter or stronger as the word implies (Thrifty lighter, Best stronger), and show it in Step 7's table as a `strengths.<agent>.<word>` change. Never add a mapping for an agent that has none: only agents already under `strengths` are checked.
`models.json` also has a top-level `strengths` object: for an agent id, the loop's `thrifty`, `balanced` and `best` words, each `{ "model", "effort"? }`. After Steps 3 to 4b settled the refreshed lists, check that every `strengths` row still names a `model` that is in that agent's refreshed list (an `effort` is kept only for an agent that takes one, and is `low`, `medium` or `high`). For a row whose model is **gone**, propose a replacement from the same family, one step lighter or stronger as the word implies (Thrifty lighter, Best stronger), and show it in Step 7's table as a `strengths.<agent>.<word>` change. A model that is still offered can also be replaced, but only when the same evidence as in Step 3 shows the candidate does that word's job better at a cost it can bear. Show both prices. Never add a mapping for an agent that has none: only agents already under `strengths` are checked.
### Step 5: Re-check the agent list against vendor docs
@@ -76,10 +76,12 @@ For `models.json`, compare the discovered list with the current one by `id` and
| --- | --- | --- | --- | --- |
| added | `new-id` | — | New label | `devin models list` |
| gone | `old-id` | Old label | — | not in `devin models list` |
| dropped | `kept-id` | Old label | — | still offered; removed to make room (reason) |
| relabeled | `same-id` | Old label | New label | Claude Code docs: <page> |
- **added:** offered by the CLI, not in the file.
- **gone:** in the file, no longer offered.
- **dropped:** in the file and still offered, removed to stay within the 30-entry cap (Step 3).
- **relabeled:** same `id`, a better or changed label. Propose a label in the file's existing style: the description only (see Step 2), never repeating the id.
For `agents.json`, show one table with one row per changed field:
@@ -90,7 +92,7 @@ For `agents.json`, show one table with one row per changed field:
| added | `cursor` | new template | | template entry | <vendor docs page> |
| gone | `gemini` | whole entry | template | | skills no longer confirmed |
Summarize unchanged entries as a count under each table ("19 Devin entries unchanged", "3 built-ins unchanged") instead of listing them. If approving every **added** Devin row would take the list past 30 entries, say so above the table and by how many. Call out any likely rename before approval (see the rename warning under Validation rules). If all tables are empty, say the files are current and stop.
Summarize unchanged entries as a count under each table ("19 Devin entries unchanged", "3 built-ins unchanged") instead of listing them. If the approved **added** and **dropped** Devin rows together would take the list past 30 entries, say so above the table and by how many, and write nothing until the total fits. Call out any likely rename before approval (see the rename warning under Validation rules). If all tables are empty, say the files are current and stop.
### Step 8 — Approve each change
@@ -101,7 +103,7 @@ Ask about each row, one at a time: **yes**, **no**, or **edit** (they type the v
Apply only the approved rows:
- Keep `_note` in `models.json` and `schema` in `agents.json` verbatim.
- Keep the existing order. Remove a **gone** entry where it stands, change a **changed** or **relabeled** value in place, and append each **added** entry at the end of its list.
- Keep each list in logical order: grouped by vendor family, lighter models before stronger ones, Medium before High, with Claude's `default` first. Remove a **gone** or **dropped** entry where it stands, change a **changed** or **relabeled** value in place, and insert each **added** entry where it belongs in that order, not at the end.
- Write two-space-indented JSON with a trailing newline, matching each file's current formatting.
### Step 10 — Validate
+3 -13
View File
@@ -82,25 +82,15 @@ If `$CHANGELOG_VERSION` > `$RELEASE_VERSION`, compute:
- `title = "v$CHANGELOG_VERSION"` (plan2code keeps the `v` prefix in release titles)
- `notes` = the header line `# What's New 🎉`, one blank line, the **fixed header** below (with `$CHANGELOG_VERSION` filled in), one blank line, then the **highlights**, one blank line, then `$SECTION` verbatim (`$SECTION` already starts with the `## vX.Y.Z` heading). Build this as a real multi-line string with **actual newlines** — the `\n\n` shorthand shown elsewhere means "a blank line," never the literal two-character sequence `\` + `n`. Getting this wrong would run the header and the first CHANGELOG heading together with a stray `\n\n` in the published body.
**The fixed header** (the same on every release, so a visitor to the release page finds the install and update commands and the right file without reading the changelog):
**The fixed header** (the same on every release, so a visitor to the release page finds the install and update commands without reading the changelog):
````markdown
**Install:** `npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git#release`
**Update:** `plan2code update`
The installer downloads the right app for your system and puts it in place for you, so you only need the files below for a manual download.
| Your system | File |
| --- | --- |
| Windows (64-bit Intel or AMD) | `plan2code-app-$CHANGELOG_VERSION-windows-x64.exe` |
| macOS (Apple silicon) | `plan2code-app-$CHANGELOG_VERSION-macos-arm64` |
| macOS (Intel) | `plan2code-app-$CHANGELOG_VERSION-macos-x64` |
| Linux (64-bit Intel or AMD) | `plan2code-app-$CHANGELOG_VERSION-linux-x64` |
| Any system: check a download | `plan2code-app-$CHANGELOG_VERSION-SHA256SUMS.txt` |
The app files are not code-signed. See [the desktop app guide](https://github.com/jparkerweb/plan2code/blob/main/docs/desktop-app.md#the-app-is-not-code-signed) for what your system may ask and how to answer.
````
Do not add the manual-download file table, the installer paragraph or the "not code-signed" note to the notes: the maintainer does not want them in release bodies.
Check the install command against the README's "See it" line before publishing; if it has changed, the README wins.
**The highlights** (written fresh for each release, from `$SECTION`): a `### Highlights` heading and exactly three bullets, each one plain sentence about what a person can now do or no longer trips over (no file names, no internal terms). The full list follows below them. When `$SECTION` already opens with its own `### Highlights` block (the changelog format from 3.1.0 on), reuse those bullets as they are: add no second Highlights block.
+26 -1
View File
@@ -12,7 +12,32 @@ the workflow. Follow this launcher exactly.
## What you (the agent) must do
1. **Ask the user for the password.** Request the decryption passphrase (via
0. **Try the local key first.** The repo root may hold a git-ignored `.env`
file with a `SYNC_REPO_KEY=` line: the sync password. If the file exists and
defines that key, do NOT ask the user. Decrypt with it, reading it inside the
command so its value never appears in the conversation or in a command line:
- **bash:**
```bash
SKILL_PASSWORD="$(node -e "const m=require('fs').readFileSync('.env','utf8').match(/^SYNC_REPO_KEY=(.*)$/m);process.stdout.write(m?m[1].trim().replace(/^(['\"])(.*)\1\$/,'\$2'):'')")" node ./.claude/skills/sync-repo/decrypt.mjs ./.claude/skills/sync-repo/sync-repo.enc
```
- If the file is missing, the key is absent or empty, or decryption fails
(exit code 1), fall through to step 1 and ask the user as usual. Say in one
line which of those happened. Never print, echo or summarize the key's value,
and never write it anywhere. `.env` stays out of git (it is in `.gitignore`);
never stage or commit it.
- When the file or the key is missing (not when the key merely failed to
decrypt), tell the user how to set it up for next time, in a few lines:
create a file named `.env` in the repo root containing the single line
`SYNC_REPO_KEY=<the sync password>`, and make sure `.env` is listed in
`.gitignore` (add it if not) so it is never committed. Reading it from
`.env` is preferred because the password then stays out of the transcript.
Entering the password in the agent window (step 1) still works, so do not
block on the setup: continue with step 1 right away. If the key is present
but did not decrypt, say it looks wrong and to correct it in `.env`.
- Later steps that need the password (`set-synced.mjs`) read it the same way.
1. **Ask the user for the password** (only when step 0 did not work). Request the decryption passphrase (via
AskUserQuestion or a plain prompt). Do NOT proceed without it. Tell the user
it will be passed to a local script via an environment variable, never written
to disk, and warn them that — because you must run the command — the password
+1 -1
View File
@@ -1 +1 @@
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 truncated
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 truncated
+1
View File
@@ -1,3 +1,4 @@
.env
specs/
specs--completed/
dist/
+3 -8
View File
@@ -104,16 +104,11 @@
- About: plan2code-app/ui/theme-early.js
- Noted: 2026-11-17, implement-review
### The launcher's prompts each open a new readline on stdin, so a test piping several answers at once loses all but the first; drive a multi-prompt flow by writing each answer after a short delay.
### To drive several launcher prompts in scripts/test-launcher.mjs, use runAtTerminal(): each prompt opens a new readline on stdin, so piping all answers at once loses every one after the first.
- Kind: how-it-works
- About: src/launcher/plan2code.js
- Noted: 2026-11-15, implement-review
### To drive launcher prompts in scripts/test-launcher.mjs, use runAtTerminal(): it marks stdin as a terminal with a preload file and answers each prompt only once it shows on stdout.
- Kind: convention
- About: scripts/test-launcher.mjs
- About: src/launcher/plan2code.js, scripts/test-launcher.mjs
- Why: Each launcher prompt opens a new readline, so piping all answers at once loses every answer after the first.
- Noted: 2026-11-17, implement-review, checked 2026-11-28
- Noted: 2026-11-15, implement-review
### To run plan2code-app/ui/app.js in a page test, serve the ui folder over HTTP and stub window.__TAURI__, with platform_info answering { os }; from file:// the module never loads.
- Kind: how-it-works
+1 -1
View File
@@ -3,7 +3,7 @@
The small games behind the die in the web console's top bar. This is the full guide to each game and to the rules they share; the console guide has the short version. Back to [the web console guide](web-console.md#activities).
The **die** in the top bar, right of the megaphone, opens **Activities**: small
The **die** in the top bar, right of the text size buttons, opens **Activities**: small
games to play while you wait, say through a long build. Thirteen ship today,
**Snake**, **Mini golf**, **Light Trails**, **Bug Hunt**, **Sunset Drive**, **Stack Deploy**, **Bumper Ring**, **Rapids Run**, **Hot Potato**, **Crossing Rush**, **Bounce Road**, **Ghoul Rush** and **Flock Dash**. The window opens on a
**picker**: a row per game, in two columns on a wide window, with a small cover
+3 -2
View File
@@ -171,8 +171,9 @@ The same journey is four commands, each in a new conversation:
3. `/plan2code-3-implement specs/task-api/overview.md`, once per phase. It finds the next open phase itself.
4. `/plan2code-4-finalize specs/task-api/overview.md`. Verifies, updates docs, and archives the spec.
Add `--web` to any of them (for example `/plan2code-1-plan --web`) to open that step straight on the
web console without being asked. Every command and argument is in the README's
Typed on their own they start in your saved default (say "make the terminal my default" once to
set it; until then they ask). Add `--web` to any of them (for example `/plan2code-1-plan --web`) to
open that step straight on the web console for one session. Every command and argument is in the README's
[Prefer the terminal?](../README.md#prefer-the-terminal) section. You can switch between terminal and
console at any point, because the files under `specs/` are the only state.
+1
View File
@@ -169,6 +169,7 @@ origin.
| `POST /open-prototype` | `{ spec, name }`: opens one `.html` from `<spec>/prototypes/` in the person's default browser. 404 for any other name, 500 when no browser could start. |
| `GET /handoff?id=<id>` | *Read it all*: the handoff's `.md` from `~/.plan2code/handoffs/`, as `text/markdown` with `cache-control: no-store`. A dashboard only, and only an id its own scan listed: a used, unknown or malformed id is 404. |
| `POST /learning/pause` | Pause for me: `{ paused: boolean }` (origin-checked; anything else is 400 `bad-request`, and 409 `not-on` unless Learning is On or Paused for you). Writes the personal pause on this machine only (`pause.json` under `~/.plan2code/learning/<key>/`), the server's only write for Learning, and repaints the row with no agent. |
| `POST /learning/tidy-quiet` | Tidy-up quiet: an empty JSON object (origin-checked; 409 `not-on` unless Learning is On). Stores a fingerprint of the saved lessons in `tidy-quiet.json` beside `pause.json`, so `scan.learning.nearCap` stays false until a lesson file changes. Sent by the banner's Not now and by a Tidy up that proposed nothing; repaints with no agent. |
| `GET /learning/state` | The Learning row's state worked out now, `{ state, pausedSince, waiting, oldestDays, nearCap }` (`{}` when the project's settings file is from a format it cannot read), with `cache-control: no-store`. |
| `GET /learning/lessons` | Open the lessons, read only: `{ files: [{ name, title, text }], follows: { <lesson id>: { count, last } } }` (follows from this machine's `follows.ndjson`, for the reader's "Followed N times" line) from the project's lessons (`.plan2code/lessons/`, saved with the repository), `general.md` first, then the other `.md` files in name order (plain files only, at most 100 of 512 KB each), with `cache-control: no-store`. |
| `GET /workspace` | The Workspace dialog's list: folders, `missing`, `remote` and the agent's folder `issues`. `?check=1` re-checks every folder on disk first. |
+3 -2
View File
@@ -30,7 +30,8 @@ inside it, or add `--web` to a skill (`/plan2code-1-plan --web plan a lunch voti
**Where next.** [walkthrough.md](walkthrough.md) follows one feature from the first idea to the
last phase. The rest of this file is the reference: every card, button and rule. Prefer the terminal?
Run the same commands without `--web` and answer there; the files under `specs/` are identical.
Answer **terminal** the one time a skill asks (or add `--terminal`); the
files under `specs/` are identical.
---
@@ -116,7 +117,7 @@ The easy way in is the dashboard: type `/plan2code` in your agent, or run `plan2
- **Learning.** A row shows *Not set up*, *Off*, *On* or *Paused for you*; **Pause for me** pauses it for you alone. A banner offers **Review** while lessons are waiting. Before you see them, each waiting lesson is checked against the code by a separate reader, and the card shows any Doubt or Fail with its reason (and, where it helps, a better wording to use); you still decide. The lessons reader shows how often each lesson was followed. **More, Tidy up lessons** (and a banner nudge once general lessons reach 22 of 25, or an area file 30) has the agent propose merges, rewords, retires and moves, one change each, checked like any lesson and applied only on your **Apply**. Kept lessons go to `.plan2code/lessons/` in the project; waiting lessons and your pause stay on this machine, and nothing is committed for you.
- **Planny wakes up.** A fresh dashboard starts with him asleep; click to wake him (**Skip** or Escape skips it, and reduced motion shows the awake dashboard at once).
Or start any step by its command (the full list is in the README's [Prefer the terminal?](../README.md#prefer-the-terminal) section), and add `--web` to open the console without being asked: `/plan2code-1-plan --web plan a lunch voting app`. Without it, the first question is "In your browser (suggested)" or "Here in the terminal". The page opens straight away at a `127.0.0.1` address, with a starting screen while the skill reads your project. You can switch to the terminal at any point: the files under `specs/` are the same either way.
Or start any step by its command (the full list is in the README's [Prefer the terminal?](../README.md#prefer-the-terminal) section). Until you save a default, it asks "In your browser (suggested)" or "Here in the terminal" each time; say "make the terminal (or web console) my default" and every skill in every project starts there (saved in `~/.plan2code/console/interface.json`). Add `--web` or `--terminal` to use the other one for one session (`/plan2code-1-plan --web plan a lunch voting app`), or just ask for it in your request; say "make the web console my default" to change it, or "ask me again" to clear it. One-session choices never change your default, and a task that is only *about* web code is not a request for the console. The page opens straight away at a `127.0.0.1` address, with a starting screen while the skill reads your project. You can switch to the terminal at any point: the files under `specs/` are the same either way.
While the page is open, the agent's messages in the terminal end with `→ Look at the web console` and, while it waits on you, say *Waiting on your answer in the web console*.
+2 -2
View File
@@ -36,11 +36,11 @@ Details: [Status line](./.agents-docs/AGENTS-architecture-statusline.md)
## Web Console
Optional local browser UI (`src/web-console/`, zero dependencies, detached `node` server on `127.0.0.1`) installed once under `~/.plan2code/console/<version>/` (`installSharedConsole` in `install.js`) and reached from every skill through a forwarding stub, `src/web-console-stub/console.mjs`. The bare `plan2code` skill opens its dashboard, a card menu that launches any skill in the same session. Pages cover questions, sign-off gates (with an in-page code review, and in Implement, Implement + Review and Quick task a **Changes** tab: a `diff` doc block fed by the `changes.mjs` skill script, parsed by `public/diff-parse.js` and drawn by `public/diff-view.js`), build progress, the living document, a spec's saved prototypes (a **Prototypes** tab: an `.md` read in place, an `.html` opened in the default browser), an **Ask** chat, a read-only **Workspace** of extra folders (remembered per folder and spec in `~/.plan2code/console/workspaces.json`), a session meter, a **git board** for the `git` workflow (a Save, Share, Review, Tidy path, one task card for the step you are on, and the Changes, Branches and Sync tabs folded into **All branches and tools**; branches, pull, push, commits and pull-request links, drawn from `state.git`; contract in `notes/git.md`), **Stop with a handoff** (handoffs live in `~/.plan2code/handoffs/`, owned by `handoffs.mjs`, swept after 30 days, and offered as dashboard chips to pick up in the same session), a private **Notebook** in the top bar (named tabs of Markdown and pictures, a live-preview CodeMirror editor, one notepad per folder in `~/.plan2code/notepads/`, owned by `notepads.mjs`, private: the agent reads a tab only when you start Pathfinder, Plan, Quick task, Diagnose, UI Prototype or Revise plan from the dashboard with it and send the box it fills (an idea box marked `fill: "note"`, up to five ticked pictures attached), which then marks the tab sent via `POST /notepad/tab/sent`; the agent CLI never imports the store; removed only through Cleanup once a month untouched), **Activities** behind the top bar's die (thirteen small games, Snake, Mini golf, Light Trails, Bug Hunt, Sunset Drive, Stack Deploy, Bumper Ring, Rapids Run, Hot Potato, Crossing Rush, Bounce Road, Ghoul Rush and Flock Dash, listed in `public/activities.js` with one module per game under `public/activities/` (Ghoul Rush is its own folder of modules, `public/activities/ghoul-rush/`) and a card line (`blurb`) each, a picker of game rows in two columns, ordered Recently played or A to Z (saved in `activityOrder`), with never-picked games under Not played yet, once two are listed, that plays one game at a time (another pick drops the last game's round), driven by `screens/activities.js` (keys, key releases for a game with `release()`, canvas pointer events for a game with `pointer()`, one frame timer), paused whenever the person's turn comes and resumed only by the person (while that pause's banner is up, only by its **Unpause game** button), best scores in flat `activityBest<Id>` keys in `looks.json` (and the time each game was last picked in `activityPlayed<Id>`) (lowest wins for a game that sets `lowerIsBetter`; Mini golf opens on a dashboard of its six 18-hole courses, one file each under `public/activities/golf-course-<id>.js`, and keeps a best per course, `activityBestGolf<Course>`), and one number a game may keep between sessions in `activityMemo<Id>` (Snake's tally of surprises found, Light Trails' furthest arena, Bug Hunt's tally of finds, Sunset Drive's roads found, Stack Deploy's highest floor, Bumper Ring's furthest arena, Rapids Run's furthest dam, Hot Potato's furthest venue, Crossing Rush's furthest zone, Bounce Road's furthest stage, Ghoul Rush's most stages cleared in a run, Flock Dash's furthest stage), never shown to the agent), a built-in 24-topic Help, the app-only **Implementation Loop** (a dashboard card and a setup screen drawn by the page, `public/screens/loop-setup.js`; the last setup remembered per project in `~/.plan2code/console/loop-setup.json`, owned by `loop-setup.mjs`; a page that locks while `state.loop.driving` is set, until the app posts `loopEnd`; a skill run with `--loop` reports a `loopOutcome` instead of asking for sign-off, per `notes/loop.md`), the app-only **Review Loop** (a card beside it, `screens/review-loop-setup.js`, the setup remembered in `~/.plan2code/console/review-loop-setup.json` owned by `review-loop-setup.mjs`; the app's `review_loop.rs` drives review-and-fix rounds, each a Review session opened with `--loop --round N --role` that reports a `roundOutcome` per `notes/review-loop.md`; its end screen is `public/review-loop-end.js`), a first-run Welcome, User Preferences (gear: four tabs, Appearance, Agents & models, System and Sounds & activities, on the `public/tabs.js` helper Help also uses, with `public/prefs.js`, `screens/prefs-dialog.js` and `screens/agents-view.js`), an agent-less **setup** page (the `setup` workflow `plan2code` or the desktop app opens wheLine truncated
Optional local browser UI (`src/web-console/`, zero dependencies, detached `node` server on `127.0.0.1`) installed once under `~/.plan2code/console/<version>/` (`installSharedConsole` in `install.js`) and reached from every skill through a forwarding stub, `src/web-console-stub/console.mjs`. Whether a skill starts in the terminal or the console is asked each run until the person saves a default (`console.mjs interface`, saved in `~/.plan2code/console/interface.json`); `--web` / `--terminal` or plain words override it for one session. The bare `plan2code` skill opens its dashboard, a card menu that launches any skill in the same session. Pages cover questions, sign-off gates (with an in-page code review, and in Implement, Implement + Review and Quick task a **Changes** tab: a `diff` doc block fed by the `changes.mjs` skill script, parsed by `public/diff-parse.js` and drawn by `public/diff-view.js`), build progress, the living document, a spec's saved prototypes (a **Prototypes** tab: an `.md` read in place, an `.html` opened in the default browser), an **Ask** chat, a read-only **Workspace** of extra folders (remembered per folder and spec in `~/.plan2code/console/workspaces.json`), a session meter, a **git board** for the `git` workflow (a Save, Share, Review, Tidy path, one task card for the step you are on, and the Changes, Branches and Sync tabs folded into **All branches and tools**; branches, pull, push, commits and pull-request links, drawn from `state.git`; contract in `notes/git.md`), **Stop with a handoff** (handoffs live in `~/.plan2code/handoffs/`, owned by `handoffs.mjs`, swept after 30 days, and offered as dashboard chips to pick up in the same session), a private **Notebook** in the top bar (named tabs of Markdown and pictures, a live-preview CodeMirror editor, one notepad per folder in `~/.plan2code/notepads/`, owned by `notepads.mjs`, private: the agent reads a tab only when you start Pathfinder, Plan, Quick task, Diagnose, UI Prototype or Revise plan from the dashboard with it and send the box it fills (an idea box marked `fill: "note"`, up to five ticked pictures attached), which then marks the tab sent via `POST /notepad/tab/sent`; the agent CLI never imports the store; removed only through Cleanup once a month untouched), **Activities** behind the top bar's die (thirteen small games, Snake, Mini golf, Light Trails, Bug Hunt, Sunset Drive, Stack Deploy, Bumper Ring, Rapids Run, Hot Potato, Crossing Rush, Bounce Road, Ghoul Rush and Flock Dash, listed in `public/activities.js` with one module per game under `public/activities/` (Ghoul Rush is its own folder of modules, `public/activities/ghoul-rush/`) and a card line (`blurb`) each, a picker of game rows in two columns, ordered Recently played or A to Z (saved in `activityOrder`), with never-picked games under Not played yet, once two are listed, that plays one game at a time (another pick drops the last game's round), driven by `screens/activities.js` (keys, key releases for a game with `release()`, canvas pointer events for a game with `pointer()`, one frame timer), paused whenever the person's turn comes and resumed only by the person (while that pause's banner is up, only by its **Unpause game** button), best scores in flat `activityBest<Id>` keys in `looks.json` (and the time each game was last picked in `activityPlayed<Id>`) (lowest wins for a game that sets `lowerIsBetter`; Mini golf opens on a dashboard of its six 18-hole courses, one file each under `public/activities/golf-course-<id>.js`, and keeps a best per course, `activityBestGolf<Course>`), and one number a game may keep between sessions in `activityMemo<Id>` (Snake's tally of surprises found, Light Trails' furthest arena, Bug Hunt's tally of finds, Sunset Drive's roads found, Stack Deploy's highest floor, Bumper Ring's furthest arena, Rapids Run's furthest dam, Hot Potato's furthest venue, Crossing Rush's furthest zone, Bounce Road's furthest stage, Ghoul Rush's most stages cleared in a run, Flock Dash's furthest stage), never shown to the agent), a built-in 24-topic Help, the app-only **Implementation Loop** (a dashboard card and a setup screen drawn by the page, `public/screens/loop-setup.js`; the last setup remembered per project in `~/.plan2code/console/loop-setup.json`, owned by `loop-setup.mjs`; a page that locks while `state.loop.driving` is set, until the app posts `loopEnd`; a skill run with `--loop` reports a `loopOutcome` instead of asking for sign-off, per `notes/loop.md`), the app-only **Review Loop** (a card beside it, `screens/review-loop-setup.js`, the setup remembered in `~/.plan2code/console/review-loop-setup.json` owned by `review-loop-setup.mjs`; the app's `review_loop.rs` drives review-and-fix rounds, each a Review session opened with `--loop --round N --role` that reports a `roundOutcome` per `notes/review-loop.md`; its end screen is `public/review-loop-end.js`), a first-run Welcome, User Preferences (gear: four tabs, Appearance, Agents & models, SystLine truncated
One agent list and one lookup rule serve the launcher, the console and the app: `src/launcher/agents.json` (the built-ins and starter templates with per-OS install data) and `src/web-console/agent-lookup.mjs` (`loadAgentList()` and `findAgent()`, both copied by `install.js` into `~/.plan2code/bin/`); the app carries a Rust twin held to the same cases by `scripts/fixtures/agent-lookup-cases.json`.
**Learning** (lessons about a codebase, kept with it): the dashboard draws a Learning row (Not set up, Off, On or Paused for you, with a Pause for me switch and a More menu) and, while lessons are waiting, a banner with Review (plus a Tidy up nudge from the scan's `nearCap`; More, Tidy up lessons sends the `tidy` action, which writes `tidy` waiting items the same card applies), both from the scan's `learning` field (`public/screens/learning-row.js`, `public/styles/learning.css`); skills ask for approval through the `lessons` card kind. Before that card, every waiting lesson is graded by a separate check, a fresh read-only helper where the agent has one, else a labeled second pass by the same agent (`src/shared-references/lesson-check.md`; `lessons.mjs check-input` prepares, the checker judges, `check-record` stores), and the card shows each Doubt or Fail with its reason; follows ("Following a lesson") are counted on this machine only, in `follows.ndjson`, for the lessons reader. The server's only write for it is the personal pause, on this machine only (`POST /learning/pause`, under `~/.plan2code/learning/`); every change to the project's Learning files (`.plan2code/settings.json` and `.plan2code/lessons/`) goes through the `lessons.mjs` skill script, which shares one core with the scan, `src/web-console/learning.mjs`.
**Learning** (lessons about a codebase, kept with it): the dashboard draws a Learning row (Not set up, Off, On or Paused for you, with a Pause for me switch and a More menu) and, while lessons are waiting, a banner with Review (plus a Tidy up nudge from the scan's `nearCap`; More, Tidy up lessons sends the `tidy` action, which writes `tidy` waiting items the same card applies), both from the scan's `learning` field (`public/screens/learning-row.js`, `public/styles/learning.css`); skills ask for approval through the `lessons` card kind. Before that card, every waiting lesson is graded by a separate check, a fresh read-only helper where the agent has one, else a labeled second pass by the same agent (`src/shared-references/lesson-check.md`; `lessons.mjs check-input` prepares, the checker judges, `check-record` stores), and the card shows each Doubt or Fail with its reason; follows ("Following a lesson") are counted on this machine only, in `follows.ndjson`, for the lessons reader. The server's only writes for it are the personal pause (`POST /learning/pause`) and the tidy-up quiet (`POST /learning/tidy-quiet`: a Tidy up that proposed nothing, or the banner's Not now, hides the nudge until the saved lessons change), both on this machine only, under `~/.plan2code/learning/`; every change to the project's Learning files (`.plan2code/settings.json` and `.plan2code/lessons/`) goes through the `lessons.mjs` skill script, which shares one core with the scan, `src/web-console/learning.mjs`.
Building or changing an Activities game: follow the game rules in [Activities](./.agents-docs/AGENTS-architecture-activities.md) ("Building an Activities game": lives in the solid lives pill, the endless-lives code (`cheat(on)`) in every game with lives, banners placed away from the player and see-through over what matters, pausing left to the window).
Details: [Web console server and contract](./.agents-docs/AGENTS-architecture-console.md), [page](./.agents-docs/AGENTS-architecture-console-page.md), [design points](./.agents-docs/AGENTS-architecture-console-design.md), [Activities](./.agents-docs/AGENTS-architecture-activities.md) (and the Ghoul Rush and Bounce Road files it links) [.readme/web-console.md](./.readme/web-console.md) (the user guide), [.readme/activities.md](./.readme/activities.md) and [.readme/web-console-internals.md](./.readme/web-console-internals.md) (routes, security, driving it by hand, refreshing screenshots)
Why the agent-facing console docs are shaped as they are (the card, pointers, refusals): [Web Console Contract](./.agents-docs/AGENTS-web-console-contract.md); it never ships.
+28
View File
@@ -4,6 +4,34 @@ All notable changes to Plan2Code will be documented in this file.
<!-- Format from 3.1.0 on: `## vX.Y.Z (YYYY-MM-DD)` with the date from version.json; a minor release opens with a three-bullet `### Highlights`; sections run Added, Changed, Fixed; game changes sit under one Activities line; tooling and test lines go under "For contributors". Older headings have no date and are not backfilled. -->
## v3.2.2 (2026-11-30)
### ✨ Added
- **Remembered interface**: a skill started on its own opens in your saved default, terminal or web console, instead of asking every run. With no default saved it asks as before, and saves nothing until you say "make the terminal (or web console) my default" (`console.mjs interface --set`, saved in `~/.plan2code/console/interface.json` for every project). `--web`, `--terminal` or plain words override it for one session, and a session can switch either way mid-run. The desktop app and the dashboard always use the web console. Next-step commands are printed bare, with a note that `--web` opens the web console; the console's own finish card still adds `--web`.
- **launcher**: Devin's model menu offers SWE-2.1, Gemini 4 Carbon and Gemini 3.8 Flash at Medium and High, and a Fusion model (Claude Opus 5.5 Medium with SWE-2.1 Medium as its sidekick).
### 🔧 Changed
- **launcher**: the model menus are sorted by vendor, lighter models before stronger ones, Medium before High.
- **launcher**: Devin's menu no longer lists Low-effort models, to stay within its 30 entries. If you chose one for Thrifty, Balanced or Best, the loop now uses the shipped choice; add the model under User Preferences, Agents & models, Add a model to keep using it.
- **Implementation Loop**: Devin's Balanced strength uses SWE-2.1 High (was SWE-2 High), at the same price.
## v3.2.1 (2026-11-29)
### ✨ Added
- **Web console**: text size buttons in the top bar, between the megaphone and the die: [-], the current size and [+] scale all the console's text in seven steps from 80% to 150%, the size returns to 100% when you click it, your choice is kept with your other looks, and Back to default on the Appearance tab resets it.
- **Learning**: the Tidy up banner has a Not now button that hides it until your saved lessons change (remembered on this machine only).
### 🔧 Changed
- **Git**: committing from the board takes one card, the commit subject and a choice of Commit only or Commit and push, answered in one send; choosing push is the yes, so the Commit this? and Push confirms are gone.
### 🐛 Fixed
- **Learning**: the Tidy up banner stays hidden once a Tidy up finds nothing to do, until your saved lessons change; before, it came straight back and Tidy up only said there was nothing to tidy.
## v3.2.0 (2026-11-29)
### Highlights
+3 -3
View File
@@ -19,7 +19,7 @@ The web console is the main way in: a local page where questions, documents, bui
| Install | `npx --allow-git=all git+https://github.com/jparkerweb/plan2code.git#release` | Installs the skills and the `plan2code` command (to update, run `plan2code update`; re-running the install command also works, and removes nothing) |
| Update | `plan2code update` | Updates the skills, command, app and status line, with no menu (metrics and the bot only from a git checkout: `node install.js`); never uninstalls anything |
| Uninstall | `plan2code uninstall` | Removes the skills, command, app and dev tools after a Y/N; then asks whether `~/.plan2code/` (your notebooks, handoffs, settings) goes too. `--yes` skips the questions and keeps your data, `--purge` deletes it |
| Straight into a skill | `/plan2code-1-plan --web` (any step) | Skips the "web console or terminal?" question and opens the page |
| Straight into a skill | `/plan2code-1-plan --web` (any step) | Opens the page for this session, whatever your saved default |
The install command always opens a menu. Back at your prompt with no output at all? npm could not reach the repository and hid the reason: run `git ls-remote https://github.com/jparkerweb/plan2code.git` to see it (usually the network, a proxy or the VPN).
@@ -33,7 +33,7 @@ The **Implementation Loop** (app only) builds every remaining phase of a spec un
## Commands
Every command below is what a dashboard card runs. Typed on its own, each one asks "web console or terminal?" first.
Every command below is what a dashboard card runs. Typed on its own, each one starts in your saved default (terminal or web console); with none saved, it asks each time.
| Step | Command | Input | Output |
| ---------- | ----------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------- |
@@ -60,7 +60,7 @@ Every command below is what a dashboard card runs. Typed on its own, each one as
| changelog | /plan2code-changelog | Your branch | `CHANGELOG.md` entries and the `package.json` version, from the default branch's latest version |
| git | /plan2code-git | Your repo | Commits (`<subject>` / `AI Assisted`), branches, pull with conflict help, push, publish |
**Terminal instead:** run any command without `--web` and answer the interface question with **terminal**. Nothing is lost: same questions, same gates, same files under `specs/`. You can switch between the two mid-feature.
**Terminal or console, remembered:** until you save a default, each skill asks whether you want the web console or the terminal; say "make the terminal (or web console) my default" and every skill in every project starts there. Add `--web` or `--terminal` to override it for one session, or say "web console" or "terminal" to switch mid-session. Nothing is lost either way: same questions, same gates, same files under `specs/`.
## File Structure
+5 -4
View File
@@ -13,7 +13,7 @@
Plan2Code is a spec-driven workflow for AI coding agents. You work through it on a page in your browser: the dashboard lists every step as a card, and each step's questions, progress and sign-offs arrive on that same page while your agent does the work. An approved plan becomes phase documents, and the agent builds to them one phase at a time.
Version 3.2.0 · Apache 2.0 · 📖 [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com)
Version 3.2.2 · Apache 2.0 · 📖 [plan2code.jparkerweb.com](https://plan2code.jparkerweb.com)
---
@@ -277,9 +277,10 @@ Each one is a card on the dashboard and a command in your agent. Which cards lig
### Prefer the terminal?
Every skill also runs right in the terminal. Each one asks at the start whether you want the web
console or the terminal; add `--web` to skip the question and go straight to the web console:
`/plan2code-1-plan --web plan a REST API for tasks`.
Every skill also runs right in the terminal. Typed on its own, a skill starts in your saved default;
with none saved it asks "web console or terminal?" each time, until you say "make the terminal (or
web console) my default". Add `--web` (`/plan2code-1-plan --web plan a REST API for tasks`) or
`--terminal` to override that for one session.
---
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "plan2code",
"version": "3.2.0",
"version": "3.2.2",
"private": true,
"license": "Apache-2.0",
"engines": {
+2 -2
View File
@@ -957,7 +957,7 @@ dependencies = [
[[package]]
name = "fake-agent"
version = "3.2.0"
version = "3.2.2"
dependencies = [
"serde_json",
"terminal_size",
@@ -2647,7 +2647,7 @@ checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
[[package]]
name = "plan2code-app"
version = "3.2.0"
version = "3.2.2"
dependencies = [
"chrono",
"libc",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "fake-agent"
version = "3.2.0"
version = "3.2.2"
description = "A stand-in agent program for the Plan2Code app's tests"
edition = "2021"
publish = false
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "plan2code-app",
"version": "3.2.0",
"version": "3.2.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "plan2code-app",
"version": "3.2.0",
"version": "3.2.2",
"dependencies": {
"@tauri-apps/api": "2.12.4",
"@xterm/addon-fit": "0.11.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "plan2code-app",
"version": "3.2.0",
"version": "3.2.2",
"private": true,
"description": "Plan2Code desktop app (Tauri). Separate from the repo root so the root and the web console stay dependency-free.",
"scripts": {
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "plan2code-app"
version = "3.2.0"
version = "3.2.2"
description = "Plan2Code desktop app"
edition = "2021"
publish = false
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Plan2Code",
"version": "3.2.0",
"version": "3.2.2",
"identifier": "com.plan2code.desktop",
"build": {
"frontendDist": "../ui",
+3 -6
View File
@@ -1,6 +1,6 @@
// Fails when the console opening paragraph of a skill drifts from the shared one.
//
// Eighteen skills open with the same "web console or terminal?" paragraph. Only
// Twenty-one skills open with the same "terminal or web console?" paragraph. Only
// the workflow name, the notes file and a few skill-specific clauses may differ;
// the shared sentences below must read the same in every one, so a fix to one
// skill's opening cannot silently skip the others. Matching ignores case and
@@ -15,19 +15,16 @@ import { fileURLToPath } from "node:url";
// own words on purpose is listed in EXEMPT with the reason.
export const SHARED = [
{ id: "first", text: "The FIRST thing you do, before anything else in this file" },
{ id: "ask", text: "**web console** (browser page, suggested) or **terminal**?" },
{ id: "ask", text: '**terminal** or **web console**? Run `node "<D>/console.mjs" interface`' },
{ id: "rule", text: "and follow its rule: the request or the saved default decides; ask only if it says so or the command fails." },
{ id: "run", text: 'run `node "<D>/console.mjs" open --workflow {w}` before reading' },
{ id: "dir", text: "<D>: references/web-console/ beside this SKILL.md" },
{ id: "dirfile", text: "or the dir in ~/.plan2code/console/console-dir" },
{ id: "read", text: "then read <D>/console.md" },
{ id: "switch", text: "Switchable anytime." },
{ id: "web", text: "If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag." },
{ id: "dash", text: "Launched by the dashboard? Its session is already open: resume it (console-launches.md)" },
];
export const EXEMPT = {
// Implement + Review defers to Implementation Mode's own Interface question.
"plan2code-3-implement-review": { ask: "defers to Implementation Mode's Interface question", run: "the question is Implementation Mode's" , switch: "Implementation Mode's Interface section says it" },
// Git runs an instruction in the argument in the terminal at once and has its own hand-off lines.
"plan2code-git": { dash: "also resumes from Commit it now and the Changelog hand-off", first: "opens with the run-at-once rule for an argument" },
};
+32 -6
View File
@@ -1,10 +1,12 @@
// Fails when a built prompt names an agent product's tool by its product name.
// Fails when a built prompt names an agent product's tool by its product name,
// or bakes --web into a skill command.
//
// Prompts are read by many agents, and each one calls the same tool something
// else. Prompt text says what to do ("ask with the question tool", "list the
// folder") and never what one product's tool is called. This reads every
// Markdown file in the built skills/ tree, so run it after
// `node install.js --build-skills`.
// folder") and never what one product's tool is called. Skill commands are
// printed bare so the person's saved terminal or web console default decides;
// a baked --web overrides it. This reads every Markdown file in the built
// skills/ tree, so run it after `node install.js --build-skills`.
// Usage: node scripts/check-prompt-wording.mjs [skillsDir] (defaults to ./skills)
import fs from "node:fs";
@@ -29,6 +31,7 @@ export const BANNED = [
];
const PATTERN = new RegExp(`(?<![A-Za-z0-9_])(${BANNED.join("|")})(?![A-Za-z0-9_])`);
const BAKED_WEB_PATTERN = /`[^`\n]*\/plan2code[\w-]*[^`\n]*--web\b[^`\n]*`/g;
function* markdownFiles(dir) {
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
@@ -52,6 +55,21 @@ export function findBanned(dir) {
return hits;
}
// Returns [{ file, line, text }] for every skill command with --web baked in.
export function findBakedWeb(dir) {
const hits = [];
for (const file of markdownFiles(dir)) {
fs.readFileSync(file, "utf8")
.split("\n")
.forEach((lineText, i) => {
for (const m of lineText.matchAll(BAKED_WEB_PATTERN)) {
hits.push({ file: path.relative(dir, file).split(path.sep).join("/"), line: i + 1, text: m[0] });
}
});
}
return hits;
}
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
const root = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
const dir = process.argv[2] ? path.resolve(process.argv[2]) : path.join(root, "skills");
@@ -60,10 +78,18 @@ if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.me
process.exit(1);
}
const hits = findBanned(dir);
const baked = findBakedWeb(dir);
if (hits.length) {
for (const h of hits) console.error(` FAIL ${h.file}:${h.line} names a product tool: ${h.name}`);
console.error(" Say what to do in neutral words (\"the question tool\", \"list the folder\").");
process.exit(1);
} else {
console.log("Built prompts name no product tool.");
}
console.log("Built prompts name no product tool.");
if (baked.length) {
for (const h of baked) console.error(` FAIL ${h.file}:${h.line} bakes --web into a skill command: ${h.text}`);
console.error(" Write the command bare and add \"(add `--web` for the web console)\" after it: a baked flag overrides the person's saved terminal or web console default.");
} else {
console.log("Built prompts bake no --web into skill commands.");
}
if (hits.length || baked.length) process.exit(1);
}
-112
View File
@@ -9,7 +9,6 @@
import test from "node:test";
import assert from "node:assert/strict";
import fs from "node:fs";
import http from "node:http";
import path from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import { looksFromMessage, terminalFontStep, TERMINAL_FONT_DEFAULT, TERMINAL_FONT_MIN, TERMINAL_FONT_MAX, splitterFraction, splitterAria, terminalTitle, barFit, terminalAnsi, TERMINAL_ANSI, hexToRgba, helloRetryAction, retryLabel, RETRY_AFTER_SECONDS, attentionSignal, commandSegments, plainCommandText, menuStep, pageNotShownView, pageDetailsLine, redactSessionUrl, barNextSteps, continueKeys, defaultRightFraction, folderName, folderPickerRows, pickDefaultAgent, taskbarSwitch, windowTitleFor, deadConsoleAction, loopBanner, loopRunText, loopLocks, loopStopLabels, loopWindowTitle, CONSOLE_ASIDE_BREAKPOINT_PX, NEXT_STEP_LABELS, NEW_RELEASE_COMMAND, STILL_WAITING_MS, STILL_WAITING_TEXT, waitingView, friendlyError, endedView, confirmButtons, trapTab, SHORTCUTS, shortcutAction, shortcutLabel, tipWithShortcut, shortcutFromMessage, clipboardAction, releaseAfterCheck, releaseNotesUrl, reasonSentence, UPDATE_RECHECK_MS } from "../plan2code-app/ui/meter.js";
@@ -1136,117 +1135,6 @@ test("barFit drops the model text first, then the status line, and only when the
assert.deepEqual(barFit({ available: 500, needed: 800 }), { model: false, status: false }, "no parts measured, none claimed");
});
// The app's ui/ folder over HTTP on a free local port, for a test that needs app.js to run.
function serveFolder(dir) {
const TYPES = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".woff2": "font/woff2" };
const server = http.createServer((req, res) => {
const file = path.join(dir, decodeURIComponent(new URL(req.url, "http://x").pathname));
if (!file.startsWith(dir) || !fs.existsSync(file) || !fs.statSync(file).isFile()) {
res.writeHead(404).end();
return;
}
res.writeHead(200, { "content-type": TYPES[path.extname(file)] || "application/octet-stream" });
fs.createReadStream(file).pipe(res);
});
return new Promise((resolve) => server.listen(0, "127.0.0.1", () => resolve(server)));
}
test("the bar's step text uses the room the row has; model and status drop before it is cut, and its buttons never shrink", async (t) => {
if (!findBrowser()) return t.skip("no Chrome or Edge installed");
const browser = await launchBrowser();
try {
const page = await browser.newPage({ viewport: { width: 1800, height: 600 } });
// Later start-up steps trip over the stub's nulls; the bar is wired before them,
// and "the model alone drops" below shows fitBar() ran.
page.on("pageerror", () => {});
// Enough of __TAURI__ for app.js to run, so its real fitBar() lays out the row:
// every command answers null (platform_info a platform), every window call resolves.
await page.addInitScript(() => {
const resolved = () => Promise.resolve();
const win = new Proxy({}, { get: () => resolved });
const known = {
core: { invoke: (cmd) => Promise.resolve(cmd === "platform_info" ? { os: "linux" } : null), Channel: class {} },
window: { getCurrentWindow: () => win },
event: { listen: () => Promise.resolve(() => {}) },
};
window.__TAURI__ = new Proxy(known, { get: (all, key) => all[key] || new Proxy({}, { get: () => resolved }) });
});
// app.js is a module, which Chrome will not load from file://: serve the folder.
const server = await serveFolder(path.dirname(INDEX_HTML_PATH));
t.after(() => server.close());
await page.goto(`http://127.0.0.1:${server.address().port}/index.html`, { waitUntil: "networkidle" });
await page.evaluate(() => {
const show = (id, text) => {
const el = document.getElementById(id);
el.hidden = false;
if (text !== undefined) el.textContent = text;
};
document.getElementById("agent-none").hidden = true;
show("project-menu-button");
document.getElementById("project-name").textContent = "plan2code";
show("agent-restart");
show("agent-menu-button");
document.getElementById("agent-name").textContent = "Claude Code";
show("agent-model", "opus 5.5 xhigh");
document.getElementById("agent-status").textContent = "Working: reading the plan and every phase file";
show("next-step");
const text = document.getElementById("next-step-text");
text.textContent = "npx fetches it quietly first, which can take a minute or two.";
text.className = "is-warn is-busy";
show("next-step-button", "Update and restart");
show("next-step-more", "+1 more");
show("next-step-notes");
});
const settle = () => page.evaluate(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r))));
const measure = () =>
page.evaluate(() => {
const row = document.getElementById("bar-row");
const text = document.getElementById("next-step-text");
const box = (id) => document.getElementById(id).getBoundingClientRect();
const menu = box("app-menu-button");
const buttons = ["next-step-button", "next-step-more", "next-step-notes"].map(box);
return {
noModel: row.classList.contains("no-model"),
noStatus: row.classList.contains("no-status"),
cut: text.scrollWidth > text.clientWidth,
textWidth: text.clientWidth,
buttonWidths: buttons.map((b) => Math.round(b.width)),
overlap: buttons.some((b) => b.right > menu.left + 0.5),
menuInside: menu.width > 0 && menu.right <= row.getBoundingClientRect().right + 0.5,
};
});
await settle();
const wide = await measure();
assert.deepEqual([wide.noModel, wide.noStatus, wide.cut], [false, false, false], "a wide window shows everything, the whole line included");
assert.ok(wide.textWidth > 320, `wider than the old 320px cap (${wide.textWidth}px)`);
const seen = new Set();
// Down to the app's minimum width (tauri.conf.json minWidth 960).
for (let width = 1800; width >= 960; width -= 20) {
await page.setViewportSize({ width, height: 600 });
await settle();
const at = await measure();
if (at.cut) assert.ok(at.noModel && at.noStatus, `${width}px: the line is cut only after the model and status dropped`);
if (at.noStatus) assert.ok(at.noModel, `${width}px: the model drops before the status`);
assert.deepEqual(at.buttonWidths, wide.buttonWidths, `${width}px: the step buttons keep their width`);
assert.equal(at.overlap, false, `${width}px: no step button runs under the menu button`);
assert.equal(at.menuInside, true, `${width}px: the menu button stays inside the row`);
seen.add(`${at.noModel}/${at.noStatus}/${at.cut}`);
}
assert.ok(seen.has("true/false/false"), `the model alone drops at some width (${[...seen]})`);
assert.ok(seen.has("true/true/true"), `the line is cut at the narrowest widths (${[...seen]})`);
assert.equal(await page.evaluate(() => getComputedStyle(document.getElementById("next-step-text")).textOverflow), "ellipsis");
// Below the minimum, the row runs out at its end as it always did: the text
// has shrunk to nothing, but its buttons are never squeezed under the menu.
await page.setViewportSize({ width: 400, height: 600 });
await settle();
const tight = await measure();
assert.deepEqual(tight.buttonWidths, wide.buttonWidths, "400px: the step buttons keep their width");
assert.equal(tight.overlap, false, "400px: no step button runs under the menu button");
} finally {
await browser.close();
}
});
test("the top bar collapses instead of scrolling, and +N more is a button that lists the other steps", () => {
assert.doesNotMatch(INDEX_HTML, /#bar-row \{[^}]*overflow-x: auto/, "no sideways scrolling row");
assert.match(INDEX_HTML, /#bar-row\.no-model #agent-model, #bar-row\.no-status #agent-status \{ display: none; \}/);
+4 -4
View File
@@ -32,15 +32,15 @@ test("the real prompts pass", () => {
test("a drifted shared sentence is named with its skill", () => {
const dir = copySrc();
edit(dir, "plan2code-review.md", "Switchable anytime.", "You can switch whenever.");
edit(dir, "plan2code-review.md", "and follow its rule", "and follow its nose");
const problems = check(dir);
assert.equal(problems.length, 1);
assert.match(problems[0], /plan2code-review\.md: shared sentence "switch"/);
assert.match(problems[0], /plan2code-review\.md: shared sentence "rule"/);
});
test("punctuation and case alone do not count as drift", () => {
const dir = copySrc();
edit(dir, "plan2code-test.md", "Switchable anytime.", "switchable anytime.");
edit(dir, "plan2code-test.md", "and follow its rule:", "AND FOLLOW ITS RULE;");
edit(dir, "plan2code-test.md", "Its session is already open: resume it", "Its session is already open \u2014 resume it");
assert.deepEqual(check(dir), []);
});
@@ -73,7 +73,7 @@ test("helpers", () => {
test("the CLI exits 1 on drift", () => {
const dir = copySrc();
edit(dir, "plan2code-git.md", "Switchable anytime.", "Whenever.");
edit(dir, "plan2code-git.md", "ask only if it says so", "ask only if it wants");
const r = spawnSync(process.execPath, [path.join(HERE, "check-console-openings.mjs"), dir], { encoding: "utf8" });
assert.equal(r.status, 1);
assert.match(r.stderr, /plan2code-git\.md/);
+15 -1
View File
@@ -5,7 +5,7 @@ import os from "node:os";
import path from "node:path";
import { spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";
import { BANNED, findBanned } from "./check-prompt-wording.mjs";
import { BANNED, findBanned, findBakedWeb } from "./check-prompt-wording.mjs";
const HERE = path.dirname(fileURLToPath(import.meta.url));
const ROOT = path.dirname(HERE);
@@ -37,6 +37,16 @@ test("a longer word that contains a banned name is not a hit", () => {
assert.deepEqual(findBanned(dir), []);
});
test("a baked --web in a skill command is found, with its file and line", () => {
const dir = fixture({ "x/SKILL.md": "fine\n`NEXT STEP: /plan2code-1-plan --web`\n" });
assert.deepEqual(findBakedWeb(dir), [{ file: "x/SKILL.md", line: 2, text: "`NEXT STEP: /plan2code-1-plan --web`" }]);
});
test("a bare command with the web-console note is not a hit", () => {
const dir = fixture({ "a.md": "Run `/plan2code-1-plan` (add `--web` for the web console)\n`--web` is the console flag\n" });
assert.deepEqual(findBakedWeb(dir), []);
});
test("the CLI exits 1 on a hit and 0 on a clean tree", () => {
const bad = fixture({ "a.md": "never use Glob\n" });
const r = spawnSync(process.execPath, [path.join(HERE, "check-prompt-wording.mjs"), bad], { encoding: "utf8" });
@@ -49,3 +59,7 @@ test("the CLI exits 1 on a hit and 0 on a clean tree", () => {
test("the built skills tree names no product tool", { skip: !fs.existsSync(path.join(ROOT, "skills")) }, () => {
assert.deepEqual(findBanned(path.join(ROOT, "skills")), []);
});
test("the built skills tree bakes no --web into skill commands", { skip: !fs.existsSync(path.join(ROOT, "skills")) }, () => {
assert.deepEqual(findBakedWeb(path.join(ROOT, "skills")), []);
});
+8 -5
View File
@@ -695,7 +695,10 @@ test("launcher: on Windows the saved user PATH fills in folders the inherited PA
addSavedWindowsPath();
const dirs = process.env[pathKey].split(";");
assert.equal(dirs[0], "C:\\stale-terminal-path", "the inherited PATH keeps its place in front");
assert.ok(dirs.includes(first), `${first} is added from the saved PATH`);
// Compared as the launcher dedupes them: the machine PATH may already hold the
// same folder spelled another way (a trailing backslash, another case), and that copy wins.
const id = (dir) => path.resolve(dir.replace(/^"|"$/g, "")).toLowerCase();
assert.ok(dirs.map(id).includes(id(first)), `${first} is added from the saved PATH`);
const length = dirs.length;
addSavedWindowsPath();
assert.equal(process.env[pathKey].split(";").length, length, "a second call adds nothing twice");
@@ -1793,8 +1796,8 @@ test("launcher menus: the agent tip shows once, and the model menu prints ids in
assert.doesNotMatch(first.stdout, /That runs outside the desktop app/, "no app installed, so no line about it");
// ids padded to the longest (opusplan), then the description; the first run's Enter is the agent's.
assert.match(first.stdout, /^ {2}1\) default {3}your account setting$/m);
assert.match(first.stdout, /^ {2}2\) sonnet {4}latest Sonnet$/m);
assert.match(first.stdout, /^ {2}5\) opusplan {2}Opus in plan mode, Sonnet otherwise$/m);
assert.match(first.stdout, /^ {2}3\) sonnet {4}latest Sonnet$/m);
assert.match(first.stdout, /^ {2}7\) opusplan {2}Opus in plan mode, Sonnet otherwise$/m);
assert.match(first.stdout, /Choice \[agent default\]: /);
assert.ok(box.argsOf("claude").includes("opus"), "a typed description picks its model");
const state = JSON.parse(fs.readFileSync(box.stateFile, "utf8"));
@@ -1806,8 +1809,8 @@ test("launcher menus: the agent tip shows once, and the model menu prints ids in
assert.equal(second.status, 0, second.stderr);
assert.equal(second.sent, 3, second.stdout);
assert.doesNotMatch(second.stdout, /skip this launcher/);
assert.match(second.stdout, /^ {2}3\) opus {6}latest Opus \(last used\)$/m);
assert.match(second.stdout, /Choice \[3\]: /);
assert.match(second.stdout, /^ {2}4\) opus {6}latest Opus \(last used\)$/m);
assert.match(second.stdout, /Choice \[4\]: /);
assert.ok(box.argsOf("claude").includes("opus"));
});
+5 -4
View File
@@ -166,12 +166,12 @@ test("pathfinder trail: exact footer for forms A, B and C", () => {
assert.equal(P("trail", "audit-export", "--form", "B", "--item", "1", "--item", "2", "--item", "3", "--item", "4").code, 5, "three-probe cap");
assert.equal(P("trail", "audit-export", "--form", "C").json.error, "claim-open", "no menu while a claim is open");
const a = P("trail", "audit-export", "--form", "A", "--text").stdout;
assert.ok(a.endsWith("NEXT STEP · start a new conversation and run:\n`/plan2code-0-pathfinder specs/audit-export/pathfinder --web`\n"), a);
assert.ok(a.endsWith("NEXT STEP · start a new conversation and run:\n`/plan2code-0-pathfinder specs/audit-export/pathfinder`\nAdd `--web` for the web console.\n"), a);
fs.appendFileSync(path.join(root, pf, "questions/03-testing-posture.md"), "\n## Answer\n\nUnit; `Run after each phase`; `Critical paths`.\n\n**Gist:** Unit tests, run after each phase.\n");
P("resolve", "audit-export", "03");
const c = P("trail", "audit-export", "--form", "C", "--resolved-this-session", "3");
assert.equal(c.code, 0, c.stderr);
assert.ok(c.json.text.endsWith("OR START FRESH · new conversation, paste:\n`/plan2code-0-pathfinder specs/audit-export/pathfinder --web`"));
assert.ok(c.json.text.endsWith("OR START FRESH · new conversation, paste:\n`/plan2code-0-pathfinder specs/audit-export/pathfinder`\nAdd `--web` for the web console."));
assert.deepEqual(c.json.menu.options.map((o) => o.label), ["Row-count ceiling", "Start fresh"]);
assert.equal(c.json.menu.recommended, "Start fresh", "the checkpoint after ~3 decisions");
assert.equal(c.json.menu.options.find((o) => o.label === "Start fresh").fresh, true, "the page reads it as a clean start");
@@ -192,11 +192,12 @@ test("pathfinder trail: a cleared map arrives; init first only while AGENTS.md i
" Confidence: solid, but Requirements, Risk are borderline.",
"",
"NEXT STEP · start a new conversation and run:",
"`/plan2code-init`, then `/plan2code-1-plan --web`",
"`/plan2code-init`, then `/plan2code-1-plan`",
"Add `--web` for the web console.",
"",
].join("\n"));
write(root, "AGENTS.md", "# AGENTS.md\n");
assert.match(P("trail", "done", "--form", "A", "--text").stdout, /run:\n`\/plan2code-1-plan --web`\n$/);
assert.match(P("trail", "done", "--form", "A", "--text").stdout, /run:\n`\/plan2code-1-plan`\nAdd `--web` for the web console\.\n$/);
assert.equal(P("trail", "done", "--form", "C").code, 5, "no menu on a cleared map");
});
+30
View File
@@ -119,6 +119,36 @@ test("scan.learning.nearCap: true at 22 general lessons or 30 in an area, false
assert.deepEqual(listing(full), before, "the scan writes nothing");
});
test("scan.learning.nearCap stays false once a tidy-up found nothing, until the saved lessons change", async (t) => {
const dir = project({ ...SETTINGS("on"), ".plan2code/lessons/general.md": lessonFile("General", 23) });
assert.equal(learningScan(dir).nearCap, true);
const s = dashboard(t, dir);
const res = await s.post("/learning/tidy-quiet", {});
assert.equal(res.status, 200);
const body = await res.json();
assert.equal(body.ok, true);
assert.equal(body.learning.nearCap, false, "the answer carries the patched scan");
assert.equal(readState(s.session).scan.learning.nearCap, false, "the page repaints from the patched scan");
assert.equal(learningScan(dir).nearCap, false, "a later scan agrees");
assert.ok(fs.existsSync(path.join(storeDir(dir), "tidy-quiet.json")), "it lives in the learning store on this machine");
// The lessons change (a merge, a new lesson): the nudge may come back.
fs.writeFileSync(path.join(dir, ".plan2code", "lessons", "general.md"), lessonFile("General", 24));
assert.equal(learningScan(dir).nearCap, true);
});
test("POST /learning/tidy-quiet is 409 when the project is not on and writes nothing into the project", async (t) => {
for (const files of [{}, SETTINGS("off")]) {
const s = dashboard(t, project(files));
const res = await s.post("/learning/tidy-quiet", {});
assert.equal(res.status, 409);
assert.deepEqual(await res.json(), { error: "not-on" });
}
const dir = project({ ...SETTINGS("on"), ".plan2code/lessons/general.md": lessonFile("General", 23) });
const before = listing(dir);
await dashboard(t, dir).post("/learning/tidy-quiet", {});
assert.deepEqual(listing(dir), before);
});
test("a failure in Learning's core never fails the scan", () => {
const boom = () => {
throw new Error("the core broke");
+2 -1
View File
@@ -170,7 +170,8 @@ test("the die sits right of the megaphone and opens on the picker, a ledger row
await pastTheIntro(s);
await iconUsable(s, "the dashboard");
const next = await s.page.evaluate(() => document.getElementById("btn-feedback").nextElementSibling?.id);
assert.equal(next, "btn-activities");
assert.equal(next, "text-size", "the text size control sits between the megaphone and the die");
assert.equal(await s.page.evaluate(() => document.getElementById("text-size").nextElementSibling?.id), "btn-activities");
await openPicker(s);
// Snake's seeded best makes it the one played row; the rest sit under Not played yet, A to Z.
assert.deepEqual(await cardTitles(s), ["Snake", "Bounce Road", "Bug Hunt", "Bumper Ring", "Crossing Rush", "Flock Dash", "Ghoul Rush", "Hot Potato", "Light Trails", "Mini golf", "Rapids Run", "Stack Deploy", "Sunset Drive"]);
@@ -282,6 +282,17 @@ test("the banner nudges a tidy-up when lessons are near their limit, and only th
assert.equal(await below.main.locator(".learn-banner").count(), 0, "no banner below the line");
});
test("Not now hides the tidy-up nudge at once and it stays hidden for the same lessons", async (t) => {
const full = await dashboard(t, { ...PROJECT("on"), ".plan2code/lessons/general.md": lessonFile("General", 22) });
const banner = full.main.locator(".learn-banner");
await banner.waitFor();
await banner.getByRole("button", { name: "Not now" }).click();
await until(async () => (await full.main.locator(".learn-banner").count()) === 0, 5000);
const state = await full.s.page.evaluate(() => fetch("/learning/state").then((r) => r.json()));
assert.equal(state.nearCap, false, "the server remembers it");
assert.equal(await full.main.locator(".learn-banner").count(), 0, "still hidden after the repaint");
});
test("a launch from a dashboard showing lessons waiting carries fromBanner", async (t) => {
const { s, main } = await dashboard(t, PROJECT("on"), (p) =>
writeWaiting(p, { id: "20261113-120000-eeeeee", type: "lesson", text: "Waits.", noted: new Date().toISOString() })
+53
View File
@@ -85,6 +85,59 @@ test("the violet highlight and dark theme chosen in preferences stick across a r
assert.deepEqual(await firstPaintAttrs(s), { theme: null, accent: null }, "the first paint still carries the old looks");
});
// The top bar's text size buttons: seven steps, saved with the looks, in the first paint.
const bodySize = (s) => s.page.evaluate(() => getComputedStyle(document.body).fontSize);
const sizeLabel = (s) => s.page.locator("#btn-text-size").innerText();
const savedTextSize = (s) => s.page.evaluate(async () => ((await (await fetch("/looks")).json()).looks || {}).textSize);
test("the text size buttons step the console's type up and down between the megaphone and the die, stop at the ends, and the label returns to 100%", async (t) => {
noSavedLooks(t);
const s = await openSession(await suite.browser(), { t, workflow: "plan", payload: PLAN_QUESTION });
const order = await s.page.evaluate(() => [...document.getElementById("btn-feedback").parentElement.children].map((n) => n.id));
assert.deepEqual(order.slice(order.indexOf("btn-feedback"), order.indexOf("btn-feedback") + 3), ["btn-feedback", "text-size", "btn-activities"], "the control sits between the megaphone and the die");
assert.equal(await sizeLabel(s), "100%");
assert.equal(await root(s, "data-text-size"), null, "the default size leaves the page unmarked");
assert.equal(await bodySize(s), "15px");
await s.page.click("#btn-text-larger");
assert.equal(await sizeLabel(s), "110%");
assert.equal(await root(s, "data-text-size"), "110");
assert.equal(await s.page.locator("#btn-text-size").getAttribute("aria-label"), "Text size 110%, back to 100%", "a screen reader hears the size");
assert.equal(await bodySize(s), "16.5px");
await s.page.waitForFunction(async () => ((await (await fetch("/looks")).json()).looks || {}).textSize === 110);
// The first paint carries it, and so does a reload.
const html = await (await s.context.request.get(s.url)).text();
assert.match(html.match(/<html\b[^>]*>/i)?.[0] ?? `no html tag in: ${html.slice(0, 200)}`, /data-text-size="110"/, "the first paint carries the saved size");
await s.page.reload({ waitUntil: "domcontentloaded" });
await drawn(s.page);
assert.equal(await sizeLabel(s), "110%");
assert.equal(await bodySize(s), "16.5px");
// The label puts it back.
await s.page.click("#btn-text-size");
assert.equal(await sizeLabel(s), "100%");
assert.equal(await root(s, "data-text-size"), null);
assert.equal(await bodySize(s), "15px");
// Largest and smallest: the button at the end is spent, not wrapped.
for (let i = 0; i < 6; i++) if (await s.page.locator("#btn-text-larger").isEnabled()) await s.page.click("#btn-text-larger");
assert.equal(await sizeLabel(s), "150%");
assert.equal(await s.page.locator("#btn-text-larger").getAttribute("aria-disabled"), "true");
await s.page.click("#btn-text-size");
for (let i = 0; i < 6; i++) if ((await s.page.locator("#btn-text-smaller").getAttribute("aria-disabled")) !== "true") await s.page.click("#btn-text-smaller");
assert.equal(await sizeLabel(s), "80%");
assert.equal(await bodySize(s), "12px");
await s.page.waitForFunction(async () => ((await (await fetch("/looks")).json()).looks || {}).textSize === 80);
// Back to default in Preferences returns it too.
await s.page.click("#btn-looks");
await s.page.click("#looks-reset");
await s.page.waitForFunction(() => !document.documentElement.hasAttribute("data-text-size"));
assert.equal(await sizeLabel(s), "100%");
assert.equal(await savedTextSize(s) ?? 100, 100);
});
// The Agents & models tab: a roster of agent cards, the picked agent's form in
// a drawer over it (Models & strengths and Launch tabs), and the Add agent
// chooser, where the starter templates are an opt-in.
+78 -3
View File
@@ -351,7 +351,7 @@ test("the session sweep removes only month-old session dirs, never the one being
}
});
test("the scratch sweep removes old patches and helpers, never looks, the pointer, the update cache or a directory", async () => {
test("the scratch sweep removes old patches and helpers, never looks, the interface, the pointer, the update cache or a directory", async () => {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "p2c-scratch-"));
try {
const file = (name, stale = true) => {
@@ -363,6 +363,7 @@ test("the scratch sweep removes old patches and helpers, never looks, the pointe
const removable = [file("p2.json"), file("helper.mjs")];
const kept = [
file("looks.json"),
file("interface.json"),
file("workspaces.json"),
file("loop-setup.json"),
file("review-loop-setup.json"),
@@ -383,13 +384,14 @@ test("the scratch sweep removes old patches and helpers, never looks, the pointe
const stale = staleScratch(dir, Date.now(), SESSION_MAX_AGE_MS).sort();
assert.deepEqual(stale, ["helper.mjs", "p2.json"]);
assert.deepEqual(
(await removeScratch(dir, [...stale, "looks.json", "workspaces.json", "loop-setup.json", "review-loop-setup.json", "loop-reports.json", "subagents.json", "spec-carry.json", "pr-hosts.json", "../p.json", "console-dir", "update-check.json"])).sort(),
(await removeScratch(dir, [...stale, "looks.json", "interface.json", "workspaces.json", "loop-setup.json", "review-loop-setup.json", "loop-reports.json", "subagents.json", "spec-carry.json", "pr-hosts.json", "../p.json", "console-dir", "update-check.json"])).sort(),
["helper.mjs", "p2.json"]
);
for (const p of removable) assert.equal(fs.existsSync(p), false, p);
for (const p of kept) assert.ok(fs.existsSync(p), p);
assert.deepEqual([...PROTECTED_CONSOLE_FILES].sort(), [
"console-dir",
"interface.json",
"looks.json",
"loop-reports.json",
"loop-setup.json",
@@ -435,7 +437,7 @@ test("cleanup finds old sessions and strays in both folders, and keeps every pro
const drafted = session("20250801-101010-dddddd", true);
put(path.join(drafted, "draft.json"));
const kept = [
...["looks.json", "workspaces.json", "subagents.json", "console-dir", "update-check.json"].map((n) =>
...["looks.json", "interface.json", "workspaces.json", "subagents.json", "console-dir", "update-check.json"].map((n) =>
put(path.join(consoleDir, n))
),
put(path.join(plan2code, "launcher.json")),
@@ -1666,3 +1668,76 @@ test("a setup console without the app signal never calls a leftover announce URL
stub.close();
}
});
/* ------------------------------------------------- terminal or web console */
// Its own console home, so a default saved here never reaches another test.
function interfaceCli(home, args) {
return cli(["interface", ...args], { expectFail: true, env: { PLAN2CODE_CONSOLE_HOME: home } });
}
test("interface reports no default on a fresh home, and its rule says to ask and save nothing", () => {
const home = fs.mkdtempSync(path.join(os.tmpdir(), "p2c-interface-"));
try {
const res = interfaceCli(home, []);
assert.equal(res.status, 0);
assert.equal(res.json.interface, null);
assert.match(res.json.rule, /Save nothing from the answer/);
assert.match(res.json.rule, /make the terminal \(or web console\) my default/);
assert.equal(fs.existsSync(path.join(home, "interface.json")), false);
assert.match(res.json.rule, /interface --set web\|terminal/);
assert.match(res.json.rule, /--web/);
assert.match(res.json.rule, /--terminal/);
} finally {
fs.rmSync(home, { recursive: true, force: true });
}
});
test("interface --set saves one default that every later call reads back, and ask clears it", () => {
const home = fs.mkdtempSync(path.join(os.tmpdir(), "p2c-interface-"));
try {
for (const choice of ["terminal", "web"]) {
assert.deepEqual(interfaceCli(home, ["--set", choice]).json, { ok: true, interface: choice });
const res = interfaceCli(home, []);
assert.equal(res.json.interface, choice);
assert.match(res.json.rule, /saved default, so do not ask/);
assert.doesNotMatch(res.json.rule, /Save nothing/);
}
assert.deepEqual(interfaceCli(home, ["--set", "ask"]).json, { ok: true, interface: null });
assert.equal(fs.existsSync(path.join(home, "interface.json")), false);
assert.equal(interfaceCli(home, []).json.interface, null);
} finally {
fs.rmSync(home, { recursive: true, force: true });
}
});
test("interface refuses an unknown or missing value, and reads a damaged file as no default", () => {
const home = fs.mkdtempSync(path.join(os.tmpdir(), "p2c-interface-"));
try {
for (const bad of [["--set", "browser"], ["--set"]]) {
const res = interfaceCli(home, bad);
assert.equal(res.status, 2, bad.join(" "));
assert.equal(fs.existsSync(path.join(home, "interface.json")), false);
}
for (const body of ["{not json", JSON.stringify({ interface: "browser" }), "[]"]) {
fs.writeFileSync(path.join(home, "interface.json"), body);
assert.equal(interfaceCli(home, []).json.interface, null, body);
}
} finally {
fs.rmSync(home, { recursive: true, force: true });
}
});
// The rule lives in the interface command, so no skill may go back to asking
// up front or spell out its own version of the rule.
test("every skill but the dashboard picks its interface through the interface command", () => {
const skills = fs.readdirSync(path.join(ROOT, "src")).filter((f) => /^plan2code-.*\.md$/.test(f));
assert.equal(skills.length, 21);
for (const f of skills) {
const text = fs.readFileSync(path.join(ROOT, "src", f), "utf8");
const iface = text.indexOf('console.mjs" interface`');
assert.ok(iface > -1, `${f} runs the interface command`);
assert.ok(iface < text.search(/console\.mjs" open(?! --resume)/), `${f} runs it before open`);
assert.doesNotMatch(text, /ask \*\*web console\*\*/, `${f} no longer asks up front`);
}
});
+1 -1
View File
@@ -869,7 +869,7 @@ test("prefs: the dialog opens on the tab asked for, else Appearance", () => {
});
test("prefs: Back to default resets Appearance or Sounds & activities only, and nothing on the other two", () => {
assert.deepEqual(prefsResetScope("appearance"), ["theme", "width", "accent", "role", "skipIntro"]);
assert.deepEqual(prefsResetScope("appearance"), ["theme", "width", "textSize", "accent", "role", "skipIntro"]);
const sounds = prefsResetScope("sounds");
assert.deepEqual(sounds, ["sound", ...Object.keys(SOUND_EVENTS).map(soundKey), ...PICKABLE_SOUNDS.map(soundFileKey), "hideActivities", "activitySounds", "gameMusic"]);
for (const key of [...prefsResetScope("appearance"), ...sounds]) {
+1 -1
View File
@@ -189,7 +189,7 @@ test("shape: no page module sets a style attribute from script", () => {
// no routes of its own: its buttons are sends (`__git`), through /submit.
const ROUTE_ORDER = [
"/health", "/s/", "/handover", "/", "SERVABLE", "/overview", "/agents-doc", "/prototypes", "/prototype", "/handoff", "/version", "/state", "/events", "/draft",
"/looks", "/looks", "/subagents", "/learning/pause", "/learning/state", "/learning/lessons", "/pr-host", "/models", "/models", "/agents", "/agents", "/agents/test", "/agents/use-path", "/cleanup", "/upload",
"/looks", "/looks", "/subagents", "/learning/pause", "/learning/tidy-quiet", "/learning/state", "/learning/lessons", "/pr-host", "/models", "/models", "/agents", "/agents", "/agents/test", "/agents/use-path", "/cleanup", "/upload",
"/notepad", "/notepad/text", "/notepad/image", "/notepad/thumb", "/notepad/image/delete", "/notepad/tab",
"/notepad/tab/rename", "/notepad/tab/delete", "/notepad/tab/order", "/notepad/tab/last", "/notepad/tab/sent", "/notepad/images/",
"/attachments/", "/shots/", "/uploads/", "/submit", "/open-link", "/open-prototype", "/chat", "/chat/decision", "/workspace",
+79 -83
View File
@@ -5,6 +5,10 @@
"id": "default",
"label": "your account setting"
},
{
"id": "haiku",
"label": "fast and efficient Haiku"
},
{
"id": "sonnet",
"label": "latest Sonnet"
@@ -13,14 +17,6 @@
"id": "opus",
"label": "latest Opus"
},
{
"id": "haiku",
"label": "fast and efficient Haiku"
},
{
"id": "opusplan",
"label": "Opus in plan mode, Sonnet otherwise"
},
{
"id": "fable",
"label": "Fable for your hardest tasks"
@@ -28,6 +24,10 @@
{
"id": "best",
"label": "same model as Opus"
},
{
"id": "opusplan",
"label": "Opus in plan mode, Sonnet otherwise"
}
],
"devin": [
@@ -35,6 +35,10 @@
"id": "adaptive",
"label": "Adaptive"
},
{
"id": "swe-2-flash-high",
"label": "SWE-2 Flash High"
},
{
"id": "swe-2-medium",
"label": "SWE-2 Medium"
@@ -44,20 +48,16 @@
"label": "SWE-2 High"
},
{
"id": "claude-opus-5-5-low",
"label": "Claude Opus 5.5 Low"
"id": "swe-2-1-medium",
"label": "SWE-2.1 Medium"
},
{
"id": "claude-opus-5-5-medium",
"label": "Claude Opus 5.5 Medium"
"id": "swe-2-1-high",
"label": "SWE-2.1 High"
},
{
"id": "claude-opus-5-5-high",
"label": "Claude Opus 5.5 High"
},
{
"id": "claude-sonnet-5-5-low",
"label": "Claude Sonnet 5.5 Low"
"id": "claude-haiku-5-5-high",
"label": "Claude Haiku 5.5 High"
},
{
"id": "claude-sonnet-5-5-medium",
@@ -68,56 +68,12 @@
"label": "Claude Sonnet 5.5 High"
},
{
"id": "gpt-6-luna-low",
"label": "GPT-6 Luna Low Thinking"
"id": "claude-opus-5-5-medium",
"label": "Claude Opus 5.5 Medium"
},
{
"id": "gpt-6-luna-medium",
"label": "GPT-6 Luna Medium Thinking"
},
{
"id": "gpt-6-luna-high",
"label": "GPT-6 Luna High Thinking"
},
{
"id": "glm-5-3-high",
"label": "GLM-5.3 High"
},
{
"id": "gpt-6-1-sol-low",
"label": "GPT-6.1 Sol Low Thinking"
},
{
"id": "gpt-6-1-sol-medium",
"label": "GPT-6.1 Sol Medium Thinking"
},
{
"id": "gpt-6-1-sol-high",
"label": "GPT-6.1 Sol High Thinking"
},
{
"id": "claude-haiku-5-5-high",
"label": "Claude Haiku 5.5 High"
},
{
"id": "gpt-6-astra-low",
"label": "GPT-6 Astra Low Thinking"
},
{
"id": "gpt-6-astra-medium",
"label": "GPT-6 Astra Medium Thinking"
},
{
"id": "gpt-6-astra-high",
"label": "GPT-6 Astra High Thinking"
},
{
"id": "swe-2-flash-high",
"label": "SWE-2 Flash High"
},
{
"id": "claude-fable-5-2-low",
"label": "Claude Fable 5.2 Low"
"id": "claude-opus-5-5-high",
"label": "Claude Opus 5.5 High"
},
{
"id": "claude-fable-5-2-medium",
@@ -128,8 +84,40 @@
"label": "Claude Fable 5.2 High"
},
{
"id": "gemini-4-hydrogen-low",
"label": "Gemini 4 Hydrogen Low"
"id": "fusion-claude-opus-5-5-medium-sidekick-swe-2-1-medium",
"label": "Fusion (Claude Opus 5.5 Medium + SWE-2.1 Medium)"
},
{
"id": "gpt-6-luna-medium",
"label": "GPT-6 Luna Medium Thinking"
},
{
"id": "gpt-6-luna-high",
"label": "GPT-6 Luna High Thinking"
},
{
"id": "gpt-6-1-sol-medium",
"label": "GPT-6.1 Sol Medium Thinking"
},
{
"id": "gpt-6-1-sol-high",
"label": "GPT-6.1 Sol High Thinking"
},
{
"id": "gpt-6-astra-medium",
"label": "GPT-6 Astra Medium Thinking"
},
{
"id": "gpt-6-astra-high",
"label": "GPT-6 Astra High Thinking"
},
{
"id": "gemini-3-8-flash-medium",
"label": "Gemini 3.8 Flash Medium"
},
{
"id": "gemini-3-8-flash-high",
"label": "Gemini 3.8 Flash High"
},
{
"id": "gemini-4-hydrogen-medium",
@@ -140,8 +128,12 @@
"label": "Gemini 4 Hydrogen High"
},
{
"id": "gemini-4-neon-low",
"label": "Gemini 4 Neon Low"
"id": "gemini-4-carbon-medium",
"label": "Gemini 4 Carbon Medium"
},
{
"id": "gemini-4-carbon-high",
"label": "Gemini 4 Carbon High"
},
{
"id": "gemini-4-neon-medium",
@@ -150,32 +142,36 @@
{
"id": "gemini-4-neon-high",
"label": "Gemini 4 Neon High"
},
{
"id": "glm-5-3-high",
"label": "GLM-5.3 High"
}
],
"codex": [
{
"id": "gpt-6-astra",
"label": "GPT-6 Astra"
},
{
"id": "gpt-6.1-sol",
"label": "GPT-6.1 Sol"
"id": "gpt-6-luna",
"label": "GPT-6 Luna"
},
{
"id": "gpt-6.1-terra",
"label": "GPT-6.1 Terra"
},
{
"id": "gpt-6-luna",
"label": "GPT-6 Luna"
},
{
"id": "gpt-6.2-astra",
"label": "GPT-6.2 Astra"
"id": "gpt-6.1-sol",
"label": "GPT-6.1 Sol"
},
{
"id": "gpt-6.2-sol",
"label": "GPT-6.2 Sol"
},
{
"id": "gpt-6-astra",
"label": "GPT-6 Astra"
},
{
"id": "gpt-6.2-astra",
"label": "GPT-6.2 Astra"
}
],
"strengths": {
@@ -198,7 +194,7 @@
"model": "swe-2-flash-high"
},
"balanced": {
"model": "swe-2-high"
"model": "swe-2-1-high"
},
"best": {
"model": "claude-opus-5-5-medium"
@@ -52,7 +52,7 @@ Q2 Ceiling behavior past the cap (re-ask) · Q3 Who sees the truncation warning
## Form A — the turn ends the session
The command follows the map's status: `/plan2code-0-pathfinder specs/<idea>/pathfinder --web` while `Charting` / `Working`; `/plan2code-1-plan --web` once `Cleared`; and `/plan2code-init` first when `## Ground rules` records `AGENTS.md` absent and it still is. The path is the exact argument Auto-Discovery resolves an idea from, so the human pastes it back with zero edits.
The command follows the map's status: `/plan2code-0-pathfinder specs/<idea>/pathfinder` while `Charting` / `Working`; `/plan2code-1-plan` once `Cleared`; and `/plan2code-init` first when `## Ground rules` records `AGENTS.md` absent and it still is. The path is the exact argument Auto-Discovery resolves an idea from, so the human pastes it back with zero edits. It is printed bare, with `Add --web for the web console.` under it.
## Form B — the turn asks the human something
@@ -1143,6 +1143,9 @@ function wrapJoin(parts, indent = " ", width = 100) {
return lines;
}
// Printed bare so it pastes as is; WEB_NOTE under it offers the console.
const WEB_NOTE = "Add `--web` for the web console.";
// Init comes first only while the ground rules record AGENTS.md absent AND it is
// still missing: one written since charting needs no init detour.
function needsInit(loc, map) {
@@ -1151,9 +1154,9 @@ function needsInit(loc, map) {
function resumeCommand(loc, map) {
if (/^cleared$/i.test(map.status || "")) {
return needsInit(loc, map) ? "`/plan2code-init`, then `/plan2code-1-plan --web`" : "`/plan2code-1-plan --web`";
return needsInit(loc, map) ? "`/plan2code-init`, then `/plan2code-1-plan`" : "`/plan2code-1-plan`";
}
return `\`/plan2code-0-pathfinder ${loc.relPf} --web\``;
return `\`/plan2code-0-pathfinder ${loc.relPf}\``;
}
// What the human reads a question as: its name on the checklist row (the
@@ -1212,7 +1215,7 @@ async function cmdTrail(loc, args) {
let part2;
let menu;
if (form === "A") {
part2 = ["NEXT STEP · start a new conversation and run:", cmd];
part2 = ["NEXT STEP · start a new conversation and run:", cmd, WEB_NOTE];
} else if (form === "B") {
const items = args.item || [];
if (!items.length) fail(EXIT.USAGE, "missing-items", "Form B names every outstanding item: pass 1-3 --item.", 'Example: --item "Q1 Duration model" --item "Q2 Contract while held"');
@@ -1226,7 +1229,7 @@ async function cmdTrail(loc, args) {
// Nothing takeable means there is no menu to offer: an empty frontier is a
// stop (Work Step 4), and a stop is Form A.
if (!f.frontier.length) fail(EXIT.REFUSED, "no-frontier", "Nothing on the frontier to offer: every open question is blocked, or none is left.", "Use --form A (report the blocked chain, or go to The Clearing Gate).");
part2 = ["OR START FRESH · new conversation, paste:", cmd];
part2 = ["OR START FRESH · new conversation, paste:", cmd, WEB_NOTE];
const resolvedThisSession = Number(args["resolved-this-session"] || 0);
const checkpoint = resolvedThisSession >= 3 || !!args.heavy;
const options = f.frontier.slice(0, 3).map((x) => {
+1 -1
View File
@@ -12,7 +12,7 @@ Read references/grilling.md at the first question you grill (Chart Step 2, or a
## Interface
The FIRST thing you do, before anything else in this file — before Step 0: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow pathfinder` before reading (<D>: references/web-console/ beside this SKILL.md, or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/pathfinder.md. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Step 0.
The FIRST thing you do, before anything else in this file — before Step 0: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md, or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow pathfinder` before reading, then read <D>/console.md and <D>/notes/pathfinder.md. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Step 0.
## Backend
+3 -3
View File
@@ -8,7 +8,7 @@ Senior software architect and technical PM. Analyze requirements critically, ask
## Interface
The FIRST thing you do, before anything else in this file — before the AGENTS.md check, before looking for a draft: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow plan` before reading (<D>: references/web-console/ beside this SKILL.md, or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/plan.md. Switchable anytime. The console is far easier for sign-offs with a non-engineer. If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then the AGENTS.md check.
The FIRST thing you do, before anything else in this file — before the AGENTS.md check, before looking for a draft: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md, or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow plan` before reading, then read <D>/console.md and <D>/notes/plan.md. The console is far easier for sign-offs with a non-engineer. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then the AGENTS.md check.
## Project Context (BLOCKING)
@@ -181,7 +181,7 @@ State assessment and ask user to confirm.
3. Create `specs/<feature-name>/PLAN-DRAFT-<YYYYMMDD>.md` with Phases 1-3
4. Set status: `Phase 3 Complete - Resume at Phase 4`
5. Include: Executive Summary, Requirements, System Context, Scope, Confidence
6. Instruct: "Large project. Progress saved. Start NEW conversation with `/plan2code-1-plan --web` to resume at Phase 4." On the web console, the finish carries that command.
6. Instruct: "Large project. Progress saved. Start NEW conversation with `/plan2code-1-plan` (add `--web` for the web console) to resume at Phase 4." On the web console, the finish carries that command.
7. STOP
### PHASE 4: Tech Stack
@@ -306,7 +306,7 @@ When complete (PLAN-DRAFT created), tell user:
> ╰┬─┬╯
> ```"
In the terminal, end with `NEXT STEP: /plan2code-2-document --web` in a NEW conversation. The web console's finish carries it, so print nothing there.
In the terminal, end with `NEXT STEP: /plan2code-2-document` (add `--web` for the web console) in a NEW conversation. The web console's finish carries it, so print nothing there.
## Abort / Recovery
+3 -3
View File
@@ -8,7 +8,7 @@ Senior software architect updating implementation specs when requirements change
## Interface
The FIRST thing you do, before anything else in this file — before Step 1, before reading a spec: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow revise-plan` before reading (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-1b-revise-plan/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir; add `--spec specs/<feature-name>` if known, else post `specDir` later), then read <D>/console.md and <D>/notes/revise-plan.md; the Step 1 confirmation, the Step 2 approval and every cleanup question go through it. Switchable anytime. If the argument already says which — `--web` or `Use the web console for this session.` — take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then Step 1.
The FIRST thing you do, before anything else in this file — before Step 1, before reading a spec: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-1b-revise-plan/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow revise-plan` before reading (add `--spec specs/<feature-name>` if known, else post `specDir` later), then read <D>/console.md and <D>/notes/revise-plan.md; the Step 1 confirmation, the Step 2 approval and every cleanup question go through it. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then Step 1.
## Rules
@@ -202,7 +202,7 @@ Report and resolve issues (every `error` in `checks` included), then rerun `stat
```
In the terminal, end with `REVISION COMPLETE: start a NEW conversation and run /plan2code-3-implement --web with specs/<feature-name>/overview.md` (it finds the next phase itself). The web console's finish carries it, so print nothing there.
In the terminal, end with `REVISION COMPLETE: start a NEW conversation and run /plan2code-3-implement with specs/<feature-name>/overview.md` (it finds the next phase itself; add `--web` for the web console). The web console's finish carries it, so print nothing there.
### STEP 6: Revision Cleanup
@@ -242,6 +242,6 @@ Work summary — tell user: change type, tasks added/modified/removed, phases re
**Pending phases after revision** — list `status`'s `pending` (every phase not `[x]`, re-opened ones included) with its task count so the user can plan next implementation sessions.
Returning context: Revised specs in `specs/<feature-name>/`. Run `/plan2code-3-implement --web` in a new conversation to continue implementation.
Returning context: Revised specs in `specs/<feature-name>/`. Run `/plan2code-3-implement` in a new conversation to continue implementation (add `--web` for the web console).
**On the web console:** specs change only at Step 3, so stopping before then saves nothing. The finish command is `/plan2code-3-implement specs/<feature-name>/overview.md` when revised, or the revise-plan command on an abort.
+3 -3
View File
@@ -8,7 +8,7 @@ Technical writer transforming planning documents into precise, complete implemen
## Interface
The FIRST thing you do, before anything else in this file — before Auto-Discovery: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow document` before reading (<D>: references/web-console/ beside this SKILL.md, or the dir in ~/.plan2code/console/console-dir; `--spec` once known), then read <D>/console.md and <D>/notes/document.md. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Auto-Discovery.
The FIRST thing you do, before anything else in this file — before Auto-Discovery: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md, or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow document` before reading (`--spec` once known), then read <D>/console.md and <D>/notes/document.md. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Auto-Discovery.
## Scripts
@@ -235,7 +235,7 @@ Paste the `comment` from `specs.mjs metrics specs/<feature-name> --step document
**Tell user:**
1. What was created (spec files list)
2. Path for next session: `specs/<feature-name>/overview.md`
3. Next command: `/plan2code-3-implement-review --web` (quality-gated) or `/plan2code-3-implement --web` (implementation only)
3. Next command: `/plan2code-3-implement-review` (quality-gated) or `/plan2code-3-implement` (implementation only)
4. Start NEW conversation for implementation
**Phase Overview** — present a table from `status`'s `phases`: phase name, task count (`tasks.total`), one-sentence goal (`goal`, tightened if it runs long; write one yourself when it is null). Helps the user plan sessions and identify review gates.
@@ -248,7 +248,7 @@ Paste the `comment` from `specs.mjs metrics specs/<feature-name> --step document
╰┬─┬╯
```
In the terminal, end with `NEXT STEP: start a NEW conversation and run /plan2code-3-implement-review --web` (or `/plan2code-3-implement --web` for implementation without the review gate). The web console's finish carries it, so print nothing there.
In the terminal, end with `NEXT STEP: start a NEW conversation and run /plan2code-3-implement-review` (or `/plan2code-3-implement` for implementation without the review gate; add `--web` to either for the web console). The web console's finish carries it, so print nothing there.
## Abort Handling
+1 -1
View File
@@ -8,7 +8,7 @@ Orchestrate one implementation phase and its focused independent review as a sin
## Web Console
The FIRST thing you do, before anything else in this file: Implementation Mode's Interface question — **web console** or **terminal**? On the web console, run `node "<D>/console.mjs" open --workflow implement-review` before reading (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-3-implement-review/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md, <D>/building.md and <D>/notes/implement.md in one batch (all of it; its Implement + Review section covers Stages 2–5), and <D>/building-review.md when Stage 2 starts: the Stage 2 findings go out as the page's fix list, Stage 4 is the only sign-off item, and the Stage 5 `finish` never carries the review offer. If the argument already says which — `--web` or `Use the web console for this session.` — take it and do not ask; drop the flag. `--loop` (only inside the desktop app): read <D>/notes/loop.md after console.md; it replaces the sign-off, marking and git steps, and Stages 2 to 4 run as its review section says. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then the spec.
The FIRST thing you do, before anything else in this file: Implementation Mode's Interface question — **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-3-implement-review/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. On the web console, run `node "<D>/console.mjs" open --workflow implement-review` before reading, then read <D>/console.md, <D>/building.md and <D>/notes/implement.md in one batch (all of it; its Implement + Review section covers Stages 2–5), and <D>/building-review.md when Stage 2 starts: the Stage 2 findings go out as the page's fix list, Stage 4 is the only sign-off item, and the Stage 5 `finish` never carries the review offer. `--loop` (only inside the desktop app): read <D>/notes/loop.md after console.md; it replaces the sign-off, marking and git steps, and Stages 2 to 4 run as its review section says. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then the spec.
## Controlling Contract
+8 -8
View File
@@ -8,7 +8,7 @@ Senior software engineer building exactly what the spec says, keeping progress c
## Interface
The FIRST thing you do, before anything else in this file — before reading a spec, before Phase 1: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow implement` before reading (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-3-implement/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md, <D>/building.md and <D>/notes/implement.md in one batch; progress, every question and the sign-off go through it. Switchable anytime. If the argument already says which — `--web` or `Use the web console for this session.` — take it and do not ask; drop the flag. `--loop` (only inside the desktop app): read <D>/notes/loop.md after console.md; it replaces the sign-off, marking and git steps below. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then the spec.
The FIRST thing you do, before anything else in this file — before reading a spec, before Phase 1: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-3-implement/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow implement` before reading, then read <D>/console.md, <D>/building.md and <D>/notes/implement.md in one batch; progress, every question and the sign-off go through it. `--loop` (only inside the desktop app): read <D>/notes/loop.md after console.md; it replaces the sign-off, marking and git steps below. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then the spec.
## Scripts
@@ -75,7 +75,7 @@ Never reset `[/]` to `[ ]`: started work stays marked so resuming is a conscious
| `ask-resume` | Prompt: "Phase X is in progress. Resume? (yes/no)" Relay `warning` when present. |
| `auto-start` | Mark it `[/]` and begin. Relay `warning` when present. |
| `checkoff` | Every phase is approved but tasks in them are still open (manual steps, blockers). Never say "nothing left to do": run Manual Check-Off below. |
| `none` | Nothing to implement: say why (`reason`). Every phase complete → `/plan2code-4-finalize --web` |
| `none` | Nothing to implement: say why (`reason`). Every phase complete → `/plan2code-4-finalize` (add `--web` for the web console) |
Before acting on `ask-resume` or `choose`, read the Notes of each `[/]` phase on offer: a waiting `**Plan change:**` line replaces the resume question (Plan Change Mid-Phase). After selection, claim it (Process 1), read `phase-X.md`, begin.
@@ -88,7 +88,7 @@ Before acting on `ask-resume` or `choose`, read the Notes of each `[/]` phase on
3. Yes → `node "<S>/specs.mjs" tick <spec> --task <id>` (writes `[x]` and a "Confirmed done by the user" line). Not yet → leave it as it stands. A note asking for help: help, then ask again.
4. Next task.
After the last one: `tick`'s `remaining` empty (`next` is `none`) → "NEXT STEP: Start NEW conversation and run: `/plan2code-4-finalize --web`". Otherwise list what is still open, say Finalize opens once they are checked off, and that rerunning Implement asks again. Never tick a task the person did not confirm.
After the last one: `tick`'s `remaining` empty (`next` is `none`) → "NEXT STEP: Start NEW conversation and run: `/plan2code-4-finalize` (add `--web` for the web console)". Otherwise list what is still open, say Finalize opens once they are checked off, and that rerunning Implement asks again. Never tick a task the person did not confirm.
## Code Consistency Rules
@@ -211,9 +211,9 @@ On user "approved":
| Phase X+1: [Name] | Z | [One-sentence goal] |
5. Before this, follow `references/lessons.md` → End. (Not under `--loop`.) Then write a one-line subject for the phase, then give the user the `command` from `commit-msg.mjs --subject "<subject>" --files <path> ...`, one `--files` per file the phase created or changed. It enforces the format: subject ≤100 chars and EXACTLY TWO -m flags (subject, `AI Assisted`), no body. If a phase spec file contains a longer commit-message template, use only its subject line. The diff is the body; the PR is the explanation. On Windows PowerShell 5.1 (no `&&`), give `add` and `commit` as two commands instead.
6. **If more phases:** "NEXT STEP: Start NEW conversation and run: `/plan2code-3-implement specs/<feature>/overview.md --web`"
7. **If final phase:** "NEXT STEP: Start NEW conversation and run: `/plan2code-4-finalize --web`"
8. Mention `/plan2code-1b-revise-plan --web` option
6. **If more phases:** "NEXT STEP: Start NEW conversation and run: `/plan2code-3-implement specs/<feature>/overview.md` (add `--web` for the web console)"
7. **If final phase:** "NEXT STEP: Start NEW conversation and run: `/plan2code-4-finalize` (add `--web` for the web console)"
8. Mention `/plan2code-1b-revise-plan` option
9. **On the web console:** the finish carries the next step, never a review offer (it was on the sign-off card).
Planny (continuing):
@@ -242,7 +242,7 @@ If user says "abort", "cancel", or similar:
- List completed vs remaining tasks
- Note created/modified files
- Do NOT change phase checkbox (stays `[/]`)
- Explain: "Run `/plan2code-3-implement --web` again to resume."
- Explain: "Run `/plan2code-3-implement` again to resume (add `--web` for the web console)."
3. Stop implementation. On the web console, the finish carries that command.
## Recovery
@@ -262,7 +262,7 @@ When the person decides the plan must change before this phase can finish (a new
<done and still open by task id in prose ("done 9.1, 9.3-9.5; open 9.2, 9.6-9.9"), never checkbox lines; decisions made so far>
```
NEXT STEP: `/plan2code-1b-revise-plan specs/<feature>/overview.md --web`. The dashboard and Revise the plan look for that `**Plan change:**` line; Revise the plan rewrites it to `**Plan change (applied <date>):**` once the spec is updated.
NEXT STEP: `/plan2code-1b-revise-plan specs/<feature>/overview.md` (add `--web` for the web console). The dashboard and Revise the plan look for that `**Plan change:**` line; Revise the plan rewrites it to `**Plan change (applied <date>):**` once the spec is updated.
A phase whose Notes still hold a waiting `**Plan change:**` gets one question in place of "Resume?" (console: a `choice`): **Revise the plan first** (recommended) or **Resume Phase X anyway**. Revise first: change nothing and end as a pause with the NEXT STEP above (console: that `finish.command`, headline starting "Paused"). Resume anyway: rewrite the line to `**Plan change (dropped <YYYY-MM-DD>):**`, then carry on.
+2 -2
View File
@@ -8,7 +8,7 @@ QA engineer and technical lead performing rigorous final validation. Verify spec
## Interface
The FIRST thing you do, before anything else in this file — before the Required Context check, before Step 1: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow finalize` before reading (<D>: references/web-console/ beside this SKILL.md, or the dir in ~/.plan2code/console/console-dir; `--spec specs/<feature-name>` if known, else post `specDir` later), then read <D>/console.md and <D>/notes/finalize.md; the audit options, the final review, the doc-update approval and every cleanup confirmation go through it. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then the Required Context check.
The FIRST thing you do, before anything else in this file — before the Required Context check, before Step 1: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md, or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow finalize` before reading (`--spec specs/<feature-name>` if known, else post `specDir` later), then read <D>/console.md and <D>/notes/finalize.md; the audit options, the final review, the doc-update approval and every cleanup confirmation go through it. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then the Required Context check.
## Scripts
@@ -350,7 +350,7 @@ Paste the `comment` from `specs.mjs metrics <spec's current path: specs--complet
| Completion | Action |
|-----------|--------|
| **≥75%** | Finalize with notice. List incomplete items. Note remaining tasks for follow-up cycle. |
| **<75%** | Recommend returning to implementation. List incomplete phases with task counts. Options: 1) Return via `/plan2code-3-implement --web` 2) Proceed with partial finalization. |
| **<75%** | Recommend returning to implementation. List incomplete phases with task counts. Options: 1) Return via `/plan2code-3-implement` (add `--web` for the web console) 2) Proceed with partial finalization. |
## Abort Handling
+1 -1
View File
@@ -8,7 +8,7 @@ Careful release scribe. Work out the right version from the default branch, find
## Interface
The FIRST thing you do, before anything else in this file, before reading the repository: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow changelog` before reading (<D>: references/web-console/ beside this SKILL.md, ~/.agents/skills/plan2code-changelog/references/web-console/ globally, or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/changelog.md. Every question goes through it. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`) take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Step 1.
The FIRST thing you do, before anything else in this file, before reading the repository: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md, ~/.agents/skills/plan2code-changelog/references/web-console/ globally, or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow changelog` before reading, then read <D>/console.md and <D>/notes/changelog.md. Every question goes through it. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Step 1.
## Scripts
+1 -1
View File
@@ -8,7 +8,7 @@ Finds unused code paths and dead code in the person's own project. Shows each fi
## Interface
The FIRST thing you do, before anything else in this file, before running a script: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow dead-code` before reading (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-dead-code/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/dead-code.md. The start questions, the findings list, the checks, the report and the save offers all go through it. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
The FIRST thing you do, before anything else in this file, before running a script: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-dead-code/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow dead-code` before reading, then read <D>/console.md and <D>/notes/dead-code.md. The start questions, the findings list, the checks, the report and the save offers all go through it. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
## Project Context
+1 -1
View File
@@ -10,7 +10,7 @@ Plain words for the person: version list (lockfile), package list (manifest), sm
## Interface
The FIRST thing you do, before anything else in this file, before running a script: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow deps` before reading (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-deps/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/deps.md. Every card, the progress and the report go through it. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
The FIRST thing you do, before anything else in this file, before running a script: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-deps/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow deps` before reading, then read <D>/console.md and <D>/notes/deps.md. Every card, the progress and the report go through it. Switchable anytime. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
## Project Context
+1 -1
View File
@@ -8,7 +8,7 @@ Bug detective. Find a bug's cause and write it up, **without fixing it**: reprod
## Interface
The FIRST thing you do, before anything else in this file, before asking about the bug: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow diagnose` before reading (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-diagnose/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/diagnose.md. The bug questions, the growing cause, the bug name and the hand-off all go through it. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
The FIRST thing you do, before anything else in this file, before asking about the bug: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-diagnose/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow diagnose` before reading, then read <D>/console.md and <D>/notes/diagnose.md. The bug questions, the growing cause, the bug name and the hand-off all go through it. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
## Project Context (BLOCKING)
+4 -4
View File
@@ -8,7 +8,7 @@ Careful git operator. Read where the repository stands, do what the person asks
## Interface
An instruction in the argument (`/plan2code-git switch to main`, `/plan2code-git commit and push`, a commit subject) runs in the terminal at once: do not ask about the console. With no argument, the FIRST thing you do, before anything else in this file, before reading the repository: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow git` before reading (<D>: references/web-console/ beside this SKILL.md, ~/.agents/skills/plan2code-git/references/web-console/ globally, or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/git.md. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`) take it and do not ask; drop the flag. Launched by the dashboard, or by a **Commit it now** or Changelog hand-off? Its session is already open: resume it with `--workflow git` (console-launches.md). Handed off to commit (Commit it now, Changelog's yes): post `reread`, then run the Commit flow from step 1 over every changed file (risky ones left out and named), its cards on the board; afterwards the board is theirs with Push lit.
An instruction in the argument (`/plan2code-git switch to main`, `/plan2code-git commit and push`, a commit subject) runs in the terminal at once: do not ask about the console. With no argument, the FIRST thing you do, before anything else in this file, before reading the repository: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md, ~/.agents/skills/plan2code-git/references/web-console/ globally, or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow git` before reading, then read <D>/console.md and <D>/notes/git.md. Launched by the dashboard, or by a **Commit it now** or Changelog hand-off? Its session is already open: resume it with `--workflow git` (console-launches.md). Handed off to commit (Commit it now, Changelog's yes): post `reread`, then run the Commit flow from step 1 over every changed file (risky ones left out and named), its cards on the board; afterwards the board is theirs with Push lit.
## Project context
@@ -68,7 +68,7 @@ On a non-zero exit, save git's stderr to the session folder, run `classify-error
## Actions
- **refresh, pull, switch, create** run on the click when the plan says `ask: false` (a clean tree, a fast-forward).
- **push, publish, delete, cleanup** always ask first, with the plan's `confirm`.
- **push, publish, delete, cleanup** always ask first, with the plan's `confirm`, except a push picked in the commit's own card (Commit flow step 7).
- **switch** with changes: **Switch and bring them** runs the switch; **Commit first** runs the Commit flow over the changed files, then the switch; **Cancel** does nothing but the `git-result` line. A pull's `dirty` card works the same way, with the pull in place of the switch.
- **create** with `then: "commit"` creates the branch, then continues the Commit flow on it with the action's `files` (and `ignore`, as for commit).
- **commit** commits only the paths in `files`. With `ignore[]`, first propose those `.gitignore` lines as a doc plus a `review` card (approve / change), write them on approve, and add `.gitignore` to the commit.
@@ -96,9 +96,9 @@ In the terminal the same stops are asked in prose, with the diff printed.
2. **Nothing to commit.** If `push` is not null, go to 7. Otherwise say the tree is clean and everything is pushed (or that there is no remote), and stop.
3. **Branch.** On the board, skip this: the Save step's **Start a branch and commit** already offered it, and its answer arrives as `create` with `then: "commit"`. In the terminal, when `onDefault` (or `detached`) and `hasCommits`, offer one drafted branch name `<type>/<short-description>` (types: feature, fix, chore, docs, refactor, test; `feature/export-csv`). Run any name the person types through `branch-check`, then `plan create`. Skipping is always fine (on a detached HEAD, warn that commits there are easy to lose). When `defaultBranch` is null say why there is no offer.
4. **Read the changes.** `git diff`, `git diff --cached` and the untracked files (an `untracked` path ending in `/` is a folder: list its files with `git ls-files -o --exclude-standard -- <folder>` and stage them by name). If the person staged some files, work from that staged set and leave the rest alone (say what was left). On the board, only the paths the action named, or every changed file on a hand-off. Decide whether the work is one concern or several.
5. **Message.** One concern: draft a subject, or use the argument and skip approval; ask **Yes** / **Edit** / **No**. Several: always suggest whole-file groups, each with a subject, naming any file that mixes concerns and which group took it; ask **Approve** / **Change it** / **One commit instead** (asked even when the subject came as the argument). Name the `sensitive` and `large` files you are leaving out.
5. **Message.** One concern: draft a subject, or use the argument and skip approval; ask **Yes** / **Edit** / **No**, with **Yes and push** beside Yes when a push is possible (on the console, the subject and **Commit only** / **Commit and push** go in ONE post, notes/git.md). Several: always suggest whole-file groups, each with a subject, naming any file that mixes concerns and which group took it; ask **Approve** / **Change it** / **One commit instead** (asked even when the subject came as the argument). Name the `sensitive` and `large` files you are leaving out.
6. **Commit.** For each group in order: with more than one group, run `git reset -q` first so only that group is staged; then run `commit-msg.mjs --subject "<s>" --files <a> --files <b>` (`--files` once per path) and its `command` (or `add`, then `commit`). Finish with `git log --oneline -<n>`. On the console post `run: { "event": "git-commits", "id": "<first short hash>", "commits": <n> }` with the `reread` and a `git-result` line naming the hashes with `op: "commit"`, so the board lights Push.
7. **Push.** In the terminal, stop after committing with a one-line push hint and no push prompt. `commit and push` (or a push the person asks for) runs `plan push` / `plan publish` and asks its `confirm`. A rejected push: report it, suggest Pull, run nothing more.
7. **Push.** In the terminal, stop after committing with a one-line push hint and no push prompt. `commit and push`, or **Commit and push** / **Yes and push** picked with the message, runs `plan push` / `plan publish` straight after the commit: that choice was the yes. A push asked for any other way runs the same plan and asks its `confirm`. A rejected push: report it, suggest Pull, run nothing more.
## Terminal
+6 -6
View File
@@ -9,7 +9,7 @@ and can open files, but they cannot see this conversation. Write for them.
## Interface
The FIRST thing you do, before anything else in this file — before inferring the next task: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow handoff` before reading (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-handoff/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/handoff.md. The next-task confirmation and any clarifying questions go through it, and the finished handoff lands on the page as a doc with the download the page offers. Switchable anytime. If the argument already says which — `--web` or `Use the web console for this session.` — take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then the one hard rule.
The FIRST thing you do, before anything else in this file — before inferring the next task: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-handoff/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow handoff` before reading, then read <D>/console.md and <D>/notes/handoff.md. The next-task confirmation and any clarifying questions go through it, and the finished handoff lands on the page as a doc with the download the page offers. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then the one hard rule.
## The one hard rule: capture the next task, and confirm it with the user
@@ -60,8 +60,8 @@ writing with `node "<S>/specs.mjs" status specs/<feature>` (`<S>` is `scripts/`
- Cite that file and its checkbox state directly in **Current state** and
**Key files & pointers**, instead of relying on conversation memory alone.
- Let **Suggested skills** name the specific next pipeline command
(`/plan2code-3-implement --web` to keep implementing the phase,
`/plan2code-4-finalize --web` once all phases are checked) — but only as a
(`/plan2code-3-implement` to keep implementing the phase,
`/plan2code-4-finalize` once all phases are checked) — but only as a
suggestion; the confirmed **Next task** above still governs what the reader
does first.
@@ -106,9 +106,9 @@ a command that must be run a specific way. Save the reader from re-discovering
these the hard way.>
## Suggested skills
<Which skills the next agent should use, and when — e.g. /plan2code-3-implement --web
to continue a phase, /plan2code-review before finishing, /plan2code-4-finalize --web
to wrap up. Skip if none apply.>
<Which skills the next agent should use, and when — e.g. /plan2code-3-implement
to continue a phase, /plan2code-review before finishing, /plan2code-4-finalize
to wrap up; add --web to any of them for the web console. Skip if none apply.>
## Verification
<How the reader confirms their work: exact test/build commands, what "done"
+1 -1
View File
@@ -14,7 +14,7 @@ Interactive Q&A flow to update an existing `AGENTS.md` with new learnings and pr
## Interface
The FIRST thing you do, before anything else in this file — before the Awareness Context: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow init-update` before reading (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-init-update/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/init.md. Every question in the Q&A flow and the restructure offer go through it. Switchable anytime. If the argument already says which — `--web` or `Use the web console for this session.` — take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then Awareness Context.
The FIRST thing you do, before anything else in this file — before the Awareness Context: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-init-update/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow init-update` before reading, then read <D>/console.md and <D>/notes/init.md. Every question in the Q&A flow and the restructure offer go through it. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then Awareness Context.
## Scripts
+1 -1
View File
@@ -14,7 +14,7 @@ Analyze this codebase and create `AGENTS.md` to guide future AI coding agents (C
## Interface
The FIRST thing you do, before anything else in this file — before exploring the codebase: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow init` before reading (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-init/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/init.md. Every confirmation — the restructure offer, the AI-agent file-sync prompt — goes through it, and the finished AGENTS.md lands on the page as a doc marked `saved` (the file is already on disk — no download offered). Switchable anytime. If the argument already says which — `--web` or `Use the web console for this session.` — take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then Content.
The FIRST thing you do, before anything else in this file — before exploring the codebase: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-init/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow init` before reading, then read <D>/console.md and <D>/notes/init.md. Every confirmation — the restructure offer, the AI-agent file-sync prompt — goes through it, and the finished AGENTS.md lands on the page as a doc marked `saved` (the file is already on disk — no download offered). Launched by the dashboard? Its session is already open — resume it (console-launches.md), then Content.
## Scripts
+1 -1
View File
@@ -8,7 +8,7 @@ Gets a branch ready for review. Picks the checks its changes need, runs the ones
## Interface
The FIRST thing you do, before anything else in this file, before reading the branch: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow pr-prep` before reading (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-pr-prep/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/pr-prep.md. Every question, the check plan, the report and the description go through it. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
The FIRST thing you do, before anything else in this file, before reading the branch: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-pr-prep/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow pr-prep` before reading, then read <D>/console.md and <D>/notes/pr-prep.md. Every question, the check plan, the report and the description go through it. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
## Project Context
+3 -3
View File
@@ -8,7 +8,7 @@ Senior software architect. Analyze requirements, ask clarifying questions, deliv
## Interface
The FIRST thing you do, before anything else in this file — before the AGENTS.md check, before asking what to build: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow quick-task` before reading (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-quick-task/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md, <D>/building.md and <D>/notes/quick-task.md in one batch. Every question, the scope check and the plan go through it; once the task is built, the finish offers a review of it on the page. Switchable anytime. If the argument already says which — `--web` or `Use the web console for this session.` — take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then the AGENTS.md check.
The FIRST thing you do, before anything else in this file — before the AGENTS.md check, before asking what to build: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-quick-task/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow quick-task` before reading, then read <D>/console.md, <D>/building.md and <D>/notes/quick-task.md in one batch. Every question, the scope check and the plan go through it; once the task is built, the finish offers a review of it on the page. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then the AGENTS.md check.
## Project Context (BLOCKING)
@@ -128,11 +128,11 @@ After achieving clarity, assess scope:
[Files examined, patterns noted]
---
**Next:** New conversation with `/plan2code-1-plan --web`, attach this file.
**Next:** New conversation with `/plan2code-1-plan` (add `--web` for the web console), attach this file.
Resume at Phase 2 (System Context).
```
Then tell user: "Created `specs/<feature-name>/PLAN-DRAFT-<date>.md`. Start new conversation with `/plan2code-1-plan --web` to continue."
Then tell user: "Created `specs/<feature-name>/PLAN-DRAFT-<date>.md`. Start new conversation with `/plan2code-1-plan` to continue (add `--web` for the web console)."
---
+2 -2
View File
@@ -8,7 +8,7 @@ Critical review specialist -- experienced senior engineer providing independent
## Interface
The FIRST thing you do, before anything else in this file — before the scope detection: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow review` before reading (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-review/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/review.md. Scope questions, the findings report and the pick-what-gets-fixed menu all go through it; the report lands on the page as a doc. Switchable anytime. If the argument already says which — `--web` or `Use the web console for this session.` — take it and do not ask; drop the flag. `--loop` (only inside the desktop app, a Review Loop round): open with `open --loop --workflow review --round <n> --role <role> --scope-file <path>` from the arguments, read `<D>/notes/review-loop.md` after `console.md`, and follow it; it replaces the scope question, the fix menu, the sign-off, Lessons End and every git step below. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then Process. Read inside a build session for its review button? Skip this section — building-review.md's overrides govern, the session is already running.
The FIRST thing you do, before anything else in this file — before the scope detection: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md — ~/.agents/skills/plan2code-review/references/web-console/ globally — or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow review` before reading, then read <D>/console.md and <D>/notes/review.md. Scope questions, the findings report and the pick-what-gets-fixed menu all go through it; the report lands on the page as a doc. `--loop` (only inside the desktop app, a Review Loop round): open with `open --loop --workflow review --round <n> --role <role> --scope-file <path>` from the arguments, read `<D>/notes/review-loop.md` after `console.md`, and follow it; it replaces the scope question, the fix menu, the sign-off, Lessons End and every git step below. Launched by the dashboard? Its session is already open — resume it (console-launches.md), then Process. Read inside a build session for its review button? Skip this section — building-review.md's overrides govern, the session is already running.
## Scripts
@@ -184,7 +184,7 @@ Work summary — tell user: scope reviewed, findings count by severity (Critical
Read references/session-end.md
> Fallback: route plan2code artifacts (plan/spec docs/phases) on the reviewed feature's own `specs/<feature>/` state to the earliest unmet pipeline stage whose input exists — `PLAN-*` or `overview.md` without `phase-*.md` → `/plan2code-2-document`; unchecked `- [ ]` phase tasks → `/plan2code-3-implement`; all checked → `/plan2code-4-finalize`; archived → complete, summary only. Read the state with `specs.mjs status <spec>` (gitignored `specs/` defeats search tools). Non-pipeline artifacts (code/PRs/docs/logs) → summary only. Unresolved Criticals → fixing them (H/A/S) is the next step. Ambiguous or multiple candidate specs → ask one targeted question. Output: "Next (NEW conversation): `/plan2code-<step>` — [why + how you know]", appending ` --web` when the routed step offers the web console; else "Review complete -- [summary]."
> Fallback: route plan2code artifacts (plan/spec docs/phases) on the reviewed feature's own `specs/<feature>/` state to the earliest unmet pipeline stage whose input exists — `PLAN-*` or `overview.md` without `phase-*.md` → `/plan2code-2-document`; unchecked `- [ ]` phase tasks → `/plan2code-3-implement`; all checked → `/plan2code-4-finalize`; archived → complete, summary only. Read the state with `specs.mjs status <spec>` (gitignored `specs/` defeats search tools). Non-pipeline artifacts (code/PRs/docs/logs) → summary only. Unresolved Criticals → fixing them (H/A/S) is the next step. Ambiguous or multiple candidate specs → ask one targeted question. Output: "Next (NEW conversation): `/plan2code-<step>` — [why + how you know]; add `--web` for the web console"; else "Review complete -- [summary]."
- **Commit** (code changes): the `command` from `commit-msg.mjs --subject "fix: [desc]" --files <file>` repeated once per fixed file. On Windows PowerShell 5.1 (no `&&`), give `add` and `commit` as two commands.
+4 -4
View File
@@ -8,7 +8,7 @@ Finds code no test covers and writes the missing tests. Asks where to look, find
## Interface
The FIRST thing you do, before anything else in this file, before reading the code: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow test` before reading (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-test/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/test.md. Every question, the plan and the results go through it. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
The FIRST thing you do, before anything else in this file, before reading the code: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-test/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow test` before reading, then read <D>/console.md and <D>/notes/test.md. Every question, the plan and the results go through it. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
## Project Context
@@ -133,11 +133,11 @@ Write the missing tests for [scope]: [N] source files with no test, across [runn
[Commands confirmed, coverage run or skipped, nearest tests read]
---
**Next:** New conversation with `/plan2code-1-plan --web`, attach this file.
**Next:** New conversation with `/plan2code-1-plan` (add `--web` for the web console), attach this file.
Resume at Phase 2 (System Context).
```
3. Say: "Created `specs/<name>/PLAN-DRAFT-<date>.md`. Start a new conversation with `/plan2code-1-plan --web` to continue." End the run (Session End, escalated).
3. Say: "Created `specs/<name>/PLAN-DRAFT-<date>.md`. Start a new conversation with `/plan2code-1-plan` (add `--web` for the web console) to continue." End the run (Session End, escalated).
### Step 4: Style
@@ -191,7 +191,7 @@ Work summary: the scope, how gaps were found (matching, and coverage run or skip
**Next step**, as the closing line:
- A bug was kept: "NEXT STEP (NEW conversation): `/plan2code-diagnose` with `[test file]` › `[case]` as the reproduction."
- Escalated: "NEXT STEP (NEW conversation): `/plan2code-1-plan --web` with `specs/<name>/PLAN-DRAFT-<date>.md`."
- Escalated: "NEXT STEP (NEW conversation): `/plan2code-1-plan` (add `--web` for the web console) with `specs/<name>/PLAN-DRAFT-<date>.md`."
- Otherwise: "Commit the new tests with `/plan2code-git`."
On the console, post `finish` with the tests added and their results in `headline`, `"dashboard": true`, and `command` `/plan2code-diagnose` when a bug was kept (`/plan2code-1-plan` when escalated), else no `command`. No `commit` field: `body` says to commit the new tests with `/plan2code-git`.
+1 -1
View File
@@ -8,7 +8,7 @@ Product designer who shows several real options instead of describing them. Draw
## Interface
The FIRST thing you do, before anything else in this file, before running a script: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow ui-prototype` before reading (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-ui-prototype/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/ui-prototype.md. The starting screen, the paste, the next steps and the save questions all go through it; the prototype itself always opens as its own browser tab. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
The FIRST thing you do, before anything else in this file, before running a script: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-ui-prototype/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow ui-prototype` before reading, then read <D>/console.md and <D>/notes/ui-prototype.md. The starting screen, the paste, the next steps and the save questions all go through it; the prototype itself always opens as its own browser tab. Switchable anytime. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
## Run from another skill
+1 -1
View File
@@ -8,7 +8,7 @@ Codebase guide. Two jobs, one card: **explain** how and why an area of the code
## Interface
The FIRST thing you do, before anything else in this file, before the mode question: ask **web console** (browser page, suggested) or **terminal**? Console → run `node "<D>/console.mjs" open --workflow xray` before reading (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-xray/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir), then read <D>/console.md and <D>/notes/xray.md. The mode question, the answer or the ranked list, and the save offer all go through it. Switchable anytime. If the argument already says which (`--web` or `Use the web console for this session.`), take it and do not ask; drop the flag. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
The FIRST thing you do, before anything else in this file, before the mode question: **terminal** or **web console**? Run `node "<D>/console.mjs" interface` (<D>: references/web-console/ beside this SKILL.md (~/.agents/skills/plan2code-xray/references/web-console/ globally) or the dir in ~/.plan2code/console/console-dir) and follow its rule: the request or the saved default decides; ask only if it says so or the command fails. Console → run `node "<D>/console.mjs" open --workflow xray` before reading, then read <D>/console.md and <D>/notes/xray.md. The mode question, the answer or the ranked list, and the save offer all go through it. Launched by the dashboard? Its session is already open: resume it (console-launches.md), then Project Context.
## Project Context (BLOCKING)
+6
View File
@@ -143,6 +143,11 @@ port, and the filesystem as transport; this CLI is the whole agent surface.
finish to post). --force stops a dead page or an abandoned session
anyway (the desktop app passes it on its own shutdowns); --all
never asks.
interface [--set web|terminal|ask]
Every skill's first step. Prints { interface, rule }: the person's
saved default ("web", "terminal" or null) and the rule for picking
this session's interface. Follow the rule. --set saves the default
for every skill in every project; ask clears it.
${workflowLines()}
@@ -174,6 +179,7 @@ export const HELP_TOPICS = {
dashboard: "console-launches.md",
meter: "console-meter.md",
trouble: "console-trouble.md",
interface: "console-interface.md",
};
for (const f of fs.existsSync(path.join(HERE, "notes")) ? fs.readdirSync(path.join(HERE, "notes")) : []) {
if (f.endsWith(".md")) HELP_TOPICS[f.slice(0, -3)] ??= `notes/${f}`;
+53 -2
View File
@@ -1,9 +1,9 @@
// Plan2Code Web Console - the small commands: keep, forget, delete-spec, handoff, delete-handoff, status and stop.
// Plan2Code Web Console - the small commands: keep, forget, delete-spec, handoff, delete-handoff, status, stop and interface.
import fs from "node:fs";
import path from "node:path";
import { SESSIONS_DIR, appendEvent, readJson } from "./files.mjs";
import { HERE, HOME_DIR, INTERFACE_FILE, INTERFACES, SESSIONS_DIR, appendEvent, ensureDir, nowIso, readJson, savedInterface, writeJsonAtomic } from "./files.mjs";
import { SERVER_MAX_LIFE_MS, attachmentName, healthOk, listHandles, pidAlive, projectRoot, repoRoots, resultWaiting, sessionDir } from "./sessions.mjs";
import { removeSpec } from "./scan.mjs";
import { isOpen, rule } from "./patches.mjs";
@@ -304,3 +304,54 @@ export async function cmdStop() {
}
print({ ok: true, stopped, ...(skipped ? { skippedStaleHandles: skipped } : {}) });
}
/* ------------------------------------------------------------ interface */
// Every skill's first step: terminal or web console? The answer comes from the
// person's request, else their one saved default, and only when neither says
// does a skill ask. An answer is never saved on its own: the person opts in to
// a default by asking for one. The rule is printed here rather than written
// into every skill prompt: those sit at their size limit, and one copy
// cannot drift.
const INTERFACE_NAMES = { web: "web console", terminal: "terminal" };
const INTERFACE_CUES =
"Cues for the web console: --web, `Use the web console for this session.`, or words such as " +
"web console, Plan2Code UI, browser page, interactive HTML session. Cues for the terminal: " +
"--terminal, or asking for the terminal. A task that is merely about web code is not a cue. " +
"Drop a flag from the argument.";
function interfaceRule(saved) {
const set = `node "${path.join(HERE, "console.mjs")}" interface --set web|terminal`;
const switching =
'Mid-session, "web console" or "terminal" from the person switches (console-interface.md → Switching mid-session) and leaves the default alone.';
if (saved) {
return (
`Use the ${INTERFACE_NAMES[saved]}: it is the person's saved default, so do not ask. ` +
`Only a cue in their request for this skill overrides it, for this session only. ${INTERFACE_CUES} ` +
`${switching} Asked to change the default: ${set}; --set ask clears it, so the next skill asks again.`
);
}
return (
`No default saved. A cue in the person's request decides. ${INTERFACE_CUES} ` +
"Without one, ask: web console (suggested: a browser page, easier for sign-offs) or terminal. " +
"Save nothing from the answer. After asking, add one line: say \"make the terminal (or web console) my default\" " +
`and no skill asks again. Asked for a default: ${set}. ${switching}`
);
}
export function cmdInterface() {
if (args.set === undefined) {
const saved = savedInterface();
print({ interface: saved, rule: interfaceRule(saved) });
return;
}
if (args.set === "ask") {
fs.rmSync(INTERFACE_FILE, { force: true });
print({ ok: true, interface: null });
return;
}
if (!INTERFACES.includes(args.set)) die("--set takes web, terminal or ask", 2);
ensureDir(HOME_DIR);
writeJsonAtomic(INTERFACE_FILE, { interface: args.set, at: nowIso() });
print({ ok: true, interface: args.set });
}
+55
View File
@@ -0,0 +1,55 @@
# The Interface Pick: Terminal or Web Console
Part of the web console contract (`console.md`). Read when the `interface`
command's rule tells you to ask, or when the person asks to switch a running
session between the terminal and this page.
## Which one: the request, the saved default, or ask
Every skill's first step is `node "<CONSOLE>" interface`. It prints
`{ interface, rule }`: the person's saved default (`"web"`, `"terminal"` or
`null`) and the rule to follow. In short: a cue in their request wins for this
session (`--web`, `--terminal`, or plain words asking for one), then the saved
default, and only with neither do you ask. The answer is for this session only:
nothing is saved until the person asks for a default, so someone who has not
chosen one keeps being offered both.
The default is one file for the person, `interface.json` in the console folder
(`~/.plan2code/console/`), shared by every skill in every project. A cue, an
answer to the question or a mid-session switch never changes it. "Make the
terminal my default" does: `interface --set terminal`. `interface --set ask`
clears it, so the next skill asks again.
When the rule says to ask, use the structured question tool if you have one.
If you have none, ask it as an ordinary numbered question in prose. Either way
it is one question with two answers:
> **How would you like to work through this?**
>
> - **In your browser** (suggested) — a page opens with the questions laid out,
> what we have agreed so far, and everything saved as you go. Easier to follow,
> and far easier if you are walking through this with someone else.
> - **Here in the terminal** — one question at a time, right where you are.
If it lands on the terminal, ignore the rest of the console's files until they
ask to switch. If the console fails to start for any reason, say so in one line
and carry on in the terminal: never let this block the session.
## Switching mid-session
The person can move a running session either way whenever they say so ("web
console", "terminal", "switch to the browser"). The files under `specs/` are the
only source of truth and neither channel owns them, so nothing is lost. A switch
is for this session only and leaves the saved default alone.
- **Terminal → web console:** `open --workflow <yours>` (with `--spec` if you
know it), read `console.md` (and `building.md` for a build), then post where
the session stands: what is already settled as answered items, and the
question that is open now. Never re-ask something they answered in the
terminal.
- **Web console → terminal:** in one patch, post a `finish` with a headline
such as "Carrying on in the terminal", a body saying their answers are
saved, and `"console": false`, and clear any `"stopWarning"` with `""` (a
`finish` is refused while one is set). Then `stop`, and carry on in the
terminal from the same point, re-asking there whatever was still open on
the page.
+1 -1
View File
@@ -6,7 +6,7 @@
| `wait` returns 20 | `open --resume <sid>`, give the new link; nothing they typed is lost |
| They close the tab | Nothing: drafts are saved and the link restores everything |
| Your session ends mid-flight | Their answers stay on disk; a fresh session runs `status` (or `open --resume`, which reports `pendingResult:true`) and `wait` returns them |
| They ask to go back to the terminal | `finish`, then `stop`, and continue; files under `specs/` are unchanged |
| They ask to go back to the terminal | Post the "Carrying on in the terminal" `finish`, then `stop`, and continue (`console-interface.md` → Switching mid-session); files under `specs/` are unchanged |
| The page is dead, the server will not answer, or the session is abandoned with no finish | `stop --session <sid> --force` (a plain `stop` with no finish is refused, exit 3) |
| Picking up a paused session | `open --resume <sid>` clears the paused `finish` and its open questions; re-ask what you need (`console-stop.md`) |
| The same result arrives twice | Your harness killed `wait` after the hand-over. Handle it once; most of a repeated patch is harmless since items merge by id, but `thread` appends: leave out entries you already sent |
+6 -2
View File
@@ -8,6 +8,8 @@
// keep copy a cited note attachment into specs/<idea>/attachments/
// status list sessions, or show one
// stop shut a session's server down
// interface the person's saved terminal / web console default, and the rule
// every skill follows to pick one; --set changes it
//
// This file is the command table and what every command shares (the parsed
// flags, print, die and the session lookups). The commands live beside it:
@@ -39,6 +41,7 @@ import {
cmdDeleteSpec,
cmdForget,
cmdHandoff,
cmdInterface,
cmdKeep,
cmdStatus,
cmdStop,
@@ -90,6 +93,7 @@ const COMMANDS = {
"delete-handoff": cmdDeleteHandoff,
status: cmdStatus,
stop: cmdStop,
interface: cmdInterface,
help: cmdHelp,
};
@@ -107,7 +111,7 @@ if (Number.isFinite(nodeMajor) && nodeMajor < 18) {
if (!cmd || !Object.hasOwn(COMMANDS, cmd)) {
process.stderr.write(
"console: usage: console.mjs <open|post|wait|chat|keep|forget|delete-spec|handoff|delete-handoff|status|stop|help> [--session <id>] [--file <patch.json>] [--seconds N]\n"
"console: usage: console.mjs <open|post|wait|chat|keep|forget|delete-spec|handoff|delete-handoff|status|stop|interface|help> [--session <id>] [--file <patch.json>] [--seconds N]\n"
);
process.exit(2);
}
@@ -115,7 +119,7 @@ if (!cmd || !Object.hasOwn(COMMANDS, cmd)) {
// A flag given with no value parses as `true`, and a boolean handed on as a
// path or a name crashes somewhere deep (path.basename(true) throws). Every
// flag that takes a value is checked once, here, and refused as bad usage.
const VALUE_FLAGS = ["session", "sid", "resume", "file", "spec", "title", "workflow", "skill", "handoff", "upload", "name", "from", "seconds", "limit", "idle-ms", "for-cli", "round", "role", "scope-file"];
const VALUE_FLAGS = ["session", "sid", "resume", "file", "spec", "title", "workflow", "skill", "handoff", "upload", "name", "from", "seconds", "limit", "idle-ms", "for-cli", "round", "role", "scope-file", "set"];
for (const flag of VALUE_FLAGS) {
if (flag in args && typeof args[flag] !== "string") die(`--${flag} needs a value`, 2);
}
+13
View File
@@ -53,6 +53,19 @@ export const LOOKS_FILE = path.join(HOME_DIR, "looks.json");
// so every session within the hour reuses one lookup.
export const UPDATE_CHECK_FILE = path.join(HOME_DIR, "update-check.json");
// Where the person likes skills to run: "web" (this console) or "terminal".
// One file for the user, read by every skill in every project, and kept apart
// from looks.json because the page rewrites that one from its own copy and
// would put back a stale value. Written only by `console.mjs interface --set`.
export const INTERFACE_FILE = path.join(HOME_DIR, "interface.json");
export const INTERFACES = Object.freeze(["web", "terminal"]);
// The saved interface, or null when there is none or the file is unreadable.
export function savedInterface() {
const saved = readJson(INTERFACE_FILE, null);
return saved && INTERFACES.includes(saved.interface) ? saved.interface : null;
}
// The runtime dir has to follow PLAN2CODE_CONSOLE_HOME too. Without that, a
// test run (or a second sandboxed instance) shares one handle directory with
// the real thing, and `stop --all` reaches outside its own world and kills a
+46 -1
View File
@@ -126,6 +126,49 @@ export function writePause(cwd, paused, now) {
return { paused: true, since };
}
/* ------------------------------------------------------- the tidy-up quiet */
/**
* A short fingerprint of the project's saved lessons (every `.md` file's name
* and text under `.plan2code/lessons/`, in name order). It changes when a
* lesson is added, merged, reworded or retired, and only then. Reads only; a
* missing folder or an unreadable file counts as empty.
*/
export function lessonsFingerprint(cwd = process.cwd()) {
const dir = path.join(worktreeOf(cwd), ".plan2code", "lessons");
const hash = crypto.createHash("sha1");
let names = [];
try {
names = fs.readdirSync(dir).filter((n) => n.endsWith(".md")).sort();
} catch {}
for (const name of names) {
let text = "";
try {
text = fs.readFileSync(path.join(dir, name), "utf8");
} catch {}
hash.update(`${name}\0${text}\0`);
}
return hash.digest("hex");
}
/** The lessons a tidy-up already looked over (or the person waved off), or null. */
export function readTidyQuiet(cwd) {
const data = readJson(path.join(storeDir(cwd), "tidy-quiet.json"));
if (!data || typeof data !== "object" || data.format !== FORMAT || typeof data.fingerprint !== "string") return null;
return data.fingerprint;
}
/**
* Remember that the lessons as they are now need no tidy-up nudge: a tidy-up
* proposed nothing, or the person pressed Not now. `now` pins the clock.
*/
export function writeTidyQuiet(cwd, now) {
const fingerprint = lessonsFingerprint(cwd);
ensureDir(storeDir(cwd));
writeJsonAtomic(path.join(storeDir(cwd), "tidy-quiet.json"), { format: FORMAT, fingerprint, at: toDate(now).toISOString() });
return fingerprint;
}
/* ------------------------------------------------------------ follow counts */
/** One line per "Following a lesson" moment, on this machine only. */
@@ -330,6 +373,8 @@ export function learningScan(cwd = process.cwd(), { now, read = learningState }
pausedSince: s.pausedSince || null,
waiting: Number.isInteger(waiting.count) ? waiting.count : 0,
oldestDays: Number.isInteger(waiting.oldestDays) ? waiting.oldestDays : 0,
nearCap: s.state === "on" && lessonsNearCap(cwd),
// Crowded, and not already looked over: a tidy-up that proposed nothing (or
// a Not now) quiets the nudge until the saved lessons change.
nearCap: s.state === "on" && lessonsNearCap(cwd) && readTidyQuiet(cwd) !== lessonsFingerprint(cwd),
};
}
+4 -4
View File
@@ -18,7 +18,7 @@ A click arrives as one session action per send, and the board locks until your n
| `commit` | `files[]`, `ignore[]` (folders for `.gitignore`). `files[]` may be empty when `ignore[]` is not (held-back offer): add the paths to `.gitignore` and commit only `.gitignore`. |
| `pr-host` | `host`, `kind` (already saved by `POST /pr-host`) |
**After an action**, ONE post with `--wait`:
**After an action**, ONE post with `--wait` and `"settle":true` (an answered card left open is delivered again):
```jsonc
{"reread":true,"items":[{"id":"git-result","kind":"notice","op":"push","title":"Pushed 2 commits to origin/feature/x","body":"a1b2c3d, e4f5a6b. [Open pull request](https://github.com/...)"}],"board":{"describe":"export-csv-button"}}
@@ -43,9 +43,9 @@ An `auth` failure: a `notice` saying the tool never handles logins, with `next`.
| Commit step | On the page |
| --- | --- |
| One commit | `text` card, `placeholder` the drafted subject, `pattern` capping it at 100 characters, then `confirm` "Commit this?" with files in `consequences` and `files:[{"path","state"}]` (modified, new, deleted, renamed). No card when the subject was the argument. |
| A split | Doc `commits` (each group's subject and files, files mixing concerns) plus `review` with verdicts `approve`, `change`, `single` ("One commit instead"). Asked even with a subject argument. |
| Push | Not asked after a board commit (the board lights Push). `commit and push` or a Push click asks `plan push` / `plan publish`'s `confirm`. |
| One commit | Two cards in ONE post, one send: a `text` "Commit subject" (`placeholder` the drafted subject, `pattern` capping it at 100 characters; changed files in `body`, risky ones named) and a `choice` "Commit or push?": `1` **Commit only**, `2` **Commit and push** (recommended with an `upstream` or remote), `allowOther:false`, its `detail` naming where the push goes. No "Commit this?" confirm. A subject argument: the choice alone. |
| A split | Doc `commits` (each group's subject and files, files mixing concerns) plus `review` with verdicts `approve`, `change`, `single` ("One commit instead"), and the same Commit only / Commit and push `choice` beside it in the same post. Asked even with a subject argument. |
| Push | After **Commit and push** (or `commit and push`): run `plan push` / `plan publish` at once, no second `confirm`; the choice was the yes. Any other push click asks the plan's `confirm`. |
| `git init` | `confirm` naming folder and first branch (`init-check`'s `branch`, `danger:false`), `consequences` its `commands`. Run those, not a bare `git init`. |
| `.gitignore` | The proposed file, or a `commit`'s `ignore[]` lines, as a doc plus `review`. |
+1
View File
@@ -22,6 +22,7 @@ export const POINTER_FILES = {
workspace: "console-workspace.md",
subagents: "console-subagents.md",
review: "building-review.md",
interface: "console-interface.md",
learning: "console-launches.md",
};
+3 -3
View File
@@ -451,8 +451,8 @@ export function workflowLabel(workflow) {
export const CONSOLE_WORKFLOWS = FLOW_SKILLS.map((s) => s.command).filter(Boolean);
// Rides on the end of the command as part of the skill's argument. Every
// console skill takes it as the answer to "web console or terminal?" instead
// of asking again. It must stay clear of "brief", "recap" and "minutes":
// console skill takes it as a one-session cue for the web console, ahead of
// the person's saved default. It must stay clear of "brief", "recap" and "minutes":
// pathfinder reads any of those in its argument as a request for a brief.
export const CONTINUE_IN_CONSOLE = "--web";
@@ -464,7 +464,7 @@ const CONSOLE_SENTENCE = /\s*Use the web console for this session\.?/gi;
* What the Copy button on the finished screen puts on the clipboard.
*
* Someone who worked the whole session in the browser should land back in the
* browser, not be asked the interface question as though they were new. The
* browser, even when their saved default is the terminal. The
* `--web` flag goes on the same line as the command, because what follows a
* slash command is its argument, and a pasted second line is not reliably that.
* A command written with the long sentence is copied with the flag instead.
+24
View File
@@ -207,6 +207,17 @@
<path class="mg-line" d="M7 14.5l1.2 5h2.4l-.9-3.8M17.5 9.5a4 4 0 0 1 0 5M20 7a7.5 7.5 0 0 1 0 10" />
</svg>
</a>
<!-- Text size: [-], the size (a click returns to 100%), [+]. Saved with
the looks; the page's type tokens scale from it (tokens.css). -->
<div class="text-size" id="text-size" role="group" aria-label="Text size">
<button type="button" class="icon-btn" id="btn-text-smaller" title="Smaller text" aria-label="Smaller text">
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 12h12" /></svg>
</button>
<button type="button" class="text-size-label" id="btn-text-size" title="Back to 100%" aria-label="Text size, back to 100%">100%</button>
<button type="button" class="icon-btn" id="btn-text-larger" title="Larger text" aria-label="Larger text">
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 12h12M12 6v12" /></svg>
</button>
</div>
<!-- Activities: small games for a long wait. Opens a dialog that pauses
the moment Plan2Code needs the person; nothing in it reaches the agent. -->
<button type="button" class="icon-btn" id="btn-activities" title="Activities" aria-label="Activities">
@@ -1542,6 +1553,12 @@
The <strong>megaphone</strong> button opens Plan2Code's
GitHub issues, where you can report a bug or suggest an idea.
</li>
<li>
The <strong>[-]</strong> and <strong>[+]</strong> buttons make the
whole page's text smaller or larger, in seven steps from 80% to 150%;
the size between them (click it) returns to 100%. Your choice is kept, and
Back to default on the Appearance tab resets it.
</li>
<li>
The <strong>die</strong> beside it opens <strong>Activities</strong>,
small games to play while you wait. See "Activities".
@@ -3891,6 +3908,13 @@
Your choices are remembered on this machine and carry over to every
session you open here.
</p>
<h4>Terminal or this page</h4>
<p>
Until you save a default, Plan2Code asks whether to start in the
terminal or on this page. Say "make the terminal my default" (or "make
the web console my default") and it stops asking. To move just the
session you are in, say "web console" or "terminal" at any point.
</p>
<h4>Less motion</h4>
<p>
The page has no motion switch of its own. It follows your computer's
+19 -1
View File
@@ -4,7 +4,7 @@
// `looks` is a live binding: every file reads the current object, and only
// this file replaces it.
import { DEFAULT_ACCENT, soundPrefs, soundFilePrefs, DEFAULT_CARD_WIDTH, ACCENTS, accentId, cardWidth, soundKey, soundFileKey } from "./palette.js";
import { DEFAULT_ACCENT, soundPrefs, soundFilePrefs, DEFAULT_CARD_WIDTH, DEFAULT_TEXT_SIZE, TEXT_SIZES, ACCENTS, accentId, cardWidth, textSize, soundKey, soundFileKey } from "./palette.js";
import { normalizeRole, ROLE_NOT_SET } from "./starters.js";
import { bootData, hooks } from "./state.js";
import { el } from "./render.js";
@@ -32,6 +32,8 @@ export const DEFAULT_LOOKS = {
// Which sound file each pickable cue plays (soundFileQuestion: "sound-03").
...soundFilePrefs(null),
width: DEFAULT_CARD_WIDTH,
// The top bar's text size, in percent (palette.js TEXT_SIZES).
textSize: DEFAULT_TEXT_SIZE,
hideUnavailable: true,
// Skip the wake-up intro: never play the dashboard's first-open wake-up (Planny asleep), off by default.
skipIntro: false,
@@ -77,6 +79,7 @@ export function adoptLooks(saved) {
Object.assign(looks, soundFilePrefs(looks));
if (typeof looks.hideUnavailable !== "boolean") looks.hideUnavailable = DEFAULT_LOOKS.hideUnavailable;
looks.width = cardWidth(looks.width);
looks.textSize = textSize(looks.textSize);
if (typeof looks.skipIntro !== "boolean") looks.skipIntro = DEFAULT_LOOKS.skipIntro;
if (typeof looks.skillLaunched !== "boolean") looks.skillLaunched = DEFAULT_LOOKS.skillLaunched;
if (typeof looks.meterTipSeen !== "boolean") looks.meterTipSeen = DEFAULT_LOOKS.meterTipSeen;
@@ -190,6 +193,18 @@ const systemDark = () => matchMedia("(prefers-color-scheme: dark)").matches;
const effectiveTheme = () => (looks.theme === "system" ? (systemDark() ? "dark" : "light") : looks.theme);
// The top bar's text size control: the label says the size, and a button at an end of the range is spent.
function paintTextSize() {
const at = TEXT_SIZES.indexOf(looks.textSize);
const label = $("btn-text-size");
if (!label) return;
label.textContent = looks.textSize + "%";
// The accessible name replaces the visible text, so it carries the size too.
label.setAttribute("aria-label", `Text size ${looks.textSize}%, back to 100%`);
$("btn-text-smaller").setAttribute("aria-disabled", String(at <= 0));
$("btn-text-larger").setAttribute("aria-disabled", String(at >= TEXT_SIZES.length - 1));
}
export function applyLooks() {
const root = document.documentElement;
// The desktop app's shell wears this page's theme and highlight: the resolved
@@ -208,6 +223,9 @@ export function applyLooks() {
// Before the accent's early return, so a default accent never skips it.
if (looks.width === DEFAULT_CARD_WIDTH) root.removeAttribute("data-width");
else root.dataset.width = looks.width;
if (looks.textSize === DEFAULT_TEXT_SIZE) root.removeAttribute("data-text-size");
else root.dataset.textSize = String(looks.textSize);
paintTextSize();
// The default lives in the stylesheet, where it is written once per theme.
// Clearing the override is how it gets its own values back.
+11
View File
@@ -249,6 +249,17 @@ export function cardWidth(value) {
return typeof value === "string" && Object.hasOwn(CARD_WIDTHS, value) ? value : DEFAULT_CARD_WIDTH;
}
// The text size steps, in percent, for the top bar's [-] and [+]. Here for the
// same reason the card widths are: the page validates a saved `looks.textSize`
// with textSize(), and the server paints the first-load `data-text-size`.
export const TEXT_SIZES = [80, 90, 100, 110, 120, 135, 150];
export const DEFAULT_TEXT_SIZE = 100;
export function textSize(value) {
return TEXT_SIZES.includes(value) ? value : DEFAULT_TEXT_SIZE;
}
// The sound files a person can give a cue, sound-01 to sound-19, served from
// /sounds/<name>.mp3 (static.mjs).
export const SOUND_FILES = Array.from({ length: 19 }, (_, i) => `sound-${String(i + 1).padStart(2, "0")}`);
+1 -1
View File
@@ -25,7 +25,7 @@ export function prefsOpenTab(asked) {
// The looks keys Back to default resets on a tab, or null where it has
// nothing to reset (and is hidden).
export function prefsResetScope(tab) {
if (tab === "appearance") return ["theme", "width", "accent", "role", "skipIntro"];
if (tab === "appearance") return ["theme", "width", "textSize", "accent", "role", "skipIntro"];
if (tab === "sounds") return ["sound", ...Object.keys(SOUND_EVENTS).map(soundKey), ...PICKABLE_SOUNDS.map(soundFileKey), "hideActivities", "activitySounds", "gameMusic"];
return null;
}
@@ -16,6 +16,7 @@ import {
} from "../selectors.js";
import { whenTitle, whenWords } from "../labels.js";
import { hooks, page, redraw, saveNow } from "../state.js";
import { postJson } from "../net.js";
import { el, approvalTip, mdInto, releasesLink, copyButton, lightDismiss, icon, SVG_NS } from "../render.js";
import { needsRoleNudge, ROLE_NOT_SET } from "../starters.js";
import { looks, saveLooks } from "../looks.js";
@@ -1483,6 +1484,15 @@ function learningBanner(sc) {
if (why) b.title = why;
b.addEventListener("click", () => sendLearning(what));
r.appendChild(b);
if (what === "tidy") {
// Not now needs no agent: the server remembers it, on this machine only,
// and the nudge stays hidden until the saved lessons change.
const later = el("button", "btn sm", "Not now");
later.type = "button";
later.title = "Hide this until your lessons change.";
later.addEventListener("click", () => quietTidyNudge());
r.appendChild(later);
}
banner.appendChild(r);
};
if (text) row(text, "Review", "review", true);
@@ -1490,6 +1500,17 @@ function learningBanner(sc) {
return banner;
}
// Hide the tidy-up nudge until the saved lessons change (POST /learning/tidy-quiet;
// the server pushes the patched scan, so the banner redraws without it). Used by
// Not now and by a Tidy up that came back with nothing to propose. A failure is
// quiet: the nudge simply stays, as it did before.
async function quietTidyNudge() {
try {
await postJson("/learning/tidy-quiet", {});
} catch {}
redraw();
}
// The agent finishing with nothing to show ends the wait early: a Review whose
// card never came (the banner was stale) says so at once instead of spinning
// to the limit, and a saved choice stops when the agent is back to waiting.
@@ -1514,6 +1535,9 @@ function watchLearningBusy(busy) {
clearInterval(timer);
page.learningBusy = null;
if (busy.what === "review" || busy.what === "tidy") {
// A tidy-up with nothing to propose is an answer: remember it, so the
// nudge does not come straight back for the same lessons.
if (busy.what === "tidy") quietTidyNudge();
const none = hooks.banner(busy.what === "tidy" ? "Nothing to tidy up right now." : "No lessons are waiting any more.", "info");
setTimeout(() => hooks.clearBanner(none), 4000);
}
+14 -1
View File
@@ -5,7 +5,7 @@ import { adoptLooks, applyLooks, loadLooks, looks, renderSwatches, saveLooks, sy
import { dropHeldSound, previewSound, releaseHeldSound, sound, soundOn } from "../sound.js";
import { hushTones, tone, unlockTones } from "../tones.js";
import { hushMusic } from "../music.js";
import { SOUND_EVENTS, soundFileKey, soundKey } from "../palette.js";
import { DEFAULT_TEXT_SIZE, SOUND_EVENTS, TEXT_SIZES, soundFileKey, soundKey } from "../palette.js";
import { ROLES, ROLE_NOT_SET, ROLE_NOT_SET_LABEL, needsRoleNudge, normalizeRole } from "../starters.js";
import { isDashboard } from "../selectors.js";
import { el } from "../render.js";
@@ -63,6 +63,19 @@ export function wireLooks() {
hooks.markSaved(fieldsetOf(radio), saveLooks());
});
}
// The top bar's text size: one step each way, the label back to 100%.
const stepText = (by) => {
const at = TEXT_SIZES.indexOf(looks.textSize) + by;
if (at < 0 || at >= TEXT_SIZES.length) return;
looks.textSize = TEXT_SIZES[at];
saveLooks();
};
$("btn-text-smaller").addEventListener("click", () => stepText(-1));
$("btn-text-larger").addEventListener("click", () => stepText(1));
$("btn-text-size").addEventListener("click", () => {
looks.textSize = DEFAULT_TEXT_SIZE;
saveLooks();
});
for (const radio of document.querySelectorAll('input[name="looks-width"]')) {
radio.addEventListener("change", () => {
looks.width = radio.value;
+22
View File
@@ -28,6 +28,28 @@
.icon-btn:hover svg .ab-dot, .icon-btn:hover svg .dc-pip { fill: var(--accent); stroke: none; }
a.icon-btn { box-sizing: border-box; text-decoration: none; }
/* The text size control: [-] size [+], one group in the tools. The label is the
reset, so it reads as text and gets the same hover as an icon. */
.text-size { display: flex; align-items: center; gap: 0; }
.text-size-label {
appearance: none;
min-width: 44px;
height: 36px;
padding: 0 4px;
border: 1px solid transparent;
border-radius: var(--radius-md);
background: transparent;
color: var(--ink-2);
font: 600 var(--fs-xs)/1 var(--sans);
font-variant-numeric: tabular-nums;
cursor: pointer;
}
.text-size-label:hover { background: var(--panel-2); border-color: var(--rule); color: var(--accent); }
/* An end of the range: dimmed, not disabled, so Playwright and keyboards still reach it. */
.text-size .icon-btn[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.text-size .icon-btn[aria-disabled="true"]:hover { background: transparent; border-color: transparent; }
.text-size .icon-btn[aria-disabled="true"]:hover svg * { stroke: var(--ink-2); }
/* A link in a dialog (the update modal's release, Help's version) keeps the
accent once visited: the browser's purple is unreadable on the dark theme. */
.modal a:not(.btn), .modal a:not(.btn):visited { color: var(--accent); }
+19 -11
View File
@@ -76,17 +76,19 @@
/* The column's width: the card, the pager and the documents. */
--card-width: 880px;
/* Type: text steps, h1 to h4, one poster size; weights 400, 600, 700 only. */
--fs-2xs: 11px;
--fs-xs: 12px;
--fs-sm: 13px;
--fs-md: 14px;
--fs-base: 15px;
--fs-lg: 17px;
--fs-h4: 16px;
--fs-h3: 18px;
--fs-h2: 21px;
--fs-h1: 25px;
--fs-poster: 38px;
--fs-2xs: calc(11px * var(--text-scale));
--fs-xs: calc(12px * var(--text-scale));
--fs-sm: calc(13px * var(--text-scale));
--fs-md: calc(14px * var(--text-scale));
--fs-base: calc(15px * var(--text-scale));
--fs-lg: calc(17px * var(--text-scale));
--fs-h4: calc(16px * var(--text-scale));
--fs-h3: calc(18px * var(--text-scale));
--fs-h2: calc(21px * var(--text-scale));
--fs-h1: calc(25px * var(--text-scale));
--fs-poster: calc(38px * var(--text-scale));
/* The top bar's text size: 1 until [data-text-size] says otherwise (rules below). */
--text-scale: 1;
--lh-tight: 1.25;
--lh-ui: 1.4;
--lh-body: 1.55;
@@ -101,6 +103,12 @@
:root[data-width="narrow"] { --card-width: 720px; }
:root[data-width="wide"] { --card-width: 1080px; }
:root[data-width="ultrawide"] { --card-width: 1440px; }
:root[data-text-size="80"] { --text-scale: 0.8; }
:root[data-text-size="90"] { --text-scale: 0.9; }
:root[data-text-size="110"] { --text-scale: 1.1; }
:root[data-text-size="120"] { --text-scale: 1.2; }
:root[data-text-size="135"] { --text-scale: 1.35; }
:root[data-text-size="150"] { --text-scale: 1.5; }
/* Dark is written twice on purpose. The first copy follows the system unless
light was chosen; the second is the explicit ask. Without the `:not()` a
+34 -6
View File
@@ -50,10 +50,10 @@ import {
import { DOC_TYPES, MAX_ATTACHMENTS, MAX_DOC_BYTES, docExt, workflowLabel, workflowTitle } from "./public/answers.js";
import { CHAT_LIMIT, CHAT_MAX_CHARS } from "./public/chat.js";
import { cleanSetting, offered } from "./public/subagents.js";
import { DEFAULT_ACCENT, DEFAULT_CARD_WIDTH, accentId, cardWidth } from "./public/palette.js";
import { DEFAULT_ACCENT, DEFAULT_CARD_WIDTH, DEFAULT_TEXT_SIZE, accentId, cardWidth, textSize } from "./public/palette.js";
import { SERVABLE, TYPES, asset } from "./static.mjs";
import { handoffsDir, isHandoffId } from "./handoffs.mjs";
import { followCounts, learningScan, learningState, writePause } from "./learning.mjs";
import { followCounts, learningScan, learningState, writePause, writeTidyQuiet } from "./learning.mjs";
import { linkToOpen, openFile, openLink } from "./open-link.mjs";
import {
NotepadError,
@@ -100,6 +100,7 @@ const ROUTES = [
{ path: "/looks", method: "POST", origin: true, run: looksPost },
{ path: "/subagents", method: "POST", origin: true, run: subagentsPost },
{ path: "/learning/pause", method: "POST", origin: true, run: learningPause },
{ path: "/learning/tidy-quiet", method: "POST", origin: true, run: learningTidyQuiet },
{ path: "/learning/state", method: "GET", run: learningStateGet },
{ path: "/learning/lessons", method: "GET", run: learningLessons },
{ path: "/pr-host", method: "POST", origin: true, run: prHost },
@@ -370,6 +371,10 @@ function renderIndex(ctx) {
if (looks && cardWidth(looks.width) !== DEFAULT_CARD_WIDTH) {
htmlAttrs += ` data-width="${cardWidth(looks.width)}"`;
}
// Likewise the text size: a fixed list of whole numbers, nothing to escape.
if (looks && textSize(looks.textSize) !== DEFAULT_TEXT_SIZE) {
htmlAttrs += ` data-text-size="${textSize(looks.textSize)}"`;
}
const title = (state && state.title) || "Session";
const workflow = state && state.workflow;
const json = JSON.stringify(boot).replace(/</g, "\\u003c");
@@ -656,17 +661,40 @@ function subagentsPost(req, res, ctx) {
// store), never inside the project. It needs no agent: the dashboard's
// scan.learning is patched in place and pushed, so the row repaints at once.
function learningPause(req, res, ctx) {
return learningWrite(req, res, ctx, {
valid: (body) => typeof body.paused === "boolean",
states: ["on", "paused"],
write: (worktree, body) => writePause(worktree, body.paused),
event: (body) => ({ type: "learning-pause", paused: body.paused }),
});
}
// Learning's tidy-up quiet (learning.mjs): a Tidy up that proposed nothing, or
// the banner's Not now, hides the tidy-up nudge until the saved lessons change.
// Machine-local like the pause, and only while Learning is on.
function learningTidyQuiet(req, res, ctx) {
return learningWrite(req, res, ctx, {
valid: () => true,
states: ["on"],
write: (worktree) => writeTidyQuiet(worktree),
event: () => ({ type: "learning-tidy-quiet" }),
});
}
// The shared body of the Learning routes that write on this machine: check the
// body and the state, write, patch the dashboard's scan in place and push it.
function learningWrite(req, res, ctx, { valid, states, write, event }) {
return readBody(req, res, (err, body) => {
if (err) return json(res, err.tooBig ? 413 : 400, { error: err.tooBig ? "too large" : "body must be JSON" });
if (!body || typeof body !== "object" || typeof body.paused !== "boolean") return json(res, 400, { error: "bad-request" });
if (!body || typeof body !== "object" || !valid(body)) return json(res, 400, { error: "bad-request" });
const worktree = ctx.worktree() || ctx.project;
let learning;
let written = null;
let agentWrote = false;
try {
const current = learningState(worktree, undefined, { prune: false });
if (current.state !== "on" && current.state !== "paused") return json(res, 409, { error: "not-on" });
writePause(worktree, body.paused);
if (!states.includes(current.state)) return json(res, 409, { error: "not-on" });
write(worktree, body);
learning = learningScan(worktree);
written = updateState(ctx.dir, (fresh) => {
if (!fresh || !fresh.scan || typeof fresh.scan !== "object") return null;
@@ -696,7 +724,7 @@ function learningPause(req, res, ctx) {
} catch {}
}
}
noteEvent(ctx.dir, { type: "learning-pause", paused: body.paused });
noteEvent(ctx.dir, event(body));
ctx.pushState();
return json(res, 200, { ok: true, learning });
});
+2 -1
View File
@@ -297,12 +297,13 @@ export async function removeSessions(sessionsDir, sids) {
}
// The console folder's own files that no sweep may ever remove: the person's
// looks, the folders remembered per project and spec, the Implementation
// looks, their saved interface, the folders remembered per project and spec, the Implementation
// Loop's setup per project and its report while a build is under way, the Subagents switch
// saved per project and workflow, what each unknown git host is, the pointer
// to this console's directory, and the cached release check.
export const PROTECTED_CONSOLE_FILES = new Set([
"looks.json",
"interface.json",
"workspaces.json",
"loop-setup.json",
"loop-reports.json",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "Plan2Code",
"version": "3.2.0",
"version": "3.2.2",
"description": "A structured workflow of six steps (Pathfinder, Plan, Document, Implement, Review, Finalize) for AI-assisted software development",
"keywords": [
"ai",
@@ -17,6 +17,6 @@
"url": "https://github.com/jparkerweb/plan2code"
},
"homepage": "https://github.com/jparkerweb/plan2code",
"releaseDate": "2026-11-28",
"releaseDate": "2026-11-30",
"mode": "utility"
}