/atproto-skills:atproto-attestationfrom atproto-skills
Implements, debugs, and audits AT Protocol record attestations per badge.blue spec — inline ECDSA signatures or remote strongRef proof records — in Rust, TypeScript, and Go. Covers CID-first signing, low-S normalization, and per-language library choices.
Ships in atproto-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
CID-first record attestations as specified at https://badge.blue/ and implemented in the atproto-attestation Rust crate. This skill routes to per-language guides for Rust, TypeScript, and Go, sitting on top of a language-neutral spec in shared/.
An attestation binds a cryptographic or content-addressed claim to a specific record in a specific repository:
0x71 (dag-cbor), hash 0x12 (SHA-256), 32-byte digest, 36-byte binary form. Computed over a canonical merge of record (without signatures) + $sig metadata (without cid/signature, with repository inserted).record.signatures[] alongside the metadata.signatures[] carries a com.atproto.repo.strongRef pointing at the proof record.Full normative rules: shared/spec.md. Step-by-step CID procedure: shared/cid-computation.md. Inline flow: shared/inline-attestation.md. Remote flow: shared/remote-attestation.md. Signature normalization: shared/signature-normalization.md. Fixtures: shared/test-vectors.md. Cross-language differences: shared/divergence-matrix.md.
Before generating or reviewing any attestation code, determine the target language from project files:
Cargo.toml, *.rs, any mention of atproto-attestation / atproto-identity / k256 / p256 → Rust — read from rust/. The reference crate lives here.package.json, tsconfig.json, *.ts, *.tsx, imports of @noble/curves / @ipld/dag-cbor / multiformats → TypeScript — read from typescript/.go.mod, *.go, imports of github.com/ipfs/go-cid / github.com/ipld/go-ipld-prime / github.com/decred/dcrd/dcrec → Go — read from go/.Prefer the file being edited over the repo root when they disagree.
If multiple languages are present and the task does not point at one unambiguously, ask which one applies. Never mix attestation libraries across languages in generated code.
For an unsupported language (Python, Java, Elixir, Swift, …), point the user at shared/spec.md and the Rust crate as the reference implementation to transliterate from.
For every attestation task:
shared/spec.md for the normative rules (terminology, record shapes, verification order, known gaps).shared/cid-computation.md. Every non-trivial implementation bug in this space is at this step.shared/inline-attestation.md.shared/remote-attestation.md.shared/signature-normalization.md.{lang}/README.md{lang}/creating.md{lang}/verifying.md{lang}/signatures.mdshared/divergence-matrix.md when porting between languages or reviewing cross-stack interop.Always prefer the reference crate (Rust) or the primitive libraries called out in each {lang}/README.md over hand-rolling. Never guess function names — read the relevant file, and if a detail is missing, consult live docs (docs.rs, npm, pkg.go.dev) rather than inventing.
Neither the raw record nor the metadata alone — the ECDSA signature is over the 36-byte binary content CID of a canonical merge:
record' = record without `signatures`
meta' = metadata without `cid` / `signature`, with `repository` inserted
merged = record' ∪ { "$sig": meta' }
content_cid = CIDv1(dag-cbor, SHA-256(DAG-CBOR(merged)))
signature = ECDSA_sign(private_key, content_cid.bytes)
repository participates in the CID but NOT in the stored attestation. This gives replay protection: the same record + metadata signed for did:plc:A produces a different CID than for did:plc:B, so a signature made for one repo cannot be reused in another.
| Trait | Inline | Remote |
|---|---|---|
| Cryptographic | Yes — ECDSA signature in the record | No — integrity by content-address + strongRef |
| Records involved | 1 (subject only) | 2 (subject + proof, usually in different repos) |
signatures[] entry | metadata object with cid and signature.$bytes | com.atproto.repo.strongRef with uri + cid |
| Verifier needs | public key resolution | record resolver (AT-URI fetch) |
| Revocation | immutable once signed | delete proof record → unreachable |
shared/inline-attestation.md and shared/remote-attestation.md cover each in full.
Remote attestations involve two distinct CIDs and confusing them is the most common bug:
| CID | Where it's stored | What it identifies |
|---|---|---|
| Content CID | Inside the proof record's cid field | The signing payload (record + $sig) |
| Proof CID | Inside the strongRef's cid field | The proof record itself (plain DAG-CBOR) |
Always verify both. See shared/remote-attestation.md §two-CIDs.
| Curve | Reference crate (Rust) | TypeScript (@noble/curves) | Go (crypto/ecdsa + dcrec) |
|---|---|---|---|
| P-256 | ✅ full | ✅ full | ✅ full (low-S manual) |
| K-256 | ✅ full | ✅ full | ✅ full (dcrec low-S default) |
| P-384 | ⚠️ normalize_signature returns UnsupportedKeyType | ✅ full, but interop broken | ✅ full, but interop broken |
Interop rule: use P-256 or K-256 only. P-384 does not round-trip through the reference crate. See shared/signature-normalization.md §curve-coverage.
Separate these steps in your code. Keep policy checks (is this issuer authorized? is the attestation fresh?) outside — they're application concerns above the crypto.
Draw from each shared/*.md §common-mistakes and shared/divergence-matrix.md. The high-impact ones:
bafyrei…) instead of the 36-byte binary CID. Silent interop break — implementations that hash cid.bytes don't verify signatures made over the string form.repository in the stored attestation. It's only a transient input to CID computation; it must not appear in signatures[] entries. Reference implementations strip it; hand-rolled ones often don't.signatures from the record before CID computation. Every new signature re-signs a stripped version, so all prior signatures stay valid. Skip the strip and all signatures invalidate each other.cid / signature from metadata before CID computation. These fields are outputs, not inputs. Including them on re-verify produces a different CID.r‖s (64 bytes for P-256/K-256). Convert if needed.signature.$bytes. Spec uses standard base64 (+// + padding). URL-safe (-/_) decodes to different bytes for 62/63 code points.fxamacker/cbor without CoreDetEncOptions (Go), hand-rolled CBOR, or generic CBOR libraries produce different bytes than DAG-CBOR. Use strict DAG-CBOR libraries only.cid? The reference crate does not; the TS and Go guides in this skill do by default. Pass verifyProofCid: false / VerifyProofCid: false to match reference semantics exactly.repository come from at verify time? The DID of the repo you fetched the record from. Hardcoding it or using a stale value silently invalidates every inline signature.signatures stripped, so all prior signatures remain valid when new ones are appended.Prefer these MCP tools when the goal is to compute or validate CIDs as part of a composite workflow rather than teach an implementation how:
lexicon-garden → create_record_cid(record_json) for the underlying DAG-CBOR CID primitive, invoke_xrpc for com.atproto.repo.putRecord / getRecord.atpmcp → create_record_cid, get_record, invoke_xrpc against a local PDS for development.Note: neither MCP currently exposes a badge.blue-specific create_attestation or verify_attestation tool — the content-CID pipeline (record + $sig(repository)) is attestation-specific and must be implemented per-language as described in the guides. The MCPs are useful for the raw CID step inside that pipeline and for publishing the resulting records.
atproto-attestation/
├── SKILL.md # this file — router
├── shared/
│ ├── spec.md # normative attestation rules
│ ├── cid-computation.md # content-CID procedure (bit-exact)
│ ├── inline-attestation.md # inline flow + record shape
│ ├── remote-attestation.md # remote flow + two-CID model
│ ├── signature-normalization.md # low-S rules, P-384 gap
│ ├── test-vectors.md # fixtures catalog
│ └── divergence-matrix.md # cross-language differences
├── rust/
│ ├── README.md # reference crate setup, API map
│ ├── creating.md # create_inline / create_remote / append
│ ├── verifying.md # verify_record + resolver impls
│ └── signatures.md # sign / validate / normalize_signature
├── typescript/
│ ├── README.md # library stack + idioms
│ ├── creating.md # computeContentCid + create flows
│ ├── verifying.md # verifier + resolver impls
│ └── signatures.md # noble curves + low-S
└── go/
├── README.md # stdlib + dcrec + go-ipld-prime
├── creating.md # ComputeContentCID + create flows
├── verifying.md # VerifyRecord + resolvers
└── signatures.md # stdlib ecdsa + dcrec + P1363
shared/spec.md, shared/cid-computation.md, shared/inline-attestation.md, shared/remote-attestation.md, shared/signature-normalization.md, shared/test-vectors.md, shared/divergence-matrix.mdrust/README.md, rust/creating.md, rust/verifying.md, rust/signatures.mdtypescript/README.md, typescript/creating.md, typescript/verifying.md, typescript/signatures.mdgo/README.md, go/creating.md, go/verifying.md, go/signatures.mdgo/README.md (opens in a new tab)go/creating.md (opens in a new tab)go/signatures.md (opens in a new tab)go/verifying.md (opens in a new tab)rust/README.md (opens in a new tab)rust/creating.md (opens in a new tab)rust/signatures.md (opens in a new tab)rust/verifying.md (opens in a new tab)shared/cid-computation.md (opens in a new tab)shared/divergence-matrix.md (opens in a new tab)shared/inline-attestation.md (opens in a new tab)shared/remote-attestation.md (opens in a new tab)shared/signature-normalization.md (opens in a new tab)shared/spec.md (opens in a new tab)shared/test-vectors.md (opens in a new tab)typescript/README.md (opens in a new tab)typescript/creating.md (opens in a new tab)typescript/signatures.md (opens in a new tab)typescript/verifying.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Rust, TypeScript, Go
atproto, badge-blue, ecdsa-signatures, cid-signing, record-attestation
npx claudepluginhub ngerakines/atproto-skills --plugin atproto-skills7 skills in this plugin
/atproto-cidThis skill should be used when the user is working with AT Protocol or DASL CIDs (Content Identifiers) in Rust, TypeScript, or Go — parsing, constructing, validating, verifying, or debugging them. Triggers on phrases like "parse a CID", "compute a CID for this record", "verify a blob CID", "why is this CID invalid", "CID mismatch", "tag 42 in DAG-CBOR", "identity multibase prefix", "the $link format", "base32lower", "digest length error", "what does the b prefix mean", "CIDv1 vs CIDv0", "bafyrei / bafkrei prefix", "dag-cbor codec", "multihash", "BLAKE3 CID", "BDASL". Also triggers on dependency/import names like `atproto-dasl`, `cid`, `multihash-codetable`, `libipld`, `multiformats`, `@ipld/dag-cbor`, `CID.parse`, `CID.create`, `github.com/ipfs/go-cid`, `go-multihash`, or lockfile names `Cargo.toml`, `package.json`, `pnpm-lock.yaml`, `go.mod`, `go.sum`. Covers the strict DASL CID profile (CIDv1 only, codec raw 0x55 or dag-cbor 0x71, hash SHA-256 0x12, 32-byte digest, base32lower string form with 'b' prefix, 36-byte binary form), the BDASL extension permitting BLAKE3 (0x1e) for large-file content, the DAG-CBOR wire form (CBOR tag 42 plus identity multibase 0x00 prefix), and the AT Protocol JSON `{"$link": "..."}` form. Use this skill to implement CID support in SDKs, clients, servers, firehose consumers, repo tooling, or diagnostic scripts in any of the three supported languages; for an unsupported language point at `shared/spec.md` and a reference implementation. Does NOT cover general IPFS / multiformats CID questions (DASL is a strict subset — reject anything outside the allowed constants); for MST tree traversal, CAR inspection, or DAG-CBOR canonicalization beyond the CID tag see `atproto-repository`./atproto-identity-resolutionThis skill should be used when the user is resolving, validating, parsing, or debugging AT Protocol identities in Rust, TypeScript, or Go — handles (domain-name usernames like `alice.bsky.social`) and DIDs (`did:plc:…`, `did:web:…`, `did:webvh:…`). Triggers on phrases like "resolve a handle", "why does my handle return 404", "DNS TXT `_atproto.`", "`/.well-known/atproto-did`", "bidirectional verification", "handle.invalid", "`alsoKnownAs` not matching", "DID document", "atproto_pds service endpoint", "signing key multikey", "my PDS location is wrong", "can't find PDS endpoint", "did:web vs did:plc", "com.atproto.identity.resolveHandle", "rotation key", "handle resolution mismatch". Also triggers on dependency/import names like `atproto-identity` (Rust crate), `@atproto/identity`, `@atproto-labs/handle-resolver`, `@atproto/syntax`, `ensureValidHandle`, `ensureValidDid`, `IdResolver`, `HandleResolver`, `DidResolver`, `github.com/bluesky-social/indigo/atproto/identity`, `indigo/atproto/syntax`, `syntax.ParseHandle`, `syntax.ParseDID`, `identity.DefaultDirectory`, `identity.BaseDirectory`, `LookupHandle`, `LookupDID`, `HickoryDnsResolver`, or lockfile names `Cargo.toml`, `package.json`, `pnpm-lock.yaml`, `go.mod`, `go.sum`. Covers handle syntax rules and reserved TLDs; DNS TXT + HTTPS well-known handle resolution (concurrent, with conflict handling); input normalization (`at://`, `@` prefixes); DID method selection (plc, web, webvh — webvh is validated by all three reference libraries but not resolved: none of them ship a log verifier, and all three reject webvh inputs at fetch time rather than silently falling back); DID document requirements (handle binding in `alsoKnownAs`, `Multikey` with `#atproto` suffix, `AtprotoPersonalDataServer` service); bidirectional verification; `handle.invalid` semantics; caching guidance. Use to implement handle/DID resolvers, client-side auth onboarding, AppView handle lookups, PDS handle-change flows, or diagnostic tooling. Does NOT cover did:plc operation log format, key rotation cryptography, OAuth (see `atproto-oauth`), record CID computation (see `atproto-cid`), repo/MST traversal (see `atproto-repository`), or parsing `at://` URIs *inside records* (see `atproto-lexicon` — this skill covers identity-side `at://` normalization only)./atproto-lexiconThis skill should be used when the user is authoring, validating, or invoking AT Protocol lexicons in Rust, TypeScript, or Go — the JSON schema layer that governs record shapes and XRPC methods. Triggers on phrases like "lexicon", "lexicon doc", "LexiconDoc", "NSID", "defs", "$type", "$type dispatch", "main def", "open union", "closed union", "knownValues", "enum", "strongRef", "blob ref", "cid-link", "record-key", "rkey", "tid", "at-uri", "at://<did>/<collection>/<rkey>", "record validation", "assertValidRecord", "ValidateRecord", "validate_record", "query", "procedure", "subscription", "XRPC", "XRPC method", "invoke XRPC", "xrpc call", "params", "parameters", "input.schema", "output.schema", "subscription frame", "MessageFrame", "ErrorFrame", "firehose consumer", "Jetstream", "lex-cli", "gen-api", "gen-server", "lexgen", "cbor-gen", "backward-compat", "breaking change", "add optional field", "closed union evolution", "InvalidRequest", "XRPCError", "XRPCInvalidResponseError", "AuthRequiredError", "RateLimitExceeded". Also triggers on dependency/import names like `atproto-lexicon`, `atproto-client`, `atproto-record`, `atproto-jetstream`, `@atproto/lexicon`, `@atproto/xrpc`, `@atproto/xrpc-server`, `@atproto/api`, `@atproto/lex-cli`, `@atproto/syntax`, `indigo/atproto/lexicon`, `indigo/atproto/data`, `indigo/atproto/syntax`, `indigo/xrpc`, `indigo/api/atproto`, `indigo/api/agnostic`, `indigo/events`, `indigo/lex/util`, or API names like `BaseCatalog`, `Lexicons`, `XrpcClient`, `AtpAgent`, `createServer`, `streamMethod`, `ResolvingCatalog`, `DefaultLexiconResolver`, `RepoGetRecord`, `RepoCreateRecord`, `HandleRepoStream`, `RepoStreamCallbacks`, `LexiconTypeDecoder`, `BlobRef`, `DataValue`. Use this skill to author a new lexicon, run a validator against records (strict on write, lenient on read), call any `com.atproto.*` XRPC method, consume the firehose, stand up an XRPC server, or plan a backward-compatible lexicon change. Covers lexicon document structure, NSID grammar, AT-URI shape inside records, `$type` dispatch, strongRef vs. blob refs, XRPC HTTP/WebSocket wire format, validation strictness modes, and the backward-compat change matrix. Does NOT cover CID parsing/construction (see `atproto-cid`), DID resolution / handle lookup (see `atproto-identity-resolution`), CAR / MST / commit signing at the repo layer (see `atproto-repository`), OAuth token flows / DPoP (see `atproto-oauth`), Bluesky-domain record idioms (`app.bsky.*` facets, richtext, embeds, threadgates, labels — out of scope for this plugin entirely; point users at the Bluesky appview or `@atproto/api` docs)./atproto-oauthThis skill should be used when the user is implementing, auditing, or debugging AT Protocol OAuth in Rust, TypeScript, or Go — covering confidential backend (BFF) clients, public SPA clients, native desktop clients, the authorization flow (PAR / DPoP / PKCE), client metadata publication, permission / scope design, refresh token handling, session storage, and server-side DPoP validation. Triggers on phrases like "OAuth client metadata", "client_id as URL", "private_key_jwt", "dpop_bound_access_tokens", "dpop_signing_alg_values_supported", "PAR", "pushed authorization request", "request_uri", "DPoP proof", "DPoP nonce", "use_dpop_nonce", "invalid_dpop_proof", "ath claim", "htu", "htm", "jkt", "jwk thumbprint", "refresh token race", "token rotation", "invalid_grant", "access_denied", "state store", "session store", "requestLock", "oauth/authorize", "oauth/callback", "oauth/token", "oauth/par", "oauth/revoke", ".well-known/oauth-protected-resource", ".well-known/oauth-authorization-server", "permission-set", "transition:generic", "transition:email", "atproto scope", "account:email", "identity:handle", "repo:*", "blob:*", "rpc:*", "include:", "iss parameter", "RFC 9449", "RFC 9126", "RFC 7636", "RFC 7523", "RFC 9207", "OAuth 2.1", "SameSite=Lax for OAuth", "confidential client", "public client", "BFF pattern", "SPA OAuth", "app password migration". Also triggers on dependency/import names like `atproto-oauth`, `@atproto/oauth-client-node`, `@atproto/oauth-client-browser`, `@atproto/oauth-client`, `@atproto/oauth-types`, `@atproto/jwk-jose`, `indigo/atproto/auth/oauth`, `NodeOAuthClient`, `BrowserOAuthClient`, `ClientApp`, `ClientSession`, `ClientAuthStore`, `OAuthClient`, `OAuthRequestStorage`, `DpopRetry`, `validate_dpop_jwt`, `auth_dpop`, `request_dpop`, `StartAuthFlow`, `ProcessCallback`, `ResumeSession`, `JoseKey`. Use this skill to build a login/callback/refresh/logout flow, publish a `/oauth-client-metadata.json` document, implement a pre-flow `state` store or post-flow session store, design permission sets, set up DPoP on resource requests, or debug token/DPoP failures. Covers identity verification (`sub` DID → DID doc → PDS → AS match), session-cookie hardening (SameSite=Lax, HttpOnly, encryption at rest), refresh-race mitigation, multi-node BFF lock patterns, SSRF hardening on metadata fetches, and cross-language differences between the three reference implementations. Does NOT cover DID / handle resolution in depth (see `atproto-identity-resolution`), CAR / MST / commit signing (see `atproto-repository`), CID parsing (see `atproto-cid`), lexicon-level record validation or XRPC method invocation beyond OAuth (see `atproto-lexicon`), or app-password flows (a separate, legacy mechanism being deprecated in favor of OAuth)./atproto-publish-lexiconThis skill should be used when the user is publishing an AT Protocol lexicon as a `com.atproto.lexicon.schema` record on the network, or resolving such a record back to a lexicon document. Triggers on phrases like "publish my lexicon", "publish lexicon to PDS", "lexicon publication", "lexicon registry", "schema registry", "who owns this NSID", "NSID authority", "`_lexicon.` TXT record", "lexicon DNS record", "lexicon resolution", "resolve an NSID to a lexicon", "describe_lexicon", "`com.atproto.lexicon.schema`", "putRecord lexicon", "createRecord lexicon", "lexicon revision", "lexicon versioning", "publish NSID", "how do clients fetch my lexicon", "rkey is the NSID". Also covers error surfaces like "InvalidRecord" when publishing a lexicon, the `rkey = <full NSID>` convention, and the authority-to-DID binding that gates resolution at consumer time. Uses the `lexicon-garden` and `atpmcp` MCP tools (`validate_lexicon`, `check_compatibility`, `create_record_cid`, `invoke_xrpc`, `describe_lexicon`, `get_record`) rather than hand-rolled validators. Does NOT cover authoring the lexicon JSON document, catalog loading, codegen, or client-side record/XRPC validation (see `atproto-lexicon`); DID/handle resolution internals or the `_atproto.` TXT record (see `atproto-identity-resolution`); CAR/MST/commit signing (see `atproto-repository`); CID computation internals (see `atproto-cid`); or Bluesky-domain (`app.bsky.*`) lexicons (out of scope for this plugin)./atproto-repositoryThis skill should be used when the user is constructing, parsing, exporting, importing, or signature-validating an AT Protocol user repository in Rust, TypeScript, or Go — the durable per-account record store represented as a Merkle Search Tree inside a signed commit, serialized on the wire as a CAR v1 file. Triggers on phrases like "CAR file", "CAR v1", "car export", "com.atproto.sync.getRepo", "com.atproto.sync.getBlocks", "listMissingBlocks", "subscribeRepos", "repo export", "MST", "Merkle Search Tree", "MST node", "tree entry", "left subtree", "fanout", "prefix compression", "key height", "repo commit", "commit signature", "sig field", "signing bytes", "UnsignedCommit", "commit version 3", "rev TID", "prev commit", "DAG-CBOR", "DRISL", "canonical CBOR", "map key ordering", "tag 42", "block store", "block CID mismatch", "verify repo", "inductive verification", "prevData", "record CID in MST", "at://<did>/<collection>/<rkey>". Also triggers on dependency/import names like `atproto-repo`, `atproto-dasl`, `atproto-record`, `@atproto/repo`, `@atproto/lex-cbor`, `@atproto/lex-data`, `@atproto/crypto`, `indigo/atproto/repo`, `indigo/atproto/repo/mst`, `indigo/atproto/atdata`, `github.com/ipld/go-car`, `go-block-format`, `cbor-gen`, or API names like `LoadRepoFromCAR`, `VerifyCommitSignatureFromCar`, `VerifyCommitMessage`, `readCar`, `readCarWithRoot`, `verifyRepoCar`, `verifyDiffCar`, `signCommit`, `verifyCommitSig`, `Mst::insert_recursive`, `Tree.RootCID`, `MST.create`, `MST.load`, `DataDiff.of`. Use this skill to implement a repo reader, a repo writer, a commit signer/verifier, an MST diff tool, a CAR streaming parser, a firehose consumer, or to debug failures like "CID mismatch", "unknown codec in CAR", "MST node not found", "prefix_len exceeds previous key", "signature invalid", "prev null vs absent", "partial tree", "missing block", or "inverted tree root didn't match prevData". Covers DRISL (canonical DAG-CBOR) encoding rules, CAR v1 byte framing, MST structure (SHA-256 fanout 4, sorted entries, prefix compression, left subtree pointer), commit record fields and signing bytes, signature verification (including the `prev: null` vs omitted cross-implementation divergence), record placement (NSID + rkey), and cross-language interop. Does NOT cover CID parsing/construction (see `atproto-cid`), DID resolution / locating the signing key (see `atproto-identity-resolution`), lexicon-level record validation or XRPC method invocation or typed `$type` record dispatch (see `atproto-lexicon`), or OAuth (see `atproto-oauth`). Bluesky-domain record idioms (richtext facets, embeds) are out of scope for this plugin entirely.Other plugins' skills for the same job