Prepare context & input-spec quality
New“Garbage spec → garbage code.” Prepare business context, constraints, project conventions and input/output examples before AI generates anything.
Humans set direction, AI executes, the system controls, humans hold final accountability — a seven-stage process with quality gates and a cross-cutting security track.
Humans direct — AI executes — the system controls — humans hold final accountability.
If code diverges from spec, spec wins; if code is more correct, update the spec at once to prevent drift.
Generating code is nearly free; the real cost is verification and review. Optimize around the new bottleneck.
Every AI action is traceable — which prompt, which agent, who approved — mandatory in regulated domains.
From context preparation to production feedback — each stage has a Definition of Done and a control gate.
“Garbage spec → garbage code.” Prepare business context, constraints, project conventions and input/output examples before AI generates anything.
Separate “understanding the client's business problem” from “writing the technical spec.” Don't turn raw requests into a spec without the analysis step in between.
Define what AI may decide autonomously and what requires human approval. The output is a risk map that flags high-risk modules in advance.
AI implements from the spec and knows to ask back on ambiguity instead of guessing. The real loop happens inside this stage.
Don't stop at test + lint. Natural-language specs must evolve into verifiable forms: Given/When/Then, input→output examples, property/invariant tests.
Not folded into general review. Runs alongside stages 4–5, automated (SAST, secret scan, data-leak checks) plus human approval. AI is especially prone to leaking sensitive data, loosening authorization, or hard-coding secrets while still passing tests.
Don't read every line — but don't “trust AI and skip” either. Prioritize by the risk map (stage 2) and keep diffs small enough to actually read the critical parts.
Turn the process into a learning loop. The strongest learning comes from observing the live system (observability) → fed back into the spec and risk map.
Stage 6 feeds back into stage 1 — the process never “closes,” it keeps learning.
This framework keeps the spirit that humans hold final accountability, while fixing three common weaknesses: it makes spec-checking concrete, adds an independent security track, and places the learning loop at the right altitude — with explicit DoDs and gates so the process is executable, not just theory.