Skip to content

feat: add Polytoken installer support - #2575

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

feat: add Polytoken installer support#2575
sjennings wants to merge 6 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 .agents/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
  • cover Polytoken discovery, installation, generated skill metadata, and reinstall behavior

Testing

  • npm run test:install — 402 passed, 0 failed
  • npm run lint — passed

@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
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.
Title check ✅ Passed The title clearly summarizes the main change: adding Polytoken installer support.
Description check ✅ Passed The description is relevant to the change and covers Polytoken support, installation targets, and testing.
✨ 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 thread tools/installer/prompts.js Outdated
Comment thread tools/installer/ide/platform-codes.yaml Outdated
@sjennings
sjennings requested a review from bmadcode July 28, 2026 20:38
…-only

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment on lines +1415 to +1416
assert(polytokenInstaller?.target_dir === '.agents/skills', 'Polytoken target_dir uses the shared project-local skills path');
assert(!polytokenInstaller?.global_target_dir, 'Polytoken does not claim an undocumented global skills path');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 PR description contradicts implementation path

The PR description states skills are written to .polytoken/skills, but the implementation (and this assertion) uses .agents/skills. The description also still references "add Clack compatibility fallbacks" even though that work was deliberately dropped in the final commit. The code itself is correct, but the description may confuse future reviewers or users consulting the PR history.

Prompt To Fix With AI
This is a comment left during a code review.
Path: test/test-installation-components.js
Line: 1415-1416

Comment:
**PR description contradicts implementation path**

The PR description states skills are written to `.polytoken/skills`, but the implementation (and this assertion) uses `.agents/skills`. The description also still references "add Clack compatibility fallbacks" even though that work was deliberately dropped in the final commit. The code itself is correct, but the description may confuse future reviewers or users consulting the PR history.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds Polytoken as a supported installer platform by registering it in platform-codes.yaml with a project-local target_dir of .agents/skills, and adds test Suite 28b to verify discovery, installation, SKILL.md generation, and reinstall behavior.

  • platform-codes.yaml: Adds a minimal polytoken entry using the shared .agents/skills path (no global_target_dir, consistent with platforms like replit and ona).
  • test/test-installation-components.js: Adds Suite 28b modeled after the existing Pi suite (28), covering the full install/detect/reinstall lifecycle including frontmatter and body content assertions.

Confidence Score: 4/5

Safe to merge — the two changed files are additive, low-risk, and the installer pipeline for Polytoken is fully covered by the new test suite.

The YAML entry is minimal and consistent with comparable no-global-dir platforms. The test suite closely mirrors the existing Pi suite and passes all assertions. The only notable issue is a stale PR description that still references .polytoken/skills and dropped Clack shims — neither affects runtime behavior.

Files Needing Attention: No files require special attention; the PR description should be updated to match the implementation before merging if commit-message accuracy matters to the team.

Important Files Changed

Filename Overview
tools/installer/ide/platform-codes.yaml Adds the polytoken platform entry with target_dir set to .agents/skills and no global_target_dir — consistent with other no-global platforms (replit, ona, trae); alphabetical ordering is preserved.
test/test-installation-components.js Adds Suite 28b covering Polytoken install/detect/reinstall lifecycle; frontmatter assertions are less thorough than Suite 28 (Pi) — no name-key check and no keys-only-name-and-description guard — though the shared code path means the gap is low risk.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[platform-codes.yaml\npolytoken entry added] --> B[IdeManager.loadHandlers]
    B --> C[ConfigDrivenIdeSetup\ninstantiated for 'polytoken']
    C --> D{getAvailableIdes}
    D -->|preferred=false| E[Listed in other IDEs]
    C --> F{detectInstalledIdes}
    F --> G[Check .agents/skills\nfor bmad-owned entries]
    G -->|found| H[polytoken detected]
    G -->|not found| I[polytoken not detected]
    C --> J{setup polytoken}
    J --> K[Write skills to\n.agents/skills/]
    K --> L[SKILL.md with\nname + description frontmatter]
Loading
Prompt To Fix All With AI
### Issue 1
test/test-installation-components.js:1415-1416
**PR description contradicts implementation path**

The PR description states skills are written to `.polytoken/skills`, but the implementation (and this assertion) uses `.agents/skills`. The description also still references "add Clack compatibility fallbacks" even though that work was deliberately dropped in the final commit. The code itself is correct, but the description may confuse future reviewers or users consulting the PR history.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "refactor: drop unrelated Clack compatibi..." | Re-trigger Greptile

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