Skip to content

fix: scan Cursor .mdc rules (were silently dropped) - #35

Merged
Railly merged 1 commit into
mainfrom
fix/cursor-mdc-rules-scan
Jul 24, 2026
Merged

fix: scan Cursor .mdc rules (were silently dropped)#35
Railly merged 1 commit into
mainfrom
fix/cursor-mdc-rules-scan

Conversation

@Railly

@Railly Railly commented Jul 24, 2026

Copy link
Copy Markdown
Owner

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 .mdc scanner (scanMdc) was implemented but dead code.

The fix

Cursor rules path becomes pattern: "mdc". Project-level rules work automatically via scanToolProjectPaths. globs/alwaysApply land in the frontmatter bag; typed promotion follows in the rules-management feature.

Verified

Test project with two .cursor/rules/*.mdc files: 0 rules before the fix, 2 after, globs and alwaysApply parsed. Build + eslint clean. Split out from the #26 rules-management feature.

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.
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenfiles-web Ready Ready Preview, Comment Jul 24, 2026 7:56pm

@Railly
Railly merged commit a9e02e9 into main Jul 24, 2026
4 checks passed
@Railly
Railly deleted the fix/cursor-mdc-rules-scan branch July 24, 2026 20:00
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.
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