Skip to content

Migrate superpowers to Pi platform with bilingual support and tests#1507

Open
weiping wants to merge 9 commits into
obra:mainfrom
weiping:main
Open

Migrate superpowers to Pi platform with bilingual support and tests#1507
weiping wants to merge 9 commits into
obra:mainfrom
weiping:main

Conversation

@weiping
Copy link
Copy Markdown

@weiping weiping commented May 9, 2026

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

  • I have reviewed all open AND closed PRs for duplicates or prior art
  • Related PRs:

Environment tested

Harness (e.g. Claude Code, Cursor) Harness version Model Model version/ID

New harness support (required if this PR adds a new harness)

Clean-session transcript for "Let's make a react todo list"
paste the complete transcript here

Evaluation

  • What was the initial prompt you (or your human partner) used to start
    the session that led to this change?
  • How many eval sessions did you run AFTER making the change?
  • How did outcomes change compared to before the change?

Rigor

  • If this is a skills change: I used superpowers:writing-skills and
    completed adversarial pressure testing (paste results below)
  • This change was tested adversarially, not just on the happy path
  • I did not modify carefully-tuned content (Red Flags table,
    rationalizations, "human partner" language) without extensive evals
    showing the change is an improvement

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

weiping added 6 commits April 8, 2026 22:02
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
Copilot AI review requested due to automatic review settings May 9, 2026 03:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-superpowers and a dispatch_agent tool backed by pi --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_agent tool (extensions/subagent.ts) as a Task-like replacement. Update the injected mapping (and/or using-superpowers SKILL.md mapping section) to mention dispatch_agent as 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 thread openclaw-plugin/index.ts
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 thread README.md Outdated
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 是插件与核心之间的**类型化契约**,定义了**从哪里导入**以及**可以注册什么**。

### 导入约定

weiping added 2 commits May 9, 2026 11:45
- 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
@obra
Copy link
Copy Markdown
Owner

obra commented May 13, 2026

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
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.

3 participants