Skip to content

Fix ProjectDetector not recognizing .mcs-project as project root#309

Merged
bguidolim merged 1 commit intomainfrom
bruno/fix-project-detector-mcs-project
Mar 28, 2026
Merged

Fix ProjectDetector not recognizing .mcs-project as project root#309
bguidolim merged 1 commit intomainfrom
bruno/fix-project-detector-mcs-project

Conversation

@bguidolim
Copy link
Copy Markdown
Collaborator

Summary

mcs doctor, mcs export, and mcs check-updates failed to detect projects that have .claude/.mcs-project but no .git/ or CLAUDE.local.md. This is common for packs that provide only skills, MCP servers, or settings (no templates). mcs sync creates the project state at CWD but the other commands used ProjectDetector.findProjectRoot() which only recognized .git/ and CLAUDE.local.md.

Changes

  • Add .claude/.mcs-project as a third project root marker in ProjectDetector.findProjectRoot(), so all commands that walk up from CWD (doctor, export, check-updates) can detect template-less projects
  • Reorder ProjectStateFileCheck.check() to try .mcs-project first — passes when it exists even without CLAUDE.local.md, only warns for legacy state (CLAUDE.local.md present but .mcs-project missing)
  • Update ProjectStateFileCheck doc comment to reflect the full three-way behavior (pass/warn/skip)
  • Add test for .mcs-project-only project root detection and ProjectStateFileCheck passing without CLAUDE.local.md

Test plan

  • swift test passes locally (915 tests, 0 failures)
  • swiftformat --lint . and swiftlint pass without violations
  • Affected commands verified with a real pack (mcs doctor from a template-less project)

- Add .claude/.mcs-project as third project root marker in findProjectRoot(), fixing doctor/export/check-updates failing to detect projects without .git or CLAUDE.local.md
- Reorder ProjectStateFileCheck to check .mcs-project first and pass when it exists without CLAUDE.local.md (common for template-less packs)
- Add tests for .mcs-project detection and ProjectStateFileCheck without CLAUDE.local.md
@bguidolim bguidolim enabled auto-merge (squash) March 28, 2026 02:33
@bguidolim bguidolim merged commit 55254f9 into main Mar 28, 2026
4 checks passed
@bguidolim bguidolim deleted the bruno/fix-project-detector-mcs-project branch March 28, 2026 02:34
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.

1 participant