-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: Add CodeBuddy MCP integration #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add MCP (Model Context Protocol) integration for Tencent CodeBuddy. Features: - MCP server with use_skill, find_skills, get_bootstrap tools - Support for CodeBuddy Internal version - Skill priority: project > personal > superpowers - Shared core module (lib/skills-core.js) - Bootstrap injection and context compaction support Files: - .codebuddy/mcp-server/ (index.js, package.json, test.js, README.md) - .codebuddy/INSTALL.md (installation guide) - docs/README.codebuddy.md (comprehensive guide) - Updates to README.md, RELEASE-NOTES.md, .gitignore All tests passing ✓
📝 WalkthroughWalkthroughThis PR introduces CodeBuddy MCP server integration for Superpowers, featuring a Node.js MCP server with three tools (use_skill, find_skills, get_bootstrap), skill discovery with priority-based resolution, comprehensive documentation, new skill definitions for brainstorming/planning/execution, and updated README with Chinese localization and setup guidance. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client / IDE
participant Server as MCP Server
participant FS as Filesystem
participant Core as Skills Core Module
rect rgba(100, 150, 255, 0.5)
Note over Client,Core: use_skill Tool Flow
Client->>Server: use_skill("brainstorming")
Server->>Core: resolve skill by priority
Core->>FS: check project skills dir
FS-->>Core: not found
Core->>FS: check personal skills dir
FS-->>Core: not found
Core->>FS: check superpowers skills dir
FS-->>Core: return SKILL.md path
Server->>FS: read SKILL.md
FS-->>Server: file content
Server->>Core: extract frontmatter
Core-->>Server: name, description
Server-->>Client: formatted payload with header
end
rect rgba(100, 200, 100, 0.5)
Note over Client,Core: find_skills Tool Flow
Client->>Server: find_skills()
Server->>Core: discover all skills
Core->>FS: scan project skills dir
FS-->>Core: [skill1, skill2, ...]
Core->>FS: scan personal skills dir
FS-->>Core: [skill3, skill4, ...]
Core->>FS: scan superpowers skills dir
FS-->>Core: [skill5, skill6, ...]
Server->>Core: format with namespace prefixes
Core-->>Server: ranked list with descriptions
Server-->>Client: formatted skills text
end
rect rgba(255, 150, 100, 0.5)
Note over Client,Core: get_bootstrap Tool Flow
Client->>Server: get_bootstrap()
Server->>Core: resolve using-superpowers
Core->>FS: locate using-superpowers/SKILL.md
FS-->>Core: return path
Server->>FS: read SKILL.md
FS-->>Server: file content
Server->>Core: strip frontmatter
Core-->>Server: cleaned content
Server->>Core: wrap with header & mappings
Core-->>Server: bootstrap block
Server-->>Client: bootstrap payload
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~40 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 14
🤖 Fix all issues with AI agents
In @.codebuddy/INSTALL.md:
- Around line 248-269: The Support section contains bare URLs (e.g.,
https://github.com/binbinao/superpowers/issues,
https://cloud.tencent.com/document/product/1749,
https://cloud.tencent.com/developer/article/2526313) which markdownlint flags
(MD034); update the "Support" list in .codebuddy/INSTALL.md to convert each bare
URL into a proper Markdown link with descriptive link text (for example
"Issues", "CodeBuddy Docs", "CodeBuddy MCP Guide") or wrap them in angle
brackets, ensuring the visible text replaces the raw URLs under the "Support"
heading.
- Around line 54-64: The "Method A" npx example is invalid because npm/npx do
not accept GitHub subdirectory refs; replace or remove the npx snippet that uses
the string "github.com/binbinao/superpowers#main/.codebuddy/mcp-server": either
remove Method A and promote Method B as the primary install option, or update
the instructions to require publishing the package and show using its npm
package name with the "command": "npx" entry; ensure any remaining example uses
a valid npx target (a published package name or a GitHub repo root accepted by
npx) rather than the subdirectory syntax.
In @.codebuddy/mcp-server/index.js:
- Around line 62-67: getBootstrapContent currently only checks
superpowers/personal dirs so project-level overrides (e.g. ~/.codebuddy/skills)
are skipped; update getBootstrapContent to mirror the project-first resolution
logic used by use_skill: read the projectSkillsDir (or extend
getSkillDirectories to return it) and call resolveSkillPath with
projectSkillsDir first (then personal, then superpowers) so project overrides
are honored when locating 'using-superpowers'.
- Around line 19-28: The dynamic import is using string concatenation ('file://'
+ skillsCoreModule) which breaks on Windows; import pathToFileURL from 'url' and
replace the concatenation with a proper file URL using
pathToFileURL(skillsCoreModule).href (or .toString()) when calling import so the
URL is correctly escaped; update the imports to include pathToFileURL and change
the import call that references skillsCoreModule to use that file URL helper.
In @.codebuddy/mcp-server/test.js:
- Around line 11-20: Import and use pathToFileURL from 'url' and replace the
manual 'file://' + skillsCoreModule import with
pathToFileURL(skillsCoreModule).href to produce a correct file URL on all
platforms; specifically, add pathToFileURL to the existing import (alongside
fileURLToPath), then change the dynamic import target for the skillsCoreModule
variable from 'file://' + skillsCoreModule to
pathToFileURL(skillsCoreModule).href so Windows paths are converted correctly.
In @.codebuddy/settings.local.json:
- Around line 2-36: The local sandbox defaults are insecure: set
"sandbox.enabled" to true and "allowUnsandboxedCommands" to false, tighten
"filesystem.allowWrite" to remove broad entries (only keep essential safe paths)
and ensure "network.allowedDomains"/"deniedDomains" are explicit; also rename
this local file to a .example (e.g., settings.local.example.json) and add the
actual local filename to .gitignore so defaults are not shipped. Locate these
keys ("sandbox.enabled", "allowUnsandboxedCommands", "filesystem.allowWrite",
"network.allowedDomains", "network.deniedDomains") and apply the changes,
keeping the permissive entries only in the example file not the committed local
config.
In @.codebuddy/skills/brainstorming/SKILL.md:
- Around line 18-20: Replace the unhyphenated phrase "multiple choice" with the
compound adjective "multiple-choice" in the SKILL text line that currently reads
"Prefer multiple choice questions when possible, but open-ended is fine too" so
the sentence becomes "Prefer multiple-choice questions when possible, but
open-ended is fine too"; update that exact phrase in the document to maintain
correct compound-adjective hyphenation.
In @.codebuddy/skills/writing-plans/SKILL.md:
- Around line 49-88: The outer markdown fence currently uses ```markdown which
is closed prematurely by inner ```python fences (breaking rendering and
triggering MD036/MD040); update the outer fence to use quadruple backticks
(e.g., ````markdown) so the inner triple-backtick code blocks like the ```python
and other ``` blocks remain intact and render correctly—ensure you replace the
opening ```markdown and its matching closing ``` with ````markdown and ````
respectively in the SKILL.md content.
In `@docs/README.codebuddy.md`:
- Around line 36-37: The README currently uses inconsistent user directory paths
(`~/.codebuddy/superpowers` vs `~/.config/codebuddy/skills/`); update the docs
to either standardize on one user-level location (e.g., `~/.codebuddy/`) or
explicitly document the XDG-compliant layout, adding a clear "Directory
Structure" section that lists each directory and its purpose (installed
superpowers repo, user-level skills, project-level skills) and update all
examples (the mkdir and Create SKILL.md examples) to consistently use the chosen
paths so the installation and personal-skill sections match.
- Around line 16-19: The docs/README.codebuddy.md references the wrong
repository (github.com/binbinao/superpowers and ~/.codebuddy/superpowers);
update all occurrences in that file to the canonical repository name
github.com/obra/superpowers (replace strings like
"github.com/binbinao/superpowers" and local path "~/.codebuddy/superpowers") to
match other docs, or if binbinao is intentional add a short explanatory note
near those references explaining why CodeBuddy uses binbinao instead of obra so
readers aren’t confused.
In `@docs/superpowers-skills-guide.md`:
- Around line 271-275: Several fenced code blocks (for example the block
containing "没有失败测试,就不能写生产代码" and other similar multi-line fences) are missing
language identifiers causing markdownlint MD040; update each triple-backtick
fence to include an appropriate language tag (e.g., ```text for plain text
quotes, ```bash for shell snippets, or ```markdown for markdown examples) so
every fenced block has a language identifier and the lint error is resolved.
- Around line 12-25: The TOC link fragments (e.g., using-superpowers,
brainstorming, writing-plans, executing-plans, subagent-driven-development,
etc.) do not match the generated Markdown heading IDs and trigger markdownlint
MD051; update the fragments so they exactly match the serialized heading IDs or
add explicit heading IDs to the corresponding headings (for example change
headings like "Using Superpowers" to "Using Superpowers {`#using-superpowers`}" or
regenerate the TOC using your Markdown tool) and verify each anchor resolves by
testing the TOC links; ensure consistency between the list items and the target
headings (use the exact slug or explicit {`#id`} form).
In `@RELEASE-NOTES.md`:
- Around line 3-4: The release date for the v4.1.0 heading ("## v4.1.0
(2025-01-19)") is out of chronological order relative to the v4.0.3 entry
("v4.0.3 (2025-12-26)"); confirm the correct date for v4.1.0 and either update
the date on the "## v4.1.0 (2025-01-19)" heading to the intended value or move
the entire v4.1.0 section below v4.0.3 so entries are chronological; also check
and fix the same issue where it appears again around the entries referenced at
lines 74-75 (the other version heading) to ensure all release headings are
consistently ordered by date.
- Around line 7-9: Replace the bolded line "**Added CodeBuddy support (including
Internal version)**" with a proper Markdown heading (e.g., "## Added CodeBuddy
support (including Internal version)") to satisfy markdownlint MD036; update the
surrounding text if needed to keep heading level consistent with other entries
in RELEASE-NOTES.md.
♻️ Duplicate comments (1)
docs/README.codebuddy.md (1)
377-384: Directory path recommendation conflicts with installation instructions.Line 379 recommends using
~/.config/codebuddy/skills/for team-wide skills, but the installation section uses~/.codebuddy/superpowers/. This reinforces the need to clarify the directory structure conventions.See previous comment on lines 36-37,142-146 for the broader directory structure issue.
🧹 Nitpick comments (6)
.gitignore (1)
6-6: Keep lockfiles versioned (avoid global ignore).Line 6 ignores
package-lock.jsonrepo-wide, which undermines reproducible installs and supply‑chain tracking. If the intent is only to ignore the MCP server lockfile, scope it; otherwise, consider committing the lockfile instead.♻️ Suggested scoping change
-package-lock.json +.codebuddy/mcp-server/package-lock.jsondocs/README.codebuddy.md (3)
58-68: Use platform-agnostic path placeholders in configuration examples.The configuration examples use macOS-specific paths (
/Users/your-home/), which may cause confusion for Windows and Linux users.📝 Suggested improvement
Use placeholders or provide multi-platform examples:
{ "name": "superpowers", "type": "stdio", "command": "node", "args": [ - "/Users/your-home/.codebuddy/superpowers/.codebuddy/mcp-server/index.js" + "/path/to/.codebuddy/superpowers/.codebuddy/mcp-server/index.js" ], "disabled": false }Or add a note:
**Note:** Replace `/path/to/` with your actual home directory: - macOS/Linux: `/home/username/` or `~/.codebuddy/` - Windows: `C:\Users\username\.codebuddy\`Also applies to: 80-92
11-21: Add language specifiers to fenced code blocks.Several fenced code blocks lack language specifiers, which affects syntax highlighting and accessibility. While these are usage instructions rather than code, adding specifiers improves readability.
📝 Suggested improvements
-``` +```text Configure MCP server: - Name: superpowers ...-
+text
Use the find_skills tool to list all available superpowers skills-``` +```text Use find_skills tool to list available skills-
+text
Use use_skill tool with skill_name: "superpowers:brainstorming"-``` +```text Use get_bootstrap tool with compact: false-
+text
Use get_bootstrap tool with compact: trueBased on static analysis hints (markdownlint).
Also applies to: 102-104, 114-116, 122-124, 130-132, 136-138
319-322: Format bare URLs as proper markdown links.The URLs in the "Getting Help" section should be formatted as proper markdown links for better accessibility and presentation.
📝 Suggested fix
-- Report issues: https://github.com/binbinao/superpowers/issues -- Main documentation: https://github.com/binbinao/superpowers -- CodeBuddy docs: https://cloud.tencent.com/document/product/1749 -- CodeBuddy MCP guide: https://cloud.tencent.com/developer/article/2526313 +- Report issues: [GitHub Issues](https://github.com/binbinao/superpowers/issues) +- Main documentation: [Superpowers Repository](https://github.com/binbinao/superpowers) +- CodeBuddy docs: [Tencent Cloud Documentation](https://cloud.tencent.com/document/product/1749) +- CodeBuddy MCP guide: [MCP Integration Guide](https://cloud.tencent.com/developer/article/2526313)Based on static analysis hints (markdownlint).
README.md (2)
51-56: Consider adding language specifiers to fenced code blocks.Several fenced code blocks lack language specifiers. While these contain output or instructions rather than code, adding specifiers improves readability.
📝 Suggested improvements
-``` +```text # 应该能看到: # /superpowers:brainstorm - 交互式设计细化 # /superpowers:write-plan - 创建实现计划 # /superpowers:execute-plan - 批量执行计划-
+text
Fetch and follow instructions from https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/.codex/INSTALL.md-``` +```text Fetch and follow instructions from https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/.opencode/INSTALL.md</details> Based on static analysis hints (markdownlint). Also applies to: 62-64, 72-74 --- `187-188`: **Format bare URLs as markdown links.** The support section URLs should be formatted as proper markdown links. <details> <summary>📝 Suggested fix</summary> ```diff -- **问题**:https://github.com/obra/superpowers/issues -- **市场**:https://github.com/obra/superpowers-marketplace +- **问题**:[GitHub Issues](https://github.com/obra/superpowers/issues) +- **市场**:[Superpowers Marketplace](https://github.com/obra/superpowers-marketplace)Based on static analysis hints (markdownlint).
| **Method A: Using npx (Easiest)** | ||
|
|
||
| ```json | ||
| { | ||
| "name": "superpowers", | ||
| "type": "stdio", | ||
| "command": "npx", | ||
| "args": [ | ||
| "-y", | ||
| "github.com/binbinao/superpowers#main/.codebuddy/mcp-server" | ||
| ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# Read the INSTALL.md file around the mentioned lines
cd /tmp && find . -name "INSTALL.md" 2>/dev/null | head -5 || echo "Need to search in repo"Repository: obra/superpowers
Length of output: 42
🌐 Web query:
npx github subdirectory path support
💡 Result:
Short answer: No — npx follows npm's package specifiers and does not support pointing directly at a package.json inside a GitHub repo subdirectory. npx accepts git/GitHub specifiers, but npm's git-install semantics don't include a subdirectory path. [1][2]
Workarounds:
- Publish the subpackage to npm (or GitHub Packages) and npx that package. [1]
- Use tools that extract subfolders (degit, gitpkg, github-partials) and then run/install from the extracted folder (you can call these via npx). [3][4]
Sources:
- npx README (shows git/GitHub specifiers and notes it uses npm's specifiers). [1]
- npm issue requesting subdirectory installs (closed; explains lack of support). [2]
- degit / gitpkg / github-partials docs for subdirectory extraction workarounds. [3][4]
🏁 Script executed:
# Also search for any npx documentation or usage in the repo
rg "npx.*github" -A 5 -B 5Repository: obra/superpowers
Length of output: 42
🏁 Script executed:
# Find the INSTALL.md file
fd -name "INSTALL.md" -type fRepository: obra/superpowers
Length of output: 290
🏁 Script executed:
# Also check if .codebuddy directory exists
fd -path "*/.codebuddy/INSTALL.md" -type fRepository: obra/superpowers
Length of output: 228
🏁 Script executed:
# Find the INSTALL.md file with correct syntax
fd "INSTALL.md" -type fRepository: obra/superpowers
Length of output: 230
🏁 Script executed:
# Alternative: search from root
git ls-files | grep -i install.mdRepository: obra/superpowers
Length of output: 120
🏁 Script executed:
# Read the INSTALL.md file to see lines 54-64 and surrounding context
cat -n .codebuddy/INSTALL.md | sed -n '50,75p'Repository: obra/superpowers
Length of output: 695
🏁 Script executed:
# Also check what's near lines 248-269 mentioned in the scratchpad
wc -l .codebuddy/INSTALL.mdRepository: obra/superpowers
Length of output: 85
The npx command on line 63 will fail—npm/npx do not support GitHub subdirectory paths.
The syntax github.com/binbinao/superpowers#main/.codebuddy/mcp-server is invalid. npx/npm do not support subdirectory specifications in GitHub URLs; they expect a package.json at the repository root. Either publish the package to npm and reference it by name, or remove Method A and make Method B (local installation) the primary approach.
🤖 Prompt for AI Agents
In @.codebuddy/INSTALL.md around lines 54 - 64, The "Method A" npx example is
invalid because npm/npx do not accept GitHub subdirectory refs; replace or
remove the npx snippet that uses the string
"github.com/binbinao/superpowers#main/.codebuddy/mcp-server": either remove
Method A and promote Method B as the primary install option, or update the
instructions to require publishing the package and show using its npm package
name with the "command": "npx" entry; ensure any remaining example uses a valid
npx target (a published package name or a GitHub repo root accepted by npx)
rather than the subdirectory syntax.
| - Read full documentation: [docs/README.codebuddy.md](../docs/README.codebuddy.md) | ||
| - Learn skill development: [skills/writing-skills/SKILL.md](../skills/writing-skills/SKILL.md) | ||
| - Browse available skills: [skills/](../skills/) | ||
| - Report issues: [https://github.com/binbinao/superpowers/issues](https://github.com/binbinao/superpowers/issues) | ||
|
|
||
| ## Uninstallation | ||
|
|
||
| ```bash | ||
| # Remove the superpowers repository | ||
| rm -rf ~/.codebuddy/superpowers | ||
|
|
||
| # Remove MCP configuration from CodeBuddy settings | ||
| # (Go to CodeBuddy MCP settings and delete superpowers server) | ||
| ``` | ||
|
|
||
| Your personal and project skills in `~/.config/codebuddy/skills/` and `.codebuddy/skills/` will remain unless you delete them. | ||
|
|
||
| ## Support | ||
|
|
||
| - **Issues**: https://github.com/binbinao/superpowers/issues | ||
| - **CodeBuddy Docs**: https://cloud.tencent.com/document/product/1749 | ||
| - **CodeBuddy MCP Guide**: https://cloud.tencent.com/developer/article/2526313 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace bare URLs with Markdown links.
Lines 248–269 include bare URLs, which markdownlint flags (MD034). Wrap them with link text or angle brackets.
📝 Example fix
-- Report issues: [https://github.com/binbinao/superpowers/issues](https://github.com/binbinao/superpowers/issues)
-- **CodeBuddy Docs**: https://cloud.tencent.com/document/product/1749
-- **CodeBuddy MCP Guide**: https://cloud.tencent.com/developer/article/2526313
+- Report issues: [GitHub Issues](https://github.com/binbinao/superpowers/issues)
+- **CodeBuddy Docs**: <https://cloud.tencent.com/document/product/1749>
+- **CodeBuddy MCP Guide**: <https://cloud.tencent.com/developer/article/2526313>🤖 Prompt for AI Agents
In @.codebuddy/INSTALL.md around lines 248 - 269, The Support section contains
bare URLs (e.g., https://github.com/binbinao/superpowers/issues,
https://cloud.tencent.com/document/product/1749,
https://cloud.tencent.com/developer/article/2526313) which markdownlint flags
(MD034); update the "Support" list in .codebuddy/INSTALL.md to convert each bare
URL into a proper Markdown link with descriptive link text (for example
"Issues", "CodeBuddy Docs", "CodeBuddy MCP Guide") or wrap them in angle
brackets, ensuring the visible text replaces the raw URLs under the "Support"
heading.
| import { fileURLToPath } from 'url'; | ||
| import os from 'os'; | ||
|
|
||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
|
|
||
| // Import shared skills core | ||
| const skillsCoreModule = path.join(__dirname, '../../lib/skills-core.js'); | ||
| const { extractFrontmatter, stripFrontmatter, findSkillsInDir, resolveSkillPath, checkForUpdates } = await import( | ||
| 'file://' + skillsCoreModule | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cat -n .codebuddy/mcp-server/index.js | head -40Repository: obra/superpowers
Length of output: 1433
🌐 Web query:
Node.js pathToFileURL function url module documentation
💡 Result:
Summary — url.pathToFileURL(path[, options])
- Purpose: convert a filesystem path to a file:// WHATWG URL (returns a URL object). [1]
- Signature: pathToFileURL(path: string, options?: { windows?: boolean | undefined }) => URL. [1][2]
- Behavior: resolves the path absolutely and percent-encodes URL control characters (so '/foo#1' → 'file:///foo%231'). [1][2]
- Options.windows: true = treat input as Windows path, false = treat as POSIX, undefined = system default. (options support added in v20.13.0 / v22.1.0). [1][2]
- Added: v10.12.0. [1][2]
Examples:
- ESM: import { pathToFileURL } from 'node:url'; pathToFileURL(__filename);
- CommonJS: const { pathToFileURL } = require('node:url'); pathToFileURL('/some/path%.c');
Sources:
[1] Node.js URL module documentation (latest): https://nodejs.org/api/url.html.
[2] Node.js v20 URL docs (history/options): https://nodejs.org/docs/latest-v20.x/api/url.html.
🏁 Script executed:
# Check if path module is imported in the file
head -20 .codebuddy/mcp-server/index.js | grep -n "import\|require"Repository: obra/superpowers
Length of output: 343
Use pathToFileURL for cross-platform file URL handling in dynamic imports.
String concatenation with 'file://' produces invalid URLs on Windows, where path.join() returns backslashes and drive letters (e.g., C:\path\to\file). The pathToFileURL() function correctly converts native paths to file:// URLs with proper escaping.
🐛 Proposed fix
-import { fileURLToPath } from 'url';
+import { fileURLToPath, pathToFileURL } from 'url';
@@
-const { extractFrontmatter, stripFrontmatter, findSkillsInDir, resolveSkillPath, checkForUpdates } = await import(
- 'file://' + skillsCoreModule
-);
+const skillsCoreModuleUrl = pathToFileURL(skillsCoreModule).href;
+const { extractFrontmatter, stripFrontmatter, findSkillsInDir, resolveSkillPath, checkForUpdates } = await import(
+ skillsCoreModuleUrl
+);🤖 Prompt for AI Agents
In @.codebuddy/mcp-server/index.js around lines 19 - 28, The dynamic import is
using string concatenation ('file://' + skillsCoreModule) which breaks on
Windows; import pathToFileURL from 'url' and replace the concatenation with a
proper file URL using pathToFileURL(skillsCoreModule).href (or .toString()) when
calling import so the URL is correctly escaped; update the imports to include
pathToFileURL and change the import call that references skillsCoreModule to use
that file URL helper.
| // Helper to generate bootstrap content | ||
| const getBootstrapContent = (compact = false) => { | ||
| const { superpowersSkillsDir, personalSkillsDir } = getSkillDirectories(); | ||
| const usingSuperpowersPath = resolveSkillPath('using-superpowers', superpowersSkillsDir, personalSkillsDir); | ||
|
|
||
| if (!usingSuperpowersPath) return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bootstrap skips project-level using-superpowers overrides.
get_bootstrap only resolves against personal/superpowers dirs, so project overrides in ~/.codebuddy/skills won’t apply despite the documented priority order. If project overrides should be respected, mirror the project-first logic used in use_skill or clarify the docs.
🔧 Possible adjustment
- const { superpowersSkillsDir, personalSkillsDir } = getSkillDirectories();
- const usingSuperpowersPath = resolveSkillPath('using-superpowers', superpowersSkillsDir, personalSkillsDir);
+ const { superpowersSkillsDir, personalSkillsDir, projectSkillsDir } = getSkillDirectories();
+ const projectOverride = path.join(projectSkillsDir, 'using-superpowers', 'SKILL.md');
+ const usingSuperpowersPath = fs.existsSync(projectOverride)
+ ? { skillFile: projectOverride, sourceType: 'project', skillPath: 'using-superpowers' }
+ : resolveSkillPath('using-superpowers', superpowersSkillsDir, personalSkillsDir);🤖 Prompt for AI Agents
In @.codebuddy/mcp-server/index.js around lines 62 - 67, getBootstrapContent
currently only checks superpowers/personal dirs so project-level overrides (e.g.
~/.codebuddy/skills) are skipped; update getBootstrapContent to mirror the
project-first resolution logic used by use_skill: read the projectSkillsDir (or
extend getSkillDirectories to return it) and call resolveSkillPath with
projectSkillsDir first (then personal, then superpowers) so project overrides
are honored when locating 'using-superpowers'.
| import { fileURLToPath } from 'url'; | ||
| import os from 'os'; | ||
|
|
||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
|
|
||
| // Import shared skills core | ||
| const skillsCoreModule = path.join(__dirname, '../../lib/skills-core.js'); | ||
| const { extractFrontmatter, stripFrontmatter, findSkillsInDir, resolveSkillPath } = await import( | ||
| 'file://' + skillsCoreModule | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, locate the file
find . -name "test.js" -path "*mcp-server*" 2>/dev/nullRepository: obra/superpowers
Length of output: 91
🏁 Script executed:
# List files in .codebuddy directory to understand structure
git ls-files .codebuddy/ | head -20Repository: obra/superpowers
Length of output: 405
🏁 Script executed:
# Check if the specific file exists and examine its contents
if [ -f ".codebuddy/mcp-server/test.js" ]; then
echo "=== File found, showing lines 1-25 ==="
sed -n '1,25p' .codebuddy/mcp-server/test.js
else
echo "File not found at expected location"
find . -name "test.js" -type f 2>/dev/null | grep -i mcp
fiRepository: obra/superpowers
Length of output: 812
🏁 Script executed:
# Verify the url module exports pathToFileURL and fileURLToPath
node -e "const url = require('url'); console.log('fileURLToPath:', typeof url.fileURLToPath); console.log('pathToFileURL:', typeof url.pathToFileURL);"Repository: obra/superpowers
Length of output: 107
🏁 Script executed:
# Verify pathToFileURL behavior with a test
node -e "
const { pathToFileURL } = require('url');
const path = require('path');
// Simulate Windows-style path
const windowsPath = 'C:\\Users\\test\\lib\\skills-core.js';
const unixPath = '/home/test/lib/skills-core.js';
console.log('Windows path input:', windowsPath);
console.log('With string concat:', 'file://' + windowsPath);
console.log('With pathToFileURL:', pathToFileURL(windowsPath).href);
console.log('');
console.log('Unix path input:', unixPath);
console.log('With string concat:', 'file://' + unixPath);
console.log('With pathToFileURL:', pathToFileURL(unixPath).href);
"Repository: obra/superpowers
Length of output: 403
🏁 Script executed:
# Check if there are any other uses of dynamic imports in the codebase that might have similar issues
rg "await import\(" --type js -A 2 -B 2Repository: obra/superpowers
Length of output: 42
🏁 Script executed:
# Verify the skills-core.js file actually exists at the expected location
if [ -f "lib/skills-core.js" ]; then
echo "File exists: lib/skills-core.js"
head -5 lib/skills-core.js
else
echo "File not found at lib/skills-core.js"
find . -name "skills-core.js" -type f 2>/dev/null
fiRepository: obra/superpowers
Length of output: 184
Use pathToFileURL for ESM dynamic import to ensure Windows compatibility.
The current code concatenates 'file://' directly with a native path, which produces malformed file URLs on Windows (e.g., file://C:\path\to\file instead of file:///C:/path/to/file). This breaks on Windows systems. Use pathToFileURL(skillsCoreModule).href to properly convert native paths to file URLs across all platforms.
🐛 Proposed fix
-import { fileURLToPath } from 'url';
+import { fileURLToPath, pathToFileURL } from 'url';
@@
-const { extractFrontmatter, stripFrontmatter, findSkillsInDir, resolveSkillPath } = await import(
- 'file://' + skillsCoreModule
-);
+const skillsCoreModuleUrl = pathToFileURL(skillsCoreModule).href;
+const { extractFrontmatter, stripFrontmatter, findSkillsInDir, resolveSkillPath } = await import(
+ skillsCoreModuleUrl
+);🤖 Prompt for AI Agents
In @.codebuddy/mcp-server/test.js around lines 11 - 20, Import and use
pathToFileURL from 'url' and replace the manual 'file://' + skillsCoreModule
import with pathToFileURL(skillsCoreModule).href to produce a correct file URL
on all platforms; specifically, add pathToFileURL to the existing import
(alongside fileURLToPath), then change the dynamic import target for the
skillsCoreModule variable from 'file://' + skillsCoreModule to
pathToFileURL(skillsCoreModule).href so Windows paths are converted correctly.
| mkdir -p ~/.codebuddy | ||
| git clone https://github.com/binbinao/superpowers.git ~/.codebuddy/superpowers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify directory path conventions.
The documentation uses inconsistent directory paths:
- Installation location:
~/.codebuddy/superpowers(lines 36-37) - Personal skills location:
~/.config/codebuddy/skills/(lines 142-146)
This creates ambiguity about the intended directory structure. Consider:
- Should personal skills be at
~/.codebuddy/skills/for consistency? - Is
~/.config/codebuddy/the XDG-compliant location for user configuration? - Should the documentation clearly explain why different directories are used?
📝 Suggested clarification
Add a section explaining the directory structure:
## Directory Structure
Superpowers uses the following directories:
- `~/.codebuddy/superpowers/` - Installed superpowers repository
- `~/.config/codebuddy/skills/` - Personal skills (XDG-compliant location)
- `.codebuddy/skills/` - Project-specific skills in your project directoryOr standardize on ~/.codebuddy/ for all user-level files:
-Create your own skills in `~/.config/codebuddy/skills/`:
+Create your own skills in `~/.codebuddy/skills/`:
```bash
-mkdir -p ~/.config/codebuddy/skills/my-skill
+mkdir -p ~/.codebuddy/skills/my-skill-Create ~/.config/codebuddy/skills/my-skill/SKILL.md:
+Create ~/.codebuddy/skills/my-skill/SKILL.md:
</details>
Also applies to: 142-146
<details>
<summary>🤖 Prompt for AI Agents</summary>
In @docs/README.codebuddy.md around lines 36 - 37, The README currently uses
inconsistent user directory paths (~/.codebuddy/superpowers vs
~/.config/codebuddy/skills/); update the docs to either standardize on one
user-level location (e.g., ~/.codebuddy/) or explicitly document the
XDG-compliant layout, adding a clear "Directory Structure" section that lists
each directory and its purpose (installed superpowers repo, user-level skills,
project-level skills) and update all examples (the mkdir and Create SKILL.md
examples) to consistently use the chosen paths so the installation and
personal-skill sections match.
</details>
<!-- fingerprinting:phantom:triton:puma -->
<!-- This is an auto-generated comment by CodeRabbit -->
| - [using-superpowers](#1-using-superpowers-使用技能的基础) | ||
| - [brainstorming](#2-brainstorming-头脑风暴) | ||
| - [writing-plans](#3-writing-plans-编写计划) | ||
| - [executing-plans](#4-executing-plans-执行计划) | ||
| - [subagent-driven-development](#5-subagent-driven-development-子代理驱动开发) | ||
| - [test-driven-development](#6-test-driven-development-测试驱动开发) | ||
| - [systematic-debugging](#7-systematic-debugging-系统化调试) | ||
| - [verification-before-completion](#8-verification-before-completion-完成前验证) | ||
| - [requesting-code-review](#9-requesting-code-review-请求代码审查) | ||
| - [receiving-code-review](#10-receiving-code-review-接收代码审查) | ||
| - [finishing-a-development-branch](#11-finishing-a-development-branch-完成开发分支) | ||
| - [using-git-worktrees](#12-using-git-worktrees-使用-git-worktrees) | ||
| - [dispatching-parallel-agents](#13-dispatching-parallel-agents-并行调度代理) | ||
| - [writing-skills](#14-writing-skills-编写技能) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix TOC link fragments so anchors resolve.
markdownlint MD051 flags these fragments as invalid; some TOC links may not match generated heading IDs. Consider regenerating the TOC or adding explicit heading IDs and aligning the fragments.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
15-15: Link fragments should be valid
(MD051, link-fragments)
16-16: Link fragments should be valid
(MD051, link-fragments)
17-17: Link fragments should be valid
(MD051, link-fragments)
18-18: Link fragments should be valid
(MD051, link-fragments)
19-19: Link fragments should be valid
(MD051, link-fragments)
20-20: Link fragments should be valid
(MD051, link-fragments)
🤖 Prompt for AI Agents
In `@docs/superpowers-skills-guide.md` around lines 12 - 25, The TOC link
fragments (e.g., using-superpowers, brainstorming, writing-plans,
executing-plans, subagent-driven-development, etc.) do not match the generated
Markdown heading IDs and trigger markdownlint MD051; update the fragments so
they exactly match the serialized heading IDs or add explicit heading IDs to the
corresponding headings (for example change headings like "Using Superpowers" to
"Using Superpowers {`#using-superpowers`}" or regenerate the TOC using your
Markdown tool) and verify each anchor resolves by testing the TOC links; ensure
consistency between the list items and the target headings (use the exact slug
or explicit {`#id`} form).
| **铁律:** | ||
| ``` | ||
| 没有失败测试,就不能写生产代码 | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language identifiers to fenced blocks.
markdownlint MD040 reports multiple fences without a language; add text/bash/markdown as appropriate to keep lint clean and improve rendering.
🔧 Example fix (apply similarly to other fences)
-```
+```text
没有失败测试,就不能写生产代码Also applies to: 321-323, 383-386, 388-398, 458-467, 482-487, 509-516, 681-683, 689-715
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
274-274: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In `@docs/superpowers-skills-guide.md` around lines 271 - 275, Several fenced code
blocks (for example the block containing "没有失败测试,就不能写生产代码" and other similar
multi-line fences) are missing language identifiers causing markdownlint MD040;
update each triple-backtick fence to include an appropriate language tag (e.g.,
```text for plain text quotes, ```bash for shell snippets, or ```markdown for
markdown examples) so every fenced block has a language identifier and the lint
error is resolved.
| ## v4.1.0 (2025-01-19) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release date appears out of order.
v4.1.0 is dated 2025-01-19 but appears above v4.0.3 dated 2025-12-26. Please confirm the intended v4.1.0 date to keep chronological ordering consistent.
Also applies to: 74-75
🤖 Prompt for AI Agents
In `@RELEASE-NOTES.md` around lines 3 - 4, The release date for the v4.1.0 heading
("## v4.1.0 (2025-01-19)") is out of chronological order relative to the v4.0.3
entry ("v4.0.3 (2025-12-26)"); confirm the correct date for v4.1.0 and either
update the date on the "## v4.1.0 (2025-01-19)" heading to the intended value or
move the entire v4.1.0 section below v4.0.3 so entries are chronological; also
check and fix the same issue where it appears again around the entries
referenced at lines 74-75 (the other version heading) to ensure all release
headings are consistently ordered by date.
| **Added CodeBuddy support (including Internal version)** | ||
|
|
||
| Superpowers now supports Tencent CodeBuddy through MCP (Model Context Protocol) integration. This is the first Chinese AI coding assistant to fully support Superpowers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer a heading instead of bold text.
markdownlint MD036 flags bold text used as a heading; promote this to a heading level.
✍️ Suggested edit
-**Added CodeBuddy support (including Internal version)**
+#### Added CodeBuddy support (including Internal version)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| **Added CodeBuddy support (including Internal version)** | |
| Superpowers now supports Tencent CodeBuddy through MCP (Model Context Protocol) integration. This is the first Chinese AI coding assistant to fully support Superpowers. | |
| #### Added CodeBuddy support (including Internal version) | |
| Superpowers now supports Tencent CodeBuddy through MCP (Model Context Protocol) integration. This is the first Chinese AI coding assistant to fully support Superpowers. |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
7-7: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🤖 Prompt for AI Agents
In `@RELEASE-NOTES.md` around lines 7 - 9, Replace the bolded line "**Added
CodeBuddy support (including Internal version)**" with a proper Markdown heading
(e.g., "## Added CodeBuddy support (including Internal version)") to satisfy
markdownlint MD036; update the surrounding text if needed to keep heading level
consistent with other entries in RELEASE-NOTES.md.
Summary
Add MCP (Model Context Protocol) server for CodeBuddy integration, enabling Superpowers skills on CodeBuddy platform.
Motivation
CodeBuddy is a popular AI coding assistant IDE plugin. This PR enables CodeBuddy users to leverage Superpowers skills through the MCP protocol, providing a zero-intrusion integration approach.
Changes
.codebuddy/mcp-server/with MCP server implementationindex.js: Main MCP server with three tools (use_skill,find_skills,get_bootstrap)package.json: Dependencies configurationtest.js: Test script for validation.codebuddy/INSTALL.md: Installation guidedocs/README.codebuddy.md: Detailed documentationFeatures
use_skill: Load and read a specific skillfind_skills: List all available skills from project, personal, and superpowers librariesget_bootstrap: Get the Superpowers bootstrap content with tool mappings for CodeBuddyproject:,superpowers:prefixes for explicit skill selectionlib/skills-core.js: Maintains consistency with Codex/OpenCode integrationsTesting
Documentation
.codebuddy/INSTALL.mddocs/README.codebuddy.mdSummary by CodeRabbit
New Features
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.