mirror of
https://github.com/obra/superpowers.git
synced 2026-04-21 08:59:04 +08:00
Compare commits
42 Commits
fix/openco
...
v4.3.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2d6cf4852 | ||
|
|
394cf85013 | ||
|
|
31bbbe2dbb | ||
|
|
5fbefbd0a9 | ||
|
|
a0b9ecce2b | ||
|
|
772ec9f834 | ||
|
|
e16d611eee | ||
|
|
b7cad76134 | ||
|
|
4c836817da | ||
|
|
7f2ee614b6 | ||
|
|
b97b5f228d | ||
|
|
93c8966cab | ||
|
|
19df3db59b | ||
|
|
f8cf545bc5 | ||
|
|
a98c5dfc9d | ||
|
|
a72e416979 | ||
|
|
8dd31c3da5 | ||
|
|
6a07692da1 | ||
|
|
0771fd7cd1 | ||
|
|
bcccc69271 | ||
|
|
3626ccc53e | ||
|
|
47d3df7acc | ||
|
|
d41f951c4a | ||
|
|
b4f56fec1b | ||
|
|
1143f9be3d | ||
|
|
6cc2d8c920 | ||
|
|
038abed026 | ||
|
|
961052e0f9 | ||
|
|
689e2a77fc | ||
|
|
5e0d2f8175 | ||
|
|
06b92f3682 | ||
|
|
9819209bba | ||
|
|
c7816ee2a6 | ||
|
|
b323e35805 | ||
|
|
bb2ff5d309 | ||
|
|
b63d485955 | ||
|
|
fa3f46d4e9 | ||
|
|
f8dbe7b196 | ||
|
|
93cf2ee84f | ||
|
|
1872f50b64 | ||
|
|
8904b7d9dc | ||
|
|
469a6d81eb |
@@ -9,7 +9,7 @@
|
|||||||
{
|
{
|
||||||
"name": "superpowers",
|
"name": "superpowers",
|
||||||
"description": "Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques",
|
"description": "Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques",
|
||||||
"version": "4.0.3",
|
"version": "4.3.1",
|
||||||
"source": "./",
|
"source": "./",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Jesse Vincent",
|
"name": "Jesse Vincent",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "superpowers",
|
"name": "superpowers",
|
||||||
"description": "Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques",
|
"description": "Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques",
|
||||||
"version": "4.1.1",
|
"version": "4.3.1",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Jesse Vincent",
|
"name": "Jesse Vincent",
|
||||||
"email": "jesse@fsck.com"
|
"email": "jesse@fsck.com"
|
||||||
|
|||||||
@@ -1,35 +1,67 @@
|
|||||||
# Installing Superpowers for Codex
|
# Installing Superpowers for Codex
|
||||||
|
|
||||||
Quick setup to enable superpowers skills in Codex.
|
Enable superpowers skills in Codex via native skill discovery. Just clone and symlink.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Git
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. **Clone superpowers repository**:
|
1. **Clone the superpowers repository:**
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/.codex/superpowers
|
git clone https://github.com/obra/superpowers.git ~/.codex/superpowers
|
||||||
cd ~/.codex/superpowers
|
|
||||||
git clone https://github.com/obra/superpowers.git .
|
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Create personal skills directory**:
|
2. **Create the skills symlink:**
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/.codex/skills
|
mkdir -p ~/.agents/skills
|
||||||
|
ln -s ~/.codex/superpowers/skills ~/.agents/skills/superpowers
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Update ~/.codex/AGENTS.md** to include this superpowers section:
|
**Windows (PowerShell):**
|
||||||
```markdown
|
```powershell
|
||||||
## Superpowers System
|
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.agents\skills"
|
||||||
|
cmd /c mklink /J "$env:USERPROFILE\.agents\skills\superpowers" "$env:USERPROFILE\.codex\superpowers\skills"
|
||||||
<EXTREMELY_IMPORTANT>
|
|
||||||
You have superpowers. Superpowers teach you new skills and capabilities. RIGHT NOW run: `~/.codex/superpowers/.codex/superpowers-codex bootstrap` and follow the instructions it returns.
|
|
||||||
</EXTREMELY_IMPORTANT>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Verification
|
3. **Restart Codex** (quit and relaunch the CLI) to discover the skills.
|
||||||
|
|
||||||
|
## Migrating from old bootstrap
|
||||||
|
|
||||||
|
If you installed superpowers before native skill discovery, you need to:
|
||||||
|
|
||||||
|
1. **Update the repo:**
|
||||||
|
```bash
|
||||||
|
cd ~/.codex/superpowers && git pull
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Create the skills symlink** (step 2 above) — this is the new discovery mechanism.
|
||||||
|
|
||||||
|
3. **Remove the old bootstrap block** from `~/.codex/AGENTS.md` — any block referencing `superpowers-codex bootstrap` is no longer needed.
|
||||||
|
|
||||||
|
4. **Restart Codex.**
|
||||||
|
|
||||||
|
## Verify
|
||||||
|
|
||||||
Test the installation:
|
|
||||||
```bash
|
```bash
|
||||||
~/.codex/superpowers/.codex/superpowers-codex bootstrap
|
ls -la ~/.agents/skills/superpowers
|
||||||
```
|
```
|
||||||
|
|
||||||
You should see skill listings and bootstrap instructions. The system is now ready for use.
|
You should see a symlink (or junction on Windows) pointing to your superpowers skills directory.
|
||||||
|
|
||||||
|
## Updating
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ~/.codex/superpowers && git pull
|
||||||
|
```
|
||||||
|
|
||||||
|
Skills update instantly through the symlink.
|
||||||
|
|
||||||
|
## Uninstalling
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rm ~/.agents/skills/superpowers
|
||||||
|
```
|
||||||
|
|
||||||
|
Optionally delete the clone: `rm -rf ~/.codex/superpowers`.
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
# Superpowers Bootstrap for Codex
|
|
||||||
|
|
||||||
<EXTREMELY_IMPORTANT>
|
|
||||||
You have superpowers.
|
|
||||||
|
|
||||||
**Tool for running skills:**
|
|
||||||
- `~/.codex/superpowers/.codex/superpowers-codex use-skill <skill-name>`
|
|
||||||
|
|
||||||
**Tool Mapping for Codex:**
|
|
||||||
When skills reference tools you don't have, substitute your equivalent tools:
|
|
||||||
- `TodoWrite` → `update_plan` (your planning/task tracking tool)
|
|
||||||
- `Task` tool with subagents → Tell the user that subagents aren't available in Codex yet and you'll do the work the subagent would do
|
|
||||||
- `Skill` tool → `~/.codex/superpowers/.codex/superpowers-codex use-skill` command (already available)
|
|
||||||
- `Read`, `Write`, `Edit`, `Bash` → Use your native tools with similar functions
|
|
||||||
|
|
||||||
**Skills naming:**
|
|
||||||
- Superpowers skills: `superpowers:skill-name` (from ~/.codex/superpowers/skills/)
|
|
||||||
- Personal skills: `skill-name` (from ~/.codex/skills/)
|
|
||||||
- Personal skills override superpowers skills when names match
|
|
||||||
|
|
||||||
**Critical Rules:**
|
|
||||||
- Before ANY task, review the skills list (shown below)
|
|
||||||
- If a relevant skill exists, you MUST use `~/.codex/superpowers/.codex/superpowers-codex use-skill` to load it
|
|
||||||
- Announce: "I've read the [Skill Name] skill and I'm using it to [purpose]"
|
|
||||||
- Skills with checklists require `update_plan` todos for each item
|
|
||||||
- NEVER skip mandatory workflows (brainstorming before coding, TDD, systematic debugging)
|
|
||||||
|
|
||||||
**Skills location:**
|
|
||||||
- Superpowers skills: ~/.codex/superpowers/skills/
|
|
||||||
- Personal skills: ~/.codex/skills/ (override superpowers when names match)
|
|
||||||
|
|
||||||
IF A SKILL APPLIES TO YOUR TASK, YOU DO NOT HAVE A CHOICE. YOU MUST USE IT.
|
|
||||||
</EXTREMELY_IMPORTANT>
|
|
||||||
@@ -1,267 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
const os = require('os');
|
|
||||||
const skillsCore = require('../lib/skills-core');
|
|
||||||
|
|
||||||
// Paths
|
|
||||||
const homeDir = os.homedir();
|
|
||||||
const superpowersSkillsDir = path.join(homeDir, '.codex', 'superpowers', 'skills');
|
|
||||||
const personalSkillsDir = path.join(homeDir, '.codex', 'skills');
|
|
||||||
const bootstrapFile = path.join(homeDir, '.codex', 'superpowers', '.codex', 'superpowers-bootstrap.md');
|
|
||||||
const superpowersRepoDir = path.join(homeDir, '.codex', 'superpowers');
|
|
||||||
|
|
||||||
// Utility functions
|
|
||||||
function printSkill(skillPath, sourceType) {
|
|
||||||
const skillFile = path.join(skillPath, 'SKILL.md');
|
|
||||||
const relPath = sourceType === 'personal'
|
|
||||||
? path.relative(personalSkillsDir, skillPath)
|
|
||||||
: path.relative(superpowersSkillsDir, skillPath);
|
|
||||||
|
|
||||||
// Print skill name with namespace
|
|
||||||
if (sourceType === 'personal') {
|
|
||||||
console.log(relPath.replace(/\\/g, '/')); // Personal skills are not namespaced
|
|
||||||
} else {
|
|
||||||
console.log(`superpowers:${relPath.replace(/\\/g, '/')}`); // Superpowers skills get superpowers namespace
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extract and print metadata
|
|
||||||
const { name, description } = skillsCore.extractFrontmatter(skillFile);
|
|
||||||
|
|
||||||
if (description) console.log(` ${description}`);
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Commands
|
|
||||||
function runFindSkills() {
|
|
||||||
console.log('Available skills:');
|
|
||||||
console.log('==================');
|
|
||||||
console.log('');
|
|
||||||
|
|
||||||
const foundSkills = new Set();
|
|
||||||
|
|
||||||
// Find personal skills first (these take precedence)
|
|
||||||
const personalSkills = skillsCore.findSkillsInDir(personalSkillsDir, 'personal', 2);
|
|
||||||
for (const skill of personalSkills) {
|
|
||||||
const relPath = path.relative(personalSkillsDir, skill.path);
|
|
||||||
foundSkills.add(relPath);
|
|
||||||
printSkill(skill.path, 'personal');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find superpowers skills (only if not already found in personal)
|
|
||||||
const superpowersSkills = skillsCore.findSkillsInDir(superpowersSkillsDir, 'superpowers', 1);
|
|
||||||
for (const skill of superpowersSkills) {
|
|
||||||
const relPath = path.relative(superpowersSkillsDir, skill.path);
|
|
||||||
if (!foundSkills.has(relPath)) {
|
|
||||||
printSkill(skill.path, 'superpowers');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('Usage:');
|
|
||||||
console.log(' superpowers-codex use-skill <skill-name> # Load a specific skill');
|
|
||||||
console.log('');
|
|
||||||
console.log('Skill naming:');
|
|
||||||
console.log(' Superpowers skills: superpowers:skill-name (from ~/.codex/superpowers/skills/)');
|
|
||||||
console.log(' Personal skills: skill-name (from ~/.codex/skills/)');
|
|
||||||
console.log(' Personal skills override superpowers skills when names match.');
|
|
||||||
console.log('');
|
|
||||||
console.log('Note: All skills are disclosed at session start via bootstrap.');
|
|
||||||
}
|
|
||||||
|
|
||||||
function runBootstrap() {
|
|
||||||
console.log('# Superpowers Bootstrap for Codex');
|
|
||||||
console.log('# ================================');
|
|
||||||
console.log('');
|
|
||||||
|
|
||||||
// Check for updates (with timeout protection)
|
|
||||||
if (skillsCore.checkForUpdates(superpowersRepoDir)) {
|
|
||||||
console.log('## Update Available');
|
|
||||||
console.log('');
|
|
||||||
console.log('⚠️ Your superpowers installation is behind the latest version.');
|
|
||||||
console.log('To update, run: `cd ~/.codex/superpowers && git pull`');
|
|
||||||
console.log('');
|
|
||||||
console.log('---');
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show the bootstrap instructions
|
|
||||||
if (fs.existsSync(bootstrapFile)) {
|
|
||||||
console.log('## Bootstrap Instructions:');
|
|
||||||
console.log('');
|
|
||||||
try {
|
|
||||||
const content = fs.readFileSync(bootstrapFile, 'utf8');
|
|
||||||
console.log(content);
|
|
||||||
} catch (error) {
|
|
||||||
console.log(`Error reading bootstrap file: ${error.message}`);
|
|
||||||
}
|
|
||||||
console.log('');
|
|
||||||
console.log('---');
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run find-skills to show available skills
|
|
||||||
console.log('## Available Skills:');
|
|
||||||
console.log('');
|
|
||||||
runFindSkills();
|
|
||||||
|
|
||||||
console.log('');
|
|
||||||
console.log('---');
|
|
||||||
console.log('');
|
|
||||||
|
|
||||||
// Load the using-superpowers skill automatically
|
|
||||||
console.log('## Auto-loading superpowers:using-superpowers skill:');
|
|
||||||
console.log('');
|
|
||||||
runUseSkill('superpowers:using-superpowers');
|
|
||||||
|
|
||||||
console.log('');
|
|
||||||
console.log('---');
|
|
||||||
console.log('');
|
|
||||||
console.log('# Bootstrap Complete!');
|
|
||||||
console.log('# You now have access to all superpowers skills.');
|
|
||||||
console.log('# Use "superpowers-codex use-skill <skill>" to load and apply skills.');
|
|
||||||
console.log('# Remember: If a skill applies to your task, you MUST use it!');
|
|
||||||
}
|
|
||||||
|
|
||||||
function runUseSkill(skillName) {
|
|
||||||
if (!skillName) {
|
|
||||||
console.log('Usage: superpowers-codex use-skill <skill-name>');
|
|
||||||
console.log('Examples:');
|
|
||||||
console.log(' superpowers-codex use-skill superpowers:brainstorming # Load superpowers skill');
|
|
||||||
console.log(' superpowers-codex use-skill brainstorming # Load personal skill (or superpowers if not found)');
|
|
||||||
console.log(' superpowers-codex use-skill my-custom-skill # Load personal skill');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle namespaced skill names
|
|
||||||
let actualSkillPath;
|
|
||||||
let forceSuperpowers = false;
|
|
||||||
|
|
||||||
if (skillName.startsWith('superpowers:')) {
|
|
||||||
// Remove the superpowers: namespace prefix
|
|
||||||
actualSkillPath = skillName.substring('superpowers:'.length);
|
|
||||||
forceSuperpowers = true;
|
|
||||||
} else {
|
|
||||||
actualSkillPath = skillName;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove "skills/" prefix if present
|
|
||||||
if (actualSkillPath.startsWith('skills/')) {
|
|
||||||
actualSkillPath = actualSkillPath.substring('skills/'.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Function to find skill file
|
|
||||||
function findSkillFile(searchPath) {
|
|
||||||
// Check for exact match with SKILL.md
|
|
||||||
const skillMdPath = path.join(searchPath, 'SKILL.md');
|
|
||||||
if (fs.existsSync(skillMdPath)) {
|
|
||||||
return skillMdPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for direct SKILL.md file
|
|
||||||
if (searchPath.endsWith('SKILL.md') && fs.existsSync(searchPath)) {
|
|
||||||
return searchPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
let skillFile = null;
|
|
||||||
|
|
||||||
// If superpowers: namespace was used, only check superpowers skills
|
|
||||||
if (forceSuperpowers) {
|
|
||||||
if (fs.existsSync(superpowersSkillsDir)) {
|
|
||||||
const superpowersPath = path.join(superpowersSkillsDir, actualSkillPath);
|
|
||||||
skillFile = findSkillFile(superpowersPath);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// First check personal skills directory (takes precedence)
|
|
||||||
if (fs.existsSync(personalSkillsDir)) {
|
|
||||||
const personalPath = path.join(personalSkillsDir, actualSkillPath);
|
|
||||||
skillFile = findSkillFile(personalPath);
|
|
||||||
if (skillFile) {
|
|
||||||
console.log(`# Loading personal skill: ${actualSkillPath}`);
|
|
||||||
console.log(`# Source: ${skillFile}`);
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If not found in personal, check superpowers skills
|
|
||||||
if (!skillFile && fs.existsSync(superpowersSkillsDir)) {
|
|
||||||
const superpowersPath = path.join(superpowersSkillsDir, actualSkillPath);
|
|
||||||
skillFile = findSkillFile(superpowersPath);
|
|
||||||
if (skillFile) {
|
|
||||||
console.log(`# Loading superpowers skill: superpowers:${actualSkillPath}`);
|
|
||||||
console.log(`# Source: ${skillFile}`);
|
|
||||||
console.log('');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If still not found, error
|
|
||||||
if (!skillFile) {
|
|
||||||
console.log(`Error: Skill not found: ${actualSkillPath}`);
|
|
||||||
console.log('');
|
|
||||||
console.log('Available skills:');
|
|
||||||
runFindSkills();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extract frontmatter and content using shared core functions
|
|
||||||
let content, frontmatter;
|
|
||||||
try {
|
|
||||||
const fullContent = fs.readFileSync(skillFile, 'utf8');
|
|
||||||
const { name, description } = skillsCore.extractFrontmatter(skillFile);
|
|
||||||
content = skillsCore.stripFrontmatter(fullContent);
|
|
||||||
frontmatter = { name, description };
|
|
||||||
} catch (error) {
|
|
||||||
console.log(`Error reading skill file: ${error.message}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Display skill header with clean info
|
|
||||||
const displayName = forceSuperpowers ? `superpowers:${actualSkillPath}` :
|
|
||||||
(skillFile.includes(personalSkillsDir) ? actualSkillPath : `superpowers:${actualSkillPath}`);
|
|
||||||
|
|
||||||
const skillDirectory = path.dirname(skillFile);
|
|
||||||
|
|
||||||
console.log(`# ${frontmatter.name || displayName}`);
|
|
||||||
if (frontmatter.description) {
|
|
||||||
console.log(`# ${frontmatter.description}`);
|
|
||||||
}
|
|
||||||
console.log(`# Skill-specific tools and reference files live in ${skillDirectory}`);
|
|
||||||
console.log('# ============================================');
|
|
||||||
console.log('');
|
|
||||||
|
|
||||||
// Display the skill content (without frontmatter)
|
|
||||||
console.log(content);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Main CLI
|
|
||||||
const command = process.argv[2];
|
|
||||||
const arg = process.argv[3];
|
|
||||||
|
|
||||||
switch (command) {
|
|
||||||
case 'bootstrap':
|
|
||||||
runBootstrap();
|
|
||||||
break;
|
|
||||||
case 'use-skill':
|
|
||||||
runUseSkill(arg);
|
|
||||||
break;
|
|
||||||
case 'find-skills':
|
|
||||||
runFindSkills();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.log('Superpowers for Codex');
|
|
||||||
console.log('Usage:');
|
|
||||||
console.log(' superpowers-codex bootstrap # Run complete bootstrap with all skills');
|
|
||||||
console.log(' superpowers-codex use-skill <skill-name> # Load a specific skill');
|
|
||||||
console.log(' superpowers-codex find-skills # List all available skills');
|
|
||||||
console.log('');
|
|
||||||
console.log('Examples:');
|
|
||||||
console.log(' superpowers-codex bootstrap');
|
|
||||||
console.log(' superpowers-codex use-skill superpowers:brainstorming');
|
|
||||||
console.log(' superpowers-codex use-skill my-custom-skill');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
18
.cursor-plugin/plugin.json
Normal file
18
.cursor-plugin/plugin.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "superpowers",
|
||||||
|
"displayName": "Superpowers",
|
||||||
|
"description": "Core skills library: TDD, debugging, collaboration patterns, and proven techniques",
|
||||||
|
"version": "4.3.1",
|
||||||
|
"author": {
|
||||||
|
"name": "Jesse Vincent",
|
||||||
|
"email": "jesse@fsck.com"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/obra/superpowers",
|
||||||
|
"repository": "https://github.com/obra/superpowers",
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": ["skills", "tdd", "debugging", "collaboration", "best-practices", "workflows"],
|
||||||
|
"skills": "./skills/",
|
||||||
|
"agents": "./agents/",
|
||||||
|
"commands": "./commands/",
|
||||||
|
"hooks": "./hooks/hooks.json"
|
||||||
|
}
|
||||||
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1,5 +1,6 @@
|
|||||||
# Ensure shell scripts always have LF line endings
|
# Ensure shell scripts always have LF line endings
|
||||||
*.sh text eol=lf
|
*.sh text eol=lf
|
||||||
|
hooks/session-start text eol=lf
|
||||||
|
|
||||||
# Ensure the polyglot wrapper keeps LF (it's parsed by both cmd and bash)
|
# Ensure the polyglot wrapper keeps LF (it's parsed by both cmd and bash)
|
||||||
*.cmd text eol=lf
|
*.cmd text eol=lf
|
||||||
|
|||||||
22
README.md
22
README.md
@@ -26,7 +26,8 @@ Thanks!
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
**Note:** Installation differs by platform. Claude Code has a built-in plugin system. Codex and OpenCode require manual setup.
|
**Note:** Installation differs by platform. Claude Code or Cursor have built-in plugin marketplaces. Codex and OpenCode require manual setup.
|
||||||
|
|
||||||
|
|
||||||
### Claude Code (via Plugin Marketplace)
|
### Claude Code (via Plugin Marketplace)
|
||||||
|
|
||||||
@@ -42,19 +43,12 @@ Then install the plugin from this marketplace:
|
|||||||
/plugin install superpowers@superpowers-marketplace
|
/plugin install superpowers@superpowers-marketplace
|
||||||
```
|
```
|
||||||
|
|
||||||
### Verify Installation
|
### Cursor (via Plugin Marketplace)
|
||||||
|
|
||||||
Check that commands appear:
|
In Cursor Agent chat, install from marketplace:
|
||||||
|
|
||||||
```bash
|
```text
|
||||||
/help
|
/plugin-add superpowers
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
# Should see:
|
|
||||||
# /superpowers:brainstorm - Interactive design refinement
|
|
||||||
# /superpowers:write-plan - Create implementation plan
|
|
||||||
# /superpowers:execute-plan - Execute plan in batches
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Codex
|
### Codex
|
||||||
@@ -77,6 +71,10 @@ Fetch and follow instructions from https://raw.githubusercontent.com/obra/superp
|
|||||||
|
|
||||||
**Detailed docs:** [docs/README.opencode.md](docs/README.opencode.md)
|
**Detailed docs:** [docs/README.opencode.md](docs/README.opencode.md)
|
||||||
|
|
||||||
|
### Verify Installation
|
||||||
|
|
||||||
|
Start a new session in your chosen platform and ask for something that should trigger a skill (for example, "help me plan this feature" or "let's debug this issue"). The agent should automatically invoke the relevant superpowers skill.
|
||||||
|
|
||||||
## The Basic Workflow
|
## The Basic Workflow
|
||||||
|
|
||||||
1. **brainstorming** - Activates before writing code. Refines rough ideas through questions, explores alternatives, presents design in sections for validation. Saves design document.
|
1. **brainstorming** - Activates before writing code. Refines rough ideas through questions, explores alternatives, presents design in sections for validation. Saves design document.
|
||||||
|
|||||||
113
RELEASE-NOTES.md
113
RELEASE-NOTES.md
@@ -1,5 +1,118 @@
|
|||||||
# Superpowers Release Notes
|
# Superpowers Release Notes
|
||||||
|
|
||||||
|
## v4.3.1 (2026-02-21)
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
**Cursor support**
|
||||||
|
|
||||||
|
Superpowers now works with Cursor's plugin system. Includes a `.cursor-plugin/plugin.json` manifest and Cursor-specific installation instructions in the README. The SessionStart hook output now includes an `additional_context` field alongside the existing `hookSpecificOutput.additionalContext` for Cursor hook compatibility.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
**Windows: Restored polyglot wrapper for reliable hook execution (#518, #504, #491, #487, #466, #440)**
|
||||||
|
|
||||||
|
Claude Code's `.sh` auto-detection on Windows was prepending `bash` to the hook command, breaking execution. The fix:
|
||||||
|
|
||||||
|
- Renamed `session-start.sh` to `session-start` (extensionless) so auto-detection doesn't interfere
|
||||||
|
- Restored `run-hook.cmd` polyglot wrapper with multi-location bash discovery (standard Git for Windows paths, then PATH fallback)
|
||||||
|
- Exits silently if no bash is found rather than erroring
|
||||||
|
- On Unix, the wrapper runs the script directly via `exec bash`
|
||||||
|
- Uses POSIX-safe `dirname "$0"` path resolution (works on dash/sh, not just bash)
|
||||||
|
|
||||||
|
This fixes SessionStart failures on Windows with spaces in paths, missing WSL, `set -euo pipefail` fragility on MSYS, and backslash mangling.
|
||||||
|
|
||||||
|
## v4.3.0 (2026-02-12)
|
||||||
|
|
||||||
|
This fix should dramatically improve superpowers skills compliance and should reduce the chances of Claude entering its native plan mode unintentionally.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
**Brainstorming skill now enforces its workflow instead of describing it**
|
||||||
|
|
||||||
|
Models were skipping the design phase and jumping straight to implementation skills like frontend-design, or collapsing the entire brainstorming process into a single text block. The skill now uses hard gates, a mandatory checklist, and a graphviz process flow to enforce compliance:
|
||||||
|
|
||||||
|
- `<HARD-GATE>`: no implementation skills, code, or scaffolding until design is presented and user approves
|
||||||
|
- Explicit checklist (6 items) that must be created as tasks and completed in order
|
||||||
|
- Graphviz process flow with `writing-plans` as the only valid terminal state
|
||||||
|
- Anti-pattern callout for "this is too simple to need a design" — the exact rationalization models use to skip the process
|
||||||
|
- Design section sizing based on section complexity, not project complexity
|
||||||
|
|
||||||
|
**Using-superpowers workflow graph intercepts EnterPlanMode**
|
||||||
|
|
||||||
|
Added an `EnterPlanMode` intercept to the skill flow graph. When the model is about to enter Claude's native plan mode, it checks whether brainstorming has happened and routes through the brainstorming skill instead. Plan mode is never entered.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
**SessionStart hook now runs synchronously**
|
||||||
|
|
||||||
|
Changed `async: true` to `async: false` in hooks.json. When async, the hook could fail to complete before the model's first turn, meaning using-superpowers instructions weren't in context for the first message.
|
||||||
|
|
||||||
|
## v4.2.0 (2026-02-05)
|
||||||
|
|
||||||
|
### Breaking Changes
|
||||||
|
|
||||||
|
**Codex: Replaced bootstrap CLI with native skill discovery**
|
||||||
|
|
||||||
|
The `superpowers-codex` bootstrap CLI, Windows `.cmd` wrapper, and related bootstrap content file have been removed. Codex now uses native skill discovery via `~/.agents/skills/superpowers/` symlink, so the old `use_skill`/`find_skills` CLI tools are no longer needed.
|
||||||
|
|
||||||
|
Installation is now just clone + symlink (documented in INSTALL.md). No Node.js dependency required. The old `~/.codex/skills/` path is deprecated.
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
**Windows: Fixed Claude Code 2.1.x hook execution (#331)**
|
||||||
|
|
||||||
|
Claude Code 2.1.x changed how hooks execute on Windows: it now auto-detects `.sh` files in commands and prepends `bash`. This broke the polyglot wrapper pattern because `bash "run-hook.cmd" session-start.sh` tries to execute the `.cmd` file as a bash script.
|
||||||
|
|
||||||
|
Fix: hooks.json now calls session-start.sh directly. Claude Code 2.1.x handles the bash invocation automatically. Also added .gitattributes to enforce LF line endings for shell scripts (fixes CRLF issues on Windows checkout).
|
||||||
|
|
||||||
|
**Windows: SessionStart hook runs async to prevent terminal freeze (#404, #413, #414, #419)**
|
||||||
|
|
||||||
|
The synchronous SessionStart hook blocked the TUI from entering raw mode on Windows, freezing all keyboard input. Running the hook async prevents the freeze while still injecting superpowers context.
|
||||||
|
|
||||||
|
**Windows: Fixed O(n^2) `escape_for_json` performance**
|
||||||
|
|
||||||
|
The character-by-character loop using `${input:$i:1}` was O(n^2) in bash due to substring copy overhead. On Windows Git Bash this took 60+ seconds. Replaced with bash parameter substitution (`${s//old/new}`) which runs each pattern as a single C-level pass — 7x faster on macOS, dramatically faster on Windows.
|
||||||
|
|
||||||
|
**Codex: Fixed Windows/PowerShell invocation (#285, #243)**
|
||||||
|
|
||||||
|
- Windows doesn't respect shebangs, so directly invoking the extensionless `superpowers-codex` script triggered an "Open with" dialog. All invocations now prefixed with `node`.
|
||||||
|
- Fixed `~/` path expansion on Windows — PowerShell doesn't expand `~` when passed as an argument to `node`. Changed to `$HOME` which expands correctly in both bash and PowerShell.
|
||||||
|
|
||||||
|
**Codex: Fixed path resolution in installer**
|
||||||
|
|
||||||
|
Used `fileURLToPath()` instead of manual URL pathname parsing to correctly handle paths with spaces and special characters on all platforms.
|
||||||
|
|
||||||
|
**Codex: Fixed stale skills path in writing-skills**
|
||||||
|
|
||||||
|
Updated `~/.codex/skills/` reference (deprecated) to `~/.agents/skills/` for native discovery.
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
**Worktree isolation now required before implementation**
|
||||||
|
|
||||||
|
Added `using-git-worktrees` as a required skill for both `subagent-driven-development` and `executing-plans`. Implementation workflows now explicitly require setting up an isolated worktree before starting work, preventing accidental work directly on main.
|
||||||
|
|
||||||
|
**Main branch protection softened to require explicit consent**
|
||||||
|
|
||||||
|
Instead of prohibiting main branch work entirely, the skills now allow it with explicit user consent. More flexible while still ensuring users are aware of the implications.
|
||||||
|
|
||||||
|
**Simplified installation verification**
|
||||||
|
|
||||||
|
Removed `/help` command check and specific slash command list from verification steps. Skills are primarily invoked by describing what you want to do, not by running specific commands.
|
||||||
|
|
||||||
|
**Codex: Clarified subagent tool mapping in bootstrap**
|
||||||
|
|
||||||
|
Improved documentation of how Codex tools map to Claude Code equivalents for subagent workflows.
|
||||||
|
|
||||||
|
### Tests
|
||||||
|
|
||||||
|
- Added worktree requirement test for subagent-driven-development
|
||||||
|
- Added main branch red flag warning test
|
||||||
|
- Fixed case sensitivity in skill recognition test assertions
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## v4.1.1 (2026-01-23)
|
## v4.1.1 (2026-01-23)
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Superpowers for Codex
|
# Superpowers for Codex
|
||||||
|
|
||||||
Complete guide for using Superpowers with OpenAI Codex.
|
Guide for using Superpowers with OpenAI Codex via native skill discovery.
|
||||||
|
|
||||||
## Quick Install
|
## Quick Install
|
||||||
|
|
||||||
@@ -14,63 +14,59 @@ Fetch and follow instructions from https://raw.githubusercontent.com/obra/superp
|
|||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- OpenAI Codex access
|
- OpenAI Codex CLI
|
||||||
- Shell access to install files
|
- Git
|
||||||
|
|
||||||
### Installation Steps
|
### Steps
|
||||||
|
|
||||||
#### 1. Clone Superpowers
|
1. Clone the repo:
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/obra/superpowers.git ~/.codex/superpowers
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
2. Create the skills symlink:
|
||||||
mkdir -p ~/.codex/superpowers
|
```bash
|
||||||
git clone https://github.com/obra/superpowers.git ~/.codex/superpowers
|
mkdir -p ~/.agents/skills
|
||||||
|
ln -s ~/.codex/superpowers/skills ~/.agents/skills/superpowers
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Restart Codex.
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Use a junction instead of a symlink (works without Developer Mode):
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.agents\skills"
|
||||||
|
cmd /c mklink /J "$env:USERPROFILE\.agents\skills\superpowers" "$env:USERPROFILE\.codex\superpowers\skills"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 2. Install Bootstrap
|
## How It Works
|
||||||
|
|
||||||
The bootstrap file is included in the repository at `.codex/superpowers-bootstrap.md`. Codex will automatically use it from the cloned location.
|
Codex has native skill discovery — it scans `~/.agents/skills/` at startup, parses SKILL.md frontmatter, and loads skills on demand. Superpowers skills are made visible through a single symlink:
|
||||||
|
|
||||||
#### 3. Verify Installation
|
|
||||||
|
|
||||||
Tell Codex:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
Run ~/.codex/superpowers/.codex/superpowers-codex find-skills to show available skills
|
~/.agents/skills/superpowers/ → ~/.codex/superpowers/skills/
|
||||||
```
|
```
|
||||||
|
|
||||||
You should see a list of available skills with descriptions.
|
The `using-superpowers` skill is discovered automatically and enforces skill usage discipline — no additional configuration needed.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Finding Skills
|
Skills are discovered automatically. Codex activates them when:
|
||||||
|
- You mention a skill by name (e.g., "use brainstorming")
|
||||||
```
|
- The task matches a skill's description
|
||||||
Run ~/.codex/superpowers/.codex/superpowers-codex find-skills
|
- The `using-superpowers` skill directs Codex to use one
|
||||||
```
|
|
||||||
|
|
||||||
### Loading a Skill
|
|
||||||
|
|
||||||
```
|
|
||||||
Run ~/.codex/superpowers/.codex/superpowers-codex use-skill superpowers:brainstorming
|
|
||||||
```
|
|
||||||
|
|
||||||
### Bootstrap All Skills
|
|
||||||
|
|
||||||
```
|
|
||||||
Run ~/.codex/superpowers/.codex/superpowers-codex bootstrap
|
|
||||||
```
|
|
||||||
|
|
||||||
This loads the complete bootstrap with all skill information.
|
|
||||||
|
|
||||||
### Personal Skills
|
### Personal Skills
|
||||||
|
|
||||||
Create your own skills in `~/.codex/skills/`:
|
Create your own skills in `~/.agents/skills/`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/.codex/skills/my-skill
|
mkdir -p ~/.agents/skills/my-skill
|
||||||
```
|
```
|
||||||
|
|
||||||
Create `~/.codex/skills/my-skill/SKILL.md`:
|
Create `~/.agents/skills/my-skill/SKILL.md`:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
---
|
---
|
||||||
@@ -83,71 +79,42 @@ description: Use when [condition] - [what it does]
|
|||||||
[Your skill content here]
|
[Your skill content here]
|
||||||
```
|
```
|
||||||
|
|
||||||
Personal skills override superpowers skills with the same name.
|
The `description` field is how Codex decides when to activate a skill automatically — write it as a clear trigger condition.
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
### Codex CLI Tool
|
|
||||||
|
|
||||||
**Location:** `~/.codex/superpowers/.codex/superpowers-codex`
|
|
||||||
|
|
||||||
A Node.js CLI script that provides three commands:
|
|
||||||
- `bootstrap` - Load complete bootstrap with all skills
|
|
||||||
- `use-skill <name>` - Load a specific skill
|
|
||||||
- `find-skills` - List all available skills
|
|
||||||
|
|
||||||
### Shared Core Module
|
|
||||||
|
|
||||||
**Location:** `~/.codex/superpowers/lib/skills-core.js`
|
|
||||||
|
|
||||||
The Codex implementation uses the shared `skills-core` module (ES module format) for skill discovery and parsing. This is the same module used by the OpenCode plugin, ensuring consistent behavior across platforms.
|
|
||||||
|
|
||||||
### Tool Mapping
|
|
||||||
|
|
||||||
Skills written for Claude Code are adapted for Codex with these mappings:
|
|
||||||
|
|
||||||
- `TodoWrite` → `update_plan`
|
|
||||||
- `Task` with subagents → Tell user subagents aren't available, do work directly
|
|
||||||
- `Skill` tool → `~/.codex/superpowers/.codex/superpowers-codex use-skill`
|
|
||||||
- File operations → Native Codex tools
|
|
||||||
|
|
||||||
## Updating
|
## Updating
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/.codex/superpowers
|
cd ~/.codex/superpowers && git pull
|
||||||
git pull
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Skills update instantly through the symlink.
|
||||||
|
|
||||||
|
## Uninstalling
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rm ~/.agents/skills/superpowers
|
||||||
|
```
|
||||||
|
|
||||||
|
**Windows (PowerShell):**
|
||||||
|
```powershell
|
||||||
|
Remove-Item "$env:USERPROFILE\.agents\skills\superpowers"
|
||||||
|
```
|
||||||
|
|
||||||
|
Optionally delete the clone: `rm -rf ~/.codex/superpowers` (Windows: `Remove-Item -Recurse -Force "$env:USERPROFILE\.codex\superpowers"`).
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### Skills not found
|
### Skills not showing up
|
||||||
|
|
||||||
1. Verify installation: `ls ~/.codex/superpowers/skills`
|
1. Verify the symlink: `ls -la ~/.agents/skills/superpowers`
|
||||||
2. Check CLI works: `~/.codex/superpowers/.codex/superpowers-codex find-skills`
|
2. Check skills exist: `ls ~/.codex/superpowers/skills`
|
||||||
3. Verify skills have SKILL.md files
|
3. Restart Codex — skills are discovered at startup
|
||||||
|
|
||||||
### CLI script not executable
|
### Windows junction issues
|
||||||
|
|
||||||
```bash
|
Junctions normally work without special permissions. If creation fails, try running PowerShell as administrator.
|
||||||
chmod +x ~/.codex/superpowers/.codex/superpowers-codex
|
|
||||||
```
|
|
||||||
|
|
||||||
### Node.js errors
|
|
||||||
|
|
||||||
The CLI script requires Node.js. Verify:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
node --version
|
|
||||||
```
|
|
||||||
|
|
||||||
Should show v14 or higher (v18+ recommended for ES module support).
|
|
||||||
|
|
||||||
## Getting Help
|
## Getting Help
|
||||||
|
|
||||||
- Report issues: https://github.com/obra/superpowers/issues
|
- Report issues: https://github.com/obra/superpowers/issues
|
||||||
- Main documentation: https://github.com/obra/superpowers
|
- Main documentation: https://github.com/obra/superpowers
|
||||||
- Blog post: https://blog.fsck.com/2025/10/27/skills-for-openai-codex/
|
|
||||||
|
|
||||||
## Note
|
|
||||||
|
|
||||||
Codex support is experimental and may require refinement based on user feedback. If you encounter issues, please report them on GitHub.
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
"hooks": [
|
"hooks": [
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh"
|
"command": "'${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd' session-start",
|
||||||
|
"async": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,43 +1,46 @@
|
|||||||
: << 'CMDBLOCK'
|
: << 'CMDBLOCK'
|
||||||
@echo off
|
@echo off
|
||||||
REM ============================================================================
|
REM Cross-platform polyglot wrapper for hook scripts.
|
||||||
REM DEPRECATED: This polyglot wrapper is no longer used as of Claude Code 2.1.x
|
REM On Windows: cmd.exe runs the batch portion, which finds and calls bash.
|
||||||
REM ============================================================================
|
REM On Unix: the shell interprets this as a script (: is a no-op in bash).
|
||||||
REM
|
REM
|
||||||
REM Claude Code 2.1.x changed the Windows execution model for hooks:
|
REM Hook scripts use extensionless filenames (e.g. "session-start" not
|
||||||
|
REM "session-start.sh") so Claude Code's Windows auto-detection -- which
|
||||||
|
REM prepends "bash" to any command containing .sh -- doesn't interfere.
|
||||||
REM
|
REM
|
||||||
REM Before (2.0.x): Hooks ran with shell:true, using the system default shell.
|
|
||||||
REM This wrapper provided cross-platform compatibility by
|
|
||||||
REM being both a valid .cmd file (Windows) and bash script.
|
|
||||||
REM
|
|
||||||
REM After (2.1.x): Claude Code now auto-detects .sh files in hook commands
|
|
||||||
REM and prepends "bash " on Windows. This broke the wrapper
|
|
||||||
REM because the command:
|
|
||||||
REM "run-hook.cmd" session-start.sh
|
|
||||||
REM became:
|
|
||||||
REM bash "run-hook.cmd" session-start.sh
|
|
||||||
REM ...and bash cannot execute a .cmd file.
|
|
||||||
REM
|
|
||||||
REM The fix: hooks.json now calls session-start.sh directly. Claude Code 2.1.x
|
|
||||||
REM handles the bash invocation automatically on Windows.
|
|
||||||
REM
|
|
||||||
REM This file is kept for reference and potential backward compatibility.
|
|
||||||
REM ============================================================================
|
|
||||||
REM
|
|
||||||
REM Original purpose: Polyglot wrapper to run .sh scripts cross-platform
|
|
||||||
REM Usage: run-hook.cmd <script-name> [args...]
|
REM Usage: run-hook.cmd <script-name> [args...]
|
||||||
REM The script should be in the same directory as this wrapper
|
|
||||||
|
|
||||||
if "%~1"=="" (
|
if "%~1"=="" (
|
||||||
echo run-hook.cmd: missing script name >&2
|
echo run-hook.cmd: missing script name >&2
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
"C:\Program Files\Git\bin\bash.exe" -l "%~dp0%~1" %2 %3 %4 %5 %6 %7 %8 %9
|
|
||||||
exit /b
|
set "HOOK_DIR=%~dp0"
|
||||||
|
|
||||||
|
REM Try Git for Windows bash in standard locations
|
||||||
|
if exist "C:\Program Files\Git\bin\bash.exe" (
|
||||||
|
"C:\Program Files\Git\bin\bash.exe" "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
if exist "C:\Program Files (x86)\Git\bin\bash.exe" (
|
||||||
|
"C:\Program Files (x86)\Git\bin\bash.exe" "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Try bash on PATH (e.g. user-installed Git Bash, MSYS2, Cygwin)
|
||||||
|
where bash >nul 2>nul
|
||||||
|
if %ERRORLEVEL% equ 0 (
|
||||||
|
bash "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
|
||||||
|
REM No bash found - exit silently rather than error
|
||||||
|
REM (plugin still works, just without SessionStart context injection)
|
||||||
|
exit /b 0
|
||||||
CMDBLOCK
|
CMDBLOCK
|
||||||
|
|
||||||
# Unix shell runs from here
|
# Unix: run the named script directly
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
SCRIPT_NAME="$1"
|
SCRIPT_NAME="$1"
|
||||||
shift
|
shift
|
||||||
"${SCRIPT_DIR}/${SCRIPT_NAME}" "$@"
|
exec bash "${SCRIPT_DIR}/${SCRIPT_NAME}" "$@"
|
||||||
|
|||||||
@@ -17,34 +17,33 @@ fi
|
|||||||
# Read using-superpowers content
|
# Read using-superpowers content
|
||||||
using_superpowers_content=$(cat "${PLUGIN_ROOT}/skills/using-superpowers/SKILL.md" 2>&1 || echo "Error reading using-superpowers skill")
|
using_superpowers_content=$(cat "${PLUGIN_ROOT}/skills/using-superpowers/SKILL.md" 2>&1 || echo "Error reading using-superpowers skill")
|
||||||
|
|
||||||
# Escape outputs for JSON using pure bash
|
# Escape string for JSON embedding using bash parameter substitution.
|
||||||
|
# Each ${s//old/new} is a single C-level pass - orders of magnitude
|
||||||
|
# faster than the character-by-character loop this replaces.
|
||||||
escape_for_json() {
|
escape_for_json() {
|
||||||
local input="$1"
|
local s="$1"
|
||||||
local output=""
|
s="${s//\\/\\\\}"
|
||||||
local i char
|
s="${s//\"/\\\"}"
|
||||||
for (( i=0; i<${#input}; i++ )); do
|
s="${s//$'\n'/\\n}"
|
||||||
char="${input:$i:1}"
|
s="${s//$'\r'/\\r}"
|
||||||
case "$char" in
|
s="${s//$'\t'/\\t}"
|
||||||
$'\\') output+='\\' ;;
|
printf '%s' "$s"
|
||||||
'"') output+='\"' ;;
|
|
||||||
$'\n') output+='\n' ;;
|
|
||||||
$'\r') output+='\r' ;;
|
|
||||||
$'\t') output+='\t' ;;
|
|
||||||
*) output+="$char" ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
printf '%s' "$output"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using_superpowers_escaped=$(escape_for_json "$using_superpowers_content")
|
using_superpowers_escaped=$(escape_for_json "$using_superpowers_content")
|
||||||
warning_escaped=$(escape_for_json "$warning_message")
|
warning_escaped=$(escape_for_json "$warning_message")
|
||||||
|
session_context="<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Below is the full content of your 'superpowers:using-superpowers' skill - your introduction to using skills. For all other skills, use the 'Skill' tool:**\n\n${using_superpowers_escaped}\n\n${warning_escaped}\n</EXTREMELY_IMPORTANT>"
|
||||||
|
|
||||||
# Output context injection as JSON
|
# Output context injection as JSON.
|
||||||
|
# Keep both shapes for compatibility:
|
||||||
|
# - Cursor hooks expect additional_context.
|
||||||
|
# - Claude hooks expect hookSpecificOutput.additionalContext.
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
{
|
{
|
||||||
|
"additional_context": "${session_context}",
|
||||||
"hookSpecificOutput": {
|
"hookSpecificOutput": {
|
||||||
"hookEventName": "SessionStart",
|
"hookEventName": "SessionStart",
|
||||||
"additionalContext": "<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Below is the full content of your 'superpowers:using-superpowers' skill - your introduction to using skills. For all other skills, use the 'Skill' tool:**\n\n${using_superpowers_escaped}\n\n${warning_escaped}\n</EXTREMELY_IMPORTANT>"
|
"additionalContext": "${session_context}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
@@ -9,7 +9,50 @@ description: "You MUST use this before any creative work - creating features, bu
|
|||||||
|
|
||||||
Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
|
Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
|
||||||
|
|
||||||
Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design in small sections (200-300 words), checking after each section whether it looks right so far.
|
Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design and get user approval.
|
||||||
|
|
||||||
|
<HARD-GATE>
|
||||||
|
Do NOT invoke any implementation skill, write any code, scaffold any project, or take any implementation action until you have presented a design and the user has approved it. This applies to EVERY project regardless of perceived simplicity.
|
||||||
|
</HARD-GATE>
|
||||||
|
|
||||||
|
## Anti-Pattern: "This Is Too Simple To Need A Design"
|
||||||
|
|
||||||
|
Every project goes through this process. A todo list, a single-function utility, a config change — all of them. "Simple" projects are where unexamined assumptions cause the most wasted work. The design can be short (a few sentences for truly simple projects), but you MUST present it and get approval.
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
You MUST create a task for each of these items and complete them in order:
|
||||||
|
|
||||||
|
1. **Explore project context** — check files, docs, recent commits
|
||||||
|
2. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
|
||||||
|
3. **Propose 2-3 approaches** — with trade-offs and your recommendation
|
||||||
|
4. **Present design** — in sections scaled to their complexity, get user approval after each section
|
||||||
|
5. **Write design doc** — save to `docs/plans/YYYY-MM-DD-<topic>-design.md` and commit
|
||||||
|
6. **Transition to implementation** — invoke writing-plans skill to create implementation plan
|
||||||
|
|
||||||
|
## Process Flow
|
||||||
|
|
||||||
|
```dot
|
||||||
|
digraph brainstorming {
|
||||||
|
"Explore project context" [shape=box];
|
||||||
|
"Ask clarifying questions" [shape=box];
|
||||||
|
"Propose 2-3 approaches" [shape=box];
|
||||||
|
"Present design sections" [shape=box];
|
||||||
|
"User approves design?" [shape=diamond];
|
||||||
|
"Write design doc" [shape=box];
|
||||||
|
"Invoke writing-plans skill" [shape=doublecircle];
|
||||||
|
|
||||||
|
"Explore project context" -> "Ask clarifying questions";
|
||||||
|
"Ask clarifying questions" -> "Propose 2-3 approaches";
|
||||||
|
"Propose 2-3 approaches" -> "Present design sections";
|
||||||
|
"Present design sections" -> "User approves design?";
|
||||||
|
"User approves design?" -> "Present design sections" [label="no, revise"];
|
||||||
|
"User approves design?" -> "Write design doc" [label="yes"];
|
||||||
|
"Write design doc" -> "Invoke writing-plans skill";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**The terminal state is invoking writing-plans.** Do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skill you invoke after brainstorming is writing-plans.
|
||||||
|
|
||||||
## The Process
|
## The Process
|
||||||
|
|
||||||
@@ -27,7 +70,7 @@ Start by understanding the current project context, then ask questions one at a
|
|||||||
|
|
||||||
**Presenting the design:**
|
**Presenting the design:**
|
||||||
- Once you believe you understand what you're building, present the design
|
- Once you believe you understand what you're building, present the design
|
||||||
- Break it into sections of 200-300 words
|
- Scale each section to its complexity: a few sentences if straightforward, up to 200-300 words if nuanced
|
||||||
- Ask after each section whether it looks right so far
|
- Ask after each section whether it looks right so far
|
||||||
- Cover: architecture, components, data flow, error handling, testing
|
- Cover: architecture, components, data flow, error handling, testing
|
||||||
- Be ready to go back and clarify if something doesn't make sense
|
- Be ready to go back and clarify if something doesn't make sense
|
||||||
@@ -39,10 +82,9 @@ Start by understanding the current project context, then ask questions one at a
|
|||||||
- Use elements-of-style:writing-clearly-and-concisely skill if available
|
- Use elements-of-style:writing-clearly-and-concisely skill if available
|
||||||
- Commit the design document to git
|
- Commit the design document to git
|
||||||
|
|
||||||
**Implementation (if continuing):**
|
**Implementation:**
|
||||||
- Ask: "Ready to set up for implementation?"
|
- Invoke the writing-plans skill to create a detailed implementation plan
|
||||||
- Use superpowers:using-git-worktrees to create isolated workspace
|
- Do NOT invoke any other skill. writing-plans is the next step.
|
||||||
- Use superpowers:writing-plans to create detailed implementation plan
|
|
||||||
|
|
||||||
## Key Principles
|
## Key Principles
|
||||||
|
|
||||||
@@ -50,5 +92,5 @@ Start by understanding the current project context, then ask questions one at a
|
|||||||
- **Multiple choice preferred** - Easier to answer than open-ended when possible
|
- **Multiple choice preferred** - Easier to answer than open-ended when possible
|
||||||
- **YAGNI ruthlessly** - Remove unnecessary features from all designs
|
- **YAGNI ruthlessly** - Remove unnecessary features from all designs
|
||||||
- **Explore alternatives** - Always propose 2-3 approaches before settling
|
- **Explore alternatives** - Always propose 2-3 approaches before settling
|
||||||
- **Incremental validation** - Present design in sections, validate each
|
- **Incremental validation** - Present design, get approval before moving on
|
||||||
- **Be flexible** - Go back and clarify when something doesn't make sense
|
- **Be flexible** - Go back and clarify when something doesn't make sense
|
||||||
|
|||||||
@@ -74,3 +74,11 @@ After all tasks complete and verified:
|
|||||||
- Reference skills when plan says to
|
- Reference skills when plan says to
|
||||||
- Between batches: just report and wait
|
- Between batches: just report and wait
|
||||||
- Stop when blocked, don't guess
|
- Stop when blocked, don't guess
|
||||||
|
- Never start implementation on main/master branch without explicit user consent
|
||||||
|
|
||||||
|
## Integration
|
||||||
|
|
||||||
|
**Required workflow skills:**
|
||||||
|
- **superpowers:using-git-worktrees** - REQUIRED: Set up isolated workspace before starting
|
||||||
|
- **superpowers:writing-plans** - Creates the plan this skill executes
|
||||||
|
- **superpowers:finishing-a-development-branch** - Complete development after all tasks
|
||||||
|
|||||||
@@ -199,6 +199,7 @@ Done!
|
|||||||
## Red Flags
|
## Red Flags
|
||||||
|
|
||||||
**Never:**
|
**Never:**
|
||||||
|
- Start implementation on main/master branch without explicit user consent
|
||||||
- Skip reviews (spec compliance OR code quality)
|
- Skip reviews (spec compliance OR code quality)
|
||||||
- Proceed with unfixed issues
|
- Proceed with unfixed issues
|
||||||
- Dispatch multiple implementation subagents in parallel (conflicts)
|
- Dispatch multiple implementation subagents in parallel (conflicts)
|
||||||
@@ -229,6 +230,7 @@ Done!
|
|||||||
## Integration
|
## Integration
|
||||||
|
|
||||||
**Required workflow skills:**
|
**Required workflow skills:**
|
||||||
|
- **superpowers:using-git-worktrees** - REQUIRED: Set up isolated workspace before starting
|
||||||
- **superpowers:writing-plans** - Creates the plan this skill executes
|
- **superpowers:writing-plans** - Creates the plan this skill executes
|
||||||
- **superpowers:requesting-code-review** - Code review template for reviewer subagents
|
- **superpowers:requesting-code-review** - Code review template for reviewer subagents
|
||||||
- **superpowers:finishing-a-development-branch** - Complete development after all tasks
|
- **superpowers:finishing-a-development-branch** - Complete development after all tasks
|
||||||
|
|||||||
@@ -210,8 +210,9 @@ Ready to implement auth feature
|
|||||||
|
|
||||||
**Called by:**
|
**Called by:**
|
||||||
- **brainstorming** (Phase 4) - REQUIRED when design is approved and implementation follows
|
- **brainstorming** (Phase 4) - REQUIRED when design is approved and implementation follows
|
||||||
|
- **subagent-driven-development** - REQUIRED before executing any tasks
|
||||||
|
- **executing-plans** - REQUIRED before executing any tasks
|
||||||
- Any skill needing isolated workspace
|
- Any skill needing isolated workspace
|
||||||
|
|
||||||
**Pairs with:**
|
**Pairs with:**
|
||||||
- **finishing-a-development-branch** - REQUIRED for cleanup after work complete
|
- **finishing-a-development-branch** - REQUIRED for cleanup after work complete
|
||||||
- **executing-plans** or **subagent-driven-development** - Work happens in this worktree
|
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ This is not negotiable. This is not optional. You cannot rationalize your way ou
|
|||||||
```dot
|
```dot
|
||||||
digraph skill_flow {
|
digraph skill_flow {
|
||||||
"User message received" [shape=doublecircle];
|
"User message received" [shape=doublecircle];
|
||||||
|
"About to EnterPlanMode?" [shape=doublecircle];
|
||||||
|
"Already brainstormed?" [shape=diamond];
|
||||||
|
"Invoke brainstorming skill" [shape=box];
|
||||||
"Might any skill apply?" [shape=diamond];
|
"Might any skill apply?" [shape=diamond];
|
||||||
"Invoke Skill tool" [shape=box];
|
"Invoke Skill tool" [shape=box];
|
||||||
"Announce: 'Using [skill] to [purpose]'" [shape=box];
|
"Announce: 'Using [skill] to [purpose]'" [shape=box];
|
||||||
@@ -34,6 +37,11 @@ digraph skill_flow {
|
|||||||
"Follow skill exactly" [shape=box];
|
"Follow skill exactly" [shape=box];
|
||||||
"Respond (including clarifications)" [shape=doublecircle];
|
"Respond (including clarifications)" [shape=doublecircle];
|
||||||
|
|
||||||
|
"About to EnterPlanMode?" -> "Already brainstormed?";
|
||||||
|
"Already brainstormed?" -> "Invoke brainstorming skill" [label="no"];
|
||||||
|
"Already brainstormed?" -> "Might any skill apply?" [label="yes"];
|
||||||
|
"Invoke brainstorming skill" -> "Might any skill apply?";
|
||||||
|
|
||||||
"User message received" -> "Might any skill apply?";
|
"User message received" -> "Might any skill apply?";
|
||||||
"Might any skill apply?" -> "Invoke Skill tool" [label="yes, even 1%"];
|
"Might any skill apply?" -> "Invoke Skill tool" [label="yes, even 1%"];
|
||||||
"Might any skill apply?" -> "Respond (including clarifications)" [label="definitely not"];
|
"Might any skill apply?" -> "Respond (including clarifications)" [label="definitely not"];
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ Assume they are a skilled developer, but know almost nothing about our toolset o
|
|||||||
|
|
||||||
## Task Structure
|
## Task Structure
|
||||||
|
|
||||||
```markdown
|
````markdown
|
||||||
### Task N: [Component Name]
|
### Task N: [Component Name]
|
||||||
|
|
||||||
**Files:**
|
**Files:**
|
||||||
@@ -85,7 +85,7 @@ Expected: PASS
|
|||||||
git add tests/path/test.py src/path/file.py
|
git add tests/path/test.py src/path/file.py
|
||||||
git commit -m "feat: add specific feature"
|
git commit -m "feat: add specific feature"
|
||||||
```
|
```
|
||||||
```
|
````
|
||||||
|
|
||||||
## Remember
|
## Remember
|
||||||
- Exact file paths always
|
- Exact file paths always
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ description: Use when creating new skills, editing existing skills, or verifying
|
|||||||
|
|
||||||
**Writing skills IS Test-Driven Development applied to process documentation.**
|
**Writing skills IS Test-Driven Development applied to process documentation.**
|
||||||
|
|
||||||
**Personal skills live in agent-specific directories (`~/.claude/skills` for Claude Code, `~/.codex/skills` for Codex)**
|
**Personal skills live in agent-specific directories (`~/.claude/skills` for Claude Code, `~/.agents/skills/` for Codex)**
|
||||||
|
|
||||||
You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).
|
You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ echo "Test 1: Skill loading..."
|
|||||||
|
|
||||||
output=$(run_claude "What is the subagent-driven-development skill? Describe its key steps briefly." 30)
|
output=$(run_claude "What is the subagent-driven-development skill? Describe its key steps briefly." 30)
|
||||||
|
|
||||||
if assert_contains "$output" "subagent-driven-development" "Skill is recognized"; then
|
if assert_contains "$output" "subagent-driven-development\|Subagent-Driven Development\|Subagent Driven" "Skill is recognized"; then
|
||||||
: # pass
|
: # pass
|
||||||
else
|
else
|
||||||
exit 1
|
exit 1
|
||||||
@@ -136,4 +136,30 @@ fi
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
# Test 8: Verify worktree requirement
|
||||||
|
echo "Test 8: Worktree requirement..."
|
||||||
|
|
||||||
|
output=$(run_claude "What workflow skills are required before using subagent-driven-development? List any prerequisites or required skills." 30)
|
||||||
|
|
||||||
|
if assert_contains "$output" "using-git-worktrees\|worktree" "Mentions worktree requirement"; then
|
||||||
|
: # pass
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Test 9: Verify main branch warning
|
||||||
|
echo "Test 9: Main branch red flag..."
|
||||||
|
|
||||||
|
output=$(run_claude "In subagent-driven-development, is it okay to start implementation directly on the main branch?" 30)
|
||||||
|
|
||||||
|
if assert_contains "$output" "worktree\|feature.*branch\|not.*main\|never.*main\|avoid.*main\|don't.*main\|consent\|permission" "Warns against main branch"; then
|
||||||
|
: # pass
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
echo "=== All subagent-driven-development skill tests passed ==="
|
echo "=== All subagent-driven-development skill tests passed ==="
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ claude -p "$PROMPT" \
|
|||||||
--plugin-dir "$PLUGIN_DIR" \
|
--plugin-dir "$PLUGIN_DIR" \
|
||||||
--dangerously-skip-permissions \
|
--dangerously-skip-permissions \
|
||||||
--output-format stream-json \
|
--output-format stream-json \
|
||||||
|
--verbose \
|
||||||
> "$LOG_FILE" 2>&1 || true
|
> "$LOG_FILE" 2>&1 || true
|
||||||
|
|
||||||
# Extract final stats
|
# Extract final stats
|
||||||
|
|||||||
Reference in New Issue
Block a user