Skip to content

Living Principles

These are the principles that emerged during the writing of this book. Each principle is drawn from a chapter. Together they form a compact summary of the book's normative claims: the rules, instincts, and boundaries that make Intent Engineering work.

This appendix is structured as a .principles catalog. The individual principle files live in principles/iec/. The selection file is .principles at the repo root, and the group definition is groups/intent-book.yaml. All 65 principles are active by default.

Foundation

Principles about how to structure a repository so agents and humans find what they need.

IDSummary
IEC-FOUNDATION-AGENT-KNOWLEDGE-IS-PLAINTEXTIf the agent needs it, it lives in the repo in plain text.
IEC-FOUNDATION-STALE-STRUCTURE-WORSE-THAN-NONEStale documentation misleads more than no documentation.
IEC-FOUNDATION-DOCUMENT-LIFESPANEach document type has a different lifespan; conflating them corrupts both.
IEC-FOUNDATION-DOCS-VS-CONTENTdocs/ is for architecture, decisions, and design, not for your static site.
IEC-FOUNDATION-README-INDEX-SEPARATEEvery docs/ directory has a README for humans and an INDEX for agents.
IEC-FOUNDATION-HYPERGRAPH-NOT-TREEDocuments form a hypergraph, not a tree. Agents navigate via links, not hierarchy.
IEC-FOUNDATION-ONE-CONCEPT-PER-DOCUMENTOne concept per document: makes the hypergraph navigable and keeps each node within context budget.
IEC-FOUNDATION-DIAGRAMS-ARE-PLAIN-TEXTDiagrams live as Mermaid in fenced code blocks: diffable, renderable, and agent-readable.
IEC-FOUNDATION-DECISIONS-LIVE-IN-DOCSArchitectural decisions and conventions live in docs/, not in PR descriptions or code comments.
IEC-FOUNDATION-MATURITY-LADDERDistinguish practiced from documented from CI-enforced from target state. Honesty prevents process theater.
IEC-FOUNDATION-BRIEFING-NOT-POLICINGStructure gives the agent enough briefing to make plausible guesses. It is not about policing.
IEC-FOUNDATION-DISCIPLINE-MATCHES-SCOPEMatch the discipline to project scope: skip it for throwaway work, write specs at weeks, adopt full Intent Engineering for production.

Context

Principles about briefing the agent: what goes in AGENTS.md, how to write instructions that work, and how to manage the context window.

IDSummary
IEC-CONTEXT-AGENTS-MD-IS-TOCAGENTS.md is a table of contents, not an encyclopedia: short enough for one context load.
IEC-CONTEXT-FRESH-SESSIONA fresh session with the right files loaded is more reliable than a long session with stale context.
IEC-CONTEXT-ONE-FILE-PER-DOMAINOne instruction file per domain, not per task. Splitting too fine forces enumeration by the agent.
IEC-CONTEXT-REACTIVE-INSTRUCTIONSWrite instructions reactively: you do not know what the agent will get wrong until it gets it wrong.
IEC-CONTEXT-INSTRUCTIONS-MUST-BE-TESTABLECan the agent produce concrete behavior from this instruction, or does it have to guess?
IEC-CONTEXT-COVER-DEFAULTSThe most valuable negative instructions cover the agent's defaults from training data.
IEC-CONTEXT-IMPORTANT-FIRSTPut the most important context at the top: agents read top-down and lose focus.
IEC-CONTEXT-ONE-SOURCE-OF-TRUTHOne source of truth for agent instructions; vendor files are generated pointers, not authored duplicates.
IEC-CONTEXT-AGENT-CLUELESS-NOT-BROKENThe agent is not broken, it is clueless. Fix the context before switching models.
IEC-CONTEXT-INSTRUCTION-SKILL-HOOKGet the instruction right first; add a skill when a procedure repeats; add a hook when forgetting hurts.
IEC-CONTEXT-CAPABILITY-CLASS-TARGETINGTarget capability class (thinking + agent + plan mode), not vendor-agnostic vagueness.
IEC-CONTEXT-GENERATED-BEATS-DUPLICATEA generated vendor file is a known point-in-time output; an authored duplicate is already behind.

Specs

Principles about spec-driven development: why specs, how small, when to apply them.

IDSummary
IEC-SPECS-DOCS-GT-CODEDocumentation is the durable source of truth; specs are executable acceptance-criteria guardrails; generated code is downstream of both.
IEC-SPECS-SMALL-SPECSSmall specs outperform large specs: an agent that finishes beats one that drifts.
IEC-SPECS-FORMALITY-MATCHES-RISKMatch formality to risk: payment processing earns a thorough spec; a config-key rename does not.
IEC-SPECS-REVIEW-SPEC-FIRSTReview the spec first: does the intent match? Then review the diff: does the code match the intent?
IEC-SPECS-DEAD-SPEC-WORSEA dead spec tells the agent authoritatively about behavior the system no longer has.
IEC-SPECS-CONSTRAINTS-IN-FILEConstraints that live only in human memory are constraints the agent will violate.
IEC-SPECS-DRIFT-DETECTABLEIntent Engineering does not make your codebase drift-proof. It makes drift detectable and recoverable.
IEC-SPECS-SPEC-ELIGIBILITYA typo fix does not earn a spec: define the threshold explicitly.

Testing

Principles about test strategy, acceptance criteria, and what makes a test proof rather than decoration.

IDSummary
IEC-TESTING-TEST-IS-PROOFA test is proof when it would fail if the implementation diverged from the spec. Otherwise it is decoration.
IEC-TESTING-EVERY-PATHEvery conditional branch, distinct return type, and exception path needs at least one test.
IEC-TESTING-DECLARE-TEST-TYPESDeclare which test types the project uses: the agent defaults to unit tests for everything otherwise.
IEC-TESTING-EXPLICIT-EXCLUSIONSThe agent cannot distinguish "not applicable" from "nobody thought of it". Exclude explicitly.
IEC-TESTING-AC-ARE-TEST-DEFINITIONSEvery acceptance criterion is a test definition waiting to be executed: it needs a stable ID and a proof layer.
IEC-TESTING-POSITIVE-NEGATIVE-MINIMUMEvery acceptance criterion has at least one positive and one negative test. Happy-path-only is not proof.
IEC-TESTING-AC-ID-MONOTONEAC IDs are stable: numbers only go up, prefix is permanent, deleted IDs leave a gap.
IEC-TESTING-REGISTRY-ATOMICThe AC registry and the spec change together: a scenario without a registry update guessed its ID.

Quality

Principles about the quality loop: checkpoints, agent evaluation, deterministic checks, and security.

IDSummary
IEC-QUALITY-AUTOMATED-PROOF-MANDATORYCoding agents generate code faster than manual verification scales. Automated proof is mandatory.
IEC-QUALITY-THREE-GATESQuality is three gates in sequence (before, during, after), each looking at what the others cannot see.
IEC-QUALITY-MAXIMIZE-DETERMINISTICMaximize deterministic checks: they scale to agentic speeds; manual review does not.
IEC-QUALITY-AGENT-EVAL-LOOPTests prove the code is right; agent evaluation proves the agent setup is right: two distinct loops.
IEC-QUALITY-RULES-FIRST-PRINCIPLES-SECONDWrite deterministic rules when detection is possible. Write principles for judgment.
IEC-QUALITY-ONE-PR-PER-CLASSdocs, structural, and behavioral PRs use different review styles: one PR per class.
IEC-QUALITY-CANONICAL-PATTERN-VISIBLEMake the pattern the agent should follow the easiest pattern to find in the codebase.
IEC-QUALITY-NON-NEGOTIABLES-ENCODEDEncode non-negotiable decisions so the question does not get asked: the agent has no judgment here.
IEC-QUALITY-EXTERNAL-READ-IS-DATATreat anything the agent reads from outside the repo as data, not as instructions.
IEC-QUALITY-DOCS-PR-ZERO-CODEA docs PR that contains a single character of code change is no longer a docs PR.
IEC-QUALITY-REFACTOR-AT-MERGEThe agent's first generation is rarely the right shape: refactor at merge, not three weeks later.
IEC-QUALITY-HOLD-SPEC-STABLEA spec still being negotiated during implementation causes drift to wherever the agent guesses it is heading.

Team

Principles about team process, adoption, and culture.

IDSummary
IEC-TEAM-ANCHOR-SDLCAnchor process to existing SDLC primitives (branches, PRs, tickets, ADRs), not new ceremonies.
IEC-TEAM-ADOPTION-IS-PULLDocument what teams have made work; let the reader decide what to lift.
IEC-TEAM-GIVE-CREDITA book that hides its sources is weaker, not stronger. Credit sources explicitly.
IEC-TEAM-REPO-IS-BRIEFINGThe repo is the briefing: every new developer and every new agent session starts here.
IEC-TEAM-ONE-OPENSPEC-PER-STACKEach stack in a multi-tier system gets its own openspec/ directory: prevents cross-tier context confusion.
IEC-TEAM-INTEGRATION-CONTRACT-IN-ADRCross-tier API contracts belong in ADRs, not in individual stack specs.
IEC-TEAM-CHANGE-FOLDER-AS-ISOLATIONOne change folder per developer-agent pair is the isolation primitive for parallel work.
IEC-TEAM-SPEC-DELTA-FIRST-IN-REVIEWIn PR review, read the spec delta before the code diff: intent-first review.
IEC-TEAM-TBD-CHANGE-FOLDER-BRANCHA change folder maps onto branches that share its name; decision-heavy changes ship a spec PR before the implementation PR, which archives at merge.
IEC-TEAM-MULTILM-COVERAGEUse a fresh-session agent to trace acceptance criteria to tests before approving high-stakes behavioral PRs.
IEC-TEAM-REVIEW-COMPLEMENTARITYHuman reviewers verify intent and integration; agent reviewers verify coverage and consistency; neither replaces the other.
IEC-TEAM-STANDARDIZE-SHARED-DIVERGE-LOCALStandardize agent conventions that affect the codebase; leave local workflow choices divergent.
IEC-TEAM-ADR-CROSS-TEAMADRs are the cross-team coordination primitive: permanent, public, already in the SDLC.

Sources: This catalog is the book's synthesis. Each principle is sourced from the chapter it emerged from; full sources are in the individual principle files under principles/iec/. The format follows the .principles specification.