Skip to content

feat(recursive): discover instruction-only sub-projects in monorepo mode#50

Merged
Conalh merged 1 commit into
mainfrom
pr4-recursive-instruction-markers
May 29, 2026
Merged

feat(recursive): discover instruction-only sub-projects in monorepo mode#50
Conalh merged 1 commit into
mainfrom
pr4-recursive-instruction-markers

Conversation

@Conalh
Copy link
Copy Markdown
Owner

@Conalh Conalh commented May 29, 2026

Problem

Recursive monorepo discovery used PROJECT_MARKERS, which only listed MCP / Codex / Claude / Aider config files. A package whose only agent config is an instruction file — packages/foo/AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, or .cursor/rules — was never discovered as its own project under --recursive, even though the instruction parser audits exactly those surfaces. The result: instruction drift in instruction-only packages went unaudited in monorepos.

Fix

Add the instruction surfaces to PROJECT_MARKERS:

AGENTS.md
CLAUDE.md
.github/copilot-instructions.md
.cursor/rules

(.cursor/rules is a directory; stat() resolves directories as well as files, and directoryHasMarker already treats any successful stat as a hit.)

Tests

New monorepo-instructions fixture with two instruction-only packages (packages/alpha/AGENTS.md, packages/beta/CLAUDE.md). Tests confirm:

  • --recursive audits both independently, each finding scoped to its own package path (packages/alpha/AGENTS.md, packages/beta/CLAUDE.md), surfaceCount == 2.
  • without --recursive, the root audit finds nothing (instruction files live only in sub-packages).

All 120 tests pass; dist/ rebuilt and committed.

🤖 Generated with Claude Code

PROJECT_MARKERS only listed MCP / Codex / Claude / Aider config files, so a
monorepo package whose only agent config is an instruction file
(packages/foo/AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, or
.cursor/rules) was never discovered as its own project under --recursive — even
though the instruction parser audits exactly those surfaces.

Add the instruction surfaces to PROJECT_MARKERS (.cursor/rules is a directory;
stat() resolves directories too). New fixture has two instruction-only packages;
the test confirms each is audited independently with its own package-scoped path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Conalh Conalh merged commit 0759dc9 into main May 29, 2026
5 checks passed
@Conalh Conalh deleted the pr4-recursive-instruction-markers branch May 29, 2026 15:58
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