mirror of
https://github.com/obra/superpowers.git
synced 2026-04-23 09:59:05 +08:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b187e75a1e | ||
|
|
8674dc0868 | ||
|
|
42d44ceaf9 | ||
|
|
d46dddd32c | ||
|
|
b1fa6a1a46 | ||
|
|
8e38ab86dc | ||
|
|
31fd764285 | ||
|
|
e3208f1d93 | ||
|
|
1d21ee842d | ||
|
|
aa8c6b4fd0 | ||
|
|
22f57e7cb0 | ||
|
|
da9f4f1edd | ||
|
|
5831c4dfea | ||
|
|
26487902f8 |
@@ -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": "3.2.2",
|
"version": "3.4.0",
|
||||||
"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": "3.2.3",
|
"version": "3.4.1",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Jesse Vincent",
|
"name": "Jesse Vincent",
|
||||||
"email": "jesse@fsck.com"
|
"email": "jesse@fsck.com"
|
||||||
|
|||||||
35
.codex/INSTALL.md
Normal file
35
.codex/INSTALL.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Installing Superpowers for Codex
|
||||||
|
|
||||||
|
Quick setup to enable superpowers skills in Codex.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. **Clone superpowers repository**:
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/.codex/superpowers
|
||||||
|
cd ~/.codex/superpowers
|
||||||
|
git clone https://github.com/obra/superpowers.git .
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Create personal skills directory**:
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/.codex/skills
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Update ~/.codex/AGENTS.md** to include this superpowers section:
|
||||||
|
```markdown
|
||||||
|
## Superpowers System
|
||||||
|
|
||||||
|
<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
|
||||||
|
|
||||||
|
Test the installation:
|
||||||
|
```bash
|
||||||
|
~/.codex/superpowers/.codex/superpowers-codex bootstrap
|
||||||
|
```
|
||||||
|
|
||||||
|
You should see skill listings and bootstrap instructions. The system is now ready for use.
|
||||||
33
.codex/superpowers-bootstrap.md
Normal file
33
.codex/superpowers-bootstrap.md
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# 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>
|
||||||
388
.codex/superpowers-codex
Executable file
388
.codex/superpowers-codex
Executable file
@@ -0,0 +1,388 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const os = require('os');
|
||||||
|
const { execSync } = require('child_process');
|
||||||
|
|
||||||
|
// 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 checkForUpdates() {
|
||||||
|
try {
|
||||||
|
// Quick check with 3 second timeout to avoid delays if network is down
|
||||||
|
const output = execSync('git fetch origin && git status --porcelain=v1 --branch', {
|
||||||
|
cwd: superpowersRepoDir,
|
||||||
|
timeout: 3000,
|
||||||
|
encoding: 'utf8',
|
||||||
|
stdio: 'pipe'
|
||||||
|
});
|
||||||
|
|
||||||
|
// Parse git status output to see if we're behind
|
||||||
|
const statusLines = output.split('\n');
|
||||||
|
for (const line of statusLines) {
|
||||||
|
if (line.startsWith('## ') && line.includes('[behind ')) {
|
||||||
|
return true; // We're behind remote
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false; // Up to date
|
||||||
|
} catch (error) {
|
||||||
|
// Network down, git error, timeout, etc. - don't block bootstrap
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function extractFrontmatter(filePath) {
|
||||||
|
try {
|
||||||
|
const content = fs.readFileSync(filePath, 'utf8');
|
||||||
|
const lines = content.split('\n');
|
||||||
|
|
||||||
|
let inFrontmatter = false;
|
||||||
|
let name = '';
|
||||||
|
let description = '';
|
||||||
|
let whenToUse = '';
|
||||||
|
|
||||||
|
for (const line of lines) {
|
||||||
|
if (line.trim() === '---') {
|
||||||
|
if (inFrontmatter) break;
|
||||||
|
inFrontmatter = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inFrontmatter) {
|
||||||
|
const match = line.match(/^(\w+):\s*(.*)$/);
|
||||||
|
if (match) {
|
||||||
|
const [, key, value] = match;
|
||||||
|
switch (key) {
|
||||||
|
case 'name': name = value.trim(); break;
|
||||||
|
case 'description': description = value.trim(); break;
|
||||||
|
case 'when_to_use': whenToUse = value.trim(); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { name, description, whenToUse };
|
||||||
|
} catch (error) {
|
||||||
|
return { name: '', description: '', whenToUse: '' };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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, whenToUse } = extractFrontmatter(skillFile);
|
||||||
|
|
||||||
|
if (description) console.log(` ${description}`);
|
||||||
|
if (whenToUse) console.log(` When to use: ${whenToUse}`);
|
||||||
|
console.log('');
|
||||||
|
}
|
||||||
|
|
||||||
|
function findSkillsInDir(dir, sourceType, maxDepth = 1) {
|
||||||
|
const skills = [];
|
||||||
|
|
||||||
|
if (!fs.existsSync(dir)) return skills;
|
||||||
|
|
||||||
|
function searchDir(currentDir, currentDepth) {
|
||||||
|
if (currentDepth > maxDepth) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
|
||||||
|
|
||||||
|
for (const entry of entries) {
|
||||||
|
if (entry.isDirectory()) {
|
||||||
|
const skillDir = path.join(currentDir, entry.name);
|
||||||
|
const skillFile = path.join(skillDir, 'SKILL.md');
|
||||||
|
|
||||||
|
if (fs.existsSync(skillFile)) {
|
||||||
|
skills.push(skillDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
// For personal skills, search deeper (category/skill structure)
|
||||||
|
if (sourceType === 'personal' && currentDepth < maxDepth) {
|
||||||
|
searchDir(skillDir, currentDepth + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// Ignore permission errors or other issues
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
searchDir(dir, 0);
|
||||||
|
return skills;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Commands
|
||||||
|
function runFindSkills() {
|
||||||
|
console.log('Available skills:');
|
||||||
|
console.log('==================');
|
||||||
|
console.log('');
|
||||||
|
|
||||||
|
const foundSkills = new Set();
|
||||||
|
|
||||||
|
// Find personal skills first (these take precedence)
|
||||||
|
const personalSkills = findSkillsInDir(personalSkillsDir, 'personal', 2);
|
||||||
|
for (const skillPath of personalSkills) {
|
||||||
|
const relPath = path.relative(personalSkillsDir, skillPath);
|
||||||
|
foundSkills.add(relPath);
|
||||||
|
printSkill(skillPath, 'personal');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find superpowers skills (only if not already found in personal)
|
||||||
|
const superpowersSkills = findSkillsInDir(superpowersSkillsDir, 'superpowers', 1);
|
||||||
|
for (const skillPath of superpowersSkills) {
|
||||||
|
const relPath = path.relative(superpowersSkillsDir, skillPath);
|
||||||
|
if (!foundSkills.has(relPath)) {
|
||||||
|
printSkill(skillPath, '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 (checkForUpdates()) {
|
||||||
|
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
|
||||||
|
let content, frontmatter;
|
||||||
|
try {
|
||||||
|
const fullContent = fs.readFileSync(skillFile, 'utf8');
|
||||||
|
const { name, description, whenToUse } = extractFrontmatter(skillFile);
|
||||||
|
|
||||||
|
// Extract just the content after frontmatter
|
||||||
|
const lines = fullContent.split('\n');
|
||||||
|
let inFrontmatter = false;
|
||||||
|
let frontmatterEnded = false;
|
||||||
|
const contentLines = [];
|
||||||
|
|
||||||
|
for (const line of lines) {
|
||||||
|
if (line.trim() === '---') {
|
||||||
|
if (inFrontmatter) {
|
||||||
|
frontmatterEnded = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
inFrontmatter = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (frontmatterEnded || !inFrontmatter) {
|
||||||
|
contentLines.push(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
content = contentLines.join('\n').trim();
|
||||||
|
frontmatter = { name, description, whenToUse };
|
||||||
|
} 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}`);
|
||||||
|
}
|
||||||
|
if (frontmatter.whenToUse) {
|
||||||
|
console.log(`# When to use: ${frontmatter.whenToUse}`);
|
||||||
|
}
|
||||||
|
console.log(`# Supporting tools and docs are 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;
|
||||||
|
}
|
||||||
10
README.md
10
README.md
@@ -1,6 +1,6 @@
|
|||||||
# Superpowers
|
# Superpowers
|
||||||
|
|
||||||
Give Claude Code superpowers with a comprehensive skills library of proven techniques, patterns, and workflows.
|
A comprehensive skills library of proven techniques, patterns, and workflows for AI coding assistants.
|
||||||
|
|
||||||
## What You Get
|
## What You Get
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ Read the introduction: [Superpowers for Claude Code](https://blog.fsck.com/2025/
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Via Plugin Marketplace (Recommended)
|
### Claude Code (via Plugin Marketplace)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# In Claude Code
|
# In Claude Code
|
||||||
@@ -41,6 +41,12 @@ Read the introduction: [Superpowers for Claude Code](https://blog.fsck.com/2025/
|
|||||||
# /superpowers:execute-plan - Execute plan in batches
|
# /superpowers:execute-plan - Execute plan in batches
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Codex (Experimental)
|
||||||
|
|
||||||
|
**Note:** Codex support is experimental and may require refinement based on user feedback.
|
||||||
|
|
||||||
|
Tell Codex to fetch https://raw.githubusercontent.com/obra/superpowers/refs/heads/main/.codex/INSTALL.md and follow the instructions.
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
### Using Slash Commands
|
### Using Slash Commands
|
||||||
|
|||||||
@@ -1,5 +1,56 @@
|
|||||||
# Superpowers Release Notes
|
# Superpowers Release Notes
|
||||||
|
|
||||||
|
## v3.4.1 (2025-10-31)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- Optimized superpowers bootstrap to eliminate redundant skill execution. The `using-superpowers` skill content is now provided directly in session context, with clear guidance to use the Skill tool only for other skills. This reduces overhead and prevents the confusing loop where agents would execute `using-superpowers` manually despite already having the content from session start.
|
||||||
|
|
||||||
|
## v3.4.0 (2025-10-30)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- Simplified `brainstorming` skill to return to original conversational vision. Removed heavyweight 6-phase process with formal checklists in favor of natural dialogue: ask questions one at a time, then present design in 200-300 word sections with validation. Keeps documentation and implementation handoff features.
|
||||||
|
|
||||||
|
## v3.3.1 (2025-10-28)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- Updated `brainstorming` skill to require autonomous recon before questioning, encourage recommendation-driven decisions, and prevent agents from delegating prioritization back to humans.
|
||||||
|
- Applied writing clarity improvements to `brainstorming` skill following Strunk's "Elements of Style" principles (omitted needless words, converted negative to positive form, improved parallel construction).
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Clarified `writing-skills` guidance so it points to the correct agent-specific personal skill directories (`~/.claude/skills` for Claude Code, `~/.codex/skills` for Codex).
|
||||||
|
|
||||||
|
## v3.3.0 (2025-10-28)
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
**Experimental Codex Support**
|
||||||
|
- Added unified `superpowers-codex` script with bootstrap/use-skill/find-skills commands
|
||||||
|
- Cross-platform Node.js implementation (works on Windows, macOS, Linux)
|
||||||
|
- Namespaced skills: `superpowers:skill-name` for superpowers skills, `skill-name` for personal
|
||||||
|
- Personal skills override superpowers skills when names match
|
||||||
|
- Clean skill display: shows name/description without raw frontmatter
|
||||||
|
- Helpful context: shows supporting files directory for each skill
|
||||||
|
- Tool mapping for Codex: TodoWrite→update_plan, subagents→manual fallback, etc.
|
||||||
|
- Bootstrap integration with minimal AGENTS.md for automatic startup
|
||||||
|
- Complete installation guide and bootstrap instructions specific to Codex
|
||||||
|
|
||||||
|
**Key differences from Claude Code integration:**
|
||||||
|
- Single unified script instead of separate tools
|
||||||
|
- Tool substitution system for Codex-specific equivalents
|
||||||
|
- Simplified subagent handling (manual work instead of delegation)
|
||||||
|
- Updated terminology: "Superpowers skills" instead of "Core skills"
|
||||||
|
|
||||||
|
### Files Added
|
||||||
|
- `codex/INSTALL.md` - Installation guide for Codex users
|
||||||
|
- `codex/superpowers-bootstrap.md` - Bootstrap instructions with Codex adaptations
|
||||||
|
- `scripts/superpowers-codex` - Unified Node.js executable with all functionality
|
||||||
|
|
||||||
|
**Note:** Codex support is experimental. The integration provides core superpowers functionality but may require refinement based on user feedback.
|
||||||
|
|
||||||
## v3.2.3 (2025-10-23)
|
## v3.2.3 (2025-10-23)
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ cat <<EOF
|
|||||||
{
|
{
|
||||||
"hookSpecificOutput": {
|
"hookSpecificOutput": {
|
||||||
"hookEventName": "SessionStart",
|
"hookEventName": "SessionStart",
|
||||||
"additionalContext": "<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**The content below is from skills/using-superpowers/SKILL.md - your introduction to using skills:**\n\n${using_superpowers_escaped}\n\n${warning_escaped}\n</EXTREMELY_IMPORTANT>"
|
"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>"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
@@ -1,165 +1,54 @@
|
|||||||
---
|
---
|
||||||
name: brainstorming
|
name: brainstorming
|
||||||
description: Use when creating or developing anything, before writing code or implementation plans - refines rough ideas into fully-formed designs through structured Socratic questioning, alternative exploration, and incremental validation
|
description: Use when creating or developing, before writing code or implementation plans - refines rough ideas into fully-formed designs through collaborative questioning, alternative exploration, and incremental validation. Don't use during clear 'mechanical' processes
|
||||||
---
|
---
|
||||||
|
|
||||||
# Brainstorming Ideas Into Designs
|
# Brainstorming Ideas Into Designs
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Transform rough ideas into fully-formed designs through structured questioning and alternative exploration.
|
Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
|
||||||
|
|
||||||
**Core principle:** Ask questions to understand, explore alternatives, present design incrementally for validation.
|
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.
|
||||||
|
|
||||||
**Announce at start:** "I'm using the brainstorming skill to refine your idea into a design."
|
|
||||||
|
|
||||||
## Quick Reference
|
|
||||||
|
|
||||||
| Phase | Key Activities | Tool Usage | Output |
|
|
||||||
|-------|---------------|------------|--------|
|
|
||||||
| **1. Understanding** | Ask questions (one at a time) | AskUserQuestion for choices | Purpose, constraints, criteria |
|
|
||||||
| **2. Exploration** | Propose 2-3 approaches | AskUserQuestion for approach selection | Architecture options with trade-offs |
|
|
||||||
| **3. Design Presentation** | Present in 200-300 word sections | Open-ended questions | Complete design with validation |
|
|
||||||
| **4. Design Documentation** | Write design document | writing-clearly-and-concisely skill | Design doc in docs/plans/ |
|
|
||||||
| **5. Worktree Setup** | Set up isolated workspace | using-git-worktrees skill | Ready development environment |
|
|
||||||
| **6. Planning Handoff** | Create implementation plan | writing-plans skill | Detailed task breakdown |
|
|
||||||
|
|
||||||
## The Process
|
## The Process
|
||||||
|
|
||||||
Copy this checklist to track progress:
|
**Understanding the idea:**
|
||||||
|
- Check out the current project state first (files, docs, recent commits)
|
||||||
|
- Ask questions one at a time to refine the idea
|
||||||
|
- Prefer multiple choice questions when possible, but open-ended is fine too
|
||||||
|
- Only one question per message - if a topic needs more exploration, break it into multiple questions
|
||||||
|
- Focus on understanding: purpose, constraints, success criteria
|
||||||
|
|
||||||
```
|
**Exploring approaches:**
|
||||||
Brainstorming Progress:
|
- Propose 2-3 different approaches with trade-offs
|
||||||
- [ ] Phase 1: Understanding (purpose, constraints, criteria gathered)
|
- Present options conversationally with your recommendation and reasoning
|
||||||
- [ ] Phase 2: Exploration (2-3 approaches proposed and evaluated)
|
- Lead with your recommended option and explain why
|
||||||
- [ ] Phase 3: Design Presentation (design validated in sections)
|
|
||||||
- [ ] Phase 4: Design Documentation (design written to docs/plans/)
|
|
||||||
- [ ] Phase 5: Worktree Setup (if implementing)
|
|
||||||
- [ ] Phase 6: Planning Handoff (if implementing)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Phase 1: Understanding
|
**Presenting the design:**
|
||||||
- Check current project state in working directory
|
- Once you believe you understand what you're building, present the design
|
||||||
- Ask ONE question at a time to refine the idea
|
- Break it into sections of 200-300 words
|
||||||
- **Use AskUserQuestion tool** when you have multiple choice options
|
- Ask after each section whether it looks right so far
|
||||||
- Gather: Purpose, constraints, success criteria
|
- Cover: architecture, components, data flow, error handling, testing
|
||||||
|
- Be ready to go back and clarify if something doesn't make sense
|
||||||
|
|
||||||
**Example using AskUserQuestion:**
|
## After the Design
|
||||||
```
|
|
||||||
Question: "Where should the authentication data be stored?"
|
|
||||||
Options:
|
|
||||||
- "Session storage" (clears on tab close, more secure)
|
|
||||||
- "Local storage" (persists across sessions, more convenient)
|
|
||||||
- "Cookies" (works with SSR, compatible with older approach)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Phase 2: Exploration
|
**Documentation:**
|
||||||
- Propose 2-3 different approaches
|
- Write the validated design to `docs/plans/YYYY-MM-DD-<topic>-design.md`
|
||||||
- For each: Core architecture, trade-offs, complexity assessment
|
- Use elements-of-style:writing-clearly-and-concisely skill if available
|
||||||
- **Use AskUserQuestion tool** to present approaches as structured choices
|
- Commit the design document to git
|
||||||
- Ask your human partner which approach resonates
|
|
||||||
|
|
||||||
**Example using AskUserQuestion:**
|
**Implementation (if continuing):**
|
||||||
```
|
- Ask: "Ready to set up for implementation?"
|
||||||
Question: "Which architectural approach should we use?"
|
- Use superpowers:using-git-worktrees to create isolated workspace
|
||||||
Options:
|
- Use superpowers:writing-plans to create detailed implementation plan
|
||||||
- "Event-driven with message queue" (scalable, complex setup, eventual consistency)
|
|
||||||
- "Direct API calls with retry logic" (simple, synchronous, easier to debug)
|
|
||||||
- "Hybrid with background jobs" (balanced, moderate complexity, best of both)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Phase 3: Design Presentation
|
|
||||||
- Present in 200-300 word sections
|
|
||||||
- Cover: Architecture, components, data flow, error handling, testing
|
|
||||||
- Ask after each section: "Does this look right so far?" (open-ended)
|
|
||||||
- Use open-ended questions here to allow freeform feedback
|
|
||||||
|
|
||||||
### Phase 4: Design Documentation
|
|
||||||
After design is validated, write it to a permanent document:
|
|
||||||
- **File location:** `docs/plans/YYYY-MM-DD-<topic>-design.md` (use actual date and descriptive topic)
|
|
||||||
- **RECOMMENDED SUB-SKILL:** Use elements-of-style:writing-clearly-and-concisely (if available) for documentation quality
|
|
||||||
- **Content:** Capture the design as discussed and validated in Phase 3, organized into the sections that emerged from the conversation
|
|
||||||
- Commit the design document to git before proceeding
|
|
||||||
|
|
||||||
### Phase 5: Worktree Setup (for implementation)
|
|
||||||
When design is approved and implementation will follow:
|
|
||||||
- Announce: "I'm using the using-git-worktrees skill to set up an isolated workspace."
|
|
||||||
- **REQUIRED SUB-SKILL:** Use superpowers:using-git-worktrees
|
|
||||||
- Follow that skill's process for directory selection, safety verification, and setup
|
|
||||||
- Return here when worktree ready
|
|
||||||
|
|
||||||
### Phase 6: Planning Handoff
|
|
||||||
Ask: "Ready to create the implementation plan?"
|
|
||||||
|
|
||||||
When your human partner confirms (any affirmative response):
|
|
||||||
- Announce: "I'm using the writing-plans skill to create the implementation plan."
|
|
||||||
- **REQUIRED SUB-SKILL:** Use superpowers:writing-plans
|
|
||||||
- Create detailed plan in the worktree
|
|
||||||
|
|
||||||
## Question Patterns
|
|
||||||
|
|
||||||
### When to Use AskUserQuestion Tool
|
|
||||||
|
|
||||||
**Use AskUserQuestion for:**
|
|
||||||
- Phase 1: Clarifying questions with 2-4 clear options
|
|
||||||
- Phase 2: Architectural approach selection (2-3 alternatives)
|
|
||||||
- Any decision with distinct, mutually exclusive choices
|
|
||||||
- When options have clear trade-offs to explain
|
|
||||||
|
|
||||||
**Benefits:**
|
|
||||||
- Structured presentation of options with descriptions
|
|
||||||
- Clear trade-off visibility for partner
|
|
||||||
- Forces explicit choice (prevents vague "maybe both" responses)
|
|
||||||
|
|
||||||
### When to Use Open-Ended Questions
|
|
||||||
|
|
||||||
**Use open-ended questions for:**
|
|
||||||
- Phase 3: Design validation ("Does this look right so far?")
|
|
||||||
- When you need detailed feedback or explanation
|
|
||||||
- When partner should describe their own requirements
|
|
||||||
- When structured options would limit creative input
|
|
||||||
|
|
||||||
**Example decision flow:**
|
|
||||||
- "What authentication method?" → Use AskUserQuestion (2-4 options)
|
|
||||||
- "Does this design handle your use case?" → Open-ended (validation)
|
|
||||||
|
|
||||||
## When to Revisit Earlier Phases
|
|
||||||
|
|
||||||
```dot
|
|
||||||
digraph revisit_phases {
|
|
||||||
rankdir=LR;
|
|
||||||
"New constraint revealed?" [shape=diamond];
|
|
||||||
"Partner questions approach?" [shape=diamond];
|
|
||||||
"Requirements unclear?" [shape=diamond];
|
|
||||||
"Return to Phase 1" [shape=box, style=filled, fillcolor="#ffcccc"];
|
|
||||||
"Return to Phase 2" [shape=box, style=filled, fillcolor="#ffffcc"];
|
|
||||||
"Continue forward" [shape=box, style=filled, fillcolor="#ccffcc"];
|
|
||||||
|
|
||||||
"New constraint revealed?" -> "Return to Phase 1" [label="yes"];
|
|
||||||
"New constraint revealed?" -> "Partner questions approach?" [label="no"];
|
|
||||||
"Partner questions approach?" -> "Return to Phase 2" [label="yes"];
|
|
||||||
"Partner questions approach?" -> "Requirements unclear?" [label="no"];
|
|
||||||
"Requirements unclear?" -> "Return to Phase 1" [label="yes"];
|
|
||||||
"Requirements unclear?" -> "Continue forward" [label="no"];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**You can and should go backward when:**
|
|
||||||
- Partner reveals new constraint during Phase 2 or 3 → Return to Phase 1
|
|
||||||
- Validation shows fundamental gap in requirements → Return to Phase 1
|
|
||||||
- Partner questions approach during Phase 3 → Return to Phase 2
|
|
||||||
- Something doesn't make sense → Go back and clarify
|
|
||||||
|
|
||||||
**Don't force forward linearly** when going backward would give better results.
|
|
||||||
|
|
||||||
## Key Principles
|
## Key Principles
|
||||||
|
|
||||||
| Principle | Application |
|
- **One question at a time** - Don't overwhelm with multiple questions
|
||||||
|-----------|-------------|
|
- **Multiple choice preferred** - Easier to answer than open-ended when possible
|
||||||
| **One question at a time** | Phase 1: Single question per message, use AskUserQuestion for choices |
|
- **YAGNI ruthlessly** - Remove unnecessary features from all designs
|
||||||
| **Structured choices** | Use AskUserQuestion tool for 2-4 options with trade-offs |
|
- **Explore alternatives** - Always propose 2-3 approaches before settling
|
||||||
| **YAGNI ruthlessly** | Remove unnecessary features from all designs |
|
- **Incremental validation** - Present design in sections, validate each
|
||||||
| **Explore alternatives** | Always propose 2-3 approaches before settling |
|
- **Be flexible** - Go back and clarify when something doesn't make sense
|
||||||
| **Incremental validation** | Present design in sections, validate each |
|
|
||||||
| **Flexible progression** | Go backward when needed - flexibility > rigidity |
|
|
||||||
| **Announce usage** | State skill usage at start of session |
|
|
||||||
|
|||||||
@@ -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 are written to `~/.claude/skills`**
|
**Personal skills live in agent-specific directories (`~/.claude/skills` for Claude Code, `~/.codex/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).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user