Add the git-commit skill and dashboard card, and the No changes button, as v2.6.0

AI Assisted
This commit is contained in:
jparkerweb committed 2026-10-07 23:18:40 -07:00
1 parent 1877ca1fa7
commit 50a78a6917
37 files changed
+1001 -141

No files matched your search

+25 -5
View File
@@ -96,8 +96,8 @@ files under `specs/` are the only source of truth, and neither channel owns them
```
`--workflow` is whichever you are running: `dashboard`, `init`,
`init-update`, `pathfinder`, `quick-task`, `plan`, `revise-plan`,
`document`, `implement`, `implement-review`, `review`, `finalize` or
`handoff`. Get it
`document`, `implement`, `implement-review`, `review`, `finalize`,
`handoff` or `git-commit`. Get it
right: the page decides from it whether to offer a brief, what stopping
early costs, and which command resumes the session if you cannot say.
`dashboard` is the special one: the page draws the skill menu itself, and
@@ -776,7 +776,7 @@ where its real work starts.
The menu itself is the page's own list — you never send it. The page knows
the repo too: `open` scans `AGENTS.md` and `specs/` into `state.scan`
(`{ hasAgents, specs: [{ dir, name, state, detail, touched }] }`), and the
(`{ hasAgents, isGit, specs: [{ dir, name, state, detail, touched }] }`), and the
picker at the top of the menu greys the cards that do not fit the selected
spec's pipeline stage — or hides them outright while the **Hide unavailable
workflows** switch under the picker is on (the default; kept in `looks.json`
@@ -873,6 +873,25 @@ that is what the person is there to download. The finish carries no
`command`: the doc download is the point, and the dashboard button and the
"All done" line cover what comes next.
### Git commit (`git-commit`)
Open with `--workflow git-commit` (launched from the dashboard: resume the
session instead). Post `activity` while you read diffs and untracked files. One
card per step, each asked only when the step needs it:
| Step | On the page |
| --- | --- |
| Branch offer | A `choice`, "Which branch?": the suggested `<type>/<name>` (recommended), "Another name" (`allowOther` with a `pattern` for a branch name's shape; run what they type through `branch-check`) and "Stay on the current branch". |
| One commit | A `text` card whose `placeholder` is the drafted subject and whose `pattern` caps it at 100 characters, then a `confirm` "Commit this?" with the files in `consequences`. With the subject given as the argument there is no card. |
| A split | The groups as a doc (`id: "commits"`: each group's subject and files, and any file that mixes concerns) plus a `review` card with verdicts `approve`, `change` and `single` ("One commit instead"). Asked even when the subject came as the argument. |
| Push | A `confirm` with `push.command` and the commit list in `consequences`. |
| `git init` | A `confirm` naming the folder (`danger: false`). |
| `.gitignore` | The proposed file as a doc plus a `review` card. |
Risky files (`sensitive`, `large`) are named in the card's `body`. Finish: no
`command`, `"dashboard": true`, the commits and the push result in `body`.
A stop's finish is the bare `/plan2code-git-commit`.
### Pathfinder
- Every probe, recap and menu goes through the page.
@@ -994,7 +1013,7 @@ The page's top bar shows a meter of how much work this console session has
done (green, yellow, red), so the person knows when a fresh session would be
sharper. It is advice only and never blocks anything. The console counts
launches itself: Plan, Revise plan, Document, Review, Quick task, Init, Init
update and Finalize score when their session opens, and there is nothing to
update, Finalize and Git commit score when their session opens, and there is nothing to
post for them.
It counts answers itself too: every card the person answers in a send adds to
@@ -1011,7 +1030,8 @@ Per-unit work is yours to report, with `run` in any post:
- `event` is one of `pathfinder-chart`, `pathfinder-question` (scores
nothing now: answers count instead), `pathfinder-research`, `plan`,
`revise-plan`, `document`, `implement-phase`, `implement-review-phase`,
`review`, `quick-task`, `init`, `init-update`, `finalize`, `handoff`.
`review`, `quick-task`, `init`, `init-update`, `finalize`, `handoff`,
`git-commit` (counted when its session opens, so never post it).
An unknown event is exit `3`.
- `id` names the unit: a question's file slug, `phase-N`, `map`. The same id
posted again in the same skill run is ignored, so a repeated post never
+1 -1
View File
@@ -1108,7 +1108,7 @@ port, and the filesystem as transport; this CLI is the whole agent surface.
workflows: dashboard · init · init-update · pathfinder · quick-task · plan ·
revise-plan · document · implement · implement-review · review ·
finalize · handoff
finalize · handoff · git-commit
A session handed to you by the dashboard (a --session id): resume it with
"open --resume <sid> --no-open --workflow <yours> --title <t>" -- never a
+16
View File
@@ -344,6 +344,20 @@ function gitDirAt(dir) {
return fs.existsSync(path.join(git, "HEAD")) ? git : null;
}
// Whether `dir` is inside a git repository, found without a git process: the
// same walk findRoots() does. A set GIT_DIR / GIT_WORK_TREE / GIT_COMMON_DIR
// means git decides, so it counts as a repository. A `gitdir:` file (a linked
// worktree or a submodule) counts like a `.git` folder.
export function insideGitRepo(dir) {
if (process.env.GIT_DIR || process.env.GIT_WORK_TREE || process.env.GIT_COMMON_DIR) return true;
for (let d = path.resolve(dir); ; ) {
if (gitDirAt(d)) return true;
const up = path.dirname(d);
if (up === d) return false;
d = up;
}
}
export function projectRoot(cwd = process.cwd()) {
return repoRoots(cwd).project;
}
@@ -857,6 +871,7 @@ function isDir(p) {
* Scan <root>/specs into picker entries, most recently touched first.
* `touched` is the newest file mtime inside the folder — last write wins,
* which is the honest reading of "the one you were working on".
* `isGit` says whether `root` sits inside a git repository (no git process).
*/
export function scanProject(root) {
const specsDir = path.join(root, "specs");
@@ -888,6 +903,7 @@ export function scanProject(root) {
return {
at: nowIso(),
hasAgents: fs.existsSync(path.join(root, "AGENTS.md")),
isGit: insideGitRepo(root),
specs,
};
}
+31 -4
View File
@@ -247,6 +247,7 @@ export const WORKFLOW_LABEL = {
"quick-task": "Quick task",
finalize: "Wrapping up",
handoff: "Handoff",
"git-commit": "Git commit",
};
export function workflowLabel(workflow) {
@@ -271,6 +272,7 @@ export const CONSOLE_WORKFLOWS = [
"/plan2code-review",
"/plan2code-4-finalize",
"/plan2code-handoff",
"/plan2code-git-commit",
];
// Rides on the end of the command as part of the skill's argument. Every
@@ -434,6 +436,8 @@ export function resumeCommand({ workflow, specDir } = {}) {
return withOverview("/plan2code-4-finalize");
case "handoff":
return "/plan2code-handoff";
case "git-commit":
return "/plan2code-git-commit";
default:
return dir ? `/plan2code-0-pathfinder ${dir}/pathfinder` : "/plan2code-0-pathfinder";
}
@@ -638,6 +642,17 @@ export const SKILL_CATALOG = [
about:
"Writes down everything a new session would need, as a single document: what was decided, what is done, what is left. Use it when a conversation got long, a machine changed, or tomorrow-you deserves the context today-you has.",
},
{
skill: "plan2code-git-commit",
command: "/plan2code-git-commit",
workflow: "git-commit",
group: "extra",
chip: "Utility",
title: "Git commit",
blurb: "Commits your changes with a clear message, suggests a split when it is really two jobs, and offers to push.",
about:
"Reads what changed and drafts the commit message for you to approve. On the main branch it offers a new one first, and when the work is really two jobs it suggests splitting it into separate commits. It asks before every commit and every push, and never force-pushes.",
},
];
// A workflow by the name its dashboard card gives it ("Implement"), for the
@@ -660,6 +675,7 @@ export const START_POSES = [
"quick-task",
"review",
"handoff",
"git-commit",
];
const POSE_ALIASES = { "init-update": "init", "revise-plan": "plan", "implement-review": "implement" };
@@ -699,19 +715,21 @@ const NEXT_FOR_STATE = {
};
const ON = { on: true };
export const GIT_INIT_NOTE = "Not a git repository yet: it offers to start one";
const off = (reason) => ({ on: false, reason });
/**
* Whether a catalog card is clickable for the current picker selection.
*
* `scan` is the server's project scan ({ hasAgents, specs }); `sel` is the
* `scan` is the server's project scan ({ hasAgents, isGit, specs }); `sel` is the
* picked spec object or null for "start from scratch". A spec whose files
* match no pipeline shape ("unrecognized") behaves like no spec at all for
* availability — but its folder still goes along on a Pathfinder or Plan
* launch, since the files may be reference docs.
*
* Returns { on, reason?, next? } — `reason` is the one line a greyed card
* shows, `next` marks the state's natural step.
* Returns { on, reason?, note?, next? } — `reason` is the one line a greyed card
* shows, `note` the one line a clickable card shows when there is something to
* know before launching it, `next` marks the state's natural step.
*/
export function cardAvailability(entry, scan, sel) {
const hasAgents = Boolean(scan && scan.hasAgents);
@@ -727,6 +745,8 @@ export function cardAvailability(entry, scan, sel) {
case "plan2code-review":
case "plan2code-handoff":
return ON;
case "plan2code-git-commit":
return scan && scan.isGit === false ? { on: true, note: GIT_INIT_NOTE } : ON;
case "plan2code-0-pathfinder":
if (!state || state === "exploring") return { ...ON, next };
return off("This spec is already past the questions");
@@ -763,7 +783,14 @@ export function cardPresentation(entry, scan, sel, menu = {}) {
const recommendation = requested && cardAvailability(requested, scan, sel).on ? requested.skill : null;
const recommended = availability.on && (recommendation ? entry.skill === recommendation : availability.next);
const supplied = initial && menu.details && typeof menu.details[entry.skill] === "string" ? menu.details[entry.skill] : "";
const detail = availability.on && supplied ? supplied : !initial && availability.next && sel && sel.detail ? sel.detail : "";
const detail =
availability.on && supplied
? supplied
: availability.on && availability.note
? availability.note
: !initial && availability.next && sel && sel.detail
? sel.detail
: "";
return { ...availability, recommended, detail };
}
+14
View File
@@ -3419,6 +3419,20 @@ a.icon-btn { box-sizing: border-box; text-decoration: none; }
100% { transform: translateX(8px); opacity: 0; }
}
/* Git commit -- the arm reaches out and a new commit settles onto the branch
line in step with it. */
.pose .gc-reach { transform-origin: 0% 50%; animation: gc-reach 2.4s ease-in-out infinite; }
@keyframes gc-reach {
0%, 100% { transform: scaleX(0.9); }
50% { transform: scaleX(1); }
}
.pose .gc-dot { animation: gc-dot 2.4s ease-in-out infinite; }
@keyframes gc-dot {
0%, 15% { opacity: 0; transform: translateY(-8px); }
50%, 85% { opacity: 1; transform: translateY(0); }
100% { opacity: 0; transform: translateY(0); }
}
@media (max-width: 720px) {
.dash { padding-top: 0; }
.launch-stage { height: 140px; }
+15 -2
View File
@@ -4712,15 +4712,22 @@ function buildList(card, item, staged) {
}
card.appendChild(row);
card.appendChild(el("p", "help", "Drag to reorder, click a name to rename it."));
commentField(card, item, "Anything else about this breakdown? (type 'no changes' if none)");
commentField(card, item, "Anything else about this breakdown?", false, "no changes");
}
function commentField(card, item, labelText, required) {
function commentField(card, item, labelText, required, quickText) {
const wrap = el("div", "field");
const id = "note-" + item.id;
const label = el("label", null, labelText);
label.htmlFor = id;
wrap.appendChild(label);
let quick = null;
if (quickText) {
quick = el("button", "btn tiny", quickText.charAt(0).toUpperCase() + quickText.slice(1));
quick.type = "button";
quick.title = "Fill in \"" + quickText + "\"";
wrap.appendChild(quick);
}
const ta = el("textarea");
ta.id = id;
ta.placeholder = required ? "Tell Plan2Code what to change." : "Optional.";
@@ -4741,6 +4748,12 @@ function commentField(card, item, labelText, required) {
stagedChanged();
});
wrap.appendChild(ta);
if (quick)
quick.addEventListener("click", () => {
ta.value = quickText;
ta.dispatchEvent(new Event("input", { bubbles: true }));
ta.focus();
});
card.appendChild(wrap);
}
+27
View File
@@ -538,6 +538,32 @@
</g>
<g class="ho-arrow"><path class="as" d="M178 64 L214 64 M204 54 L216 64 L204 74" /></g>
</svg>
<!-- Git commit: saving a step. Beside a branch line with two commits on
it, one arm reaches to set a third commit onto the line. -->
<svg class="pose pose-git-commit" data-pose="git-commit" viewBox="0 4 240 216" aria-hidden="true" focusable="false">
<ellipse class="shadow" cx="126" cy="198" rx="44" ry="5" />
<g class="prop">
<line class="lt gc-line" x1="204" y1="62" x2="204" y2="172" />
<circle class="ac" cx="204" cy="82" r="7" />
<circle class="ac" cx="204" cy="112" r="7" />
<circle class="ac gc-dot" cx="204" cy="142" r="7" />
</g>
<g class="bob">
<g transform="translate(-14 0)">
<rect class="fl foot f1" x="94" y="179" width="20" height="10" rx="5" />
<rect class="fl foot f2" x="126" y="179" width="20" height="10" rx="5" />
<rect class="sh" x="80" y="72" width="80" height="108" rx="16" />
<path class="ln" d="M80 126 L66 150" /><circle class="fl" cx="66" cy="150" r="5.5" />
<path class="ey blink" d="M126 86 L129.64 94.98 L139.31 95.67 L131.9 101.92 L134.23 111.33 L126 106.2 L117.77 111.33 L120.1 101.92 L112.69 95.67 L122.36 94.98 Z" />
<path class="es" d="M110 120 Q122 129 134 120" />
<g class="gc-reach">
<line class="ln" x1="160" y1="126" x2="212" y2="142" />
<circle class="fl" cx="212" cy="142" r="5.5" />
</g>
</g>
</g>
</svg>
</template>
<!-- The Help dialog's content, cloned into #help-modal the first time ? is
@@ -1341,6 +1367,7 @@
<li><strong>Quick task.</strong> Too small for the full process? A quick plan, then it just builds it.</li>
<li><strong>Review.</strong> A second opinion on the changes. Problems ranked, and you pick what gets fixed.</li>
<li><strong>Handoff.</strong> Pack this conversation into a document a fresh session can pick up cold.</li>
<li><strong>Git commit.</strong> Commits your changes with a clear message, suggests a split when it is really two jobs, and offers to push.</li>
</ul>
<h4>Picking a spec</h4>
<p>
+6 -2
View File
@@ -25,13 +25,14 @@ export const WEIGHTS = Object.freeze({
"init-update": 2,
finalize: 1,
handoff: 0,
"git-commit": 1,
});
// Workflows whose launch itself scores WEIGHTS[workflow]. Pathfinder,
// implement and implement-review score only through the agent's `run`
// reports; dashboard and handoff never score.
// reports; dashboard and handoff never score; git-commit scores 1 on launch.
export const LAUNCH_COUNTED = Object.freeze(
new Set(["plan", "revise-plan", "document", "review", "quick-task", "init", "init-update", "finalize"])
new Set(["plan", "revise-plan", "document", "review", "quick-task", "init", "init-update", "finalize", "git-commit"])
);
const weightOf = (key) => (Object.prototype.hasOwnProperty.call(WEIGHTS, key) ? WEIGHTS[key] : 0);
@@ -126,6 +127,7 @@ const WORKFLOW_NAMES = Object.freeze({
"init-update": "Init update",
finalize: "Finalize",
handoff: "Handoff",
"git-commit": "Git commit",
});
// The skill run an entry belongs to, from its ledger id ("L3:..." -> "L3").
@@ -141,6 +143,7 @@ const LAUNCH_LABELS = Object.freeze({
init: "Init started",
"init-update": "Init update started",
finalize: "Finalize started",
"git-commit": "Git commit started",
});
const RUN_LABELS = Object.freeze({
"pathfinder-chart": "Pathfinder map written",
@@ -157,6 +160,7 @@ const RUN_LABELS = Object.freeze({
"init-update": "Init update run",
finalize: "Finalize run",
handoff: "Handoff written",
"git-commit": "Git commit run",
});
// The unit a run names, from its ledger id ("L3:phase-2" -> "phase-2").
+1 -1
View File
@@ -185,7 +185,7 @@ export function checkHelpers(list) {
// are tested without a browser. `frame` is the state frame's `subagents`
// block; app.js only renders what these say.
export const CHECKIN_LINE = "Helpers report through Plan2Code, so their progress shows here at its check-ins, not live.";
export const CHECKIN_LINE = "Helpers report through Plan2Code, so their progress is shown as it checks-in, not live.";
const STATE_LABELS = Object.freeze({ running: "Running", done: "Done", failed: "Failed" });