Windsurf requires YAML frontmatter - title, trigger, globs - in rule files under .windsurf/rules, but the WindsurfRule class does not compose front matter into the generated file content.
Root cause
WindsurfRule.fromRulesyncRule() delegates to buildToolRuleParamsDefault(), which sets fileContent = ruleSyncRule.getBody . Description and globs are passed as properties on the returned object but they're not serialized into fileContent.
Contrast to CopilotRule, which has a custom constructor which calls stringify(body, frontmatter) - source
super({
...rest,
// If the rule is a root rule, the file content does not contain frontmatter.
fileContent: rest.root ? body : stringifyFrontmatter(body, frontmatter),
});
Expected behavior
Generated .windsurf/rules/*.md should include Windsurf specific frontmatter e.g.
---
title: My Rule
trigger: always_on
---
Or for glob scoped rules
---
title: My Rule
trigger: glob
globs: **/**.swift
---
Windsurf requires YAML frontmatter -
title,trigger,globs- in rule files under.windsurf/rules, but the WindsurfRule class does not compose front matter into the generated file content.Root cause
WindsurfRule.fromRulesyncRule() delegates to
buildToolRuleParamsDefault(), which setsfileContent = ruleSyncRule.getBody. Description and globs are passed as properties on the returned object but they're not serialized into fileContent.Contrast to
CopilotRule, which has a custom constructor which callsstringify(body, frontmatter)- sourceExpected behavior
Generated .windsurf/rules/*.md should include Windsurf specific frontmatter e.g.
Or for glob scoped rules