ce-ai
AGENTS.md6 starsChanged 20 days agoMITView on GitHub
This document defines mandatory instructions, architectural boundaries, and operational constraints for AI agents (including Gemini, Antigravity, OpenCode, Claude, Cursor, Copilot) working within or interacting with the ce-ai codebase. All AI agents MUST enforce these hard invariants deterministically at every session start: 1. Never Direct Commit to main: All changes MUST be committed on feature branches (feat/* or fix/*) and opened as a PR (gh pr create). 2. 100% Green CI Matrix Gate: NEVER merge a PR until ALL GitHub Actions…
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- sequential-thinkingSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
24 rules. About 0 are common, 11 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 9
All AI agents MUST enforce these hard invariants deterministically at every session start:
- Very specific: line 10
Never Direct Commit to
main: All changes MUST be committed on feature branches (feat/* or fix/*) and opened as a PR (gh pr create). - Very specific: line 11
100% Green CI Matrix Gate: NEVER merge a PR until ALL GitHub Actions CI matrix jobs pass (gh pr checks --watch).
- Very specific: line 13
Preserve User Configs: NEVER overwrite unmanaged custom plugins or custom skills in opencode.json.
- Distinctive: line 14
No Dummy Fallbacks: NEVER comment out failing assertions, mask errors with empty catches, or ignore CLI errors.
- Very specific: line 17
Preserve Active Worktrees: NEVER run git worktree remove or delete sibling worktrees in <repo>-worktrees/ without explicit USER permission …
- Very specific: line 18
Mandatory Versioning & CHANGELOG: Every merged feature/fix MUST bump SemVer in Cargo.toml, update CHANGELOG.md, tag release (vX.Y.Z), and …
- Very specific: line 22
Strict Bug Triage Boundary: NEVER file or propose ce-ai report-bug for errors in the host project's domain code or test failures.
- Distinctive: line 28
All AI agent operations on this repository MUST strictly follow:
- Distinctive: line 79
Never suppress errors with dummy fallbacks, empty try-catches, or commenting out failing tests.
- Very specific: line 86
When modifying opencode.json, NEVER delete or replace unmanaged user plugins or custom skills.
- Distinctive: line 107
Every PR description MUST be self-explaining: explicitly declare what was ruled out, which rule decided it, attach empirical verification …
- Very specific: line 110
ALL documentation changes (README.md, docs/, guides) MUST follow the project style guide at docs/references/docs-styling.md.
- Distinctive: line 112
Every document MUST have exactly one Diátaxis intent (tutorial / how-to / reference / explanation).
- Distinctive: line 117
All commits MUST use clean Conventional Commits only.
- Very specific: line 122
All modifications must be verified via scripts/validate-concepts.py or ce-ai doc lint --strict, ensuring existing entries grow …
- Very specific: line 143
When formal specifications are activated for complex or regulated features, specifications and contracts reside under docs/arch/:
- Distinctive: line 153
When to Suggest Architecture Specs: If a proposed feature involves multi-repo contracts, schema migrations, public API mutations, or …
- Very specific: line 161
When creating Pull Requests (ce-commit-push-pr), agents MUST ensure the change explains itself:
- Distinctive: line 165
Pre-Review Automated Checks: Run and verify 100% green status across all local linters, unit tests, and browser/E2E checks BEFORE …
- Distinctive: line 170
Before declaring any task or issue completed, an AI agent MUST satisfy all criteria of the Definition of Done:
- Very specific: line 230
All AI agents MUST follow the 7-stage Compound Engineering development cycle: [Stage 1: Ideation] ➔ [Stage 2: Architecture & Deltas …
- Very specific: line 248
When formal specifications are activated for complex features, OpenSpec is authored progressively in docs/arch/deltas/<feature>/ (or legacy …
- Distinctive: line 255
When creating Pull Requests (Stage 7), agents MUST ensure the change explains itself:
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — AI Agent Operating Directives
This document defines mandatory instructions, architectural boundaries, and operational constraints for AI agents (including Gemini, Antigravity, OpenCode, Claude, Cursor, Copilot) working within or interacting with the ce-ai codebase.
⚡ Hard-Gate Invariant Index (Non-Negotiable Delivery Rules)
All AI agents MUST enforce these hard invariants deterministically at every session start:
- Never Direct Commit to
main: All changes MUST be committed on feature branches (feat/*orfix/*) and opened as a PR (gh pr create). - 100% Green CI Matrix Gate: NEVER merge a PR until ALL GitHub Actions CI matrix jobs pass (
gh pr checks --watch). - Atomic File Writes: Mutations to
state.jsonoropencode.jsonMUST usecrate::state::write_atomic. - Preserve User Configs: NEVER overwrite unmanaged custom plugins or custom skills in
opencode.json. - No Dummy Fallbacks: NEVER comment out failing assertions, mask errors with empty catches, or ignore CLI errors.
- No Semantic Authority & Lean Living Architecture: CE-AI MUST NOT introduce mandatory workflow stages, artifacts, or blocking write gates beyond those defined by Compound Engineering contracts. Living architecture resides in
docs/arch/(system/,adr/,contracts/,deltas/,archive/) anddocs/plans/serves as the sole Single Source of Truth (SSOT) for task progress, eliminating rigid 5-file SDD packages and blocking write gates. - Strict Exit Codes: Map all errors to
CeErrorenum exit codes (0Success,1Runtime,2Usage,3State,4IO,5Network,6Verification). - Preserve Active Worktrees: NEVER run
git worktree removeor delete sibling worktrees in<repo>-worktrees/without explicit USER permission or verifying creation within the current turn. - Mandatory Versioning & CHANGELOG: Every merged feature/fix MUST bump SemVer in
Cargo.toml, updateCHANGELOG.md, tag release (vX.Y.Z), and create a GitHub Release. Homebrew distribution is owned exclusively by themastepanoski/homebrew-ce-aitap (self-updating); no formula is maintained in this repository. - Post-Merge Lifecycle & Clean State: Immediately after merging a PR, switch to
main, rungit pull, delete merged local branches (git branch -d), prune remotes (git fetch --prune), remove turn-created temporary worktrees, and runce-ai workflow status. If any completed architecture deltas or legacy OpenSpec changes exist, the AI agent MUST runce-ai archive <feature>(and submit the corresponding archive PR) so the repository FSM is left at✓ Ready (100%)with zero unarchived change warnings before concluding. - Zero AI Attribution & No Co-Author Trailers: AI agents MUST NEVER add "Co-Authored-By", AI attribution trailers, or "Generated with [Agent]" footers/badges to git commit messages or PR descriptions. All commits MUST use clean Conventional Commits only.
- Monotonic Concept Accretion:
CONCEPTS.mdMUST NEVER suffer destructive deletion or blind overwrite. Agents MUST use surgical edits (Edit/append), execute a mandatory pre-read, and verify changes withce-ai doc lint --strict. - Strict Bug Triage Boundary: NEVER file or propose
ce-ai report-bugfor errors in the host project's domain code or test failures. Upstream bug reporting is strictly reserved for internalce-aibinary/harness crashes and command failures, requiring user consent and zero-token leak sanitization.
🛡️ Governance & Compliance Standards
All AI agent operations on this repository MUST strictly follow:
- ISO/IEC 27001 & 27002: Information Security & Cryptographic Integrity Controls.
- ISO/IEC 42001: Artificial Intelligence Management System (AIMS).
- NIST AI Risk Management Framework (AI RMF 1.0).
📐 Codebase Architecture & Key Boundaries
ce-ai is built in modular Rust (2021 edition) with clean domain separation:
src/
├── main.rs # CLI entry point, Clap subcommand parser, command dispatch
├── error.rs # CeError enum, exit code mapping (Usage=2, State=3, IO=4, Network=5, Verification=6)
├── state/ # State management
│ ├── state.rs # state.json schema & ModelAssignment structs
│ ├── diff.rs # Manifest & filesystem drift calculation (Copy, Restore, Remove)
│ ├── profiles.rs # Model profile snapshots & save/load logic
│ └── mod.rs # Atomic file writer (write_atomic with tempfile + rename)
├── opencode/ # OpenCode harness integration
│ ├── config.rs # opencode.json reader/writer & plugin array preservation
│ ├── manifest.rs # manifest.json SHA256 file index tracking
│ └── plugins.rs # Managed directory paths (~/.config/opencode/compound-engineering)
├── source/ # Plugin package resolution & retrieval
│ ├── archive.rs # Shared tar.gz extraction & source root finder
│ └── github.rs # GitHub release API fetcher & fallback tag resolution
└── commands/ # Subcommand implementations
├── mod.rs # Shared Context struct
├── install.rs # ce-ai install implementation
├── init_prj.rs # ce-ai init-prj project adoption implementation
├── deinit_prj.rs # ce-ai deinit-prj project de-adoption implementation
├── sync.rs # ce-ai sync implementation
├── upgrade.rs # ce-ai upgrade implementation
├── fleet.rs # ce-ai fleet pin/status/sync implementation
├── guard.rs # ce-ai guard agent guardrails & risk policy engine
├── decisions.rs # ce-ai decisions (legacy aliases & deprecated routing)
├── status.rs # ce-ai status implementation
├── uninstall.rs # ce-ai uninstall implementation
└── doctor.rs # ce-ai doctor health check implementationdocs/solutions/ documents solutions to past problems (bugs, best practices, workflow patterns), organized by category with YAML frontmatter (module, tags, problem_type). Relevant when implementing or debugging in documented areas.
CONCEPTS.md defines shared domain vocabulary (entities, named processes, status concepts) for this project. Relevant when orienting to the codebase or discussing domain concepts.
🚫 Mandatory Agent Constraints (DO NOT VIOLATE)
- No Superficial Symptom Patches:
- Never suppress errors with dummy fallbacks, empty try-catches, or commenting out failing tests.
- Trace root causes to upstream logic.
- Atomic Writes Only:
- Filesystem mutations targeting
state.jsonoropencode.jsonMUST usecrate::state::write_atomic. Direct unbuffered file overwrites are forbidden.
- Filesystem mutations targeting
- Preserve User Configurations:
- When modifying
opencode.json, NEVER delete or replace unmanaged user plugins or custom skills. Always parse the JSON structure, update targeted keys, and re-serialize cleanly.
- When modifying
- 100% Verification Before Hand-off:
- Agents MUST verify changes by running:
cargo fmt --check cargo clippy --all-targets --all-features -- -D warnings cargo test make e2e
- Agents MUST verify changes by running:
- No Semantic Authority & Lean Living Architecture:
- CE-AI must not require artifacts that Compound Engineering itself does not require. Living architecture specifications reside in
docs/arch/and implementation plans indocs/plans/serve as the SSOT for progress. 5-file OpenSpec packages are not mandatory blockers for bug fixes, docs, or routine tasks.
- CE-AI must not require artifacts that Compound Engineering itself does not require. Living architecture specifications reside in
- Standardized Exit Code Compliance:
- Errors MUST map to standard
CeErrorexit codes:0(Success),1(Runtime),2(Usage),3(State),4(IO),5(Network),6(Verification).
- Errors MUST map to standard
- Mandatory Pull Request Workflow (No Direct Push to
main):- Direct commits and pushes to
mainare strictly forbidden for feature development, refactoring, and bug fixes. - Agents MUST create feature branches (
feature/<name>orfix/<name>), push to origin, and open a Pull Request (gh pr create). - PRs must wait for 100% green GitHub Actions CI status checks before merging.
- Every PR description MUST be self-explaining: explicitly declare what was ruled out, which rule decided it, attach empirical verification evidence in collapsible blocks upfront, and verify all automated checks pass before requesting review.
- Direct commits and pushes to
- Documentation Style Compliance (Diátaxis + Cognitive Load):
- ALL documentation changes (
README.md,docs/, guides) MUST follow the project style guide atdocs/references/docs-styling.md. README.mdMUST stay ≤ 100 lines: title + what/why, Quick Path (install → first command → verification), then an audience-labeled documentation map. Deep internals belong indocs/, never inline.- Every document MUST have exactly one Diátaxis intent (tutorial / how-to / reference / explanation). Do not blend quadrants within a section.
- Documentation must self-route two audiences: newbies via the Quick Start tutorial path, seniors directly to reference/architecture.
- ALL documentation changes (
- Zero AI Attribution & No Co-Author Trailers:
- AI agents MUST NEVER add "Co-Authored-By", agent attribution trailers, or "Generated with [Agent]" footers/badges to git commit messages or PR descriptions.
- All commits MUST use clean Conventional Commits only.
- Monotonic Concept Accretion & Anti-Clobber Protection (
CONCEPTS.md):
- During Stage 6 (
ce-compound/ Vocabulary Capture), agents MUST readCONCEPTS.mdimmediately before editing. - Agents MUST use surgical in-place editing (
Edit/replace_file_content/ append) and NEVER perform full-fileWriteoverwrites that truncate existing terms. - All modifications must be verified via
scripts/validate-concepts.pyorce-ai doc lint --strict, ensuring existing entries grow monotonically. - Reports must state empirical before/after entry counts (e.g.
N entries (was M, +X added, 0 removed)).
- Strict Upstream Bug Triage Boundary:
- AI agents operating in consumer projects MUST strictly distinguish between project application bugs and
ce-aiinternal tool defects. - Project-level code, tests, and application logic bugs MUST be diagnosed and resolved locally using Compound Engineering workflows (
ce-debug/ce-work). - Upstream bug reporting (
ce-ai report-bug) is EXCLUSIVELY reserved for internalce-airuntime errors, panics, unexpected CLI failures, and harness sync failures, subject to explicit user consent and zero-leak sanitization.
🔄 Mandatory 7-Stage Development Cycle & Lean Living Architecture
Regardless of whether Compound Engineering, agile fast-path, or pair programming workflows are used, all AI agents MUST strictly follow the 7-stage development cycle:
[Stage 1: Ideation (ce-brainstorm)] ➔ [Stage 2: Architecture & Contracts (OPTIONAL)] ➔ [Stage 3: Execution Plan (ce-plan)]
➔ [Stage 4: TDD & Implementation (ce-work)] ➔ [Stage 5: Verification (project quality gates)]
➔ [Stage 6: Knowledge Capture (ce-compound)] ➔ [Stage 7: Git Shipping (ce-commit-push-pr)]Stage 2 Living Architecture & Contracts (Optional)
When formal specifications are activated for complex or regulated features, specifications and contracts reside under docs/arch/:
docs/arch/system/<domain>.md: Living domain specifications aggregating capabilities across features.docs/arch/adr/NNNN-<slug>.md: Architecture Decision Records capturing irreversible technical choices.docs/arch/contracts/: Formal interface schemas and protocol contracts.docs/arch/deltas/<feature>/: Optional active architecture delta requirements, automatically promoted to system specs upon archive.
Stage 3 (/ce-plan) creates the executable implementation plan in docs/plans/ as vertical Scrum slices with TDD test triads. The checklist - [x] in docs/plans/ serves as the sole Single Source of Truth (SSOT) for progress tracking and FSM stage deduction, eliminating redundant tasks.md packages.
💡 Proactive Architecture Triage & Guidance for Developers
AI agents MUST actively guide developers (especially onboarding/newbie contributors) on when to use formal architecture specifications:
- When to Suggest Architecture Specs: If a proposed feature involves multi-repo contracts, schema migrations, public API mutations, or estimated scope > 200 LOC, the agent MUST proactively ask the developer:
"Esta funcionalidad tiene impacto arquitectónico o contratos (> 200 LOC). ¿Deseas que formalicemos especificaciones en
docs/arch/(o deltas endocs/arch/deltas/<feature>/) para congelar el contrato antes de escribir código, o prefieres proceder con un plan ágil directo (docs/plans/)?" - When to Bypass: For bug fixes, minor tweaks, documentation updates, or tactical tasks (< 200 LOC), agents MUST NOT require or suggest formal architecture specs; proceed directly with
/ce-plan,ce-work, orce-debug.
Single Source of Truth Rule
Ideation artifacts (docs/brainstorms/*.md, docs/ideation/*.md) are disposable inputs, NOT parallel specifications. Distill their conclusions into architecture specs or implementation plans and reference the source doc instead of copying content. Never maintain brainstorm/ideation documents in sync with implementation plans — that duplicates work and burns tokens. Ideation artifacts are retained by default as the permanent raw-history record that living specs deliberately do not duplicate — "disposable" never means deleting them; removal is an ordinary reversible git decision, never a workflow step. Skip ideation skills entirely when requirements and approach are already clear.
Stage 7 PR & Review Readiness Directives ("A Change That Explains Itself")
When creating Pull Requests (ce-commit-push-pr), agents MUST ensure the change explains itself:
- What It Ruled Out: State rejected alternatives and discarded trade-offs (distilled from OpenSpec
exploration.md). - Which Rule Decided It: Cite the specific invariant, rule, architectural boundary, or compliance constraint (from
AGENTS.mdordesign.md) that determined the solution. - Upfront Evidence: Attach empirical validation proof (test run summaries, CLI logs, reproduction traces, or browser check results) directly to the PR body using collapsible
<details><summary>blocks (not asked for later). - Pre-Review Automated Checks: Run and verify 100% green status across all local linters, unit tests, and browser/E2E checks BEFORE requesting human review or marking the PR ready.
- Reviewer Routing: Identify domain owners or
CODEOWNERSand assign appropriate reviewers.
✅ Definition of Done (DoD) & Technical Justifications
Before declaring any task or issue completed, an AI agent MUST satisfy all criteria of the Definition of Done:
1. Code Quality & Architectural Integrity
- Zero Clippy Warnings (
cargo clippy --all-targets --all-features -- -D warnings):- Justification: Prevents unhandled error cases, memory leaks, unsound unsafe blocks, and performance anti-patterns before runtime compilation.
- Strict Formatting (
cargo fmt --check):- Justification: Ensures consistent codebase style, eliminates whitespace noise in Git diffs, and prevents merge conflicts across different operating systems.
- Atomic Writes (
crate::state::write_atomic):- Justification: Guarantees configuration files (
state.json,opencode.json) are never left corrupted by unexpected process crashes or power loss (NIST SP 800-53 CP-9/CP-10 & ISO 27002 Control 8.9 compliance).
- Justification: Guarantees configuration files (
- Cross-Platform Path Joining (
PathBuf::join):- Justification: Operating systems use different path separators (Windows
\vs Unix/). Hardcoded slashes cause test failures, path comparison bugs, and file lookup panics on Windows runners.
- Justification: Operating systems use different path separators (Windows
- Preservation of Unmanaged User Configurations:
- Justification: Users rely on custom plugins and custom skills in
opencode.json. Clobbering user keys destroys user configuration; targeted JSON merging protects user customization.
- Justification: Users rely on custom plugins and custom skills in
2. Testing & Empirical Verification
- 100% Passing Unit & Integration Tests (
cargo test):- Justification: Prevents functional regressions in archive extraction, manifest indexing, state diff calculation, and exit code mappings.
- Containerized Docker E2E Gate (
make e2e):- Justification: Validates real-world installation, sync, model setting, and uninstallation in a clean, isolated Linux container environment independent of host machine state.
- 100% Green Cross-Platform CI Matrix:
- Justification: Native binaries behave differently across operating systems. Verifying Linux (
ubuntu-latest), macOS (macos-latest), and Windows (windows-latest) guarantees multi-platform reliability.
- Justification: Native binaries behave differently across operating systems. Verifying Linux (
- Windows PowerShell Installer Gate (
install.ps1):- Justification: Automatically verifies
scripts/install.ps1downloads, extracts, and validatesce-ai.exeexecution on nativewindows-latestGitHub Actions runners.
- Justification: Automatically verifies
- Automated PR Rejection on CI Failure:
- Justification: Enforces zero-tolerance for broken code on
main. Automatically blocks PR merges and requests changes when any CI or security check fails.
- Justification: Enforces zero-tolerance for broken code on
3. Compliance, Governance & Security
- ISO/IEC 27001/27002 Compliance (SHA256 Manifests &
cargo-audit):- Justification: Cryptographic SHA256 indexing detects asset tampering or file drift, while
cargo-auditguarantees zero known CVE supply-chain vulnerabilities in third-party crates.
- Justification: Cryptographic SHA256 indexing detects asset tampering or file drift, while
- ISO/IEC 42001 & NIST AI RMF 1.0 Compliance:
- Justification: Scoping model assignments per agent role (
ce-brainstorm,ce-plan,ce-work) ensures capability/cost matching while maintaining transparent state logging.
- Justification: Scoping model assignments per agent role (
- Local Security Pre-Commit Hook (
make hooks/.githooks/pre-commit):- Justification: Scans staged files for secret key leaks, blocks transient metadata (
.atl/,.pi/), and runs formatting/linter/tests before git commit.
- Justification: Scans staged files for secret key leaks, blocks transient metadata (
- Zero Secrets, Tokens, or Transient File Exposure:
- Justification: Prevents catastrophic credential leaks (API keys, SSH keys, bearer tokens) and prevents committing local transient metadata (
.atl/,.pi/,.codegraph/).
- Justification: Prevents catastrophic credential leaks (API keys, SSH keys, bearer tokens) and prevents committing local transient metadata (
4. Documentation & Git Delivery
- SemVer Versioning &
CHANGELOG.mdMaintenance:- Justification: Follows Semantic Versioning (
MAJOR.MINOR.PATCHinCargo.toml). Any breaking API/CLI change bumpMAJOR, new feature bumpMINOR, bug fix bumpPATCH. All notable changes MUST be documented inCHANGELOG.mdfollowing the Keep a Changelog standard.
- Justification: Follows Semantic Versioning (
- Updated User Documentation:
- Justification: Outdated docs create user confusion, improper CLI usage, and support overhead. Any schema, command, or flag change requires updating
README.md,SECURITY.md,CHANGELOG.md, or CLI--helpstrings.
- Justification: Outdated docs create user confusion, improper CLI usage, and support overhead. Any schema, command, or flag change requires updating
- Conventional Commits & Clean Git History:
- Justification: Clear commit messages provide auditability, enable automated changelog generation, and allow easy regression bisecting.
- Self-Explaining Pull Request & Upfront Evidence:
- Justification: Human review is the primary cognitive bottleneck. Stating what was ruled out, which rule decided it, and attaching empirical evidence upfront in collapsible blocks minimizes back-and-forth and prevents unverified claims.
📜 Verification Checklist for Agents
- Code compiles without warnings (
-D warnings). - Formatting complies with
cargo fmt. - All unit and CLI integration tests pass (
cargo test). - Containerized Docker E2E gate passes (
make e2e). - All GitHub Actions CI jobs pass green across Linux, macOS, and Windows.
- Definition of Done (DoD) criteria fully satisfied.
<!-- ce-ai:block begin v=9 tier=full sha256=39c05d9dba534f0624819ce9fead49c213c19e9da13639b96f2960c8bbc34b53 -->🔄 Mandatory 7-Stage Development Cycle & Architecture Guidelines
All AI agents MUST follow the 7-stage Compound Engineering development cycle:
[Stage 1: Ideation] ➔ [Stage 2: Architecture & Deltas (Optional)] ➔ [Stage 3: Execution Plan]
➔ [Stage 4: TDD & Implementation] ➔ [Stage 5: Verification] ➔ [Stage 6: Knowledge Capture]
➔ [Stage 7: Git Shipping]
⚡ Turn-0 Session Directives (Zero-Step Drift Recovery)
ce-ai auto-installs a SessionStart hook on supported harnesses that runs ce-ai workflow resume --json and injects live FSM state (Git working tree, active branch, manifest SHA256 integrity, plan progress) into context before your first turn. If that state is already present at session start, treat it as current — do NOT re-run the command. Only run ce-ai workflow resume yourself when no such context was injected (harness without hook support, or the hook is disabled) or when you suspect the injected state has gone stale mid-session (e.g. after a git operation you didn't make through your own tool calls).
Stage 2 Living Architecture & Deltas (Optional)
Living architecture specifications reside under docs/arch/:
docs/arch/system/: Living domain specifications.docs/arch/adr/: Architecture Decision Records (NNNN-title.md).docs/arch/contracts/: Formal data contracts and API interfaces.docs/arch/deltas/: Temporary feature changes during development.docs/arch/archive/: Archived changes and historical milestones.
CE-AI enforces zero semantic authority: architecture deltas are decoupled from the core workflow as an optional tool for architectural changes (> 200 LOC), schema changes, or cross-cutting features, rather than a mandatory write blocker. For bug fixes, minor tweaks, or tactical tasks (< 200 LOC), proceed directly with /ce-plan or ce-work.
When formal specifications are activated for complex features, OpenSpec is authored progressively in docs/arch/deltas/<feature>/ (or legacy openspec/changes/<feature>/) to establish the frozen Stage 2 contract.
The execution plan and task checklist reside in docs/plans/ (- [x] checkboxes) as the single source of truth for progress.
Single Source of Truth Rule
Ideation artifacts (docs/brainstorms/*.md, docs/ideation/*.md) are disposable inputs, NOT parallel specifications. Distill their conclusions into architecture or plan docs and reference the source doc instead of copying content. Never maintain brainstorm/ideation documents in sync with architecture deltas. Ideation artifacts are retained by default as the permanent raw-history record that specifications intentionally do not duplicate; "disposable" never means deleting them. Skip ideation skills entirely when requirements and approach are already clear.
🚀 Self-Explaining Pull Requests & Review Readiness
When creating Pull Requests (Stage 7), agents MUST ensure the change explains itself:
- What It Ruled Out: State rejected alternatives and discarded trade-offs.
- Which Rule Decided It: Cite the specific invariant, rule, architectural boundary, or compliance constraint (from
AGENTS.md) that determined the solution. - Upfront Evidence: Attach empirical validation proof (test run summaries, CLI logs, reproduction traces, or browser check results) directly to the PR body using collapsible
<details><summary>blocks (not asked for later). - Pre-Review Automated Checks: Run and verify 100% green status across all local linters, unit tests, and browser/E2E checks BEFORE requesting human review or marking the PR ready.
- Reviewer Routing: Identify domain owners or
CODEOWNERSand assign appropriate reviewers.
🧹 Post-Merge Lifecycle & Clean State
Immediately after merging a PR on main, agents MUST run ce-ai workflow status and archive completed changes via ce-ai archive <feature> to seal change packages and maintain zero workflow drift.
<!-- ce-ai:block end -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

