stitchkit AGENTS.md

A project instruction file for developing Stitchkit, a framework that turns one API definition into an HTTP API, MCP tools, AI-agent tools, and a typed client.

In plain words
What is it for?
It is for framework contributors working on Stitchkit code, design decisions, tests, documentation, and releases.
Why use it?
It tells contributors which architecture rules, development guides, and release practices apply when changing the framework itself.

Instructions file for CodexOpenCode

Install

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.

agentmods
npx agentmods add instructions/max-listov/stitchkit/agents-md
Clone the repo
git clone --depth 1 https://github.com/max-listov/stitchkit

Made for: Codex, OpenCode.

Per session 4,943 This file is loaded in full into every session.
When invoked 4,943 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.04943 $0.04943
Opus 5 $0.02472 $0.02472
Sonnet 5 $0.00989 $0.00989
Haiku 4.5 $0.00494 $0.00494

Measured 2d ago against content hash fd5ec8ebdae8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

stitchkit 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 2d 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.

AGENTS.md · 338 lines

How it starts

The opening of the file, as written. The whole thing — 338 lines — stays where its author put it; the contents beside it link to each section on GitHub.

stitchkit — agent guide

Contract-first backend framework for Bun and Node. One defineContract() → an HTTP API, MCP tools, AI-agent tools and a typed client.

Two roads — pick yours

📦 Building an app with stitchkit? This file is not for you — it is about changing the framework. Start at the README quick start and the user guide. In your own project your agent's entry point is node_modules/stitchkit/llms.txt (ships in the package); Claude Code users can also drop the repo's skills/stitchkit into .claude/skills/. They map the whole consumer surface.

🔧 Developing stitchkit itself? You're in the right place. This file is the canonical, tool-agnostic guide — the rules, architecture, breaking-change and release flow. The hands-on contributor workflow (setup, commands, git hooks, local development against a consuming app, PRs) is in CONTRIBUTING.md. Design rationale per rule is an ADR in docs/decisions/; tasks live in docs/backlog/.


Rules

  • NEVER ship a competing WebSocket or hook engine — wrap Socket.IO (createSocketIOClient / createSocketIOServer) and react-query-kit (createCursorQuery). → ADR 0008
  • NEVER write as casts in business logic. A cast that ships is a boundary: the loose↔typed bridges in internal/typed.ts, adapters over untyped external emitters (Socket.IO, the event bus, the cache bridge), and the generic bridges in browser/client.ts where a scoped client surface is rebuilt from a wider one. Each must carry a comment saying why. A new cast anywhere else means the types are broken upstream; fix them there. Nothing enforces this mechanically — it is a review rule over a small, countable set (thirteen in packages/core/src), not a gate. → ADR 0003
  • ALWAYS keep the core Web Fetch-clean — createHandler takes HandlerConfig (no Bun types). Bun APIs live only in createServer and stitchkit/server. → ADR 0013
  • ALWAYS Zod-first — a schema is the source of truth, types come from z.infer. Never hand-write a duplicate type.
  • NEVER make the project declaration a condition — of a build, a test, a start path or a check. A project with no project.json is a complete project; stitchkit/declaration is a leaf nothing else in the core imports, and packages/core/tests/project-declaration.test.ts keeps it one. A repository only one tool can bring up is a fork, not a dependency. → ADR 0104
  • ALWAYS keep the core generic — no domain model. Scopes are free strings, there is no billing, source is transport-only. → ADR 0002
  • Transport and hooks use RuntimeContext (loose); handlers use HandlerContext (typed). Do not cast between them. → ADR 0003
  • A new architectural decision → a new ADR in docs/decisions/ and a row in docs/decisions/README.md (keep the index in sync). A new idea → a file in docs/backlog/inbox/. See docs/README.md.
  • A completed backlog item may claim test coverage only by naming the exact test file and test case in its Что сделано section.
  • ALWAYS run bun scripts/verify.ts --release before a release commit, and let the pre-push hook reuse that exact-tree result — see What runs where below. verify is the whole portable local gate and it runs every portable gate CI runs: lint, typecheck, tests, the Postgres agent-store lane, build, the Next-SSR and Node smokes, the packed consumer lane, the packed starter lanes and the supervised PM2 lane. Its prerequisites are listed in CONTRIBUTING.md and all of them arrive with bun install except a reachable PostgreSQL and the Playwright browsers.

Read the full file on GitHub · 338 lines

Changes

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.

  1. 2d ago First seen · 338 lines · 4,943 tokens per session scan A fd5ec8ebdae8

Subscribe to this mod's changes

stitchkit AGENTS.md is an instructions file published in the GitHub repository max-listov/stitchkit (4 stars, last pushed 2d ago), licensed MIT. It adds 4,943 tokens to every session, about $0.0247 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-31.

Related

Other instructions, from other repositories

keryx CLAUDE.md

Instructions for actionhero/keryx, covering claude.md, project overview, monorepo structure, development environment and environment setup.

actionhero/keryx · 2,225 tokens

wa-automate-nodejs AGENTS.md

AGENTS.md instructions for open-wa/wa-automate-nodejs, covering repository instructions, commit policy, no ai attribution, commit grouping and gitmoji reference.

open-wa/wa-automate-nodejs · 1,586 tokens

wa-automate-nodejs copilot-instructions.md

Copilot instructions for open-wa/wa-automate-nodejs, covering switchboard configuration for github, available mcp tools, messaging (cross-ide), workflow management and terminal management.

open-wa/wa-automate-nodejs · 467 tokens

igniter-js GEMINI.md

Gemini CLI instructions for felipebarcelospro/igniter-js, covering 1. identity and profile, 2. about the igniter.js monorepo, 3. personality and communication, 4. lia's core responsibilities (the 4 pillars) and 5. technical guidelines and methodology.

felipebarcelospro/igniter-js · 9,239 tokens

igniter-js AGENTS.md

AGENTS.md instructions for felipebarcelospro/igniter-js, covering lia - ai agent for igniter.js, 1. identity & mission, core mission, key responsibilities and 2. project overview.

felipebarcelospro/igniter-js · 6,319 tokens

igniter-js writing-style.instructions.md

Instructions for felipebarcelospro/igniter-js, covering ✍️ unified documentation style guide (for llms & authors), 🎯 core style principles (applies to all documentation), 📘 documentation (docs): writing style, installation and quick start.

felipebarcelospro/igniter-js · 3,722 tokens