@fission-ai/openspec 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -4
- package/dist/commands/change.js +6 -6
- package/dist/core/config.js +5 -0
- package/dist/core/configurators/costrict.d.ts +8 -0
- package/dist/core/configurators/costrict.js +15 -0
- package/dist/core/configurators/qoder.d.ts +30 -0
- package/dist/core/configurators/qoder.js +42 -0
- package/dist/core/configurators/qwen.d.ts +24 -0
- package/dist/core/configurators/qwen.js +37 -0
- package/dist/core/configurators/registry.js +9 -0
- package/dist/core/configurators/slash/cline.js +3 -3
- package/dist/core/configurators/slash/costrict.d.ts +9 -0
- package/dist/core/configurators/slash/costrict.js +31 -0
- package/dist/core/configurators/slash/gemini.d.ts +12 -0
- package/dist/core/configurators/slash/gemini.js +68 -0
- package/dist/core/configurators/slash/opencode.js +6 -1
- package/dist/core/configurators/slash/qoder.d.ts +35 -0
- package/dist/core/configurators/slash/qoder.js +76 -0
- package/dist/core/configurators/slash/qwen.d.ts +37 -0
- package/dist/core/configurators/slash/qwen.js +74 -0
- package/dist/core/configurators/slash/registry.js +15 -0
- package/dist/core/configurators/slash/roocode.d.ts +9 -0
- package/dist/core/configurators/slash/roocode.js +23 -0
- package/dist/core/init.d.ts +2 -0
- package/dist/core/init.js +68 -17
- package/dist/core/templates/agents-template.d.ts +1 -1
- package/dist/core/templates/agents-template.js +2 -0
- package/dist/core/templates/costrict-template.d.ts +2 -0
- package/dist/core/templates/costrict-template.js +2 -0
- package/dist/core/templates/index.d.ts +1 -0
- package/dist/core/templates/index.js +4 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -92,16 +92,22 @@ These tools have built-in OpenSpec commands. Select the OpenSpec integration whe
|
|
|
92
92
|
|------|----------|
|
|
93
93
|
| **Claude Code** | `/openspec:proposal`, `/openspec:apply`, `/openspec:archive` |
|
|
94
94
|
| **CodeBuddy Code (CLI)** | `/openspec:proposal`, `/openspec:apply`, `/openspec:archive` (`.codebuddy/commands/`) — see [docs](https://www.codebuddy.ai/cli) |
|
|
95
|
+
| **CoStrict** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.cospec/openspec/commands/`) — see [docs](https://costrict.ai)|
|
|
95
96
|
| **Cursor** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` |
|
|
96
|
-
| **Cline** |
|
|
97
|
+
| **Cline** | Workflows in `.clinerules/workflows/` directory (`.clinerules/workflows/openspec-*.md`) |
|
|
98
|
+
| **Crush** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.crush/commands/openspec/`) |
|
|
99
|
+
| **RooCode** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.roo/commands/`) |
|
|
97
100
|
| **Factory Droid** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.factory/commands/`) |
|
|
101
|
+
| **Gemini CLI** | `/openspec:proposal`, `/openspec:apply`, `/openspec:archive` (`.gemini/commands/openspec/`) |
|
|
98
102
|
| **OpenCode** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` |
|
|
99
103
|
| **Kilo Code** | `/openspec-proposal.md`, `/openspec-apply.md`, `/openspec-archive.md` (`.kilocode/workflows/`) |
|
|
104
|
+
| **Qoder (CLI)** | `/openspec:proposal`, `/openspec:apply`, `/openspec:archive` (`.qoder/commands/openspec/`) — see [docs](https://qoder.com/cli) |
|
|
100
105
|
| **Windsurf** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.windsurf/workflows/`) |
|
|
101
106
|
| **Codex** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (global: `~/.codex/prompts`, auto-installed) |
|
|
102
107
|
| **GitHub Copilot** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.github/prompts/`) |
|
|
103
108
|
| **Amazon Q Developer** | `@openspec-proposal`, `@openspec-apply`, `@openspec-archive` (`.amazonq/prompts/`) |
|
|
104
109
|
| **Auggie (Augment CLI)** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.augment/commands/`) |
|
|
110
|
+
| **Qwen Code** | `/openspec-proposal`, `/openspec-apply`, `/openspec-archive` (`.qwen/commands/`) |
|
|
105
111
|
|
|
106
112
|
|
|
107
113
|
Kilo Code discovers team workflows automatically. Save the generated files under `.kilocode/workflows/` and trigger them from the command palette with `/openspec-proposal.md`, `/openspec-apply.md`, or `/openspec-archive.md`.
|
|
@@ -111,7 +117,7 @@ These tools automatically read workflow instructions from `openspec/AGENTS.md`.
|
|
|
111
117
|
|
|
112
118
|
| Tools |
|
|
113
119
|
|-------|
|
|
114
|
-
| Amp • Jules •
|
|
120
|
+
| Amp • Jules • Others |
|
|
115
121
|
|
|
116
122
|
### Install & Initialize
|
|
117
123
|
|
|
@@ -142,7 +148,7 @@ openspec init
|
|
|
142
148
|
```
|
|
143
149
|
|
|
144
150
|
**What happens during initialization:**
|
|
145
|
-
- You'll be prompted to pick any natively supported AI tools (Claude Code, CodeBuddy, Cursor, OpenCode, etc.); other assistants always rely on the shared `AGENTS.md` stub
|
|
151
|
+
- You'll be prompted to pick any natively supported AI tools (Claude Code, CodeBuddy, Cursor, OpenCode, Qoder,etc.); other assistants always rely on the shared `AGENTS.md` stub
|
|
146
152
|
- OpenSpec automatically configures slash commands for the tools you choose and always writes a managed `AGENTS.md` hand-off at the project root
|
|
147
153
|
- A new `openspec/` directory structure is created in your project
|
|
148
154
|
|
|
@@ -152,6 +158,17 @@ openspec init
|
|
|
152
158
|
- If your coding assistant doesn't surface the new slash commands right away, restart it. Slash commands are loaded at startup,
|
|
153
159
|
so a fresh launch ensures they appear
|
|
154
160
|
|
|
161
|
+
### Optional: Populate Project Context
|
|
162
|
+
|
|
163
|
+
After `openspec init` completes, you'll receive a suggested prompt to help populate your project context:
|
|
164
|
+
|
|
165
|
+
```text
|
|
166
|
+
Populate your project context:
|
|
167
|
+
"Please read openspec/project.md and help me fill it out with details about my project, tech stack, and conventions"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Use `openspec/project.md` to define project-level conventions, standards, architectural patterns, and other guidelines that should be followed across all changes.
|
|
171
|
+
|
|
155
172
|
### Create Your First Change
|
|
156
173
|
|
|
157
174
|
Here's a real example showing the complete OpenSpec workflow. This works with any AI tool. Those with native slash commands will recognize the shortcuts automatically.
|
|
@@ -217,7 +234,7 @@ Or run the command yourself in terminal:
|
|
|
217
234
|
$ openspec archive add-profile-filters --yes # Archive the completed change without prompts
|
|
218
235
|
```
|
|
219
236
|
|
|
220
|
-
**Note:** Tools with native slash commands (Claude Code, CodeBuddy, Cursor, Codex) can use the shortcuts shown. All other tools work with natural language requests to "create an OpenSpec proposal", "apply the OpenSpec change", or "archive the change".
|
|
237
|
+
**Note:** Tools with native slash commands (Claude Code, CodeBuddy, Cursor, Codex, Qoder, RooCode) can use the shortcuts shown. All other tools work with natural language requests to "create an OpenSpec proposal", "apply the OpenSpec change", or "archive the change".
|
|
221
238
|
|
|
222
239
|
## Command Reference
|
|
223
240
|
|
package/dist/commands/change.js
CHANGED
|
@@ -59,7 +59,7 @@ export class ChangeCommand {
|
|
|
59
59
|
}
|
|
60
60
|
const parsed = JSON.parse(jsonOutput);
|
|
61
61
|
const contentForTitle = await fs.readFile(proposalPath, 'utf-8');
|
|
62
|
-
const title = this.extractTitle(contentForTitle);
|
|
62
|
+
const title = this.extractTitle(contentForTitle, changeName);
|
|
63
63
|
const id = parsed.name;
|
|
64
64
|
const deltas = parsed.deltas || [];
|
|
65
65
|
if (options.requirementsOnly || options.deltasOnly) {
|
|
@@ -111,7 +111,7 @@ export class ChangeCommand {
|
|
|
111
111
|
}
|
|
112
112
|
return {
|
|
113
113
|
id: changeName,
|
|
114
|
-
title: this.extractTitle(content),
|
|
114
|
+
title: this.extractTitle(content, changeName),
|
|
115
115
|
deltaCount: change.deltas.length,
|
|
116
116
|
taskStatus,
|
|
117
117
|
};
|
|
@@ -145,7 +145,7 @@ export class ChangeCommand {
|
|
|
145
145
|
const tasksPath = path.join(changesPath, changeName, 'tasks.md');
|
|
146
146
|
try {
|
|
147
147
|
const content = await fs.readFile(proposalPath, 'utf-8');
|
|
148
|
-
const title = this.extractTitle(content);
|
|
148
|
+
const title = this.extractTitle(content, changeName);
|
|
149
149
|
let taskStatusText = '';
|
|
150
150
|
try {
|
|
151
151
|
const tasksContent = await fs.readFile(tasksPath, 'utf-8');
|
|
@@ -246,9 +246,9 @@ export class ChangeCommand {
|
|
|
246
246
|
return [];
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
extractTitle(content) {
|
|
250
|
-
const match = content.match(/^#\s+(?:Change:\s+)?(.+)$/
|
|
251
|
-
return match ? match[1].trim() :
|
|
249
|
+
extractTitle(content, changeName) {
|
|
250
|
+
const match = content.match(/^#\s+(?:Change:\s+)?(.+)$/im);
|
|
251
|
+
return match ? match[1].trim() : changeName;
|
|
252
252
|
}
|
|
253
253
|
countTasks(content) {
|
|
254
254
|
const lines = content.split('\n');
|
package/dist/core/config.js
CHANGED
|
@@ -7,16 +7,21 @@ export const AI_TOOLS = [
|
|
|
7
7
|
{ name: 'Auggie (Augment CLI)', value: 'auggie', available: true, successLabel: 'Auggie' },
|
|
8
8
|
{ name: 'Claude Code', value: 'claude', available: true, successLabel: 'Claude Code' },
|
|
9
9
|
{ name: 'Cline', value: 'cline', available: true, successLabel: 'Cline' },
|
|
10
|
+
{ name: 'RooCode', value: 'roocode', available: true, successLabel: 'RooCode' },
|
|
10
11
|
{ name: 'CodeBuddy Code (CLI)', value: 'codebuddy', available: true, successLabel: 'CodeBuddy Code' },
|
|
12
|
+
{ name: 'CoStrict', value: 'costrict', available: true, successLabel: 'CoStrict' },
|
|
11
13
|
{ name: 'Crush', value: 'crush', available: true, successLabel: 'Crush' },
|
|
12
14
|
{ name: 'Cursor', value: 'cursor', available: true, successLabel: 'Cursor' },
|
|
13
15
|
{ name: 'Factory Droid', value: 'factory', available: true, successLabel: 'Factory Droid' },
|
|
16
|
+
{ name: 'Gemini CLI', value: 'gemini', available: true, successLabel: 'Gemini CLI' },
|
|
14
17
|
{ name: 'OpenCode', value: 'opencode', available: true, successLabel: 'OpenCode' },
|
|
15
18
|
{ name: 'Kilo Code', value: 'kilocode', available: true, successLabel: 'Kilo Code' },
|
|
19
|
+
{ name: 'Qoder (CLI)', value: 'qoder', available: true, successLabel: 'Qoder' },
|
|
16
20
|
{ name: 'Windsurf', value: 'windsurf', available: true, successLabel: 'Windsurf' },
|
|
17
21
|
{ name: 'Codex', value: 'codex', available: true, successLabel: 'Codex' },
|
|
18
22
|
{ name: 'GitHub Copilot', value: 'github-copilot', available: true, successLabel: 'GitHub Copilot' },
|
|
19
23
|
{ name: 'Amazon Q Developer', value: 'amazon-q', available: true, successLabel: 'Amazon Q Developer' },
|
|
24
|
+
{ name: 'Qwen Code', value: 'qwen', available: true, successLabel: 'Qwen Code' },
|
|
20
25
|
{ name: 'AGENTS.md (works with Amp, VS Code, …)', value: 'agents', available: false, successLabel: 'your AGENTS.md-compatible assistant' }
|
|
21
26
|
];
|
|
22
27
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ToolConfigurator } from './base.js';
|
|
2
|
+
export declare class CostrictConfigurator implements ToolConfigurator {
|
|
3
|
+
name: string;
|
|
4
|
+
configFileName: string;
|
|
5
|
+
isAvailable: boolean;
|
|
6
|
+
configure(projectPath: string, openspecDir: string): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=costrict.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { FileSystemUtils } from '../../utils/file-system.js';
|
|
3
|
+
import { TemplateManager } from '../templates/index.js';
|
|
4
|
+
import { OPENSPEC_MARKERS } from '../config.js';
|
|
5
|
+
export class CostrictConfigurator {
|
|
6
|
+
name = 'CoStrict';
|
|
7
|
+
configFileName = 'COSTRICT.md';
|
|
8
|
+
isAvailable = true;
|
|
9
|
+
async configure(projectPath, openspecDir) {
|
|
10
|
+
const filePath = path.join(projectPath, this.configFileName);
|
|
11
|
+
const content = TemplateManager.getCostrictTemplate();
|
|
12
|
+
await FileSystemUtils.updateFileWithMarkers(filePath, content, OPENSPEC_MARKERS.start, OPENSPEC_MARKERS.end);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=costrict.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ToolConfigurator } from './base.js';
|
|
2
|
+
/**
|
|
3
|
+
* Qoder AI Tool Configurator
|
|
4
|
+
*
|
|
5
|
+
* Configures OpenSpec integration for Qoder AI coding assistant.
|
|
6
|
+
* Creates and manages QODER.md configuration file with OpenSpec instructions.
|
|
7
|
+
*
|
|
8
|
+
* @implements {ToolConfigurator}
|
|
9
|
+
*/
|
|
10
|
+
export declare class QoderConfigurator implements ToolConfigurator {
|
|
11
|
+
/** Display name for the Qoder tool */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Configuration file name at project root */
|
|
14
|
+
configFileName: string;
|
|
15
|
+
/** Indicates tool is available for configuration */
|
|
16
|
+
isAvailable: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Configure Qoder integration for a project
|
|
19
|
+
*
|
|
20
|
+
* Creates or updates QODER.md file with OpenSpec instructions.
|
|
21
|
+
* Uses Claude-compatible template for instruction content.
|
|
22
|
+
* Wrapped with OpenSpec markers for future updates.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} projectPath - Absolute path to project root directory
|
|
25
|
+
* @param {string} openspecDir - Path to openspec directory (unused but required by interface)
|
|
26
|
+
* @returns {Promise<void>} Resolves when configuration is complete
|
|
27
|
+
*/
|
|
28
|
+
configure(projectPath: string, openspecDir: string): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=qoder.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { FileSystemUtils } from '../../utils/file-system.js';
|
|
3
|
+
import { TemplateManager } from '../templates/index.js';
|
|
4
|
+
import { OPENSPEC_MARKERS } from '../config.js';
|
|
5
|
+
/**
|
|
6
|
+
* Qoder AI Tool Configurator
|
|
7
|
+
*
|
|
8
|
+
* Configures OpenSpec integration for Qoder AI coding assistant.
|
|
9
|
+
* Creates and manages QODER.md configuration file with OpenSpec instructions.
|
|
10
|
+
*
|
|
11
|
+
* @implements {ToolConfigurator}
|
|
12
|
+
*/
|
|
13
|
+
export class QoderConfigurator {
|
|
14
|
+
/** Display name for the Qoder tool */
|
|
15
|
+
name = 'Qoder';
|
|
16
|
+
/** Configuration file name at project root */
|
|
17
|
+
configFileName = 'QODER.md';
|
|
18
|
+
/** Indicates tool is available for configuration */
|
|
19
|
+
isAvailable = true;
|
|
20
|
+
/**
|
|
21
|
+
* Configure Qoder integration for a project
|
|
22
|
+
*
|
|
23
|
+
* Creates or updates QODER.md file with OpenSpec instructions.
|
|
24
|
+
* Uses Claude-compatible template for instruction content.
|
|
25
|
+
* Wrapped with OpenSpec markers for future updates.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} projectPath - Absolute path to project root directory
|
|
28
|
+
* @param {string} openspecDir - Path to openspec directory (unused but required by interface)
|
|
29
|
+
* @returns {Promise<void>} Resolves when configuration is complete
|
|
30
|
+
*/
|
|
31
|
+
async configure(projectPath, openspecDir) {
|
|
32
|
+
// Construct full path to QODER.md at project root
|
|
33
|
+
const filePath = path.join(projectPath, this.configFileName);
|
|
34
|
+
// Get Claude-compatible instruction template
|
|
35
|
+
// This ensures Qoder receives the same high-quality OpenSpec instructions
|
|
36
|
+
const content = TemplateManager.getClaudeTemplate();
|
|
37
|
+
// Write or update file with managed content between markers
|
|
38
|
+
// This allows future updates to refresh instructions automatically
|
|
39
|
+
await FileSystemUtils.updateFileWithMarkers(filePath, content, OPENSPEC_MARKERS.start, OPENSPEC_MARKERS.end);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=qoder.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ToolConfigurator } from './base.js';
|
|
2
|
+
/**
|
|
3
|
+
* QwenConfigurator class provides integration with Qwen Code
|
|
4
|
+
* by creating and managing the necessary configuration files.
|
|
5
|
+
* Currently configures the QWEN.md file with OpenSpec instructions.
|
|
6
|
+
*/
|
|
7
|
+
export declare class QwenConfigurator implements ToolConfigurator {
|
|
8
|
+
/** Display name for the Qwen Code tool */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Configuration file name for Qwen Code */
|
|
11
|
+
configFileName: string;
|
|
12
|
+
/** Availability status for the Qwen Code tool */
|
|
13
|
+
isAvailable: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Configures the Qwen Code integration by creating or updating the QWEN.md file
|
|
16
|
+
* with OpenSpec instructions and markers.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} projectPath - The path to the project root
|
|
19
|
+
* @param {string} _openspecDir - The path to the openspec directory (unused)
|
|
20
|
+
* @returns {Promise<void>} A promise that resolves when configuration is complete
|
|
21
|
+
*/
|
|
22
|
+
configure(projectPath: string, _openspecDir: string): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=qwen.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Qwen Code configurator for OpenSpec integration.
|
|
3
|
+
* This class handles the configuration of Qwen Code as an AI tool within OpenSpec.
|
|
4
|
+
*
|
|
5
|
+
* @implements {ToolConfigurator}
|
|
6
|
+
*/
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import { FileSystemUtils } from '../../utils/file-system.js';
|
|
9
|
+
import { TemplateManager } from '../templates/index.js';
|
|
10
|
+
import { OPENSPEC_MARKERS } from '../config.js';
|
|
11
|
+
/**
|
|
12
|
+
* QwenConfigurator class provides integration with Qwen Code
|
|
13
|
+
* by creating and managing the necessary configuration files.
|
|
14
|
+
* Currently configures the QWEN.md file with OpenSpec instructions.
|
|
15
|
+
*/
|
|
16
|
+
export class QwenConfigurator {
|
|
17
|
+
/** Display name for the Qwen Code tool */
|
|
18
|
+
name = 'Qwen Code';
|
|
19
|
+
/** Configuration file name for Qwen Code */
|
|
20
|
+
configFileName = 'QWEN.md';
|
|
21
|
+
/** Availability status for the Qwen Code tool */
|
|
22
|
+
isAvailable = true;
|
|
23
|
+
/**
|
|
24
|
+
* Configures the Qwen Code integration by creating or updating the QWEN.md file
|
|
25
|
+
* with OpenSpec instructions and markers.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} projectPath - The path to the project root
|
|
28
|
+
* @param {string} _openspecDir - The path to the openspec directory (unused)
|
|
29
|
+
* @returns {Promise<void>} A promise that resolves when configuration is complete
|
|
30
|
+
*/
|
|
31
|
+
async configure(projectPath, _openspecDir) {
|
|
32
|
+
const filePath = path.join(projectPath, this.configFileName);
|
|
33
|
+
const content = TemplateManager.getAgentsStandardTemplate();
|
|
34
|
+
await FileSystemUtils.updateFileWithMarkers(filePath, content, OPENSPEC_MARKERS.start, OPENSPEC_MARKERS.end);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=qwen.js.map
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { ClaudeConfigurator } from './claude.js';
|
|
2
2
|
import { ClineConfigurator } from './cline.js';
|
|
3
3
|
import { CodeBuddyConfigurator } from './codebuddy.js';
|
|
4
|
+
import { CostrictConfigurator } from './costrict.js';
|
|
5
|
+
import { QoderConfigurator } from './qoder.js';
|
|
4
6
|
import { AgentsStandardConfigurator } from './agents.js';
|
|
7
|
+
import { QwenConfigurator } from './qwen.js';
|
|
5
8
|
export class ToolRegistry {
|
|
6
9
|
static tools = new Map();
|
|
7
10
|
static {
|
|
8
11
|
const claudeConfigurator = new ClaudeConfigurator();
|
|
9
12
|
const clineConfigurator = new ClineConfigurator();
|
|
10
13
|
const codeBuddyConfigurator = new CodeBuddyConfigurator();
|
|
14
|
+
const costrictConfigurator = new CostrictConfigurator();
|
|
15
|
+
const qoderConfigurator = new QoderConfigurator();
|
|
11
16
|
const agentsConfigurator = new AgentsStandardConfigurator();
|
|
17
|
+
const qwenConfigurator = new QwenConfigurator();
|
|
12
18
|
// Register with the ID that matches the checkbox value
|
|
13
19
|
this.tools.set('claude', claudeConfigurator);
|
|
14
20
|
this.tools.set('cline', clineConfigurator);
|
|
15
21
|
this.tools.set('codebuddy', codeBuddyConfigurator);
|
|
22
|
+
this.tools.set('costrict', costrictConfigurator);
|
|
23
|
+
this.tools.set('qoder', qoderConfigurator);
|
|
16
24
|
this.tools.set('agents', agentsConfigurator);
|
|
25
|
+
this.tools.set('qwen', qwenConfigurator);
|
|
17
26
|
}
|
|
18
27
|
static register(tool) {
|
|
19
28
|
this.tools.set(tool.name.toLowerCase().replace(/\s+/g, '-'), tool);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SlashCommandConfigurator } from './base.js';
|
|
2
2
|
const FILE_PATHS = {
|
|
3
|
-
proposal: '.clinerules/openspec-proposal.md',
|
|
4
|
-
apply: '.clinerules/openspec-apply.md',
|
|
5
|
-
archive: '.clinerules/openspec-archive.md'
|
|
3
|
+
proposal: '.clinerules/workflows/openspec-proposal.md',
|
|
4
|
+
apply: '.clinerules/workflows/openspec-apply.md',
|
|
5
|
+
archive: '.clinerules/workflows/openspec-archive.md'
|
|
6
6
|
};
|
|
7
7
|
export class ClineSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
8
8
|
toolId = 'cline';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
3
|
+
export declare class CostrictSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
|
+
readonly toolId = "costrict";
|
|
5
|
+
readonly isAvailable = true;
|
|
6
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
7
|
+
protected getFrontmatter(id: SlashCommandId): string | undefined;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=costrict.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
const FILE_PATHS = {
|
|
3
|
+
proposal: '.cospec/openspec/commands/openspec-proposal.md',
|
|
4
|
+
apply: '.cospec/openspec/commands/openspec-apply.md',
|
|
5
|
+
archive: '.cospec/openspec/commands/openspec-archive.md',
|
|
6
|
+
};
|
|
7
|
+
const FRONTMATTER = {
|
|
8
|
+
proposal: `---
|
|
9
|
+
description: "Scaffold a new OpenSpec change and validate strictly."
|
|
10
|
+
argument-hint: feature description or request
|
|
11
|
+
---`,
|
|
12
|
+
apply: `---
|
|
13
|
+
description: "Implement an approved OpenSpec change and keep tasks in sync."
|
|
14
|
+
argument-hint: change-id
|
|
15
|
+
---`,
|
|
16
|
+
archive: `---
|
|
17
|
+
description: "Archive a deployed OpenSpec change and update specs."
|
|
18
|
+
argument-hint: change-id
|
|
19
|
+
---`
|
|
20
|
+
};
|
|
21
|
+
export class CostrictSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
22
|
+
toolId = 'costrict';
|
|
23
|
+
isAvailable = true;
|
|
24
|
+
getRelativePath(id) {
|
|
25
|
+
return FILE_PATHS[id];
|
|
26
|
+
}
|
|
27
|
+
getFrontmatter(id) {
|
|
28
|
+
return FRONTMATTER[id];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=costrict.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
3
|
+
export declare class GeminiSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
|
+
readonly toolId = "gemini";
|
|
5
|
+
readonly isAvailable = true;
|
|
6
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
7
|
+
protected getFrontmatter(_id: SlashCommandId): string | undefined;
|
|
8
|
+
generateAll(projectPath: string, _openspecDir: string): Promise<string[]>;
|
|
9
|
+
private generateTOML;
|
|
10
|
+
protected updateBody(filePath: string, body: string): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=gemini.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { FileSystemUtils } from '../../../utils/file-system.js';
|
|
2
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
3
|
+
import { OPENSPEC_MARKERS } from '../../config.js';
|
|
4
|
+
const FILE_PATHS = {
|
|
5
|
+
proposal: '.gemini/commands/openspec/proposal.toml',
|
|
6
|
+
apply: '.gemini/commands/openspec/apply.toml',
|
|
7
|
+
archive: '.gemini/commands/openspec/archive.toml'
|
|
8
|
+
};
|
|
9
|
+
const DESCRIPTIONS = {
|
|
10
|
+
proposal: 'Scaffold a new OpenSpec change and validate strictly.',
|
|
11
|
+
apply: 'Implement an approved OpenSpec change and keep tasks in sync.',
|
|
12
|
+
archive: 'Archive a deployed OpenSpec change and update specs.'
|
|
13
|
+
};
|
|
14
|
+
export class GeminiSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
15
|
+
toolId = 'gemini';
|
|
16
|
+
isAvailable = true;
|
|
17
|
+
getRelativePath(id) {
|
|
18
|
+
return FILE_PATHS[id];
|
|
19
|
+
}
|
|
20
|
+
getFrontmatter(_id) {
|
|
21
|
+
// TOML doesn't use separate frontmatter - it's all in one structure
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
// Override to generate TOML format with markers inside the prompt field
|
|
25
|
+
async generateAll(projectPath, _openspecDir) {
|
|
26
|
+
const createdOrUpdated = [];
|
|
27
|
+
for (const target of this.getTargets()) {
|
|
28
|
+
const body = this.getBody(target.id);
|
|
29
|
+
const filePath = FileSystemUtils.joinPath(projectPath, target.path);
|
|
30
|
+
if (await FileSystemUtils.fileExists(filePath)) {
|
|
31
|
+
await this.updateBody(filePath, body);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const tomlContent = this.generateTOML(target.id, body);
|
|
35
|
+
await FileSystemUtils.writeFile(filePath, tomlContent);
|
|
36
|
+
}
|
|
37
|
+
createdOrUpdated.push(target.path);
|
|
38
|
+
}
|
|
39
|
+
return createdOrUpdated;
|
|
40
|
+
}
|
|
41
|
+
generateTOML(id, body) {
|
|
42
|
+
const description = DESCRIPTIONS[id];
|
|
43
|
+
// TOML format with triple-quoted string for multi-line prompt
|
|
44
|
+
// Markers are inside the prompt value
|
|
45
|
+
return `description = "${description}"
|
|
46
|
+
|
|
47
|
+
prompt = """
|
|
48
|
+
${OPENSPEC_MARKERS.start}
|
|
49
|
+
${body}
|
|
50
|
+
${OPENSPEC_MARKERS.end}
|
|
51
|
+
"""
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
// Override updateBody to handle TOML format
|
|
55
|
+
async updateBody(filePath, body) {
|
|
56
|
+
const content = await FileSystemUtils.readFile(filePath);
|
|
57
|
+
const startIndex = content.indexOf(OPENSPEC_MARKERS.start);
|
|
58
|
+
const endIndex = content.indexOf(OPENSPEC_MARKERS.end);
|
|
59
|
+
if (startIndex === -1 || endIndex === -1 || endIndex <= startIndex) {
|
|
60
|
+
throw new Error(`Missing OpenSpec markers in ${filePath}`);
|
|
61
|
+
}
|
|
62
|
+
const before = content.slice(0, startIndex + OPENSPEC_MARKERS.start.length);
|
|
63
|
+
const after = content.slice(endIndex);
|
|
64
|
+
const updatedContent = `${before}\n${body}\n${after}`;
|
|
65
|
+
await FileSystemUtils.writeFile(filePath, updatedContent);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=gemini.js.map
|
|
@@ -19,7 +19,12 @@ The user has requested the following change proposal. Use the openspec instructi
|
|
|
19
19
|
apply: `---
|
|
20
20
|
agent: build
|
|
21
21
|
description: Implement an approved OpenSpec change and keep tasks in sync.
|
|
22
|
-
|
|
22
|
+
---
|
|
23
|
+
The user has requested to implement the following change proposal. Find the change proposal and follow the instructions below. If you're not sure or if ambiguous, ask for clarification from the user.
|
|
24
|
+
<UserRequest>
|
|
25
|
+
$ARGUMENTS
|
|
26
|
+
</UserRequest>
|
|
27
|
+
`,
|
|
23
28
|
archive: `---
|
|
24
29
|
agent: build
|
|
25
30
|
description: Archive a deployed OpenSpec change and update specs.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Qoder Slash Command Configurator
|
|
5
|
+
*
|
|
6
|
+
* Manages OpenSpec slash commands for Qoder AI assistant.
|
|
7
|
+
* Creates three workflow commands: proposal, apply, and archive.
|
|
8
|
+
* Uses colon-separated command format (/openspec:proposal).
|
|
9
|
+
*
|
|
10
|
+
* @extends {SlashCommandConfigurator}
|
|
11
|
+
*/
|
|
12
|
+
export declare class QoderSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
13
|
+
/** Unique identifier for Qoder tool */
|
|
14
|
+
readonly toolId = "qoder";
|
|
15
|
+
/** Indicates slash commands are available for this tool */
|
|
16
|
+
readonly isAvailable = true;
|
|
17
|
+
/**
|
|
18
|
+
* Get relative file path for a slash command
|
|
19
|
+
*
|
|
20
|
+
* @param {SlashCommandId} id - Command identifier (proposal, apply, or archive)
|
|
21
|
+
* @returns {string} Relative path from project root to command file
|
|
22
|
+
*/
|
|
23
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get YAML frontmatter for a slash command
|
|
26
|
+
*
|
|
27
|
+
* Frontmatter defines how the command appears in Qoder's UI,
|
|
28
|
+
* including display name, description, and categorization.
|
|
29
|
+
*
|
|
30
|
+
* @param {SlashCommandId} id - Command identifier (proposal, apply, or archive)
|
|
31
|
+
* @returns {string} YAML frontmatter block with command metadata
|
|
32
|
+
*/
|
|
33
|
+
protected getFrontmatter(id: SlashCommandId): string;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=qoder.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
/**
|
|
3
|
+
* File paths for Qoder slash commands
|
|
4
|
+
* Maps each OpenSpec workflow stage to its command file location
|
|
5
|
+
* Commands are stored in .qoder/commands/openspec/ directory
|
|
6
|
+
*/
|
|
7
|
+
const FILE_PATHS = {
|
|
8
|
+
// Create and validate new change proposals
|
|
9
|
+
proposal: '.qoder/commands/openspec/proposal.md',
|
|
10
|
+
// Implement approved changes with task tracking
|
|
11
|
+
apply: '.qoder/commands/openspec/apply.md',
|
|
12
|
+
// Archive completed changes and update specs
|
|
13
|
+
archive: '.qoder/commands/openspec/archive.md'
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* YAML frontmatter for Qoder slash commands
|
|
17
|
+
* Defines metadata displayed in Qoder's command palette
|
|
18
|
+
* Each command is categorized and tagged for easy discovery
|
|
19
|
+
*/
|
|
20
|
+
const FRONTMATTER = {
|
|
21
|
+
proposal: `---
|
|
22
|
+
name: OpenSpec: Proposal
|
|
23
|
+
description: Scaffold a new OpenSpec change and validate strictly.
|
|
24
|
+
category: OpenSpec
|
|
25
|
+
tags: [openspec, change]
|
|
26
|
+
---`,
|
|
27
|
+
apply: `---
|
|
28
|
+
name: OpenSpec: Apply
|
|
29
|
+
description: Implement an approved OpenSpec change and keep tasks in sync.
|
|
30
|
+
category: OpenSpec
|
|
31
|
+
tags: [openspec, apply]
|
|
32
|
+
---`,
|
|
33
|
+
archive: `---
|
|
34
|
+
name: OpenSpec: Archive
|
|
35
|
+
description: Archive a deployed OpenSpec change and update specs.
|
|
36
|
+
category: OpenSpec
|
|
37
|
+
tags: [openspec, archive]
|
|
38
|
+
---`
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Qoder Slash Command Configurator
|
|
42
|
+
*
|
|
43
|
+
* Manages OpenSpec slash commands for Qoder AI assistant.
|
|
44
|
+
* Creates three workflow commands: proposal, apply, and archive.
|
|
45
|
+
* Uses colon-separated command format (/openspec:proposal).
|
|
46
|
+
*
|
|
47
|
+
* @extends {SlashCommandConfigurator}
|
|
48
|
+
*/
|
|
49
|
+
export class QoderSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
50
|
+
/** Unique identifier for Qoder tool */
|
|
51
|
+
toolId = 'qoder';
|
|
52
|
+
/** Indicates slash commands are available for this tool */
|
|
53
|
+
isAvailable = true;
|
|
54
|
+
/**
|
|
55
|
+
* Get relative file path for a slash command
|
|
56
|
+
*
|
|
57
|
+
* @param {SlashCommandId} id - Command identifier (proposal, apply, or archive)
|
|
58
|
+
* @returns {string} Relative path from project root to command file
|
|
59
|
+
*/
|
|
60
|
+
getRelativePath(id) {
|
|
61
|
+
return FILE_PATHS[id];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get YAML frontmatter for a slash command
|
|
65
|
+
*
|
|
66
|
+
* Frontmatter defines how the command appears in Qoder's UI,
|
|
67
|
+
* including display name, description, and categorization.
|
|
68
|
+
*
|
|
69
|
+
* @param {SlashCommandId} id - Command identifier (proposal, apply, or archive)
|
|
70
|
+
* @returns {string} YAML frontmatter block with command metadata
|
|
71
|
+
*/
|
|
72
|
+
getFrontmatter(id) {
|
|
73
|
+
return FRONTMATTER[id];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=qoder.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Qwen slash command configurator for OpenSpec integration.
|
|
3
|
+
* This class handles the generation of Qwen-specific slash command files
|
|
4
|
+
* in the .qwen/commands directory structure.
|
|
5
|
+
*
|
|
6
|
+
* @implements {SlashCommandConfigurator}
|
|
7
|
+
*/
|
|
8
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
9
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* QwenSlashCommandConfigurator class provides integration with Qwen Code
|
|
12
|
+
* by creating the necessary slash command files in the .qwen/commands directory.
|
|
13
|
+
*
|
|
14
|
+
* The slash commands include:
|
|
15
|
+
* - /openspec-proposal: Create an OpenSpec change proposal
|
|
16
|
+
* - /openspec-apply: Apply an approved OpenSpec change
|
|
17
|
+
* - /openspec-archive: Archive a deployed OpenSpec change
|
|
18
|
+
*/
|
|
19
|
+
export declare class QwenSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
20
|
+
/** Unique identifier for the Qwen tool */
|
|
21
|
+
readonly toolId = "qwen";
|
|
22
|
+
/** Availability status for the Qwen tool */
|
|
23
|
+
readonly isAvailable = true;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the relative file path for a given slash command ID.
|
|
26
|
+
* @param {SlashCommandId} id - The slash command identifier
|
|
27
|
+
* @returns {string} The relative path to the command file
|
|
28
|
+
*/
|
|
29
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
30
|
+
/**
|
|
31
|
+
* Returns the YAML frontmatter for a given slash command ID.
|
|
32
|
+
* @param {SlashCommandId} id - The slash command identifier
|
|
33
|
+
* @returns {string} The YAML frontmatter string
|
|
34
|
+
*/
|
|
35
|
+
protected getFrontmatter(id: SlashCommandId): string;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=qwen.d.ts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Qwen slash command configurator for OpenSpec integration.
|
|
3
|
+
* This class handles the generation of Qwen-specific slash command files
|
|
4
|
+
* in the .qwen/commands directory structure.
|
|
5
|
+
*
|
|
6
|
+
* @implements {SlashCommandConfigurator}
|
|
7
|
+
*/
|
|
8
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
9
|
+
/**
|
|
10
|
+
* Mapping of slash command IDs to their corresponding file paths in .qwen/commands directory.
|
|
11
|
+
* @type {Record<SlashCommandId, string>}
|
|
12
|
+
*/
|
|
13
|
+
const FILE_PATHS = {
|
|
14
|
+
proposal: '.qwen/commands/openspec-proposal.md',
|
|
15
|
+
apply: '.qwen/commands/openspec-apply.md',
|
|
16
|
+
archive: '.qwen/commands/openspec-archive.md'
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* YAML frontmatter definitions for Qwen command files.
|
|
20
|
+
* These provide metadata for each slash command to ensure proper recognition by Qwen Code.
|
|
21
|
+
* @type {Record<SlashCommandId, string>}
|
|
22
|
+
*/
|
|
23
|
+
const FRONTMATTER = {
|
|
24
|
+
proposal: `---
|
|
25
|
+
name: /openspec-proposal
|
|
26
|
+
id: openspec-proposal
|
|
27
|
+
category: OpenSpec
|
|
28
|
+
description: Scaffold a new OpenSpec change and validate strictly.
|
|
29
|
+
---`,
|
|
30
|
+
apply: `---
|
|
31
|
+
name: /openspec-apply
|
|
32
|
+
id: openspec-apply
|
|
33
|
+
category: OpenSpec
|
|
34
|
+
description: Implement an approved OpenSpec change and keep tasks in sync.
|
|
35
|
+
---`,
|
|
36
|
+
archive: `---
|
|
37
|
+
name: /openspec-archive
|
|
38
|
+
id: openspec-archive
|
|
39
|
+
category: OpenSpec
|
|
40
|
+
description: Archive a deployed OpenSpec change and update specs.
|
|
41
|
+
---`
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* QwenSlashCommandConfigurator class provides integration with Qwen Code
|
|
45
|
+
* by creating the necessary slash command files in the .qwen/commands directory.
|
|
46
|
+
*
|
|
47
|
+
* The slash commands include:
|
|
48
|
+
* - /openspec-proposal: Create an OpenSpec change proposal
|
|
49
|
+
* - /openspec-apply: Apply an approved OpenSpec change
|
|
50
|
+
* - /openspec-archive: Archive a deployed OpenSpec change
|
|
51
|
+
*/
|
|
52
|
+
export class QwenSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
53
|
+
/** Unique identifier for the Qwen tool */
|
|
54
|
+
toolId = 'qwen';
|
|
55
|
+
/** Availability status for the Qwen tool */
|
|
56
|
+
isAvailable = true;
|
|
57
|
+
/**
|
|
58
|
+
* Returns the relative file path for a given slash command ID.
|
|
59
|
+
* @param {SlashCommandId} id - The slash command identifier
|
|
60
|
+
* @returns {string} The relative path to the command file
|
|
61
|
+
*/
|
|
62
|
+
getRelativePath(id) {
|
|
63
|
+
return FILE_PATHS[id];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Returns the YAML frontmatter for a given slash command ID.
|
|
67
|
+
* @param {SlashCommandId} id - The slash command identifier
|
|
68
|
+
* @returns {string} The YAML frontmatter string
|
|
69
|
+
*/
|
|
70
|
+
getFrontmatter(id) {
|
|
71
|
+
return FRONTMATTER[id];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=qwen.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ClaudeSlashCommandConfigurator } from './claude.js';
|
|
2
2
|
import { CodeBuddySlashCommandConfigurator } from './codebuddy.js';
|
|
3
|
+
import { QoderSlashCommandConfigurator } from './qoder.js';
|
|
3
4
|
import { CursorSlashCommandConfigurator } from './cursor.js';
|
|
4
5
|
import { WindsurfSlashCommandConfigurator } from './windsurf.js';
|
|
5
6
|
import { KiloCodeSlashCommandConfigurator } from './kilocode.js';
|
|
@@ -8,14 +9,19 @@ import { CodexSlashCommandConfigurator } from './codex.js';
|
|
|
8
9
|
import { GitHubCopilotSlashCommandConfigurator } from './github-copilot.js';
|
|
9
10
|
import { AmazonQSlashCommandConfigurator } from './amazon-q.js';
|
|
10
11
|
import { FactorySlashCommandConfigurator } from './factory.js';
|
|
12
|
+
import { GeminiSlashCommandConfigurator } from './gemini.js';
|
|
11
13
|
import { AuggieSlashCommandConfigurator } from './auggie.js';
|
|
12
14
|
import { ClineSlashCommandConfigurator } from './cline.js';
|
|
13
15
|
import { CrushSlashCommandConfigurator } from './crush.js';
|
|
16
|
+
import { CostrictSlashCommandConfigurator } from './costrict.js';
|
|
17
|
+
import { QwenSlashCommandConfigurator } from './qwen.js';
|
|
18
|
+
import { RooCodeSlashCommandConfigurator } from './roocode.js';
|
|
14
19
|
export class SlashCommandRegistry {
|
|
15
20
|
static configurators = new Map();
|
|
16
21
|
static {
|
|
17
22
|
const claude = new ClaudeSlashCommandConfigurator();
|
|
18
23
|
const codeBuddy = new CodeBuddySlashCommandConfigurator();
|
|
24
|
+
const qoder = new QoderSlashCommandConfigurator();
|
|
19
25
|
const cursor = new CursorSlashCommandConfigurator();
|
|
20
26
|
const windsurf = new WindsurfSlashCommandConfigurator();
|
|
21
27
|
const kilocode = new KiloCodeSlashCommandConfigurator();
|
|
@@ -24,11 +30,16 @@ export class SlashCommandRegistry {
|
|
|
24
30
|
const githubCopilot = new GitHubCopilotSlashCommandConfigurator();
|
|
25
31
|
const amazonQ = new AmazonQSlashCommandConfigurator();
|
|
26
32
|
const factory = new FactorySlashCommandConfigurator();
|
|
33
|
+
const gemini = new GeminiSlashCommandConfigurator();
|
|
27
34
|
const auggie = new AuggieSlashCommandConfigurator();
|
|
28
35
|
const cline = new ClineSlashCommandConfigurator();
|
|
29
36
|
const crush = new CrushSlashCommandConfigurator();
|
|
37
|
+
const costrict = new CostrictSlashCommandConfigurator();
|
|
38
|
+
const qwen = new QwenSlashCommandConfigurator();
|
|
39
|
+
const roocode = new RooCodeSlashCommandConfigurator();
|
|
30
40
|
this.configurators.set(claude.toolId, claude);
|
|
31
41
|
this.configurators.set(codeBuddy.toolId, codeBuddy);
|
|
42
|
+
this.configurators.set(qoder.toolId, qoder);
|
|
32
43
|
this.configurators.set(cursor.toolId, cursor);
|
|
33
44
|
this.configurators.set(windsurf.toolId, windsurf);
|
|
34
45
|
this.configurators.set(kilocode.toolId, kilocode);
|
|
@@ -37,9 +48,13 @@ export class SlashCommandRegistry {
|
|
|
37
48
|
this.configurators.set(githubCopilot.toolId, githubCopilot);
|
|
38
49
|
this.configurators.set(amazonQ.toolId, amazonQ);
|
|
39
50
|
this.configurators.set(factory.toolId, factory);
|
|
51
|
+
this.configurators.set(gemini.toolId, gemini);
|
|
40
52
|
this.configurators.set(auggie.toolId, auggie);
|
|
41
53
|
this.configurators.set(cline.toolId, cline);
|
|
42
54
|
this.configurators.set(crush.toolId, crush);
|
|
55
|
+
this.configurators.set(costrict.toolId, costrict);
|
|
56
|
+
this.configurators.set(qwen.toolId, qwen);
|
|
57
|
+
this.configurators.set(roocode.toolId, roocode);
|
|
43
58
|
}
|
|
44
59
|
static register(configurator) {
|
|
45
60
|
this.configurators.set(configurator.toolId, configurator);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
import { SlashCommandId } from '../../templates/index.js';
|
|
3
|
+
export declare class RooCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
4
|
+
readonly toolId = "roocode";
|
|
5
|
+
readonly isAvailable = true;
|
|
6
|
+
protected getRelativePath(id: SlashCommandId): string;
|
|
7
|
+
protected getFrontmatter(id: SlashCommandId): string | undefined;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=roocode.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SlashCommandConfigurator } from './base.js';
|
|
2
|
+
const NEW_FILE_PATHS = {
|
|
3
|
+
proposal: '.roo/commands/openspec-proposal.md',
|
|
4
|
+
apply: '.roo/commands/openspec-apply.md',
|
|
5
|
+
archive: '.roo/commands/openspec-archive.md'
|
|
6
|
+
};
|
|
7
|
+
export class RooCodeSlashCommandConfigurator extends SlashCommandConfigurator {
|
|
8
|
+
toolId = 'roocode';
|
|
9
|
+
isAvailable = true;
|
|
10
|
+
getRelativePath(id) {
|
|
11
|
+
return NEW_FILE_PATHS[id];
|
|
12
|
+
}
|
|
13
|
+
getFrontmatter(id) {
|
|
14
|
+
const descriptions = {
|
|
15
|
+
proposal: 'Scaffold a new OpenSpec change and validate strictly.',
|
|
16
|
+
apply: 'Implement an approved OpenSpec change and keep tasks in sync.',
|
|
17
|
+
archive: 'Archive a deployed OpenSpec change and update specs.'
|
|
18
|
+
};
|
|
19
|
+
const description = descriptions[id];
|
|
20
|
+
return `# OpenSpec: ${id.charAt(0).toUpperCase() + id.slice(1)}\n\n${description}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=roocode.js.map
|
package/dist/core/init.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export declare class InitCommand {
|
|
|
39
39
|
private isToolConfigured;
|
|
40
40
|
private createDirectoryStructure;
|
|
41
41
|
private generateFiles;
|
|
42
|
+
private ensureTemplateFiles;
|
|
43
|
+
private writeTemplateFiles;
|
|
42
44
|
private configureAITools;
|
|
43
45
|
private configureRootAgentsStub;
|
|
44
46
|
private displaySuccessMessage;
|
package/dist/core/init.js
CHANGED
|
@@ -6,7 +6,7 @@ import { FileSystemUtils } from '../utils/file-system.js';
|
|
|
6
6
|
import { TemplateManager } from './templates/index.js';
|
|
7
7
|
import { ToolRegistry } from './configurators/registry.js';
|
|
8
8
|
import { SlashCommandRegistry } from './configurators/slash/registry.js';
|
|
9
|
-
import { AI_TOOLS, OPENSPEC_DIR_NAME, } from './config.js';
|
|
9
|
+
import { AI_TOOLS, OPENSPEC_DIR_NAME, OPENSPEC_MARKERS, } from './config.js';
|
|
10
10
|
import { PALETTE } from './styles/palette.js';
|
|
11
11
|
const PROGRESS_SPINNER = {
|
|
12
12
|
interval: 80,
|
|
@@ -254,7 +254,7 @@ export class InitCommand {
|
|
|
254
254
|
const openspecPath = path.join(projectPath, openspecDir);
|
|
255
255
|
// Validation happens silently in the background
|
|
256
256
|
const extendMode = await this.validate(projectPath, openspecPath);
|
|
257
|
-
const existingToolStates = await this.getExistingToolStates(projectPath);
|
|
257
|
+
const existingToolStates = await this.getExistingToolStates(projectPath, extendMode);
|
|
258
258
|
this.renderBanner(extendMode);
|
|
259
259
|
// Get configuration (after validation to avoid prompts if validation fails)
|
|
260
260
|
const config = await this.getConfiguration(existingToolStates, extendMode);
|
|
@@ -276,7 +276,9 @@ export class InitCommand {
|
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
278
|
else {
|
|
279
|
-
ora({ stream: process.stdout }).info(PALETTE.midGray('ℹ OpenSpec already initialized.
|
|
279
|
+
ora({ stream: process.stdout }).info(PALETTE.midGray('ℹ OpenSpec already initialized. Checking for missing files...'));
|
|
280
|
+
await this.createDirectoryStructure(openspecPath);
|
|
281
|
+
await this.ensureTemplateFiles(openspecPath, config);
|
|
280
282
|
}
|
|
281
283
|
// Step 2: Configure AI tools
|
|
282
284
|
const toolSpinner = this.startSpinner('Configuring AI tools...');
|
|
@@ -413,25 +415,64 @@ export class InitCommand {
|
|
|
413
415
|
initialSelected,
|
|
414
416
|
});
|
|
415
417
|
}
|
|
416
|
-
async getExistingToolStates(projectPath) {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
418
|
+
async getExistingToolStates(projectPath, extendMode) {
|
|
419
|
+
// Fresh initialization - no tools configured yet
|
|
420
|
+
if (!extendMode) {
|
|
421
|
+
return Object.fromEntries(AI_TOOLS.map(t => [t.value, false]));
|
|
420
422
|
}
|
|
421
|
-
|
|
423
|
+
// Extend mode - check all tools in parallel for better performance
|
|
424
|
+
const entries = await Promise.all(AI_TOOLS.map(async (t) => [t.value, await this.isToolConfigured(projectPath, t.value)]));
|
|
425
|
+
return Object.fromEntries(entries);
|
|
422
426
|
}
|
|
423
427
|
async isToolConfigured(projectPath, toolId) {
|
|
428
|
+
// A tool is only considered "configured by OpenSpec" if its files contain OpenSpec markers.
|
|
429
|
+
// For tools with both config files and slash commands, BOTH must have markers.
|
|
430
|
+
// For slash commands, at least one file with markers is sufficient (not all required).
|
|
431
|
+
// Helper to check if a file exists and contains OpenSpec markers
|
|
432
|
+
const fileHasMarkers = async (absolutePath) => {
|
|
433
|
+
try {
|
|
434
|
+
const content = await FileSystemUtils.readFile(absolutePath);
|
|
435
|
+
return content.includes(OPENSPEC_MARKERS.start) && content.includes(OPENSPEC_MARKERS.end);
|
|
436
|
+
}
|
|
437
|
+
catch {
|
|
438
|
+
return false;
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
let hasConfigFile = false;
|
|
442
|
+
let hasSlashCommands = false;
|
|
443
|
+
// Check if the tool has a config file with OpenSpec markers
|
|
424
444
|
const configFile = ToolRegistry.get(toolId)?.configFileName;
|
|
425
|
-
if (configFile
|
|
426
|
-
|
|
427
|
-
|
|
445
|
+
if (configFile) {
|
|
446
|
+
const configPath = path.join(projectPath, configFile);
|
|
447
|
+
hasConfigFile = (await FileSystemUtils.fileExists(configPath)) && (await fileHasMarkers(configPath));
|
|
448
|
+
}
|
|
449
|
+
// Check if any slash command file exists with OpenSpec markers
|
|
428
450
|
const slashConfigurator = SlashCommandRegistry.get(toolId);
|
|
429
|
-
if (
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
451
|
+
if (slashConfigurator) {
|
|
452
|
+
for (const target of slashConfigurator.getTargets()) {
|
|
453
|
+
const absolute = slashConfigurator.resolveAbsolutePath(projectPath, target.id);
|
|
454
|
+
if ((await FileSystemUtils.fileExists(absolute)) && (await fileHasMarkers(absolute))) {
|
|
455
|
+
hasSlashCommands = true;
|
|
456
|
+
break; // At least one file with markers is sufficient
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
// Tool is only configured if BOTH exist with markers
|
|
461
|
+
// OR if the tool has no config file requirement (slash commands only)
|
|
462
|
+
// OR if the tool has no slash commands requirement (config file only)
|
|
463
|
+
const hasConfigFileRequirement = configFile !== undefined;
|
|
464
|
+
const hasSlashCommandRequirement = slashConfigurator !== undefined;
|
|
465
|
+
if (hasConfigFileRequirement && hasSlashCommandRequirement) {
|
|
466
|
+
// Both are required - both must be present with markers
|
|
467
|
+
return hasConfigFile && hasSlashCommands;
|
|
468
|
+
}
|
|
469
|
+
else if (hasConfigFileRequirement) {
|
|
470
|
+
// Only config file required
|
|
471
|
+
return hasConfigFile;
|
|
472
|
+
}
|
|
473
|
+
else if (hasSlashCommandRequirement) {
|
|
474
|
+
// Only slash commands required
|
|
475
|
+
return hasSlashCommands;
|
|
435
476
|
}
|
|
436
477
|
return false;
|
|
437
478
|
}
|
|
@@ -447,12 +488,22 @@ export class InitCommand {
|
|
|
447
488
|
}
|
|
448
489
|
}
|
|
449
490
|
async generateFiles(openspecPath, config) {
|
|
491
|
+
await this.writeTemplateFiles(openspecPath, config, false);
|
|
492
|
+
}
|
|
493
|
+
async ensureTemplateFiles(openspecPath, config) {
|
|
494
|
+
await this.writeTemplateFiles(openspecPath, config, true);
|
|
495
|
+
}
|
|
496
|
+
async writeTemplateFiles(openspecPath, config, skipExisting) {
|
|
450
497
|
const context = {
|
|
451
498
|
// Could be enhanced with prompts for project details
|
|
452
499
|
};
|
|
453
500
|
const templates = TemplateManager.getTemplates(context);
|
|
454
501
|
for (const template of templates) {
|
|
455
502
|
const filePath = path.join(openspecPath, template.path);
|
|
503
|
+
// Skip if file exists and we're in skipExisting mode
|
|
504
|
+
if (skipExisting && (await FileSystemUtils.fileExists(filePath))) {
|
|
505
|
+
continue;
|
|
506
|
+
}
|
|
456
507
|
const content = typeof template.content === 'function'
|
|
457
508
|
? template.content(context)
|
|
458
509
|
: template.content;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const agentsTemplate = "# OpenSpec Instructions\n\nInstructions for AI coding assistants using OpenSpec for spec-driven development.\n\n## TL;DR Quick Checklist\n\n- Search existing work: `openspec spec list --long`, `openspec list` (use `rg` only for full-text search)\n- Decide scope: new capability vs modify existing capability\n- Pick a unique `change-id`: kebab-case, verb-led (`add-`, `update-`, `remove-`, `refactor-`)\n- Scaffold: `proposal.md`, `tasks.md`, `design.md` (only if needed), and delta specs per affected capability\n- Write deltas: use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements`; include at least one `#### Scenario:` per requirement\n- Validate: `openspec validate [change-id] --strict` and fix issues\n- Request approval: Do not start implementation until proposal is approved\n\n## Three-Stage Workflow\n\n### Stage 1: Creating Changes\nCreate proposal when you need to:\n- Add features or functionality\n- Make breaking changes (API, schema)\n- Change architecture or patterns \n- Optimize performance (changes behavior)\n- Update security patterns\n\nTriggers (examples):\n- \"Help me create a change proposal\"\n- \"Help me plan a change\"\n- \"Help me create a proposal\"\n- \"I want to create a spec proposal\"\n- \"I want to create a spec\"\n\nLoose matching guidance:\n- Contains one of: `proposal`, `change`, `spec`\n- With one of: `create`, `plan`, `make`, `start`, `help`\n\nSkip proposal for:\n- Bug fixes (restore intended behavior)\n- Typos, formatting, comments\n- Dependency updates (non-breaking)\n- Configuration changes\n- Tests for existing behavior\n\n**Workflow**\n1. Review `openspec/project.md`, `openspec list`, and `openspec list --specs` to understand current context.\n2. Choose a unique verb-led `change-id` and scaffold `proposal.md`, `tasks.md`, optional `design.md`, and spec deltas under `openspec/changes/<id>/`.\n3. Draft spec deltas using `## ADDED|MODIFIED|REMOVED Requirements` with at least one `#### Scenario:` per requirement.\n4. Run `openspec validate <id> --strict` and resolve any issues before sharing the proposal.\n\n### Stage 2: Implementing Changes\nTrack these steps as TODOs and complete them one by one.\n1. **Read proposal.md** - Understand what's being built\n2. **Read design.md** (if exists) - Review technical decisions\n3. **Read tasks.md** - Get implementation checklist\n4. **Implement tasks sequentially** - Complete in order\n5. **Confirm completion** - Ensure every item in `tasks.md` is finished before updating statuses\n6. **Update checklist** - After all work is done, set every task to `- [x]` so the list reflects reality\n7. **Approval gate** - Do not start implementation until the proposal is reviewed and approved\n\n### Stage 3: Archiving Changes\nAfter deployment, create separate PR to:\n- Move `changes/[name]/` \u2192 `changes/archive/YYYY-MM-DD-[name]/`\n- Update `specs/` if capabilities changed\n- Use `openspec archive <change-id> --skip-specs --yes` for tooling-only changes (always pass the change ID explicitly)\n- Run `openspec validate --strict` to confirm the archived change passes checks\n\n## Before Any Task\n\n**Context Checklist:**\n- [ ] Read relevant specs in `specs/[capability]/spec.md`\n- [ ] Check pending changes in `changes/` for conflicts\n- [ ] Read `openspec/project.md` for conventions\n- [ ] Run `openspec list` to see active changes\n- [ ] Run `openspec list --specs` to see existing capabilities\n\n**Before Creating Specs:**\n- Always check if capability already exists\n- Prefer modifying existing specs over creating duplicates\n- Use `openspec show [spec]` to review current state\n- If request is ambiguous, ask 1\u20132 clarifying questions before scaffolding\n\n### Search Guidance\n- Enumerate specs: `openspec spec list --long` (or `--json` for scripts)\n- Enumerate changes: `openspec list` (or `openspec change list --json` - deprecated but available)\n- Show details:\n - Spec: `openspec show <spec-id> --type spec` (use `--json` for filters)\n - Change: `openspec show <change-id> --json --deltas-only`\n- Full-text search (use ripgrep): `rg -n \"Requirement:|Scenario:\" openspec/specs`\n\n## Quick Start\n\n### CLI Commands\n\n```bash\n# Essential commands\nopenspec list # List active changes\nopenspec list --specs # List specifications\nopenspec show [item] # Display change or spec\nopenspec validate [item] # Validate changes or specs\nopenspec archive <change-id> [--yes|-y] # Archive after deployment (add --yes for non-interactive runs)\n\n# Project management\nopenspec init [path] # Initialize OpenSpec\nopenspec update [path] # Update instruction files\n\n# Interactive mode\nopenspec show # Prompts for selection\nopenspec validate # Bulk validation mode\n\n# Debugging\nopenspec show [change] --json --deltas-only\nopenspec validate [change] --strict\n```\n\n### Command Flags\n\n- `--json` - Machine-readable output\n- `--type change|spec` - Disambiguate items\n- `--strict` - Comprehensive validation\n- `--no-interactive` - Disable prompts\n- `--skip-specs` - Archive without spec updates\n- `--yes`/`-y` - Skip confirmation prompts (non-interactive archive)\n\n## Directory Structure\n\n```\nopenspec/\n\u251C\u2500\u2500 project.md # Project conventions\n\u251C\u2500\u2500 specs/ # Current truth - what IS built\n\u2502 \u2514\u2500\u2500 [capability]/ # Single focused capability\n\u2502 \u251C\u2500\u2500 spec.md # Requirements and scenarios\n\u2502 \u2514\u2500\u2500 design.md # Technical patterns\n\u251C\u2500\u2500 changes/ # Proposals - what SHOULD change\n\u2502 \u251C\u2500\u2500 [change-name]/\n\u2502 \u2502 \u251C\u2500\u2500 proposal.md # Why, what, impact\n\u2502 \u2502 \u251C\u2500\u2500 tasks.md # Implementation checklist\n\u2502 \u2502 \u251C\u2500\u2500 design.md # Technical decisions (optional; see criteria)\n\u2502 \u2502 \u2514\u2500\u2500 specs/ # Delta changes\n\u2502 \u2502 \u2514\u2500\u2500 [capability]/\n\u2502 \u2502 \u2514\u2500\u2500 spec.md # ADDED/MODIFIED/REMOVED\n\u2502 \u2514\u2500\u2500 archive/ # Completed changes\n```\n\n## Creating Change Proposals\n\n### Decision Tree\n\n```\nNew request?\n\u251C\u2500 Bug fix restoring spec behavior? \u2192 Fix directly\n\u251C\u2500 Typo/format/comment? \u2192 Fix directly \n\u251C\u2500 New feature/capability? \u2192 Create proposal\n\u251C\u2500 Breaking change? \u2192 Create proposal\n\u251C\u2500 Architecture change? \u2192 Create proposal\n\u2514\u2500 Unclear? \u2192 Create proposal (safer)\n```\n\n### Proposal Structure\n\n1. **Create directory:** `changes/[change-id]/` (kebab-case, verb-led, unique)\n\n2. **Write proposal.md:**\n```markdown\n## Why\n[1-2 sentences on problem/opportunity]\n\n## What Changes\n- [Bullet list of changes]\n- [Mark breaking changes with **BREAKING**]\n\n## Impact\n- Affected specs: [list capabilities]\n- Affected code: [key files/systems]\n```\n\n3. **Create spec deltas:** `specs/[capability]/spec.md`\n```markdown\n## ADDED Requirements\n### Requirement: New Feature\nThe system SHALL provide...\n\n#### Scenario: Success case\n- **WHEN** user performs action\n- **THEN** expected result\n\n## MODIFIED Requirements\n### Requirement: Existing Feature\n[Complete modified requirement]\n\n## REMOVED Requirements\n### Requirement: Old Feature\n**Reason**: [Why removing]\n**Migration**: [How to handle]\n```\nIf multiple capabilities are affected, create multiple delta files under `changes/[change-id]/specs/<capability>/spec.md`\u2014one per capability.\n\n4. **Create tasks.md:**\n```markdown\n## 1. Implementation\n- [ ] 1.1 Create database schema\n- [ ] 1.2 Implement API endpoint\n- [ ] 1.3 Add frontend component\n- [ ] 1.4 Write tests\n```\n\n5. **Create design.md when needed:**\nCreate `design.md` if any of the following apply; otherwise omit it:\n- Cross-cutting change (multiple services/modules) or a new architectural pattern\n- New external dependency or significant data model changes\n- Security, performance, or migration complexity\n- Ambiguity that benefits from technical decisions before coding\n\nMinimal `design.md` skeleton:\n```markdown\n## Context\n[Background, constraints, stakeholders]\n\n## Goals / Non-Goals\n- Goals: [...]\n- Non-Goals: [...]\n\n## Decisions\n- Decision: [What and why]\n- Alternatives considered: [Options + rationale]\n\n## Risks / Trade-offs\n- [Risk] \u2192 Mitigation\n\n## Migration Plan\n[Steps, rollback]\n\n## Open Questions\n- [...]\n```\n\n## Spec File Format\n\n### Critical: Scenario Formatting\n\n**CORRECT** (use #### headers):\n```markdown\n#### Scenario: User login success\n- **WHEN** valid credentials provided\n- **THEN** return JWT token\n```\n\n**WRONG** (don't use bullets or bold):\n```markdown\n- **Scenario: User login** \u274C\n**Scenario**: User login \u274C\n### Scenario: User login \u274C\n```\n\nEvery requirement MUST have at least one scenario.\n\n### Requirement Wording\n- Use SHALL/MUST for normative requirements (avoid should/may unless intentionally non-normative)\n\n### Delta Operations\n\n- `## ADDED Requirements` - New capabilities\n- `## MODIFIED Requirements` - Changed behavior\n- `## REMOVED Requirements` - Deprecated features\n- `## RENAMED Requirements` - Name changes\n\nHeaders matched with `trim(header)` - whitespace ignored.\n\n#### When to use ADDED vs MODIFIED\n- ADDED: Introduces a new capability or sub-capability that can stand alone as a requirement. Prefer ADDED when the change is orthogonal (e.g., adding \"Slash Command Configuration\") rather than altering the semantics of an existing requirement.\n- MODIFIED: Changes the behavior, scope, or acceptance criteria of an existing requirement. Always paste the full, updated requirement content (header + all scenarios). The archiver will replace the entire requirement with what you provide here; partial deltas will drop previous details.\n- RENAMED: Use when only the name changes. If you also change behavior, use RENAMED (name) plus MODIFIED (content) referencing the new name.\n\nCommon pitfall: Using MODIFIED to add a new concern without including the previous text. This causes loss of detail at archive time. If you aren\u2019t explicitly changing the existing requirement, add a new requirement under ADDED instead.\n\nAuthoring a MODIFIED requirement correctly:\n1) Locate the existing requirement in `openspec/specs/<capability>/spec.md`.\n2) Copy the entire requirement block (from `### Requirement: ...` through its scenarios).\n3) Paste it under `## MODIFIED Requirements` and edit to reflect the new behavior.\n4) Ensure the header text matches exactly (whitespace-insensitive) and keep at least one `#### Scenario:`.\n\nExample for RENAMED:\n```markdown\n## RENAMED Requirements\n- FROM: `### Requirement: Login`\n- TO: `### Requirement: User Authentication`\n```\n\n## Troubleshooting\n\n### Common Errors\n\n**\"Change must have at least one delta\"**\n- Check `changes/[name]/specs/` exists with .md files\n- Verify files have operation prefixes (## ADDED Requirements)\n\n**\"Requirement must have at least one scenario\"**\n- Check scenarios use `#### Scenario:` format (4 hashtags)\n- Don't use bullet points or bold for scenario headers\n\n**Silent scenario parsing failures**\n- Exact format required: `#### Scenario: Name`\n- Debug with: `openspec show [change] --json --deltas-only`\n\n### Validation Tips\n\n```bash\n# Always use strict mode for comprehensive checks\nopenspec validate [change] --strict\n\n# Debug delta parsing\nopenspec show [change] --json | jq '.deltas'\n\n# Check specific requirement\nopenspec show [spec] --json -r 1\n```\n\n## Happy Path Script\n\n```bash\n# 1) Explore current state\nopenspec spec list --long\nopenspec list\n# Optional full-text search:\n# rg -n \"Requirement:|Scenario:\" openspec/specs\n# rg -n \"^#|Requirement:\" openspec/changes\n\n# 2) Choose change id and scaffold\nCHANGE=add-two-factor-auth\nmkdir -p openspec/changes/$CHANGE/{specs/auth}\nprintf \"## Why\\n...\\n\\n## What Changes\\n- ...\\n\\n## Impact\\n- ...\\n\" > openspec/changes/$CHANGE/proposal.md\nprintf \"## 1. Implementation\\n- [ ] 1.1 ...\\n\" > openspec/changes/$CHANGE/tasks.md\n\n# 3) Add deltas (example)\ncat > openspec/changes/$CHANGE/specs/auth/spec.md << 'EOF'\n## ADDED Requirements\n### Requirement: Two-Factor Authentication\nUsers MUST provide a second factor during login.\n\n#### Scenario: OTP required\n- **WHEN** valid credentials are provided\n- **THEN** an OTP challenge is required\nEOF\n\n# 4) Validate\nopenspec validate $CHANGE --strict\n```\n\n## Multi-Capability Example\n\n```\nopenspec/changes/add-2fa-notify/\n\u251C\u2500\u2500 proposal.md\n\u251C\u2500\u2500 tasks.md\n\u2514\u2500\u2500 specs/\n \u251C\u2500\u2500 auth/\n \u2502 \u2514\u2500\u2500 spec.md # ADDED: Two-Factor Authentication\n \u2514\u2500\u2500 notifications/\n \u2514\u2500\u2500 spec.md # ADDED: OTP email notification\n```\n\nauth/spec.md\n```markdown\n## ADDED Requirements\n### Requirement: Two-Factor Authentication\n...\n```\n\nnotifications/spec.md\n```markdown\n## ADDED Requirements\n### Requirement: OTP Email Notification\n...\n```\n\n## Best Practices\n\n### Simplicity First\n- Default to <100 lines of new code\n- Single-file implementations until proven insufficient\n- Avoid frameworks without clear justification\n- Choose boring, proven patterns\n\n### Complexity Triggers\nOnly add complexity with:\n- Performance data showing current solution too slow\n- Concrete scale requirements (>1000 users, >100MB data)\n- Multiple proven use cases requiring abstraction\n\n### Clear References\n- Use `file.ts:42` format for code locations\n- Reference specs as `specs/auth/spec.md`\n- Link related changes and PRs\n\n### Capability Naming\n- Use verb-noun: `user-auth`, `payment-capture`\n- Single purpose per capability\n- 10-minute understandability rule\n- Split if description needs \"AND\"\n\n### Change ID Naming\n- Use kebab-case, short and descriptive: `add-two-factor-auth`\n- Prefer verb-led prefixes: `add-`, `update-`, `remove-`, `refactor-`\n- Ensure uniqueness; if taken, append `-2`, `-3`, etc.\n\n## Tool Selection Guide\n\n| Task | Tool | Why |\n|------|------|-----|\n| Find files by pattern | Glob | Fast pattern matching |\n| Search code content | Grep | Optimized regex search |\n| Read specific files | Read | Direct file access |\n| Explore unknown scope | Task | Multi-step investigation |\n\n## Error Recovery\n\n### Change Conflicts\n1. Run `openspec list` to see active changes\n2. Check for overlapping specs\n3. Coordinate with change owners\n4. Consider combining proposals\n\n### Validation Failures\n1. Run with `--strict` flag\n2. Check JSON output for details\n3. Verify spec file format\n4. Ensure scenarios properly formatted\n\n### Missing Context\n1. Read project.md first\n2. Check related specs\n3. Review recent archives\n4. Ask for clarification\n\n## Quick Reference\n\n### Stage Indicators\n- `changes/` - Proposed, not yet built\n- `specs/` - Built and deployed\n- `archive/` - Completed changes\n\n### File Purposes\n- `proposal.md` - Why and what\n- `tasks.md` - Implementation steps\n- `design.md` - Technical decisions\n- `spec.md` - Requirements and behavior\n\n### CLI Essentials\n```bash\nopenspec list # What's in progress?\nopenspec show [item] # View details\nopenspec validate --strict # Is it correct?\nopenspec archive <change-id> [--yes|-y] # Mark complete (add --yes for automation)\n```\n\nRemember: Specs are truth. Changes are proposals. Keep them in sync.\n";
|
|
1
|
+
export declare const agentsTemplate = "# OpenSpec Instructions\n\nInstructions for AI coding assistants using OpenSpec for spec-driven development.\n\n## TL;DR Quick Checklist\n\n- Search existing work: `openspec spec list --long`, `openspec list` (use `rg` only for full-text search)\n- Decide scope: new capability vs modify existing capability\n- Pick a unique `change-id`: kebab-case, verb-led (`add-`, `update-`, `remove-`, `refactor-`)\n- Scaffold: `proposal.md`, `tasks.md`, `design.md` (only if needed), and delta specs per affected capability\n- Write deltas: use `## ADDED|MODIFIED|REMOVED|RENAMED Requirements`; include at least one `#### Scenario:` per requirement\n- Validate: `openspec validate [change-id] --strict` and fix issues\n- Request approval: Do not start implementation until proposal is approved\n\n## Three-Stage Workflow\n\n### Stage 1: Creating Changes\nCreate proposal when you need to:\n- Add features or functionality\n- Make breaking changes (API, schema)\n- Change architecture or patterns \n- Optimize performance (changes behavior)\n- Update security patterns\n\nTriggers (examples):\n- \"Help me create a change proposal\"\n- \"Help me plan a change\"\n- \"Help me create a proposal\"\n- \"I want to create a spec proposal\"\n- \"I want to create a spec\"\n\nLoose matching guidance:\n- Contains one of: `proposal`, `change`, `spec`\n- With one of: `create`, `plan`, `make`, `start`, `help`\n\nSkip proposal for:\n- Bug fixes (restore intended behavior)\n- Typos, formatting, comments\n- Dependency updates (non-breaking)\n- Configuration changes\n- Tests for existing behavior\n\n**Workflow**\n1. Review `openspec/project.md`, `openspec list`, and `openspec list --specs` to understand current context.\n2. Choose a unique verb-led `change-id` and scaffold `proposal.md`, `tasks.md`, optional `design.md`, and spec deltas under `openspec/changes/<id>/`.\n3. Draft spec deltas using `## ADDED|MODIFIED|REMOVED Requirements` with at least one `#### Scenario:` per requirement.\n4. Run `openspec validate <id> --strict` and resolve any issues before sharing the proposal.\n\n### Stage 2: Implementing Changes\nTrack these steps as TODOs and complete them one by one.\n1. **Read proposal.md** - Understand what's being built\n2. **Read design.md** (if exists) - Review technical decisions\n3. **Read tasks.md** - Get implementation checklist\n4. **Implement tasks sequentially** - Complete in order\n5. **Confirm completion** - Ensure every item in `tasks.md` is finished before updating statuses\n6. **Update checklist** - After all work is done, set every task to `- [x]` so the list reflects reality\n7. **Approval gate** - Do not start implementation until the proposal is reviewed and approved\n\n### Stage 3: Archiving Changes\nAfter deployment, create separate PR to:\n- Move `changes/[name]/` \u2192 `changes/archive/YYYY-MM-DD-[name]/`\n- Update `specs/` if capabilities changed\n- Use `openspec archive <change-id> --skip-specs --yes` for tooling-only changes (always pass the change ID explicitly)\n- Run `openspec validate --strict` to confirm the archived change passes checks\n\n## Before Any Task\n\n**Context Checklist:**\n- [ ] Read relevant specs in `specs/[capability]/spec.md`\n- [ ] Check pending changes in `changes/` for conflicts\n- [ ] Read `openspec/project.md` for conventions\n- [ ] Run `openspec list` to see active changes\n- [ ] Run `openspec list --specs` to see existing capabilities\n\n**Before Creating Specs:**\n- Always check if capability already exists\n- Prefer modifying existing specs over creating duplicates\n- Use `openspec show [spec]` to review current state\n- If request is ambiguous, ask 1\u20132 clarifying questions before scaffolding\n\n### Search Guidance\n- Enumerate specs: `openspec spec list --long` (or `--json` for scripts)\n- Enumerate changes: `openspec list` (or `openspec change list --json` - deprecated but available)\n- Show details:\n - Spec: `openspec show <spec-id> --type spec` (use `--json` for filters)\n - Change: `openspec show <change-id> --json --deltas-only`\n- Full-text search (use ripgrep): `rg -n \"Requirement:|Scenario:\" openspec/specs`\n\n## Quick Start\n\n### CLI Commands\n\n```bash\n# Essential commands\nopenspec list # List active changes\nopenspec list --specs # List specifications\nopenspec show [item] # Display change or spec\nopenspec validate [item] # Validate changes or specs\nopenspec archive <change-id> [--yes|-y] # Archive after deployment (add --yes for non-interactive runs)\n\n# Project management\nopenspec init [path] # Initialize OpenSpec\nopenspec update [path] # Update instruction files\n\n# Interactive mode\nopenspec show # Prompts for selection\nopenspec validate # Bulk validation mode\n\n# Debugging\nopenspec show [change] --json --deltas-only\nopenspec validate [change] --strict\n```\n\n### Command Flags\n\n- `--json` - Machine-readable output\n- `--type change|spec` - Disambiguate items\n- `--strict` - Comprehensive validation\n- `--no-interactive` - Disable prompts\n- `--skip-specs` - Archive without spec updates\n- `--yes`/`-y` - Skip confirmation prompts (non-interactive archive)\n\n## Directory Structure\n\n```\nopenspec/\n\u251C\u2500\u2500 project.md # Project conventions\n\u251C\u2500\u2500 specs/ # Current truth - what IS built\n\u2502 \u2514\u2500\u2500 [capability]/ # Single focused capability\n\u2502 \u251C\u2500\u2500 spec.md # Requirements and scenarios\n\u2502 \u2514\u2500\u2500 design.md # Technical patterns\n\u251C\u2500\u2500 changes/ # Proposals - what SHOULD change\n\u2502 \u251C\u2500\u2500 [change-name]/\n\u2502 \u2502 \u251C\u2500\u2500 proposal.md # Why, what, impact\n\u2502 \u2502 \u251C\u2500\u2500 tasks.md # Implementation checklist\n\u2502 \u2502 \u251C\u2500\u2500 design.md # Technical decisions (optional; see criteria)\n\u2502 \u2502 \u2514\u2500\u2500 specs/ # Delta changes\n\u2502 \u2502 \u2514\u2500\u2500 [capability]/\n\u2502 \u2502 \u2514\u2500\u2500 spec.md # ADDED/MODIFIED/REMOVED\n\u2502 \u2514\u2500\u2500 archive/ # Completed changes\n```\n\n## Creating Change Proposals\n\n### Decision Tree\n\n```\nNew request?\n\u251C\u2500 Bug fix restoring spec behavior? \u2192 Fix directly\n\u251C\u2500 Typo/format/comment? \u2192 Fix directly \n\u251C\u2500 New feature/capability? \u2192 Create proposal\n\u251C\u2500 Breaking change? \u2192 Create proposal\n\u251C\u2500 Architecture change? \u2192 Create proposal\n\u2514\u2500 Unclear? \u2192 Create proposal (safer)\n```\n\n### Proposal Structure\n\n1. **Create directory:** `changes/[change-id]/` (kebab-case, verb-led, unique)\n\n2. **Write proposal.md:**\n```markdown\n# Change: [Brief description of change]\n\n## Why\n[1-2 sentences on problem/opportunity]\n\n## What Changes\n- [Bullet list of changes]\n- [Mark breaking changes with **BREAKING**]\n\n## Impact\n- Affected specs: [list capabilities]\n- Affected code: [key files/systems]\n```\n\n3. **Create spec deltas:** `specs/[capability]/spec.md`\n```markdown\n## ADDED Requirements\n### Requirement: New Feature\nThe system SHALL provide...\n\n#### Scenario: Success case\n- **WHEN** user performs action\n- **THEN** expected result\n\n## MODIFIED Requirements\n### Requirement: Existing Feature\n[Complete modified requirement]\n\n## REMOVED Requirements\n### Requirement: Old Feature\n**Reason**: [Why removing]\n**Migration**: [How to handle]\n```\nIf multiple capabilities are affected, create multiple delta files under `changes/[change-id]/specs/<capability>/spec.md`\u2014one per capability.\n\n4. **Create tasks.md:**\n```markdown\n## 1. Implementation\n- [ ] 1.1 Create database schema\n- [ ] 1.2 Implement API endpoint\n- [ ] 1.3 Add frontend component\n- [ ] 1.4 Write tests\n```\n\n5. **Create design.md when needed:**\nCreate `design.md` if any of the following apply; otherwise omit it:\n- Cross-cutting change (multiple services/modules) or a new architectural pattern\n- New external dependency or significant data model changes\n- Security, performance, or migration complexity\n- Ambiguity that benefits from technical decisions before coding\n\nMinimal `design.md` skeleton:\n```markdown\n## Context\n[Background, constraints, stakeholders]\n\n## Goals / Non-Goals\n- Goals: [...]\n- Non-Goals: [...]\n\n## Decisions\n- Decision: [What and why]\n- Alternatives considered: [Options + rationale]\n\n## Risks / Trade-offs\n- [Risk] \u2192 Mitigation\n\n## Migration Plan\n[Steps, rollback]\n\n## Open Questions\n- [...]\n```\n\n## Spec File Format\n\n### Critical: Scenario Formatting\n\n**CORRECT** (use #### headers):\n```markdown\n#### Scenario: User login success\n- **WHEN** valid credentials provided\n- **THEN** return JWT token\n```\n\n**WRONG** (don't use bullets or bold):\n```markdown\n- **Scenario: User login** \u274C\n**Scenario**: User login \u274C\n### Scenario: User login \u274C\n```\n\nEvery requirement MUST have at least one scenario.\n\n### Requirement Wording\n- Use SHALL/MUST for normative requirements (avoid should/may unless intentionally non-normative)\n\n### Delta Operations\n\n- `## ADDED Requirements` - New capabilities\n- `## MODIFIED Requirements` - Changed behavior\n- `## REMOVED Requirements` - Deprecated features\n- `## RENAMED Requirements` - Name changes\n\nHeaders matched with `trim(header)` - whitespace ignored.\n\n#### When to use ADDED vs MODIFIED\n- ADDED: Introduces a new capability or sub-capability that can stand alone as a requirement. Prefer ADDED when the change is orthogonal (e.g., adding \"Slash Command Configuration\") rather than altering the semantics of an existing requirement.\n- MODIFIED: Changes the behavior, scope, or acceptance criteria of an existing requirement. Always paste the full, updated requirement content (header + all scenarios). The archiver will replace the entire requirement with what you provide here; partial deltas will drop previous details.\n- RENAMED: Use when only the name changes. If you also change behavior, use RENAMED (name) plus MODIFIED (content) referencing the new name.\n\nCommon pitfall: Using MODIFIED to add a new concern without including the previous text. This causes loss of detail at archive time. If you aren\u2019t explicitly changing the existing requirement, add a new requirement under ADDED instead.\n\nAuthoring a MODIFIED requirement correctly:\n1) Locate the existing requirement in `openspec/specs/<capability>/spec.md`.\n2) Copy the entire requirement block (from `### Requirement: ...` through its scenarios).\n3) Paste it under `## MODIFIED Requirements` and edit to reflect the new behavior.\n4) Ensure the header text matches exactly (whitespace-insensitive) and keep at least one `#### Scenario:`.\n\nExample for RENAMED:\n```markdown\n## RENAMED Requirements\n- FROM: `### Requirement: Login`\n- TO: `### Requirement: User Authentication`\n```\n\n## Troubleshooting\n\n### Common Errors\n\n**\"Change must have at least one delta\"**\n- Check `changes/[name]/specs/` exists with .md files\n- Verify files have operation prefixes (## ADDED Requirements)\n\n**\"Requirement must have at least one scenario\"**\n- Check scenarios use `#### Scenario:` format (4 hashtags)\n- Don't use bullet points or bold for scenario headers\n\n**Silent scenario parsing failures**\n- Exact format required: `#### Scenario: Name`\n- Debug with: `openspec show [change] --json --deltas-only`\n\n### Validation Tips\n\n```bash\n# Always use strict mode for comprehensive checks\nopenspec validate [change] --strict\n\n# Debug delta parsing\nopenspec show [change] --json | jq '.deltas'\n\n# Check specific requirement\nopenspec show [spec] --json -r 1\n```\n\n## Happy Path Script\n\n```bash\n# 1) Explore current state\nopenspec spec list --long\nopenspec list\n# Optional full-text search:\n# rg -n \"Requirement:|Scenario:\" openspec/specs\n# rg -n \"^#|Requirement:\" openspec/changes\n\n# 2) Choose change id and scaffold\nCHANGE=add-two-factor-auth\nmkdir -p openspec/changes/$CHANGE/{specs/auth}\nprintf \"## Why\\n...\\n\\n## What Changes\\n- ...\\n\\n## Impact\\n- ...\\n\" > openspec/changes/$CHANGE/proposal.md\nprintf \"## 1. Implementation\\n- [ ] 1.1 ...\\n\" > openspec/changes/$CHANGE/tasks.md\n\n# 3) Add deltas (example)\ncat > openspec/changes/$CHANGE/specs/auth/spec.md << 'EOF'\n## ADDED Requirements\n### Requirement: Two-Factor Authentication\nUsers MUST provide a second factor during login.\n\n#### Scenario: OTP required\n- **WHEN** valid credentials are provided\n- **THEN** an OTP challenge is required\nEOF\n\n# 4) Validate\nopenspec validate $CHANGE --strict\n```\n\n## Multi-Capability Example\n\n```\nopenspec/changes/add-2fa-notify/\n\u251C\u2500\u2500 proposal.md\n\u251C\u2500\u2500 tasks.md\n\u2514\u2500\u2500 specs/\n \u251C\u2500\u2500 auth/\n \u2502 \u2514\u2500\u2500 spec.md # ADDED: Two-Factor Authentication\n \u2514\u2500\u2500 notifications/\n \u2514\u2500\u2500 spec.md # ADDED: OTP email notification\n```\n\nauth/spec.md\n```markdown\n## ADDED Requirements\n### Requirement: Two-Factor Authentication\n...\n```\n\nnotifications/spec.md\n```markdown\n## ADDED Requirements\n### Requirement: OTP Email Notification\n...\n```\n\n## Best Practices\n\n### Simplicity First\n- Default to <100 lines of new code\n- Single-file implementations until proven insufficient\n- Avoid frameworks without clear justification\n- Choose boring, proven patterns\n\n### Complexity Triggers\nOnly add complexity with:\n- Performance data showing current solution too slow\n- Concrete scale requirements (>1000 users, >100MB data)\n- Multiple proven use cases requiring abstraction\n\n### Clear References\n- Use `file.ts:42` format for code locations\n- Reference specs as `specs/auth/spec.md`\n- Link related changes and PRs\n\n### Capability Naming\n- Use verb-noun: `user-auth`, `payment-capture`\n- Single purpose per capability\n- 10-minute understandability rule\n- Split if description needs \"AND\"\n\n### Change ID Naming\n- Use kebab-case, short and descriptive: `add-two-factor-auth`\n- Prefer verb-led prefixes: `add-`, `update-`, `remove-`, `refactor-`\n- Ensure uniqueness; if taken, append `-2`, `-3`, etc.\n\n## Tool Selection Guide\n\n| Task | Tool | Why |\n|------|------|-----|\n| Find files by pattern | Glob | Fast pattern matching |\n| Search code content | Grep | Optimized regex search |\n| Read specific files | Read | Direct file access |\n| Explore unknown scope | Task | Multi-step investigation |\n\n## Error Recovery\n\n### Change Conflicts\n1. Run `openspec list` to see active changes\n2. Check for overlapping specs\n3. Coordinate with change owners\n4. Consider combining proposals\n\n### Validation Failures\n1. Run with `--strict` flag\n2. Check JSON output for details\n3. Verify spec file format\n4. Ensure scenarios properly formatted\n\n### Missing Context\n1. Read project.md first\n2. Check related specs\n3. Review recent archives\n4. Ask for clarification\n\n## Quick Reference\n\n### Stage Indicators\n- `changes/` - Proposed, not yet built\n- `specs/` - Built and deployed\n- `archive/` - Completed changes\n\n### File Purposes\n- `proposal.md` - Why and what\n- `tasks.md` - Implementation steps\n- `design.md` - Technical decisions\n- `spec.md` - Requirements and behavior\n\n### CLI Essentials\n```bash\nopenspec list # What's in progress?\nopenspec show [item] # View details\nopenspec validate --strict # Is it correct?\nopenspec archive <change-id> [--yes|-y] # Mark complete (add --yes for automation)\n```\n\nRemember: Specs are truth. Changes are proposals. Keep them in sync.\n";
|
|
2
2
|
//# sourceMappingURL=agents-template.d.ts.map
|
|
@@ -8,6 +8,7 @@ export declare class TemplateManager {
|
|
|
8
8
|
static getTemplates(context?: ProjectContext): Template[];
|
|
9
9
|
static getClaudeTemplate(): string;
|
|
10
10
|
static getClineTemplate(): string;
|
|
11
|
+
static getCostrictTemplate(): string;
|
|
11
12
|
static getAgentsStandardTemplate(): string;
|
|
12
13
|
static getSlashCommandBody(id: SlashCommandId): string;
|
|
13
14
|
}
|
|
@@ -2,6 +2,7 @@ import { agentsTemplate } from './agents-template.js';
|
|
|
2
2
|
import { projectTemplate } from './project-template.js';
|
|
3
3
|
import { claudeTemplate } from './claude-template.js';
|
|
4
4
|
import { clineTemplate } from './cline-template.js';
|
|
5
|
+
import { costrictTemplate } from './costrict-template.js';
|
|
5
6
|
import { agentsRootStubTemplate } from './agents-root-stub.js';
|
|
6
7
|
import { getSlashCommandBody } from './slash-command-templates.js';
|
|
7
8
|
export class TemplateManager {
|
|
@@ -23,6 +24,9 @@ export class TemplateManager {
|
|
|
23
24
|
static getClineTemplate() {
|
|
24
25
|
return clineTemplate;
|
|
25
26
|
}
|
|
27
|
+
static getCostrictTemplate() {
|
|
28
|
+
return costrictTemplate;
|
|
29
|
+
}
|
|
26
30
|
static getAgentsStandardTemplate() {
|
|
27
31
|
return agentsRootStubTemplate;
|
|
28
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fission-ai/openspec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "AI-native system for spec-driven development",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openspec",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@changesets/cli": "^2.27.7",
|
|
44
44
|
"@types/node": "^24.2.0",
|
|
45
45
|
"@vitest/ui": "^3.2.4",
|
|
46
|
-
"typescript": "^5.9.
|
|
46
|
+
"typescript": "^5.9.3",
|
|
47
47
|
"vitest": "^3.2.4"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|