agentleFS
propstreetpropstreet/claude-powerpack/CLAUDE.md

claude-powerpack

CLAUDE.md2 starsChanged 9 months agoMITView on GitHub

Claude Powerpack is a Claude Code plugin that provides productivity tools for developers. Skills (alphabetical): This is a plugin repository with no build process. Testing is done by installing the plugin in Claude Code. Test skill activation by typing these prompts in Claude Code chat: - Update the PR description → update-pr skill - Create an expert consultation document for... → ask-expert skill - Debrief this session → debrief skill The extraction script is Node.js (ESM) and can be tested…

  • Commits and pushes

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When modifying the ask-expert skill or creating new skills:

    line 123
  2. Distinctive:

    description: must include activation trigger phrases in quotes for auto-discovery

    line 142
  3. Very specific:

    Glob tool: does not support brace expansion {A,B}*.md — use separate Glob patterns instead

    line 149
  4. Very specific:

    Keep SKILL.md under 500 lines (move detailed examples to EXAMPLES.md)

    line 150
  5. Very specific:

    When bumping versions with replace_all, verify per-skill version tags in README (e.g., ### analyze-deps (v1.9.0)) weren't changed — they …

    line 152
  6. Distinctive:

    Key principle: Use relative paths for all script and file references within skills, as documented in the official Anthropic skills …

    line 175
  7. Distinctive:

    Use ESLint with project settings

    line 182
  8. Distinctive:

    Run Prettier for formatting

    line 183
  9. Distinctive:

    Add JSDoc comments for all functions

    line 184
  10. Distinctive:

    Use clear, descriptive variable names

    line 185
  11. Very specific:

    Run npm run check-versions (or node scripts/check-versions.js) to verify — CI enforces this on every PR.

    line 238
  12. Distinctive:

    Create a new commit for fixes instead of amending

    line 243
  13. Distinctive:

    After merging version bump to main:

    line 258

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

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

Project Overview

Claude Powerpack is a Claude Code plugin that provides productivity tools for developers.

Agents:

  • code-researcher - Deep codebase analysis using ast-grep, ripgrep, git, and native tools

Skills (alphabetical):

  • analyze-deps - Analyzes dependency updates with breaking changes, new features, and actionable recommendations
  • ask-expert - Extracts code with size tracking for external expert consultation
  • debrief - Captures session learnings and updates project docs with progressive disclosure
  • deep-interview - Structured requirements gathering via AskUserQuestion
  • mine-history - Extracts learnings from all past session transcripts via pattern-based correction detection
  • trim-pr - Pre-merge PR cleanup: trims accumulated cruft and over-engineering
  • update-pr - Creates comprehensive PR descriptions by systematically reviewing all changes

Repository Structure

  • .claude-plugin/plugin.json - Plugin metadata and configuration
  • agents/code-researcher.md - Deep codebase analysis agent (ast-grep, ripgrep, git)
  • skills/mine-history/ - Session history mining skill
    • SKILL.md - 5-phase workflow for extracting and synthesizing learnings
    • scripts/extract-learnings.js - Node.js extraction script (zero deps, ESM)
  • skills/debrief/ - The debrief skill (session learning capture)
    • SKILL.md - 4-phase debrief workflow with CLAUDE.md token discipline rules
    • EXAMPLES.md - Good vs bad examples, routing decision guide
    • README.md - User-facing documentation
  • skills/update-pr/ - The update-pr skill implementation
    • SKILL.md - Multi-phase workflow for comprehensive PR descriptions
    • EXAMPLES.md - Good vs bad PR description examples
    • README.md - User-facing documentation
  • skills/ask-expert/ - The ask-expert skill implementation
    • SKILL.md - Skill definition loaded by Claude Code (with YAML frontmatter)
    • EXAMPLES.md - Detailed usage examples and patterns
    • README.md - User-facing documentation
    • scripts/extract-code.js - Node.js script for code extraction with size tracking
  • scripts/check-versions.js - Verifies all version strings are in sync (used by CI and releases)

Development Commands

This is a plugin repository with no build process. Testing is done by installing the plugin in Claude Code.

Testing the Plugin Locally

# Install from your fork/branch
/plugin install YOUR-USERNAME/claude-powerpack

# Verify installation
/plugin

# Uninstall and reinstall after changes
/plugin uninstall claude-powerpack
/plugin install YOUR-USERNAME/claude-powerpack

Test skill activation by typing these prompts in Claude Code chat:

  • Update the PR description → update-pr skill
  • Create an expert consultation document for... → ask-expert skill
  • Debrief this session → debrief skill

Testing the Extraction Script

The extraction script is Node.js (ESM) and can be tested directly:

# Requires Node.js 18+
node --version

# Show help
node skills/ask-expert/scripts/extract-code.js --help

# Test basic extraction
node skills/ask-expert/scripts/extract-code.js \
  --track-size --output=/tmp/test.md \
  README.md

# Verify output
wc -c /tmp/test.md

Architecture

Plugin System Integration

The plugin follows Claude Code's plugin specification:

  • plugin.json defines metadata (name, version, description, repository)
  • Skills are placed in skills/{skill-name}/ directories
  • Agents are placed in agents/ directory (referenced via "agents": "./agents/" in plugin.json)
  • Each skill has SKILL.md with YAML frontmatter defining activation criteria
  • Each agent has a markdown file with YAML frontmatter defining name, description, model, color, and tools

Skill Activation

Skills activate based on their description field in SKILL.md frontmatter. Claude matches user requests against these descriptions to determine which skill to invoke.

See README.md - Agents & Skills Included for example prompts that trigger each skill/agent.

Code Extraction Script

skills/ask-expert/scripts/extract-code.js is a standalone Node.js script that:

  • Extracts full files, line ranges, or git diffs
  • Formats output as markdown code blocks
  • Tracks cumulative size to stay within 125KB limit
  • Supports batch processing multiple files
  • Validates all files before writing output (atomic operations)
  • Can be used via CLI or config file

Key design patterns:

  • Validation happens before any file writes (prevents partial output on errors)
  • Appends to existing files (allows incremental building)
  • Size tracking with warnings at 100KB and 115KB thresholds
  • Supports both --output flag and traditional shell redirection

Skill Development Guidelines

When modifying the ask-expert skill or creating new skills:

SKILL.md Requirements (Claude Code 2.1.x)

---
name: skill-name
description: Clear description with trigger phrases. Use when user asks to "do X", "perform Y", or needs Z.
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash(git:*)
  - Bash(node:*)
user-invocable: true
context: fork
---
  • description must include activation trigger phrases in quotes for auto-discovery
  • allowed-tools use YAML array format with Bash wildcard patterns (e.g., Bash(git:*)). It is pre-approval (suppresses permission prompts), NOT enforcement — unlisted tools/commands are not blocked, they just prompt (#37683, verified Claude Code v2.1.185). So a context: fork skill whose orchestrator runs repo build/test commands must list them to avoid prompts (see trim-pr and pr-fix-angles). For an actual restriction use disallowed-tools (added v2.1.152).
  • Bash patterns: Bash(npm run:*) does NOT match bare npm test/npm ci — use Bash(npm:*). A space before * is a word boundary (Bash(ls *) ≠ lsof); wrappers (timeout, nice, nohup, …) are stripped before matching.
  • user-invocable is the correct spelling (user-invocable with c, NOT user-invokable with k — VS Code extension has a known bug #23723)
  • context: fork runs skill in isolated sub-agent — but forked skills have NO conversation history and CANNOT use AskUserQuestion. Skills needing either must omit context: fork.
  • Additional frontmatter fields: argument-hint (autocomplete hint), model (per-skill model override), hooks (scoped hooks), agent (subagent type for forked skills)
  • Agent tool replaced Task in Claude Code 2.1.63. Use Agent in allowed-tools for spawning sub-agents. Task still works as a backward-compatible alias but should not be used in new code.
  • Glob tool does not support brace expansion {A,B}*.md — use separate Glob patterns instead
  • Keep SKILL.md under 500 lines (move detailed examples to EXAMPLES.md)
  • Skills should describe intent, not prescribe exact commands — Claude already knows git, gh, linting, and project detection. Focus on what Claude doesn't know: domain patterns, gotchas, output templates, and non-obvious constraints.
  • When bumping versions with replace_all, verify per-skill version tags in README (e.g., ### analyze-deps (v1.9.0)) weren't changed — they track introduction date, not current version

Progressive Disclosure Pattern

The skill uses a three-tier documentation structure:

  1. SKILL.md - Loaded by Claude, contains workflow and critical rules
  2. EXAMPLES.md - Detailed usage patterns and complete workflows
  3. README.md - User-facing documentation (not loaded by Claude)

This keeps Claude's context focused while providing comprehensive documentation.

File Path Patterns

The extraction script is accessed via relative path following official Claude Code conventions:

# Correct (works regardless of installation method):
node scripts/extract-code.js

# Why: Skills execute with their directory as the working directory
# This works for personal skills, project skills, and plugin-installed skills

Key principle: Use relative paths for all script and file references within skills, as documented in the official Anthropic skills repository.

Code Quality Standards

From CONTRIBUTING.md:

JavaScript/Node.js

  • Use ESLint with project settings
  • Run Prettier for formatting
  • Add JSDoc comments for all functions
  • Use clear, descriptive variable names

Skills Checklist

  • ✅ Clear activation criteria in SKILL.md description
  • ✅ Proper YAML frontmatter with allowed-tools
  • ✅ Progressive disclosure (keep SKILL.md concise)
  • ✅ Version documented in plugin.json

Important Constraints

Size Limits

Expert consultation documents target 125KB maximum to stay within LLM context limits. The extraction script enforces this with:

  • MAX_SIZE_BYTES = 125 * 1024
  • Warning at 100KB
  • Warning at 115KB
  • Error and exit at 125KB

Git Integration

Diff functionality requires:

  • Valid git repository
  • Valid git references (branches, commits, ranges)
  • File must exist in git history

The script validates git refs before attempting diffs (skills/ask-expert/scripts/extract-code.js:117-149).

Testing Checklist

Before submitting changes:

  1. ✅ Test locally using /plugin install YOUR-USERNAME/claude-powerpack
  2. ✅ Verify skill activation with trigger phrases (both skills)
  3. ✅ Test update-pr skill on a branch with multiple commits
  4. ✅ Test extraction script with various file patterns
  5. ✅ Verify git diff functionality (if changed)
  6. ✅ Check size tracking accuracy
  7. ✅ Test error handling (missing files, invalid ranges, no PR, etc.)
  8. ✅ Update version in plugin.json if needed
  9. ✅ Run node scripts/check-versions.js to verify version consistency

Version Management

The plugin uses semantic versioning. When bumping versions, update ALL of these files:

FileField/Location
.claude-plugin/plugin.json"version": "x.y.z"
.claude-plugin/marketplace.json"version" in both top-level and plugins[0]
package.json"version": "x.y.z"
README.mdVersion badge URL
CHANGELOG.mdNew ## [x.y.z] section + footer link

marketplace.json is what Claude Code settings displays — forgetting it shows stale versions to users.

Run npm run check-versions (or node scripts/check-versions.js) to verify — CI enforces this on every PR.

Git Workflow

Never amend pushed commits. Once a commit is pushed to a remote branch:

  • Create a new commit for fixes instead of amending
  • Amending requires force push, which rewrites public history
  • Force push can cause issues for collaborators and breaks PR review flow

When amend is acceptable:

  • Local commits not yet pushed
  • Explicitly requested by the user

Prefer separate commits for:

  • Security fixes (creates audit trail)
  • Review feedback (shows the review process)
  • Distinct logical changes

Creating a Release

After merging version bump to main:

# Switch to main and pull
git checkout main && git pull

# Verify all version strings are in sync (exits 1 on mismatch)
npm run check-versions

# Create GitHub release (uses CHANGELOG content for notes)
gh release create v1.1.1 --title "v1.1.1" --notes "$(cat <<'EOF'
## Fixed

- Description of fixes...

See [CHANGELOG.md](https://github.com/propstreet/claude-powerpack/blob/main/CHANGELOG.md) for full details.
EOF
)"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.