Skip to content

fix(framework): AGENTS.md and CLAUDE.md have never moved in the same commit, and nothing checks they still agree #619

Closed as not planned

Description

@avp9-nexus

Problem

AGENTS.md and CLAUDE.md at the repository root carry the same doctrine: 55 lines each, 53 of them byte-identical. The framework's portability depends on them staying in agreement, since Claude Code reads one and every other tool reads the other.

Measured on main, 2026-08-11, via the commits API filtered by path:

CLAUDE.md touched by: d3fe2ac 2026-06-26 - 80daf0d 2026-06-20 - c6b474f 2026-06-06 - 3a91267 2026-05-11
AGENTS.md touched by: cfaf61b 2026-07-18 - 6c0914a 2026-07-07

No commit touches both files. Four commits edited CLAUDE.md without AGENTS.md, then two edited AGENTS.md without CLAUDE.md. If the two files are 53/55 identical today, it is because someone re-copied the content by hand between commits, and the only thing keeping them aligned is the memory of whoever edits next.

The drift is already visible in the two lines that differ, the greeting:

CLAUDE.md : "AI-Driven Development ON - Date: {current_date}, TZ: {current_timezone}."
AGENTS.md : "AI-Driven Development On ⚡"

The {current_date} placeholders look deliberate, since only Claude Code substitutes them. The casing difference and the decorative emoji do not, and the emoji sits in a file whose own Communication section says "no decorative tables or emoji unless they carry information". Whether each difference is a choice or a leftover is exactly what nothing currently records.

I checked whether an existing control covers this: lefthook.yml validates JSON, YAML and skill frontmatter but does not compare the twins; among scripts/, cli/ and .github/, the files mentioning AGENTS.md are CLI tests and a fixture; dev-sync.sh installs, it does not compare; CONTRIBUTING.md has zero occurrences of AGENTS, CLAUDE or sync. If I missed a control somewhere else, this issue collapses and I would be glad to close it.

Scope

A parity check with declared exceptions, not byte parity. Byte parity would flag the greeting line forever and the check would be disabled within a week; a red check nobody can fix is worse than none.

  • scripts/check-doctrine-parity.mjs: both files must be identical except for lines listed in a small versioned exceptions block (the two title lines, the greeting line). Any undeclared divergence fails with the differing lines printed.
  • One entry in lefthook.yml under pre-commit, next to the existing JSON/YAML checks, scoped to the two files.
  • The exceptions block lives in the script or a small config, so a deliberate divergence is one reviewed line in a diff, and drift is a red check.
  • I can submit the PR with the script and a test that proves the check goes red on an undeclared mutation and stays green on the declared exceptions.

Acceptance criteria

  • Editing one twin without the other, outside the declared exceptions, fails pre-commit with the differing lines named.
  • The declared exceptions pass, and adding a new exception requires touching the versioned list, so it shows in review.
  • A test exercises both directions: red on undeclared mutation, green on declared exceptions.

Prior art in this repo

Same shape as the existing lefthook.yml checks (json-validity, yaml-validity, skill-frontmatter): mechanical, scoped, runs where the mistake happens. #618 makes a neighbouring argument about unverified table cells; this is the same failure one level up, applied to the two files that instruct every agent.

Out of scope

Deciding which greeting is correct, or unifying the two files into one generated artifact. Both are maintainer calls; the check only makes the difference visible and deliberate.

Activity

  1. added theissue type on Aug 11, 2026
  2. avp9-nexus commented on Sep 8, 2026

    @avp9-nexus
    Author

    Following up, since this issue has been cited in 522455e and 8a43983 but has not moved on the board.

    The check the issue asks for exists and is tested: scripts/check-doctrine-parity.js compares AGENTS.md and CLAUDE.md line for line outside two declared exceptions (the title and the greeting); inside the memory block, reference lines are left to check-context-reference-form.js, which already judges their form, and everything else is compared. It comes with a lefthook pre-commit entry and a paired test: a doctrine line mutated in one twin fails with the line named and both versions shown, and the restored tree passes. Built on next at 25f0837; the real pass on the current twins is green.

    One correction to the issue's premise: the claim that no commit had ever touched both files stopped being true on 28 August (87304fb moved both). The gap it describes, that nothing checks parity, is unchanged.

    Per CONTRIBUTING, I'll open the PR once this is moved to Todo. If the topic is already being handled in-house, which the two commits above suggest, say so and I'll drop it.

    Avp9.

  3. moved this from Ideation to In review in AIDD Roadmapon Sep 9, 2026
  4. moved this from In review to Done in AIDD Roadmapon Sep 9, 2026
  5. blafourcade commented on Sep 10, 2026

    @blafourcade
    Contributor

    Thanks for the proposal. We will not enforce full parity between AGENTS.md and CLAUDE.md.

    project-memory owns only the fenced memory block and renders it for each target. The rest of both files is user-owned and may intentionally differ by host or project convention. A repository-wide parity hook would turn legitimate user changes into pre-commit failures.

    Generator behavior should instead be covered by project-memory tests: preserve everything outside the block and render the selected target’s memory references correctly.

    Closing as not planned. The earlier Completed closure came from the release flow, not from a delivered doctrine-parity check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions