Skip to content

Commit a008b60

Browse files
committed
feat: align Qwen Code platform with OpenCode (agents + commands dirs)
- Change qwen-code config to use agents/ and commands/ directories - Update spec-driven command template to use {{args}} syntax - Update clean functions to remove from agents/, commands/, and legacy skills/ - Update clean preview to show new Qwen Code paths - Update platform-config unit tests for new config values - Fix acceptance criteria extraction regex in ids.ts
1 parent 240c5a9 commit a008b60

6 files changed

Lines changed: 35 additions & 24 deletions

File tree

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spec-driven-steroids",
3-
"version": "0.11.2",
3+
"version": "0.11.3",
44
"description": "Inject Spec-Driven workflow into your favorite AI Agents. Rigorous. Simple. Frictionless.",
55
"type": "module",
66
"main": "dist/cli/index.js",

packages/cli/src/cli/index.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,8 @@ function buildCleanPreview(): string {
488488
` • skills/`,
489489
'',
490490
` ${chalk.bold('Qwen Code')} (${formatDir(qwenDir)}):`,
491-
` • skills/spec-driven.md, skills/inject-guidelines.md`,
491+
` • agents/spec-driven.agent.md`,
492+
` • commands/spec-driven.md, commands/inject-guidelines.md`,
492493
` • skills/${STEROIDS_SKILL_DIRS.join('/, skills/')}/`,
493494
'',
494495
` ${chalk.bold('OpenCode')} (${formatDir(opencodeDir)}):`,
@@ -638,12 +639,23 @@ async function removeGeminiCliGlobalFiles(): Promise<void> {
638639

639640
async function removeQwenCodeGlobalFiles(): Promise<void> {
640641
const qwenDir = path.join(os.homedir(), '.qwen');
642+
const agentsDir = path.join(qwenDir, 'agents');
643+
const commandsDir = path.join(qwenDir, 'commands');
641644
const skillsDir = path.join(qwenDir, 'skills');
642-
const filesToRemove = [
645+
646+
const agentsFiles = [
647+
path.join(agentsDir, 'spec-driven.agent.md')
648+
];
649+
const commandsFiles = [
650+
path.join(commandsDir, 'spec-driven.md'),
651+
path.join(commandsDir, 'inject-guidelines.md')
652+
];
653+
const skillsFiles = [
643654
path.join(skillsDir, 'spec-driven.md'),
644655
path.join(skillsDir, 'inject-guidelines.md')
645656
];
646-
for (const file of filesToRemove) {
657+
658+
for (const file of [...agentsFiles, ...commandsFiles, ...skillsFiles]) {
647659
if (await fs.pathExists(file)) {
648660
await fs.remove(file);
649661
}

packages/cli/src/cli/platform-config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ export const PLATFORM_CONFIGS: Record<string, PlatformConfig> = {
174174
description: 'Use this planner when the user wants to define, design, decompose, or implement a change through the full Spec-Driven lifecycle. It must enforce requirements -> design -> tasks -> implementation, load long-running-work-planning at the start of each planning phase when available, and stop for human approval between phases.'
175175
}
176176
},
177-
agentDirectory: 'skills',
178-
agentFilename: 'spec-driven.md',
179-
commandDirectory: 'skills',
177+
agentDirectory: 'agents',
178+
agentFilename: 'spec-driven.agent.md',
179+
commandDirectory: 'commands',
180180
specDrivenCommandFilename: 'spec-driven.md',
181181
injectGuidelinesCommandFilename: 'inject-guidelines.md'
182182
}

packages/cli/src/core/validate/shared/ids.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,14 @@ export function extractAcceptanceCriteriaRefs(content: string): string[] {
5454
continue;
5555
}
5656

57-
const criteria = line.match(/^\s*(\d+)(?:\.\d+)?(?:\.)?\s+/);
57+
const criteria = line.match(/^\s*(\d+)\.(\d+)\s+/);
5858
if (criteria) {
59-
refs.push(`REQ-${currentReq}.${criteria[1]}`);
59+
refs.push(`REQ-${criteria[1]}.${criteria[2]}`);
60+
} else {
61+
const simpleCriteria = line.match(/^\s*(\d+)\s+/);
62+
if (simpleCriteria) {
63+
refs.push(`REQ-${currentReq}.${simpleCriteria[1]}`);
64+
}
6065
}
6166
}
6267

packages/cli/templates/universal/commands/spec-driven.command.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,10 @@ agent: Spec-Driven
55

66
Start Spec-Driven planning for this request:
77

8-
$ARGUMENTS
8+
{{args}}
99

10-
Use the `spec-driven` agent for this request.
11-
12-
Command behavior:
13-
- Begin at Phase 1 (requirements).
14-
- Enforce the full lifecycle: `requirements -> design -> tasks -> implementation`.
15-
- Load `long-running-work-planning` at the start of each planning phase when it is available, using it for durable checkpoints and resumable progress.
16-
- Do not implement code yet.
17-
- Propose a slug and draft `.specs/changes/<slug>/requirements.md`.
18-
- Write `.specs/changes/<slug>/requirements.md` first, validate it, then ask for human approval before moving to design.
19-
- After Phase 1 is written, stop immediately.
20-
- Do not start Phase 2, Phase 3, or Phase 4 in the same turn.
21-
- Wait for explicit approval before continuing to the next phase.
10+
Delegate this to the "Spec-Driven" agent. Begin at Phase 1 (requirements).
11+
Enforce the full lifecycle: requirements → design → tasks → implementation.
12+
Do not implement code yet. Propose a slug, draft requirements.md, validate it, then stop for approval.
13+
After Phase 1 is written, stop immediately. Do not continue to Phase 2, 3, or 4 in the same turn.
14+
Wait for explicit approval before continuing to the next phase.

packages/cli/tests/unit/platform-config.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ describe('Unit: Platform Config', () => {
7979
const config = getPlatformConfig('qwen-code');
8080
expect(config).toBeDefined();
8181
expect(config?.format).toBe(FormatType.MARKDOWN);
82-
expect(config?.agentDirectory).toBe('skills');
83-
expect(config?.agentFilename).toBe('spec-driven.md');
82+
expect(config?.agentDirectory).toBe('agents');
83+
expect(config?.agentFilename).toBe('spec-driven.agent.md');
84+
expect(config?.commandDirectory).toBe('commands');
8485
});
8586
});
8687

0 commit comments

Comments
 (0)