Skip to content

Conversation

@yangjuncode
Copy link

@yangjuncode yangjuncode commented Jan 28, 2026

Update Windsurf file path from commands to workflows, close #591

Summary by CodeRabbit

  • Changes

    • Windsurf command files now use a revised directory structure and filename pattern.
  • Documentation

    • Supported-tools docs updated to reflect the new Windsurf command file location.
  • Tests

    • Test suite updated to validate the revised Windsurf file location and naming convention.

✏️ Tip: You can customize this high-level summary in your review settings.

@yangjuncode yangjuncode requested a review from TabishB as a code owner January 28, 2026 14:00
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

Update changes Windsurf file path and filename pattern: generated files move from .windsurf/commands/opsx/<id>.md to .windsurf/workflows/opsx-<id>.md. Documentation, adapter code, and tests updated to match.

Changes

Cohort / File(s) Summary
Windsurf docs
docs/supported-tools.md
Commands Location updated from .windsurf/commands/opsx/ to .windsurf/workflows/.
Windsurf adapter
src/core/command-generation/adapters/windsurf.ts
getFilePath and frontmatter path updated to use .windsurf/workflows/opsx-<commandId>.md.
Tests (path expectations & mocks)
test/core/command-generation/adapters.test.ts, test/core/init.test.ts, test/core/update.test.ts
Test expectations and a console.log mock adjusted to reflect new workflows directory and opsx-<id>.md filename pattern.
Spec update
openspec/changes/.../specs/command-generation/spec.md
Documentation/spec formatting requirement updated to .windsurf/workflows/opsx-<id>.md.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • TabishB

Poem

🐰 I hopped through paths both old and new,
.commands to .workflows — a cleaner view.
opsx- named files now prance in line,
I nibble a carrot, say “Nice design!” 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: updating Windsurf file paths from commands to workflows.
Linked Issues check ✅ Passed The PR addresses the primary requirement from #591 by updating file paths to use workflows instead of commands, making OpenSpec output compatible with Windsurf.
Out of Scope Changes check ✅ Passed All changes focus on updating the file path pattern from commands/opsx to workflows/opsx-*, which directly addresses issue #591. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

@greptile-apps
Copy link

greptile-apps bot commented Jan 28, 2026

Greptile Overview

Greptile Summary

Fixed Windsurf workflow file paths from the incorrect nested structure .windsurf/commands/opsx/<id>.md to the correct flat structure .windsurf/workflows/opsx-<id>.md.

This change:

  • Aligns Windsurf with the opsx-<id> naming pattern used by other workflow-based tools (Kilocode, Antigravity, Cline)
  • Matches Windsurf's official workflows directory structure (.windsurf/workflows/)
  • Updates the adapter implementation, documentation, and all related tests
  • Includes a minor whitespace formatting change in test/core/init.test.ts (added space in empty arrow function)

Confidence Score: 5/5

  • This PR is safe to merge - it's a straightforward path correction with comprehensive test coverage
  • The changes are purely corrective, fixing an incorrect path structure to match both Windsurf's conventions and the project's established patterns. All tests have been updated to reflect the new paths, and the implementation is consistent across adapter code, documentation, and test suites.
  • No files require special attention

Important Files Changed

Filename Overview
src/core/command-generation/adapters/windsurf.ts Changed Windsurf workflow path from nested .windsurf/commands/opsx/<id>.md to flat .windsurf/workflows/opsx-<id>.md, matching the pattern used by other workflow-based tools
docs/supported-tools.md Updated documentation table to reflect the corrected Windsurf workflows path
test/core/command-generation/adapters.test.ts Updated test assertions to match the new Windsurf workflow path structure
test/core/init.test.ts Updated init test to verify files are created at the corrected workflow path; minor whitespace fix in mock function
test/core/update.test.ts Updated update test to check for files at the corrected workflow path

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as OpenSpec CLI
    participant Adapter as Windsurf Adapter
    participant FS as File System

    User->>CLI: openspec init --tools windsurf
    CLI->>Adapter: getFilePath("explore")
    Adapter-->>CLI: ".windsurf/workflows/opsx-explore.md"
    CLI->>Adapter: formatFile(commandContent)
    Adapter-->>CLI: Formatted content with YAML frontmatter
    CLI->>FS: Write file to .windsurf/workflows/opsx-explore.md
    FS-->>CLI: Success
    CLI-->>User: Windsurf workflows configured

    Note over Adapter,FS: Changed from .windsurf/commands/opsx/<id>.md<br/>to .windsurf/workflows/opsx-<id>.md
Loading

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/core/command-generation/adapters/windsurf.ts`:
- Around line 34-44: The windsurfAdapter currently writes YAML frontmatter for
workflows which Windsurf does not support; update the adapter (wind​surfAdapter
and its getFilePath usage) to either (A) output workflows as markdown with a
title, description paragraph and ordered steps (mirroring the Cline adapter
format) and keep the path '.windsurf/workflows/opsx-<id>.md', or (B) if YAML
frontmatter is intended for Skills, change getFilePath to place files under
'.windsurf/skills/opsx-<id>.md' and keep the frontmatter; implement one of these
two fixes consistently across the adapter so generated files match Windsurf's
documented format.

Comment on lines 34 to 44
/**
* Windsurf adapter for command generation.
* File path: .windsurf/commands/opsx/<id>.md
* File path: .windsurf/workflows/opsx-<id>.md
* Frontmatter: name, description, category, tags
*/
export const windsurfAdapter: ToolCommandAdapter = {
toolId: 'windsurf',

getFilePath(commandId: string): string {
return path.join('.windsurf', 'commands', 'opsx', `${commandId}.md`);
return path.join('.windsurf', 'workflows', `opsx-${commandId}.md`);
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

git ls-files src/core/command-generation/adapters/ | head -20

Repository: Fission-AI/OpenSpec

Length of output: 1021


🏁 Script executed:

cat -n src/core/command-generation/adapters/windsurf.ts

Repository: Fission-AI/OpenSpec

Length of output: 2177


🏁 Script executed:

cat -n src/core/command-generation/adapters/cursor.ts

Repository: Fission-AI/OpenSpec

Length of output: 1857


🏁 Script executed:

cat -n src/core/command-generation/adapters/cline.ts

Repository: Fission-AI/OpenSpec

Length of output: 1006


🏁 Script executed:

rg -A 30 "formatFile.*commandId" src/core/command-generation/adapters/windsurf.ts

Repository: Fission-AI/OpenSpec

Length of output: 45


🏁 Script executed:

sed -n '45,100p' src/core/command-generation/adapters/windsurf.ts

Repository: Fission-AI/OpenSpec

Length of output: 337


🏁 Script executed:

rg "591" . -t ts -t md | head -20

Repository: Fission-AI/OpenSpec

Length of output: 45


🏁 Script executed:

rg -i "windsurf" . -t ts -t md -t json | grep -v node_modules | head -30

Repository: Fission-AI/OpenSpec

Length of output: 2996


🏁 Script executed:

fd "windsurf" -t f . | head -20

Repository: Fission-AI/OpenSpec

Length of output: 113


🏁 Script executed:

find . -name "*windsurf*" -type f 2>/dev/null | head -20

Repository: Fission-AI/OpenSpec

Length of output: 113


🏁 Script executed:

ls -la src/core/command-generation/adapters/*.test.ts src/core/command-generation/adapters/__tests__/ 2>/dev/null | head -20

Repository: Fission-AI/OpenSpec

Length of output: 45


🏁 Script executed:

find . -path ./node_modules -prune -o -name "*.test.ts" -type f -print 2>/dev/null | grep -i adapter

Repository: Fission-AI/OpenSpec

Length of output: 110


🏁 Script executed:

wc -l src/core/command-generation/adapters/windsurf.ts

Repository: Fission-AI/OpenSpec

Length of output: 114


🏁 Script executed:

cat src/core/command-generation/adapters/windsurf.ts

Repository: Fission-AI/OpenSpec

Length of output: 1778


🌐 Web query:

Windsurf IDE workflow file format YAML frontmatter specification

💡 Result:

Windsurf Workflow files are Markdown (.md) files stored under .windsurf/workflows/ (and can also be discovered in subdirectories / up to the git root). They are invoked in Cascade via a slash command /[workflow-name], and the docs describe their contents as a title, a description, and an ordered series of steps/instructions. The official Windsurf docs do not publish a YAML-frontmatter schema/spec for workflow files (i.e., no documented required/optional frontmatter keys for workflows). [1]

What is explicitly documented in Windsurf is YAML frontmatter for Skills (.windsurf/skills/<skill-name>/SKILL.md), where the frontmatter uses --- delimiters and includes (at least) name and description. [2]

Sources:
[1] Windsurf Docs – Workflows (storage/discovery/character limit; “title, description, and steps”; slash invocation)
[2] Windsurf Docs – Cascade Skills (SKILL.md YAML frontmatter example/required fields)


🏁 Script executed:

rg -i "workflow" src/core/command-generation/adapters/windsurf.ts -B 2 -A 2

Repository: Fission-AI/OpenSpec

Length of output: 336


🌐 Web query:

Windsurf IDE .windsurf/workflows directory structure file format

💡 Result:

.windsurf/workflows directory structure (discovery)

Windsurf/Cascade loads workflow files from any folder named:

  • ./.windsurf/workflows/ (at your workspace root)
  • ./**/.windsurf/workflows/ (in any subdirectory)
  • For git repos, it also searches parent directories up to the git root for .windsurf/workflows/ folders (so workflows can be shared from higher-level folders). New workflows you create are saved to the current workspace’s .windsurf/workflows/ (not necessarily the git root). [1]

(Enterprise) System-level workflows can also be deployed via OS directories like /Library/Application Support/Windsurf/workflows/*.md, /etc/windsurf/workflows/*.md, or C:\ProgramData\Windsurf\workflows\*.md, and they take precedence over workspace/global/built-in workflows. [1]

File format

  • One workflow = one Markdown file (.md) placed in a discovered .windsurf/workflows/ directory. [1]
  • A workflow Markdown file should include a title, a description, and a sequence of steps/instructions for Cascade to follow. [1]
  • File size limit: 12,000 characters per workflow file. [1]

Minimal template (practical)

# /my-workflow-name
One-line description of what this does.

1. Step one instruction for Cascade.
2. Step two instruction.
3. (Optional) Include code blocks/CLI commands as needed.

Invocation: type /my-workflow-name in Cascade. [1]

Sources:
[1] Windsurf Docs — “Workflows” (storage locations, discovery rules, and that workflows are .md with title/description/steps; size limit; enterprise paths/precedence). (docs.windsurf.com)

Citations:


🏁 Script executed:

rg -i "opsx-" . --type ts --type md | head -20

Repository: Fission-AI/OpenSpec

Length of output: 2274


Path structure is correct, but frontmatter format is unsupported for Windsurf workflows.

The path change to .windsurf/workflows/opsx-<id>.md aligns with Windsurf's directory structure, but the implementation has a critical issue: the adapter generates YAML frontmatter (name, description, category, tags), which is not documented in Windsurf's official workflow specification. According to Windsurf documentation, workflow files should contain a markdown title, description, and ordered steps—not YAML frontmatter. YAML frontmatter is only documented for Windsurf Skills (.windsurf/skills/), not workflows.

The current format may not work with actual Windsurf workflows. Consider either: (1) removing the YAML frontmatter and using markdown headers similar to the Cline adapter, or (2) clarifying that this format is intended for Skills, not workflows, and adjust the file path accordingly.

🤖 Prompt for AI Agents
In `@src/core/command-generation/adapters/windsurf.ts` around lines 34 - 44, The
windsurfAdapter currently writes YAML frontmatter for workflows which Windsurf
does not support; update the adapter (wind​surfAdapter and its getFilePath
usage) to either (A) output workflows as markdown with a title, description
paragraph and ordered steps (mirroring the Cline adapter format) and keep the
path '.windsurf/workflows/opsx-<id>.md', or (B) if YAML frontmatter is intended
for Skills, change getFilePath to place files under
'.windsurf/skills/opsx-<id>.md' and keep the frontmatter; implement one of these
two fixes consistently across the adapter so generated files match Windsurf's
documented format.

@yangjuncode yangjuncode changed the title fix windsurf workrules, Update Windsurf file path from commands to workflows Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: OpenSpec generates unsupported commands/opsx for Windsurf/Cursor

1 participant