@zero2webmaster/starter-kit 0.5.5 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/first-session-prompt.d.ts +33 -0
- package/dist/first-session-prompt.js +98 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/scaffolders/common.js +12 -25
- package/dist/standards.js +7 -0
- package/dist/summary.d.ts +6 -0
- package/dist/summary.js +33 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# z2w-starter-kit
|
|
2
2
|
|
|
3
|
-
**Version:** 0.5.
|
|
3
|
+
**Version:** 0.5.7 | **Framework:** 2.13.0
|
|
4
4
|
|
|
5
5
|
> Node CLI to scaffold new Z2W projects from canonical Templates + AGENTS.md.
|
|
6
6
|
|
|
@@ -99,4 +99,4 @@ For licensing inquiries: kerry@zero2webmaster.com.
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
101
|
*Scaffolded 2026-05-28 via the [[instantiate-z2w-project]] Claude Code skill v1; reconciled against the consolidated skill v1.1.0 (brief-first + Agent Coordination block) on 2026-05-29.*
|
|
102
|
-
*Version: 0.5.
|
|
102
|
+
*Version: 0.5.7 | Last Updated: 2026-07-27*
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ScaffoldInputs } from "./index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Markdown heading (without the leading `##`) for the HANDOFF.md section that
|
|
4
|
+
* carries the prompt. Exported so tests and future consumers locate the section
|
|
5
|
+
* by constant rather than by a copy of the literal.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FIRST_SESSION_PROMPT_HEADING = "\uD83D\uDE80 First-Session Kickoff Prompt";
|
|
8
|
+
/**
|
|
9
|
+
* Build the ready-to-paste prompt that starts the new project's first working
|
|
10
|
+
* session.
|
|
11
|
+
*
|
|
12
|
+
* Shape of the returned text — each paragraph earns its place:
|
|
13
|
+
*
|
|
14
|
+
* - **Framing.** States plainly that this is the first session and there is no
|
|
15
|
+
* application code yet, so the agent doesn't go hunting for prior work.
|
|
16
|
+
* - **Reading order.** Mirrors the reading order written into HANDOFF.md,
|
|
17
|
+
* including `directives/PROJECT_BRIEF.md` when a brief was captured.
|
|
18
|
+
* - **Coordination bootstrap.** Only for projects that participate in the
|
|
19
|
+
* bulletin. This is the step most reliably forgotten on a first session,
|
|
20
|
+
* because the project file doesn't exist yet — so there is nothing to read
|
|
21
|
+
* that would remind anyone it's missing.
|
|
22
|
+
* - **What to do with ROADMAP.md.** Branches on whether the roadmap is
|
|
23
|
+
* concrete (seeded from a brief), derivable (brief but no roadmap section),
|
|
24
|
+
* or a bare placeholder — so the agent is never told to "begin Step 1" on a
|
|
25
|
+
* roadmap that has no Step 1. This is the same three-way branch the older
|
|
26
|
+
* resumption prompt used; it was the one genuinely good part of it.
|
|
27
|
+
* - **How to finish.** Points at the Step Completion Protocol in CLAUDE.md,
|
|
28
|
+
* which is where verification + the mandatory bulletin write-back live.
|
|
29
|
+
*
|
|
30
|
+
* Returns text with `{{slug}}` / `{{date}}` tokens unresolved — see the module
|
|
31
|
+
* header.
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildFirstSessionPrompt(inputs: ScaffoldInputs): string;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// The first-session kickoff prompt — ONE source of truth for two consumers.
|
|
2
|
+
//
|
|
3
|
+
// Kerry's 2026-07-23 ask: "every session that scaffolds a new project should end
|
|
4
|
+
// with a suggested prompt for admin to kick off the first session in that new
|
|
5
|
+
// project." Before this module the scaffolder emitted a thin *resumption* prompt
|
|
6
|
+
// ("I'm picking up {{slug}}…") inside HANDOFF.md and nothing at all in the CLI's
|
|
7
|
+
// final summary — so whether the human actually received a kickoff prompt
|
|
8
|
+
// depended on the scaffolding agent remembering to hand one over by convention.
|
|
9
|
+
// Two projects (email-engine, courses-engine) got one that way; the next one
|
|
10
|
+
// would have depended on the same memory.
|
|
11
|
+
//
|
|
12
|
+
// Two things changed:
|
|
13
|
+
//
|
|
14
|
+
// 1. The prompt is framed as a FIRST session on a brand-new repo, not as
|
|
15
|
+
// picking up work in progress. A repo scaffolded ten seconds ago has no
|
|
16
|
+
// state to resume, and the first session's real job is different from every
|
|
17
|
+
// later one: bootstrap the bulletin entry, turn a brief into verifiable
|
|
18
|
+
// steps, then start Step 1.
|
|
19
|
+
// 2. It is rendered in BOTH places from this one builder — the HANDOFF.md
|
|
20
|
+
// section and the CLI's final summary — so the copy the human pastes and
|
|
21
|
+
// the copy committed to the repo cannot drift. `first-session-prompt.test.ts`
|
|
22
|
+
// pins that equivalence.
|
|
23
|
+
//
|
|
24
|
+
// The returned string still carries `{{slug}}`-style tokens: the HANDOFF path
|
|
25
|
+
// runs the whole file body through `sub()`, and the summary path substitutes
|
|
26
|
+
// explicitly. Callers must substitute before showing it to a human.
|
|
27
|
+
/**
|
|
28
|
+
* Markdown heading (without the leading `##`) for the HANDOFF.md section that
|
|
29
|
+
* carries the prompt. Exported so tests and future consumers locate the section
|
|
30
|
+
* by constant rather than by a copy of the literal.
|
|
31
|
+
*/
|
|
32
|
+
export const FIRST_SESSION_PROMPT_HEADING = "🚀 First-Session Kickoff Prompt";
|
|
33
|
+
/**
|
|
34
|
+
* Build the ready-to-paste prompt that starts the new project's first working
|
|
35
|
+
* session.
|
|
36
|
+
*
|
|
37
|
+
* Shape of the returned text — each paragraph earns its place:
|
|
38
|
+
*
|
|
39
|
+
* - **Framing.** States plainly that this is the first session and there is no
|
|
40
|
+
* application code yet, so the agent doesn't go hunting for prior work.
|
|
41
|
+
* - **Reading order.** Mirrors the reading order written into HANDOFF.md,
|
|
42
|
+
* including `directives/PROJECT_BRIEF.md` when a brief was captured.
|
|
43
|
+
* - **Coordination bootstrap.** Only for projects that participate in the
|
|
44
|
+
* bulletin. This is the step most reliably forgotten on a first session,
|
|
45
|
+
* because the project file doesn't exist yet — so there is nothing to read
|
|
46
|
+
* that would remind anyone it's missing.
|
|
47
|
+
* - **What to do with ROADMAP.md.** Branches on whether the roadmap is
|
|
48
|
+
* concrete (seeded from a brief), derivable (brief but no roadmap section),
|
|
49
|
+
* or a bare placeholder — so the agent is never told to "begin Step 1" on a
|
|
50
|
+
* roadmap that has no Step 1. This is the same three-way branch the older
|
|
51
|
+
* resumption prompt used; it was the one genuinely good part of it.
|
|
52
|
+
* - **How to finish.** Points at the Step Completion Protocol in CLAUDE.md,
|
|
53
|
+
* which is where verification + the mandatory bulletin write-back live.
|
|
54
|
+
*
|
|
55
|
+
* Returns text with `{{slug}}` / `{{date}}` tokens unresolved — see the module
|
|
56
|
+
* header.
|
|
57
|
+
*/
|
|
58
|
+
export function buildFirstSessionPrompt(inputs) {
|
|
59
|
+
const hasBrief = (inputs.instantiationPrompt ?? "").trim().length > 0;
|
|
60
|
+
const roadmapConcrete = (inputs.briefSections?.roadmap ?? "").trim().length > 0;
|
|
61
|
+
const paragraphs = [];
|
|
62
|
+
paragraphs.push("This is the FIRST working session on {{slug}}. The repo was scaffolded on\n" +
|
|
63
|
+
"{{date}} via @zero2webmaster/starter-kit and has no application code yet.");
|
|
64
|
+
// Hard-wrapped to ~78 columns so the block reads cleanly in a terminal, in the
|
|
65
|
+
// committed HANDOFF.md, and in a chat window without re-flowing.
|
|
66
|
+
const reading = hasBrief
|
|
67
|
+
? "Read HANDOFF.md, STATUS.md, ROADMAP.md, CLAUDE.md, and\n" +
|
|
68
|
+
"directives/PROJECT_BRIEF.md (the frozen instantiation brief).\n"
|
|
69
|
+
: "Read HANDOFF.md, STATUS.md, ROADMAP.md, and CLAUDE.md.\n";
|
|
70
|
+
paragraphs.push(reading + "Then confirm the next step with me before writing any code.");
|
|
71
|
+
if (inputs.participateInBulletin) {
|
|
72
|
+
paragraphs.push("This project participates in the Z2W coordination bulletin and its entry does\n" +
|
|
73
|
+
"not exist yet. Follow COORDINATION_ONBOARDING.md in this repo to create\n" +
|
|
74
|
+
"projects/{{slug}}.md in zero2webmaster/z2w-agent-coordination, then do the\n" +
|
|
75
|
+
"normal session-start read (Needs attention, Incidents, Inbox from Kerry,\n" +
|
|
76
|
+
"Open questions) before starting work.");
|
|
77
|
+
}
|
|
78
|
+
// Branch on `roadmapConcrete` FIRST, independent of `hasBrief`. A caller can
|
|
79
|
+
// supply `briefSections.roadmap` without `instantiationPrompt` — the `--input`
|
|
80
|
+
// path does exactly that when the brief lives outside the repo — and in that
|
|
81
|
+
// case ROADMAP.md really is seeded, so claiming it is "a placeholder" sends the
|
|
82
|
+
// agent off to invent a plan that is already sitting in the file.
|
|
83
|
+
if (roadmapConcrete) {
|
|
84
|
+
paragraphs.push("ROADMAP.md was seeded from the brief's plan. Turn it into concrete, verifiable\n" +
|
|
85
|
+
"steps, then begin Step 1.");
|
|
86
|
+
}
|
|
87
|
+
else if (hasBrief) {
|
|
88
|
+
paragraphs.push("ROADMAP.md has no concrete steps yet. Derive the first milestone from the\n" +
|
|
89
|
+
"brief, then begin Step 1.");
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
paragraphs.push("ROADMAP.md is a placeholder. Define the first concrete milestone, then begin\n" +
|
|
93
|
+
"Step 1.");
|
|
94
|
+
}
|
|
95
|
+
paragraphs.push("Close the session with the Step Completion Protocol in CLAUDE.md: run\n" +
|
|
96
|
+
"verification, update ROADMAP.md and STATUS.md, then commit and push.");
|
|
97
|
+
return paragraphs.join("\n\n");
|
|
98
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { writeScaffold } from "./writer.js";
|
|
2
2
|
import type { ScaffoldFile } from "./scaffolders/common.js";
|
|
3
3
|
import type { StandardDecision } from "./standards.js";
|
|
4
|
-
export declare const version = "0.5.
|
|
4
|
+
export declare const version = "0.5.7";
|
|
5
5
|
export type ProjectType = "wp-plugin" | "cf-worker" | "cf-pages" | "nextjs" | "python-service" | "node-service" | "library" | "protocol-repo";
|
|
6
6
|
export type BrandPreset = "save-the-frogs" | "bansuri-bliss" | "zero2webmaster" | "custom";
|
|
7
7
|
export type DbStrategy = "none" | "neon-postgres" | "supabase" | "sqlite" | "mysql-wp" | "other";
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import * as path from "node:path";
|
|
|
21
21
|
import { Writable } from "node:stream";
|
|
22
22
|
import { isValidSlug } from "./parse-brief.js";
|
|
23
23
|
import { writeScaffold } from "./writer.js";
|
|
24
|
-
export const version = "0.5.
|
|
24
|
+
export const version = "0.5.7";
|
|
25
25
|
// Canonical enum value-arrays. These live here, next to the type unions they
|
|
26
26
|
// enumerate, so both the CLI's confirm/wizard flows (which re-export them) and
|
|
27
27
|
// the programmatic `validateScaffoldInputs` share one source of truth. Keep
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
// Step 4 scaffolders emit the markers verbatim so they're easy to grep and
|
|
13
13
|
// trivially testable without a Templates dependency.
|
|
14
14
|
import { getBrandSpec, renderBrandBlock } from "../brand.js";
|
|
15
|
+
import { buildFirstSessionPrompt, FIRST_SESSION_PROMPT_HEADING, } from "../first-session-prompt.js";
|
|
15
16
|
import { applySubstitutions } from "../substitute.js";
|
|
16
17
|
export const STANDARDS_BLOCK_MARKER = "<!-- STANDARDS_BLOCK -->";
|
|
17
18
|
export const AGENT_COORDINATION_BLOCK_MARKER = "<!-- AGENT_COORDINATION_BLOCK -->";
|
|
@@ -583,12 +584,15 @@ export function commonStatus(inputs, opts, spec) {
|
|
|
583
584
|
}
|
|
584
585
|
export function commonHandoff(inputs, opts, spec) {
|
|
585
586
|
// Did we capture (and persist) a brief? If so it is written verbatim to
|
|
586
|
-
// directives/PROJECT_BRIEF.md and belongs in the reading order.
|
|
587
|
-
//
|
|
588
|
-
//
|
|
589
|
-
//
|
|
587
|
+
// directives/PROJECT_BRIEF.md and belongs in the reading order.
|
|
588
|
+
//
|
|
589
|
+
// The kickoff prompt itself lives in ../first-session-prompt.ts, because the
|
|
590
|
+
// CLI's final summary renders the SAME text (Kerry's 2026-07-23 ask) and two
|
|
591
|
+
// copies of a prompt is two prompts that drift. That module owns the
|
|
592
|
+
// brief/roadmap branching that used to be inline here — including the rule
|
|
593
|
+
// that an agent is never told to "begin ROADMAP Step 1" on a roadmap that has
|
|
594
|
+
// no Step 1 (the second half of the 2026-06-28 silent-miss).
|
|
590
595
|
const hasBrief = (inputs.instantiationPrompt ?? "").trim().length > 0;
|
|
591
|
-
const roadmapConcrete = (inputs.briefSections?.roadmap ?? "").trim().length > 0;
|
|
592
596
|
const readingOrder = [
|
|
593
597
|
"1. **This file (HANDOFF.md)** — current state",
|
|
594
598
|
"2. **[STATUS.md](STATUS.md)** — decisions, next actions, recent updates",
|
|
@@ -600,28 +604,11 @@ export function commonHandoff(inputs, opts, spec) {
|
|
|
600
604
|
else {
|
|
601
605
|
readingOrder.push("4. **[CLAUDE.md](CLAUDE.md)** — operating rules");
|
|
602
606
|
}
|
|
603
|
-
let startingPrompt;
|
|
604
|
-
if (hasBrief && roadmapConcrete) {
|
|
605
|
-
startingPrompt =
|
|
606
|
-
"I'm picking up {{slug}}. Read HANDOFF.md, STATUS.md, ROADMAP.md, and\n" +
|
|
607
|
-
"directives/PROJECT_BRIEF.md (the full brief). ROADMAP.md was seeded from the\n" +
|
|
608
|
-
"brief's plan — turn it into concrete, verifiable steps, then begin Step 1.";
|
|
609
|
-
}
|
|
610
|
-
else if (hasBrief) {
|
|
611
|
-
startingPrompt =
|
|
612
|
-
"I'm picking up {{slug}}. Read HANDOFF.md, STATUS.md, ROADMAP.md, and\n" +
|
|
613
|
-
"directives/PROJECT_BRIEF.md (the full brief). ROADMAP.md has no concrete steps\n" +
|
|
614
|
-
"yet — derive the first milestone from the brief, then begin Step 1.";
|
|
615
|
-
}
|
|
616
|
-
else {
|
|
617
|
-
startingPrompt =
|
|
618
|
-
"I'm picking up {{slug}}. Read HANDOFF.md, STATUS.md, ROADMAP.md. ROADMAP.md is\n" +
|
|
619
|
-
"a placeholder — define the first concrete milestone, then begin Step 1.";
|
|
620
|
-
}
|
|
621
607
|
const body = HANDOFF_HEAD +
|
|
622
608
|
readingOrder.join("\n") +
|
|
623
|
-
|
|
624
|
-
|
|
609
|
+
`\n\n---\n\n## ${FIRST_SESSION_PROMPT_HEADING}\n\n` +
|
|
610
|
+
"Paste this to start the first working session on this project:\n\n```\n" +
|
|
611
|
+
buildFirstSessionPrompt(inputs) +
|
|
625
612
|
"\n```\n" +
|
|
626
613
|
HANDOFF_TAIL +
|
|
627
614
|
"\n";
|
package/dist/standards.js
CHANGED
|
@@ -358,6 +358,13 @@ This project participates in the Z2W cross-project coordination bulletin.
|
|
|
358
358
|
- 2026-07-25 · z2w-starter-kit · ACTION · Trim your bulletin file — it's over the 256 KB read-cap · §Open questions
|
|
359
359
|
\`\`\`
|
|
360
360
|
Applies to every inbound form: a \`[→ {them}]\` question, a heads-up you filed in their file, or a maintainer directive. **The recipient deletes the line when they handle it**, so leaving it un-deleted is the signal that the item is still live. *(Adopted 2026-07-25 from \`z2w-starter-kit\`'s 2026-07-15 proposal on Kerry's observation that finding messages addressed to a project was too hard — one session had to grep a 705 KB file across three sections to find a directive aimed at it — and \`z2w-agent-command-center\`'s independent endorsement after the same failure bit it. The Command Center renders this block as the phone-first "addressed to you" queue.)*
|
|
361
|
+
- **ANSWERING a \`[→ you]\` question counts as "writing something addressed to another project" — so the reply ALSO needs a \`## 📥 Needs attention\` line, in the ASKER's file (v0.1.21).** This is the case the rule above always covered in principle and that everyone (including the maintainer) reads past in practice, because replying *feels* like closing an item rather than sending one. It isn't. Per §8.2 the thread lives in **your** file, which means **the asker has nothing in their own file to tell them an answer arrived** — they filed into your file and then never look at it again. Posting the \`↳\` is not delivering it.
|
|
362
|
+
\`\`\`
|
|
363
|
+
- 2026-07-27 · z2w-agent-coordination · FYI · RULING on your \`## Integrations\` question — answered in full on the thread in my file · projects/z2w-agent-coordination.md §Open questions
|
|
364
|
+
\`\`\`
|
|
365
|
+
Tag it \`FYI\` when the answer closes the thread and needs nothing back; \`ACTION\` when your answer asks them to change something. **Point at the file AND the section** — the thread is in your file, not theirs, so a bare \`§Open questions\` sends them to the wrong place. The asker deletes the line once they've read the reply, exactly as with any other inbound item.
|
|
366
|
+
|
|
367
|
+
*(Added 2026-07-27 after this exact failure, committed by the maintainer against \`audit-engine\`. A ruling it had been waiting on since 2026-07-26 was posted as a \`↳\` at 14:07 and broadcast to \`global.md\` at 14:13; \`audit-engine\` then wrote to the bulletin three times over the next six hours — 15:22, 15:23, 20:48 — still believing it had no answer, and eventually asked **Kerry** to relay it by hand. Its \`## 📥 Needs attention\` block was checked and carried two other lines and not this one, so the queue it correctly consulted told it, accurately, that no reply had arrived. Note that the \`global.md\` broadcast did NOT save it: a broadcast is a session-**start** read aimed at everyone, and the one agent with a specific stake in the answer is exactly the one who needs a routed line rather than a bulletin notice. Cost: ~7 hours of a held finding-set and a human relay hop, in the ecosystem's own coordination repo, under a rule that repo wrote.)*
|
|
361
368
|
- If a decision is genuinely waiting on Kerry, append a \`[→ Kerry]\` entry to your OWN file's \`## Open questions\` section — same syntax as cross-agent asks. Do NOT bury "waiting on Kerry" items in Heads-ups; the dashboard reads \`[→ Kerry]\` entries to show Kerry what's blocked on him.
|
|
362
369
|
- **\`[→ Kerry]\` entries MUST be human-readable to Kerry, not agent jargon (v0.1.9).** Lead every \`[→ Kerry]\` entry with a short **bold plain-English title** + a one-sentence "what Kerry needs to decide or do," then any detail below (a \`<details>\` block is fine for depth). The dashboard at \`agents.z2w.us\` surfaces these to Kerry directly; if the title buries the ask, the dashboard has to guess. Optionally add a machine-readable \`<!-- ask: {one-line ask} -->\` marker (the dashboard prefers it over derived text) and a blocking/non-blocking hint. Example:
|
|
363
370
|
\`\`\`
|
package/dist/summary.d.ts
CHANGED
|
@@ -16,6 +16,12 @@ export interface SummaryOptions {
|
|
|
16
16
|
* the manual commands.
|
|
17
17
|
*/
|
|
18
18
|
repoAutoCreated?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* ISO `YYYY-MM-DD` stamped into the first-session kickoff prompt. Omit in
|
|
21
|
+
* production (the substituter reads the system clock per CLAUDE.md Operating
|
|
22
|
+
* Principle #5); tests pin it for deterministic assertions.
|
|
23
|
+
*/
|
|
24
|
+
date?: string;
|
|
19
25
|
}
|
|
20
26
|
/**
|
|
21
27
|
* Render the post-scaffold summary block.
|
package/dist/summary.js
CHANGED
|
@@ -3,13 +3,19 @@
|
|
|
3
3
|
// Pure rendering layer that turns a {@link WriteScaffoldResult} (from the
|
|
4
4
|
// Step 6 writer) + the original {@link ScaffoldInputs} into the post-scaffold
|
|
5
5
|
// summary block the [[instantiate-z2w-project]] skill v1.1.0 Step 7 spec
|
|
6
|
-
// requires.
|
|
6
|
+
// requires. Six sections, in order:
|
|
7
7
|
//
|
|
8
8
|
// 1. Scaffold-complete banner (slug + targetPath + file count; "Dry run" prefix in dry-run mode)
|
|
9
9
|
// 2. Standards inserted — from decisions where state === "inserted-inline"
|
|
10
10
|
// 3. Standards skipped — from decisions where state === "skipped-not-applicable"
|
|
11
11
|
// 4. Promotions — only when at least one promotion.choice === "promote"
|
|
12
12
|
// 5. Next actions checklist — conditional on inputs + decisions
|
|
13
|
+
// 6. First-session kickoff prompt — the ready-to-paste prompt that starts the
|
|
14
|
+
// new project's first working session (Kerry's 2026-07-23 ask). Rendered
|
|
15
|
+
// from `first-session-prompt.ts`, the same builder that writes the prompt
|
|
16
|
+
// into the scaffolded HANDOFF.md, so the copy on screen and the copy in the
|
|
17
|
+
// repo cannot drift. It is deliberately LAST: it is the literal next thing
|
|
18
|
+
// the human does after working the checklist above it.
|
|
13
19
|
//
|
|
14
20
|
// Coloring (per CLAUDE.md brand block + skill spec): Z2W green `#82C92B` for
|
|
15
21
|
// section headings, Z2W gold `#FFD700` for the next-actions checklist. Color
|
|
@@ -18,7 +24,9 @@
|
|
|
18
24
|
// `opts.forceColor` is not set. Tests pin level=0 explicitly to assert ANSI
|
|
19
25
|
// escapes are absent.
|
|
20
26
|
import { Chalk } from "chalk";
|
|
27
|
+
import { buildFirstSessionPrompt, FIRST_SESSION_PROMPT_HEADING, } from "./first-session-prompt.js";
|
|
21
28
|
import { fathomEnvVarFor } from "./standards.js";
|
|
29
|
+
import { applySubstitutions } from "./substitute.js";
|
|
22
30
|
const Z2W_GREEN = "#82C92B";
|
|
23
31
|
const Z2W_GOLD = "#FFD700";
|
|
24
32
|
const PROMOTIONS_FILE = "STANDARDS_PROMOTIONS.md";
|
|
@@ -184,6 +192,29 @@ function renderNextActionsSection(chalk, inputs, result, repoAutoCreated) {
|
|
|
184
192
|
}
|
|
185
193
|
return lines.join("\n");
|
|
186
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Render the ready-to-paste first-session kickoff prompt.
|
|
197
|
+
*
|
|
198
|
+
* The prompt body is printed uncolored and unindented on purpose. Every other
|
|
199
|
+
* section indents its lines two spaces for readability, but this block exists to
|
|
200
|
+
* be selected and pasted into a new chat — leading spaces would come along, and
|
|
201
|
+
* ANSI color codes survive some copy paths. Only the heading and the fence rules
|
|
202
|
+
* are colored.
|
|
203
|
+
*/
|
|
204
|
+
function renderFirstSessionPromptSection(chalk, inputs, opts) {
|
|
205
|
+
const heading = chalk.hex(Z2W_GREEN).bold;
|
|
206
|
+
const rule = chalk.hex(Z2W_GOLD);
|
|
207
|
+
const prompt = applySubstitutions(buildFirstSessionPrompt(inputs), inputs, {
|
|
208
|
+
date: opts.date,
|
|
209
|
+
});
|
|
210
|
+
return [
|
|
211
|
+
heading("First-session kickoff prompt (paste this to start the new project):"),
|
|
212
|
+
rule(" ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄"),
|
|
213
|
+
prompt,
|
|
214
|
+
rule(" ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄"),
|
|
215
|
+
` (also written to HANDOFF.md in the new repo, under "${FIRST_SESSION_PROMPT_HEADING}")`,
|
|
216
|
+
].join("\n");
|
|
217
|
+
}
|
|
187
218
|
/**
|
|
188
219
|
* Render the post-scaffold summary block.
|
|
189
220
|
*
|
|
@@ -203,6 +234,6 @@ export function renderSummary(inputs, result, opts = {}) {
|
|
|
203
234
|
const promotions = renderPromotionsSection(chalk, result);
|
|
204
235
|
if (promotions !== null)
|
|
205
236
|
sections.push(promotions);
|
|
206
|
-
sections.push(renderNextActionsSection(chalk, inputs, result, opts.repoAutoCreated === true));
|
|
237
|
+
sections.push(renderNextActionsSection(chalk, inputs, result, opts.repoAutoCreated === true), renderFirstSessionPromptSection(chalk, inputs, opts));
|
|
207
238
|
output.write("\n" + sections.join("\n\n") + "\n");
|
|
208
239
|
}
|