Atproto

From maragudk/fabrik · View interactive version

Atproto is an AI agent skill from the GitHub repository maragudk/fabrik. Guide for building on the AT Protocol (the "atmosphere") -- authoring Lexicons, building app views, consuming the firehose, working with identity (DIDs, handles), repositories, records, XRPC endpoints, and OAuth. Use this skill whenever the user is building anything on atproto/Bluesky/the atmosphere

How to use this skill

Skill file

AT Protocol (atproto)

A guide for building on atproto -- the protocol behind Bluesky and the broader atmosphere of interoperable apps. This file is the overview and a router; deep details live in references/.

Mental model

atproto is a federated protocol where users own a signed, content-addressed data repository that any service can replicate. Apps are mostly app views -- services that consume the network firehose, validate records against a Lexicon schema, index them, and expose a read API. Writes go to the user's PDS via XRPC.

Five concepts to keep in your head:

Service roles

Real systems are made of four roles. An app you build is usually #3.

  1. PDS (Personal Data Server) -- hosts a user's repo, signing keys, blobs. Authenticates clients. One per user.
  2. Relay -- subscribes to many PDSes' firehoses and aggregates into one stream. Optimisation, not source of truth.
  3. App View -- subscribes to a relay, validates records, indexes them, exposes XRPC reads. Bluesky's timeline service is one. A "feed generator" is a thin specialised app view.
  4. Labeler -- emits signed labels (moderation/badge metadata) on URIs. Has its own DID and signing key.

What to read next

This SKILL.md is intentionally thin. For anything beyond a high-level question, jump to the right reference:

| You are doing | Read |

|---|---|

| Authoring a Lexicon (records, queries, procedures, subscriptions) | CODE0 |

| Lexicon style guide -- naming, conventions, design patterns | CODE0 |

| Working with DIDs, handles, AT URIs, NSIDs, TIDs, record keys | CODE0 |

| Calling XRPC endpoints, handling errors, auth, proxying | CODE0 |

| Reading repos, commits, MSTs, CAR files, the data model | CODE0 |

| Consuming the firehose / subscribeRepos, event framing | CODE1 |

| OAuth client implementation specifics | CODE0 |

| Designing an app view end-to-end (the most common task) | CODE0 |

| Picking a Go package from indigo, code sketches | CODE0 |

If a question spans several topics, start with app-view.md -- it stitches the others together.

Default stack for Markus's Go projects

The most common gotchas

These bite people the first time they build anything on atproto:

Spec index

<https://atproto.com/specs/atp> -- starting point for everything below.

| Spec | URL |

|---|---|

| Lexicon | <https://atproto.com/specs/lexicon> |

| Data model | <https://atproto.com/specs/data-model> |

| Repository | <https://atproto.com/specs/repository> |

| XRPC | <https://atproto.com/specs/xrpc> |

| Sync / firehose | <https://atproto.com/specs/sync> |

| Event stream framing | <https://atproto.com/specs/event-stream> |

| OAuth | <https://atproto.com/specs/oauth> |

| DIDs | <https://atproto.com/specs/did> |

| Handles | <https://atproto.com/specs/handle> |

| NSIDs | <https://atproto.com/specs/nsid> |

| TIDs | <https://atproto.com/specs/tid> |

| Record keys | <https://atproto.com/specs/record-key> |

| AT URI | <https://atproto.com/specs/at-uri-scheme> |

| Blobs | <https://atproto.com/specs/blob> |

| Labels | <https://atproto.com/specs/label> |

| Cryptography | <https://atproto.com/specs/cryptography> |

| Permissions | <https://atproto.com/specs/permission> |

| Accounts | <https://atproto.com/specs/account> |

Worked examples: Statusphere tutorial (TS), indigo services (Go), Bluesky's canonical Lexicons (the best style reference).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.