Skip to content

feat: add Polytoken installer support#2575

Open
sjennings wants to merge 4 commits into
bmad-code-org:mainfrom
sjennings:feat/polytoken-support
Open

feat: add Polytoken installer support#2575
sjennings wants to merge 4 commits into
bmad-code-org:mainfrom
sjennings:feat/polytoken-support

Conversation

@sjennings

@sjennings sjennings commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

What

Add Polytoken (https://docs.polytoken.dev), a new coding agent currently in early alpha testing, as a supported installer platform, writing native skills to .polytoken/skills.

Why

Polytoken users should be able to select the platform during BMAD installation and receive native skill-directory output.

How

  • register Polytoken and its project-local skill target in the platform catalog
  • add Clack compatibility fallbacks used by the installer prompts
  • cover Polytoken discovery, installation, generated skill metadata, and reinstall behavior

Testing

  • npm run test:install — 402 passed, 0 failed
  • targeted ESLint on all three changed files — passed
  • npm run quality — formatting passed, then repository-wide lint was blocked by unrelated local untracked .serena/*.yml files; those files are not included in this PR

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Polytoken native-skills installer metadata and end-to-end installation tests. Updates installer prompts with runtime fallbacks for unavailable autocomplete, multiselect, box, and directory APIs.

Changes

Polytoken installation

Layer / File(s) Summary
Polytoken platform registration and installation validation
tools/installer/ide/platform-codes.yaml, test/test-installation-components.js
Registers .polytoken/skills as the Polytoken target and verifies detection, SKILL.md content, reinstall behavior, and temporary-directory cleanup.

Prompt compatibility fallbacks

Layer / File(s) Summary
Runtime prompt fallbacks
tools/installer/prompts.js
Adds clack-based fallbacks for multiselect, box, autocomplete, and directory prompts when preferred APIs are unavailable.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: bmadcode

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding Polytoken installer support.
Description check ✅ Passed The description matches the changeset and explains the Polytoken support, prompt fallbacks, and tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tools/installer/prompts.js`:
- Around line 269-280: Update the fallback multiselect path around
clack.multiselect so locked values cannot be deselected, matching the primary
AutocompletePrompt behavior. Mark locked options with a clear “always installed”
hint and ensure required validation allows submission when only locked values
remain selected. Preserve the existing deduplication and locked-value
re-addition in the returned result.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7728d6ef-22d8-4660-ac70-304a386acdcd

📥 Commits

Reviewing files that changed from the base of the PR and between 49069b8 and 63be1bf.

📒 Files selected for processing (3)
  • test/test-installation-components.js
  • tools/installer/ide/platform-codes.yaml
  • tools/installer/prompts.js

Comment on lines +269 to +280
if (typeof core.AutocompletePrompt !== 'function') {
const initialValues = [...new Set([...(options.initialValues || []), ...(options.lockedValues || [])])];
const result = await clack.multiselect({
message: options.message,
options: options.options,
initialValues: initialValues.length > 0 ? initialValues : undefined,
required: options.required || false,
maxItems: options.maxItems,
});
await handleCancel(result);
return [...new Set([...result, ...(options.lockedValues || [])])];
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Locked values can be deselected in the fallback multiselect UI.

In the primary path (lines 366-376), locked values are prevented from being toggled off via a custom toggleSelected override. In this fallback, the user can freely deselect locked values in the clack.multiselect UI. While the return on line 279 re-adds them so the final result is correct, two issues arise:

  1. UX confusion: The user deselects an item marked as selected, submits, and it silently reappears in the result.
  2. Submission block: If required is true and the user deselects all items (including locked ones), clack.multiselect blocks submission — whereas the primary path always allows submitting with just locked values.

Consider adding a hint to locked options so users understand they are always installed, which partially mitigates the confusion:

💡 Suggested improvement
     const result = await clack.multiselect({
       message: options.message,
-      options: options.options,
+      options: options.options.map((opt) =>
+        lockedSet.has(opt.value)
+          ? { ...opt, hint: opt.hint ?? 'always installed' }
+          : opt
+      ),
       initialValues: initialValues.length > 0 ? initialValues : undefined,
       required: options.required || false,
       maxItems: options.maxItems,
     });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/installer/prompts.js` around lines 269 - 280, Update the fallback
multiselect path around clack.multiselect so locked values cannot be deselected,
matching the primary AutocompletePrompt behavior. Mark locked options with a
clear “always installed” hint and ensure required validation allows submission
when only locked values remain selected. Preserve the existing deduplication and
locked-value re-addition in the returned result.

Comment thread tools/installer/ide/platform-codes.yaml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants