copilot
AGENTS.md54 starsChanged 3 months agoMITView on GitHub
Minimal guide for agents working in this repository. Monorepo for Nav's Copilot ecosystem: SECURITY.md has the security model and trust boundaries. Keep tool output small. Run targeted commands, do not dump whole files or full build logs into context, and reach for deterministic tools (rg, git, gh) before asking the model to guess. rtk is an optional CLI proxy that filters terminal output before it reaches the model. Use it if you want to (rtk git status). Nothing here requires…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository35 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- ai-news-researchSkill
- aksel-builderSkill
- aksel-spacingSkill
- api-designSkill
- conventional-commitSkill
- deliberate-ai-useSkill
- flyway-migrationSkill
- jackson-3-migrationSkill
- java-to-kotlinSkill
- kafkaSkill
- klarsprakSkill
- kotlin-app-configSkill
- ktor-scaffoldSkill
- naisSkill
- nav-architecture-reviewSkill
- nav-authSkill
- nav-deep-interviewSkill
- nav-dekoratorenSkill
- nav-planSkill
- nav-troubleshootSkill
- observability-debuggingSkill
- observability-setupSkill
- playwright-testingSkill
- postgresql-reviewSkill
- readme-reviewSkill
- rust-developmentSkill
- security-owaspSkill
- security-reviewSkill
- spring-boot-scaffoldSkill
- terse-modeSkill
- threat-modelSkill
- tokenx-authSkill
- web-design-reviewerSkill
- workstation-securitySkill
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 1 is common, 2 are distinctive, and 4 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 19
Keep tool output small. Run targeted commands, do not dump whole files or full build logs into context, and reach for deterministic tools …
- Very specific: line 34
After editing an app, run mise check in that app's directory.
- Distinctive: line 56
Start with the smallest safe change and keep diffs task-focused.
- Common: line 62
Do not commit secrets.
- Distinctive: line 63
Do not push unless explicitly asked.
- Very specific: line 116
Every Go test package in cli/nav-pilot has a TestMain that calls testhome.Run (internal/testhome).
- Very specific: line 127
Do not assume a command only reads.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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 for navikt/copilot
Minimal guide for agents working in this repository.
What this repo is
Monorepo for Nav's Copilot ecosystem:
apps/my-copilot(Next.js/TypeScript web app)apps/copilot-api(Go backend API)apps/copilot-metrics(Go metrics job)apps/mcp-onboarding(Go MCP reference server)apps/mcp-registry(Go MCP registry API)
SECURITY.md has the security model and trust boundaries.
Efficiency rule
Keep tool output small. Run targeted commands, do not dump whole files or full build logs into context, and reach for deterministic tools (rg, git, gh) before asking the model to guess.
rtk is an optional CLI proxy that filters terminal output before it reaches the model. Use it if you want to (rtk git status). Nothing here requires or assumes it, and public controlled measurement has not reproduced its advertised savings (JetBrains study).
Standard commands
From repo root:
mise check
mise test
mise build
mise allAfter editing an app, run mise check in that app's directory. Run mise all when the change reaches across the repo.
Conventions
- PR bodies may be in Norwegian, but issue-closing references must use GitHub's
English keywords:
Closes #NNN/Fixes #NNN.Lukker #NNNdoes not link or auto-close anything, and three months of shipped-but-open issues in this repo trace back to exactly that. Verify with the PR'sclosingIssuesReferenceswhen it matters. - Artifact language: body text in instructions and skills is English; metadata in the YAML frontmatter stays Norwegian (#179). The rule governs every artifact in this repo and was only recorded in a changelog entry, which is not where an author looks before editing a skill (#679).
- Text a human reads gets a språkvask and unslop pass before it ships: docs, READMEs, issue and PR bodies, user-facing CLI strings and error messages, Norwegian and English alike. Cut filler and AI tells, keep every command, flag and value verbatim. Recorded after the 2026-09-13 pass over navikt/apt and nais/pilot#3, where a denial message an engineer meets mid-task had to be cut down to what is wrong and what to run.
- Start with the smallest safe change and keep diffs task-focused.
- Reuse existing patterns before adding new abstractions.
- In
my-copilot, use Aksel spacing tokens, not Tailwindp-*/m-*utilities. /cpltinmy-copilotis the external landing page for the cplt open-source project: keep it in English (lang="en") and keep its dark design. Don't translate it or restyle it to the ki-utvikling/Aksel look; fix bugs only.- Do not commit secrets.
- Do not push unless explicitly asked.
Merging a stacked pull request
This repository uses a merge queue, and pull requests are sometimes registered
as a GitHub stack (GET /repos/{owner}/{repo}/pulls/{n} shows a stack
object). A stacked PR refuses every ordinary merge route, each with a different
error, so it is easy to spend a long time concluding the wrong thing:
gh pr merge --autoreportsAuto-merge is not supported for stacked pull requests.- GraphQL
enqueuePullRequestrefuses and points at the async REST API. PUT /pulls/{n}/mergerefuses stacked PRs outright.PATCH /pulls/{n}cannot change the base while the PR is in a stack.
The route that works is the asynchronous one:
gh api -X PUT repos/OWNER/REPO/pulls/N/merge-asyncDo not pass merge_method. The merge queue sets it, and supplying one makes
the request fail with Custom merge params are not supported when merging via a
merge queue.
Poll the result. The endpoint returns {"status":"pending"} with a uuid
whether or not the request will succeed. The failure only appears here:
gh api repos/OWNER/REPO/pulls/N/merge-async/UUIDThat returns enqueued, or failed with the actual reason: a rejected merge
param, checks still owing results, and so on. Treating the pending response as
success means retrying a request that has already failed, silently.
Running the nav-pilot binary in tests or verification
nav-pilot writes to the developer's own environment: ~/.copilot/,
~/.nav-pilot/ and the repository you are standing in. A verification that runs
the real binary without isolation changes a real setup, and it has: an install
run during testing pointed a user scope at a temporary worktree and left 23 of 52
files in conflict, which sync then silently skipped. Nothing had been edited by
hand.
Whenever you run the binary — directly, or through a test that calls run():
- Set
HOMEto a temporary directory. That is the one that matters, because everything resolves throughos.UserHomeDir.nav-pilotdoes not readCOPILOT_HOME. Also setNAV_PILOT_CONFIG(relocates~/.nav-pilot/config.toml, seeinternal/cli/config.go) andXDG_CONFIG_HOME(honoured on the opencode export path, seeinternal/provider/opencode_launch.go). In Go tests,isolatedConfig(t)does this for you — use it. - Every Go test package in
cli/nav-pilothas aTestMainthat callstesthome.Run(internal/testhome). It pointsHOME, the XDG directories andNAV_PILOT_CONFIGat a temporary directory for the whole test binary and fails the run if the test binary opened nav-pilot's files in the real home (Go's test log shows it). A change in those files that the binary did not open is a warning locally, since a real nav-pilot may be running, and a failure in CI. A new test package needs the sameTestMain;TestEveryTestPackageCallsRunfails without it. A test that setsHOMEitself must also setNAV_PILOT_CONFIG, or it uses the configtesthome.Runchose.isolatedConfig(t)sets both. - Do not assume a command only reads.
install,sync,configand the launch paths all write. - Hash
~/.copilotand~/.nav-pilotbefore and after, and report any difference. Isolation that is set up wrong looks exactly like isolation until someone checks. - Say so loudly if you did touch something. A silent change to a developer's setup is worse than a failed test.
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.

