Skip to content

WindsurfRule does not generate frontmatter in output files #1438

@atecle

Description

@atecle

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
---

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions