Level 4

Use AI for coding — without surrendering engineering

AI can accelerate design, implementation, debugging, review and testing. The important step is to make the project rules and verification stronger than the model's urge to produce a plausible answer quickly.

The coding loop

1. Read before changing

Require the AI to inspect the authoritative design, relevant code and configuration before proposing a fix.

2. Diagnose root cause

Avoid “make the symptom disappear” patches. Ask which mechanism or invariant is actually wrong.

3. Change narrowly

Patch the smallest correct region and preserve valid logic. Large rewrites create unnecessary new failure surface.

4. Keep control in config

Tunable behavior belongs in configuration, not magic constants embedded in code.

5. Test the contract

Add a regression test that would have caught the original failure. Deterministic systems should remain deterministic.

6. Verify the real product

A green pipeline is useful evidence, not the finish line. Run the actual behavior and inspect the result.

Example: ask for a proper bug investigation

Goal: fix the underlying defect, not hide the symptom.

Before proposing code:
- read the relevant design/rules and cite them
- trace the current behavior end to end
- identify the first point where actual behavior diverges from intended behavior
- distinguish root cause from downstream symptoms

Constraints:
- no silent fallback
- no hardcoded tuning values
- reuse existing utilities/mechanisms
- patch, do not rewrite unrelated valid logic
- preserve deterministic decision paths

Output:
1. observed failure
2. intended behavior and authority
3. root cause
4. smallest complete fix plan
5. regression test
6. real-run verification plan

Do not call the work complete merely because the code compiles or tests pass.
This is where “AI commandments” become valuable. Persistent project rules keep the model from rediscovering your engineering philosophy in every conversation.
Read the Commandments Level 5: tools and APIs →