repo-conventions
What every repository must contain, how it is laid out, how its tools are pinned and how its scripts are placed. Use when creating a repository, auditing one against the baseline, or deciding where a
Files1
View on GitHubSKILL.mdskills/conventions/repo-conventions/SKILL.md
GitHubRepository conventions
The baseline every repository follows, independent of language.
When to use
- Creating a repository, or bringing an existing one up to the baseline.
- Deciding where a file, a script or a document belongs.
- A tool version differs between a machine and CI.
Rules
Required files
README.md: what the repository is, quick start, configuration, development, releasing.AGENTS.md: layout, the commands that verify a change, and this repository's own constraints. Repository specific only, the baseline already applies. Deviations from this baseline go under## Deviations, one line each with the reason. ACLAUDE.mdholding@AGENTS.mdsits next to it until every agent readsAGENTS.mdon its own. Size limits and placement:agents-md.LICENSE: Apache-2.0 for a new repository, with a license header in every source file..editorconfigand.gitignore, kept current by hand until a shared generator exists.mise.tomlpinning every tool..agent-skills.jsonis optional, absent means defaults.Taskfile.yamlover a Makefile. One task target per check,lint:<tool>,test:<suite>,validate, plusfmtandbuildwhere they apply. Achecktarget may aggregate the small targets and holds no command of its own. CI calls the small targets, nevercheck. An existing repository keeps whatever task runner it already has.renovate.json, referencing the organisation's shared preset where one exists.release-me.yamlfor anything that is released,release-please-config.jsonand.release-please-manifest.jsonwhere a repository still runs release-please instead.CHANGELOG.mdis generated by the release tool and never hand edited..github/workflows/with one file per purpose, named after what it checks or releases, for examplelint.yamlandtest.yamlrather than oneci.yaml. Seeci-conventions.- Every YAML file ends in
.yamlwherever the tool reading it accepts that extension. Known exceptions:.github/FUNDING.ymland.github/dependabot.yml, where GitHub reads only that exact name.
Layout
docs/adr/NNNN-title.mdfor decision records,docs/concepts/<feature>.mdfor concept docs. Neither directory exists ahead of time. A skill creates it with the first record it writes, not as part of repository setup.docs/for everything else a user or an operator needs to read.- No generated artifact in git unless a consumer needs it there, and then it is marked generated and checked in CI.
Deviations
- One line per
## Deviationsentry inAGENTS.md: the convention it drops or changes, then the reason. - Read that heading before creating files the baseline describes. An entry that drops a convention skips the step, and the skill says so. No entry means the baseline applies in full.
Tooling (development environment)
mise.tomlis the only source of tool versions. Pin to the minor version the repository is tested with. Nolatest. Pin to the patch where one tool is coupled to another's version.miseis the only installer. Nevergo install,go get -tool,npx,pipxorcurl | sh, in a task, in CI or by hand. A tool missing from themiseregistry is named, with an alternative proposed instead of reaching for another installer.- A tool needed on every machine rather than in one repository is Homebrew's job, installed by a human, not by an agent.
mise installis the single setup command. It is documented in the README.
CI
- CI installs the same tool versions from the same
mise.toml, through themiseGitHub Action, so no tool version is duplicated into a workflow file. - CI runs the same task targets a human runs locally. No logic exists only in the workflow.
- A missing tool fails the job with a clear message instead of being installed ad hoc.
Scripts
- Ask the generic question every time a script is touched: could another repository use it with different inputs. If yes it belongs in the organisation's shared scripts repository, not here.
- A script needed only by this repository, for example one reading this repository's own output,
stays in its
scripts/and is documented in the README. Never copy a script between repositories, move it and point the caller at the moved one. - Scripts only where they earn it: run repeatedly, complex logic, or needed by CI.
- A throwaway script deleted in the same task lives in the session's scratch directory, outside
every repository and worktree. Never in
scripts/or the shared scripts repository. - No inline interpreter one liner that will run again, and never one that spans lines.
- A check that only asserts a convention is not a script. See
conformance-checks. - A check script past one screen means the wrong tool, or none was searched for. Search for an existing tool before building anything that checks, validates or lints.
Settings and labels
- Repository and organisation settings, rulesets, secrets and labels are infrastructure as code in
the organisation's infrastructure repository. Never change them with a CLI or a web interface.
See
github-as-codefor turning a setting into committed configuration. - A label missing on the tracker is reported. Skills never create one.
Scope
- One repository has one purpose. A part that grows its own features, documentation and release cycle gets extracted into its own repository.
Guardrails
- Never hand edit
CHANGELOG.mdor a release tool's own state file. - Never add a second task runner next to an existing one.
- Never change a repository or organisation setting outside its infrastructure repository.
- Never create
docs/adrordocs/conceptsahead of a record. - Never override a
## Deviationsentry.
Config
verify: command that proves a change is good. Default:task checkwhen a Taskfile exists, else detected.iac: infrastructure as code tool. Default:opentofu.docs.adr: path for decision records. Default:docs/adr.docs.concepts: path for concept docs. Default:docs/concepts.
References
conformance-checksfor a rule that belongs in a declarative suite rather than a script.secrets-handlingfor what never belongs in any of these files.github-as-codefor repository and organisation settings as committed configuration.ci-conventionsfor how a workflow file inside.github/workflows/is named and shaped.