Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2e50c88
docs(writing-skills): add automation-over-documentation lesson
EthanJStark Dec 5, 2025
45d4e02
fix: replace emoji regex placeholder with working implementation
EthanJStark Dec 5, 2025
8a059e9
docs(automation-over-documentation): add silent dependency gate pattern
EthanJStark Dec 14, 2025
22ba472
feat: replace writing-plans with record-plans
EthanJStark Dec 14, 2025
9296ca0
docs: update writing-plans references to record-plans
EthanJStark Dec 14, 2025
3e329d4
feat(skills): improve writing-skills discoverability
EthanJStark Dec 15, 2025
4a0a7eb
refactor(executing-plans): remove batch pausing, enable continuous ex…
EthanJStark Dec 15, 2025
51ab41b
fix: update record-plan script paths to ~/.claude/scripts/
EthanJStark Dec 15, 2025
e91a33e
chore: improve CLAUDE.md formatting and add reload-plugin helper
EthanJStark Dec 15, 2025
85631e1
fix: add approval gate to PR creation in finishing-branch skill
EthanJStark Dec 16, 2025
13793de
fix: add rationalization counters to finishing-branch skill
EthanJStark Dec 16, 2025
e691e1f
docs: document PR approval pattern in CLAUDE.md
EthanJStark Dec 16, 2025
33a4055
Update plugin.json for fork identity
EthanJStark Dec 16, 2025
6ce3936
fix: address CodeRabbit PR #170 review - module system and hardcoded …
EthanJStark Dec 16, 2025
d11e3b5
refactor: rename record-plan skill to writing-plans for upstream alig…
EthanJStark Dec 16, 2025
972499d
refactor: update skill name references from record-plan to writing-plans
EthanJStark Dec 16, 2025
2f26905
fix: bundle scripts and fix plugin identity for writing-plans skill
EthanJStark Dec 16, 2025
603103e
fix: replace $CLAUDE_PLUGIN_ROOT with dynamic path finder
EthanJStark Dec 16, 2025
7332ace
fix: replace command substitution with two-step approach
EthanJStark Dec 16, 2025
ddae086
docs: add troubleshooting for shell evaluation issues
EthanJStark Dec 16, 2025
c66acbc
docs: add git worktree workflow for local development
EthanJStark Dec 16, 2025
3de58dc
chore: remove marketplace.json (company-specific config)
EthanJStark Dec 16, 2025
8cc2065
chore: restore upstream plugin identity
EthanJStark Dec 16, 2025
7da3d71
chore: remove personal paths from documentation and scripts
EthanJStark Dec 16, 2025
d92206c
docs: add fork acknowledgment and improvements documentation
EthanJStark Dec 17, 2025
f79982c
fix: address CodeRabbit security and quality issues
EthanJStark Dec 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .claude-plugin/marketplace.json

This file was deleted.

4 changes: 2 additions & 2 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superpowers",
"description": "Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques",
"description": "Core skills library with writing-plans skill and automation-over-documentation guidance",
"version": "3.6.2",
"author": {
"name": "Jesse Vincent",
Expand All @@ -9,5 +9,5 @@
"homepage": "https://github.com/obra/superpowers",
"repository": "https://github.com/obra/superpowers",
"license": "MIT",
"keywords": ["skills", "tdd", "debugging", "collaboration", "best-practices", "workflows"]
"keywords": ["skills", "tdd", "debugging", "collaboration", "best-practices", "workflows", "writing-plans"]
}
8 changes: 4 additions & 4 deletions .codex/superpowers-codex
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env node

const fs = require('fs');
const path = require('path');
const os = require('os');
const skillsCore = require('../lib/skills-core');
import fs from 'fs';
import path from 'path';
import os from 'os';
import * as skillsCore from '../lib/skills-core.js';

// Paths
const homeDir = os.homedir();
Expand Down
248 changes: 248 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

This is a **Claude Code plugin** that provides a core skills library. Unlike traditional Node.js projects, this repository contains **no build system, no package.json, and no traditional test suite**. Skills are markdown documentation files that are loaded directly by Claude Code.

**Key Architecture:**

- `skills/` - 21 skills organized by category (testing, debugging, collaboration, meta)
- `commands/` - Slash commands that activate corresponding skills
- `agents/` - Agent definitions (e.g., code-reviewer)
- `hooks/` - Session lifecycle hooks (auto-loads skills system)
- `.claude-plugin/` - Plugin manifest and marketplace configuration
- `llm/` - Local-only planning documents (NOT tracked by git)

## Development Workflow

### Creating New Skills

**Don't improvise.** Use the meta-skills that define the process:

1. **Read `skills/writing-skills/SKILL.md` first** - Complete TDD methodology for documentation
2. **Test with `skills/testing-skills-with-subagents/SKILL.md`** - Run baseline tests, verify skill fixes violations
3. **Contribute with `skills/sharing-skills/SKILL.md`** - Fork, branch, test, PR workflow

**TDD for Documentation Approach:**

- RED: Run baseline with subagent (without skill) - observe failures
- GREEN: Write skill that addresses violations - verify compliance
- REFACTOR: Close loopholes, tighten language against rationalization

### Local Plugin Development

When developing superpowers locally and testing changes in Claude Code:

1. **Edit skills** in the repository's `skills/` directory
2. **Commit changes** to your branch
3. **Reload plugin** to reflect changes in Claude Code (paste both lines):
```bash
/plugin uninstall superpowers
/plugin install superpowers
```
4. **Test changes** in a new Claude Code session

**Important:** Plugin changes only take effect after reload. Skills are loaded at session start, so existing sessions won't see updates.

### PR Creation Safety

**Approval pattern:** finishing-a-development-branch skill enforces preview-then-confirm for PR creation.

**Expected flow:**
1. User selects option 2 (Push and create PR)
2. Claude pushes branch
3. Claude shows PR title/body preview
4. Claude asks: "Create this PR? (yes/no)"
5. User must type "yes" to proceed

**Defense-in-depth:**
- Skill-level approval gate (primary)
- Permission rules in ~/.claude/settings.json (secondary)
- Permission system prompts on first use (tertiary)

**Similar patterns:**
- jira-publisher skill (safety-critical approval gates)
- Option 4 discard confirmation (typed "discard" required)

### Local Development with Worktrees

**Use git worktrees to test changes in isolation while keeping main stable.**

**Creating a worktree for experiments:**

```bash
# From main repository
cd /path/to/superpowers

# Create worktree with new branch
git worktree add .worktrees/feature-name -b feature/my-experiment

# Work in worktree
cd .worktrees/feature-name
# Edit skills, commit changes, then reload plugin:
/plugin uninstall superpowers
/plugin install superpowers
# (Paste both lines together)
```

**When satisfied with changes:**

```bash
# Return to main
cd /path/to/superpowers

# Merge feature branch
git merge feature/my-experiment

# Remove worktree
git worktree remove .worktrees/feature-name

# Delete feature branch (optional)
git branch -d feature/my-experiment
```

**Benefits:**
- Main directory always stable
- Test changes in isolation without affecting running Claude sessions
- Run multiple worktrees for parallel experiments
- Easy cleanup when done

### Skill Structure Requirements

**Directory and Naming:**

```plaintext
skills/
skill-name/ # lowercase-with-hyphens only (no special chars)
SKILL.md # Required: main skill content
example.ts # Optional: reusable tool/example code
scripts/ # Optional: supporting utilities
reference-docs.md # Optional: heavy reference material
```

**Frontmatter (required in SKILL.md):**

```yaml
---
name: skill-name # Must match directory name exactly
description: Use when [trigger] - [what it does] # Appears in skill list
---
```

**Supporting Files Patterns:**

- Self-contained skill → Only `SKILL.md`
- Skill with reusable tool → `SKILL.md` + `example.ts` (see `condition-based-waiting`)
- Skill with heavy reference → `SKILL.md` + reference docs + `scripts/` (see `root-cause-tracing`)

### Skill Types and Treatment

1. **Discipline-Enforcing Skills** (e.g., `test-driven-development`, `verification-before-completion`)

- Contain rigid rules tested against pressure scenarios
- Follow exactly - don't adapt away the discipline

2. **Technique Skills** (e.g., `condition-based-waiting`, `root-cause-tracing`)

- How-to guides with concrete steps

3. **Pattern Skills** (e.g., `brainstorming`, `systematic-debugging`)

- Mental models and flexible patterns - adapt to context

4. **Reference Skills**
- Heavy documentation, APIs, guides

The skill itself indicates which type it is.

## Testing Skills

**No traditional test suite exists.** Skills are tested using:

1. **Subagent Testing** - Spawn subagents with/without skill, compare behavior
2. **Pressure Scenarios** - Test if agents comply when tempted to skip steps
3. **Baseline Testing** - Run without skill to demonstrate violations
4. **TDD Cycle** - Iteratively tighten language to close loopholes

See `skills/testing-skills-with-subagents/SKILL.md` for complete methodology.

## Contributing Workflow

**Standard fork-based workflow:**

1. Fork repository (if you have `gh` CLI configured)
2. Create feature branch: `add-skillname-skill` or `improve-skillname-skill`
3. Create/edit skill following `writing-skills` guidelines
4. Test with subagents to verify behavior changes
5. Commit with clear message (avoid mentioning "Claude" in commits)
6. Push to your fork
7. Create PR to upstream

**Branch off `main`** - this is the primary branch.

## Version Management

Update plugin version in `.claude-plugin/plugin.json`:

```json
{
"name": "superpowers",
"version": "X.Y.Z",
...
}
```

Follow semantic versioning:

- MAJOR: Breaking changes to skill interfaces
- MINOR: New skills, backward-compatible improvements
- PATCH: Bug fixes, documentation improvements

## Important Notes

**llm/ Directory:**

- Contains local-only planning documents
- NOT tracked by git (per `.gitignore`)
- Safe for scratch notes, implementation plans
- Do NOT reference these files in skills or commits

**Skill References:**

- Skills are namespace-qualified: `superpowers:skill-name`
- Use slash commands to activate: `/superpowers:brainstorm`
- Session hook auto-loads `using-superpowers` at startup

**No Legacy Systems:**

- Skills overlay system removed in v2.0
- First-party skills system adopted in v3.0
- No backward compatibility with old skill formats

## Key Reference Files

**Essential reading for contributors:**

- `skills/writing-skills/SKILL.md` - How to create effective skills
- `skills/using-superpowers/SKILL.md` - How the skills system works
- `skills/testing-skills-with-subagents/SKILL.md` - Testing methodology
- `skills/sharing-skills/SKILL.md` - Contributing workflow
- `README.md` - Installation, quick start, skills overview

**Example skills demonstrating patterns:**

- `skills/systematic-debugging/SKILL.md` - Complex skill with flowchart (Graphviz DOT notation)
- `skills/condition-based-waiting/` - Skill with supporting TypeScript example
- `skills/brainstorming/SKILL.md` - Command-activated skill with clear triggers

**Supporting documentation in writing-skills:**

- `anthropic-best-practices.md` - Official Anthropic skill authoring guide
- `graphviz-conventions.dot` - Flowchart style rules
- `persuasion-principles.md` - Psychology of effective documentation

## Philosophy

Skills are TDD for documentation. Write tests (baseline runs) first, then write documentation that makes tests pass. Iterate to close loopholes where agents rationalize around requirements. The result: battle-tested process documentation that actually changes agent behavior.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Next up, once you say "go", it launches a *subagent-driven-development* process,

There's a bunch more to it, but that's the core of the system. And because the skills trigger automatically, you don't need to do anything special. Your coding agent just has Superpowers.

> **Fork Note:** This is a compatibility-focused fork of [obra/superpowers](https://github.com/obra/superpowers) with production-tested improvements including mechanical enforcement and safety gates. All existing workflows and commands work unchanged. [See what's different →](docs/IMPROVEMENTS.md)


## Sponsorship

Expand Down Expand Up @@ -110,7 +112,7 @@ Fetch and follow instructions from https://raw.githubusercontent.com/obra/superp
- **verification-before-completion** - Ensure it's actually fixed
- **defense-in-depth** - Multiple validation layers

**Collaboration**
**Collaboration**
- **brainstorming** - Socratic design refinement
- **writing-plans** - Detailed implementation plans
- **executing-plans** - Batch execution with checkpoints
Expand Down
57 changes: 57 additions & 0 deletions docs/IMPROVEMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Production-Tested Improvements

This fork of [obra/superpowers](https://github.com/obra/superpowers) adds mechanical enforcement and safety gates developed through real-world usage.

## Compatibility

All existing Superpowers workflows, commands, and skills work unchanged. Users familiar with the original can maintain their existing workflows.

## Key Improvements

### 1. Writing-Plans Automation Framework

Enhances the existing `writing-plans` skill with executable wrapper scripts that enforce plan creation through lock files and git pre-commit hooks.

- **Lock file mechanism** ensures plans exist before coding begins
- **Git pre-commit hooks** prevent commits without corresponding implementation plans
- **Shifts from documentation to mechanical constraints** - addresses incidents where agents rationalized away requirements

### 2. Automation Over Documentation Framework

A new guidance document establishing when to use code vs. documentation for skill requirements.

- **Clear decision criteria**: objective, programmatically detectable requirements should trigger automation
- **Reduces documentation churn** - when violations are 100% detectable, use automation
- **Framework for future skill development** - establishes pattern for similar enforcement needs

### 3. PR Creation Safety Gate

Adds mandatory user preview and approval before pull request creation in the `finishing-a-development-branch` skill.

- **Defense-in-depth approach**: skill-level approval gate + permission rules + system prompts
- **Preview-then-confirm pattern** prevents bypassing approval workflows through rationalization
- **Follows pattern from `jira-publisher` skill** - proven safety-critical workflow

### 4. Continuous Execution Pattern

Removes artificial 3-task batching checkpoints from `executing-plans`, allowing uninterrupted workflow through multiple tasks.

- **Improved development velocity** - no artificial pauses
- **Only genuine blockers cause pauses** - maintains quality gates
- **Preserves all safety checks** - verification still runs at appropriate times

### 5. Writing-Skills Governance

Strengthens skill modification governance with enhanced discoverability and rationalization counters.

- **Enhanced discoverability** of the writing-skills meta-skill
- **Rationalization counters** against "just adding a section" shortcuts
- **Clear guidance on TDD treatment vs. quick updates** - when skills need full testing methodology

## Philosophy

**Automation over documentation** for objective constraints, while preserving judgment-based guidance for subjective decisions. Skills are TDD for documentation—we test first, then write documentation that makes tests pass, iterating to close loopholes where agents rationalize around requirements.

---

[View upstream project](https://github.com/obra/superpowers)
23 changes: 23 additions & 0 deletions scripts/reload-plugin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
#
# reload-plugin.sh - Helper for reloading superpowers plugin in Claude Code
#
# This script outputs the slash commands needed to reload the superpowers plugin
# after making changes. Copy and paste both commands into Claude Code.
#
# Usage:
# ./scripts/reload-plugin.sh
# rls # if you have the alias set up
#

# Extract marketplace name from marketplace.json
MARKETPLACE=$(jq -r '.name' "$(dirname "$0")/../.claude-plugin/marketplace.json" 2>/dev/null || echo "superpowers-dev")
Comment on lines +13 to +14
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Marketplace.json was removed in this PR; fallback will always trigger.

The AI summary indicates .claude-plugin/marketplace.json was deleted. The jq command will consistently fail, causing the fallback to "superpowers-dev". If this is intentional for upstream/fork separation, consider updating the comment on line 13 to reflect this behavior, or simplify by removing the dead code path.

-# Extract marketplace name from marketplace.json
-MARKETPLACE=$(jq -r '.name' "$(dirname "$0")/../.claude-plugin/marketplace.json" 2>/dev/null || echo "superpowers-dev")
+# Default to superpowers-dev marketplace (marketplace.json removed for upstream)
+MARKETPLACE="superpowers-dev"
🤖 Prompt for AI Agents
In scripts/reload-plugin.sh around lines 13 to 14, the jq call reading
.claude-plugin/marketplace.json will always fail because that file was removed
in this PR, so the fallback "superpowers-dev" is always used; either update the
comment on line 13 to state the marketplace.json was intentionally removed and
the fallback is expected, or simplify the script by removing the jq invocation
and hardcoding/using a single source for MARKETPLACE ("superpowers-dev" or
another desired value), making sure any ancillary comment reflects the new
behavior.


echo "==> Superpowers Plugin Reload Commands"
echo ""
echo "Copy and paste these into Claude Code (paste both lines at once):"
echo ""
echo "/plugin uninstall superpowers@${MARKETPLACE}"
echo "/plugin install superpowers@${MARKETPLACE}"
echo ""
echo "IMPORTANT: After reload, start a new session to see changes."
Loading