mirror of
https://github.com/jnMetaCode/superpowers-zh.git
synced 2026-09-03 07:23:56 +08:00
补齐上游漏的根级文件:CLAUDE.md(翻译 + 中文 fork 备注)、
AGENTS.md(symlink → CLAUDE.md,跟上游 mode 120000 一致)、
RELEASE-NOTES.md(上游英文原样 1180 行)、RELEASE-NOTES.zh.md
(新建中文 fork 自身 release log)、.codex-plugin/plugin.json
(中文化)、.version-bump.json、scripts/bump-version.sh、
assets/{app-icon.png,superpowers-small.svg}、4 个上游新增测试。
跟上游意图对齐,删上游已废弃流程:
- commands/ 全 3 个 deprecated stub(上游 #1188)
- agents/code-reviewer.md(已上升进 requesting-code-review skill,
上游 PR #1299)
- bin/superpowers-zh.js 删 install agents 逻辑,保留 uninstall 用
hardcoded LEGACY_AGENT_FILENAMES 列表清理已装用户残留
- .github/workflows/ci.yml 删 "Validate agents" 段
- package.json files 字段移除 agents/ commands/
主动修上游 v5.1.0 疏忽:
- .cursor-plugin/plugin.json 删 dangling 的 "agents": "./agents/"
和 "commands": "./commands/"。上游删目录但忘同步 manifest
(git blame 显示自 2026-02-13 起从未更新)。
配套:
- scripts/sync-plugin-version.js 扩到 .codex-plugin/plugin.json
- npm pack 校验 90 文件 228KB,agents/commands 残留 0 条
中文版"手动新增"叠加层全部保留:bin/ + npx 流程、docs/、
chinese-* skill、mcp-builder、workflow-runner、README 主推 npx、
各 INSTALL.md、.gemini/、sync-plugin-version.js。
详见 RELEASE-NOTES.zh.md v1.3.0 段。
Claude Code Skills Tests
Automated tests for superpowers skills using Claude Code CLI.
Overview
This test suite verifies that skills are loaded correctly and Claude follows them as expected. Tests invoke Claude Code in headless mode (claude -p) and verify the behavior.
Requirements
- Claude Code CLI installed and in PATH (
claude --versionshould work) - Local superpowers plugin installed (see main README for installation)
Running Tests
Run all fast tests (recommended):
./run-skill-tests.sh
Run integration tests (slow, 10-30 minutes):
./run-skill-tests.sh --integration
Run specific test:
./run-skill-tests.sh --test test-subagent-driven-development.sh
Run with verbose output:
./run-skill-tests.sh --verbose
Set custom timeout:
./run-skill-tests.sh --timeout 1800 # 30 minutes for integration tests
Test Structure
test-helpers.sh
Common functions for skills testing:
run_claude "prompt" [timeout]- Run Claude with promptassert_contains output pattern name- Verify pattern existsassert_not_contains output pattern name- Verify pattern absentassert_count output pattern count name- Verify exact countassert_order output pattern_a pattern_b name- Verify ordercreate_test_project- Create temp test directorycreate_test_plan project_dir- Create sample plan file
Test Files
Each test file:
- Sources
test-helpers.sh - Runs Claude Code with specific prompts
- Verifies expected behavior using assertions
- Returns 0 on success, non-zero on failure
Example Test
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
source "$SCRIPT_DIR/test-helpers.sh"
echo "=== Test: My Skill ==="
# Ask Claude about the skill
output=$(run_claude "What does the my-skill skill do?" 30)
# Verify response
assert_contains "$output" "expected behavior" "Skill describes behavior"
echo "=== All tests passed ==="
Current Tests
Fast Tests (run by default)
test-subagent-driven-development.sh
Tests skill content and requirements (~2 minutes):
- Skill loading and accessibility
- Workflow ordering (spec compliance before code quality)
- Self-review requirements documented
- Plan reading efficiency documented
- Spec compliance reviewer skepticism documented
- Review loops documented
- Task context provision documented
Integration Tests (use --integration flag)
test-subagent-driven-development-integration.sh
Full workflow execution test (~10-30 minutes):
- Creates real test project with Node.js setup
- Creates implementation plan with 2 tasks
- Executes plan using subagent-driven-development
- Verifies actual behaviors:
- Plan read once at start (not per task)
- Full task text provided in subagent prompts
- Subagents perform self-review before reporting
- Spec compliance review happens before code quality
- Spec reviewer reads code independently
- Working implementation is produced
- Tests pass
- Proper git commits created
What it tests:
- The workflow actually works end-to-end
- Our improvements are actually applied
- Subagents follow the skill correctly
- Final code is functional and tested
Adding New Tests
- Create new test file:
test-<skill-name>.sh - Source test-helpers.sh
- Write tests using
run_claudeand assertions - Add to test list in
run-skill-tests.sh - Make executable:
chmod +x test-<skill-name>.sh
Timeout Considerations
- Default timeout: 5 minutes per test
- Claude Code may take time to respond
- Adjust with
--timeoutif needed - Tests should be focused to avoid long runs
Debugging Failed Tests
With --verbose, you'll see full Claude output:
./run-skill-tests.sh --verbose --test test-subagent-driven-development.sh
Without verbose, only failures show output.
CI/CD Integration
To run in CI:
# Run with explicit timeout for CI environments
./run-skill-tests.sh --timeout 900
# Exit code 0 = success, non-zero = failure
Notes
- Tests verify skill instructions, not full execution
- Full workflow tests would be very slow
- Focus on verifying key skill requirements
- Tests should be deterministic
- Avoid testing implementation details