Install
openclaw skills install engineering-disciplineProduction-grade AI coding discipline. Prevents the top 4 AI coding sins: acting without thinking, over-engineering, collateral damage, and vague execution. Based on Karpathy's 4 rules + battle-tested additions (3-layer consistency checks, anti-rationalization, verification loops, surgical diffs). Works with Claude Code, Cursor, Copilot, and any AI coding assistant.
openclaw skills install engineering-disciplineApply this skill to every coding session. It's not a task-specific tool — it's a permanent behavior modifier for AI coding assistants.
Especially critical when:
Problem: AI acts on assumptions, not understanding.
Before writing any code:
❌ Bad: "I'll refactor this module while fixing the bug" ✅ Good: "The bug is in line 42. I see the surrounding code could be cleaner, but you only asked me to fix the bug. Should I also refactor?"
Problem: AI defaults to over-abstraction.
❌ Bad: Adding a factory pattern, three interfaces, and a config layer for a simple utility function ✅ Good: One function, clear name, no unnecessary indirection
Problem: AI makes "drive-by" edits to code it wasn't asked to touch.
❌ Bad: "While fixing the auth bug, I also cleaned up the logging format and renamed some variables" ✅ Good: 3 lines changed, all in the auth function, all directly related to the bug
Problem: Vague instructions lead to vague results.
Instead of telling the AI how to do something, give it a success criterion:
❌ "Fix the login bug" ✅ "Write a test that reproduces the login timeout on slow networks, then make it pass"
❌ "Improve the API" ✅ "Response time for /api/users must be under 200ms for 1000 concurrent requests"
The AI iterates better toward measurable goals than fuzzy directions.
💡 Why This Way: LLMs are natural iterators. Given a clear target, they'll loop (generate → test → adjust) until they hit it. Given a vague goal, they'll generate once, declare victory, and move on.
After any change, verify alignment across layers:
Layer 1 — Naming: env vars, DB columns, API paths, config keys must match across all files Layer 2 — Business: design docs ↔ code ↔ UI ↔ API responses must tell the same story Layer 3 — Database: migrations ordered correctly, FK references valid, types match TS interfaces
Run the relevant layer after each change. Run all three on major releases.
Never trust the AI's "I think this looks correct."
For every change type, define a verification action:
| Changed | Verify by |
|---|---|
| Code/script | Execute it |
| Config | Restart + confirm effect |
| Generated file | Check content (wc -l, grep, diff) |
| API call | Check return value |
| UI change | Visual diff before/after |
Before modifying any file:
AI context windows are finite. Polluted context → degraded output.
head -30, don't dump 500 lines)Add to your project's CLAUDE.md:
# Engineering Discipline Rules
[paste the 4 rules + additions above]
Add to .cursor/rules/engineering-discipline.md
These rules work as system prompts, project instructions, or conversation primers for any LLM-based coding assistant.
trinity-harness — Full agent harness with Challenge + Execute + Compound layersself-improving-agent — Continuous learning from mistakesskill-creator — Create new skills from workflowsclawhub star engineering-discipline