From 04dc6deb5d68b39040cd890e0cc03e0b7702d123 Mon Sep 17 00:00:00 2001 From: yangjun <290968698@qq.com> Date: Wed, 28 Jan 2026 21:56:58 +0800 Subject: [PATCH 1/2] fix windsurf workrules --- docs/supported-tools.md | 2 +- src/core/command-generation/adapters/windsurf.ts | 4 ++-- test/core/command-generation/adapters.test.ts | 4 ++-- test/core/init.test.ts | 4 ++-- test/core/update.test.ts | 5 ++--- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/supported-tools.md b/docs/supported-tools.md index df178c5ff..d0f4e59f2 100644 --- a/docs/supported-tools.md +++ b/docs/supported-tools.md @@ -33,7 +33,7 @@ For each tool you select, OpenSpec installs: | Qoder | `.qoder/skills/` | `.qoder/commands/opsx/` | | Qwen Code | `.qwen/skills/` | `.qwen/commands/` | | RooCode | `.roo/skills/` | `.roo/commands/` | -| Windsurf | `.windsurf/skills/` | `.windsurf/commands/opsx/` | +| Windsurf | `.windsurf/skills/` | `.windsurf/workflows/` | ## Non-Interactive Setup diff --git a/src/core/command-generation/adapters/windsurf.ts b/src/core/command-generation/adapters/windsurf.ts index 3267808fe..59c86d8e0 100644 --- a/src/core/command-generation/adapters/windsurf.ts +++ b/src/core/command-generation/adapters/windsurf.ts @@ -33,14 +33,14 @@ function formatTagsArray(tags: string[]): string { /** * Windsurf adapter for command generation. - * File path: .windsurf/commands/opsx/.md + * File path: .windsurf/workflows/opsx-.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`); }, formatFile(content: CommandContent): string { diff --git a/test/core/command-generation/adapters.test.ts b/test/core/command-generation/adapters.test.ts index c40455deb..1360f61cd 100644 --- a/test/core/command-generation/adapters.test.ts +++ b/test/core/command-generation/adapters.test.ts @@ -107,7 +107,7 @@ describe('command-generation/adapters', () => { it('should generate correct file path', () => { const filePath = windsurfAdapter.getFilePath('explore'); - expect(filePath).toBe(path.join('.windsurf', 'commands', 'opsx', 'explore.md')); + expect(filePath).toBe(path.join('.windsurf', 'workflows', 'opsx-explore.md')); }); it('should format file similar to Claude format', () => { @@ -495,7 +495,7 @@ describe('command-generation/adapters', () => { it('Windsurf adapter uses path.join for paths', () => { const filePath = windsurfAdapter.getFilePath('test'); - expect(filePath.split(path.sep)).toEqual(['.windsurf', 'commands', 'opsx', 'test.md']); + expect(filePath.split(path.sep)).toEqual(['.windsurf', 'workflows', 'opsx-test.md']); }); it('All adapters use path.join for paths', () => { diff --git a/test/core/init.test.ts b/test/core/init.test.ts index f4b02bcc5..ea313ca69 100644 --- a/test/core/init.test.ts +++ b/test/core/init.test.ts @@ -12,7 +12,7 @@ describe('InitCommand', () => { await fs.mkdir(testDir, { recursive: true }); // Mock console.log to suppress output during tests - vi.spyOn(console, 'log').mockImplementation(() => {}); + vi.spyOn(console, 'log').mockImplementation(() => { }); }); afterEach(async () => { @@ -375,7 +375,7 @@ describe('InitCommand', () => { const initCommand = new InitCommand({ tools: 'windsurf', force: true }); await initCommand.execute(testDir); - const cmdFile = path.join(testDir, '.windsurf', 'commands', 'opsx', 'explore.md'); + const cmdFile = path.join(testDir, '.windsurf', 'workflows', 'opsx-explore.md'); expect(await fileExists(cmdFile)).toBe(true); }); diff --git a/test/core/update.test.ts b/test/core/update.test.ts index ce2b34369..21bb00f59 100644 --- a/test/core/update.test.ts +++ b/test/core/update.test.ts @@ -301,9 +301,8 @@ Old instructions content const windsurfCmd = path.join( testDir, '.windsurf', - 'commands', - 'opsx', - 'explore.md' + 'workflows', + 'opsx-explore.md' ); const exists = await FileSystemUtils.fileExists(windsurfCmd); expect(exists).toBe(true); From d59a0b347af9b4cccb272ea505f28906a4cc36ea Mon Sep 17 00:00:00 2001 From: yangjun <290968698@qq.com> Date: Wed, 28 Jan 2026 22:35:59 +0800 Subject: [PATCH 2/2] fix a missing update --- .../specs/command-generation/spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openspec/changes/multi-provider-skill-generation/specs/command-generation/spec.md b/openspec/changes/multi-provider-skill-generation/specs/command-generation/spec.md index 7374b20aa..ce5382824 100644 --- a/openspec/changes/multi-provider-skill-generation/specs/command-generation/spec.md +++ b/openspec/changes/multi-provider-skill-generation/specs/command-generation/spec.md @@ -49,7 +49,7 @@ The system SHALL define a `ToolCommandAdapter` interface for per-tool formatting - **WHEN** formatting a command for Windsurf - **THEN** the adapter SHALL output YAML frontmatter with `name`, `description`, `category`, `tags` fields -- **AND** file path SHALL follow pattern `.windsurf/commands/opsx/.md` +- **AND** file path SHALL follow pattern `.windsurf/workflows/opsx-.md` ### Requirement: Command generator function