Use Pegma with your coding agent

Pegma is assembled, not hand-installed: you teach your agent — Claude Code, Cursor, Codex, Grok Build, or anything that reads a markdown skill — how to compose @pegma/* packages, and it does the wiring. Two steps, an optional third, then a first prompt.

An untrained agent will regenerate sessions, identity, and rate limits from scratch. A trained one composes tested packages and pins exact versions. The whole difference is one markdown file and one JSON URL.

1. Install the assembly skill

The skill is a short judgment document — assemble over generate, explicit composition root, refusals as hard constraints. It deliberately holds no package versions; those live in the catalog (step 2). There is no universal skill registry, so use whichever path your tool supports. The document is plain markdown either way: https://pegma.dev/skill.md

Skills directory (Claude Code, Grok Build, and similar)

Tools in this family treat a project directory containing SKILL.md (with YAML frontmatter — keep it) as an installable skill. From your project root:

mkdir -p .claude/skills/pegma
curl -fsSL https://pegma.dev/skill.md -o .claude/skills/pegma/SKILL.md
mkdir -p .grok/skills/pegma
curl -fsSL https://pegma.dev/skill.md -o .grok/skills/pegma/SKILL.md
mkdir .claude\skills\pegma
curl -fsSL https://pegma.dev/skill.md -o .claude\skills\pegma\SKILL.md
mkdir .grok\skills\pegma
curl -fsSL https://pegma.dev/skill.md -o .grok\skills\pegma\SKILL.md
New-Item -ItemType Directory -Force .claude\skills\pegma
curl.exe -fsSL https://pegma.dev/skill.md -o .claude\skills\pegma\SKILL.md
New-Item -ItemType Directory -Force .grok\skills\pegma
curl.exe -fsSL https://pegma.dev/skill.md -o .grok\skills\pegma\SKILL.md

curl.exe on purpose: in Windows PowerShell 5.1, plain curl is an alias for Invoke-WebRequest and rejects these flags.

Tools that use a generic agent directory follow the same shape, for example .agents/skills/pegma/SKILL.md.

Rules file (Cursor, Codex, and similar)

If your tool reads project rules or custom instructions instead of a skills directory, paste the body of skill.md into that file — a Cursor project rule, an AGENTS.md, or the agent's system instructions. Keep the catalog URL in the text so the agent re-fetches facts instead of caching versions in the prompt.

Longer notes — plugin wrappers and per-tool details — are on the skill page.

2. Point at the catalog

https://pegma.dev/catalog.json is the machine-readable source of truth: components, exact npm pins when known, what each package owns and refuses, adapters, and recipe intents with fixture citations. The skill tells the agent to fetch it at the start of every assembly task — versions are never hardcoded in the skill, so a stale skill install cannot pin stale packages.

Nothing to configure here. Just don't defeat it: if you paste the skill into a rules file, leave the catalog URL intact.

3. Optional: wire the MCP server

The same catalog facts are available as MCP tools over Streamable HTTP at https://pegma.dev/api/mcp — public reads, no auth, no private data plane. Useful when your agent prefers tool calls over fetching JSON:

{
  "mcpServers": {
    "pegma": {
      "url": "https://pegma.dev/api/mcp"
    }
  }
}

Clients without native remote MCP can proxy with npx mcp-remote https://pegma.dev/api/mcp. Tool list and details are on the skill page. Skipping this step is fine — the catalog URL alone is enough.

4. Assemble something

Hand your agent a real task. A good first prompt:

Assemble a Cloudflare Worker with passkey accounts using Pegma.
Fetch https://pegma.dev/catalog.json first. Pin exact versions.
Do not invent passwords.

That exercises the whole path: the skill's judgment, the catalog's pins, a green recipe (accounts on a Cloudflare-shaped host), and a refusal — Identity is passkeys-first and refuses passwords outright.

Two starting points, both CI-tested:

Related: skill install notes · catalog.json · examples · the stack · llms.txt