Skip to content

Single source of truth for AI rules across agents, AGENTS.md, extensions, skills, Cratis AI corpus and other harnesses #30

Open

Description

@woksin

woksin (2026-10-23, via SPEC): "setup and rules should live in ONE place, not copied into agent definitions, prompts, skills or per-harness files. Please research this before choosing."

Rules are copied today into agent definitions (agent/agents/*.md), the global and profile AGENTS.md, extensions and guards, skills, the Cratis AI corpus (.cratis/ai, installed with cratis ai install/update) and other harnesses' files (Claude Code, Copilot, Codex). The copies drift. Agent types then behave differently under the same policy, as in #29.

Research questions

  • Where do rules drift today? An inventory of the duplicates, with examples of drift.
  • Which mechanism gives one source of truth with per-repo and per-task overrides that every agent type honours equally? Options:
    • generated agent files;
    • runtime injection by an extension;
    • enforcement by hooks or tools instead of prose;
    • layered config.
  • How does it fit the Cratis AI corpus distribution and other harnesses?

Deliverable

A decision document, the method documented in the pi-setup README, and the migration, in slices. #29 (the pi-phase execution policy) is the first concrete case.

Activity

  1. self-assigned this
    on Oct 23, 2026
  2. woksin commented on Oct 23, 2026

    @woksin
    OwnerAuthor

    Research done; the decision is proposed and awaits woksin's open questions.

    • Key finding: subagents never see AGENTS.md. pi-subagents creates them with noContextFiles, so every rule reaches them only through copies in the agent files: 8 agents × 8 profile directories = 64 copies. Those copies already disagree on priority-high, the scripting rule (missing from the default profile's implementer) and the execution exceptions.
    • Decision: AGENTS.md becomes the only prose source, with sections tagged by audience. One policy extension delivers the subagent sections at runtime. Mechanical rules go into tools and guards (pi-phase decides admission). Agent files keep only their role. Profiles become overlays. Cratis rules stay in the Cratis AI corpus and are referenced, not copied.
    • Precedence: user > parent brief > repo > global, with a fixed safety floor.
    • Slices: 1 = Central execution policy: agents stop hard-coding pi-phase rules; pi-phase decides direct/fast/queued #29 (in progress); 2 = the runtime policy extension replaces the copies and AGENTS.subagent.md; 3 = profile overlays.
    • Corpus, first moves: reference the corpus PR/label/merge rules and codescene.md instead of copying them; settle three conflicts upstream; move the Cratis CI/release operations rules to corpus github-actions.md; add a neutral phase-runner hook.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions