feat(recursive): discover instruction-only sub-projects in monorepo mode#50
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:(
.cursor/rulesis a directory;stat()resolves directories as well as files, anddirectoryHasMarkeralready treats any successfulstatas a hit.)Tests
New
monorepo-instructionsfixture with two instruction-only packages (packages/alpha/AGENTS.md,packages/beta/CLAUDE.md). Tests confirm:--recursiveaudits both independently, each finding scoped to its own package path (packages/alpha/AGENTS.md,packages/beta/CLAUDE.md),surfaceCount == 2.--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