-
Notifications
You must be signed in to change notification settings - Fork 0
Best Practices
Status: Complete · The durable habits that keep a team‑of‑one operation healthy over time. Where Operator Techniques are tactical moves, these are standing rules.
Organized by area. Each is a Do / Don't pair so the boundary is unambiguous.
| ✅ Do | ❌ Don't |
|---|---|
| Treat the spec as the source of truth; edit it before code | Patch code directly and "get to the spec later" |
| Write edge cases explicitly — they are the spec | Spec only the happy path |
Version specs/ alongside src/ in the same commit |
Let the spec and code diverge silently |
| Keep one bounded context per spec file | Write a mega‑spec describing three domains |
| Reconcile every hot‑fix back into the spec the same day | Accumulate "spec debt" |
| ✅ Do | ❌ Don't |
|---|---|
Prime with only the relevant slice + spec + .cursorrules
|
Dump the whole repo into the context window |
| Start a fresh context when answers drift | Fight a polluted, stale session |
| Keep files small and single‑responsibility (~100 lines) | Let monoliths grow until the model loses precision |
| Use narrow contracts between contexts | Let agents read across bounded contexts "for convenience" |
| ✅ Do | ❌ Don't |
|---|---|
Self‑documenting features/<slice>/ layout |
Scatter a feature across unrelated folders |
| Split by responsibility | Split arbitrarily just to hit a line count |
| Encapsulate vendor/external code behind an adapter seam | Let a vendor SDK leak into domain logic |
| ✅ Do | ❌ Don't |
|---|---|
| Verify in a fresh, adversarial context | Let the writer be the sole judge |
| Review the diff; flag unrequested scope | Skim the whole file and trust it |
| Add a regression test for every bug before fixing | Fix and move on without a guard |
| Use diverse lenses for high‑blast‑radius changes | Repeat one identical check N times |
| ✅ Do | ❌ Don't |
|---|---|
| Validate and sanitize all external input | Trust generated code to be secure by default |
| Keep secrets in env/secret stores, never in code or prompts | Paste API keys into a chat or commit them |
| Enforce authZ in the spec and test it | Assume the agent added permission checks |
| Review dependencies the agent adds | Auto‑install whatever it suggests |
→ Deep dive: Risks, Security & Governance.
| ✅ Do | ❌ Don't |
|---|---|
| Small, coherent commits tied to a slice | Giant "AI did a bunch of stuff" commits |
| Commit spec + code + tests together | Commit code without its spec change |
Keep main shippable; flag incomplete work |
Leave the trunk broken between sessions |
| ✅ Do | ❌ Don't |
|---|---|
| Score tools against the Zero‑Ops rubric | Adopt a tool that needs a dedicated admin |
| Favour standard exit formats (plain Postgres, portable components) | Accept deep lock‑in for convenience |
| Match the model tier to task entropy | Burn frontier‑model tokens on trivial edits |
These are the operational face of the canonical First Principles (P2, P3, P5, P4, P6). If you forget everything else, keep these:
- The spec is the source of truth. Code that disagrees with the spec is a bug in one of them — reconcile immediately.
- The writer never judges its own work. Verify in a fresh, adversarial context.
- Gate the irreversible. Auth, payments, deletion, schema drops — human decides, never auto.
- Isolate bounded contexts. Isolation is what keeps generation precise.
- You own the output. "The AI wrote it" is not an explanation an operator gets to give.
Reality check. Best practices are a target, not a purity test. Under real deadline pressure you will occasionally hand‑fix and reconcile late, or ship with thinner tests than you'd like. The goal isn't perfection — it's making the deviation deliberate and tracked, not silent and forgotten. A practice you broke knowingly and logged is recoverable; one you broke without noticing is technical debt with compound interest.
See also: Operator Techniques · KPIs & Metrics (how you'll know these are working) · When NOT to Use SAE.
The Sovereign Architect‑Engineer (SAE) Framework · Maintained by Sanjeev Azad · Repository · MIT License · Contribute
- Module 1: The Sovereign Paradigm Shifts
- Module 2: Core Pillars of SAE Architecture
- Module 3: The Digital Org Chart
- Module 4: The Lean SAE Tech Stack
- Module 5: Project Navigation & Metrics
- The End‑to‑End Lifecycle
- Operator Competency Model
- The Verification Doctrine
- Scenario Playbooks
- Operator Techniques
- Best Practices
- KPIs & Metrics
- The Maturity Model
- The Anti-Pattern Catalog
- Risks, Security & Governance
- Governance, Versioning & Stewardship