Repository instructs the coding agents working in it
docs/agent-instructions@v1
The repository carries an agent instruction file, and it is long enough to say something and short enough to be read.
| Id | docs/agent-instructions |
| Version | v1 |
| Category | docs |
| Default severity | info |
| Interpreter | python3 |
| Timeout | 30 seconds |
| Violations tolerated | 0 |
| Collects | files |
Collectors
This guardrail gathers nothing itself. It depends on the collectors below, which the CLI runs once per build before any check, and reads what they found out of GUARDRAIL_FACTS. A collector that collects nothing skips this guardrail rather than failing it.
| Collector | Gathers | Inputs it is given |
|---|---|---|
files | Presence, size and line counts of the well known files a repository is expected to carry, plus any extra path the guardrail asks for. | paths |
The inputs above are this guardrail's own, passed straight through. Configuring one in buildnote.json changes what is collected, and two guardrails configured the same way share the one collection.
Configuration
{
"guardrails": {
"failOn": "error",
"comment": true,
"checks": [
{
"use": "docs/agent-instructions@v1",
"severity": "info",
"with": {
"paths": "AGENTS.md,CLAUDE.md,.github/copilot-instructions.md",
"minLines": "10",
"maxLines": "500"
},
"exemptions": []
}
]
}
}Inputs
| Input | Description | Default | Environment variable |
|---|---|---|---|
paths | Comma separated paths, any one of which satisfies the guardrail. The first one present is the one measured. | AGENTS.md,CLAUDE.md,.github/copilot-instructions.md | GUARDRAIL_INPUT_PATHS |
minLines | How many non-blank lines it must have before it counts as written. | 10 | GUARDRAIL_INPUT_MINLINES |
maxLines | How many non-blank lines it may have before it is too long to be attended to. 0 means no ceiling. | 500 | GUARDRAIL_INPUT_MAXLINES |
How to fix
Add an AGENTS.md at the repository root saying how the project is built, how it is tested, and the conventions a change is held to:
# AGENTS.md
## Commands
`./gradlew check` builds and tests every module.
## Conventions
Commits follow Conventional Commits. Write no comments.See agents.md. An agent with no instructions rediscovers the conventions from the code every session and gets them wrong at the edges; an instruction file nobody trimmed is past the point where the model attends to all of it, which fails the same way while looking answered.
More in docs
docs/changelog. The repository carries a changelog, so what changed between two releases is written down rather than reconstructed from commits.docs/code-of-conduct. The repository carries aCODE_OF_CONDUCT.md, so the standard contributors are held to is written down and so is who enforces it.docs/contributing. The repository carries aCONTRIBUTING.mdsaying how a change is proposed, built and reviewed.docs/license-present. The repository carries a licence file, so what may be done with the code is written down rather than assumed.docs/readme. The repository has a README, and it says more than its title.docs/security-policy. The repository carries aSECURITY.mdnaming where a security problem should be reported.