Skip to content
@pegma-dev

Pegma

machine-operated scaffold
Pegma

Composable, MIT-licensed components for building web applications — designed to be assembled and maintained by AI coding agents. pegma.dev

Important

Pegma is in early development. Published packages remain unstable 0.x APIs; adopters must pin exact versions and own their deployment review.

The idea

Most of what a site needs has been built ten thousand times: sessions, audit trails, persistence, cache, flags, billing, health probes, structured logging. Rebuilding them per project is expensive, and having an agent generate them from scratch each time is worse — thousands of lines of novel, unverified logic, different every run.

Pegma takes the other path. Each capability is an independent package with a typed contract and a published conformance suite. Building a site becomes assembly rather than generation: pick the components, wire them together at a composition root, and let the compiler and the conformance suites prove the wiring is correct. The hard logic is written once, verified once, and reused — not re-rolled per project.

Components

Package Purpose Status
@pegma/spine Shared identity, time, logging, and event contracts published
@pegma/storage-core Schema-agnostic persistence with declared collections published
@pegma/storage-azure-tables Azure Table Storage adapter published
@pegma/storage-cloudflare-d1 Cloudflare D1 adapter published
@pegma/storage-blobs Provider-neutral object (blob) storage port published
@pegma/storage-azure-blob Azure Blob Storage adapter published
@pegma/storage-cloudflare-r2 Cloudflare R2 adapter published
@pegma/storage-s3 AWS S3 / S3-compatible adapter published
@pegma/audit Append-only audit records published
@pegma/logger-tee Fan-out Spine Logger to multiple sinks published
@pegma/logger-applicationinsights Spine Logger to Application Insights published
@pegma/logger-cloudflare Spine Logger to Cloudflare Workers Logs published
@pegma/logger-datadog Spine Logger to Datadog logs published
@pegma/health Composable health probes and public liveness responses published
@pegma/sessions Server-side session records: hashed ids, dual expiry published
@pegma/authorization-core Permission and entitlement resolution published
@pegma/authorization-identity Verified Identity claims adapter published
@pegma/support-desk-contracts Ticket, message, requester, and event types published
@pegma/support-desk-core Ticket creation and workflow transitions published
@pegma/support-desk-application Customer services, collections, audit, and outbox published
@pegma/support-desk-templates Versioned notification templates published
@pegma/webhooks Inbound webhook receipts: dedup, quarantine, retention published
@pegma/rate-limit Honest two-tier request limiting published
@pegma/identity First-party identity: passkeys-first, no passwords published
@pegma/mail Transactional mail: an outbox that owns no store published
@pegma/cache-core Cache port published
@pegma/cache-conformance Conformance suite for cache adapters published
@pegma/cache-redis Redis adapter published
@pegma/cache-azure-redis Azure Cache for Redis adapter published
@pegma/cache-elasticache Amazon ElastiCache adapter published
@pegma/cache-upstash-redis Upstash Redis adapter published
@pegma/flags-contracts Shared flag contracts published
@pegma/flags-core Flag port published
@pegma/flags-static Static in-process flag adapter published
@pegma/flags-azure-appconfig Azure App Configuration adapter published
@pegma/flags-aws-appconfig AWS AppConfig adapter published
@pegma/flags-cloudflare-flagship Cloudflare Flagship adapter published
@pegma/flags-flagd flagd adapter published
@pegma/flags-launchdarkly LaunchDarkly adapter published
@pegma/billing-core Subscription ledger, not a payment processor published
@pegma/billing-stripe Stripe adapter published

Each component's docs/PROJECT_PLAN.md is the source of truth, and the pegma.dev roadmap compiles those plans at build time.

The 2026-07-28 Identity batch published @pegma/rate-limit@0.1.0, @pegma/mail@0.1.0, @pegma/identity@0.1.0, and the synchronized Authorization Core 0.1.2 package set containing @pegma/authorization-identity. @pegma/sessions@0.1.0 and the Storage Core 0.4.0 D1 adapter complete the composition now running on pegma.dev.

The 2026-07-29 Storage Blobs first release published @pegma/storage-blobs@0.1.0 with Azure Blob, Cloudflare R2, and S3 adapters at the same version (signed v0.1.0, trusted-publisher provenance).

The 2026-08-15 0.1.1 batch published @pegma/cache-core@0.1.1, @pegma/flags-core@0.1.1, and @pegma/billing-core@0.1.1 with their adapters and contracts. The sixteen public cache, flags, and billing packages are on npm at latest=0.1.1. 0.0.0 was bootstrap only.

Support Desk is published and usable. Its four packages — @pegma/support-desk-core, @pegma/support-desk-contracts, @pegma/support-desk-application, and @pegma/support-desk-templates — are on npm at latest=0.1.1. The 0.x API remains intentionally unstable. Email chain processing, help desk, issue tracking, and AI support bot integration remain later work.

Webhooks Phases 1–4 are complete. @pegma/webhooks@0.1.0 was published from a signed v0.1.0 tag with trusted-publisher provenance after validation in two real integrations: Stripe on RetireGolden and GitHub Releases on pegma.dev. Its 0.x API remains intentionally unstable.

Normal releases use repository workflows with short-lived OIDC authority and provenance attestations; no long-lived publish tokens exist. Sessions 0.1.0 is the documented legacy exception: its initial workflow failed before the npm name existed, so the exact artifact was published manually without provenance. Sessions releases from 0.1.1 onward use the hardened OIDC path.

Components share contracts through @pegma/spine and, where they persist anything, use @pegma/storage-core. Narrow sibling dependencies are added only when real consumers justify them—for example Identity composes Mail and Rate Limit—then pinned exactly and wired explicitly at the host boundary.

Design principles

  • Assembled by agents. Every decision optimizes for one question: how much context must a fresh agent read to make a correct change, and how does it know the change is correct? Minimize the first, mechanize the second.
  • Boring on purpose. Ordinary, idiomatic TypeScript. Novel structures make both humans and models worse at reading code.
  • Contracts are the joints. Components meet at typed interfaces, never at each other's internals. Swapping an implementation should not ripple.
  • Conformance suites are the specification. If a rule matters, it is a type or a test — not a paragraph someone has to remember.
  • Explicit wiring. No autodiscovery, no convention-based magic. The composition root is the map of the system.
  • Uniform by repetition. Every repository uses the same layout, scripts, and conventions, so that one worked example teaches all of them.

Provenance

The name is Latin, borrowed from Greek πῆγμα (from πήγνυμι, “to fasten together”): a framework of joined parts. In Roman amphitheatres the same word named a machine-operated scaffold — multi-stage wooden machinery raised and lowered by ropes and counterweights — that brought scenery and performers into view. Pegma is that kind of thing: independent pieces fastened together, raised into place by the agent that assembles them.

Pegma is developed by RetireGolden, LLC, which uses these components in production. The projects are deliberately not retirement-specific.

Popular repositories Loading

  1. support-desk support-desk Public

    A composable, open-source support queue for web and email.

    TypeScript 1

  2. spine spine Public

    Shared identity, time, logging, and event contracts for the Pegma component ecosystem.

    TypeScript

  3. .github .github Public

    Pegma organization profile.

  4. storage-core storage-core Public

    Schema-agnostic persistence for Pegma components: declared collections, optimistic concurrency, and a conformance suite.

    TypeScript

  5. authorization-core authorization-core Public

    Provider-neutral roles, entitlements, and permissions for Pegma components.

    TypeScript

  6. audit audit Public

    Shared append-only audit records for Pegma components.

    TypeScript

Repositories

Showing 10 of 21 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…