Tighten prose throughout while preserving all policy details. Add note that make check must not modify repo files.
3.4 KiB
Development Policies
-
All references to Docker images, Go modules, and packages must use cryptographic hashes. Mutable references (tags,
@latest, etc.) are remote code execution vulnerabilities. -
Every repo with software must have a root
Makefilewith these targets:make test,make lint,make fmt(writes),make fmt-check(read-only),make check(prereqs:test,lint,fmt-check), andmake docker. -
Always use Makefile targets (
make fmt,make test,make lint, etc.) instead of invoking the underlying tools directly. The Makefile is the single source of truth for how these operations are run. -
Every repo should have a
Dockerfile. For non-server repos, the Dockerfile should bring up a development environment and runmake check(the build should fail if the branch is not green). -
Use platform-standard formatters:
blackfor Python,prettierfor JS/CSS,go fmtfor Go. Always use default configuration with one exception: set four-space indents for everything except Go. -
Pre-commit hook:
make checkif local testing is possible, otherwisemake lint && make fmt-check. -
make testmust complete in under 20 seconds. Add a 30-second timeout in the Makefile. -
Docker builds must complete in under 5 minutes.
-
make checkmust not modify any files in the repo. Tests may use temporary directories. -
mainmust always passmake check, no exceptions. -
Make all changes on a feature branch. You can do whatever you want on a feature branch.
-
.golangci.ymlis standardized and must NEVER be modified by an agent, only manually by the user. Copy from~/dev/upaas/.golangci.ymlif available. -
When pinning images or packages by hash, add a comment above the reference with the version and date (YYYY-MM-DD).
-
Use
yarn, notnpm. -
Write all dates as YYYY-MM-DD (ISO 8601).
-
Simple projects should be configured with environment variables.
-
Dockerized web services listen on port 8080 by default, overridable with
PORT. -
README.mdis the primary documentation. Required sections:- Description: First line must include the project name, purpose, category (web server, SPA, CLI tool, etc.), license, and author. Example: "µPaaS is an MIT-licensed Go web application by @sneak that receives git-frontend webhooks and deploys applications via Docker in realtime."
- Getting Started: Copy-pasteable install/usage code block.
- Rationale: Why does this exist?
- Design: How is the program structured?
- TODO: Update meticulously, even between commits. When planning, put the todo list in the README so a new agent can pick up where the last one left off.
- License: MIT, GPL, or WTFPL. Ask the user for new projects.
Include a
LICENSEfile in the repo root and a License section in the README. - Author: @sneak.
-
First commit of a new repo should contain only
README.md. -
Go module root:
sneak.berlin/go/<name>. -
Use SemVer.
-
Pre-1.0.0: modify existing migrations (no installed base assumed). Post-1.0.0: add new migration files.
-
New repos must contain at minimum:
README.md,.git,.gitignoreREPO_POLICIES.md(copy from thepromptsrepo)Dockerfile,.dockerignore- Go:
go.mod,go.sum,.golangci.yml - JS:
package.json