Skip to content

Make AGENTS.md the canonical agent guide; CLAUDE.md imports it#92

Merged
mbertschler merged 3 commits into
mainfrom
claude-md-import-agents-md
Jun 7, 2026
Merged

Make AGENTS.md the canonical agent guide; CLAUDE.md imports it#92
mbertschler merged 3 commits into
mainfrom
claude-md-import-agents-md

Conversation

@mbertschler
Copy link
Copy Markdown
Owner

What

Consolidate the two agent-instruction files into one source of truth and trim it.

  • CLAUDE.md → @AGENTS.md import. AGENTS.md (the cross-tool standard) becomes canonical; CLAUDE.md is now a one-line import so the two can't drift.
  • Trim AGENTS.md (~450 → ~350 words) by removing duplication and stale specifics:
    • Replaced the rotted schema description — it claimed "v4 schema, files PK (volume_id, path, blake3)", but migrateV7ToV8 rebuilt files to (folder_id, name, blake3) and current SchemaVersion is 13. There is no single canonical schema file (fresh DBs apply a frozen v5 baseline then step v6→v13), so pinning column lists in prose is inherently rot-prone. Now states the invariant and points at where it's actually enforced: the files_blake3_immutable trigger and uniq_files_live_per_path partial unique index in store/migrations.go (stable names across rebuilds).
    • Kept the never-squash rule as a one-liner so the repo file stands alone for agents/tools that don't see a personal global config.
    • Folded the PR Closes #N convention and the merge rule into one section; dropped the duplicate restatement in the workflow.
    • Added a CI-equivalent local verify line: go vet ./..., go test ./..., golangci-lint run.

Why

The runs-table audit-trail paragraph lived only in CLAUDE.md, and the self-reference differed — the files were already drifting. Folding everything into AGENTS.md with CLAUDE.md as an import makes drift impossible, and the schema description had already gone stale, which is the motivating example for not embedding schema specifics in instruction prose.

No code or behavior changes — docs only.

AGENTS.md becomes the canonical instructions file; CLAUDE.md is now a
one-line @AGENTS.md import so the two never drift. Also folds the runs
table audit-trail paragraph (previously only in CLAUDE.md) into AGENTS.md
so no content is lost in the consolidation.
- Replace the rotted schema description (it claimed v4 + files PK
  (volume_id, path, blake3); v7→v8 rebuilt files to (folder_id, name,
  blake3) and current SchemaVersion is 13) with the invariant plus a
  pointer to where it's actually enforced: the files_blake3_immutable
  trigger and uniq_files_live_per_path index in store/migrations.go.
- Keep the never-squash rule as a one-liner so the repo file stands
  alone for agents that don't see a personal global config.
- Fold the PR Closes convention and merge rule into one section; drop
  the redundant restatement in the workflow.
- Add the CI-equivalent local verify command.

Net ~40% smaller with no loss of load-bearing guidance.
Copilot AI review requested due to automatic review settings June 7, 2026 11:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates agent instructions into a single canonical guide (AGENTS.md) and makes CLAUDE.md a lightweight import to prevent the two documents from drifting over time.

Changes:

  • Replaces the existing multi-section CLAUDE.md content with an @AGENTS.md import.
  • Introduces AGENTS.md as the consolidated agent guide, including core data invariants, PR conventions, and the default “implement #N” workflow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
CLAUDE.md Replaced the full guide with an @AGENTS.md import so CLAUDE-based tooling reads the canonical instructions.
AGENTS.md Added the consolidated, trimmed agent guide to serve as the single source of truth across tools.
Comments suppressed due to low confidence (1)

CLAUDE.md:2

  • If the intent is for CLAUDE.md to be a single-line import, consider removing the extra blank line so tooling that expects a strict one-line file can’t be tripped up by trailing content.
@AGENTS.md


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md Outdated
Comment on lines +8 to +13
most one live (non-`superseded`) row per path. The same no-loss rule governs the
`runs` table and its history. The schema enforces it — the
`files_blake3_immutable` trigger and the `uniq_files_live_per_path` partial
unique index (`store/migrations.go`) — so any new feature (sync, prune, dedup,
GC) must preserve it: no deleting or overwriting history without an explicit,
opt-in retention policy.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in 249059c. Split the paragraph so the schema enforcement (files_blake3_immutable trigger + uniq_files_live_per_path index) is scoped to files, and runs is now stated as a policy rule (no auto-prune; it's overwrite-in-place via FinishRun), not schema-enforced.

Comment thread AGENTS.md Outdated
- Forget `go mod tidy` after adding a dependency
- Keep names/visibility when moving code — re-evaluate

Before pushing, verify like CI: `go vet ./...`, `go test ./...`, `golangci-lint run`.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 249059c — dropped the "verify like CI" framing since the local check intentionally omits go build (per a standing rule to avoid leaving build artifacts in the repo). It's now just "Before pushing: ...".

- Separate the files schema invariant (enforced by the
  files_blake3_immutable trigger + uniq_files_live_per_path index) from
  the runs retention rule (policy, not schema — runs is overwrite-in-place
  via FinishRun). The prior wording implied the trigger/index governed
  both tables.
- Drop the 'verify like CI' framing: CI also runs go build (and a
  wailsdesktop build), which the local check intentionally omits.
@mbertschler mbertschler merged commit 6afcd2d into main Jun 7, 2026
2 checks passed
@mbertschler mbertschler deleted the claude-md-import-agents-md branch June 7, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants