@zero2webmaster/starter-kit 0.16.2 → 0.17.1
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 +5 -2
- package/dist/standards.d.ts +1 -1
- package/dist/standards.js +46 -0
- package/package.json +1 -1
- package/scripts/rollup-integrations.mjs +28 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# z2w-starter-kit
|
|
2
2
|
|
|
3
|
-
**Version:** 0.
|
|
3
|
+
**Version:** 0.17.1 | **Framework:** 2.18.0
|
|
4
4
|
|
|
5
5
|
> Node CLI to scaffold new Z2W projects from canonical Templates + AGENTS.md.
|
|
6
6
|
|
|
@@ -83,6 +83,9 @@ The Claude Code skill at `~/.claude/skills/instantiate-z2w-project/SKILL.md` and
|
|
|
83
83
|
|
|
84
84
|
## Status
|
|
85
85
|
|
|
86
|
+
- **v0.17.1 (current)** stops `scripts/rollup-integrations.mjs` counting its own `*-archive.md` spill files in the "Bulletin files scanned" denominator (72 -> 52), and STATES the exclusion rather than silently shrinking the number.
|
|
87
|
+
- **v0.17.0** makes the **Cloud-Run-vs-Fly.io host choice a standard** for `python-service` / `node-service` scaffolds, so a long-running service's platform is decided by one test — *does it need a persistent volume?* — rather than per project by whoever is in the chair. Cloud Run for stateless request/response that scales to zero with the database elsewhere; Fly.io for stateful always-on needing a disk that survives a restart, which Cloud Run structurally cannot hold. It is a ruling rather than a preference because `z2w-multi-lingual-api` costed it on a live service (~13 req/hr inside a $2/month budget, because Cloud Run genuinely idles at zero), and it carries the half a new project would not think to ask for: **do not re-litigate this as a migration** — every real incident there traced to Neon's CU-hour cap or to secret hygiene, both external to *both* platforms. Deliberately NOT inserted for `cf-worker` / `cf-pages` / `nextjs`, whose host the project type already settles.
|
|
88
|
+
- **v0.16.2** fixes `--strict` so it judges only what the invocation actually reconciled, unblocking `z2w-agent-coordination`'s Project Registry reconciler cron.
|
|
86
89
|
- **v0.15.1 (current)** ships `scripts/rollup-integrations.mjs` **in the npm tarball**, which is the one thing standing between the Project Registry reconciler and a schedule. `z2w-agent-coordination` accepted this project's proposal to host it on a cron and built the workflow, then found neither delivery route worked: a checkout of this private repo needs a PAT that could read every private repo in the org, and although the package *is* published, the tarball shipped **no `scripts/` at all** — `files` listed `dist/**` + README + LICENSE and the reconciler matched none of those globs. *"It is published"* and *"the script is reachable"* were two different facts. A runner can now `npm i @zero2webmaster/starter-kit@latest` and get it with **zero credentials**. Guarded by `src/package-contents.test.ts`, which runs `npm pack --dry-run --json` and asserts on the **artifact** rather than the glob — nothing here could previously tell a shipped file from an unshipped one.
|
|
87
90
|
- **v0.15.0** deletes the embedded Agent Coordination block in favour of a **pointer**, because this CLI is an *emitter* and a stale copy here is minted into every new Z2W project. `z2w-agent-coordination` measured currency across the ecosystem on 2026-08-07 and found **0 of 37 files at canonical** — 34 stale, 3 frozen paraphrases — and named "delete the copy, keep a pointer" its preferred remedy; the block had grown 4,274 B → 34,515 B in ten weeks, so every bump re-asked ~21 projects for a bigger paste. Scaffolded `CLAUDE.md` files now carry heading + fingerprint + session-start steps 1 and 1b (read the live block; it wins) + the Hard rules, and drop ~24 KB of auto-loaded context each. **The Hard rules stay embedded on purpose** — a leaked secret or an overwritten neighbour is irreversible, so those must hold even when the clone is unreachable. The old byte-diff guard was replaced rather than dropped (pointer conformance + an anti-regrowth byte ceiling, both canary-verified), and a real defect in it was fixed: it read a local bulletin checkout without ever checking that the checkout was current, and that clone was **215 commits behind**, so it compared against stale canon while reporting a shrinking gap.
|
|
88
91
|
- **v0.14.0** makes card-path bot protection a scaffold standard, and fixes a defect that made **every** Next.js scaffold's server modules impossible to unit-test. A new `acceptsCards` input inserts a standard pointing at [[stripe-elements-confirm-path]] §8 for every project type that has a runtime request surface, and — for Next.js — emits the protected endpoint shape rather than a bare one: a Turnstile verifier whose verdict is five-valued and **fails open**, an abuse policy sized for card entry (30 per 10 minutes per source, no global cap) rather than copied from order submission, the browser widget with `appearance: "interaction-only"` and every failure callback wired, and an emitted test that greps the consuming project's own `app/` and fails the next card path added bare. The enumeration grep ships *with* the standard, because a rule that says "protect the card path" without saying how to enumerate card paths passes review and misses a route. Separately: `import "server-only"` is a build-time poison pill that made every server module in every scaffold fail to LOAD under vitest — while `next build`, `tsc --noEmit` and the emitted suite all passed — so scaffolds now emit a `server-only` test stub plus the `@/*` alias that mirrors `tsconfig.json`.
|
|
@@ -115,4 +118,4 @@ Inquiries: kerry@zero2webmaster.com.
|
|
|
115
118
|
---
|
|
116
119
|
|
|
117
120
|
*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.*
|
|
118
|
-
*Version: 0.
|
|
121
|
+
*Version: 0.17.1 | Last Updated: 2026-08-13*
|
package/dist/standards.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProjectType, ScaffoldInputs } from "./index.js";
|
|
2
2
|
import { type SubstitutionOptions } from "./substitute.js";
|
|
3
|
-
export type StandardKey = "skill-vault" | "portable-stack" | "fathom" | "uptime-kuma" | "sentry" | "neon-careful" | "temp-files" | "agent-coordination" | "seo-baseline" | "email-service" | "moderation" | "card-path-bot-protection" | "text-size" | "test-count";
|
|
3
|
+
export type StandardKey = "skill-vault" | "portable-stack" | "fathom" | "uptime-kuma" | "sentry" | "service-hosting" | "neon-careful" | "temp-files" | "agent-coordination" | "seo-baseline" | "email-service" | "moderation" | "card-path-bot-protection" | "text-size" | "test-count";
|
|
4
4
|
export type StandardDecisionState = "inserted-inline" | "skipped-not-applicable";
|
|
5
5
|
export interface StandardDecision {
|
|
6
6
|
key: StandardKey;
|
package/dist/standards.js
CHANGED
|
@@ -50,6 +50,7 @@ const STANDARD_ORDER = [
|
|
|
50
50
|
"fathom",
|
|
51
51
|
"uptime-kuma",
|
|
52
52
|
"sentry",
|
|
53
|
+
"service-hosting",
|
|
53
54
|
"neon-careful",
|
|
54
55
|
"temp-files",
|
|
55
56
|
"agent-coordination",
|
|
@@ -66,6 +67,7 @@ const TITLES = {
|
|
|
66
67
|
fathom: "Fathom analytics",
|
|
67
68
|
"uptime-kuma": "Uptime Kuma monitor",
|
|
68
69
|
sentry: "Sentry runtime-error tracking (web app)",
|
|
70
|
+
"service-hosting": "Service hosting (Cloud Run vs Fly.io)",
|
|
69
71
|
"neon-careful": "Neon-careful (Neon Postgres)",
|
|
70
72
|
"temp-files": "Project-scoped temp files (agent discipline)",
|
|
71
73
|
"agent-coordination": "Agent Coordination (cross-project bulletin)",
|
|
@@ -92,6 +94,11 @@ const SEO_BASELINE_TYPES = ["nextjs", "cf-pages"];
|
|
|
92
94
|
// CLI libraries and protocol repos have no runtime request surface.
|
|
93
95
|
const OBSERVABILITY_TYPES = ["nextjs", "cf-pages"];
|
|
94
96
|
const NO_EMAIL_TYPES = ["library", "protocol-repo"];
|
|
97
|
+
// The types that deploy as a long-running service on a general-purpose host,
|
|
98
|
+
// i.e. the ones for which "which platform?" is still an open question at
|
|
99
|
+
// instantiation. Everything else has its host decided by the type itself
|
|
100
|
+
// (cf-worker/cf-pages → Cloudflare, nextjs → Vercel) or has no host at all.
|
|
101
|
+
const SERVICE_HOSTING_TYPES = ["python-service", "node-service"];
|
|
95
102
|
// Types with no user-generated-content surface to moderate. wp-plugin is
|
|
96
103
|
// excluded because WordPress moderates comments natively (and via Akismet), so
|
|
97
104
|
// the [[moderation-system]] pattern — a Next.js + Neon report→queue model —
|
|
@@ -171,6 +178,27 @@ function checkSentry(inputs) {
|
|
|
171
178
|
reason: `hasObservability=true on ${inputs.projectType} — Sentry runtime-error/APM baseline per [[sentry-runtime-errors]]`,
|
|
172
179
|
};
|
|
173
180
|
}
|
|
181
|
+
function checkServiceHosting(inputs) {
|
|
182
|
+
// Scoped to the two types whose host is genuinely an OPEN CHOICE, and
|
|
183
|
+
// deliberately not wider. A cf-worker or cf-pages project is on Cloudflare by
|
|
184
|
+
// definition and a nextjs project is on Vercel by default — for those, the
|
|
185
|
+
// standard would be answering a question the project type already settled,
|
|
186
|
+
// and a standard that restates a foregone conclusion trains agents to skim
|
|
187
|
+
// the block. library / protocol-repo / wp-plugin have no host of their own at
|
|
188
|
+
// all. That leaves the long-running services, which is exactly where the
|
|
189
|
+
// ruling came from: `z2w-multi-lingual-api` runs both halves of this split in
|
|
190
|
+
// production (Cloud Run for the API, Fly for Uptime Kuma).
|
|
191
|
+
if (!SERVICE_HOSTING_TYPES.includes(inputs.projectType)) {
|
|
192
|
+
return {
|
|
193
|
+
applies: false,
|
|
194
|
+
reason: `${inputs.projectType}'s host is fixed by the project type — no Cloud-Run-vs-Fly choice to make`,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
applies: true,
|
|
199
|
+
reason: `${inputs.projectType} is a long-running service — pick the host on the persistent-volume test (ruling relayed by z2w-multi-lingual-api 2026-08-03)`,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
174
202
|
function checkNeonCareful(inputs) {
|
|
175
203
|
if (inputs.dbStrategy !== "neon-postgres") {
|
|
176
204
|
return {
|
|
@@ -386,6 +414,22 @@ const SENTRY_BODY = `### Sentry runtime-error tracking (customer-facing web app)
|
|
|
386
414
|
> **When to SKIP (do not wire Sentry):** WordPress sites (error tracking via Z2W Admin Suite Diagnostics + FluentSMTP logs); CLI libraries and protocol repos (no request surface); Cloudflare Workers / node-service / python-service that are API-only (the \`-i nextjs\` wizard doesn't fit — revisit per-runtime later); internal-only admin tools with a single operator who sees errors directly. The rule of thumb: wire it for any public-or-customer-facing Next.js / CF-Pages app that will have real users.
|
|
387
415
|
>
|
|
388
416
|
> See [[sentry-runtime-errors]] for the wizard answers, the config-file layout, the alert-rule setup, and the smoke-route pattern. Companion: [[uptime-kuma-monitor]] (liveness — the other half of observability), [[fathom-analytics]] (analytics, not errors).`;
|
|
417
|
+
const SERVICE_HOSTING_BODY = `### Service hosting: Cloud Run vs Fly.io (long-running service)
|
|
418
|
+
|
|
419
|
+
> **The decision rule, and it is a one-line test: does this service need a persistent VOLUME?**
|
|
420
|
+
>
|
|
421
|
+
> | Need | Host | Why |
|
|
422
|
+
> |---|---|---|
|
|
423
|
+
> | Stateless request/response that can scale to zero, with the database living elsewhere (Neon, Upstash) | **GCP Cloud Run** | Bills per request and genuinely reaches $0 between bursts |
|
|
424
|
+
> | Stateful, always-on, needs a disk that survives a restart (SQLite on a volume, a queue spool, an upload cache) | **Fly.io** | Cloud Run structurally cannot hold a volume; Fly's machines can |
|
|
425
|
+
>
|
|
426
|
+
> **This is a ruling, not a preference — it was measured on a live service.** \`z2w-multi-lingual-api\` answered Kerry's 2026-07-29 "should we move to Fly?" question on 2026-08-03 by costing its own production workload: at **~13 requests/hour**, Cloud Run's per-request billing keeps the whole service inside a **$2/month** budget, because it truly idles at zero. Fly's auto-stop/auto-start machines are good, but the model is closer to *a small always-allocated VM you are allowed to pause* — and Fly's free allowances were withdrawn for new orgs. For a service that is mostly idle, the billing shape decides it.
|
|
427
|
+
>
|
|
428
|
+
> **The other direction is equally settled, and Kerry's existing split is already correct rather than drift:** Uptime Kuma runs on Fly precisely because it keeps SQLite on a persistent volume, which Cloud Run cannot do at all.
|
|
429
|
+
>
|
|
430
|
+
> **🔴 Do not re-litigate this as a migration — the platform has never been the cause of an outage here.** Every real incident on that service traced to (a) Neon Free's 100 CU-hour cap interacting with monitoring, or (b) secret hygiene. **Both of those are external to both platforms**, so a migration would burn several sessions and fix none of the historical causes. If this project is slow or falling over, the platform is the last thing to suspect — see [[neon-postgres]] for the cap that actually bites, and [[z2w-stack-audit]] before adding any third platform.
|
|
431
|
+
>
|
|
432
|
+
> **One gap worth not repeating:** a deployed app whose configuration exists only as live platform state is tribal knowledge. Commit the deploy config (\`fly config save\` → \`fly.toml\`, or the Cloud Run service YAML) into this repo from day one.`;
|
|
389
433
|
const NEON_CAREFUL_BODY = `### Neon-careful (Neon Postgres)
|
|
390
434
|
|
|
391
435
|
> **Neon discipline:** \`/health\` must NOT touch the database (Neon Free has a 100 CU-hour monthly quota; routine probes burn through it). Pool size 1 for monitoring contexts. No scheduled jobs querying DB more than absolutely necessary.
|
|
@@ -634,6 +678,7 @@ const BODIES = {
|
|
|
634
678
|
fathom: FATHOM_BODY,
|
|
635
679
|
"uptime-kuma": UPTIME_KUMA_BODY,
|
|
636
680
|
sentry: SENTRY_BODY,
|
|
681
|
+
"service-hosting": SERVICE_HOSTING_BODY,
|
|
637
682
|
"neon-careful": NEON_CAREFUL_BODY,
|
|
638
683
|
"temp-files": TEMP_FILES_BODY,
|
|
639
684
|
"agent-coordination": AGENT_COORDINATION_BODY,
|
|
@@ -650,6 +695,7 @@ const APPLICABILITY = {
|
|
|
650
695
|
fathom: checkFathom,
|
|
651
696
|
"uptime-kuma": checkUptimeKuma,
|
|
652
697
|
sentry: checkSentry,
|
|
698
|
+
"service-hosting": checkServiceHosting,
|
|
653
699
|
"neon-careful": checkNeonCareful,
|
|
654
700
|
"temp-files": checkTempFiles,
|
|
655
701
|
"agent-coordination": checkAgentCoordination,
|
package/package.json
CHANGED
|
@@ -450,7 +450,25 @@ async function main() {
|
|
|
450
450
|
process.exit(1);
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
-
|
|
453
|
+
// `*-archive.md` are SPILL files, not projects. They exist because bulletin
|
|
454
|
+
// files are trimmed against a hard read-cap, so their content is by
|
|
455
|
+
// definition already-handled history — none carries a `## Integrations`
|
|
456
|
+
// section and none ever will. Counting them was never a correctness bug (they
|
|
457
|
+
// fall out at the `section == null` gate below, and `known.has(slug)` would
|
|
458
|
+
// reject them anyway), but it inflated the denominator this script PRINTS:
|
|
459
|
+
// "Bulletin files scanned: 72" when only 52 files can ever contribute.
|
|
460
|
+
//
|
|
461
|
+
// Reported by `z2w-agent-coordination` 2026-08-13 as a denominator-honesty
|
|
462
|
+
// item, and they were right to file it as one: a coverage figure whose
|
|
463
|
+
// denominator includes files that are structurally incapable of counting
|
|
464
|
+
// makes coverage look worse than it is, and the reader cannot tell which.
|
|
465
|
+
// This is the second occurrence of glob-matches-your-own-archives in this
|
|
466
|
+
// ecosystem; the first cost Kerry a false 🔴. See [[zero-is-not-a-pass]].
|
|
467
|
+
const allMd = (await readdir(projectsDir)).filter(
|
|
468
|
+
(f) => f.endsWith(".md") && !f.startsWith("_"),
|
|
469
|
+
);
|
|
470
|
+
const archives = allMd.filter((f) => f.endsWith("-archive.md"));
|
|
471
|
+
const files = allMd.filter((f) => !f.endsWith("-archive.md"));
|
|
454
472
|
const sql = neon(dbUrl);
|
|
455
473
|
const known = new Set((await sql`SELECT slug FROM projects`).map((r) => r.slug));
|
|
456
474
|
|
|
@@ -569,7 +587,15 @@ async function main() {
|
|
|
569
587
|
}
|
|
570
588
|
|
|
571
589
|
console.log("");
|
|
572
|
-
|
|
590
|
+
// State the exclusion rather than silently shrinking the number — a
|
|
591
|
+
// denominator that quietly got smaller is as unreadable as one that was
|
|
592
|
+
// wrong, and the next reader must be able to tell which files were left out.
|
|
593
|
+
console.log(
|
|
594
|
+
`Bulletin files scanned: ${files.length}` +
|
|
595
|
+
(archives.length > 0
|
|
596
|
+
? ` (excluded ${archives.length} *-archive.md spill file(s), which carry no ## Integrations section by construction)`
|
|
597
|
+
: ""),
|
|
598
|
+
);
|
|
573
599
|
console.log(` with ## Integrations: ${parsed} (no section: ${skippedNoSection}, unknown slug: ${skippedUnknown})`);
|
|
574
600
|
console.log(` rows ${args.apply ? "UPDATED" : "that WOULD change"}: ${changed}`);
|
|
575
601
|
if (zeroEdges.length > 0) {
|