Skip to content

fix(setup): add alwaysApply frontmatter to Cursor rules template#3193

Open
sjsyrek wants to merge 1 commit intogastownhall:mainfrom
sjsyrek:fix/cursor-setup-always-apply-frontmatter
Open

fix(setup): add alwaysApply frontmatter to Cursor rules template#3193
sjsyrek wants to merge 1 commit intogastownhall:mainfrom
sjsyrek:fix/cursor-setup-always-apply-frontmatter

Conversation

@sjsyrek
Copy link
Copy Markdown
Contributor

@sjsyrek sjsyrek commented Apr 11, 2026

Summary

Fixes #3191. bd setup cursor writes .cursor/rules/beads.mdc without YAML frontmatter, which Cursor interprets as Manual mode — rules only load when the user explicitly @beads in chat. This adds alwaysApply: true frontmatter so beads context loads automatically every session, consistent with how the Claude and Gemini integrations auto-fire on session start.

Changes Made

  • Added alwaysApply: true frontmatter to cursorRulesTemplate in cmd/bd/setup/cursor.go — prepends standard YAML frontmatter block before the existing template content
  • Added regression test TestCursorRulesTemplate_AlwaysApplyFrontmatter in cmd/bd/setup/cursor_test.go — asserts the template starts with the required frontmatter

Backward Compatibility

Existing installs: Users who have already run bd setup cursor can re-run it to get the updated template (InstallCursor overwrites the file)
No behavioral change for other recipes: Only the Cursor template is modified; windsurf/cody/kilocode recipes are unaffected
User-added frontmatter preserved on remove: bd setup cursor --remove deletes the entire file, which is the existing behavior

Technical Details

Per Cursor's rules documentation, .mdc files are categorized by frontmatter:

Frontmatter Mode Loads when
alwaysApply: true Always Every session
globs: "..." Auto-attached A matching file is in context
description: "..." Agent-requested Agent reads description and decides
(none — previous state) Manual Only when user types @beads

Size: Small ✓

Two-file change: 4-line template addition + 9-line test.

🤖 Generated with Claude Code

…3191)

Without YAML frontmatter, Cursor defaults .mdc files to Manual mode,
requiring users to @-reference the rule explicitly. Add alwaysApply: true
so beads context loads automatically every session, consistent with the
Claude and Gemini integrations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

bd setup cursor writes rules file without alwaysApply frontmatter — defaults to Manual mode

1 participant