Files
best-practices/BESTPRACTICES.md
Paul O'Reilly 4fa12d5db8 Add API design and LLM code security best practices
Two new topic files from research:
- api-design.md: Transport security, OAuth2/JWT/mTLS auth, API patterns
  (versioning, pagination, idempotency, rate limiting), input validation,
  secrets handling, zero-trust service mesh patterns. Maps to OWASP API
  Security Top 10.
- llm-code-security.md: Common vulnerabilities in LLM-generated code
  (injection, hardcoded secrets, hallucinated packages, over-permissive
  defaults, IaC risks, crypto mistakes). Includes per-technology review
  checklists and cites 18 research sources (2024-2026).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 10:58:52 +13:00

29 lines
3.1 KiB
Markdown

# Best Practices Index
Generalised best practices extracted from real project work via the `/distill-best-practices` skill. Each topic file is self-contained — read only the files relevant to the current project.
## Topics
- [Validation & Deployment](validation.md) — Validate locally, deploy once; full-chain testing; pre-flight checks
- [Security Architecture](security-architecture.md) — Server boundary rule: no credential crosses to the client; proxy + identity mapping pattern; defense in depth; anti-patterns
- [Secrets Management](secrets-management.md) — SOPS + age, credential handling, file naming, encryption gotchas
- [Git & Source Control](git-source-control.md) — Commit practices, GitOps workflows, remote conventions
- [Kubernetes Patterns](kubernetes.md) — Volume mounts, deployment strategies, naming, bootstrap ordering
- [Helm Charts](helm.md) — Schema validation, version verification, values structure
- [Ansible](ansible.md) — Inventory, templates, idempotency, credential safety
- [Scripting](scripting.md) — Shell conventions, verification scripts, idempotency, colour output
- [Documentation Standards](documentation.md) — CLAUDE.md, MEMORY.md, FUTURE.md, README.md structure and tiered memory
- [Milestones & Reflections](milestones.md) — Milestone workflow, verification, reflection process
- [Debugging Methodology](debugging.md) — Systematic diagnosis, full-chain testing, common pitfalls
- [Claude Code Skills](skills-development.md) — Skill authoring, context injection, tool restrictions
- [Linting & Formatting](linting.md) — Tool choices per language, PostToolUse hook, pre-commit integration, formatter contract
- [Spec-Driven Development](spec-driven-development.md) — Spec structure, requirement numbering, test-first workflow, context tiers, anti-patterns
- [Test-Driven Development](test-driven-development.md) — Edge case discovery, property-based testing, mutation testing, AI agent testing patterns, test architecture
- [Networking & Infrastructure](networking.md) — nftables safety, systemd socket activation, Docker forwarding, TLS SNI vs Host header, wildcard certs
- [Docker UID Matching](docker-uid-matching.md) — UID wrapper entrypoint for mounted volumes, gosu pattern, when to use vs K8s securityContext
- [Database Selection](database-selection.md) — SQLite is not a production database; always use PostgreSQL for services with FQDNs, multiple consumers, or concurrent access
- [Docker](docker.md) — gosu PID 1, GIT_SSH_COMMAND scope, slim image health checks, buildx local images, default users, TTY flags, UID resolution
- [API Design](api-design.md) — Transport security, auth (OAuth2/JWT/mTLS), versioning, pagination, error handling, idempotency, rate limiting, input validation, zero-trust patterns
- [Octopus Process Templates](octopus-process-templates.md) — OCL syntax, step template references, channel scoping, parameters, versioning, Platform Hub patterns
- [LLM Code Security](llm-code-security.md) — Security vulnerabilities in AI-generated code: injection flaws, hardcoded secrets, hallucinated packages, over-permissive defaults, IaC risks, crypto mistakes, review checklist