continue-custom/docs/docs/customize
Patrick Erichsen e2e4f94e8d Add alwaysApply property to rules for better control over rule application
This commit introduces an optional `alwaysApply` boolean property to rules that provides fine-grained control over when rules are included in system messages.

## Behavior

- `alwaysApply: true` - Always include the rule, regardless of file context
- `alwaysApply: false` - Only include if globs exist AND match file context
- `alwaysApply: undefined` - Default behavior: include if no globs OR globs match

## Changes

- Added `alwaysApply?: boolean` to `RuleWithSource` interface
- Updated `parseMarkdownRule` to handle frontmatter `alwaysApply` property
- Enhanced `shouldApplyRule` function with explicit logic for all three states
- Added `alwaysApply` to createRuleBlock tool definition and implementation
- Updated UI logic in RulesPeek component to match backend behavior
- Added comprehensive test coverage for all scenarios
- Updated documentation to mention Markdown file support for rules

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-25 19:27:15 -07:00
..
deep-dives Add alwaysApply property to rules for better control over rule application 2025-05-25 19:27:15 -07:00
model-providers Merge branch 'main' into venice 2025-04-29 13:01:19 -07:00
model-roles update docs tei with apikey 2025-04-29 13:29:43 -07:00
tutorials Merge pull request #5148 from s-h-a-d-o-w/feat/provide-workspacepath-to-http-provider 2025-04-29 11:36:28 -07:00
changelog.md redirect from docs changelog (old) to changelog.continue.dev (new) 2025-05-14 14:43:10 -07:00
context-providers.mdx feat: fix broken links 2025-04-07 10:52:56 -07:00
overview.md fix(typo): customize overview doc 2025-03-28 17:46:50 +05:30