@zero2webmaster/starter-kit 0.5.7 → 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 +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/scaffolders/cf-pages.js +28 -0
- package/dist/scaffolders/common.js +83 -14
- package/dist/scaffolders/nextjs.js +11 -1
- package/dist/standards.js +15 -1
- 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.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.
|
|
102
|
+
*Version: 0.5.8 | Last Updated: 2026-07-30*
|
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.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.
|
|
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` —
|
|
768
|
-
*
|
|
769
|
-
*
|
|
770
|
-
*
|
|
771
|
-
*
|
|
772
|
-
* the
|
|
773
|
-
*
|
|
774
|
-
*
|
|
775
|
-
*
|
|
776
|
-
*
|
|
777
|
-
*
|
|
778
|
-
*
|
|
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
|
-
#
|
|
793
|
-
#
|
|
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: "
|
|
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.
|
|
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.**
|