Skip to content

Guardrails / docs

Repository instructs the coding agents working in it ​

docs/agent-instructions@v1

The repository has an instruction file for coding agents, long enough to say something and short enough to be read in full.

Iddocs/agent-instructions
Versionv1
Categorydocs
Default severityinfo
Interpreterpython3
Timeout30 seconds
Violations tolerated0
Collectsfiles

Collectors ​

This guardrail doesn't gather anything itself. It relies on the collectors below, which the CLI runs once per build before any check, and reads what they found from GUARDRAIL_FACTS. If a collector collects nothing, this guardrail is skipped, not failed.

CollectorGathersInputs it is given
filesPresence, 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 inputs, passed straight through to the collector. Setting one in buildnote.json changes what is collected, and two guardrails configured the same way share a single collection.

Configuration ​

json
{
  "guardrails": {
      "failOn": "error",
      "checks": [
          {
              "use": "docs/agent-instructions@v1",
              "severity": "info",
              "with": {
                  "paths": "AGENTS.md,CLAUDE.md,.github/copilot-instructions.md",
                  "minLines": "10",
                  "maxLines": "500"
              },
              "exemptions": []
          }
      ]
  }
}

Inputs ​

InputDescriptionDefaultEnvironment variable
pathsComma separated paths, any one of which satisfies the guardrail. The first one present is the one measured.AGENTS.md,CLAUDE.md,.github/copilot-instructions.mdGUARDRAIL_INPUT_PATHS
minLinesHow many non-blank lines it needs before it counts as written.10GUARDRAIL_INPUT_MINLINES
maxLinesHow many non-blank lines it may have before it is too long for the model to pay attention to all of it. 0 means no limit.500GUARDRAIL_INPUT_MAXLINES

How to fix ​

Add an AGENTS.md at the repository root explaining how the project is built, how it is tested, and the conventions a change must follow:

markdown
# AGENTS.md

## Commands
`./gradlew check` builds and tests every module.

## Conventions
Commits follow Conventional Commits. Write no comments.

See agents.md. Without instructions, an agent rediscovers your conventions from the code in every session and gets the edge cases wrong. An instruction file nobody trims grows past the point where the model pays attention to all of it, which fails the same way while looking like the job is done.

More in docs ​

  • docs/changelog. The repository has a changelog, so what changed between two releases is written down instead of pieced together from commits.
  • docs/code-of-conduct. The repository has a CODE_OF_CONDUCT.md, so the standard contributors are held to, and who enforces it, is written down.
  • docs/contributing. The repository has a CONTRIBUTING.md explaining how a change is proposed, built and reviewed.
  • docs/license-present. The repository has a licence file, so what people may do with the code is written down, not assumed.
  • docs/readme. The repository has a README that says more than just its title.
  • docs/security-policy. The repository has a SECURITY.md saying where to report a security problem.

All 7 docs guardrails

Buildnote Limited
Registered in England and Wales, Reg: 16140412