Borrowing it
Nothing to install: this file belongs to orif1n/kirim-saas. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/orif1n/kirim-saas/main/AGENTS.mdgit clone --depth 1 https://github.com/orif1n/kirim-saasWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/orif1n/kirim-saas/agents-md)<a href="https://agentmods.dev/instructions/orif1n/kirim-saas/agents-md"><img src="https://agentmods.dev/badge/instructions/orif1n/kirim-saas/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/orif1n/kirim-saas/agents-md"><img src="https://agentmods.dev/badge/instructions/orif1n/kirim-saas/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.07673 | $0.07673 |
| Opus 5 | $0.03837 | $0.03837 |
| Sonnet 5 | $0.01535 | $0.01535 |
| Haiku 4.5 | $0.00767 | $0.00767 |
Grade A, and why
kirim-saas 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 9d 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 — 315 lines — stays where its author put it; the contents beside it link to each section on GitHub.
saas-boilerplate
Modular, type-safe SaaS starter. Bun monorepo, Hono API, Vite/React web, Drizzle + Postgres, Better Auth, provider-agnostic payments, hardened by default (OWASP audit passing).
Read this file first. Then read the AGENTS.md next to whatever you're about to edit — each package documents its local invariants.
Repository map
saas-boilerplate/
├── apps/
│ ├── api/ Hono + zod-openapi + Better Auth handler (Bun runtime)
│ ├── web/ Vite + React 19 + shadcn/ui + TanStack Router + i18next
│ └── worker/ Bun + BullMQ background jobs (billing reconciler, subscription lifecycle)
├── packages/
│ ├── config/ tsconfig presets + Zod env schema
│ ├── shared/ Enums, AppError, Result, crypto helpers — zero I/O, safe everywhere
│ ├── db/ Drizzle schema, client, migrations, seed
│ ├── auth/ Better Auth server factory + browser client
│ ├── email/ Resend mailer + React Email templates
│ ├── payments/ Provider interface + Duitku adapter (Midtrans/Xendit/Stripe are interface-only stubs that throw until implemented)
│ └── storage/ Provider interface + R2/S3 adapter — presigned uploads, magic-byte verify
├── docker-compose.yml Postgres + Redis + Mailpit for local dev
├── Dockerfile.api Multi-stage Bun runtime (non-root)
├── Dockerfile.web Multi-stage nginx-unprivileged (port 8080)
├── renovate.json Grouped dependency PRs, auto-merge safe minors
└── .github/workflows/ CI (lint/typecheck/test + e2e) and Docker publish to GHCR
Golden rules
- No circular deps.
apps/*depends onpackages/*, never the reverse.packages/dbandpackages/sharedare leaf packages with no cross-package runtime deps. - No I/O at import time. Every package exports pure factories (
createXxx(config)). The API'sserver.tsis the ONE place that reads env and constructs services. - Money is integer minor units.
priceAmount,amountare integers. Currency is a separate column. No floats, ever. - Payments are provider-agnostic. Routes talk only to the
PaymentProviderinterface. Adding a provider = one file + one factory branch. Swapping providers = one env var. - Errors are
AppErrorat package boundaries. The API error middleware is the ONLY response formatter. Frontend surfaces them vianormalizeError()+ i18n code table. - Type-safe env.
@saas/config/envvalidates once at boot and throws on missing/invalid vars. Placeholder values in.env.exampleare actively rejected. - OpenAPI is source of truth for the HTTP contract. Every route uses
createRoute(...)./api/openapi.jsonand/api/docsare gated OFF in production. - i18n covers every user-visible string. Locales are split per namespace under
apps/web/src/i18n/locales/{en,id}/<ns>.ts. Add keys to BOTHen/<ns>.tsandid/<ns>.tsin the same commit. Theidaggregator is typed againsttypeof en, so a missing key fails typecheck instead of silently falling back. Error codes are looked up viaerrors.<CODE>inerrors.ts. - Column-level encryption for secrets at rest. Two independent mechanisms, do NOT conflate them: (a) OAuth tokens on
accounts.*are encrypted by Better Auth's built-inaccount.encryptOAuthTokens(its own ciphertext format, keyed offAUTH_SECRET) — NOT by@saas/shared/crypto, whose format Better Auth's OAuth refresh path cannot read. (b) Verification tokens (verifications.value) and any third-party integration secrets go through@saas/shared/crypto(AES-256-GCM), gated onCOLUMN_ENCRYPTION_KEY— when that key is unset the hook is a no-op and values are stored plaintext (dev default; production MUST set it — the env schema throws at boot without it). Seepackages/auth/AGENTS.md"Column-level encryption". Personal access tokens (api_keys.hashed_key) usehashApiKeyfrom@saas/shared/crypto, which returns a raw 32-byteBuffer(sha256 digest) mapped to abyteacolumn — NOT hex. Plaintext is returned to the caller ONCE on create and NEVER persisted or logged. - Webhooks: verify signature, re-check business fields, transact. Never trust that a signed payload is safe to write — cross-check amount/currency against the pending row. Persist raw payloads ONLY through the adapter's
redactWebhookPayload()— the DB is not a place for provider signatures, customer PII, or free-form fields. EveryPaymentProviderMUST implementredactWebhookPayload(raw); per-provider allowlists are the invariant. Redacted payloads land in the sibling tablepayment_webhook_events(append-only), NOT on thepaymentsrow — that keeps the hot/billing/paymentshistory query narrow. Seepackages/payments/AGENTS.md. - Tenant scoping is a security invariant, not a filter. Every read/write on business data MUST include
WHERE organization_id = ?. The active org is resolved viarequireActiveOrg(services, session)— never trust the client. Missing the predicate is a cross-tenant data leak, not a bug. - This is a tenant application, not a platform-admin surface. Roles (
owner | admin | member) are per-organization. There is no "platform admin". Dashboard stats, MRR, revenue — all scoped to ONE workspace. Do not add cross-tenant aggregations to/api/*; that belongs in a separate admin surface not shipped here. - Bearer auth inherits creator's role at request time + carries hierarchical scopes. API keys grant the same tenant role their creator had when the request runs. Each key ALSO carries an explicit scope array (
api_keys.scopes,jsonb— seeAPI_KEY_SCOPESin@saas/shared/constants). Default is['read'];writeandadminare opt-in at create time. Scopes are hierarchical:adminimplieswriteimpliesread(viaSCOPE_HIERARCHY+scopeImplies). Bearer mutation endpoints callrequireScope(c, 'write')fromapps/api/src/lib/scopes.tsto reject read-only keys BEFORE the role check; org-wide destructive endpoints (billing cancel, workspace delete) callrequireScope(c, 'admin'). Cookie sessions bypass scope entirely (they carry the full role). Elevation guard: a bearer caller can only mint keys with scopes THEY currently hold — awrite-scoped key cannot bootstrap anadmin-scoped child key (enforced inPOST /api/api-keys). Built-in identity flows (password change, account deletion, email change) live under Better Auth's/api/auth/*, where bearer sessions are invisible (Better Auth resolves cookies itself) — no extra guard needed. Any CUSTOM sensitive route you add outside Better Auth MUST callrequireCookieAuth(c)fromapps/api/src/lib/session-source.tsto reject bearer callers regardless of scope (currently zero call sites, by design — see the helper's doc comment for the pattern). Bearer sessions get a random opaquesession.id+session.tokenper request — NEVER log them (they'd become stable identifiers tying a request back to a specificapi_keysrow). Seeapps/api/AGENTS.md"Bearer auth".
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.
- 9d ago First seen · 315 lines · 7,673 tokens per session scan A 63afb0a8fdcd
kirim-saas AGENTS.md is an instructions file published in the GitHub repository orif1n/kirim-saas (10 stars, last pushed 1mo ago), licensed MIT. It adds 7,673 tokens to every session, about $0.0384 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.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.