Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/pubky/pubky-app/agents-mdgit clone --depth 1 https://github.com/pubky/pubky-appWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01657 | $0.01657 |
| Opus 5 | $0.00829 | $0.00829 |
| Sonnet 5 | $0.00331 | $0.00331 |
| Haiku 4.5 | $0.00166 | $0.00166 |
Grade A, and why
pubky-app AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 77 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pubky App
Decentralized social app. Tech stack in package.json.
Local-first architecture with Dexie (IndexedDB), Zustand, Next.js, Tailwind CSS, Shadcn UI.
Architecture
Layered architecture in src/core/ (see docs/architecture.md for full details):
UI (user actions) → Controllers → Application → Services → Models
Coordinators (system) ↗ ↓ ↓
Stores Pipes Database
Import modules through the path aliases in tsconfig.json (for example @/hooks/*, @/controllers/*, @/services/*, @/models/*, @/stores/*). Keep imports pointed at concrete source modules rather than aggregate re-export files.
Hard constraints
- Controllers NEVER call Services directly — go through Application
- Coordinators NEVER call Application — go through Controllers
- Application NEVER accesses Stores — only Controllers manage stores
- Pipes are pure — NO IO, NO side effects
- Only PostApplication, NotificationApplication, BootstrapApplication, MigrationApplication, HotApplication, PostStreamApplication, TtlApplication may call other Applications (max depth 1 by default; only PostApplication/NotificationApplication/TtlApplication → PostStreamApplication → FileApplication attachment persistence may reach depth 2; no cycles)
Controller naming
fetch*— network only, no cacheget*— local onlygetMany*— bulk local reads, returnsMap<Pubky, T>getOrFetch*— local first, network fallbackgetMany*OrFetch— bulk local first, fetch missing (e.g.,getManyTagsOrFetch)commitCreate*/commitUpdate*/commitDelete*— optimistic local write + network syncsubscribe*— long-lived live stream subscription (e.g., homeserver event streams), not a one-shot fetch
Errors
Use Err.* factories (never raw Error). Factories log automatically — don't double-log. See docs/error-handling.md.
Key conventions
- Composite post IDs:
author:postIdformat - Local-first writes: Dexie first, homeserver sync in background
- Shadcn First: always check for Shadcn equivalent before building custom UI
- Atomic design: atoms → molecules → organisms → templates
- Components: do not add
index.ts/index.tsxundersrc/componentsthat only re-export children; import concrete component files via@/atoms/*,@/molecules/*,@/organisms/*, or@/templates/*(for example@/atoms/Button/Button) - Config: import from
@/config/<module>(concrete files undersrc/config/). There is no aggregatesrc/config/index.ts. - App routes: import route enums, maps, and helpers from
@/app/routes(src/app/routes.ts); prefer that over route-only imports through a re-export entrypoint. - Z-index scale: -z-10, z-10, z-30, z-40, z-50, z-60 (see
docs/z-index.md) - Icons: stock Lucide from
lucide-react; custom/brand SVG components from@/icons(src/libs/icons/icons.tsxviatsconfigpath alias). URL→icon helpers (getIconFromUrl,getLabelFromUrl, …) live in@/libs/utils/urlToIcon— seedocs/components.md— Icons (Lucide and custom). - Visual regression tests (VRT): surfaces with a sibling
*.vrt.test.tsx(e.g.src/components/templates/Feed/Home/Home.vrt.test.tsx) have a pixel baseline checked in under__screenshots__/. When you change a UI surface, check whether a VRT exists next to it. If yes, the baseline likely needs regenerating — surface that to the user before reporting the task done. If you're touching a template-level surface that has no VRT yet, mention adding one as an option. The VRT harness lives insrc/test-utils/vrt.tsx; fixtures insrc/test/fixtures/; deterministic mocks insrc/test/mocks/. - Forms (standard): build new forms with
react-hook-form+zod(via@hookform/resolvers/zod). Wrap field components withController(use theControlledInputField/ControlledTextareaFieldmolecules where applicable). Keep the schema + types + defaults in a sibling*.types.tsfile next to the hook (seesrc/hooks/useCreateCollection/useCreateCollection.types.tsfor the canonical layout). Components must not call controllers directly — wrap the mutation in a hook (use{Action}Formoruse{Verb}{Entity}) that returns{ form, submit, reset, ... }, wheresubmit()returnsPromise<boolean>so the caller can decide what to do on success (a form hook may instead return the created entity id asPromise<string | null>when the caller needs to navigate to it, e.g.useCreateCollection). Non-text inputs (file pickers, rich text, etc.) live in their own dedicated hooks (e.g.useCoverImagePicker) and the form hook composes them. Schemas carry their user-facing validation messages as literal US English strings. - Memoization: do not add
useCallback/useMemo— the React Compiler (reactCompiler: trueinnext.config.ts) handles memoization. Reach for them only after profiling proves the compiler missed something. - Toasts: use
toast()from@/molecules/Toaster/use-toastwithvariant(default|error|warning|info). NoshowErrorToastwrappers orclassNamedestructive hacks. Seedocs/components.md— Toasts.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 77 lines · 1,657 tokens per session scan A 7e60d9030394
pubky-app AGENTS.md is an instructions file published in the GitHub repository pubky/pubky-app (23 stars, last pushed 5d ago), licensed MIT. It adds 1,657 tokens to every session, about $0.0083 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
pumpfun-bonkfun-bot CLAUDE.md
Instructions for chainstacklabs/pumpfun-bonkfun-bot, covering agent guide, ground rules, layout, naming inside learning-examples/ and commands.
evmole AGENTS.md
Instructions for cdump/evmole: EVMole extracts structured facts from deployed EVM runtime bytecode.
VaultysClaw CLAUDE.md
Instructions for vaultys/VaultysClaw, covering claude.md, commands, development, demo / simulator and build.
plamen CLAUDE.md
Instructions for PlamenTSV/plamen, covering plamen — security auditor, execution model, reference files and shared.
solana-developer-platform AGENTS.md
Instructions for solana-foundation/solana-developer-platform, covering solana developer platform, repo layout, source of truth, generated files and public vs internal surfaces.
behavioral-prediction-mcp AGENTS.md
Instructions for ChainAware/behavioral-prediction-mcp, covering chainaware subagent index, agent directory, chainaware-wallet-auditor, chainaware-fraud-detector and chainaware-rug-pull-detector.