@zero2webmaster/starter-kit 0.5.6 → 0.5.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # z2w-starter-kit
2
2
 
3
- **Version:** 0.5.6 | **Framework:** 2.13.0
3
+ **Version:** 0.5.8 | **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.6 | Last Updated: 2026-07-27*
102
+ *Version: 0.5.8 | Last Updated: 2026-07-30*
@@ -75,7 +75,12 @@ export function buildFirstSessionPrompt(inputs) {
75
75
  "normal session-start read (Needs attention, Incidents, Inbox from Kerry,\n" +
76
76
  "Open questions) before starting work.");
77
77
  }
78
- if (hasBrief && roadmapConcrete) {
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) {
79
84
  paragraphs.push("ROADMAP.md was seeded from the brief's plan. Turn it into concrete, verifiable\n" +
80
85
  "steps, then begin Step 1.");
81
86
  }
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.6";
4
+ export declare const version = "0.5.8";
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.6";
24
+ export const version = "0.5.8";
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
@@ -238,6 +238,7 @@ export function scaffoldCfPages(inputs, opts) {
238
238
  { path: "_headers", content: sub(HEADERS_TEMPLATE, inputs, opts, spec) },
239
239
  { path: "_redirects", content: sub(REDIRECTS_TEMPLATE, inputs, opts, spec) },
240
240
  { path: "public/og-image.txt", content: OG_IMAGE_PLACEHOLDER },
241
+ { path: "health.json", content: HEALTH_JSON_TEMPLATE },
241
242
  {
242
243
  path: "SEO-CHECKLIST.md",
243
244
  content: sub(SEO_CHECKLIST_TEMPLATE, inputs, opts, spec),
@@ -245,6 +246,33 @@ export function scaffoldCfPages(inputs, opts) {
245
246
  ];
246
247
  return [...base, ...typeSpecific];
247
248
  }
249
+ /**
250
+ * Static health document for a purely static Pages deploy.
251
+ *
252
+ * `cf-pages` is a Kuma deploy target, but it has no server, so it had no
253
+ * `/health` for the Uptime Kuma standard to point at — the block said "point at
254
+ * `/health`, never the main URL" and there was nothing there. That gap is how a
255
+ * bare-`ok` keyword monitor gets invented: an agent with no health document
256
+ * points Kuma at `index.html` and picks a keyword out of the page, and `ok`
257
+ * substring-matches inside *cookie / lookup / blocked* on a 200-returning error
258
+ * page. Shipping the document makes the standard's keyword (`"status":"ok"`)
259
+ * true for all five deploy targets instead of four.
260
+ *
261
+ * Deliberately NOT substituted: the body must be byte-stable so the keyword
262
+ * match can never depend on a brand or slug value. Added 2026-07-30 alongside
263
+ * the keyword mirror from `cursor-project-templates`.
264
+ *
265
+ * ⚠️ COMPACT JSON, no space after the colon — this is load-bearing and looks
266
+ * like a formatting nit. Kuma's keyword check is a literal case-sensitive
267
+ * substring match, and the standard's keyword is `"status":"ok"`. Every OTHER
268
+ * project type gets this for free because it serializes at runtime
269
+ * (`NextResponse.json` / `c.json` / `Response.json` / FastAPI all emit compact
270
+ * JSON), but a static file is served byte-for-byte as written. Prettifying this
271
+ * to `{ "status": "ok" }` would break every monitor pointed at it — and only at
272
+ * the moment the monitor was supposed to help.
273
+ */
274
+ const HEALTH_JSON_TEMPLATE = `{"status":"ok"}
275
+ `;
248
276
  /**
249
277
  * Canonical SEO baseline file list for cf-pages. Exported for tests + the
250
278
  * Step 5 standards resolver.
@@ -764,23 +764,75 @@ export function commonDirective(inputs, opts, spec) {
764
764
  * (contact-registry, 2026-07-12). Ignoring it gives every
765
765
  * generated tree a clean `git status` — every file either
766
766
  * tracked or ignored, nothing present-but-untracked.
767
- * - `.claude/settings.local.json` — Claude Code's MACHINE-LOCAL settings
768
- * (per-machine permission allowlists, which routinely name
769
- * absolute paths and one-off commands). Its sibling
770
- * `.claude/settings.json` is the SHARED project settings file
771
- * and must stay committable — so ignore the one file, never
772
- * the whole `.claude/` directory. Added 2026-07-26 after
773
- * `audit-engine`'s first sweep found it missing in 11 of 12
774
- * Live repos. Kerry's machine happens to be covered by a
775
- * global ignore (`~/.config/git/ignore`), but a global ignore
776
- * does not travel with the repo — CI, a second machine, a
777
- * contractor, or a licensee gets no protection at all. The
778
- * repo-level line is the one that ships.
767
+ * - `.claude/settings.local.json` AND `.claude/settings.json` — BOTH of Claude
768
+ * Code's harness-written settings files. `settings.local.json`
769
+ * was added 2026-07-26 after `audit-engine`'s first sweep
770
+ * found it missing in 11 of 12 Live repos (Kerry's machine is
771
+ * covered by a global `~/.config/git/ignore`, which does not
772
+ * travel with the clone, so CI / a second machine / a
773
+ * licensee got nothing — the repo-level line is the one that
774
+ * ships).
775
+ *
776
+ * ⚠️ `settings.json` was DELIBERATELY EXCLUDED in v0.5.4 on
777
+ * the reasoning that it is "the SHARED project settings file
778
+ * and must stay committable." **That decision is reversed as
779
+ * of v0.5.8, and the reversal is evidence-driven.** Four
780
+ * independent reports in six days, from four projects:
781
+ * · `site-control` (2026-07-28) — Claude Code wrote a live
782
+ * Neon PASSWORD into it three times; they untracked it
783
+ * and ship a curated `settings.example.json` instead.
784
+ * · `file-server` (2026-07-30) — 44 entries, 42 of them
785
+ * uncommitted junk (frozen version literals, `perl -0pi`
786
+ * one-liners); left out of every commit, "only growing."
787
+ * · `z2w-crowdcommerce` (2026-07-25) — credential-shaped
788
+ * `-uroot -proot` text in the tracked file.
789
+ * · this repo (2026-07-25) — 16 junk entries discarded,
790
+ * including a standing `GH_SKIP_ACCOUNT_CHECK=1` push.
791
+ *
792
+ * The decisive fact is structural rather than statistical:
793
+ * **this scaffolder emits no `.claude/` file at all, and
794
+ * neither does any other Z2W tool.** So the file the old rule
795
+ * protected as human-curated shared config is, in every repo
796
+ * that has one, written 100% by the harness. Tracking a
797
+ * machine-mutated file guarantees a permanently dirty tree
798
+ * and invites exactly the secret-commit it was supposed to
799
+ * prevent. Ignoring it strands nothing, because nothing
800
+ * deliberate was ever put there.
801
+ *
802
+ * Both are pinned as FILES, not as `.claude/`, and that is
803
+ * load-bearing: project-scoped subagents (`.claude/agents/`),
804
+ * hooks, skills, and a hand-curated
805
+ * `.claude/settings.example.json` ARE deliberately authored
806
+ * and must keep travelling with the repo.
807
+ * - `.vscode/` — editor/extension-local settings, same class as
808
+ * `.specstory/` above and created by the same tooling (the
809
+ * file `site-control` nearly committed on 2026-07-28 was
810
+ * literally a SpecStory extension preference). Ignoring the
811
+ * directory rather than one file because there is no sibling
812
+ * that must stay tracked — contrast `.claude/` above, where
813
+ * there is, which is why that one is pinned to a single file.
814
+ * - `.env.*` + `!.env.example` — the whole OTHER-env-file family. `.env`
815
+ * (exact) and `.env*.local` match neither
816
+ * `.env.sentry-build-plugin` (where the Sentry CLI writes
817
+ * SENTRY_AUTH_TOKEN, the credential that authorises
818
+ * source-map upload) nor Next.js's own `.env.production` /
819
+ * `.env.development`. Reported by `site-control` 2026-07-29
820
+ * against the Sentry filename specifically; fixed as the
821
+ * class, because chasing one tool-written filename per
822
+ * incident is a treadmill and the next tool will pick a name
823
+ * we have not seen. `.env.example` is negated LAST so it
824
+ * stays tracked — it carries variable NAMES only.
779
825
  *
780
826
  * Per the 2026-06-11 z2w-member-match near-miss (live DATABASE_URL +
781
827
  * RESEND_API_KEY staged on a fresh repo) and matching asks from
782
828
  * videomigrator-dashboard (2026-06-07). Centralized here so no per-type body
783
829
  * can ever omit it.
830
+ *
831
+ * The load-bearing distinction when adding an entry here: **broaden to the
832
+ * family when nothing in it must stay tracked; pin to one file when a sibling
833
+ * must.** A wildcard is safer for `.env.*` (an unignored secret file is the
834
+ * failure) and actively wrong for `.claude/` (ignoring it strands the shared
835
+ * `settings.json`).
784
836
  */
785
837
  const GITIGNORE_SECRET_SCRATCH_BLOCK = `
786
838
  # Scratch / intermediates (Z2W convention) — never commit
@@ -789,9 +841,26 @@ const GITIGNORE_SECRET_SCRATCH_BLOCK = `
789
841
  .specstory/
790
842
  # Cursor's own index-management file — local, auto-created; keeps git status clean
791
843
  .cursorindexingignore
792
- # Claude Code machine-local settings (permission allowlists, absolute paths).
793
- # NOTE: .claude/settings.json is the SHARED project file — keep it committable.
844
+ # Editor/extension-local settings — created unbidden, nobody's project config.
845
+ # If a shared setting is ever genuinely wanted, force-add the ONE narrow file
846
+ # (e.g. \`git add -f .vscode/extensions.json\`).
847
+ .vscode/
848
+ # Claude Code's HARNESS-WRITTEN settings. Neither file is authored by a human
849
+ # or by the scaffolder — the harness appends one-off permission approvals to
850
+ # them all session (frozen version literals, one-off in-place edits, absolute
851
+ # per-boot paths), so a tracked copy is permanently dirty and has been observed
852
+ # receiving a live database password.
853
+ # Deliberately-authored project config under .claude/ still travels: agents/,
854
+ # hooks/, skills/, and a curated settings.example.json are NOT ignored.
855
+ .claude/settings.json
794
856
  .claude/settings.local.json
857
+ # Every OTHER .env variant holds real values — close the whole family rather
858
+ # than chasing one filename at a time. \`.env\` (exact) and \`.env*.local\` above
859
+ # do NOT match tool-written names like \`.env.sentry-build-plugin\` (where the
860
+ # Sentry CLI writes SENTRY_AUTH_TOKEN) or Next.js's \`.env.production\`.
861
+ # \`.env.example\` is re-allowed: it carries variable NAMES only, never values.
862
+ .env.*
863
+ !.env.example
795
864
  `;
796
865
  /**
797
866
  * Per-type `.gitignore` body. Sources: skill's "Inline mini-templates"
@@ -377,11 +377,21 @@ export function RouteTracker() {
377
377
  const APP_PAGE_TEMPLATE = `// Home page — per-page \`metadata\` is mandatory per SEO baseline. Replace
378
378
  // the title + description with intentional, page-specific copy (do NOT
379
379
  // inherit the root defaults).
380
+ //
381
+ // ⚠️ The root layout's \`title.template\` does NOT apply to this file, so this
382
+ // title must be COMPLETE — brand included. Next.js applies a template to CHILD
383
+ // segments only, and app/page.tsx shares the ROOT segment with app/layout.tsx.
384
+ // A bare fragment here (the old \`title: "Home"\`) renders literally as
385
+ // \`<title>Home</title>\` on the most-linked page on the site, and it fails
386
+ // silently: \`next build\` is happy and the metadata source reads as if it
387
+ // composes. Pages in CHILD segments DO get the suffix and should not repeat
388
+ // the brand. Do not "tidy" this back to a fragment for consistency with them.
389
+ // (Found by \`site-control\` dogfooding this scaffold, 2026-07-28.)
380
390
 
381
391
  import type { Metadata } from "next";
382
392
 
383
393
  export const metadata: Metadata = {
384
- title: "Home",
394
+ title: "{{brand_name}} — {{slug}}",
385
395
  description: "{{description}}",
386
396
  alternates: { canonical: "/" },
387
397
  };
package/dist/standards.js CHANGED
@@ -284,7 +284,21 @@ const FATHOM_BODY = `### Fathom analytics (web UI)
284
284
  > **Analytics:** Fathom Analytics is the single source of truth for this project. Env var name: {{fathom_env_var}}. SPA pattern: \`data-auto="false"\` on the Fathom script, then manual \`trackPageview()\` on route change. One Fathom site = one deployment. See [[fathom-analytics]] for details.`;
285
285
  const UPTIME_KUMA_BODY = `### Uptime Kuma monitor (deploy target)
286
286
 
287
- > **Uptime monitoring:** Add an HTTP(s)-Keyword monitor in Kerry's self-hosted Uptime Kuma after first deploy. Defaults: 60s heartbeat, 2 retries, 60s retry interval, 48s timeout, accepted status 200-299. Point at \`/health\` — never the main URL. See [[uptime-kuma-monitor]] for the form-by-form walkthrough.`;
287
+ > **Uptime monitoring:** Add an HTTP(s)-Keyword monitor in Kerry's self-hosted Uptime Kuma after first deploy. Defaults: 60s heartbeat, 2 retries, 60s retry interval, 48s timeout, accepted status 200-299.
288
+ >
289
+ > **Point at this project's health path — never the main URL. The path differs by stack, and the scaffold already ships a document there carrying the keyword below, so do not improvise one:**
290
+ >
291
+ > | Stack | Health path | Served by |
292
+ > |---|---|---|
293
+ > | Next.js | \`/api/health\` | \`app/api/health/route.ts\` — a bare \`/health\` **404s**, because the App Router serves route handlers under a path segment |
294
+ > | Python | \`/healthz\` | the FastAPI health route |
295
+ > | CF Worker | \`/health\` | the Worker's fetch handler |
296
+ > | Node / Hono | \`/health\` | the mounted health router |
297
+ > | CF Pages (static) | \`/health.json\` | the scaffolded \`health.json\` — a static deploy has no server, so the document IS the endpoint |
298
+ >
299
+ > Use the SAME path in CLAUDE.md / README prose as the route actually serves.
300
+ >
301
+ > **Keyword: \`"status":"ok"\` — never bare \`ok\`.** Kuma's keyword check is a case-sensitive substring match over the WHOLE response body, and \`ok\` is inside *cookie, lookup, token, booking, blocked, looking* — all of which appear in error pages that still return HTTP 200, so a bare-\`ok\` monitor stays green while the app is down. Every health document this scaffold emits already carries exactly \`{"status":"ok"}\` — compact, no space after the colon, because Kuma matches literally — so match on that rather than inventing a keyword. See [[uptime-kuma-monitor]] for the form-by-form walkthrough.`;
288
302
  const SENTRY_BODY = `### Sentry runtime-error tracking (customer-facing web app)
289
303
 
290
304
  > **Wire Sentry at instantiation — runtime error capture is the observability gap uptime monitoring can't cover.** Uptime Kuma proves \`/health\` returns 200; Sentry proves *actual user requests* are succeeding. A beta customer hits Submit, gets a 500, Kuma still sees \`/health\` 200 → no alert → nobody knows. Sentry emails + Session Replay within ~2 min. Vercel Hobby does NOT email on runtime errors (only build/deploy failures), so this is the only path to per-request error visibility. Free tier (5k errors + 10k transactions + 50 replays / mo) covers any Z2W-scale project at $0/mo. Same posture as [[fathom-analytics]] and [[uptime-kuma-monitor]]: the Z2W-sanctioned default tool for the runtime-error / APM category. **Load [[sentry-runtime-errors]] before wiring — it is the binding contract; the summary below is orientation.**
@@ -358,6 +372,13 @@ This project participates in the Z2W cross-project coordination bulletin.
358
372
  - 2026-07-25 · z2w-starter-kit · ACTION · Trim your bulletin file — it's over the 256 KB read-cap · §Open questions
359
373
  \`\`\`
360
374
  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.)*
375
+ - **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.
376
+ \`\`\`
377
+ - 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
378
+ \`\`\`
379
+ 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.
380
+
381
+ *(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
382
  - 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
383
  - **\`[→ 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
384
  \`\`\`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zero2webmaster/starter-kit",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "description": "Node CLI to scaffold new Z2W projects from canonical Templates + AGENTS.md.",
5
5
  "author": {
6
6
  "name": "Dr. Kerry Kriger",