mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-17 04:45:33 -08:00
Port upstream skill scripts into v2.4.1: deterministic workflow steps run as Node scripts beside each SKILL.md (specs, pathfinder, feedback payload, commit message, review scope, agent files, handoff path) with tests, the prompt limit rises to 20,000 chars, upstream review fixes are folded in (linked agent files never overwrite AGENTS.md, review stops with no base, paste-safe commit commands, Pathfinder number high-water mark and dry runs), and web console workspace folders are remembered per project and spec, with Finalize forgetting an archived spec's list
AI Assisted
This commit is contained in:
1 parent
c0ea70e838
commit
6a66440095
243 files changed
+23698
-1607
No files matched your search
@@ -2505,6 +2505,9 @@ a.icon-btn { box-sizing: border-box; text-decoration: none; }
|
||||
actions stay put. */
|
||||
.modal.workspace { max-width: 680px; }
|
||||
.modal.workspace[open] { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
|
||||
.workspace .modal-blurb { margin-bottom: 6px; }
|
||||
.workspace-scope { margin: 0 0 16px; color: var(--ink-3, var(--ink-2)); font-size: 12.5px; }
|
||||
|
||||
.workspace-list {
|
||||
list-style: none; margin: 0; padding: 0;
|
||||
display: grid; gap: 12px;
|
||||
|
||||
@@ -2542,6 +2542,7 @@ function renderDashboard(main) {
|
||||
const specs = specList();
|
||||
if (specs.length) wrap.appendChild(renderSpecPicker(specs));
|
||||
wrap.appendChild(hideUnavailableToggle());
|
||||
if (!local.launching && !launchScoping) syncWorkspaceScope();
|
||||
|
||||
// "Unavailable" is the scan's verdict for the selected spec, not the
|
||||
// momentary greying while a launch is in flight or the server is away, so
|
||||
@@ -2963,6 +2964,11 @@ async function launchSkill(entry) {
|
||||
// cards that take no spec (utilities, setup) launch untargeted even while
|
||||
// a spec is selected.
|
||||
if (target) action.spec = target.dir;
|
||||
// The skill opens on the folders remembered for what it was launched for.
|
||||
// Held until the launch is in flight: the swap's own frame re-renders the
|
||||
// dashboard, which would otherwise sync back to the picker's spec.
|
||||
launchScoping = true;
|
||||
await syncWorkspaceScope(target ? target.dir : "");
|
||||
try {
|
||||
const res = await fetch("/submit", {
|
||||
method: "POST",
|
||||
@@ -2973,6 +2979,7 @@ async function launchSkill(entry) {
|
||||
}),
|
||||
});
|
||||
if (res.status === 409) {
|
||||
launchScoping = false;
|
||||
pendingResult = true;
|
||||
banner("Your last pick is still being picked up. One moment.", "info");
|
||||
return;
|
||||
@@ -2980,10 +2987,12 @@ async function launchSkill(entry) {
|
||||
if (!res.ok) throw new Error(String(res.status));
|
||||
sound("startSkill");
|
||||
local.launching = { skill: entry.skill, title: entry.title, at: Date.now() };
|
||||
launchScoping = false;
|
||||
pendingResult = true;
|
||||
save();
|
||||
render();
|
||||
} catch {
|
||||
launchScoping = false;
|
||||
banner("That did not go through. Nothing was lost; try again.", "warn");
|
||||
}
|
||||
}
|
||||
@@ -5854,6 +5863,32 @@ async function postJson(url, body) {
|
||||
}
|
||||
}
|
||||
|
||||
/* The workspace follows the dashboard's picker: the folders remembered for
|
||||
the selected spec, or the project's own under "Start from scratch". The
|
||||
server swaps the list and remembers every change after it. */
|
||||
let scopeAsked = null;
|
||||
// True from a launch's scope sync until its send has gone (or failed).
|
||||
let launchScoping = false;
|
||||
async function syncWorkspaceScope(spec) {
|
||||
if (!S || S.workflow !== "dashboard" || gone || !wsFrame) return;
|
||||
const want = spec === undefined ? (selSpec() && selSpec().dir) || "" : spec;
|
||||
if ((wsFrame.scope || "") === want || scopeAsked === want) return;
|
||||
scopeAsked = want;
|
||||
const { status, body } = await postJson("/workspace/scope", { spec: want });
|
||||
if (status === 200 && body && Array.isArray(body.folders)) wsFrame = { ...wsFrame, ...body };
|
||||
scopeAsked = null;
|
||||
if ($("workspace-modal").open) renderWorkspace();
|
||||
}
|
||||
|
||||
// The dialog's "Remembered for" line: whose list this is.
|
||||
function workspaceScopeText() {
|
||||
const scope = (wsFrame && wsFrame.scope) || "";
|
||||
if (!scope) return "Remembered for this project, so your next console session here starts with these folders.";
|
||||
const spec = specList().find((s) => s.dir === scope);
|
||||
const name = spec ? spec.name : scope.split("/").pop();
|
||||
return `Remembered for the ${name} spec, and loaded again whenever it is picked.`;
|
||||
}
|
||||
|
||||
const NAME_RULE = "Names use lowercase letters, numbers and hyphens.";
|
||||
const BROWSE_UNAVAILABLE = "Browse isn't available here — type or paste the path.";
|
||||
// The folder whose Remove is waiting on its inline confirm, by id.
|
||||
@@ -5893,6 +5928,7 @@ function renderWorkspace() {
|
||||
}
|
||||
folders.forEach((f, i) => paintWorkspaceRow(list.children[i], f));
|
||||
$("workspace-browse").hidden = Boolean(wsFrame && wsFrame.remote);
|
||||
$("workspace-scope").textContent = workspaceScopeText();
|
||||
}
|
||||
|
||||
function workspaceRow(f) {
|
||||
|
||||
@@ -833,10 +833,28 @@
|
||||
Click the folder name in the middle of the bottom bar. It shows your
|
||||
folder's name and branch, such as <strong>shop · main</strong>, and
|
||||
<strong>shop + 2 folders · main</strong> once you have added some.
|
||||
The workspace lasts for this console session only: it carries across
|
||||
steps you start from the dashboard, and a new console session starts
|
||||
with just the folder you started in.
|
||||
It carries across steps you start from the dashboard.
|
||||
</p>
|
||||
<h4>Remembered for next time</h4>
|
||||
<ul>
|
||||
<li>
|
||||
Every change is saved as you make it, so the next console session in
|
||||
this folder starts with the same folders.
|
||||
</li>
|
||||
<li>
|
||||
Each spec keeps its own list. The first time you pick a spec on the
|
||||
dashboard it starts as a copy of the project's list (the one shown
|
||||
under <strong>Start from scratch</strong>), and after that the two
|
||||
are separate. Picking a spec loads its list; the line under the
|
||||
dialog's title says whose list you are looking at.
|
||||
</li>
|
||||
<li>
|
||||
The lists live in <code>workspaces.json</code> in your own
|
||||
Plan2Code settings folder, beside your look and feel, never in the
|
||||
project. Finalize offers to forget a spec's list when it archives the
|
||||
spec.
|
||||
</li>
|
||||
</ul>
|
||||
<h4>Adding a folder</h4>
|
||||
<ul>
|
||||
<li>
|
||||
@@ -1363,9 +1381,10 @@
|
||||
<h4>What it counts</h4>
|
||||
<p>
|
||||
Each step you run here adds points: a plan or a set of documents
|
||||
weighs more than a single answered question, and a built phase more
|
||||
still, by how many tasks it completed: a big phase adds more than a
|
||||
small one. Every two questions you answer add a point too, so a long
|
||||
weighs more than a quick task, and a built phase more still, by how
|
||||
many tasks it completed: a big phase adds more than a small one.
|
||||
Every two questions you answer within one step add a point too
|
||||
(rounded down, so a single answer adds nothing), so a long
|
||||
back-and-forth counts for more than a short one. Click the ring to see the count and a list of each step that added
|
||||
points, with what it added. It is a rule of thumb, not a
|
||||
reading of Plan2Code's real memory: long sessions tend to make it
|
||||
@@ -2003,6 +2022,7 @@
|
||||
The folders the agent uses as context this session. It reads the extra ones for
|
||||
reference and only changes them if you ask.
|
||||
</p>
|
||||
<p class="workspace-scope" id="workspace-scope"></p>
|
||||
<ul class="workspace-list" id="workspace-list"></ul>
|
||||
<div class="workspace-add">
|
||||
<label class="workspace-add-label" for="workspace-path">Add a folder</label>
|
||||
|
||||
Reference in new issue
Block a user