Hello, I always appreciate rulesync.
Problem
In CopilotRule.fromRulesyncRule(), there is a comment stating "no frontmatter for root file", yet a frontmatter object is still passed to the constructor when creating a root rule. The comment and the implementation are inconsistent.
Evidence
In src/features/rules/copilot-rule.ts around line 167–177:
if (root) {
// Root file: .github/copilot-instructions.md (no frontmatter for root file)
return new CopilotRule({
baseDir: baseDir,
frontmatter: copilotFrontmatter, // ← passed despite the comment above
body,
relativeDirPath: paths.root.relativeDirPath,
relativeFilePath: paths.root.relativeFilePath,
validate,
root,
});
}
The frontmatter field is passed to the constructor, but when generating the file content (in getFileContent()), root files skip frontmatter serialization:
fileContent: rest.root ? body : stringifyFrontmatter(body, frontmatter),
So the frontmatter is silently discarded at serialization time. While this avoids visible breakage today, the code's intention is unclear and could become a bug source in future refactors.
Expected Behavior
Either:
- Root rules should pass
frontmatter: undefined (or {}) explicitly to match the stated intent, or
- The comment should be updated to explain why frontmatter is provided but intentionally unused.
Your confirmation would be appreciated.
Hello, I always appreciate rulesync.
Problem
In
CopilotRule.fromRulesyncRule(), there is a comment stating "no frontmatter for root file", yet afrontmatterobject is still passed to the constructor when creating a root rule. The comment and the implementation are inconsistent.Evidence
In
src/features/rules/copilot-rule.tsaround line 167–177:The
frontmatterfield is passed to the constructor, but when generating the file content (ingetFileContent()), root files skip frontmatter serialization:So the frontmatter is silently discarded at serialization time. While this avoids visible breakage today, the code's intention is unclear and could become a bug source in future refactors.
Expected Behavior
Either:
frontmatter: undefined(or{}) explicitly to match the stated intent, orYour confirmation would be appreciated.