Repo root hygiene: move FORMAT.md to docs/, contrib/ to bin/, fix bash script style #74
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Policy: "Avoid putting files in the repo root unless necessary. Root should
contain only project-level config files (
README.md,Makefile,Dockerfile,LICENSE,.gitignore,.editorconfig,REPO_POLICIES.md,and language-specific config). Everything else goes in a subdirectory," with
a canonical subdirectory list:
bin/,cmd/,configs/,deploy/,docs/,internal/,pkg/,share/,static/,web/.Divergences:
FORMAT.md(the 6.4KB format specification) sits at the repo root. It isdocumentation and belongs in
docs/. There is currently nodocs/directory at all.
contrib/usage.shusescontrib/, which is not a canonical subdirectoryname.
Separately, both bash scripts violate the bash style guide, which requires
#!/usr/bin/env bash,set -euo pipefail, and all code inside functionswith
maincalled at the bottom:bin/gitrev.sh:1-2—#!/bin/bash, noset -euo pipefail, nomain.contrib/usage.sh:1-2—#!/bin/bash, hasset -euo pipefail, nomain.(
script/*are intentionally POSIXshper scripts-to-rule-them-all and arecorrect as-is. Do not touch them.)
Definition of done
FORMAT.mdis atdocs/FORMAT.md, moved withgit mvso history ispreserved.
AGENTS.md:28, andREADME.mdat lines12-13, 22, and 143. Search the whole repo for
FORMAT.mdrather thantrusting that list.
contrib/usage.shis moved tobin/usage.sh(ordocs/if it is reallyexample documentation rather than an executable tool — decide and say
which in the commit message), and
contrib/no longer exists.#!/usr/bin/env bash,set -euo pipefail, and wraptheir logic in a
mainfunction invoked at the bottom of the file.bin/gitrev.shin particularis invoked from
Makefile:7and its output feeds the version ldflags.make checkpasses anddocker build .succeeds.TODO.mdupdated inthe same commit.
Implementation requirements
Makefile:7runsbash $(PWD)/bin/gitrev.sh 2>/dev/null || echo unknown.Adding
set -euo pipefailchanges failure behavior — verify the fallbackto
unknownstill works when the script is run outside a git checkout,and that a non-git build (e.g. a source tarball) does not now fail hard.
.dockerignoreand theDockerfilefor references tocontrib/orFORMAT.mdbefore moving either..gitignorecurrently contains/bin/, which ignores thedirectory you are moving a script into. Confirm the moved file is actually
tracked after the move —
git status --ignored— and adjust the ignorerule if needed. This interacts with #72; whichever lands second must
re-verify.
FORMAT.mdin this change. Moving andediting in one commit makes the move unreviewable. Content work on the
spec is tracked separately.
(closes #74).One related item deliberately left out of this issue's scope, because it is
an owner decision rather than a fix.
AGENTS.mdalso sits in the repo root and is also not on the policy'sallow-list of permitted root files. Unlike
FORMAT.mdandcontrib/, thereis no obviously correct place to move it: a root
AGENTS.mdis the emergingconvention for agent-facing repository instructions, and tooling generally
expects it there. The repo's own
TODO.mdalready flags this as unresolved("Reconcile root-level AGENTS.md with directory-hygiene policy (keep or
relocate)").
Resolving it properly means amending the authoritative
REPO_POLICIES.mdinthe
promptsrepo to carve outAGENTS.mdas an allowed root file — whichis a cross-repo change to a user-owned document, not something to do here.
Recommendation: leave
AGENTS.mdwhere it is, and amend the policy documentto permit it. The alternative — relocating it to satisfy a rule that predates
the convention — would break the tooling expectation for no practical gain.
Do not action this as part of #74. Flagging it so it is not lost; it needs a
decision from
sneakand a change in thepromptsrepo.