fix: scan Cursor .mdc rules (were silently dropped) - #35
Merged
Conversation
Cursor's rule path was wired to pattern 'flat-md', which only matches .md, but Cursor rules are .mdc. The .mdc scanner (scanMdc, already implemented) was dead code — no tool used pattern 'mdc'. Net effect: the README advertised Cursor Rules support but zero real .mdc rules were ever scanned. Switches the Cursor rules path to pattern 'mdc'. Project-level scanning already derives <project>/.cursor/rules from the global path via scanToolProjectPaths, so project rules now work too. globs and alwaysApply land in the frontmatter bag as before. Verified end to end: a project with two .cursor/rules/*.mdc files (one globbed, one alwaysApply) scans as 0 rules before the fix, 2 rules after, with globs and alwaysApply parsed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Railly
added a commit
that referenced
this pull request
Jul 24, 2026
Rules MVP. Builds on the .mdc scan fix (#35). - src/scaffolds.ts: shared scaffold module for both frontends. Rule files get .mdc frontmatter (description, globs, alwaysApply); memory gets a plain body; skills keep SKILL.md. scaffoldExtension picks .mdc for Cursor rules, .md otherwise. Replaces the near-identical hand-rolled strings the two frontends used to duplicate. - src/types.ts + scanner.ts: SkillItem gains typed globs and alwaysApply, promoted from .mdc frontmatter (array globs normalized to comma string), kept in the frontmatter bag too. - create-skill-modal.ts (Obsidian): drops the exclusion that blocked creating rule/memory files, adds scroll/database type icons, uses the shared scaffold with the correct extension. - parity.ts (VS Code): create flow uses the shared scaffold and extension. - sidebar.ts (Obsidian): adds the Memories filter row (was omitted; only shows when memory items exist). Implemented by Codex (gpt-5.6-sol), reviewed line by line. Verified: build + eslint + vscode tsc all clean. Scaffold outputs checked (rule -> .mdc with globs/alwaysApply, memory -> .md, skill -> SKILL.md). Full round-trip proven: a rule created via the shared scaffold writes ts-strict.mdc, and re-scanning surfaces globs '**/*.ts' and alwaysApply true as typed fields. vsix installed into VS Code and Cursor.
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.
The bug
agentfiles advertises Cursor Rules support but zero real Cursor rules were ever scanned. Cursor's rule path was wired to
pattern: "flat-md"(matches only.md), but Cursor rules are.mdc. The.mdcscanner (scanMdc) was implemented but dead code.The fix
Cursor rules path becomes
pattern: "mdc". Project-level rules work automatically viascanToolProjectPaths.globs/alwaysApplyland in the frontmatter bag; typed promotion follows in the rules-management feature.Verified
Test project with two
.cursor/rules/*.mdcfiles: 0 rules before the fix, 2 after, globs and alwaysApply parsed. Build + eslint clean. Split out from the #26 rules-management feature.