Plan: Add Cursor Support (Rules + Skills Detection & Remediation)
Context
The application currently supports 3 AI agent ecosystems: AGENTS.md, Claude Code (.claude/), and GitHub Copilot (.github/). Cursor is a major AI coding agent that uses .cursor/rules/ for rule files (.md/.mdc with YAML frontmatter) and .cursor/skills/ for skill directories. We need to detect these files during evaluation and support Cursor as a remediation target.
Additionally, skills directories (.claude/skills/, .agents/skills/, .github/skills/) are currently not discovered during evaluation. We'll add skill discovery for all agents.
Decisions
.md and .mdc files both typed as "cursor-rules" (single type)
Skills discovered for ALL agents, not just Cursor
Full evaluation with all 17 evaluators on Cursor files
All 4 Cursor rule types supported in remediation (alwaysApply, intelligent, glob-scoped, manual)
Deduplicate Cursor rules against AGENTS.md/CLAUDE.md
Single "Cursor" target in frontend (AI decides rules vs skills per issue)
Cursor is NOT added as an evaluation provider
1. Type System Changes
src/shared/types/evaluation.ts (line 105)
Extend IContextFile.type union: add "cursor-rules" and "skills"
Add optional fields to IContextFile: description?: string, alwaysApply?: boolean
Update JSDoc comment (line 98)
src/shared/types/remediation.ts (lines 7-11)
Add "cursor": "Cursor" to TARGET_AGENTS
frontend/src/types/evaluation.ts (line 96)
Mirror: add "cursor-rules" and "skills" to IContextFile.type
frontend/src/hooks/useEvaluationApi.ts (line 24)
Add "cursor" to TargetAgent union type
2. File Discovery
src/shared/file-system/file-finder.ts
Add findCursorRulesFiles() function (model after findClaudeRulesFiles, lines 14-79):
Glob pattern: **/.cursor/rules/**/*.md and **/.cursor/rules/**/*.mdc
Cursor uses `.cursor/rules/` for rule files (.md or .mdc) with optional YAML frontmatter.
Rules support 4 modes: alwaysApply, auto-attached (description-based), glob-scoped, and manual.
Skills are placed in `.cursor/skills/<skill-name>/`.
Unit tests: bun run test — all existing + new tests pass
Lint: bun run lint — no new issues
Manual: Run evaluation against a repo with .cursor/rules/ files → verify they appear in context files list
Manual: Select "Cursor" target in RemediateTab → verify prompt includes all 4 rule type instructions
Manual: Run remediation with Cursor target → verify generated .mdc files have correct frontmatter
If you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: /Users/cedricteyton/.REDACTED.jsonl
Assistant
I'll implement this plan step by step. Let me start by reading all the key files I need to modify.
Assistant
Now let me read the remaining files I need to modify.
Assistant
Let me find the RemediateTab target agent buttons section and the frontend context files browser.
Assistant
Now let me check the ContextFilesBrowserModal to understand how it handles types.
Assistant
Now let me also check the existing test files to understand the patterns.
Assistant
Let me read the test files to understand patterns.
Assistant
Now I have a complete understanding of all the files. Let me also check the skills-finder to understand how skills work.
Assistant
Good. The skills finder already discovers SKILL.md files from all paths. Now I have full context. Let me implement all the changes. I'll work through each file systematically.
Step 1: Type system changes
Assistant
Now the frontend types:
Assistant
Step 2: File discovery - add findCursorRulesFiles and findSkillFiles
Assistant
Now update findAgentsFiles to include cursor rules and skill files, and add cursor deduplication:
Assistant
Now add cursor rules deduplication after copilot deduplication:
Assistant
Now add the deduplicateCursorRules function after deduplicateCopilotInstructions:
Assistant
Step 3: File type detection & frontmatter in context-files-summarizer.ts
Assistant
Now add the frontmatter extraction helpers for description and alwaysApply:
Assistant
Now update summarizeContextFiles to extract frontmatter for cursor-rules:
Assistant
Step 4: Remediation prompt generator - add cursor support
Assistant
Now add cursor case to getStandardInstructions:
Assistant
Now add cursor to the skill instructions:
Assistant
Step 5: Frontend changes
First, RemediateTab - add cursor to the target agent buttons:
Assistant
Now update the ContextFilesBrowserModal to handle the new types:
Assistant
Now update the filter logic and description handling in the modal:
Assistant
Now update the ContextTab to add the Cursor section:
Assistant
Now add cursor rules and skills path extraction in the ContextTab:
Assistant
Now add sorted paths for cursor rules and update section visibility:
Assistant
Now add the Cursor section in the JSX, right before the Linked Docs section:
Assistant
Step 6: Tests
Now let me update the test files. Let me start with file-finder tests:
Assistant
Now add test sections at the end of the file (before the closing });):
Assistant
Now update context-files-summarizer tests:
Assistant
Now add tests for the new frontmatter extraction functions:
Assistant
Now update the prompt-generator tests to include cursor:
Assistant
Now update the loop-based tests to include cursor:
Assistant
Now update the error prompt tests to include cursor:
Assistant
Now let me run the tests to see if everything passes:
Assistant
All 1274 tests pass. Now let me run lint:
Assistant
Let me fix the lint issues - mostly formatting and an unused variable:
Assistant
Good, the formatter fixed 6 files. Now I just need to remove the 2 unused variables:
Assistant
I added skillsPathsCount and sortedSkillsPaths but don't use them yet. Let me remove them since we don't currently display skill file paths in the ContextTab (skills are shown via the skills modal, not as file rows):
Assistant
Also remove skillsPaths since it's now unused too:
Assistant
Now run tests and lint again:
Assistant
All 1274 tests pass and lint is clean. Let me also run typecheck:
Assistant
All checks pass. Let me mark the task as complete:
Assistant
Here's a summary of all changes made:
Changes Summary
1. Type System
src/shared/types/evaluation.ts: Extended IContextFile.type union with "cursor-rules" and "skills", added optional description and alwaysApply fields
src/shared/types/remediation.ts: Added cursor: "Cursor" to TARGET_AGENTS
frontend/src/types/evaluation.ts: Mirrored backend type changes for IContextFile
frontend/src/hooks/useEvaluationApi.ts: Added "cursor" to TargetAgent union
file-finder.test.ts: 12 new tests for cursor rules discovery, cursor deduplication, and skill files discovery
context-files-summarizer.test.ts: 14 new tests for getContextFileType(), extractDescriptionFromFrontmatter(), and extractAlwaysApplyFromFrontmatter()
prompt-generator.test.ts: Added cursor to all existing loop-based tests + 1 dedicated cursor test
All 1274 tests pass, lint clean, typecheck clean.
User
Verification
Unit tests: bun run test — all existing + new tests pass
Lint: bun run lint — no new issues
Manual: Run evaluation against a repo with .cursor/rules/ files → verify they appear in context files list
Manual: Select "Cursor" target in RemediateTab → verify prompt includes all 4 rule type instructions
Manual: Run remediation with Cursor target → verify generated .mdc files have correct frontmatter
If you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: /Users/cedricteyton/.REDACTED.jsonl
Cursor uses `.cursor/rules/` for rule files (.md or .mdc) with optional YAML frontmatter.
Rules support 4 modes: alwaysApply, auto-attached (description-based), glob-scoped, and manual.
Skills are placed in `.cursor/skills/<skill-name>/`.
Add findCursorRulesFiles() and findSkillFiles() to the Promise.all array
Merge results into allFiles
Add isCursorRulesFile() helper (model after isCopilotInstructionsFile, lines 372-389)
Add deduplicateCursorRules() function (model after deduplicateCopilotInstructions, lines 399-455):
Same logic: skip cursor rule files with identical content to AGENTS.md/CLAUDE.md
Call it after deduplicateCopilotInstructions() at line 253-256
User
1. Type System Changes
src/shared/types/evaluation.ts (line 105)
Extend IContextFile.type union: add "cursor-rules" and "skills"
Add optional fields to IContextFile: description?: string, alwaysApply?: boolean
Update JSDoc comment (line 98)
src/shared/types/remediation.ts (lines 7-11)
Add "cursor": "Cursor" to TARGET_AGENTS
frontend/src/types/evaluation.ts (line 96)
Mirror: add "cursor-rules" and "skills" to IContextFile.type
frontend/src/hooks/useEvaluationApi.ts (line 24)
Add "cursor" to TargetAgent union type
User
commit
Assistant
I see there are other changes mixed in that are not from my Cursor work (changes to CHANGELOG.md, App.tsx, Summary.tsx, ContentBrowserModal.tsx). Let me only stage the files I modified for Cursor support:
Assistant
Commit successful. All pre-commit hooks passed (1274 tests, lint, typecheck) and the commit was created: 78d52f8.