From d9952f182ce2dd7ad66c4fc4d1a683106314f758 Mon Sep 17 00:00:00 2001
From: Nathan Rover
Date: Wed, 29 Jul 2026 10:29:32 -0400
Subject: [PATCH 1/4] [3] Hosted Pegma assembly skill and install notes.
Publish skill.md at a stable public URL with judgment-only guidance (no package
version pins), plus a /skill install page and llms.txt/nav links.
---
docs/AGENT_ASSEMBLY_PLAN.md | 26 ++++++---
public/llms.txt | 9 +++
public/skill.md | 107 ++++++++++++++++++++++++++++++++++++
src/layouts/Base.astro | 1 +
src/pages/skill.astro | 77 ++++++++++++++++++++++++++
5 files changed, 213 insertions(+), 7 deletions(-)
create mode 100644 public/skill.md
create mode 100644 src/pages/skill.astro
diff --git a/docs/AGENT_ASSEMBLY_PLAN.md b/docs/AGENT_ASSEMBLY_PLAN.md
index b2e497a..ffe13fe 100644
--- a/docs/AGENT_ASSEMBLY_PLAN.md
+++ b/docs/AGENT_ASSEMBLY_PLAN.md
@@ -2,13 +2,12 @@
## Status
-**Stage:** Phase 2 complete for required fixtures (P1 + P2 under `recipes/`).
-No hosted skill or MCP surface yet. This document is the working plan for
-closing the gap between what AI coding agents tend to do (regenerate common
-backend functions as bespoke code) and what the Pegma stack already packages
-(typed, tested, pin-able components).
+**Stage:** Phase 3 complete (hosted assembly skill). No MCP surface yet.
+This document is the working plan for closing the gap between what AI coding
+agents tend to do (regenerate common backend functions as bespoke code) and
+what the Pegma stack already packages (typed, tested, pin-able components).
-**Phase 0–2 artifacts:**
+**Phase 0–3 artifacts:**
| Artifact | Path |
| --- | --- |
@@ -21,6 +20,8 @@ backend functions as bespoke code) and what the Pegma stack already packages
| Published catalog | `https://pegma.dev/catalog.json` (build emit) |
| P1 fixture (Northshelf accounts) | `recipes/cf-passkey-accounts/` |
| P2 fixture (Yard Loan outbox) | `recipes/storage-audit-mail-outbox/` |
+| Hosted assembly skill (raw) | `https://pegma.dev/skill.md` (`public/skill.md`) |
+| Skill install notes | `https://pegma.dev/skill` (`src/pages/skill.astro`) |
**Goal:** An agent given a short product description chooses the right
`@pegma/*` packages, respects their refusals, and wires them at an explicit
@@ -291,13 +292,24 @@ P3–P6 remain pending. Deferred D1–D2 still wait on package publication.
`/examples` indexes those recipes and quotes only fixture (or package
README) sources.
-### Phase 3 — Hosted skill
+### Phase 3 — Hosted skill ✓
Publish a stable skill document (URL + raw markdown) that encodes assembly
judgment and the lookup workflow. Provide short install notes for common
tools (project rules / skills directories / plugin snippets) without
pretending one universal skill registry exists.
+Shipped:
+
+| Surface | Path / URL |
+| --- | --- |
+| Skill markdown | `public/skill.md` → `https://pegma.dev/skill.md` |
+| Install notes | `src/pages/skill.astro` → `https://pegma.dev/skill` |
+| Index links | `public/llms.txt`, site nav |
+
+The skill teaches judgment only; versions and package sets stay in
+`catalog.json`.
+
**Exit:** a human can add the Pegma skill to a major coding agent in one
sitting; the skill does not hardcode package versions.
diff --git a/public/llms.txt b/public/llms.txt
index 43e3063..f8a9a76 100644
--- a/public/llms.txt
+++ b/public/llms.txt
@@ -74,6 +74,14 @@ status, design decisions, and non-goals.
- Schema and recipe backlog (source docs):
https://github.com/pegma-dev/pegma.dev/tree/main/docs/catalog
+## Assembly skill (agents)
+
+- [skill.md](https://pegma.dev/skill.md): short judgment skill — assemble over
+ generate, explicit composition root, treat refuses as hard constraints,
+ lookup catalog → component → green recipe → fixture. Does **not** hardcode
+ package versions; re-fetch the catalog. Install notes:
+ [https://pegma.dev/skill](https://pegma.dev/skill).
+
## Site
- [The stack](https://pegma.dev/stack): every component — owns, refuses,
@@ -83,6 +91,7 @@ status, design decisions, and non-goals.
- [Examples](https://pegma.dev/examples): composition recipes with CI-tested
fixtures under recipes/ (P1 accounts, P2 audit/mail outbox) plus snippets
lifted from package READMEs; each block cites its source.
+- [Skill](https://pegma.dev/skill): install notes for the assembly skill.
- [Account](https://pegma.dev/account): the static shell for pegma.dev's
D1-backed first-party Identity reference consumer. The Worker pins the exact
Identity, Authorization adapter, Sessions, Mail, rate-limit, and storage
diff --git a/public/skill.md b/public/skill.md
new file mode 100644
index 0000000..f5677a3
--- /dev/null
+++ b/public/skill.md
@@ -0,0 +1,107 @@
+---
+name: pegma
+description: >
+ Assemble hosts from Pegma MIT backend packages instead of regenerating
+ sessions, identity, rate limits, mail outboxes, audit trails, and similar
+ capabilities. Use when building or wiring first-party accounts, storage,
+ authorization, health, logging, or other Pegma composition.
+---
+
+# Pegma — assemble, do not regenerate
+
+Pegma is a family of MIT-licensed backend packages a **host application
+composes**. Governing principle:
+
+> Optimize for a fresh agent context window. Minimize what must be read to
+> make a correct change; mechanize how the change proves itself correct
+> (types and tests over prose).
+
+You assemble typed, pin-able packages. You do not re-implement their
+contracts as bespoke code on every project.
+
+## Hard rules
+
+1. **Assembly over generation.** Prefer `@pegma/*` for solved problems
+ (sessions, identity, rate limits, mail outbox, audit, storage, health,
+ spine contracts). Do not invent a parallel implementation.
+
+2. **Explicit composition root.** Wire packages once in an obvious place
+ (composition module / host bootstrap). No autodiscovery story.
+
+3. **Pin exact 0.x versions.** Never invent versions or ranges. Read
+ pins from the composition catalog (below). Early 0.x APIs are unstable.
+
+4. **Refusals are hard constraints.** Each component states what it
+ **refuses**. Treat refusals as part of the contract. Examples:
+ - Identity: **no passwords**
+ - Spine in-process bus: **not durable events**
+ - Mail / Audit: **own no store** — jobs and audit rows commit in the
+ **caller's** storage-core transaction
+
+5. **Unpublished packages are unusable for production assembly.** If the
+ catalog marks a package `published: false` or a component
+ `publishUsability: unpublished`, do not ship on it. Prefer a deferred
+ recipe or wait for publication.
+
+6. **Synthetic recipes only for copy-oriented examples.** Catalog and
+ `/examples` quote CI-tested fixtures and public package sources. Do not
+ copy commercial host route maps, tenancy models, or ops topology.
+
+7. **Prove with types and tests.** Do not paper over the compiler. Prefer
+ the package's conformance patterns and fixture tests over freehand
+ wiring.
+
+## Lookup workflow (progressive disclosure)
+
+Do **not** dump monorepos into context. Fetch the minimum for the next
+decision:
+
+1. **Catalog (facts)** — `https://pegma.dev/catalog.json`
+ Components, owns/refuses, deps, adapters, publish flags, exact npm
+ pins when known, recipe intents + fixture citations.
+
+2. **Component detail** — catalog entry → GitHub README / plan links
+ How to construct the package and what the host must provide.
+
+3. **Recipe** — catalog `recipes[]` with `fixture.status === "green"`
+ Synthetic intent + selected packages/adapters + anti-patterns.
+
+4. **Fixture source** — public path cited by the recipe
+ CI-tested composition code under `recipes/` on pegma.dev (or package
+ README/conformance). Quote that code; do not invent snippets.
+
+Index (short): `https://pegma.dev/llms.txt`
+Human stack pages: `https://pegma.dev/stack`
+Recipe index: `https://pegma.dev/examples`
+This skill (judgment only): `https://pegma.dev/skill.md`
+
+## How to assemble
+
+1. Restate the product intent in one paragraph (honest scope).
+2. Fetch `catalog.json`. Filter by `capabilityTags` / owns / refuses.
+3. Drop anything unpublished if the host needs production assembly.
+4. Match a green recipe when one fits; otherwise compose from component
+ entries with the same explicit-root discipline.
+5. Choose storage adapters for the host (e.g. Cloudflare D1 vs Azure
+ Tables vs memory for tests only). Memory is never a durability claim.
+6. Wire at one composition root: store → limiters / identity / sessions /
+ mail / audit actions as needed. Host owns HTTP, cookies, secrets, DNS,
+ UI, and provider ports.
+7. Pin versions from the catalog. Install those exact packages.
+8. Prove with `tsc` / tests. Prefer package conformance and recipe fixture
+ patterns.
+
+## What this skill does **not** hold
+
+- Full package encyclopedia (versions, owns lists, recipes) — **catalog**
+- UI framework religion (React vs Astro vs other) unless a fixture includes
+ a host shell
+- Commercial product architecture
+- An LLM “Pegma copilot” backend — reasoning stays in your agent; Pegma
+ returns structured, citable facts
+
+## When package facts change
+
+Update consumers by refreshing `catalog.json` (and its compile inputs).
+Do **not** hardcode package versions in this skill file. Re-fetch the
+catalog on each assembly task.
diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro
index aa8d04a..3c83cb5 100644
--- a/src/layouts/Base.astro
+++ b/src/layouts/Base.astro
@@ -13,6 +13,7 @@ const nav = [
{ href: '/stack', label: 'The stack' },
{ href: '/roadmap', label: 'Roadmap' },
{ href: '/examples', label: 'Examples' },
+ { href: '/skill', label: 'Skill' },
{ href: '/account', label: 'Account' },
];
---
diff --git a/src/pages/skill.astro b/src/pages/skill.astro
new file mode 100644
index 0000000..a6e9ff6
--- /dev/null
+++ b/src/pages/skill.astro
@@ -0,0 +1,77 @@
+---
+import Base from '../layouts/Base.astro';
+---
+
+
+
+ Agent skill
+
+ A short, stable skill that teaches agents to assemble Pegma
+ packages instead of regenerating sessions, identity, rate limits, mail, and
+ audit. Package inventories and versions live in
+ catalog.json — not in the skill.
+
+
+ Canonical raw markdown (copy or fetch):
+ https://pegma.dev/skill.md
+
+
+
+
+ Install notes
+
+ There is no single universal skill registry. Use whichever path your tool
+ supports; the document is plain markdown.
+
+
+ Project rules / skills directory
+
+ Copy the skill into the project agent directory under a name your tool
+ expects (examples: .grok/skills/pegma/SKILL.md,
+ .claude/skills/pegma/SKILL.md, .agents/skills/pegma/SKILL.md,
+ or a project AGENTS.md / rules file that points at the same text).
+
+ curl -fsSL https://pegma.dev/skill.md -o .grok/skills/pegma/SKILL.md
+# or
+curl -fsSL https://pegma.dev/skill.md -o .claude/skills/pegma/SKILL.md
+
+ Many tools treat a directory containing SKILL.md (with YAML
+ frontmatter) as an installable skill. Keep the frontmatter; do not strip it.
+
+
+ Paste into system / custom instructions
+
+ Open skill.md, copy the body into the agent’s
+ custom instructions or project rules. Prefer linking the catalog URL so the
+ agent re-fetches facts instead of caching versions in the prompt.
+
+
+ Plugin / marketplace wrappers
+
+ If your environment uses a plugin that only differs by install path, wrap
+ this same markdown. Do not fork package facts into the wrapper — point at
+ https://pegma.dev/catalog.json.
+
+
+
+
+ What the skill teaches
+
+ - Assembly over generation
+ - Explicit composition root; pin exact 0.x versions from the catalog
+ - Refusals as hard constraints
+ - Lookup: catalog → component → green recipe → fixture source
+ - Prove with types and tests
+
+
+ Related:
+ catalog.json ·
+ examples ·
+ llms.txt ·
+ stack
+
+
+
From b1940472f50035ae235322a8050a16155806ad5b Mon Sep 17 00:00:00 2001
From: Nathan Rover
Date: Wed, 29 Jul 2026 10:40:12 -0400
Subject: [PATCH 2/4] [3] Create skill parent directories in install curl
examples.
Document mkdir -p before writing SKILL.md so one-liner installs succeed on a
fresh checkout.
---
src/pages/skill.astro | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/pages/skill.astro b/src/pages/skill.astro
index a6e9ff6..6e6c1c0 100644
--- a/src/pages/skill.astro
+++ b/src/pages/skill.astro
@@ -34,8 +34,10 @@ import Base from '../layouts/Base.astro';
.claude/skills/pegma/SKILL.md, .agents/skills/pegma/SKILL.md,
or a project AGENTS.md / rules file that points at the same text).
- curl -fsSL https://pegma.dev/skill.md -o .grok/skills/pegma/SKILL.md
+ mkdir -p .grok/skills/pegma
+curl -fsSL https://pegma.dev/skill.md -o .grok/skills/pegma/SKILL.md
# or
+mkdir -p .claude/skills/pegma
curl -fsSL https://pegma.dev/skill.md -o .claude/skills/pegma/SKILL.md
Many tools treat a directory containing SKILL.md (with YAML
From 435a52ea4bfa5b7c7a5808a5e06d30c5b341a441 Mon Sep 17 00:00:00 2001
From: Nathan Rover
Date: Wed, 29 Jul 2026 10:51:10 -0400
Subject: [PATCH 3/4] [3] Keep header nav compact; surface skill links in the
footer.
Avoid a seventh header nav item on narrow viewports. Discoverability stays via
footer agent links, llms.txt, and /skill install notes.
---
docs/AGENT_ASSEMBLY_PLAN.md | 2 +-
src/layouts/Base.astro | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/docs/AGENT_ASSEMBLY_PLAN.md b/docs/AGENT_ASSEMBLY_PLAN.md
index ffe13fe..b864e3d 100644
--- a/docs/AGENT_ASSEMBLY_PLAN.md
+++ b/docs/AGENT_ASSEMBLY_PLAN.md
@@ -305,7 +305,7 @@ Shipped:
| --- | --- |
| Skill markdown | `public/skill.md` → `https://pegma.dev/skill.md` |
| Install notes | `src/pages/skill.astro` → `https://pegma.dev/skill` |
-| Index links | `public/llms.txt`, site nav |
+| Index links | `public/llms.txt`, footer agent links |
The skill teaches judgment only; versions and package sets stay in
`catalog.json`.
diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro
index 3c83cb5..33d52f2 100644
--- a/src/layouts/Base.astro
+++ b/src/layouts/Base.astro
@@ -13,7 +13,6 @@ const nav = [
{ href: '/stack', label: 'The stack' },
{ href: '/roadmap', label: 'Roadmap' },
{ href: '/examples', label: 'Examples' },
- { href: '/skill', label: 'Skill' },
{ href: '/account', label: 'Account' },
];
---
@@ -64,6 +63,13 @@ const nav = [
pegma-dev/pegma.dev — it deploys on
Cloudflare, the ecosystem's second reference environment.
+
+ Agents:
+ install skill ·
+ skill.md ·
+ catalog.json ·
+ llms.txt
+