Skip to content

Free public course · 13/40

Chapter 13: Effective Constraints: Negative-Space Design and Modular Decoupling

Lesson objectives

Required artifact: negative-space constraint table

  1. O1 · Can distinguish the scope, owner and handoff between allowed behavior and forbidden behavior (artifact: negative-space constraint table)

    Evidence: The negative-space constraint table states the scope and owner of both allowed behavior and forbidden behavior

  2. O2 · Can construct a negative-space constraint table with inclusions, exclusions and human acceptance conditions (artifact: negative-space constraint table)

    Evidence: The negative-space constraint table contains at least one exclusion, one handoff and one acceptance condition

  3. O3 · Can constrain a module with allowed and forbidden behavior without prescribing implementation (artifact: negative-space constraint table)

    Evidence: The artifact gives one module allowed behavior, forbidden behavior, interfaces and a counterexample

Before this lesson: Chapter 12: Architecture Design: The Art of the Blueprint (CONTEXT.md)

Novice path

Chapter transfer task: Can constrain a module with allowed and forbidden behavior without prescribing implementation. Use the diagram's boundary relationship to complete the first evidence item in the negative-space constraint table, then check each owner and decision rule.

Experienced path

Apply this task to a current project before reading the explanation: Can constrain a module with allowed and forbidden behavior without prescribing implementation. Submit the negative-space constraint table, then check the relationship type, missing evidence and authority boundary.

Chapter 13 teaching diagram for the negative-space constraint table
Use boundaries, handoffs and acceptance conditions to test the negative-space constraint table; do not collapse the three elements into one responsibility.
Diagram text description

A dashed frame marks the scope of the negative-space constraint table. Three cards represent allowed behavior, forbidden behavior and module interface. Arrows show defined handoffs, not interchangeable responsibilities; crossing the frame or lacking acceptance evidence requires a stop and escalation.

Relationship semantics: The dashed frame is the responsibility boundary; handoffs connect the three elements, and work stops when evidence or authority crosses that boundary.

Adapted public course. Concepts, procedures and examples are adapted from the internal textbook. Case sizes, timings, improvement figures and target thresholds are illustrative, not site delivery results or universal standards. Verify tools, platforms and skills in your environment. Prompts do not grant permissions and retry counts do not authorize recovery. Preserve work and verify targets, sharing and external-state effects first.

Lesson explanation

Chapter 12 established the project blueprint. This chapter adds implementation constraints, starting with the documents’ distinct responsibilities:

DocumentQuestion answeredContent ownership
CONTEXT.md: project blueprintWhat are we building, and why?Overview, core terminology, tech stack and rationale, data model, API contracts, directory layout, milestones; full structure in Chapter 12, Section 12.2
ARCHITECTURE.md: constraints constitutionWhich implementation approaches are unacceptable (how-not-to)?Prohibitions, red lines, negative-space boundaries, lessons learned

The blueprint owns project facts; the constitution references the blueprint and limits implementation choices. For example, API fields and return values belong in CONTEXT.md, while “do not bypass authentication” and “do not silently break interface compatibility” belong in ARCHITECTURE.md. Cross-reference both documents. If changed facts touch a red line, resolve the conflict and record the decision before changing the implementation.

13.1 Three Essential Documents Beyond the Blueprint: AGENTS.md (AI Code of Conduct), ARCHITECTURE.md (the Architectural Constitution), and CHANGELOG.md (the Voyage Log)

In the age of AI, the value of documentation has undergone a “fusion-level leap.” In the past, documentation was “written for humans to read,” an “appendage” to the code; now, documentation in the AI era is, first and foremost, “written for machines to read” — it is the “law” of the codebase and a “generation directive.” It has evolved from a passive “manual” into an active “constrainer.”

A well-maintained project documentation set is, to an AI, what “Newton’s laws” are to the physical world. It is not “advice”; it is a set of foundational rules that must be obeyed and that constitute its worldview. Based on practice, three documents are absolutely essential — they form the “troika” of the AI constraint system:

Document one: AGENTS.md (or CLAUDE.md, depending on the model you use) — the AI code of conduct and role definition. It is the AI’s “employee handbook,” specifying what it may do, what it may not do, and the role it should play. It includes:

  • Persona and identity: What role do you want the AI to play? A clear persona activates the AI’s knowledge weights in a specific domain;
  • Core directives: Global commands, such as “the code must be in English” or “do not say ‘I am just a language model’”;
  • Required document reading: Read technologies and versions in CONTEXT.md and implementation boundaries in ARCHITECTURE.md; do not maintain duplicate lists in the code of conduct;
  • Absolute prohibitions: Things the AI is never, under any circumstances, allowed to do;
  • Output formatting: How you want the AI to format its answers.

Document two: ARCHITECTURE.md — the project’s constraints constitution. It answers “which implementation approaches are forbidden”: absolute prohibitions, red lines that trigger a pause or review, deliberately excluded design space, and lessons learned from failures. Reference CONTEXT.md for the tech stack, data model, API contracts, and directory layout (see Chapter 12, Section 12.2), instead of maintaining four duplicate sections. Lessons record the trigger, failure consequences, corresponding rule, and verification method so prohibitions are traceable.

Document three: CHANGELOG.md — the log of project evolution and state memory. It is the project’s “voyage log,” letting the AI “recall” at any moment what has already been done and which stage the project is in. Each entry contains: the date, what was implemented, key decisions, and the next step.

How to use these three documents? Every time you start a new development session, or after running /clear to reset, your first instruction is always:

“Read root CONTEXT.md, .docs/AGENTS.md (the corresponding CLAUDE.md file in projects using it), .docs/ARCHITECTURE.md, and .docs/CHANGELOG.md. Restate the project goal, applicable red lines, and latest progress; flag conflicts first. According to the log, the next task is the login page. Locate the file using the blueprint’s directory layout before starting.”

This instruction acts like a “boot disk,” instantly loading into the AI’s mind all of your project’s core rules, its full architecture, and the latest progress. It turns a “general-purpose” large model into a “domain expert” dedicated to your project.

For full templates, see Appendix D, “Project Documentation Templates.”

Sources and boundaries

Registered sources support only the external claims used here. The negative-space constraint table, example numbers and exercise scenario are internal instructional design and require project-specific validation.

  • OWASP risks for LLM applications

    OWASP Foundation · 2026-09-17 · Model output, sensitive information, tool permissions and human control require explicit risk boundaries.

Record lesson practice

When you are signed in, your ticks are saved to your account. When you are not, they last only while this page is open. A self-check is not a review or certification, so keep your own evidence and note any gaps.

Save my practice

You can read the exercises without signing in. With an account, your practice text, plain-text attachments and the self-assessment for each submission can be saved to it. Unsaved input is lost when you leave the page or switch accounts.

Go to the learning hub for more free practice →