LLM Interaction Contract

This contract defines the authority, safety, interaction, and output rules for tasks in this project.

Five concepts run through the project: requirements determine what must be true, tasks determine what work is authorized, the workflow determines how authorized work is executed, verification provides evidence that the result satisfies the applicable requirements, and acceptance is the human’s decision that the result is acceptable.

1. Instruction Precedence

Instruction precedence, from highest to lowest, is:

  1. System and platform instructions.
  2. Non-overridable safety and privacy constraints (section 8; prompts/common/02-universal-rules.md Privacy-Boundary Rules).
  3. Explicit human instructions in the current task.
  4. This contract.
  5. The workflow.
  6. Feature requirements.
  7. Global requirements.
  8. Conventions.
  9. Examples and descriptive documentation.

A higher-priority instruction overrides a lower-priority one only when they conflict.

2. Authoritative Project Rules

Every project rule has exactly one authoritative file, listed here. A rule restated in another file is a pointer, not authority: when two files disagree, the higher precedence class in section 1 wins, and the lower file is the defect.

This table records authority and precedence. What each file defines is described in prompts/README.md and in the directory README the file belongs to.

Rule file Precedence Applies
prompts/01-contract.md contract always
prompts/02-workflow.md workflow always
prompts/features/*.md feature requirements only when referenced by the task or by a feature dependency, transitively
prompts/common/02-universal-rules.md global requirements always
prompts/03-conventions.md conventions always
prompts/flavors/01-semantic-sort-naming.md conventions always
prompts/flavors/02-cpp-conventions.md conventions only when the task targets C++
prompts/capabilities/*.md conventions only when the task touches that capability
prompts/how-to-write-tasks.md conventions when a task is written, interpreted, or validated
prompts/how-to-write-features.md conventions when a feature file is written or validated
prompts/how-to-write-episodes.md conventions when an episode is written, dispatched, or validated
prompts/how-to-write-research.md conventions when a study series or a decision record is written
prompts/episodes/01-episode-template.md conventions when an episode is written
prompts/episodes/02-episode-plan.md conventions when work is planned by phase
records/README.md conventions when a record is written
tests/README.md conventions when a test is added
tools/*.md conventions only when that tool is used
prompts/common/03-glossary.md descriptive as a reference when a term’s meaning decides the work; it defines terms and states no rule
prompts/README.md, prompts/features/00-features.md, prompts/tasks/00-tasks.md, prompts/episodes/00-episodes.md descriptive orientation only
README.md, AGENTS.md, documents/*.md descriptive as context

3. Task Execution Rules

Every task must follow prompts/02-workflow.md.

4. Response Phases

The response phase depends on the task state:

A clarification question is always permitted output, regardless of the task’s requested format.

Working aids and response form:

5. Output Rules

6. Correction Rules

7. File System Rules

The canonical root-level files are:

Tool-specific root-level files and directories are permitted when a file under tools/ declares them:

All new files must be placed in the correct directory:

Protected paths are never a task target:

Also:

8. Safety Rules

9. Consistency Rules

10. Human Override