-
-
Notifications
You must be signed in to change notification settings - Fork 24.1k
feat: add writing-plans skill and execution workflow improvements #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 24 commits
2e50c88
45d4e02
8a059e9
22ba472
9296ca0
3e329d4
4a0a7eb
51ab41b
e91a33e
85631e1
13793de
e691e1f
33a4055
6ce3936
d11e3b5
972499d
2f26905
603103e
7332ace
ddae086
c66acbc
3de58dc
8cc2065
7da3d71
d92206c
f79982c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| 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): | ||
| ``` | ||
| /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:** | ||
|
|
||
| ``` | ||
| 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. | ||
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Marketplace.json was removed in this PR; fallback will always trigger. The AI summary indicates -# 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 |
||
|
|
||
| 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." | ||
Uh oh!
There was an error while loading. Please reload this page.