@w2bagency/content-loop
v0.5.0
Published
The **W2B SEO Kit** — a structure-agnostic, additive layer applied onto any migrated Astro client repo. It delivers the deterministic CI gate, the Code/Git content adapter, the `.w2b/context/` scaffold, the `.claude/` commands, and the onboarding prompt s
Readme
@w2bagency/content-loop
The W2B SEO Kit — a structure-agnostic, additive layer applied onto any migrated Astro client
repo. It delivers the deterministic CI gate, the Code/Git content adapter, the .w2b/context/
scaffold, the .claude/ commands, and the onboarding prompt so the SEO specialist can run the
5A/5B content loop (SEO/GEO/AEO) on a client via Claude Code web — branch → preview → review → merge.
First incarnation of the deferred content-loop product, via the Astro/Git adapter.
What's in here
- Library (
src/) — published to npm; thew2b-gatebinary is fetched on-demand by CI viapnpm dlx(never a client-site dependency):payload/canonical.ts— canonical post payload (zod, mirrorslanding/keystatic.config.ts).context/—SiteMaptype +parseSiteMap(the per-client structure description).adapter/code-git.ts— structure-agnostic adapter:listPosts/readPost/writeDraft, driven entirely bysite-map.md(never hardcodes paths or field names). Resolves per-post locale.gate/— five deterministic validators (frontmatter limits, hreflang parity, cannibalization, JSON-LD schema shape,.w2b/contextfreshness) + therunGateorchestrator.baseline/gsc-snapshot.ts— GSC baseline serializer (proof-of-ROI snapshot).cli/gate.ts— thew2b-gatebinary (gate run +--emit-treehash).
templates/— the thin scaffold copied ONCE into a client repo at onboarding (.claude/,.w2b/,data/, baseline GEO files, the GitHub Actions workflow,.mcp.json.tpl,.npmrc.tpl).
Apply to a client repo
pnpm exec w2b-onboard(the onboarding prompt) walks the repo once and commits.w2b/context/.- Copy
templates/.npmrc.tpl→.npmrcin the client repo root. This maps the@w2bagencyscope to public npm (https://registry.npmjs.org) — no auth token required. Do NOT add@w2bagency/content-loopto the site'spackage.json— the package is CI tooling, not a site dependency. The.npmrcis harmless to Vercel: because nopackage.jsonentry depends on the@w2bagencyscope, Vercel never fetches from that registry. - Copy
templates/.github/workflows/w2b-gate.yml. CI fetchesw2b-gateon-demand viapnpm dlxfrom public npm (no secrets needed) and runs it on every PR.@w2bagency/content-loopis never installed into the client site'snode_modulesand never reaches the Vercel build.
Local dev
pnpm install
pnpm test # vitest — 40 tests
pnpm typecheck
pnpm build # emits dist/, including the w2b-gate bin
node dist/cli/gate.js <path-to-client-repo> # run the gate
node dist/cli/gate.js --emit-treehash "<blog-glob>" # canonical treeHashHard rule
@w2bagency/site-audit-mcp-style discipline: never hardcode a client's blog path or frontmatter
key names — always go through SiteMap. The canonical payload mirrors keystatic; if they diverge,
keystatic wins and this mirror is updated. A green gate means "structure is clean", not "publishable"
— human E-E-A-T sign-off is still required before merge.
