Skip to content

Commit f5bb67a

Browse files
docs(standards): add 10 DEVELOPMENT.md marker sections
Add summary marker sections for coding-practices, git-workflow, release-versioning, ci-cd-pipelines, container-standards, secrets-management, api-cli-design, monitoring-observability, incident-response, and data-handling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 998e772 commit f5bb67a

File tree

1 file changed

+161
-0
lines changed

1 file changed

+161
-0
lines changed

DEVELOPMENT.md

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,167 @@ type(scope): description
7878

7979
<!-- /devrail:commits -->
8080

81+
<!-- devrail:coding-practices -->
82+
83+
## Coding Practices
84+
85+
General software engineering standards that apply across all languages. For the full reference, see [`standards/coding-practices.md`](standards/coding-practices.md).
86+
87+
- **DRY, KISS, YAGNI** -- don't repeat yourself, keep it simple, build only what is needed now
88+
- **Single responsibility** -- each function, class, or module does one thing
89+
- **Fail fast** -- validate inputs at boundaries, return or raise immediately on invalid state
90+
- **No swallowed exceptions** -- every error branch handles the error meaningfully or propagates it
91+
- **Test behavior, not implementation** -- assert on outputs and side effects, follow the test pyramid (unit > integration > e2e)
92+
- **New code must include tests** -- PRs that add logic without tests are incomplete
93+
- **~50 line function guideline** -- split long functions into focused helpers
94+
- **Pin dependency versions** -- commit lock files, update regularly, respond to security advisories promptly
95+
96+
<!-- /devrail:coding-practices -->
97+
98+
<!-- devrail:git-workflow -->
99+
100+
## Git Workflow
101+
102+
Git discipline and collaboration standards. For the full reference, see [`standards/git-workflow.md`](standards/git-workflow.md).
103+
104+
- **Never push directly to `main`** -- all changes reach the default branch through a pull/merge request
105+
- **Branch naming** -- `type/short-description` (e.g., `feat/add-auth`, `fix/login-error`)
106+
- **Minimum 1 approval required** before merging, no self-merge
107+
- **Atomic commits** -- one logical change per commit, conventional commit format
108+
- **No `--force-push` to shared branches** -- only force push your own feature branches
109+
- **Squash-merge feature branches** for clean, linear history on `main`
110+
- **No secrets in commits** -- enforced by gitleaks pre-commit hook and `make scan`
111+
- **Branch protection on `main`** -- require PR, approvals, and CI pass
112+
113+
<!-- /devrail:git-workflow -->
114+
115+
<!-- devrail:release-versioning -->
116+
117+
## Release & Versioning
118+
119+
Release management and versioning discipline. For the full reference, see [`standards/release-versioning.md`](standards/release-versioning.md).
120+
121+
- **Semantic versioning** -- `MAJOR.MINOR.PATCH` with strict adherence after `v1.0.0`
122+
- **Annotated tags only** -- `vX.Y.Z` format, tagged from `main`, never moved or deleted after push
123+
- **Release process** -- review changelog, tag, push, create platform release with artifacts
124+
- **Hotfixes** -- branch from tag, fix, merge to `main`, tag new patch release
125+
- **Pre-release versions** -- `v1.0.0-rc.1`, `v1.0.0-beta.1` conventions for unstable releases
126+
- **Libraries vs services** -- libraries follow semver strictly; services may use date-based versioning
127+
- **Changelog** -- auto-generated from conventional commits, [Keep a Changelog](https://keepachangelog.com/) format
128+
129+
<!-- /devrail:release-versioning -->
130+
131+
<!-- devrail:ci-cd-pipelines -->
132+
133+
## CI/CD Pipelines
134+
135+
Continuous integration and deployment standards. For the full reference, see [`standards/ci-cd-pipelines.md`](standards/ci-cd-pipelines.md).
136+
137+
- **Standard stages** -- `lint → format → test → security → scan → build → deploy` (in order)
138+
- **Stage contract** -- each CI stage calls a `make` target; identical behavior locally and in CI
139+
- **Required jobs** -- lint, format, test, security, scan must pass before merge
140+
- **Deployment gates** -- auto-deploy to staging on merge to `main`; manual approval for production
141+
- **Pipeline types** -- library (test+publish), service (test+build+deploy), infrastructure (plan+apply)
142+
- **Artifact management** -- release tags are immutable, pin toolchain versions, commit lock files
143+
- **Performance** -- cache dependencies, parallelize independent stages, target < 10 min for PR checks
144+
145+
<!-- /devrail:ci-cd-pipelines -->
146+
147+
<!-- devrail:container-standards -->
148+
149+
## Container Standards
150+
151+
Container image build and runtime standards. For the full reference, see [`standards/container-standards.md`](standards/container-standards.md).
152+
153+
- **Pin base images** -- use specific tags or digests, never `latest`
154+
- **Multi-stage builds** -- separate build dependencies from the runtime image
155+
- **Layer ordering** -- least-changing layers first to maximize cache reuse
156+
- **Non-root user** -- never run containers as root in production
157+
- **No secrets in images** -- inject at runtime via env vars or mounted volumes
158+
- **Image tagging** -- `vX.Y.Z` for releases, `sha-<short>` for CI builds, never overwrite release tags
159+
- **Health checks** -- every service container exposes `/healthz` and `/readyz` endpoints
160+
- **`.dockerignore` required** -- exclude `.git`, tests, docs, and build artifacts from the context
161+
162+
<!-- /devrail:container-standards -->
163+
164+
<!-- devrail:secrets-management -->
165+
166+
## Secrets Management
167+
168+
Standards for handling secrets and sensitive configuration. For the full reference, see [`standards/secrets-management.md`](standards/secrets-management.md).
169+
170+
- **Classify correctly** -- secrets vs sensitive config vs environment config vs application config
171+
- **Never in source control** -- no API keys, passwords, or tokens in committed files (enforced by gitleaks)
172+
- **Platform secrets** -- use GitHub/GitLab secrets or a dedicated manager (Vault, AWS SM, GCP SM)
173+
- **`.env` gitignored, `.env.example` committed** -- document required variables with placeholders
174+
- **`UPPER_SNAKE_CASE` naming** -- prefix by service or context to avoid collisions
175+
- **Rotate on schedule** -- 90-day minimum for keys and credentials; immediately on exposure
176+
- **Least privilege** -- no shared credentials, service accounts over personal, audit access
177+
178+
<!-- /devrail:secrets-management -->
179+
180+
<!-- devrail:api-cli-design -->
181+
182+
## API & CLI Design
183+
184+
Standards for designing APIs and CLIs. For the full reference, see [`standards/api-cli-design.md`](standards/api-cli-design.md).
185+
186+
- **Version APIs from day one** -- URL path (`/v1/`) preferred; never break clients without a version bump
187+
- **JSON by default** -- consistent envelope, ISO 8601 timestamps, request IDs in every response
188+
- **Structured errors** -- machine-readable `code`, human-readable `message`, detailed `fields`; correct HTTP status codes
189+
- **CLI conventions** -- `--help` on every command, exit codes 0/1/2, JSON output for machines
190+
- **Backward compatibility** -- additive changes are safe; removals require deprecation + version bump
191+
- **OpenAPI for APIs** -- spec is the source of truth, kept in sync with code
192+
- **Pagination and rate limiting** -- standard patterns for collection endpoints
193+
194+
<!-- /devrail:api-cli-design -->
195+
196+
<!-- devrail:monitoring-observability -->
197+
198+
## Monitoring & Observability
199+
200+
Runtime monitoring and observability standards. For the full reference, see [`standards/monitoring-observability.md`](standards/monitoring-observability.md).
201+
202+
- **Health endpoints** -- `/healthz` (liveness) and `/readyz` (readiness) for every service
203+
- **Structured logging** -- JSON format, correlation IDs, log levels (`debug`, `info`, `warn`, `error`)
204+
- **RED metrics** -- Rate, Errors, Duration for every service; Prometheus-style exposition
205+
- **Alerting** -- alert on symptoms not causes, every alert links to a runbook, minimize noise
206+
- **Dashboards** -- one per service minimum, golden signals visible at a glance
207+
- **Never log PII** -- no secrets, tokens, emails, or government IDs in logs; redact if unavoidable
208+
209+
<!-- /devrail:monitoring-observability -->
210+
211+
<!-- devrail:incident-response -->
212+
213+
## Incident Response
214+
215+
Incident detection, response, and learning standards. For the full reference, see [`standards/incident-response.md`](standards/incident-response.md).
216+
217+
- **Severity levels** -- SEV1 (15 min response) through SEV4 (1 business day)
218+
- **Incident workflow** -- detect → triage → mitigate → resolve → post-mortem
219+
- **Communication** -- status page updates, stakeholder notification cadence per severity
220+
- **Post-mortems** -- required for SEV1-SEV2, blameless, concrete action items with owners and due dates
221+
- **Runbooks** -- required for every production service, stored alongside code, reviewed quarterly
222+
- **On-call** -- defined rotation, clean handoffs, escalation path documented
223+
224+
<!-- /devrail:incident-response -->
225+
226+
<!-- devrail:data-handling -->
227+
228+
## Data Handling
229+
230+
Data classification, privacy, and compliance standards. For the full reference, see [`standards/data-handling.md`](standards/data-handling.md).
231+
232+
- **Data classification** -- public, internal, confidential, restricted; classify at collection time
233+
- **PII handling** -- identify, minimize collection, encrypt at rest and in transit, document what is collected
234+
- **Retention** -- define periods per data type, automate deletion, support right-to-deletion requests
235+
- **Backups** -- regular, tested restores, encrypted, offsite copy, automated
236+
- **Encryption** -- TLS 1.2+ in transit, AES-256 at rest, keys managed via secrets manager
237+
- **Compliance awareness** -- GDPR, CCPA, HIPAA, PCI DSS as applicable; breach notification process documented
238+
- **Never log PII** -- redact or mask if logging is unavoidable; route to restricted log stream
239+
240+
<!-- /devrail:data-handling -->
241+
81242
## Site Architecture
82243

83244
This site is built with [Hugo](https://gohugo.io/) using the [Docsy](https://www.docsy.dev/) theme. Content is written in Markdown and rendered to static HTML.

0 commit comments

Comments
 (0)