These conventions target new applications; assess existing ones case by case (building/general).
Scope #
The repository, its instructions and these advisories are context, not a task. Do what the user asked; if the request is unclear, ask before changing, building or deploying. Read an advisory when the agreed work needs its decisions.
Decisions and configuration #
- One version-controlled codebase per application, deployed many times; environment differences live in release configuration, not source copies.
- Read the project's recorded decisions first and ask only about open ones: authentication (
developing/architecture), native versus portable dependencies (deploying/storage) and Prometheus transport (deploying/observability). Record each choice, its reason and nonsecret settings in the project'sAGENTS.md. - Configure endpoints, credentials and environment behavior at runtime, so a backing service can be swapped without a code change. Use the same variable names everywhere and keep each default in one layer.
- Do not add single-use helper wrappers; extract helpers only for actual reuse.
- Write YAML as indented block mappings and sequences. End text files with a newline.
- Git:
developing/git.
Failures and lifecycle #
- Handle only known, recoverable errors, at the operation that can recover, with narrow try blocks. Rethrow anything unrecognized.
- Let unexpected failures fail the request, job or process. Never turn them into success, empty results, blind retries or log-and-continue. Clean up with
finally, defer or context managers. - Run the database operation directly and rely on constraints and specific errors, rather than a preflight existence check.
- Start fast. On SIGTERM stop accepting work and finish or return in-flight work before the deadline. Make jobs idempotent so a retry after abrupt termination has no duplicate effects.
Container process model: building/general. Scheduling and resources: deploying/workloads. Listeners and TLS: deploying/networking.