From b66dc4347d7d3c0763b80a8251797ea97e5c1f9c Mon Sep 17 00:00:00 2001 From: didier Date: Wed, 5 Nov 2025 17:18:50 +0100 Subject: [PATCH 1/2] fix(cline): use workflows instead of rules for slash commands - Update ClineSlashCommandConfigurator to use .clinerules/workflows/ paths - Update tests to expect correct workflow file locations - Update README.md to reflect workflows instead of rules - Fixes Cline integration to match Cline's architecture per their blog post --- README.md | 2 +- .../fix-cline-workflows-implementation/proposal.md | 13 +++++++++++++ .../fix-cline-workflows-implementation/tasks.md | 13 +++++++++++++ src/core/configurators/slash/cline.ts | 6 +++--- test/core/init.test.ts | 8 ++++---- test/core/update.test.ts | 6 +++--- 6 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 openspec/changes/fix-cline-workflows-implementation/proposal.md create mode 100644 openspec/changes/fix-cline-workflows-implementation/tasks.md diff --git a/README.md b/README.md index 48a8ea42..89d7bcf7 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ These tools have built-in OpenSpec commands. Select the OpenSpec integration whe | **CodeBuddy Code (CLI)** | `/openspec:proposal`, `/openspec:apply`, `/openspec:archive` (`.codebuddy/commands/`) — see [docs](https://www.codebuddy.ai/cli) | | **CoStrict** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.cospec/openspec/commands/`) — see [docs](https://costrict.ai)| | **Cursor** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` | -| **Cline** | Rules in `.clinerules/` directory (`.clinerules/openspec-*.md`) | +| **Cline** | Workflows in `.clinerules/workflows/` directory (`.clinerules/workflows/openspec-*.md`) | | **Crush** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.crush/commands/openspec/`) | | **Factory Droid** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.factory/commands/`) | | **OpenCode** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` | diff --git a/openspec/changes/fix-cline-workflows-implementation/proposal.md b/openspec/changes/fix-cline-workflows-implementation/proposal.md new file mode 100644 index 00000000..2fdf41c8 --- /dev/null +++ b/openspec/changes/fix-cline-workflows-implementation/proposal.md @@ -0,0 +1,13 @@ +## Why +The Cline implementation was architecturally incorrect. According to Cline's official documentation, Cline uses workflows for on-demand automation and rules for behavioral guidelines. The OpenSpec slash commands are procedural workflows (scaffold → implement → archive), not behavioral rules, so they should be placed in `.clinerules/workflows/` instead of `.clinerules/`. + +## What Changes +- Update ClineSlashCommandConfigurator to use `.clinerules/workflows/` paths instead of `.clinerules/` paths +- Update all tests to expect the correct workflow file locations +- Update README.md documentation to reflect workflows instead of rules +- **BREAKING**: Existing Cline users will need to re-run `openspec init` to get the corrected workflow files + +## Impact +- Affected specs: cli-init (Cline tool configuration) +- Affected code: `src/core/configurators/slash/cline.ts`, test files, README.md +- New files: `.clinerules/workflows/openspec-*.md` (replaces `.clinerules/openspec-*.md`) diff --git a/openspec/changes/fix-cline-workflows-implementation/tasks.md b/openspec/changes/fix-cline-workflows-implementation/tasks.md new file mode 100644 index 00000000..a023f820 --- /dev/null +++ b/openspec/changes/fix-cline-workflows-implementation/tasks.md @@ -0,0 +1,13 @@ +## 1. Update ClineSlashCommandConfigurator +- [x] Change FILE_PATHS in `src/core/configurators/slash/cline.ts` from `.clinerules/openspec-*.md` to `.clinerules/workflows/openspec-*.md` + +## 2. Update Tests +- [x] Update "should refresh existing Cline rule files" test in `test/core/update.test.ts` to use workflow paths +- [x] Update "should create Cline rule files with templates" test in `test/core/init.test.ts` to use workflow paths + +## 3. Update Documentation +- [x] Update README.md table to show "Workflows in `.clinerules/workflows/` directory" for Cline + +## 4. Validate Changes +- [x] Ensure all tests pass with the new paths +- [x] Verify the change follows OpenSpec conventions diff --git a/src/core/configurators/slash/cline.ts b/src/core/configurators/slash/cline.ts index 7c9bda49..1c7d8c5c 100644 --- a/src/core/configurators/slash/cline.ts +++ b/src/core/configurators/slash/cline.ts @@ -2,9 +2,9 @@ import { SlashCommandConfigurator } from './base.js'; import { SlashCommandId } from '../../templates/index.js'; const FILE_PATHS: Record = { - proposal: '.clinerules/openspec-proposal.md', - apply: '.clinerules/openspec-apply.md', - archive: '.clinerules/openspec-archive.md' + proposal: '.clinerules/workflows/openspec-proposal.md', + apply: '.clinerules/workflows/openspec-apply.md', + archive: '.clinerules/workflows/openspec-archive.md' }; export class ClineSlashCommandConfigurator extends SlashCommandConfigurator { diff --git a/test/core/init.test.ts b/test/core/init.test.ts index dad27726..d928b231 100644 --- a/test/core/init.test.ts +++ b/test/core/init.test.ts @@ -414,22 +414,22 @@ describe('InitCommand', () => { expect(updatedContent).toContain('Custom instructions here'); }); - it('should create Cline rule files with templates', async () => { + it('should create Cline workflow files with templates', async () => { queueSelections('cline', DONE); await initCommand.execute(testDir); const clineProposal = path.join( testDir, - '.clinerules/openspec-proposal.md' + '.clinerules/workflows/openspec-proposal.md' ); const clineApply = path.join( testDir, - '.clinerules/openspec-apply.md' + '.clinerules/workflows/openspec-apply.md' ); const clineArchive = path.join( testDir, - '.clinerules/openspec-archive.md' + '.clinerules/workflows/openspec-archive.md' ); expect(await fileExists(clineProposal)).toBe(true); diff --git a/test/core/update.test.ts b/test/core/update.test.ts index 9bb4a2f0..2edadd64 100644 --- a/test/core/update.test.ts +++ b/test/core/update.test.ts @@ -298,10 +298,10 @@ More rules after.`; expect(fileExists).toBe(false); }); - it('should refresh existing Cline rule files', async () => { + it('should refresh existing Cline workflow files', async () => { const proposalPath = path.join( testDir, - '.clinerules/openspec-proposal.md' + '.clinerules/workflows/openspec-proposal.md' ); await fs.mkdir(path.dirname(proposalPath), { recursive: true }); const initialContent = `# OpenSpec: Proposal @@ -331,7 +331,7 @@ Old slash content ); expect(logMessage).toContain('AGENTS.md (created)'); expect(logMessage).toContain( - 'Updated slash commands: .clinerules/openspec-proposal.md' + 'Updated slash commands: .clinerules/workflows/openspec-proposal.md' ); consoleSpy.mockRestore(); From d7c5ae83f3ed93f114418eebbd5da621e216d5ef Mon Sep 17 00:00:00 2001 From: didier Date: Wed, 5 Nov 2025 18:41:40 +0100 Subject: [PATCH 2/2] Adds spec for fix-cline-workflows-implementation --- .../fix-cline-workflows-implementation/proposal.md | 4 ++-- .../specs/cli-init/spec.md | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 openspec/changes/fix-cline-workflows-implementation/specs/cli-init/spec.md diff --git a/openspec/changes/fix-cline-workflows-implementation/proposal.md b/openspec/changes/fix-cline-workflows-implementation/proposal.md index 2fdf41c8..3737254e 100644 --- a/openspec/changes/fix-cline-workflows-implementation/proposal.md +++ b/openspec/changes/fix-cline-workflows-implementation/proposal.md @@ -8,6 +8,6 @@ The Cline implementation was architecturally incorrect. According to Cline's off - **BREAKING**: Existing Cline users will need to re-run `openspec init` to get the corrected workflow files ## Impact -- Affected specs: cli-init (Cline tool configuration) +- Affected specs: cli-init (corrected Cline workflow paths) - Affected code: `src/core/configurators/slash/cline.ts`, test files, README.md -- New files: `.clinerules/workflows/openspec-*.md` (replaces `.clinerules/openspec-*.md`) +- Modified files: `.clinerules/workflows/openspec-*.md` (moved from `.clinerules/openspec-*.md`) diff --git a/openspec/changes/fix-cline-workflows-implementation/specs/cli-init/spec.md b/openspec/changes/fix-cline-workflows-implementation/specs/cli-init/spec.md new file mode 100644 index 00000000..2459a486 --- /dev/null +++ b/openspec/changes/fix-cline-workflows-implementation/specs/cli-init/spec.md @@ -0,0 +1,11 @@ +# Delta for CLI Init + +## MODIFIED Requirements +### Requirement: Slash Command Configuration + +#### Scenario: Generating slash commands for Cline +- **WHEN** the user selects Cline during initialization +- **THEN** create `.clinerules/workflows/openspec-proposal.md`, `.clinerules/workflows/openspec-apply.md`, and `.clinerules/workflows/openspec-archive.md` +- **AND** populate each file from shared templates so command text matches other tools +- **AND** include Cline-specific Markdown heading frontmatter +- **AND** each template includes instructions for the relevant OpenSpec workflow stage