@zero2webmaster/starter-kit 0.45.0 → 0.47.0
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 +7 -3
- package/dist/scaffolders/cf-pages.js +2 -2
- package/dist/scaffolders/common.js +9 -11
- package/dist/scaffolders/nextjs.js +55 -24
- package/dist/scaffolders/protocol-repo.js +3 -3
- package/dist/scaffolders/wp-plugin.js +13 -2
- package/dist/writer.js +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# z2w-starter-kit
|
|
2
2
|
|
|
3
|
-
**Version:** 0.
|
|
3
|
+
**Version:** 0.47.0 | **Framework:** 2.19.0
|
|
4
4
|
|
|
5
5
|
> Node CLI to scaffold new Z2W projects from canonical Templates + AGENTS.md.
|
|
6
6
|
|
|
@@ -83,7 +83,11 @@ The Claude Code skill at `~/.claude/skills/instantiate-z2w-project/SKILL.md` and
|
|
|
83
83
|
|
|
84
84
|
## Status
|
|
85
85
|
|
|
86
|
-
- **v0.
|
|
86
|
+
- **v0.47.0 (current)** keeps our names out of an outside customer's project. A scaffold made with `audience: "external"` used to carry, outside `CLAUDE.md`, code comments citing our internal rules and organizations and about 60 links to our private skills (133 lines across the eight project types). Those comments now read neutrally for everyone, skill links become plain names for outside customers, and an outside `wp-plugin` no longer lists our wordpress.org username. The `@zero2webmaster/starter-kit` credit stays.
|
|
87
|
+
|
|
88
|
+
- **v0.46.0** gets `nextjs` scaffolds ready for phones. Installed to a home screen, the app now draws edge to edge (`viewport-fit=cover`), and the page is padded by the phone's safe areas so the notch and home indicator never cover content; CSS variables (`--safe-top`, `--safe-bottom` and so on) let a fixed bar pad itself. A `prefers-reduced-motion` rule turns any animation or transition into an instant change for people who switch on Reduce Motion. Verified on a real build in Chromium: no change at all on an ordinary screen.
|
|
89
|
+
|
|
90
|
+
- **v0.45.0** runs the tests before every push. `nextjs`, `cf-worker`, `library` and `node-service` scaffolds now ship a tracked `pre-push` hook that runs `npm test`, installed into the repo's own `.git/hooks/` by `npm install` (skipped in CI, never fails an install). Until now the scaffold emitted a test script that nothing ran: `audit-engine` measured 24 of 29 multi-tenant apps whose cross-tenant tests ran only when someone typed the command. A `library` scaffold also gets a starter test, because its first `npm test` used to fail with "No test files found". Verified on real scaffolds from the built `dist/`, through the global hook dispatcher: a green push passes, a red one is refused.
|
|
87
91
|
|
|
88
92
|
- **v0.44.0** stops the PWA service worker from storing pages. Since v0.19.0 it cached every page it loaded, including signed-in ones, which then stayed readable offline after sign-out. Page loads now go to the network, with a built-in "You're offline" page when that fails, and only content-hashed `/_next/static/` files are cached. Verified in Chromium against a dynamic page, with the old worker as a control. Full detail in [CHANGELOG.md](CHANGELOG.md).
|
|
89
93
|
|
|
@@ -139,4 +143,4 @@ Inquiries: kerry@zero2webmaster.com.
|
|
|
139
143
|
---
|
|
140
144
|
|
|
141
145
|
*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.*
|
|
142
|
-
*Version: 0.
|
|
146
|
+
*Version: 0.47.0 | Last Updated: 2026-10-27*
|
|
@@ -196,7 +196,7 @@ const SITEMAP_XML_TEMPLATE = `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
196
196
|
`;
|
|
197
197
|
const HEADERS_TEMPLATE = `# Cloudflare Pages headers for {{slug}}.
|
|
198
198
|
#
|
|
199
|
-
# Preview / non-production deploys MUST be noindex per the
|
|
199
|
+
# Preview / non-production deploys MUST be noindex per the SEO baseline
|
|
200
200
|
# standing requirement (2026-05-30). On Cloudflare Pages, the simplest
|
|
201
201
|
# approach is to set a header for the preview URL pattern. Pages also
|
|
202
202
|
# supports \`!\` patterns for any non-default branch. Adjust the pattern below
|
|
@@ -206,7 +206,7 @@ const HEADERS_TEMPLATE = `# Cloudflare Pages headers for {{slug}}.
|
|
|
206
206
|
# Preview deploys (*.pages.dev): noindex.
|
|
207
207
|
|
|
208
208
|
# ── The five-header baseline ─────────────────────────────────────────────
|
|
209
|
-
# Measured by
|
|
209
|
+
# Measured by an audit on 2026-08-20: 22 of 26 reachable production sites
|
|
210
210
|
# carried NONE of these. They are config-only and none of them can break
|
|
211
211
|
# rendering, so there is no reason for a new site to ship without them.
|
|
212
212
|
#
|
|
@@ -312,8 +312,7 @@ Format: [Semantic Versioning](https://semver.org/).
|
|
|
312
312
|
// `marketing_plan` field (the at-a-glance status the command center reads).
|
|
313
313
|
const MARKETING_TEMPLATE = `# Marketing Plan — {{slug}}
|
|
314
314
|
|
|
315
|
-
> A first-class, tracked artifact
|
|
316
|
-
> Zero2Webmaster rule (2026-06-18): every coding project with any likelihood of
|
|
315
|
+
> A first-class, tracked artifact. Every coding project with any likelihood of
|
|
317
316
|
> being sold or licensed should carry a marketing plan, kept up to date here.
|
|
318
317
|
|
|
319
318
|
**Project:** {{slug}}
|
|
@@ -362,7 +361,7 @@ const MARKETING_TEMPLATE = `# Marketing Plan — {{slug}}
|
|
|
362
361
|
// the command center can surface each project's backup status / last-completed.
|
|
363
362
|
const BACKUPS_TEMPLATE = `# Backup Plan — {{slug}}
|
|
364
363
|
|
|
365
|
-
> A first-class, tracked artifact for
|
|
364
|
+
> A first-class, tracked artifact for this project. State here what parts
|
|
366
365
|
> of this project need backups, which are actually backed up, how, and when each
|
|
367
366
|
> was last verified. Keep it up to date.
|
|
368
367
|
|
|
@@ -575,7 +574,7 @@ const DIRECTIVE_TEMPLATE = `# System Architecture — {{slug}}
|
|
|
575
574
|
|
|
576
575
|
**Version:** {{version}} | **Last updated:** {{date}}
|
|
577
576
|
|
|
578
|
-
This document describes the 3-layer architecture for {{slug}} per the
|
|
577
|
+
This document describes the 3-layer architecture for {{slug}} per the AGENTS contract in CLAUDE.md. Fill in concrete details as the project takes shape.
|
|
579
578
|
|
|
580
579
|
## Layer 1: Directive (What to do)
|
|
581
580
|
|
|
@@ -1023,7 +1022,7 @@ export function commonDirective(inputs, opts, spec) {
|
|
|
1023
1022
|
* `settings.json`).
|
|
1024
1023
|
*/
|
|
1025
1024
|
const GITIGNORE_SECRET_SCRATCH_BLOCK = `
|
|
1026
|
-
# Scratch / intermediates
|
|
1025
|
+
# Scratch / intermediates — never commit
|
|
1027
1026
|
.tmp/
|
|
1028
1027
|
# SpecStory chat transcripts — local only; can contain pasted secrets
|
|
1029
1028
|
.specstory/
|
|
@@ -1231,7 +1230,7 @@ export function commonBaseFiles(inputs, opts, perTypeNarrative) {
|
|
|
1231
1230
|
* event-engine, on Kerry's steer). A provider-router mailer with a stable
|
|
1232
1231
|
* `sendEmail()` signature: default provider Amazon SES, Resend as a one-env-var
|
|
1233
1232
|
* swappable alternative (`EMAIL_PROVIDER=resend`). SES is the default because
|
|
1234
|
-
*
|
|
1233
|
+
* a stack that already runs authenticated SES in production adds no new vendor.
|
|
1235
1234
|
* See [[email-service-router]].
|
|
1236
1235
|
*
|
|
1237
1236
|
* The mailer body has NO {{tokens}} and NO relative imports, so it is
|
|
@@ -1284,10 +1283,9 @@ const EMAIL_MAILER_BODY = `// Transactional / auth email — provider router. De
|
|
|
1284
1283
|
// credentials from process.env and pulls in the AWS/Resend SDKs.
|
|
1285
1284
|
//
|
|
1286
1285
|
// Why SES is the default ([[email-service-router]], 2026-06-28): when a stack
|
|
1287
|
-
// already runs authenticated SES in production
|
|
1288
|
-
//
|
|
1289
|
-
//
|
|
1290
|
-
// the whole Z2W portfolio. Resend stays wired for a non-developer tenant who
|
|
1286
|
+
// already runs authenticated SES in production, SES is zero new vendor, no domain
|
|
1287
|
+
// warmup, and cheap at burst volume — past Resend Free's 100/day · 3k/mo cap,
|
|
1288
|
+
// which is shared by every app on one Resend account. Resend stays wired for a non-developer tenant who
|
|
1291
1289
|
// wants the easier DX: set EMAIL_PROVIDER=resend + RESEND_API_KEY + RESEND_FROM,
|
|
1292
1290
|
// no code change. Do NOT add a fifth mail vendor (SendGrid/Mailgun/Postmark/…) —
|
|
1293
1291
|
// [[email-service-router]] sanctions exactly these.
|
|
@@ -1510,7 +1508,7 @@ const EMAIL_SETUP_DIRECTIVE = `# Directive — Wire transactional / auth email f
|
|
|
1510
1508
|
|
|
1511
1509
|
**Decision (2026-06-28):** {{slug}} sends via **Amazon SES by default**, with
|
|
1512
1510
|
Resend as a swappable alternative (\`EMAIL_PROVIDER=resend\`). SES is the default
|
|
1513
|
-
because
|
|
1511
|
+
because a stack that already runs authenticated SES in production adds zero new
|
|
1514
1512
|
vendor, no domain warmup, cheap at burst volume (past Resend Free's shared
|
|
1515
1513
|
100/day · 3k/mo cap). Resend stays wired for a non-developer client who prefers
|
|
1516
1514
|
the easier DX. See [[email-service-router]]; DO NOT add a fifth mail vendor.
|
|
@@ -376,10 +376,9 @@ function securityHeadersModule(inputs) {
|
|
|
376
376
|
// next.config.mjs is plain ESM loaded before any TypeScript exists. tsconfig.json
|
|
377
377
|
// sets \`allowJs: true\`, so test/security-headers.test.ts type-checks it too.
|
|
378
378
|
//
|
|
379
|
-
// Baseline: OWASP Secure Headers + the
|
|
380
|
-
//
|
|
381
|
-
//
|
|
382
|
-
// these five headers, and \`leaderboard\` carried five of five. This file is the
|
|
379
|
+
// Baseline: OWASP Secure Headers + the standard in [[web-security-headers]].
|
|
380
|
+
// Measured by an audit on 2026-08-20: 22 of 26 reachable production sites
|
|
381
|
+
// carried NONE of these five headers. This file is the
|
|
383
382
|
// second half of that -- the baseline arrives with the scaffold instead of with a
|
|
384
383
|
// retrofit session someone has to schedule.
|
|
385
384
|
//
|
|
@@ -466,7 +465,7 @@ const JSON_LD_MODULE_TEMPLATE = `// The single gate for JSON-LD. Every \`applica
|
|
|
466
465
|
// not care that the sequence was "inside a string" -- from the parser's position
|
|
467
466
|
// there is no string.
|
|
468
467
|
//
|
|
469
|
-
// JSON.stringify({ name: '
|
|
468
|
+
// JSON.stringify({ name: 'Ada</scr' + 'ipt><img src=x onerror=alert(1)>' })
|
|
470
469
|
// -> a closed script tag followed by a live <img onerror>, from a display name.
|
|
471
470
|
//
|
|
472
471
|
// JSON-LD is the dangerous sink and the easiest to miss, for three reasons that
|
|
@@ -628,7 +627,7 @@ import { fileURLToPath } from "node:url";
|
|
|
628
627
|
import { serializeJsonLd } from "../lib/json-ld";
|
|
629
628
|
|
|
630
629
|
const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
631
|
-
const HOSTILE = "
|
|
630
|
+
const HOSTILE = "Ada</scr" + "ipt><img src=x onerror=alert(1)>";
|
|
632
631
|
const U2028 = String.fromCharCode(0x2028);
|
|
633
632
|
|
|
634
633
|
/** Every source file under the project's own directories. */
|
|
@@ -712,7 +711,7 @@ import { securityHeaders } from "./lib/security-headers.mjs";
|
|
|
712
711
|
|
|
713
712
|
// SEO: redirect EVERY auto-assigned PRODUCTION *.vercel.app alias to the custom
|
|
714
713
|
// domain so none is crawled as an indexable duplicate of the whole site
|
|
715
|
-
// (
|
|
714
|
+
// (recipe: [[portable-stack]] §24).
|
|
716
715
|
// It lives in-repo (portable — survives a move off Vercel) and self-disables:
|
|
717
716
|
// - It matches ANY "*.vercel.app" host (regex), so it covers all of Vercel's
|
|
718
717
|
// production aliases at once — the default project alias, the random-suffixed
|
|
@@ -1475,8 +1474,8 @@ const PAGE_SURFACE = "#ffffff";
|
|
|
1475
1474
|
*
|
|
1476
1475
|
* What is deliberately NOT interpolated here is as load-bearing as what is:
|
|
1477
1476
|
* the required marker and the info-hint summary use FIXED accessible colors,
|
|
1478
|
-
* never `{{accent_color}}`. Z2W gold (`#FFD700`) is
|
|
1479
|
-
* orange (`#f5821f`)
|
|
1477
|
+
* never `{{accent_color}}`. Z2W gold (`#FFD700`) is 1.40:1 on white and STF
|
|
1478
|
+
* orange (`#f5821f`) 2.59:1 (both measured) — using the brand accent as small text ships an
|
|
1480
1479
|
* illegible glyph under a brand-consistency rationale.
|
|
1481
1480
|
*/
|
|
1482
1481
|
function globalsCss(primaryColor) {
|
|
@@ -1490,8 +1489,7 @@ function globalsCss(primaryColor) {
|
|
|
1490
1489
|
return `/* Global styles.
|
|
1491
1490
|
*
|
|
1492
1491
|
* Body typography lives here, not as an inline style on <body>, so there is ONE
|
|
1493
|
-
* home for it.
|
|
1494
|
-
* text is large and easy to read: body 18px+, line-height >= 1.5.
|
|
1492
|
+
* home for it. Public-facing text is large and easy to read: body 18px+, line-height >= 1.5.
|
|
1495
1493
|
*/
|
|
1496
1494
|
|
|
1497
1495
|
:root {
|
|
@@ -1530,10 +1528,39 @@ function globalsCss(primaryColor) {
|
|
|
1530
1528
|
/* The page itself. Named so \`test/contrast.test.ts\` can enumerate SURFACES
|
|
1531
1529
|
rather than assume one — the whole point of that file. */
|
|
1532
1530
|
--page-surface: ${PAGE_SURFACE};
|
|
1531
|
+
/* The phone's notch, rounded corners and home indicator. app/layout.tsx sets
|
|
1532
|
+
\`viewportFit: "cover"\`, so the page is drawn edge to edge and these say how
|
|
1533
|
+
much of each edge the hardware hides. They are 0px on a desktop and on any
|
|
1534
|
+
phone without a notch, so they cost nothing where they are not needed.
|
|
1535
|
+
<body> already pads by them. A FIXED or STICKY bar does not inherit that
|
|
1536
|
+
padding (it is positioned against the viewport, not the body), so give it
|
|
1537
|
+
its own, e.g. \`padding-bottom: var(--safe-bottom)\` on a bottom tab bar —
|
|
1538
|
+
otherwise the home indicator sits on top of its buttons once installed. */
|
|
1539
|
+
--safe-top: env(safe-area-inset-top, 0px);
|
|
1540
|
+
--safe-right: env(safe-area-inset-right, 0px);
|
|
1541
|
+
--safe-bottom: env(safe-area-inset-bottom, 0px);
|
|
1542
|
+
--safe-left: env(safe-area-inset-left, 0px);
|
|
1533
1543
|
}
|
|
1534
1544
|
|
|
1535
1545
|
body {
|
|
1536
1546
|
background: var(--page-surface);
|
|
1547
|
+
padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
/* Reduce Motion (an OS accessibility setting) means "no movement": it is there
|
|
1551
|
+
for people who get dizzy or nauseous from animation. The scaffold itself has
|
|
1552
|
+
no animation, so this is for the first one somebody adds. It shortens every
|
|
1553
|
+
animation and transition to an instant rather than removing it, so code that
|
|
1554
|
+
waits for \`transitionend\` or \`animationend\` still gets the event. */
|
|
1555
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1556
|
+
*,
|
|
1557
|
+
*::before,
|
|
1558
|
+
*::after {
|
|
1559
|
+
animation-duration: 0.01ms !important;
|
|
1560
|
+
animation-iteration-count: 1 !important;
|
|
1561
|
+
transition-duration: 0.01ms !important;
|
|
1562
|
+
scroll-behavior: auto !important;
|
|
1563
|
+
}
|
|
1537
1564
|
}
|
|
1538
1565
|
|
|
1539
1566
|
html {
|
|
@@ -1745,7 +1772,7 @@ body {
|
|
|
1745
1772
|
* the user agent's grey, and \`:disabled\` becomes a state with no appearance.
|
|
1746
1773
|
* The button then looks completely pressable, the click does nothing, and the
|
|
1747
1774
|
* user concludes the app is broken rather than that the control is unavailable.
|
|
1748
|
-
* That is not hypothetical — a sibling
|
|
1775
|
+
* That is not hypothetical — a sibling app shipped fully-pressable-looking
|
|
1749
1776
|
* disabled buttons across ~50 screens from its first commit, behind a clean
|
|
1750
1777
|
* typecheck, a green production build and 1,051 passing tests, because this is a
|
|
1751
1778
|
* rendered-pixel property that no type system or unit test can hold.
|
|
@@ -2021,7 +2048,7 @@ const CARD_PATH_GUARD_TEMPLATE = `/**
|
|
|
2021
2048
|
* ║ \`test/card-path-standards.test.ts\` runs this for you on every \`npm test\`. ║
|
|
2022
2049
|
* ╚══════════════════════════════════════════════════════════════════════════╝
|
|
2023
2050
|
*
|
|
2024
|
-
* Why the grep is part of the standard: a
|
|
2051
|
+
* Why the grep is part of the standard: a WooCommerce gateway (measured
|
|
2025
2052
|
* 2026-08-06) had a working \`verify_turnstile()\` and \`is_rate_limited()\` and
|
|
2026
2053
|
* called them in EXACTLY ONE of three card-accepting paths. The two bare ones
|
|
2027
2054
|
* were authenticated, nonce'd and ownership-checked — none of which limits
|
|
@@ -2618,7 +2645,7 @@ const CARD_PATH_STANDARDS_TEST_TEMPLATE = `/**
|
|
|
2618
2645
|
* not *how many* — an authenticated, nonce'd, ownership-checked endpoint is still
|
|
2619
2646
|
* a card-testing oracle if nothing limits volume.
|
|
2620
2647
|
*
|
|
2621
|
-
* A
|
|
2648
|
+
* A WooCommerce gateway (measured 2026-08-06) had both guards implemented and
|
|
2622
2649
|
* called them in exactly ONE of three card-accepting paths. Nobody spotted it by
|
|
2623
2650
|
* reading the code; a grep did. This test is that grep, run on every \`npm test\`.
|
|
2624
2651
|
*
|
|
@@ -3949,8 +3976,7 @@ describe("Sentry data-collection policy", () => {
|
|
|
3949
3976
|
});
|
|
3950
3977
|
});
|
|
3951
3978
|
`;
|
|
3952
|
-
const APP_LAYOUT_TEMPLATE = `// Root layout — SEO baseline wiring
|
|
3953
|
-
// 2026-05-30. Every indexable page MUST export its own \`metadata\`; do not
|
|
3979
|
+
const APP_LAYOUT_TEMPLATE = `// Root layout — SEO baseline wiring. Every indexable page MUST export its own \`metadata\`; do not
|
|
3954
3980
|
// rely on these defaults to fill in per-page values.
|
|
3955
3981
|
//
|
|
3956
3982
|
// ⚠️ These \`openGraph\` / \`twitter\` objects are DEFAULTS, not a base to extend.
|
|
@@ -3963,8 +3989,7 @@ import { Analytics } from "@/lib/analytics/Analytics";
|
|
|
3963
3989
|
import { InfoHintCloser } from "@/components/InfoHintCloser";
|
|
3964
3990
|
import { serializeJsonLd } from "@/lib/json-ld";
|
|
3965
3991
|
|
|
3966
|
-
// Global styles. Body typography (18px / 1.5,
|
|
3967
|
-
// readability rule) lives in this file, NOT as an inline style on <body>, so
|
|
3992
|
+
// Global styles. Body typography (18px / 1.5, for readability) lives in this file, NOT as an inline style on <body>, so
|
|
3968
3993
|
// there is one home for it rather than two that can drift.
|
|
3969
3994
|
import "./globals.css";
|
|
3970
3995
|
|
|
@@ -4000,6 +4025,10 @@ export const metadata: Metadata = {
|
|
|
4000
4025
|
|
|
4001
4026
|
export const viewport: Viewport = {
|
|
4002
4027
|
themeColor: "{{primary_color}}",
|
|
4028
|
+
// Draw edge to edge, under the notch and home indicator, when installed.
|
|
4029
|
+
// Safe only because app/globals.css pads <body> by env(safe-area-inset-*);
|
|
4030
|
+
// remove that padding and this hides content behind the notch in landscape.
|
|
4031
|
+
viewportFit: "cover",
|
|
4003
4032
|
};
|
|
4004
4033
|
|
|
4005
4034
|
const organizationJsonLd = {
|
|
@@ -4121,7 +4150,7 @@ const PWA_ICON_SVG_TEMPLATE = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="
|
|
|
4121
4150
|
`;
|
|
4122
4151
|
const PWA_SERVICE_WORKER_TEMPLATE = `// Service worker for {{brand_name}} — {{slug}}.
|
|
4123
4152
|
//
|
|
4124
|
-
// 🔴 IT NEVER STORES A PAGE. Most
|
|
4153
|
+
// 🔴 IT NEVER STORES A PAGE. Most apps show something personal once a
|
|
4125
4154
|
// person signs in (their records, their organization's data, their name in the
|
|
4126
4155
|
// header). A cached copy of such a page stays in the browser after sign-out,
|
|
4127
4156
|
// readable offline by whoever picks the phone up next, and it shows yesterday's
|
|
@@ -4139,7 +4168,7 @@ const PWA_SERVICE_WORKER_TEMPLATE = `// Service worker for {{brand_name}} — {{
|
|
|
4139
4168
|
// ids only where it can, and clears it at sign-out (the \`mobile-apps\` skill,
|
|
4140
4169
|
// references/offline-sync.md). Not here.
|
|
4141
4170
|
//
|
|
4142
|
-
// The cache name is namespaced per app because two
|
|
4171
|
+
// The cache name is namespaced per app because two apps can share an
|
|
4143
4172
|
// origin (rootdomain.com/app-a, rootdomain.com/app-b — see
|
|
4144
4173
|
// [[subdomain-vs-subdirectory]]) and a shared cache name would have them
|
|
4145
4174
|
// evicting each other's entries on every activate.
|
|
@@ -4168,7 +4197,7 @@ self.addEventListener("activate", (event) => {
|
|
|
4168
4197
|
caches
|
|
4169
4198
|
.keys()
|
|
4170
4199
|
// 🔴 Scoped to OUR prefix, not "everything that is not the current
|
|
4171
|
-
// cache". caches.keys() returns every cache on the ORIGIN, and two
|
|
4200
|
+
// cache". caches.keys() returns every cache on the ORIGIN, and two
|
|
4172
4201
|
// apps routinely share one — the standing guidance is to put
|
|
4173
4202
|
// SEO-important apps at rootdomain.com/path behind a Cloudflare front
|
|
4174
4203
|
// door rather than on a subdomain ([[subdomain-vs-subdirectory]]). An
|
|
@@ -4317,6 +4346,8 @@ Not SEO, but it is a pre-launch check and this is the pre-launch file.
|
|
|
4317
4346
|
- ✅ \`public/icon.svg\` — 512×512, listed twice in the manifest (\`purpose: "any"\` **and** \`purpose: "maskable"\`)
|
|
4318
4347
|
- ✅ \`public/sw.js\` — never stores a page (signed-in pages would stay readable offline after sign-out); page loads go to the network with a built-in offline page; only \`/_next/static/\` build files are cached
|
|
4319
4348
|
- ✅ \`components/ServiceWorker.tsx\` — registers the worker in **production only**, mounted from \`app/layout.tsx\`
|
|
4349
|
+
- ✅ Safe areas — \`viewportFit: "cover"\` in \`app/layout.tsx\`, and \`<body>\` padded by \`env(safe-area-inset-*)\` in \`app/globals.css\`
|
|
4350
|
+
- [ ] **Every fixed or sticky bar pads itself** with \`var(--safe-top)\` / \`var(--safe-bottom)\` (it does not inherit the body's padding); check it on a real iPhone with the app installed to the home screen
|
|
4320
4351
|
- [ ] **Verify installability on the deployed site, not locally** — the worker does not register under \`next dev\` by design. Chrome DevTools → Application → Manifest should list the manifest with no errors and both icon purposes; Application → Service Workers should show \`sw.js\` activated
|
|
4321
4352
|
- [ ] **Confirm no page or API response is cached** — DevTools → Application → Cache Storage → \`{{slug}}-v2\` should list only \`/_next/static/\` files
|
|
4322
4353
|
- [ ] Replace \`public/icon.svg\` with real artwork; keep the 512×512 frame and keep the mark inside the central ~80% (Android crops the rest)
|
|
@@ -4386,7 +4417,7 @@ const ANALYTICS_UTM_TEMPLATE = `export const UTM_KEYS = [
|
|
|
4386
4417
|
export type UtmKey = (typeof UTM_KEYS)[number];
|
|
4387
4418
|
export type UtmParams = Partial<Record<UtmKey, string>>;
|
|
4388
4419
|
|
|
4389
|
-
// Slug-namespaced so two
|
|
4420
|
+
// Slug-namespaced so two apps sharing a domain don't collide in storage.
|
|
4390
4421
|
const STORAGE_KEY = "{{slug}}_utm_first_touch";
|
|
4391
4422
|
const SENT_FLAG_KEY = "{{slug}}_utm_event_sent";
|
|
4392
4423
|
|
|
@@ -4863,7 +4894,7 @@ CANONICAL_HOSTS=
|
|
|
4863
4894
|
# not remove it — the same fail-closed-on-empty rule as ALLOWED_EMAILS.
|
|
4864
4895
|
#
|
|
4865
4896
|
# Magic-link auth needs this and it is not optional: \`trustHost: true\` with no
|
|
4866
|
-
# AUTH_URL (the correct
|
|
4897
|
+
# AUTH_URL (the correct setting — a fixed AUTH_URL breaks tenant vanity
|
|
4867
4898
|
# domains) means Auth.js derives every magic-link URL from the incoming Host
|
|
4868
4899
|
# header with NOTHING validating it. An attacker can request a link for someone
|
|
4869
4900
|
# else's address on a forged Host; the victim gets a genuine, correctly-signed
|
|
@@ -5655,7 +5686,7 @@ const VERCEL_JSON = JSON.stringify({ $schema: "https://openapi.vercel.sh/vercel.
|
|
|
5655
5686
|
const VERCEL_IGNORE_TEST_TEMPLATE = `/**
|
|
5656
5687
|
* vercel.json carries an Ignored Build Step: a push that changes nothing but
|
|
5657
5688
|
* Markdown (STATUS.md, HANDOFF.md, CHANGELOG.md, ...) does NOT rebuild the site.
|
|
5658
|
-
* Measured 2026-09-22 across 19
|
|
5689
|
+
* Measured 2026-09-22 across 19 production Vercel projects: 35.6% of commits
|
|
5659
5690
|
* to main changed no application code, and build CPU was 71% of the Vercel bill.
|
|
5660
5691
|
*
|
|
5661
5692
|
* Vercel's exit codes are INVERTED: exit 0 SKIPS the build, anything else builds.
|
|
@@ -58,7 +58,7 @@ const PROTOCOL_README_TEMPLATE = `# {{slug}}
|
|
|
58
58
|
|
|
59
59
|
## How consumers use it
|
|
60
60
|
|
|
61
|
-
Each consumer agent
|
|
61
|
+
Each consumer agent reads this repo via \`gh api repos/{{github_org}}/{{slug}}/contents/<file>.md\` or \`git clone\`. Auth = each consumer's existing \`gh\` CLI auth — zero new credentials.
|
|
62
62
|
|
|
63
63
|
## File layout
|
|
64
64
|
|
|
@@ -92,7 +92,7 @@ This document defines the live protocol consumers of \`{{slug}}\` follow. The RE
|
|
|
92
92
|
|
|
93
93
|
## §2 — Participating projects
|
|
94
94
|
|
|
95
|
-
[TODO — list which
|
|
95
|
+
[TODO — list which projects are participants in this protocol, and how they're identified.]
|
|
96
96
|
|
|
97
97
|
## §3 — File format
|
|
98
98
|
|
|
@@ -138,7 +138,7 @@ This file holds cross-project signals that affect 2+ participating projects, or
|
|
|
138
138
|
`;
|
|
139
139
|
const PROJECTS_KEEP_TEMPLATE = `# Per-project files
|
|
140
140
|
|
|
141
|
-
This directory holds one markdown file per participating
|
|
141
|
+
This directory holds one markdown file per participating project. Each consumer agent maintains its own file (\`projects/<their-slug>.md\`) and reads other projects' files for cross-project signals.
|
|
142
142
|
|
|
143
143
|
Bootstrap a new project file by copying the schema from any existing one, or from the AGENT_PROTOCOL.md mini-template if one is defined.
|
|
144
144
|
`;
|
|
@@ -127,6 +127,17 @@ if (!defined('WP_UNINSTALL_PLUGIN')) {
|
|
|
127
127
|
// Example:
|
|
128
128
|
// delete_option('{{slug_under}}_settings');
|
|
129
129
|
`;
|
|
130
|
+
/**
|
|
131
|
+
* `Contributors:` takes wordpress.org usernames. Ours is `kerrykriger`, which is
|
|
132
|
+
* right for our own brands and wrong for a custom (outside) brand, whose
|
|
133
|
+
* username we do not know. Guessing one would state something nobody measured,
|
|
134
|
+
* so a custom brand gets no line at all; WordPress reads the file without it.
|
|
135
|
+
*/
|
|
136
|
+
function readmeTxtTemplate(inputs) {
|
|
137
|
+
if (inputs.brand !== "custom")
|
|
138
|
+
return README_TXT_TEMPLATE;
|
|
139
|
+
return README_TXT_TEMPLATE.replace("Contributors: kerrykriger\n", "");
|
|
140
|
+
}
|
|
130
141
|
const README_TXT_TEMPLATE = `=== {{slug}} ===
|
|
131
142
|
Contributors: kerrykriger
|
|
132
143
|
Tags: {{slug}}
|
|
@@ -194,7 +205,7 @@ const MODULE_LOADER_TEMPLATE = `<?php
|
|
|
194
205
|
* Module loader for {{slug}}.
|
|
195
206
|
*
|
|
196
207
|
* Singleton; instantiates registered modules in a fixed order. Mirrors the
|
|
197
|
-
* canonical
|
|
208
|
+
* canonical WordPress module-loader pattern (see [[wordpress-plugins-skill]]).
|
|
198
209
|
*
|
|
199
210
|
* To add a module:
|
|
200
211
|
* 1. Drop the class file in includes/modules/
|
|
@@ -244,7 +255,7 @@ export function scaffoldWpPlugin(inputs, opts) {
|
|
|
244
255
|
const typeSpecific = [
|
|
245
256
|
{ path: `${inputs.slug}.php`, content: sub(PLUGIN_HEADER_TEMPLATE, inputs, opts, spec) },
|
|
246
257
|
{ path: "uninstall.php", content: sub(UNINSTALL_TEMPLATE, inputs, opts, spec) },
|
|
247
|
-
{ path: "readme.txt", content: sub(
|
|
258
|
+
{ path: "readme.txt", content: sub(readmeTxtTemplate(inputs), inputs, opts, spec) },
|
|
248
259
|
{
|
|
249
260
|
path: `includes/class-${inputs.slug}-activator.php`,
|
|
250
261
|
content: sub(ACTIVATOR_TEMPLATE, inputs, opts, spec),
|
package/dist/writer.js
CHANGED
|
@@ -366,6 +366,20 @@ export async function writeScaffold(inputs, targetPath, opts = {}) {
|
|
|
366
366
|
files.push(file);
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
+
// The same pointer rewrite for EVERY other emitted file. Until v0.47.0 it ran
|
|
370
|
+
// on CLAUDE.md alone, so an outside customer's code comments and env files
|
|
371
|
+
// still carried ~60 `[[skill]]` links they cannot open (`project-creator`,
|
|
372
|
+
// 2026-10-07; measured across all eight project types 2026-10-27).
|
|
373
|
+
// TOML is skipped because `[[name]]` is real syntax there (an array of tables,
|
|
374
|
+
// e.g. `[[routes]]` in wrangler.toml), and rewriting it would break the file.
|
|
375
|
+
if (audience === "external") {
|
|
376
|
+
for (let i = 0; i < files.length; i++) {
|
|
377
|
+
const file = files[i];
|
|
378
|
+
if (file.path === "CLAUDE.md" || file.path.endsWith(".toml"))
|
|
379
|
+
continue;
|
|
380
|
+
files[i] = { ...file, content: stripVaultPointers(file.content, audience) };
|
|
381
|
+
}
|
|
382
|
+
}
|
|
369
383
|
for (const file of files) {
|
|
370
384
|
assertScaffoldedPathSafe(resolvedTarget, file);
|
|
371
385
|
}
|