-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Closed
Closed
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 45d4e02
fix: replace emoji regex placeholder with working implementation
EthanJStark 8a059e9
docs(automation-over-documentation): add silent dependency gate pattern
EthanJStark 22ba472
feat: replace writing-plans with record-plans
EthanJStark 9296ca0
docs: update writing-plans references to record-plans
EthanJStark 3e329d4
feat(skills): improve writing-skills discoverability
EthanJStark 4a0a7eb
refactor(executing-plans): remove batch pausing, enable continuous ex…
EthanJStark 51ab41b
fix: update record-plan script paths to ~/.claude/scripts/
EthanJStark e91a33e
chore: improve CLAUDE.md formatting and add reload-plugin helper
EthanJStark 85631e1
fix: add approval gate to PR creation in finishing-branch skill
EthanJStark 13793de
fix: add rationalization counters to finishing-branch skill
EthanJStark e691e1f
docs: document PR approval pattern in CLAUDE.md
EthanJStark 33a4055
Update plugin.json for fork identity
EthanJStark 6ce3936
fix: address CodeRabbit PR #170 review - module system and hardcoded …
EthanJStark d11e3b5
refactor: rename record-plan skill to writing-plans for upstream alig…
EthanJStark 972499d
refactor: update skill name references from record-plan to writing-plans
EthanJStark 2f26905
fix: bundle scripts and fix plugin identity for writing-plans skill
EthanJStark 603103e
fix: replace $CLAUDE_PLUGIN_ROOT with dynamic path finder
EthanJStark 7332ace
fix: replace command substitution with two-step approach
EthanJStark ddae086
docs: add troubleshooting for shell evaluation issues
EthanJStark c66acbc
docs: add git worktree workflow for local development
EthanJStark 3de58dc
chore: remove marketplace.json (company-specific config)
EthanJStark 8cc2065
chore: restore upstream plugin identity
EthanJStark 7da3d71
chore: remove personal paths from documentation and scripts
EthanJStark d92206c
docs: add fork acknowledgment and improvements documentation
EthanJStark f79982c
fix: address CodeRabbit security and quality issues
EthanJStark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") | ||
|
|
||
| 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." | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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
.claude-plugin/marketplace.jsonwas deleted. Thejqcommand 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.🤖 Prompt for AI Agents