fix(setup): stop writing unread Cursor global rule, write informational copy#522
Conversation
…al copy Cursor does not read global rule files from the filesystem — .mdc files with alwaysApply outside a project are silently ignored (global User Rules are UI-only, plain text, no path). So engram setup cursor was writing ~/.cursor/rules/engram.mdc that Cursor never read. Instead write the Memory Protocol to ~/.cursor/engram-memory-protocol.md (plain, no frontmatter) and instruct the user via postInstall to paste it as a User Rule in Settings → Rules. MCP registration is unchanged. Removes dead cursorRulesBody/cursorRulesPath; updates tests. Closes #521.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Cursor agent adapter is changed from writing ChangesCursor adapter: .mdc → informational markdown
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Fixes engram setup cursor writing an unread global .mdc rule by instead writing an informational Memory Protocol markdown file and guiding the user to paste it into Cursor “User Rules” (while keeping MCP registration behavior unchanged).
Changes:
- Update the Cursor adapter to write
~/.cursor/engram-memory-protocol.md(plain protocol, no.mdc/alwaysApplyfrontmatter) and adjust post-install instructions accordingly. - Update setup registry tests to assert the old
.cursor/rules/engram.mdcis not written and the new informational file is written and frontmatter-free.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/setup/agents.go | Switch Cursor instruction surface from global .mdc rule to an informational Memory Protocol markdown file; update post-install guidance; add new path helper. |
| internal/setup/registry_test.go | Update declarative agent instruction path for Cursor and add coverage ensuring the legacy .mdc file is not created and the new file has no frontmatter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| oldMDCPath := filepath.Join(home, ".cursor", "rules", "engram.mdc") | ||
| if _, err := os.Stat(oldMDCPath); err == nil { | ||
| t.Errorf("cursor: ~/.cursor/rules/engram.mdc should not be written (Cursor ignores global rule files)") | ||
| } |
🔗 Linked Issue
Closes #521
🏷️ PR Type
type:bug— Bug fixtype:feature— New featuretype:docs— Documentation onlytype:refactor— Code refactoring (no behavior change)type:chore— Maintenance, dependencies, toolingtype:breaking-change— Breaking change📝 Summary
engram setup cursorwrote~/.cursor/rules/engram.mdcas an always-applied global rule, but Cursor does not read global rule files —.mdc/alwaysApplyonly work at the project level; global "User Rules" are Settings-only plain text with no filesystem path. The Memory Protocol was therefore silently never applied.~/.cursor/engram-memory-protocol.md, and the post-install steps tell the user to paste it as a User Rule in Settings → Rules. MCP registration (~/.cursor/mcp.json) is unchanged.📂 Changes
internal/setup/agents.goengram-memory-protocol.mdinstead of the unread.mdc; updated description + postInstall; newcursorMemoryProtocolPath; removed deadcursorRulesBody/cursorRulesPathinternal/setup/registry_test.go.mdcis NOT written and the new plain file exists (noalwaysApplyfrontmatter); VS Code frontmatter test split out🧪 Test Plan
go test ./internal/setup/...,go vet,go build ./...,gofmtall clean~/.cursor/rulesglobal support)✅ Contributor Checklist
Closes #N)type:*label to this PRCo-Authored-BytrailersSummary by CodeRabbit
Release Notes
Changed
Tests