# Capsulang Pattern Library

The pattern library is Capsulang's equivalent of a standard library for agentic workflows. It gives agents a small set of known-good workflow shapes instead of forcing every model to invent states, effects, surfaces, and persistence from scratch.

## Included patterns

- `regulated-deployment-approval` — deployment change approval with risk review, security/manager approval, deploy/rollback intents, A2UI surfaces, and replayable state.
- `access-change-approval` — auditable access provisioning workflow with manager/security approval and provision/revoke effect intents.
- `claim-review` — claims-before-facts review workflow with semantic projection.
- `policy-exception-approval` — compact policy waiver workflow with approve/reject/expire states.

## CLI

```bash
caps patterns list --json
caps patterns show access-change-approval --template --json
caps new access-change-approval --out access_change.caps
```

## Pattern metadata

Each pattern exposes:

```text
id
name
category
summary
useWhen
capabilities
exampleFile
firstCommands
template, when requested
```

## Why this matters

Capsulang is most useful for stateful, auditable workflows. The library-first surface makes that practical for Codex, Claude Code, and other agents that were not pretrained on the language.
