@zero2webmaster/starter-kit 0.3.1 → 0.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # z2w-starter-kit
2
2
 
3
- **Version:** 0.3.1 | **Framework:** 2.13.0
3
+ **Version:** 0.4.0 | **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.3.1 | Last Updated: 2026-07-17*
102
+ *Version: 0.4.0 | Last Updated: 2026-07-18*
@@ -3,12 +3,13 @@ import { type ScaffoldInputs } from "./index.js";
3
3
  export declare const AIRTABLE_API_BASE = "https://api.airtable.com/v0";
4
4
  /**
5
5
  * The marker the scaffolder actually writes when the agent-coordination
6
- * standard applies — the heading of `AGENT_COORDINATION_BODY` (src/standards.ts),
7
- * with the body's lead sentence as a fallback. We grep-verify against THIS,
8
- * not the literal `canonical-block` token: the scaffolded files do NOT carry
9
- * the `<!-- z2w-agent-coordination canonical-block vX.Y.Z -->` HTML fingerprint
10
- * comment — that fingerprint lives only in this CLI's own CLAUDE.md for
11
- * cross-project drift detection. Verify against what the scaffolder emits.
6
+ * standard applies. As of the verbatim-canonical-block change (v0.4.0), a
7
+ * scaffolded project DOES carry the real `<!-- z2w-agent-coordination
8
+ * canonical-block vX.Y.Z -->` HTML fingerprint — the same token cross-project
9
+ * drift detection (Signal A) greps for — so a fresh scaffold passes drift
10
+ * detection with no manual first-session re-sync. We grep-verify against that
11
+ * fingerprint, with the block's lead sentence retained as a fallback for older
12
+ * scaffolds that predate the fingerprint emission.
12
13
  */
13
14
  export declare const COORDINATION_BLOCK_MARKER: RegExp;
14
15
  /**
package/dist/airtable.js CHANGED
@@ -28,14 +28,15 @@ import { version } from "./index.js";
28
28
  export const AIRTABLE_API_BASE = "https://api.airtable.com/v0";
29
29
  /**
30
30
  * The marker the scaffolder actually writes when the agent-coordination
31
- * standard applies — the heading of `AGENT_COORDINATION_BODY` (src/standards.ts),
32
- * with the body's lead sentence as a fallback. We grep-verify against THIS,
33
- * not the literal `canonical-block` token: the scaffolded files do NOT carry
34
- * the `<!-- z2w-agent-coordination canonical-block vX.Y.Z -->` HTML fingerprint
35
- * comment — that fingerprint lives only in this CLI's own CLAUDE.md for
36
- * cross-project drift detection. Verify against what the scaffolder emits.
31
+ * standard applies. As of the verbatim-canonical-block change (v0.4.0), a
32
+ * scaffolded project DOES carry the real `<!-- z2w-agent-coordination
33
+ * canonical-block vX.Y.Z -->` HTML fingerprint — the same token cross-project
34
+ * drift detection (Signal A) greps for — so a fresh scaffold passes drift
35
+ * detection with no manual first-session re-sync. We grep-verify against that
36
+ * fingerprint, with the block's lead sentence retained as a fallback for older
37
+ * scaffolds that predate the fingerprint emission.
37
38
  */
38
- export const COORDINATION_BLOCK_MARKER = /Agent Coordination \(cross-project bulletin participation\)|participates in the Z2W cross-project coordination bulletin/;
39
+ export const COORDINATION_BLOCK_MARKER = /<!-- z2w-agent-coordination canonical-block v\d+\.\d+\.\d+ -->|participates in the Z2W cross-project coordination bulletin/;
39
40
  /**
40
41
  * "Verify, don't assert" (mirrors [[github-readme-and-version-integrity]]).
41
42
  * Read the freshly-written scaffold and report whether it actually carries the
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.3.1";
4
+ export declare const version = "0.4.0";
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.3.1";
24
+ export const version = "0.4.0";
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
@@ -8,6 +8,7 @@ export interface ScaffoldFile {
8
8
  export interface ScaffolderOptions extends SubstitutionOptions {
9
9
  }
10
10
  export declare const STANDARDS_BLOCK_MARKER = "<!-- STANDARDS_BLOCK -->";
11
+ export declare const AGENT_COORDINATION_BLOCK_MARKER = "<!-- AGENT_COORDINATION_BLOCK -->";
11
12
  export declare const AGENTS_BODY_MARKER = "<!-- AGENTS_BODY -->";
12
13
  export declare function resolveBrandSpec(inputs: ScaffoldInputs): BrandPresetSpec;
13
14
  export declare function sub(template: string, inputs: ScaffoldInputs, opts: ScaffolderOptions | undefined, spec: BrandPresetSpec): string;
@@ -14,6 +14,7 @@
14
14
  import { getBrandSpec, renderBrandBlock } from "../brand.js";
15
15
  import { applySubstitutions } from "../substitute.js";
16
16
  export const STANDARDS_BLOCK_MARKER = "<!-- STANDARDS_BLOCK -->";
17
+ export const AGENT_COORDINATION_BLOCK_MARKER = "<!-- AGENT_COORDINATION_BLOCK -->";
17
18
  export const AGENTS_BODY_MARKER = "<!-- AGENTS_BODY -->";
18
19
  export function resolveBrandSpec(inputs) {
19
20
  return getBrandSpec(inputs.brand, inputs.customBrand, inputs.githubOrg);
@@ -470,7 +471,7 @@ ${STANDARDS_BLOCK_MARKER}
470
471
 
471
472
  ---
472
473
 
473
- ## Generic AGENTS — 3-layer system reference
474
+ ${AGENT_COORDINATION_BLOCK_MARKER}## Generic AGENTS — 3-layer system reference
474
475
 
475
476
  The canonical AGENTS body for framework v{{framework_version}} is embedded below by the writer at scaffold time. The project-specific guidance above takes precedence on conflict.
476
477
 
@@ -28,6 +28,14 @@ export interface StandardsResolution {
28
28
  * inside CLAUDE.md. Already includes substitutions; ready to write.
29
29
  */
30
30
  body: string;
31
+ /**
32
+ * The verbatim canonical Agent Coordination section, ready to `.replace()`
33
+ * into the `<!-- AGENT_COORDINATION_BLOCK -->` marker (a TOP-LEVEL `## Agent
34
+ * Coordination` section, kept OUT of the `## Standards block` so it can carry
35
+ * the canonical heading + fingerprint comment verbatim). Empty string when
36
+ * the project does not participate in the bulletin.
37
+ */
38
+ agentCoordinationBody: string;
31
39
  /** One entry per standard the resolver considered (applicable or not). */
32
40
  decisions: StandardDecision[];
33
41
  /**
@@ -43,6 +51,7 @@ export interface StandardsResolution {
43
51
  * family — the safe default for anything else with `has_web_ui=true`.
44
52
  */
45
53
  export declare function fathomEnvVarFor(projectType: ProjectType): string;
54
+ export declare const CANONICAL_COORDINATION_BLOCK_VERSION = "v0.1.13";
46
55
  /**
47
56
  * Resolve which standards apply to `inputs` and render the standards markdown
48
57
  * body suitable for `.replace()`-ing into the `<!-- STANDARDS_BLOCK -->`
@@ -62,3 +71,13 @@ export declare function resolveStandards(inputs: ScaffoldInputs, opts?: ResolveS
62
71
  * call on any file).
63
72
  */
64
73
  export declare function applyStandardsBlock(claudeMd: string, resolution: StandardsResolution): string;
74
+ /**
75
+ * Fill the `<!-- AGENT_COORDINATION_BLOCK -->` marker with the verbatim
76
+ * canonical Agent Coordination section (or remove it, leaving a clean seam,
77
+ * when the project does not participate in the bulletin). Kept separate from
78
+ * {@link applyStandardsBlock} because the section is a TOP-LEVEL `## Agent
79
+ * Coordination` block that must sit outside `## Standards block`.
80
+ *
81
+ * Returns the input verbatim if the marker isn't present (safe on any file).
82
+ */
83
+ export declare function applyAgentCoordinationBlock(claudeMd: string, resolution: StandardsResolution): string;
package/dist/standards.js CHANGED
@@ -307,41 +307,78 @@ const NEON_CAREFUL_BODY = `### Neon-careful (Neon Postgres)
307
307
  > **Queue/outbox drain — inline, never a frequent poll:** if a queue or outbox is fed by this app's OWN writes, drain it INLINE on the compute the write already woke (Cloudflare Workers: \`ctx.waitUntil(drain())\` after the response is sent; a Node/long-running service: a fire-and-forget drain after the write commits) — a DB-touching cron's cost is its WAKE-UPS, not its row volume, so riding an existing wake costs zero extra CU-hours and ships the row in seconds. Any cron drainer stays a LOW-frequency backstop (daily, not minutes) that only sweeps rows whose send failed; keep per-row claims under \`FOR UPDATE SKIP LOCKED\` so an inline drain and a backstop tick can't double-send. (financial-engine cut an outbox from ~15 → ~0.6 CU-hr/mo/tenant — ~25× — this way.)
308
308
  >
309
309
  > See [[neon-postgres]] for the full discipline (§4.4 covers the inline-drain pattern).`;
310
- const AGENT_COORDINATION_BODY = `### Agent Coordination (cross-project bulletin participation)
310
+ // The current canonical-block fingerprint version. Bumped in lockstep with
311
+ // `zero2webmaster/z2w-agent-coordination`'s AGENT_PROTOCOL.md when the embedded
312
+ // block's mechanics change (drift-detection Signal A greps for this exact token).
313
+ // When you sync a newer canonical block below, bump this to match its comment.
314
+ export const CANONICAL_COORDINATION_BLOCK_VERSION = "v0.1.13";
315
+ /**
316
+ * The Agent Coordination section, emitted as its own TOP-LEVEL `## Agent
317
+ * Coordination` section (NOT a `###` standards subsection). The bulk is the
318
+ * VERBATIM canonical block from `AGENT_PROTOCOL.md` — heading, the
319
+ * `<!-- ... canonical-block vX.Y.Z -->` fingerprint comment, and the exact
320
+ * protocol body — so a freshly scaffolded project passes cross-project
321
+ * drift-detection (Signal A) with no manual first-session re-sync, AND carries
322
+ * the MANDATORY/never-ask session-end rule verbatim (the paraphrase this
323
+ * replaced silently dropped it — filed 2026-07-15 after two independent
324
+ * projects reported hand-fixing it; root cause of Kerry's 2026-07-18 "agents
325
+ * still ask" inbox item). Single-brace placeholders (`{this-project-slug}`,
326
+ * `{their-project}`, `{summary}`) are LITERAL canonical template syntax and
327
+ * pass through substitution untouched; only the `{{slug}}` tokens in the
328
+ * project-specific notes below are substituted at scaffold time.
329
+ */
330
+ const AGENT_COORDINATION_BODY = `## Agent Coordination
311
331
 
312
- > **Cross-project coordination:** This project participates in the Z2W cross-project coordination bulletin at \`zero2webmaster/z2w-agent-coordination\`. The canonical protocol body lives in that repo's \`AGENT_PROTOCOL.md\` — read it at session start for the current version and section list. Reference conventions by NAME — the §-numbers below are parenthetical breadcrumbs that may renumber upstream.
313
- >
314
- > **Agent identifier:** This agent identifies as \`{{slug}} agent\` per the inter-agent identifier convention (see §8.2). Optional \` #{N}\` chat-number suffix when Kerry has labeled the chat. Opaque tags only when disambiguating multiple anonymous parallel sessions. §8.2 specifies the verbatim formats for three contexts: bulletin "Active sessions" entries, bulletin reply markers (\`↳ ({reply-at}, {agent-name}):\`), and commit messages (\`{{slug}}: {summary}\`). Defer to AGENT_PROTOCOL.md for those formats — do not paraphrase.
315
- >
316
- > **Inter-agent message header convention:** every inter-agent message Kerry couriers (chat-to-chat relay) MUST begin with a \`To:\` / \`From:\` / \`Re:\` header so Kerry can route by reading the To: line alone (see §8.4). Bulletin-posted replies keep their concise inline format (the \`[→ {their-project}]\` prefix on the question + the \`↳ (..., {agent-name}):\` marker on the reply) — the header convention is courier-mode only.
317
- >
318
- > **At session start:**
319
- > 1. Resolve the bulletin clone location per the 3-step rule (see §8.3):
320
- > - If \`~/.cache/z2w-coordination/\` OR \`~/Desktop/Zero2Webmaster/AI/Cursor Projects/z2w-agent-coordination/\` exists, use it (\`cd\` there + \`git pull --ff-only\`).
321
- > - Otherwise clone to \`~/.cache/z2w-coordination\`.
322
- > - If \`~/.cache/\` isn't writable in this sandbox, fall back to \`~/.claude/coordination/\` and document the deviation.
323
- > 2. Read \`projects/{{slug}}.md\` — surface to Kerry anything in "Open questions" tagged for this project, any "Heads-ups" not yet ACK'd, and any other-session entries in "Active sessions".
324
- > 3. Read \`global.md\` — surface cross-project heads-ups.
325
- >
326
- > **During session:**
327
- > - If a coordination need surfaces, append to the relevant section in memory and persist at session end.
328
- > - Questions to another project's agent go in THEIR project file's "Open questions" section with \`[→ {their-project}]\` prefix.
329
- > - **Replies belong under the original question in the asker's project file** — do NOT mirror-and-reply in your own file (that fragments discovery).
330
- >
331
- > **At session end:**
332
- > - Update "Active sessions" (your entry, or mark complete).
333
- > - Update "Recent commits" if this session shipped.
334
- > - Append any new heads-ups, open questions, or follow-ups.
335
- > - Commit with the \`{{slug}}: {summary}\` format (see §8.2) and \`git push\`.
336
- > - **Auto-push hook race:** if this project has a post-commit hook that auto-pushes the bulletin clone, expect it to race your explicit \`git push\` and grab the ref lock first. The commit still lands — verify with \`git log origin/main\` rather than re-pushing.
337
- >
338
- > **Hard rules (read first):**
339
- > - **No secrets, ever.** Operational metadata only. Detect-and-redact on \`sk_*\`, \`pk_*\`, \`rk_*\`, \`whsec_*\`, \`xoxb-*\`, \`tbl[A-Za-z0-9]{14}\`, \`pat_*\`, etc.
340
- > - **Private repo only.** The bulletin must remain \`--visibility private\`.
341
- > - **Never edit another project's file directly.** Cross-project signaling goes through \`[→ {their-project}]\` prefixes in the target's "Open questions" section.
342
- > - **Append-only within sections.** Trimming expired entries is a separate operation flagged in the commit message.
343
- >
344
- > See \`~/Desktop/Zero2Webmaster/AI/Cursor Projects/z2w-agent-coordination/AGENT_PROTOCOL.md\` for the canonical protocol body.`;
332
+ <!-- z2w-agent-coordination canonical-block ${CANONICAL_COORDINATION_BLOCK_VERSION} -->
333
+
334
+ *(↓ copy this section, including this heading AND the HTML fingerprint comment above, into each participating project's \`CLAUDE.md\` and \`AGENTS.md\`. The fingerprint lets \`grep\` detect drift across projects.)*
335
+
336
+ This project participates in the Z2W cross-project coordination bulletin.
337
+
338
+ **At session start:**
339
+ 1. If a workspace clone exists at \`~/.cache/z2w-coordination\` OR at \`~/Desktop/Zero2Webmaster/AI/Cursor Projects/z2w-agent-coordination/\`, use it (\`cd\` there + \`git pull --ff-only\`). Otherwise: \`git clone --depth 1 git@github.com:zero2webmaster/z2w-agent-coordination.git ~/.cache/z2w-coordination\`. (See §8.3.) **Then set the bot commit identity for the clone (v0.1.12):** \`bash scripts/set-bulletin-commit-identity.sh\` — idempotent, sets \`user.name\`/\`user.email\` **locally for this clone only** (global identity untouched) so your bulletin commits author as \`Z2W Bulletin Bot\`, not Kerry. The bulletin is coordination traffic (~40 agents push here); attributing it to Kerry's personal GitHub contribution graph skews his real-work count. Existing shared clones already have this set; run it after any FRESH clone.
340
+ 2. Read \`projects/{this-project-slug}.md\` IN THIS ORDER:
341
+ a. **\`## Incidents\`** FIRST, if the section exists (v0.1.13). Any incident whose latest status line is \`open\` (i.e. no \`↳ resolved\` under it) means something is broken in production RIGHT NOW. Surface every open incident to Kerry before anything else, and prefer triaging it over new feature work — **a production incident outranks Kerry's inbox.** If the section is absent, there are no incidents; move on. (Incidents are written by the observability bridge or by an agent that spots a live problem — see §8.8 for the schema, dedup key, status lifecycle, and PII-strip rule.)
342
+ b. Then **\`## Inbox from Kerry\`**. Any entry without a \`↳ received\` line is unread. For each unread entry: surface it to Kerry, ACK by appending \`↳ received {YYYY-MM-DD HH:MM}, session {id}\` immediately, and move the work into \`## Open follow-ups owned by this project\` so it survives this session.
343
+ c. Then \`## Open questions\` — surface any \`[→ this-project]\` asks AND your OWN un-replied \`[→ Kerry]\` items. **Proactively open the session WITH your pending \`[→ Kerry]\` decisions, in plain English** (v0.1.9): e.g. *"I'm up to speed. Pending your input: (1) {one-line ask}, (2) {one-line ask}. Want to handle any now?"* A \`[→ Kerry]\` item is a genuine "blocked on you" flag — don't let it sit silently on the dashboard while Kerry is right here in the session.
344
+ d. Then \`## Heads-ups for other agents\` (un-ACK'd) and other-session entries in \`## Active sessions\`.
345
+ 3. Read \`global.md\` — surface cross-project heads-ups (and any \`## Inbox from Kerry\` entries in \`global.md\` addressed to all agents).
346
+
347
+ **During session:**
348
+ - If a coordination need surfaces (cross-project question, important heads-up), append to the relevant section in memory and persist on session end.
349
+ - If a question to another project's agent surfaces, append to THEIR project file's \`## Open questions\` section with \`[→ {their-project}]\` prefix.
350
+ - 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.
351
+ - **\`[→ 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.
352
+ - **A cross-agent question AND all its replies live in the askee's (target's) project file** — the same file you just filed the \`[→ {their-project}]\` question in. Do NOT mirror-and-reply in your own file, and do NOT park the question in your own file first (that fragments discovery). The asker may keep a lightweight pointer in their own file if they want one, but the canonical thread (question + every \`↳\` reply) stays in the askee's file.
353
+ - **"Posted to the bulletin" is ambiguous — name the FILE + SECTION, and route to a specific agent if a specific agent must see it (v0.1.12).** \`global.md\` is the ONLY file every agent reads at session start. A reply/entry under a project's section in \`projects/{x}.md\` is seen by that project's agent + anyone who opens that file — NOT automatically by other agents. To guarantee a specific other agent sees something, append a \`[→ {their-project}]\` entry to THEIR file's \`## Open questions\`. So when you say you "posted" something, say which file and section.
354
+
355
+ **At session end (or when the end is near):**
356
+ - **Re-read \`## Inbox from Kerry\` (v0.1.9).** A dispatch from Kerry can land *mid-session* — invisible to an agent that only checked at boot. Re-read the inbox; ACK and handle any entry that arrived since session start.
357
+ - **Re-check your OWN un-replied \`[→ Kerry]\` items (v0.1.9).** If any are still pending and Kerry is reachable, raise them one more time before closing.
358
+ - **Re-check \`## Open questions\` for new \`[→ this-project]\` entries that arrived since session start (v0.1.10).** A dedicated message from another agent lands here. Reply (\`↳\` under the question) and, if it needs more than this session has room for, move it into \`## Open follow-ups owned by this project\` so it survives. (You do NOT need to re-read \`global.md\` at session end.)
359
+ - **Updating the bulletin at session end is a MANDATORY standing wrap step — never a question you put to Kerry (v0.1.11).** It ranks with committing your code, not with optional extras. Do NOT end a session by asking *"want me to update the bulletin too?"* or *"that wasn't in your wrap list — say the word"* — decide with the two tiers below and just do it. The one and only time you skip is a purely read-only / conversational session that changed no files and no project state — and even then you **skip silently, you do not ask**. (Kerry, 2026-07-05: *"they should know to either do it or not do it"* — this rule is that decision, made once, so no agent defers it back to him.)
360
+ - **Tier 1 — ALWAYS (any session that did real work on this project):** rewrite \`## Current focus\` in place — one short paragraph (or 1–3 bullets) of what this project is working on right now, stamped with the current date + session id — and add/close your \`## Active sessions\` entry. It is the field the \`agents.z2w.us\` dashboard reads: a stale timestamp signals "agent ran but said nothing."
361
+ - **Tier 2 — ADDITIONALLY, only if the session shipped code or changed project state:** add a \`## Recent commits\` entry and append any new heads-ups / \`[→ {project}]\` / \`[→ Kerry]\` items.
362
+ - **Size discipline (v0.1.11):** before appending, if \`projects/{this-project}.md\` is approaching ~200 KB, trim FIRST — archive old \`## Active sessions\` and \`## Recent commits\` entries and resolved \`## Open questions\` threads into \`projects/{this-project}-archive.md\` (a separate, commit-flagged operation). \`## Current focus\` is rewritten in place (never appended).
363
+ - \`git commit -m "{this-project}: {summary}"\` (see §8.2 for agent-identifier format) and \`git push\`.
364
+ - If push fails due to concurrent write from another session: \`git pull --rebase\`, resolve any conflicts, retry push.
365
+ - **Local auto-push hooks:** if your project has a post-commit hook that auto-pushes, expect it to race your explicit \`git push\` and grab the ref lock first. The commit still lands — verify with \`git log origin/main\` rather than re-pushing.
366
+
367
+ **Inbox-section authority (v0.1.8):** Only the orchestrator identity \`kerry-phone\` (the phone-first command center at \`agents.z2w.us\`) writes to \`## Inbox from Kerry\`. Project agents only READ and ACK there — never write. Never edit another project's \`## Inbox from Kerry\` section.
368
+
369
+ **Hard rules (read first):**
370
+ - **No secrets, ever.** Operational metadata only. Detect-and-redact on \`sk_*\`, \`pk_*\`, \`rk_*\`, \`whsec_*\`, \`xoxb-*\`, \`tbl[A-Za-z0-9]{14}\`, \`pat_*\`, etc.
371
+ - **Private repo only.** The bulletin must remain \`--visibility private\`.
372
+ - **Never edit another project's file directly.** Cross-project signaling goes through \`[→ {their-project}]\` prefixes in the target's \`## Open questions\` section.
373
+ - **Append-only within sections.** Trimming expired entries is a separate operation flagged in the commit message.
374
+
375
+ See \`~/Desktop/Zero2Webmaster/AI/Cursor Projects/z2w-agent-coordination/AGENT_PROTOCOL.md\` for the canonical protocol body — read it at session start for the current version and section list. Reference conventions by NAME; the §-numbers above are parenthetical breadcrumbs that may renumber upstream.
376
+
377
+ ### Project-specific notes for {{slug}}
378
+
379
+ - **Agent identifier:** \`{{slug}}\` (per §8.2). Optional \` #{N}\` chat-number suffix when Kerry has labeled the chat.
380
+ - **Commit message format:** \`{{slug}}: {summary}\` (per §8.2).
381
+ - **Inter-agent courier header:** every message Kerry relays chat-to-chat starts with a \`To:\` / \`From:\` / \`Re:\` block (§8.4). Bulletin-posted replies use the inline \`↳ (..., {{slug}}):\` marker without the header.`;
345
382
  const SEO_BASELINE_BODY = `### SEO baseline (non-WP web UI)
346
383
 
347
384
  > **SEO is non-negotiable from v1 (standing org requirement 2026-05-30).** WordPress sites get SEO from RankMath; non-WP web apps have no equivalent — every element must be built in deliberately at instantiation. SEO is NOT a later task.
@@ -451,6 +488,7 @@ function renderPreamble(inputs, opts) {
451
488
  export function resolveStandards(inputs, opts = {}) {
452
489
  const decisions = [];
453
490
  const inserted = [];
491
+ let agentCoordinationBody = "";
454
492
  for (const key of STANDARD_ORDER) {
455
493
  const result = APPLICABILITY[key](inputs);
456
494
  if (result.applies) {
@@ -460,7 +498,15 @@ export function resolveStandards(inputs, opts = {}) {
460
498
  state: "inserted-inline",
461
499
  reason: result.reason,
462
500
  });
463
- inserted.push(renderStandardBody(key, inputs, opts));
501
+ // agent-coordination is emitted as its own top-level section (verbatim
502
+ // canonical block + fingerprint) via a separate marker, NOT inline in the
503
+ // standards block — so it never lands mid-`## Standards block`.
504
+ if (key === "agent-coordination") {
505
+ agentCoordinationBody = renderStandardBody(key, inputs, opts);
506
+ }
507
+ else {
508
+ inserted.push(renderStandardBody(key, inputs, opts));
509
+ }
464
510
  }
465
511
  else {
466
512
  decisions.push({
@@ -475,6 +521,7 @@ export function resolveStandards(inputs, opts = {}) {
475
521
  const body = `${renderPreamble(inputs, opts)}\n\n${sections}\n`;
476
522
  return {
477
523
  body,
524
+ agentCoordinationBody,
478
525
  decisions,
479
526
  promotePending: opts.promoteStandards === true,
480
527
  };
@@ -491,3 +538,20 @@ export function resolveStandards(inputs, opts = {}) {
491
538
  export function applyStandardsBlock(claudeMd, resolution) {
492
539
  return claudeMd.replace(/<!-- STANDARDS_BLOCK -->/g, resolution.body.trimEnd());
493
540
  }
541
+ /**
542
+ * Fill the `<!-- AGENT_COORDINATION_BLOCK -->` marker with the verbatim
543
+ * canonical Agent Coordination section (or remove it, leaving a clean seam,
544
+ * when the project does not participate in the bulletin). Kept separate from
545
+ * {@link applyStandardsBlock} because the section is a TOP-LEVEL `## Agent
546
+ * Coordination` block that must sit outside `## Standards block`.
547
+ *
548
+ * Returns the input verbatim if the marker isn't present (safe on any file).
549
+ */
550
+ export function applyAgentCoordinationBlock(claudeMd, resolution) {
551
+ const marker = /<!-- AGENT_COORDINATION_BLOCK -->/g;
552
+ const section = resolution.agentCoordinationBody.trimEnd();
553
+ if (section === "") {
554
+ return claudeMd.replace(marker, "");
555
+ }
556
+ return claudeMd.replace(marker, `${section}\n\n---\n\n`);
557
+ }
package/dist/writer.js CHANGED
@@ -23,10 +23,10 @@
23
23
  import { promises as fs } from "node:fs";
24
24
  import * as path from "node:path";
25
25
  import fsExtra from "fs-extra";
26
- import { AGENTS_BODY_MARKER, STANDARDS_BLOCK_MARKER, } from "./scaffolders/common.js";
26
+ import { AGENT_COORDINATION_BLOCK_MARKER, AGENTS_BODY_MARKER, STANDARDS_BLOCK_MARKER, } from "./scaffolders/common.js";
27
27
  import { buildProSeoExtension, proSeoApplies, } from "./scaffolders/pro-seo-extension.js";
28
28
  import { scaffoldByType } from "./scaffolders/index.js";
29
- import { applyStandardsBlock, resolveStandards, } from "./standards.js";
29
+ import { applyAgentCoordinationBlock, applyStandardsBlock, resolveStandards, } from "./standards.js";
30
30
  import { resolveAgentsTemplate, } from "./templates.js";
31
31
  export class WriterError extends Error {
32
32
  constructor(message) {
@@ -59,7 +59,11 @@ function reassembleStandardsBody(preamble, sections) {
59
59
  return `${preamble}\n\n${sections.map((s) => s.markdown).join("\n\n")}\n`;
60
60
  }
61
61
  async function runPromotionDialog(resolution, prompter, output) {
62
- const inlineDecisions = resolution.decisions.filter((d) => d.state === "inserted-inline");
62
+ // agent-coordination is inserted as its own top-level `## Agent Coordination`
63
+ // section (a verbatim canonical block, never promotable into Templates), NOT
64
+ // as a `### ` section inside `resolution.body` — so it is deliberately absent
65
+ // from the promotion dialog and from the section/decision count match below.
66
+ const inlineDecisions = resolution.decisions.filter((d) => d.state === "inserted-inline" && d.key !== "agent-coordination");
63
67
  // No applicable standards — pass through unchanged.
64
68
  if (inlineDecisions.length === 0) {
65
69
  return { resolution, promotions: [] };
@@ -124,6 +128,9 @@ function checkNoUnfilledMarkers(content, file) {
124
128
  if (content.includes(STANDARDS_BLOCK_MARKER)) {
125
129
  throw new WriterError(`Internal error: ${file} still contains ${STANDARDS_BLOCK_MARKER} after standards substitution.`);
126
130
  }
131
+ if (content.includes(AGENT_COORDINATION_BLOCK_MARKER)) {
132
+ throw new WriterError(`Internal error: ${file} still contains ${AGENT_COORDINATION_BLOCK_MARKER} after agent-coordination substitution.`);
133
+ }
127
134
  if (content.includes(AGENTS_BODY_MARKER)) {
128
135
  throw new WriterError(`Internal error: ${file} still contains ${AGENTS_BODY_MARKER} after AGENTS body substitution.`);
129
136
  }
@@ -216,6 +223,7 @@ export async function writeScaffold(inputs, targetPath, opts = {}) {
216
223
  }
217
224
  const claudeFile = files[claudeIdx];
218
225
  let claudeContent = applyStandardsBlock(claudeFile.content, resolution);
226
+ claudeContent = applyAgentCoordinationBlock(claudeContent, resolution);
219
227
  claudeContent = claudeContent.replace(AGENTS_BODY_MARKER, agentsBody);
220
228
  checkNoUnfilledMarkers(claudeContent, "CLAUDE.md");
221
229
  files[claudeIdx] = { path: claudeFile.path, content: claudeContent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zero2webmaster/starter-kit",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Node CLI to scaffold new Z2W projects from canonical Templates + AGENTS.md.",
5
5
  "author": {
6
6
  "name": "Dr. Kerry Kriger",