feat(rules-injector): add GitHub Copilot instructions format support (#403)
* feat(rules-injector): add GitHub Copilot instructions format support - Add .github/instructions/ directory to rule discovery paths - Add applyTo as alias for globs field in frontmatter parser - Support .github/copilot-instructions.md single-file format (always-apply) - Filter .github/instructions/ to only accept *.instructions.md files - Add comprehensive tests for parser and finder Closes #397 * fix(rules-injector): use cross-platform path separator in calculateDistance path.relative() returns OS-native separators (backslashes on Windows), but the code was splitting by forward slash only, causing incorrect distance calculations on Windows. Use regex /[/\]/ to handle both separator types. --------- Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
This commit is contained in:
@@ -14,10 +14,17 @@ export const PROJECT_MARKERS = [
|
||||
];
|
||||
|
||||
export const PROJECT_RULE_SUBDIRS: [string, string][] = [
|
||||
[".github", "instructions"],
|
||||
[".cursor", "rules"],
|
||||
[".claude", "rules"],
|
||||
];
|
||||
|
||||
export const PROJECT_RULE_FILES: string[] = [
|
||||
".github/copilot-instructions.md",
|
||||
];
|
||||
|
||||
export const GITHUB_INSTRUCTIONS_PATTERN = /\.instructions\.md$/;
|
||||
|
||||
export const USER_RULE_DIR = ".claude/rules";
|
||||
|
||||
export const RULE_EXTENSIONS = [".md", ".mdc"];
|
||||
|
||||
Reference in New Issue
Block a user