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:
@@ -60,7 +60,7 @@ function parseYamlContent(yamlContent: string): RuleMetadata {
|
||||
metadata.description = parseStringValue(rawValue);
|
||||
} else if (key === "alwaysApply") {
|
||||
metadata.alwaysApply = rawValue === "true";
|
||||
} else if (key === "globs" || key === "paths") {
|
||||
} else if (key === "globs" || key === "paths" || key === "applyTo") {
|
||||
const { value, consumed } = parseArrayOrStringValue(rawValue, lines, i);
|
||||
// Merge paths into globs (Claude Code compatibility)
|
||||
if (key === "paths") {
|
||||
|
||||
Reference in New Issue
Block a user