Skip to content

Merge Standards Updates

When sync-standards detects that your agent configs have been customized, it stages pending updates in .standards-pending/ instead of overwriting your files. This document explains how to merge those updates.

Claude Code, Cursor and Copilot users: run the merge-standards skill, command or prompt (.claude/skills/merge-standards/SKILL.md, .cursor/commands/merge-standards.md, .github/prompts/merge-standards.prompt.md — setup installs the one for each declared agent) instead of following this guide; it automates the entire process. Codex, Gemini CLI and Aider find the same runbook listed in the ## Skills section of their assembled config.

  1. You (or a tool like /claude-md-improver) customized an agent config file (e.g., CLAUDE.md)
  2. sync-standards pulled updated standards blocks
  3. The sync detected your customizations via checksum comparison
  4. Instead of overwriting, it wrote the updated version to .standards-pending/<filename>

For each file in .standards-pending/:

  • Current file: The customized version at its normal location (e.g., CLAUDE.md)
  • Pending update: The file in .standards-pending/ (skip the first 3 lines — instruction comment)

Standards sections are marked by ## headers: Architecture, Testing, Security, Naming Conventions, Git Workflow, Documentation, Language Standards, Project Type.

For each standards section:

  • Identical content → no change needed
  • New rules in pending version → add them to your file
  • Changed rules in pending version → update to the new wording
  • Your additions within the section → keep them

For content outside standards sections (project overview, key commands, custom sections you added):

  • Always keep your version

  • Persist the overview and commands in .standards.yml so the next assembly reproduces them and the checksum stays stable (text edited only in the file is flagged as customized on every later sync). sync-standards prints the exact YAML when it finds filled-in sections the yml lacks:

    project_overview: |
    One paragraph: what this project is and how its pieces fit together.
    key_commands: |
    make test # run the test suite
  • Keep a file hand-curated with managed: { CLAUDE.md: false } in .standards.yml when the customisation cannot live in those keys or below the <!-- BEGIN PROJECT-SPECIFIC marker: sync then never regenerates or stages it, doctor reports it as curated, and diff-standards.sh still shows upstream changes for manual review.

For content below <!-- BEGIN PROJECT-SPECIFIC:

  • Keep as-is

Record the hash of the staged standards version, never of your merged file. Run this before deleting the pending copy:

Terminal window
file="CLAUDE.md" # replace with the actual filename
hash=$(bash -c '. .standards/scripts/lib/checksums.sh && compute_hash "$1"' _ ".standards-pending/$(basename "$file")")
echo "$(basename "$file") $hash"
# Replace the matching line in .standards-checksums with this output

A merged file then never matches its line, so sync and setup keep it and stage new updates instead. Recording the merged file’s own hash would let the next sync replace it. A file adopted unchanged matches and keeps updating. For .aiderrc use shasum -a 256 .standards-pending/.aiderrc.

Delete the consumed file from .standards-pending/. If the directory is now empty, remove it.

When MERGE_PLAN.md carries a Migration section, the project was set up before the 1.2 safe-setup and setup.sh --migrate has just run (see Renamed Files). The existing files are old hand-rolled configs whose dead standards references were rewritten in place (originals kept as <file>.pre-standards-setup), staged beside the freshly assembled versions. Take the assembled version as the base and carry only project-specific text into its PROJECT-SPECIFIC section — the old files are mostly a stale copy of the standards themselves. For AGENTS.md converted from .codexrc (or .standards-pending/AGENTS.md.from-codexrc), keep any project notes and delete .codexrc once they are in AGENTS.md. Each still cites a removed standard line is a manual decision: delete the sentence or use the replacement named in the map’s Notes column. The recorded checksum of a staged file is the staged assembled version, so adopting it as-is needs no checksum update.

If .standards-pending/ was lost (branch switch, git clean), re-run sync-standards to regenerate pending files.