inscope
AGENTS.md3 starsChanged 32 days agoMITView on GitHub
Guidance for AI coding agents working in this repository, a Bun monorepo: the web/next app, the api/hono service, and shared packages/* (auth, config, db, env), with build-only tooling in packages/scripts. The product here is inscope's own CLI in packages/cli (the inscope npm package) with its suite in tests/packages/cli; both are fork-owned paths a zerostarter sync never touches. Start each task with the codebase-map skill to orient, then load the task skill that fits (see Skills).
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository21 other files it gives its agents.
- add-packageSkill
- agent-browserSkill
- api-endpointSkill
- auditSkill
- codebase-mapSkill
- db-migrationSkill
- designSkill
- devSkill
- docker-testSkill
- doc-syncSkill
- fontsSkill
- gh-commitSkill
- iceboxSkill
- ignore-syncSkill
- portlessSkill
- releaseSkill
- runtime-apisSkill
- shadcn-syncSkill
- shipSkill
- skills-managerSkill
- ui-verifySkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
ALWAYS: Use @/ for imports, if applicable.
- Very specific: line 17
ALWAYS: Put a new build or tooling script in packages/scripts/src/, not .github/scripts/, and declare the dependencies it imports on that …
- Distinctive: line 21
Do not comment unnecessarily.
- Very specific: line 22
Keep comments on a single line.
- Distinctive: line 23
NEVER: Use em-dashes (the long dash, U+2014) in code, comments, docs, or copy.
- Very specific: line 27
ALWAYS: Keep packages/cli at zero runtime dependencies.
- Very specific: line 28
ALWAYS: After changing a snapshot-pinned generator (packages/cli/src/generators/{gitconfig,hook,mcp}.ts), run bun test tests/packages/cli …
- Distinctive: line 29
ALWAYS: Pair a generator's pure render function (config in, text out, snapshot-pinned) with its side-effecting apply.
- Very specific: line 30
ALWAYS: When a command, flag, field, or behavior changes, update README.md and the bundled self-skill packages/cli/skills/inscope/SKILL.md …
- Very specific: line 31
ALWAYS: Read the inherited skills with this fork in mind: here packages/cli is inscope's CLI, not zerostarter's scaffolding CLI, tests/ is …
- Distinctive: line 32
ALWAYS: Apply the single-line comment rule to new code.
- Very specific: line 33
ALWAYS: Load the bundled inscope self-skill from .agents/skills/inscope, a link to packages/cli/skills/inscope (the skills tables below …
- Very specific: line 43
ALWAYS: Follow the design skill for UI, styling, and design decisions (it holds the canonical conventions).
- Distinctive: line 49
NEVER: Include "Co-authored-by" in commit messages.
- Very specific: line 53
Write audit reports (any kind) to .github/notes/audits/ as dated files (YYYY-MM-DD-<topic>.md).
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Guidance for AI coding agents working in this repository, a Bun monorepo: the web/next app, the api/hono service, and shared packages/* (auth, config, db, env), with build-only tooling in packages/scripts. The product here is inscope's own CLI in packages/cli (the inscope npm package) with its suite in tests/packages/cli; both are fork-owned paths a zerostarter sync never touches. Start each task with the codebase-map skill to orient, then load the task skill that fits (see Skills).
Workflow
- ALWAYS: Do every change in its own git worktree, never on the primary checked-out branch. Create it under
.claude/worktrees/(repo-root relative, one directory per worktree; never/tmp, home, or a sibling of the repo), and fork its branch from the latestcanary: fetch first, then branch fromorigin/canary(git fetch origin canary && git worktree add .claude/worktrees/<name> -b <branch> origin/canary), so the change builds on current main. - ALWAYS: Show the user a new or altered database schema and wait for their go before generating or applying a migration. Name the choices that are costly to reverse and stop; a shape is cheap to argue about and expensive to change once rows exist, and
canaryshares its database with production, so applying reaches production immediately. See thedb-migrationskill. - ALWAYS: Point local database work at a disposable container (
bunx pglaunch -k) set in the worktree's own.env, never thePOSTGRES_URLthat ships in the root.env. That one is the shared Neon database read by bothcanaryand production, so a migration or a rename applied there reaches production immediately and under running code. Seed fake rows; real rows must never reach a screenshot or a PR. See thedb-migrationskill. - ALWAYS: Keep documentation in sync with every change. Whenever code, structure, conventions, or tooling change, update the matching docs in the same change (e.g.
web/next/content/docs/,README.md, thellms.txt/llms-full.txtcontext routes, skill docs under.agents/skills/and.claude/skills/, and these agent guidesAGENTS.md/CLAUDE.md). Docs must never drift. See thedoc-syncskill. - ALWAYS: When code, a convention, a command, a path, or tooling changes, review the skills in
.agents/skills/that touch it and update them in the same change, so every skill stays accurate and relevant. A skill that describes old behavior misleads every agent that loads it, which is worse than no skill. If a change makes a skill obsolete, remove it; if it reveals a gap, consider adding one.
Code
- ALWAYS: Use
@/for imports, if applicable. - ALWAYS: Put every test under the repo-root
tests/directory, mirroring the path of the file it covers (api/hono/src/lib/sql.tsis tested bytests/api/hono/src/lib/sql.test.ts). Onebun run testruns the suite; a package never carries its owntest/directory ortestscript. That script buildspackages/*first, because a test reaches a shared package through itsexports, which point atdist, so on a fresh checkout an unbuilt package resolves to nothing. Only the shared packages are built, not the apps: a test imports app code by source path and never throughdist.tests/is fork-excluded, so the root script no-ops where the directory is absent. Notebun testskips dot-directories, which is why.github/scriptstests live undertests/github/scripts/. An end-to-end test mirrors the router or page its requests hit and carries the.e2e.test.tssuffix (api/hono/src/routers/admin.tsis driven bytests/api/hono/src/routers/admin.e2e.test.ts), imports the stack helper attests/stack.ts, drives the artifact over HTTP without importing app source, and skips itself when either ofE2E_API_URLandE2E_WEB_URLis unset, which is howbun run teststays green without a stack;bun run test:e2enames the compose ports unless those variables say otherwise, refuses any host that is not local, and needs a local-stage stack (NODE_ENV=localwithAGENT_SIGNIN_ENABLED=true) so the agent can sign in, with both OAuth credential pairs set to any value, the id and the secret of each, since a provider registers only when both halves are present and the providers snapshot lists all three. - ALWAYS: Put a new build or tooling script in
packages/scripts/src/, not.github/scripts/, and declare the dependencies it imports on that package. It is a real workspace package, soturbo prunecarries it into the Docker build without an extra COPY. - ALWAYS: Prefer a Bun-native API when the file runs under Bun and one exists (
Bun.file,Bun.write,Bun.spawn); otherwise use a Node built-in with thenode:protocol prefix (import { join } from "node:path",require("node:fs")), never the bare specifier. Code that runs under Node in any environment (thepackages/clinpm binary in the canonical starter,web/next, wherenext devruns under Node while Docker and Vercel serve it under Bun, and sharedpackages/env) stays onnode:. See theruntime-apisskill. - ALWAYS: Keep enumerable lists alphabetical (A→Z), union/enum members, env-var schemas and their
runtimeEnv/turbo.jsonmirrors, and the docs that list them, so the code and its docs stay in the same order. Use a meaningful order (flow, priority, required-then-optional) only where alphabetical would obscure intent. API response schemas are included, and they order by relevance first, then A→Z: where one key is what the response is about and the rest describe it, that key leads and the others sort after it (users, thenhasNextPage,page,perPage,total). Everything else, a row's own fields included, is plain A→Z withidin its alphabetical place rather than hoisted. Sorting the subject too would put it in a different position on every endpoint, which is the drift this rule exists to prevent. - ALWAYS: Version every root
catalogentry with a caret range (^1.2.3), never an exact pin or a tilde..github/scripts/deps-manager.tsrewrites exact and tilde specs onpostinstall, including specs it promotes into the catalog from a workspace dep, and reports the rest (wildcards, dist-tags, compound ranges) for a manual fix. There is no opt-out: no pin survives an install, so pinning deliberately means changing the rule in that script and recording why in.github/notes/dependencies.md. - Do not comment unnecessarily. Only comment if it is absolutely necessary.
- Keep comments on a single line; do not split one across multiple
//lines or use multi-line/* */blocks. - NEVER: Use em-dashes (the long dash, U+2014) in code, comments, docs, or copy. Regular hyphens are fine; for a pause or aside, use a comma, colon, or period.
inscope CLI
- ALWAYS: Keep
packages/cliat zero runtime dependencies; hand-roll validation rather than add a library. Logic lives insrc/;bin/is the CLI surface (arg parsing, prompts, output). Inside the package,@/issrc/and~/is the package root. - ALWAYS: After changing a snapshot-pinned generator (
packages/cli/src/generators/{gitconfig,hook,mcp}.ts), runbun test tests/packages/cli --update-snapshotsand review the snapshot diff: it is the review surface, so a moved snapshot is a change to decide on, never noise to silence. - ALWAYS: Pair a generator's pure render function (config in, text out, snapshot-pinned) with its side-effecting apply; write every file through the atomic writer in
src/io.ts, and edit shared dotfiles (~/.zshrc,~/.gitconfig) only inside a marked managed block (src/managed-block.ts). - ALWAYS: When a command, flag, field, or behavior changes, update
README.mdand the bundled self-skillpackages/cli/skills/inscope/SKILL.mdin the same change, and run theshipskill before committing. - ALWAYS: Read the inherited skills with this fork in mind: here
packages/cliis inscope's CLI, not zerostarter's scaffolding CLI,tests/is kept, and the CLI publishes fromrelease.yml, notcli-release.yml(codebase-map,release, andruntime-apisdescribe the canonical starter). - ALWAYS: Apply the single-line comment rule to new code; the CLI's existing multi-line comment blocks predate the fork and change only when the code around them does.
- ALWAYS: Load the bundled
inscopeself-skill from.agents/skills/inscope, a link topackages/cli/skills/inscope(the skills tables below skip links, so it is not listed there). - ALWAYS: Keep
.github/workflows/release.ymlunder that name: npm Trusted Publishing forinscopeis bound to it. It publishes a canary when a push tocanarytouchespackages/cli,packages/scripts, ortests, andlatestonce auto-release tags a version. A test version of a PR isgh workflow run release.yml -f pr=<n>, not upstream's/releasecomment (see CONTRIBUTING.md, Releasing).
Dashboard
- ALWAYS: Keep the dashboard read-only and local: every
/api/inscoperoute sits behindrequireLocaland stays out ofnext dev's/apirewrite inweb/next/next.config.ts, which passes a caller's forged forwarding headers along; it returns tokens and keychain items as booleans only, and maps library results field by field. A test touching inscope state seals HOME withtests/inscope/sandbox.ts, never the developer's own, and the dashboard's e2e suites also skip withoutE2E_INSCOPE_SANDBOX, whichtests/inscope/serve.tssets (see CONTRIBUTING.md, Dashboard). - ALWAYS: Read the inherited
codebase-map,design,api-endpoint, anddevskills with the dashboard in mind, rather than editing them, which would stop their sync: here they also cover the(inscope)route group andcomponents/inscope/,requireLocalas a second source of 403,inscopeConfigErrorResponsesfor the 422 an invalid config returns, andinscopeWorkspaceErrorResponsesfor the 404 an unknown workspace returns; and the navbar thedevskill points to for logging in is hidden on the dashboard's pages,/included (see Logging in (agents)).
UI
- ALWAYS: Follow the
designskill for UI, styling, and design decisions (it holds the canonical conventions). Update it in the same change when a convention changes. - ALWAYS: For any frontend or UI change, verify it in a real browser with agent-browser before opening or updating a PR; drive the actual page or flow, do not rely on type-check and lint alone. Run the end-to-end flow when the change spans it or when asked. Capture screenshots and attach them to the PR with
gh pr comment --attach. See theui-verifyskill.
Commits
- Make atomic commits in the Conventional Commits format. See the
gh-commitskill. - NEVER: Include "Co-authored-by" in commit messages.
Working notes
- Write audit reports (any kind) to
.github/notes/audits/as dated files (YYYY-MM-DD-<topic>.md). Audits are transient working docs: delete one once its findings are fully addressed (shipped or consciously won't-fixed) so the directory does not accumulate stale records. - Track planned, in-progress, and parked work in
.github/notes/plans/(an index plus one file per item), not in dated audit files or scattered across issues; issues are the inbox, folded in and closed once captured. - A fork starts both directories itself:
.github/notes/is the starter's own working record and does not ship.
Logging in (agents)
Signs in as LocalAgent (agent@local.host). The route is gated: set AGENT_SIGNIN_ENABLED=true in .env first (it is off by default, so the route 404s without it and a deployed default env never exposes it). Then click Login (agents) in the dev UI's navbar menu (the dashboard's pages, / included, hide that navbar under next dev, so open any other path first; one that 404s shows it too), or use curl:
WEB=$(bunx portless get inscope); API=$(bunx portless get api.inscope)
curl -sS -c cookies.txt -X POST -H "Origin: $WEB" "$API/api/agents/sign-in-as"
curl -sS -b cookies.txt "$API/api/v1/user"Local-only (needs NODE_ENV=local and AGENT_SIGNIN_ENABLED=true) and requires a trusted Origin header. See api/hono/src/routers/agents.ts if needed.
Skills
Skills live in .agents/skills (symlinked to .claude/skills and .github/skills, so every agent tool reads the same files). Each is a SKILL.md with a description trigger and a literal procedure; only the description is scanned until a skill matches. Start with codebase-map to orient, then load the task skill that fits. Custom skills are maintained in this repo; vendored skills are copied verbatim from an upstream project (re-vendor to update, do not hand-edit).
Custom
<!-- skills:custom -->| Skill | Description |
| add-package | Add a new shared workspace package under packages/*. |
| api-endpoint | Add a typed Hono API endpoint or WebSocket route: router, OpenAPI docs, validation envelope, and RPC client wiring. |
| audit | Run the dependency security audit and maintain .github/notes/dependencies.md. |
| codebase-map | Orient in this repo: which file to edit for a change, how a change ripples across the stack, and how to search the code. |
| db-migration | Create and apply a Drizzle schema change. |
| design | Follow and maintain the app's UI conventions. |
| dev | Start, restart, and verify the inscope dev stack. bun run dev serves portless named .localhost URLs (branch-prefixed in a worktree); resolve them with bunx portless get. |
| doc-sync | Sync docs and skills so they never drift from the code. |
| docker-test | Build and smoke-test the Docker images with docker compose, and run the golden end-to-end suite against them. |
| fonts | Add, swap, or remove a self-hosted web font (latin variable woff2 from fontsource, localized via next/font/local). |
| gh-commit | Create atomic commits in the conventional format. |
| icebox | Icebox a raised-but-undecided concern instead of forcing a plan-or-dismiss call: record it with no verdict so the context survives. |
| ignore-sync | Mirror .gitignore to .dockerignore. |
| release | Cut a production release by promoting canary to main. |
| runtime-apis | Prefer Bun-native APIs, else Node built-ins with the node: prefix. |
| shadcn-sync | Run and reconcile the shadcn component sync (bun run shadcn:update). |
| ship | Prepare a change to the inscope CLI for a PR. |
| skills-manager | Keep the AGENTS.md skills tables generated from skill descriptions, and understand how a fork syncs its skills from upstream. |
| ui-verify | Verify a frontend or UI change in a real browser. |
<!-- /skills:custom -->Vendored (upstream, copied verbatim)
<!-- skills:vendored -->| Skill | Description |
| agent-browser | Browser automation CLI for AI agents. |
| portless | Set up and use portless for named local dev server URLs (e.g. https://myapp.localhost instead of http://localhost:3000). |
<!-- /skills:vendored -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

