Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tools/cli/installers/lib/ide/platform-codes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ platforms:
template_type: default
skill_format: true

qoder:
name: "Qoder"
preferred: false
category: ide
description: "Qoder AI coding assistant"
installer:
target_dir: .qoder/skills
template_type: default
skill_format: true
Comment on lines +210 to +213
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add legacy_targets now, not later.

Line 210 introduces a fresh installer block, but no migration cleanup paths are defined. Reinstalls can leave stale artifacts in prior locations and cause duplicate behavior.

Proposed patch
   qoder:
     name: "Qoder"
     preferred: false
     category: ide
     description: "Qoder AI coding assistant"
     installer:
+      legacy_targets:
+        - .qoder/commands
+        - .qoder/command
       target_dir: .qoder/skills
       template_type: default
       skill_format: true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/platform-codes.yaml` around lines 210 - 213, The
new installer block (installer with target_dir ".qoder/skills", template_type
"default", skill_format true) lacks a legacy_targets list to declare prior
install locations, which can leave stale artifacts on reinstall; update this
installer entry to include a legacy_targets key that enumerates all previous
target paths (e.g., old directories where skills were placed) so the installer
logic can detect and remove/migrate those artifacts during install/uninstall,
and ensure any installer handling code reads legacy_targets when performing
cleanup or migration.

Comment on lines +211 to +213
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

No overwrite guard for user-customized files.

With no explicit skip_existing, reinstall behavior may clobber manually edited Qoder skills in Line 211 target directory. New platform onboarding should default to safer behavior unless explicitly tested.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/platform-codes.yaml` around lines 211 - 213, The
YAML block that installs skills into the target_dir (.qoder/skills) lacks an
overwrite guard, so reinstallation can clobber user-edited skills; update the
installer config for that entry to include an explicit skip_existing (or
equivalent flag used by the installer) set to true so existing files in
.qoder/skills are preserved, keeping template_type: default and skill_format:
true intact and ensuring the installer honors skip_existing when copying
templates.


Comment on lines +205 to +214
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Config is being accepted without schema checks; this entry can silently regress.

tools/cli/installers/lib/ide/platform-codes.js currently parses YAML directly and caches it. A typo in this new block (template_type, category, booleans) won’t fail fast. Add schema validation before caching.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/platform-codes.yaml` around lines 205 - 214, Add
JSON schema validation to the YAML parsing pipeline in platform-codes.js so
malformed entries (typos in keys like template_type, category, or wrong boolean
types) fail fast before being cached; locate the YAML parsing function(s) (e.g.,
parsePlatformCodes / parseYaml) and the cache variable (platformCodesCache) and
validate each parsed entry against a defined schema (create a
validatePlatformCodeSchema function or use ajv) and throw/log a clear error on
validation failure instead of caching the raw object.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read-only reconnaissance for existing coverage around platform-codes and qoder.
rg -n -C2 '\bqoder\b|platform-codes\.yaml|loadPlatformCodes|installer' -g '!**/node_modules/**'

Repository: bmad-code-org/BMAD-METHOD

Length of output: 50382


🏁 Script executed:

#!/bin/bash
# Focus search on qoder platform
rg -n 'qoder' test/ tools/cli/installers/lib/ide/platform-codes.yaml

Repository: bmad-code-org/BMAD-METHOD

Length of output: 215


🏁 Script executed:

#!/bin/bash
# View the qoder entry in platform-codes.yaml
sed -n '205,214p' tools/cli/installers/lib/ide/platform-codes.yaml

# Also look at a similar platform test pattern (e.g., pi which is nearby)
grep -A 15 "test.*pi.*installer" test/test-installation-components.js | head -20

Repository: bmad-code-org/BMAD-METHOD

Length of output: 281


🏁 Script executed:

#!/bin/bash
# View the pi test pattern (lines around 1564-1572 from earlier output)
sed -n '1564,1580p' test/test-installation-components.js

Repository: bmad-code-org/BMAD-METHOD

Length of output: 843


🏁 Script executed:

#!/bin/bash
# Verify qoder is NOT tested - check test function count and structure
grep -c "describe\|test\|it(" test/test-installation-components.js | head -1

# Check if there's a pattern like "qoder" anywhere in tests
grep -i "qoder" test/test-installation-components.js || echo "No qoder test found"

# Get count of platform config tests
rg "platformCodes[0-9]+\.platforms\." test/test-installation-components.js | wc -l

Repository: bmad-code-org/BMAD-METHOD

Length of output: 94


🏁 Script executed:

#!/bin/bash
# Verify loadPlatformCodes can parse qoder correctly
# Check platform-codes.js to understand how it loads
sed -n '13,32p' tools/cli/installers/lib/ide/platform-codes.js

# Count total platforms in platform-codes.yaml
rg "^  [a-z-]+:" tools/cli/installers/lib/ide/platform-codes.yaml | wc -l

Repository: bmad-code-org/BMAD-METHOD

Length of output: 696


🏁 Script executed:

#!/bin/bash
# Verify qoder can be loaded and parsed correctly by simulating what loadPlatformCodes does
node <<'EOF'
const yaml = require('yaml');
const fs = require('fs');
const path = require('path');

const configPath = path.join(process.cwd(), 'tools/cli/installers/lib/ide/platform-codes.yaml');
const content = fs.readFileSync(configPath, 'utf8');
const config = yaml.parse(content);

const qoder = config.platforms.qoder;
if (qoder) {
  console.log('✓ qoder platform is discoverable');
  console.log('  name:', qoder.name);
  console.log('  preferred:', qoder.preferred);
  console.log('  category:', qoder.category);
  console.log('  installer.target_dir:', qoder.installer?.target_dir);
  console.log('  installer.template_type:', qoder.installer?.template_type);
  console.log('  installer.skill_format:', qoder.installer?.skill_format);
} else {
  console.log('✗ qoder platform not found');
}
EOF

Repository: bmad-code-org/BMAD-METHOD

Length of output: 903


🏁 Script executed:

#!/bin/bash
# Use Python to parse YAML and verify qoder configuration
python3 <<'EOF'
import yaml
import sys

with open('tools/cli/installers/lib/ide/platform-codes.yaml', 'r') as f:
    config = yaml.safe_load(f)

qoder = config.get('platforms', {}).get('qoder')
if qoder:
    print('✓ qoder platform is discoverable and parses correctly')
    print(f'  name: {qoder.get("name")}')
    print(f'  preferred: {qoder.get("preferred")}')
    print(f'  category: {qoder.get("category")}')
    installer = qoder.get('installer', {})
    print(f'  installer.target_dir: {installer.get("target_dir")}')
    print(f'  installer.template_type: {installer.get("template_type")}')
    print(f'  installer.skill_format: {installer.get("skill_format")}')
else:
    print('✗ qoder platform not found')
    sys.exit(1)
EOF

Repository: bmad-code-org/BMAD-METHOD

Length of output: 275


Add automated test for qoder platform configuration loading.

The qoder entry in platform-codes.yaml (lines 205-214) is fully configured and discoverable but lacks test coverage. Following the established pattern in test-installation-components.js, add a test function that asserts the platform is discoverable and resolves expected target_dir (.qoder/skills), template_type (default), and skill_format (true) values.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/platform-codes.yaml` around lines 205 - 214, Add
a unit test in test-installation-components.js that verifies the newly added
'qoder' platform entry in platform-codes.yaml is discoverable and has the
expected installer fields: target_dir equals ".qoder/skills", template_type
equals "default", and skill_format equals true; follow the existing test pattern
in test-installation-components.js (use the same loader/lookup utilities used by
other platform tests to fetch the platform by code 'qoder' and assert existence
and those three properties).

qwen:
name: "QwenCoder"
preferred: false
Expand Down
Loading