feat: add Qwen install target

This commit is contained in:
Affaan Mustafa 2026-05-11 11:15:45 -04:00 committed by Affaan Mustafa
parent c7c1e36625
commit e70ef4a2ff
16 changed files with 284 additions and 21 deletions

25
.qwen/QWEN.md Normal file
View File

@ -0,0 +1,25 @@
# Qwen CLI Configuration
This directory contains ECC's Qwen CLI install template.
## Runtime Location
The source `.qwen/` directory in this repository is copied into a user's home-level `~/.qwen/` install root when running:
```bash
./install.sh --target qwen --profile minimal
```
The managed install also writes `~/.qwen/ecc-install-state.json` so future ECC updates and uninstalls can distinguish ECC-owned files from user-owned Qwen configuration.
## Installed Surface
The Qwen target installs the same managed manifest modules used by other harness adapters:
- `rules/`
- `agents/`
- `commands/`
- `skills/`
- `mcp-configs/`
Hook runtime files are intentionally not selected for Qwen until the Qwen hook/event contract is verified.

View File

@ -1084,6 +1084,7 @@ Yes. ECC is cross-platform:
- **Codex**: First-class support for both macOS app and CLI, with adapter drift guards and SessionStart fallback. See PR [#257](https://github.com/affaan-m/everything-claude-code/pull/257). - **Codex**: First-class support for both macOS app and CLI, with adapter drift guards and SessionStart fallback. See PR [#257](https://github.com/affaan-m/everything-claude-code/pull/257).
- **Antigravity**: Tightly integrated setup for workflows, skills, and flattened rules in `.agent/`. See [Antigravity Guide](docs/ANTIGRAVITY-GUIDE.md). - **Antigravity**: Tightly integrated setup for workflows, skills, and flattened rules in `.agent/`. See [Antigravity Guide](docs/ANTIGRAVITY-GUIDE.md).
- **JoyCode / CodeBuddy**: Project-local selective install adapters for commands, agents, skills, and flattened rules. See [JoyCode Adapter Guide](docs/JOYCODE-GUIDE.md). - **JoyCode / CodeBuddy**: Project-local selective install adapters for commands, agents, skills, and flattened rules. See [JoyCode Adapter Guide](docs/JOYCODE-GUIDE.md).
- **Qwen CLI**: Home-directory selective install adapter for commands, agents, skills, rules, and Qwen config. See [Qwen CLI Adapter Guide](docs/QWEN-GUIDE.md).
- **Non-native harnesses**: Manual fallback path for Grok and similar interfaces. See [Manual Adaptation Guide](docs/MANUAL-ADAPTATION-GUIDE.md). - **Non-native harnesses**: Manual fallback path for Grok and similar interfaces. See [Manual Adaptation Guide](docs/MANUAL-ADAPTATION-GUIDE.md).
- **Claude Code**: Native — this is the primary target. - **Claude Code**: Native — this is the primary target.
</details> </details>

54
docs/QWEN-GUIDE.md Normal file
View File

@ -0,0 +1,54 @@
# Qwen CLI Adapter Guide
ECC can install its managed command, agent, skill, rule, and MCP surfaces into the Qwen CLI home directory.
## Install
From the ECC repository root:
```bash
./install.sh --target qwen --profile minimal
```
Preview a larger install before copying files:
```bash
./install.sh --target qwen --profile full --dry-run
```
The Qwen adapter writes into `~/.qwen/` and records managed file ownership in `~/.qwen/ecc-install-state.json`.
## Installed Layout
The managed install can populate:
```text
~/.qwen/
QWEN.md
agents/
commands/
mcp-configs/
rules/
skills/
ecc-install-state.json
```
The installer preserves the source layout for rules, so language rule sets stay under paths such as `~/.qwen/rules/common/` and `~/.qwen/rules/typescript/`.
## Updating
Rerun the same install command after pulling ECC updates. The installer uses the install-state file to update ECC-managed files without claiming unrelated user files in `~/.qwen/`.
## Uninstalling
Use the managed uninstall path rather than deleting the whole Qwen directory:
```bash
node scripts/uninstall.js --target qwen
```
That removes files recorded in `~/.qwen/ecc-install-state.json` and leaves unrelated Qwen configuration alone.
## Scope
This target is intentionally narrower than stale PR #1352. It ports the maintainable Qwen install-target intent onto the current selective installer and avoids unverified hook-runtime claims until Qwen's hook/event contract is confirmed.

View File

@ -13,7 +13,8 @@
"cursor", "cursor",
"antigravity", "antigravity",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [], "dependencies": [],
"defaultInstall": true, "defaultInstall": true,
@ -35,7 +36,8 @@
"antigravity", "antigravity",
"codex", "codex",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [], "dependencies": [],
"defaultInstall": true, "defaultInstall": true,
@ -55,7 +57,8 @@
"antigravity", "antigravity",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [], "dependencies": [],
"defaultInstall": true, "defaultInstall": true,
@ -92,6 +95,7 @@
".cursor", ".cursor",
".gemini", ".gemini",
".opencode", ".opencode",
".qwen",
"mcp-configs", "mcp-configs",
"scripts/auto-update.js", "scripts/auto-update.js",
"scripts/setup-package-manager.js" "scripts/setup-package-manager.js"
@ -104,7 +108,8 @@
"gemini", "gemini",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [], "dependencies": [],
"defaultInstall": true, "defaultInstall": true,
@ -164,7 +169,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"rules-core", "rules-core",
@ -194,7 +200,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"platform-configs" "platform-configs"
@ -234,7 +241,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"platform-configs" "platform-configs"
@ -270,7 +278,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"workflow-quality" "workflow-quality"
@ -298,7 +307,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"platform-configs" "platform-configs"
@ -330,7 +340,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"platform-configs" "platform-configs"
@ -369,7 +380,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"platform-configs" "platform-configs"
@ -393,7 +405,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"business-content" "business-content"
@ -420,7 +433,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"platform-configs" "platform-configs"
@ -475,7 +489,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"platform-configs" "platform-configs"
@ -515,7 +530,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"platform-configs" "platform-configs"
@ -545,7 +561,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"platform-configs" "platform-configs"
@ -575,7 +592,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"platform-configs" "platform-configs"
@ -599,7 +617,8 @@
"codex", "codex",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
], ],
"dependencies": [ "dependencies": [
"platform-configs" "platform-configs"

View File

@ -48,6 +48,7 @@
".cursor/", ".cursor/",
".gemini/", ".gemini/",
".opencode/", ".opencode/",
".qwen/",
".mcp.json", ".mcp.json",
"AGENTS.md", "AGENTS.md",
"VERSION", "VERSION",

View File

@ -25,7 +25,8 @@
"gemini", "gemini",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
] ]
}, },
"profile": { "profile": {

View File

@ -54,7 +54,8 @@
"gemini", "gemini",
"opencode", "opencode",
"codebuddy", "codebuddy",
"joycode" "joycode",
"qwen"
] ]
} }
}, },

View File

@ -36,6 +36,7 @@ Targets:
opencode - Install shared commands/hooks/config into ~/.opencode/ opencode - Install shared commands/hooks/config into ~/.opencode/
codebuddy - Install commands, agents, skills, and flattened rules into ./.codebuddy/ codebuddy - Install commands, agents, skills, and flattened rules into ./.codebuddy/
joycode - Install commands, agents, skills, and flattened rules into ./.joycode/ joycode - Install commands, agents, skills, and flattened rules into ./.joycode/
qwen - Install commands, agents, skills, rules, and Qwen config into ~/.qwen/
Options: Options:
--profile <name> Resolve and install a manifest profile --profile <name> Resolve and install a manifest profile

View File

@ -4,7 +4,7 @@ const path = require('path');
const { getInstallTargetAdapter, planInstallTargetScaffold } = require('./install-targets/registry'); const { getInstallTargetAdapter, planInstallTargetScaffold } = require('./install-targets/registry');
const DEFAULT_REPO_ROOT = path.join(__dirname, '../..'); const DEFAULT_REPO_ROOT = path.join(__dirname, '../..');
const SUPPORTED_INSTALL_TARGETS = ['claude', 'cursor', 'antigravity', 'codex', 'gemini', 'opencode', 'codebuddy', 'joycode']; const SUPPORTED_INSTALL_TARGETS = ['claude', 'cursor', 'antigravity', 'codex', 'gemini', 'opencode', 'codebuddy', 'joycode', 'qwen'];
const COMPONENT_FAMILY_PREFIXES = { const COMPONENT_FAMILY_PREFIXES = {
baseline: 'baseline:', baseline: 'baseline:',
language: 'lang:', language: 'lang:',

View File

@ -10,6 +10,7 @@ const PLATFORM_SOURCE_PATH_OWNERS = Object.freeze({
'.joycode': 'joycode', '.joycode': 'joycode',
'.opencode': 'opencode', '.opencode': 'opencode',
'.codebuddy': 'codebuddy', '.codebuddy': 'codebuddy',
'.qwen': 'qwen',
}); });
function normalizeRelativePath(relativePath) { function normalizeRelativePath(relativePath) {

View File

@ -0,0 +1,10 @@
const { createInstallTargetAdapter } = require('./helpers');
module.exports = createInstallTargetAdapter({
id: 'qwen-home',
target: 'qwen',
kind: 'home',
rootSegments: ['.qwen'],
installStatePathSegments: ['ecc-install-state.json'],
nativeRootRelativePath: '.qwen',
});

View File

@ -6,6 +6,7 @@ const cursorProject = require('./cursor-project');
const geminiProject = require('./gemini-project'); const geminiProject = require('./gemini-project');
const joycodeProject = require('./joycode-project'); const joycodeProject = require('./joycode-project');
const opencodeHome = require('./opencode-home'); const opencodeHome = require('./opencode-home');
const qwenHome = require('./qwen-home');
const ADAPTERS = Object.freeze([ const ADAPTERS = Object.freeze([
claudeHome, claudeHome,
@ -16,6 +17,7 @@ const ADAPTERS = Object.freeze([
opencodeHome, opencodeHome,
codebuddyProject, codebuddyProject,
joycodeProject, joycodeProject,
qwenHome,
]); ]);
function listInstallTargetAdapters() { function listInstallTargetAdapters() {

View File

@ -246,6 +246,31 @@ function runTests() {
assert.ok(plan.operations.length > 0, 'Should include install operations'); assert.ok(plan.operations.length > 0, 'Should include install operations');
})) passed++; else failed++; })) passed++; else failed++;
if (test('resolves Qwen minimal profile while leaving hooks out', () => {
const homeDir = '/Users/example';
const plan = resolveInstallPlan({
profileId: 'minimal',
target: 'qwen',
homeDir,
});
assert.deepStrictEqual(
plan.selectedModuleIds,
['rules-core', 'agents-core', 'commands-core', 'platform-configs', 'workflow-quality']
);
assert.deepStrictEqual(plan.skippedModuleIds, []);
assert.strictEqual(plan.targetAdapterId, 'qwen-home');
assert.strictEqual(plan.targetRoot, path.join(homeDir, '.qwen'));
assert.ok(
plan.operations.some(operation => operation.sourceRelativePath === '.qwen'),
'Should install Qwen native config'
);
assert.ok(
!plan.operations.some(operation => operation.destinationPath.includes(`${path.sep}hooks`)),
'Qwen minimal profile should not install hook runtime files'
);
})) passed++; else failed++;
if (test('resolves explicit modules with dependency expansion', () => { if (test('resolves explicit modules with dependency expansion', () => {
const plan = resolveInstallPlan({ moduleIds: ['security'] }); const plan = resolveInstallPlan({ moduleIds: ['security'] });
assert.ok(plan.selectedModuleIds.includes('security'), 'Should include requested module'); assert.ok(plan.selectedModuleIds.includes('security'), 'Should include requested module');

View File

@ -44,6 +44,7 @@ function runTests() {
assert.ok(targets.includes('opencode'), 'Should include opencode target'); assert.ok(targets.includes('opencode'), 'Should include opencode target');
assert.ok(targets.includes('codebuddy'), 'Should include codebuddy target'); assert.ok(targets.includes('codebuddy'), 'Should include codebuddy target');
assert.ok(targets.includes('joycode'), 'Should include joycode target'); assert.ok(targets.includes('joycode'), 'Should include joycode target');
assert.ok(targets.includes('qwen'), 'Should include qwen target');
})) passed++; else failed++; })) passed++; else failed++;
if (test('resolves cursor adapter root and install-state path from project root', () => { if (test('resolves cursor adapter root and install-state path from project root', () => {
@ -525,6 +526,29 @@ function runTests() {
assert.ok(byTarget.supports('joycode-project')); assert.ok(byTarget.supports('joycode-project'));
})) passed++; else failed++; })) passed++; else failed++;
if (test('resolves qwen adapter root and install-state path from home dir', () => {
const adapter = getInstallTargetAdapter('qwen');
const homeDir = '/Users/example';
const root = adapter.resolveRoot({ homeDir });
const statePath = adapter.getInstallStatePath({ homeDir });
assert.strictEqual(adapter.id, 'qwen-home');
assert.strictEqual(adapter.target, 'qwen');
assert.strictEqual(adapter.kind, 'home');
assert.strictEqual(root, path.join(homeDir, '.qwen'));
assert.strictEqual(statePath, path.join(homeDir, '.qwen', 'ecc-install-state.json'));
})) passed++; else failed++;
if (test('qwen adapter supports lookup by target and adapter id', () => {
const byTarget = getInstallTargetAdapter('qwen');
const byId = getInstallTargetAdapter('qwen-home');
assert.strictEqual(byTarget.id, 'qwen-home');
assert.strictEqual(byId.id, 'qwen-home');
assert.ok(byTarget.supports('qwen'));
assert.ok(byTarget.supports('qwen-home'));
})) passed++; else failed++;
if (test('plans codebuddy rules with flat namespaced filenames', () => { if (test('plans codebuddy rules with flat namespaced filenames', () => {
const repoRoot = path.join(__dirname, '..', '..'); const repoRoot = path.join(__dirname, '..', '..');
const projectRoot = '/workspace/app'; const projectRoot = '/workspace/app';
@ -622,6 +646,69 @@ function runTests() {
); );
})) passed++; else failed++; })) passed++; else failed++;
if (test('plans qwen commands, agents, skills, and native config under home root', () => {
const repoRoot = path.join(__dirname, '..', '..');
const homeDir = '/Users/example';
const plan = planInstallTargetScaffold({
target: 'qwen',
repoRoot,
homeDir,
modules: [
{
id: 'rules-core',
paths: ['rules'],
},
{
id: 'agents-core',
paths: ['agents'],
},
{
id: 'commands-core',
paths: ['commands'],
},
{
id: 'platform-configs',
paths: ['.qwen', '.gemini', 'mcp-configs'],
},
{
id: 'workflow-quality',
paths: ['skills/tdd-workflow'],
},
],
});
assert.strictEqual(plan.adapter.id, 'qwen-home');
assert.strictEqual(plan.targetRoot, path.join(homeDir, '.qwen'));
assert.strictEqual(plan.installStatePath, path.join(homeDir, '.qwen', 'ecc-install-state.json'));
assert.ok(
plan.operations.some(operation => (
normalizedRelativePath(operation.sourceRelativePath) === 'rules'
&& operation.destinationPath === path.join(homeDir, '.qwen', 'rules')
)),
'Should preserve rules under ~/.qwen/rules'
);
assert.ok(
plan.operations.some(operation => (
normalizedRelativePath(operation.sourceRelativePath) === '.qwen'
&& operation.destinationPath === path.join(homeDir, '.qwen')
&& operation.strategy === 'sync-root-children'
)),
'Should sync Qwen native config into ~/.qwen'
);
assert.ok(
!plan.operations.some(operation => normalizedRelativePath(operation.sourceRelativePath) === '.gemini'),
'Should skip foreign platform config paths'
);
assert.ok(
plan.operations.some(operation => (
normalizedRelativePath(operation.sourceRelativePath) === 'skills/tdd-workflow'
&& operation.destinationPath === path.join(homeDir, '.qwen', 'skills', 'tdd-workflow')
)),
'Should install skills under ~/.qwen/skills'
);
})) passed++; else failed++;
if (test('exposes validate and planOperations on codebuddy adapter', () => { if (test('exposes validate and planOperations on codebuddy adapter', () => {
const codebuddyAdapter = getInstallTargetAdapter('codebuddy'); const codebuddyAdapter = getInstallTargetAdapter('codebuddy');

View File

@ -267,6 +267,40 @@ function runTests() {
} }
})) passed++; else failed++; })) passed++; else failed++;
if (test('installs Qwen profile through managed home install-state', () => {
const homeDir = createTempDir('install-apply-home-');
const projectDir = createTempDir('install-apply-project-');
try {
const result = run(['--target', 'qwen', '--profile', 'minimal'], { cwd: projectDir, homeDir });
assert.strictEqual(result.code, 0, result.stderr);
assert.ok(fs.existsSync(path.join(homeDir, '.qwen', 'QWEN.md')));
assert.ok(fs.existsSync(path.join(homeDir, '.qwen', 'rules', 'common', 'coding-style.md')));
assert.ok(fs.existsSync(path.join(homeDir, '.qwen', 'agents', 'architect.md')));
assert.ok(fs.existsSync(path.join(homeDir, '.qwen', 'commands', 'plan.md')));
assert.ok(fs.existsSync(path.join(homeDir, '.qwen', 'skills', 'tdd-workflow', 'SKILL.md')));
assert.ok(fs.existsSync(path.join(homeDir, '.qwen', 'mcp-configs', 'mcp-servers.json')));
assert.ok(!fs.existsSync(path.join(homeDir, '.qwen', 'hooks')));
const statePath = path.join(homeDir, '.qwen', 'ecc-install-state.json');
const state = readJson(statePath);
assert.strictEqual(state.target.id, 'qwen-home');
assert.deepStrictEqual(state.request.modules, []);
assert.strictEqual(state.request.profile, 'minimal');
assert.ok(state.resolution.selectedModules.includes('workflow-quality'));
assert.ok(
state.operations.some(operation => (
operation.destinationPath.endsWith(path.join('.qwen', 'skills', 'tdd-workflow', 'SKILL.md'))
)),
'Should record Qwen skill file operation'
);
} finally {
cleanup(homeDir);
cleanup(projectDir);
}
})) passed++; else failed++;
if (test('supports dry-run without mutating the target project', () => { if (test('supports dry-run without mutating the target project', () => {
const homeDir = createTempDir('install-apply-home-'); const homeDir = createTempDir('install-apply-home-');
const projectDir = createTempDir('install-apply-project-'); const projectDir = createTempDir('install-apply-project-');

View File

@ -111,6 +111,7 @@ function main() {
"scripts/catalog.js", "scripts/catalog.js",
"scripts/consult.js", "scripts/consult.js",
".gemini/GEMINI.md", ".gemini/GEMINI.md",
".qwen/QWEN.md",
".claude-plugin/plugin.json", ".claude-plugin/plugin.json",
".codex-plugin/plugin.json", ".codex-plugin/plugin.json",
"schemas/install-state.schema.json", "schemas/install-state.schema.json",