Skip to content

ISSUE-454: Skip CLAUDE file freshness when mcs never wrote there - #455

Merged
bguidolim merged 1 commit into
mainfrom
bruno/ISSUE-454-global-claude-md-freshness
Oct 19, 2026
Merged

bguidolim merged 1 commit into
mainfrom
bruno/ISSUE-454-global-claude-md-freshness

Conversation

@bguidolim

@bguidolim bguidolim commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

After a project-only setup, mcs doctor warned that a hand-written ~/.claude/CLAUDE.md has no mcs markers and told the user to run mcs sync --global. Following that hint would install packs globally that the user only wanted in a project. A CLAUDE file is now checked only when mcs recorded sections for it.

Closes #454

Release note

  • FIX: mcs doctor no longer warns about a hand-written CLAUDE.md that mcs never wrote sections into

Changes

  • A CLAUDE file with no mcs markers is skipped unless a configured pack in that scope recorded template sections; packs from older state without a record still count
  • Recorded sections with missing markers still warn as drift
  • Applies to both the global CLAUDE.md and the project CLAUDE.local.md

Test plan

  • swift test passes locally
  • swiftformat --lint . and swiftlint pass without violations
  • Affected commands verified with a real pack (e.g. mcs sync, mcs doctor)
Checklist for engine changes
  • Integration tests updated for new features (LifecycleIntegrationTests or DoctorRunnerIntegrationTests)

…here

- A marker-free CLAUDE.md / CLAUDE.local.md is skipped unless a configured pack recorded template sections
- Recorded sections with missing markers still warn as drift; legacy packs without a record count as recorded
- Regression and lifecycle tests for the project-only bootstrap case

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused change preserves genuine drift warnings, includes relevant regression coverage, and has no identified blocking issues.

No open issues 🎉

What changed in this PR

Fixes #454 by preventing doctor from warning about unmarked CLAUDE files that mcs never managed.

Changes:

  • Skips unmarked files when configured packs recorded no template sections.
  • Preserves drift warnings for recorded sections and legacy packs without artifact records.
  • Adds unit and integration regression coverage.
File Description
Tests/​MCSTests/​ProjectDetectorTests.swift Expects unmanaged files to be skipped.
Tests/​MCSTests/​LifecycleIntegrationTests.swift Covers hand-written global instructions after project-only sync.
Tests/​MCSTests/​CLAUDELocalFreshnessCheckTests.swift Tests empty records, recorded sections, and legacy state.
Sources/​mcs/​Doctor/​SectionValidator.swift Gates missing-marker warnings on scope-specific artifact records.
Sources/​mcs/​Doctor/​DoctorRunner.swift Updates the freshness-check comment.

Review effort: Balanced

@bguidolim
bguidolim merged commit 050d700 into main Oct 19, 2026
7 of 9 checks passed
@bguidolim
bguidolim deleted the bruno/ISSUE-454-global-claude-md-freshness branch October 19, 2026 22:12
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.

mcs doctor warns about a hand-written global CLAUDE.md that mcs never wrote to

2 participants