Migrate superpowers to Pi platform with bilingual support and tests#1507
Open
weiping wants to merge 9 commits into
Open
Migrate superpowers to Pi platform with bilingual support and tests#1507weiping wants to merge 9 commits into
weiping wants to merge 9 commits into
Conversation
Migrate obra/superpowers workflow skills to the Pi coding agent platform: - Add bilingual (zh/en) trigger words for all 14 skills - Add bootstrap extension to inject skill rules on session start - Add dispatch_agent subagent via pi --no-session --print - Add Chinese prompt templates (/brainstorm, /write-plan, /execute-plan) - Add tool mapping (TodoWrite → TODO.md, Task → sequential dispatch) - Add comprehensive test suite (176 tests) - Update README and add INSTALL.md
…add brainstorm-server to test suite
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Ports the Superpowers skills library to the Pi platform with bilingual (EN/ZH) skill metadata, adds Pi extensions (bootstrap + subagent dispatch), and introduces a parallel OpenClaw plugin package with supporting docs and tests.
Changes:
- Added Pi extensions: bootstrap injection for
using-superpowersand adispatch_agenttool backed bypi --no-session --print. - Added Vitest suite validating skills/prompts structure plus utility/unit/integration tests for the new extensions.
- Updated skill frontmatter to bilingual descriptions and added Pi-specific mapping/adaptation sections; introduced an OpenClaw plugin subpackage.
Reviewed changes
Copilot reviewed 44 out of 50 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Adds TS config for Pi extensions typecheck. |
| package.json | Renames/package metadata for Pi distribution; adds scripts + dev deps. |
| .gitignore | Ignores Pi project settings directory. |
| README.md | Rewrites docs for Pi port, bilingual usage, tool mapping, and install. |
| INSTALL.md | Adds detailed Pi install/verification documentation. |
| extensions/bootstrap.ts | Implements bootstrap injection on first turn per session. |
| extensions/bootstrap-utils.ts | Adds pure helpers for frontmatter stripping and mapping injection. |
| extensions/subagent.ts | Registers dispatch_agent tool that spawns pi subprocesses. |
| extensions/subagent-utils.ts | Adds pure helpers for role prompts, pi args, and output parsing. |
| tests/bootstrap.test.ts | Unit tests for bootstrap utility functions. |
| tests/bootstrap-integration.test.ts | Integration tests for bootstrap assembly pipeline. |
| tests/subagent.test.ts | Unit tests for subagent utility functions. |
| tests/subagent-integration.test.ts | Integration tests ensuring extension wiring + package registration. |
| tests/skills-validation.test.ts | Validates skill directories, frontmatter, and bilingual requirement. |
| tests/prompts-validation.test.ts | Validates prompt template existence/frontmatter/content. |
| prompts/brainstorm.md | Adds English brainstorm prompt template. |
| prompts/write-plan.md | Adds English write-plan prompt template. |
| prompts/execute-plan.md | Adds English execute-plan prompt template. |
| skills/brainstorming/SKILL.md | Converts description to bilingual block format. |
| skills/dispatching-parallel-agents/SKILL.md | Converts description to bilingual block format. |
| skills/executing-plans/SKILL.md | Converts description to bilingual block format. |
| skills/finishing-a-development-branch/SKILL.md | Converts description to bilingual block format. |
| skills/receiving-code-review/SKILL.md | Converts description to bilingual block format. |
| skills/requesting-code-review/SKILL.md | Converts description to bilingual block format. |
| skills/subagent-driven-development/SKILL.md | Converts description + adds Pi adaptation section. |
| skills/systematic-debugging/SKILL.md | Converts description to bilingual block format. |
| skills/test-driven-development/SKILL.md | Converts description to bilingual block format. |
| skills/using-git-worktrees/SKILL.md | Converts description to bilingual block format. |
| skills/using-superpowers/SKILL.md | Converts description + adds Pi tool mapping section. |
| skills/verification-before-completion/SKILL.md | Converts description to bilingual block format. |
| skills/writing-plans/SKILL.md | Converts description to bilingual block format. |
| skills/writing-skills/SKILL.md | Converts description to bilingual block format and adds Chinese triggers. |
| docs/plans/2026-02-27-superpowers-pi-migration-plan.md | Adds migration plan documentation. |
| docs/plans/2026-02-27-openclaw-plugin-design.md | Adds OpenClaw plugin design doc. |
| openclaw-plugin/package.json | Adds OpenClaw plugin package metadata and build steps. |
| openclaw-plugin/openclaw.plugin.json | Adds OpenClaw manifest for plugin discovery. |
| openclaw-plugin/index.ts | Implements OpenClaw plugin registering tools. |
| openclaw-plugin/index.d.ts | Adds OpenClaw plugin-facing type declarations. |
| openclaw-plugin/openclaw-sdk.d.ts | Adds minimal SDK declaration for compilation without OpenClaw installed. |
| openclaw-plugin/tsconfig.json | Adds TS config + path mapping for SDK types. |
| openclaw-plugin/scripts/copy-skills.mjs | Copies skills into plugin package at publish time. |
| openclaw-plugin/README.md | Adds plugin usage documentation. |
| openclaw-plugin/CLAUDE.md | Adds repository guidance doc for Claude Code. |
| openclaw-plugin/.gitignore | Ignores build and generated artifacts in subpackage. |
| openclaw-plugin/OpenClaw Plugin SDK Reference.md | Adds large consolidated SDK reference doc. |
Comments suppressed due to low confidence (3)
tests/prompts-validation.test.ts:1
- This test requires three Chinese prompt template files (头脑风暴.md / 写计划.md / 执行计划.md), but the diff only shows the English prompt files added under prompts/. Also, the final diff hunk appears to add three prompt contents without a valid file path, which would not create the required files. Add these three prompt files under prompts/ with the shown content so CI doesn't fail.
extensions/bootstrap-utils.ts:1 - This mapping states Pi has no subagent support and recommends only sequential execution, but this PR also adds a
dispatch_agenttool (extensions/subagent.ts) as a Task-like replacement. Update the injected mapping (and/or using-superpowers SKILL.md mapping section) to mentiondispatch_agentas the preferred alternative when available, so users and the model receive consistent guidance.
/**
skills/writing-skills/SKILL.md:1
- The English description repeats "work before deployment" twice (lines 4–5). Remove the duplicate to keep the frontmatter concise (and reduce chance of hitting description-length constraints in validation).
Comment on lines
+68
to
+74
| export function buildRolePrompt(role: string | undefined): string { | ||
| if (!role) return ""; | ||
| const trimmed = role.trim(); | ||
| if (!trimmed) return ""; | ||
| if (trimmed === "code-quality-reviewer") return CODE_QUALITY_REVIEWER_PROMPT; | ||
| return `You are a ${trimmed}.`; | ||
| } |
Comment on lines
+16
to
+37
| function copyDirectoryRecursive(source, destination) { | ||
| if (!existsSync(source)) return; | ||
|
|
||
| const entries = readdirSync(source, { withFileTypes: true }); | ||
|
|
||
| for (const entry of entries) { | ||
| const srcPath = join(source, entry.name); | ||
| const destPath = join(destination, entry.name); | ||
|
|
||
| // Skip excluded patterns | ||
| if (EXCLUDE_PATTERNS.includes(entry.name)) { | ||
| console.log(` Excluding: ${entry.name}`); | ||
| continue; | ||
| } | ||
|
|
||
| if (entry.isDirectory()) { | ||
| cpSync(srcPath, destPath, { recursive: true }); | ||
| } else { | ||
| cpSync(srcPath, destPath); | ||
| } | ||
| } | ||
| } |
Comment on lines
+134
to
+144
| const { runId } = await api.runtime.subagent.run({ | ||
| sessionKey: agentId || "agent:main:subagent:dispatched", | ||
| message: prompt, | ||
| deliver, | ||
| }); | ||
|
|
||
| // 等待完成 | ||
| const result = await api.runtime.subagent.waitForRun({ | ||
| runId, | ||
| timeoutMs, | ||
| }); |
Comment on lines
+1
to
+3
| # pi-superpowers | ||
|
|
||
| Superpowers is a complete software development methodology for your coding agents, built on top of a set of composable skills and some initial instructions that make sure your agent uses them. | ||
| > Superpowers 工作流技能库的 Pi 平台移植版,含中文触发支持 |
Comment on lines
+10
to
+17
| sources: | ||
| - https://docs.openclaw.ai/plugins/sdk-overview | ||
| - https://docs.openclaw.ai/plugins/sdk-entrypoints | ||
| - https://docs.openclaw.ai/plugins/sdk-runtime | ||
| - https://docs.openclaw.ai/plugins/sdk-setup | ||
| - https://docs.openclaw.ai/plugins/sdk-testing | ||
| - https://docs.openclaw.ai/plugins/manifest | ||
| - https://docs.openclaw.ai/plugins/architecture |
Comment on lines
+22
to
+43
| > 本文档整合自官方文档七个页面,涵盖 Plugin SDK 的完整参考:概述、入口点、运行时帮助器、打包与配置、测试、清单规范,以及插件架构深度解析。 | ||
|
|
||
| --- | ||
|
|
||
| ## 目录 | ||
|
|
||
| 1. [[#第一章:SDK 概述]] | ||
| 2. [[#第二章:入口点(Entry Points)]] | ||
| 3. [[#第三章:运行时帮助器(Runtime Helpers)]] | ||
| 4. [[#第四章:打包与配置(Setup & Config)]] | ||
| 5. [[#第五章:插件测试(Testing)]] | ||
| 6. [[#第六章:插件清单(openclaw.plugin.json)]] | ||
| 7. [[#第七章:插件架构(Architecture)]] | ||
|
|
||
| --- | ||
|
|
||
| ## 第一章:SDK 概述 | ||
|
|
||
| Plugin SDK 是插件与核心之间的**类型化契约**,定义了**从哪里导入**以及**可以注册什么**。 | ||
|
|
||
| ### 导入约定 | ||
|
|
- README.md: keep pi-superpowers Chinese README - package.json: keep pi config + bump version to 5.1.0 - skills/using-git-worktrees/SKILL.md: keep Chinese trigger description
5 tasks
Owner
|
Hi. What does this do that #1499 doesn't? |
- Rename README.md → README_CN.md (Chinese version preserved as-is) - Add English README.md with full translation of README_CN.md - Add bidirectional links between README.md and README_CN.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem are you trying to solve?
What does this PR change?
Is this change appropriate for the core library?
What alternatives did you consider?
Does this PR contain multiple unrelated changes?
Existing PRs
Environment tested
New harness support (required if this PR adds a new harness)
Clean-session transcript for "Let's make a react todo list"
Evaluation
the session that led to this change?
Rigor
superpowers:writing-skillsandcompleted adversarial pressure testing (paste results below)
rationalizations, "human partner" language) without extensive evals
showing the change is an improvement
Human review