agentleFS
PaulDuvallPaulDuvall/claude-code/CLAUDE.md

claude-code

CLAUDE.md110 starsChanged 2 months agoMITView on GitHub

Claude Code Custom Commands is a comprehensive collection of 45 custom slash commands for Claude Code that accelerate software development workflows through AI-powered automation. These commands provide intelligent automation for every stage of the software development lifecycle, from planning and architecture to deployment and monitoring. This project focuses on creating defensive security tools and development workflow automation. Each command leverages AI to analyze codebases and provide contextual assistance while maintaining security best practices. All commands are designed to enhance developer…

  • Installs packages

The file

Show its rules and text

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

20 rules. About 0 are common, 16 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    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:

    Security-First: All commands focus on defensive security and safe development practices

    line 15
  2. Distinctive:

    Documentation-Driven: Every command is thoroughly documented with usage examples

    line 19
  3. Distinctive:

    All commands are designed to enhance developer productivity while maintaining security and quality standards.

    line 21
  4. Distinctive:

    Never create offensive security tools

    line 258
  5. Distinctive:

    Never assist with malicious code or attacks

    line 259
  6. Distinctive:

    Documentation First: Every command must have comprehensive documentation

    line 263
  7. Very specific:

    Follow naming convention: Use x prefix (e.g., xnewfeature.md)

    line 286
  8. Very specific:

    Update documentation: Run bash scripts/generate-command-docs.sh update to regenerate README.md and CLAUDE.md

    line 290
  9. Distinctive:

    When working with this repository:

    line 341
  10. Distinctive:

    Focus on defensive security: - Only create tools that help developers build secure software

    line 343
  11. Distinctive:

    Maintain documentation: - Keep all command documentation current and comprehensive

    line 344
  12. Distinctive:

    Test thoroughly: - Verify commands work correctly before deployment

    line 345
  13. Distinctive:

    Follow security principles: - Never compromise on security best practices

    line 346
  14. Distinctive:

    Documentation: Update README.md and relevant docs/ files

    line 353
  15. Very specific:

    Configuration templates: Use templates in templates/ directory for different setup scenarios

    line 355
  16. Very specific:

    NPM sync: Run bash scripts/sync-to-npm.sh to sync source files to the npm package

    line 356
  17. Distinctive:

    Code Style: Follow markdown formatting standards for command files

    line 360
  18. Distinctive:

    Input Validation: All commands must validate inputs and sanitize parameters

    line 368
  19. Distinctive:

    Secure Defaults: Use secure defaults for all configuration options

    line 369
  20. Distinctive:

    Error Handling: Never expose sensitive information in error messages

    line 370

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 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 Code Custom Commands is a comprehensive collection of 45 custom slash commands for Claude Code that accelerate software development workflows through AI-powered automation. These commands provide intelligent automation for every stage of the software development lifecycle, from planning and architecture to deployment and monitoring.

Core Philosophy

This project focuses on creating defensive security tools and development workflow automation. Each command leverages AI to analyze codebases and provide contextual assistance while maintaining security best practices.

Key Principles:

  1. Security-First: All commands focus on defensive security and safe development practices
  2. Workflow Automation: Streamline repetitive development tasks with intelligent automation
  3. Comprehensive Coverage: Support the entire software development lifecycle
  4. Quality Assurance: Maintain high code quality through automated checks and validations
  5. Documentation-Driven: Every command is thoroughly documented with usage examples

All commands are designed to enhance developer productivity while maintaining security and quality standards.

Repository Structure

claude-code/
├── CLAUDE.md                           # This file - project guidance
├── README.md                           # Main project documentation
├── setup-devcontainer.sh               # Devcontainer setup script
├── claude-dev-toolkit/                 # NPM package (distributable toolkit)
│   ├── package.json                   # NPM package manifest
│   ├── bin/claude-commands            # CLI entry point
│   ├── lib/                           # JavaScript modules
│   ├── scripts/                       # Install/publish scripts
│   ├── commands/                      # Synced command copies for npm
│   ├── hooks/                         # Synced hook copies for npm
│   ├── subagents/                     # Synced subagent copies for npm
│   ├── templates/                     # Synced template copies for npm
│   └── tests/                         # NPM package tests
├── docs/                              # Documentation directory
│   ├── ash-integration.md             # ASH tiered security integration
│   ├── claude-custom-commands.md      # Command reference guide
│   ├── claude-code-hooks-system.md    # Hooks architecture documentation
│   ├── debug-context.md              # Debug context management
│   ├── devcontainer-guide.md          # Devcontainer guide
│   ├── manual-uninstall-install-guide.md # Installation/uninstallation guide
│   ├── npm-distribution-plan.md       # NPM distribution strategy
│   ├── npm-package-guide.md           # Published package information
│   ├── subagent-hook-integration.md   # Subagent integration docs
│   ├── analysis/                      # Historical MECE reports (superseded, dated)
│   ├── npm-only/                      # NPM consolidation migration guides
│   ├── plans/                         # Implementation plans
│   └── publish/                       # Blog articles
├── hooks/                             # Hook implementations (11 shell + 18 Python)
│   ├── file-logger.sh                # File operation logging
│   ├── on-error-debug.sh             # Error debugging hook
│   ├── pre-commit-quality.sh         # Pre-commit quality checks
│   ├── pre-commit-test-runner.sh     # Auto-detect and run tests
│   ├── pre-write-security.sh         # Pre-write security validation
│   ├── prevent-credential-exposure.sh # Credential exposure prevention
│   ├── subagent-trigger.sh           # Subagent trigger hook (--simple for lightweight mode)
│   ├── tab-color.sh                  # Terminal tab colorization
│   ├── verify-before-edit.sh         # Warn about fabricated references
│   ├── statusline.sh                 # Status line (model, dir, context usage)
│   ├── claude-wrapper.sh             # Claude wrapper script
│   ├── check-complexity.py           # PostToolUse code smell detection
│   ├── check-security.py             # PostToolUse security violations
│   ├── check-commit-signing.py       # PreToolUse GPG/SSH signing check
│   ├── precommit_checks.py           # Tier 1 pre-commit: secrets + IaC
│   ├── prepush_checks.py             # Tier 2 pre-push: ASH on push range
│   ├── check_ash_expirations.py      # Tier 3 CI: ASH suppression expiry guard
│   ├── [12 more *.py]                # Supporting scan modules (see hooks/README.md)
│   ├── settings.example.json         # Claude Code hook wiring to merge into settings.json
│   ├── git/                           # Tracked git hook logic (pre-commit, pre-push)
│   ├── tests/                         # pytest suite for the Python hooks
│   └── lib/                           # Hook support libraries (15 shell modules + 1 config)
│       ├── hook-helpers.sh           # Shared helpers for standalone hooks
│       ├── config-constants.sh        # Configuration constants
│       ├── file-utils.sh             # File utility functions
│       ├── error-handler.sh          # Error handling and logging
│       ├── argument-parser.sh        # CLI argument parsing
│       ├── context-manager.sh        # Context orchestrator (thin)
│       ├── context-gathering.sh      # Context data gathering
│       ├── context-file-ops.sh       # Context file I/O and validation
│       ├── execution-engine.sh       # Subagent execution engine
│       ├── execution-simulation.sh   # Execution simulation
│       ├── execution-results.sh      # Result processing
│       ├── subagent-discovery.sh     # Subagent discovery
│       ├── subagent-validator.sh     # Subagent validation
│       ├── field-validators.sh       # Field validation
│       ├── validation-reporter.sh    # Validation reporting
│       └── credential-patterns.conf  # Credential detection patterns
├── lib/                               # Shared utility libraries
│   └── logging.sh                    # Logging utilities
├── scripts/                           # Build and deployment scripts
│   ├── sync-to-npm.sh               # Sync source files to npm package
│   ├── deploy-subagents.sh          # Subagent deployment
│   ├── generate-command-docs.sh     # Auto-generate command docs
│   ├── setup-hooks.sh               # Hook installation script
│   ├── install-git-hooks.sh         # Install chained git pre-commit/pre-push shims
│   ├── wire-settings.py             # Merge hook config into ~/.claude/settings.json
│   ├── setup-github-actions-iam.py  # GitHub Actions IAM setup
│   ├── testing/                     # Test support scripts
│   ├── setup-npm-ssm.sh             # NPM SSM parameter setup
│   ├── beads-orchestrator.sh        # Beads task orchestration
│   ├── update-subagent-settings.py  # Settings updater
│   └── xact.sh                      # GitHub Actions local testing
├── slash-commands/                    # Command implementations (source of truth)
│   ├── active/                        # 17 production-ready commands
│   │   ├── xarchitecture.md          # Architecture design and analysis
│   │   ├── xconfig.md                # Configuration management
│   │   ├── xcontinue.md              # Execution plan continuation
│   │   ├── xdebug.md                 # Advanced debugging
│   │   ├── xdocs.md                  # Documentation generation
│   │   ├── xexplore.md               # Codebase exploration (read-only)
│   │   ├── xgit.md                   # Automated Git workflow
│   │   ├── xhelp.md                  # Built-in help system
│   │   ├── xpipeline.md              # CI/CD pipeline management
│   │   ├── xquality.md               # Code quality analysis
│   │   ├── xrefactor.md              # Code refactoring automation
│   │   ├── xrelease.md               # Release management
│   │   ├── xsecurity.md              # Security scanning and analysis
│   │   ├── xspec.md                  # Specification generation
│   │   ├── xtdd.md                   # Test-driven development
│   │   ├── xtest.md                  # Testing automation
│   │   └── xverify.md               # Reference verification
│   └── experiments/                   # 28 experimental commands
│       ├── xact.md                   # GitHub Actions testing
│       ├── xapi.md                   # API development tools
│       ├── xaws.md                   # AWS integration
│       ├── xcompliance.md            # Compliance checking
│       ├── xinfra.md                 # Infrastructure as Code
│       ├── xmetrics.md               # Metrics collection
│       ├── xplanning.md              # Project planning
│       ├── xpolicy.md                # Policy enforcement
│       ├── xproduct.md               # Product management
│       ├── xrisk.md                  # Risk assessment
│       └── [17 additional commands]  # Complete experimental collection
├── subagents/                         # 25 subagent definitions
├── specs/                             # Command specifications
│   ├── command-specifications.md      # Command development specs
│   ├── custom-command-specifications.md # Custom command guidelines
│   └── help-functionality-specification.md # Help system specs
├── templates/                         # Configuration templates
│   ├── basic-settings.json           # Basic Claude Code settings
│   ├── comprehensive-settings.json   # Advanced settings
│   ├── security-focused-settings.json # Security-focused config
│   ├── global-settings-backup.json   # Global settings backup
│   ├── global-claude.md              # Global CLAUDE.md instructions template
│   ├── headless-examples.md          # Headless mode examples
│   ├── hybrid-hook-config.yaml       # Hybrid hook configuration
│   └── subagent-hooks.yaml           # Subagent hook definitions
└── tests/                             # Test suites (shell + JS)
    ├── run-all-tests.sh              # Test runner script
    ├── test_*.sh                     # 26 shell-based test files for hooks/lib
    ├── validate-settings-templates.js # Settings template validation
    ├── validate-documentation-accuracy.js # Documentation accuracy checks
    ├── install-guide-tester.js       # Install guide testing
    ├── customization-guide-tester.js # Customization guide testing
    ├── security-validator.js         # Security validation
    ├── hook-integration/             # Hook integration test suite
    └── lib/                          # Shared test utilities

Command Reference

Source of truth: slash-commands/active/ and slash-commands/experiments/ Run bash scripts/generate-command-docs.sh update to regenerate this section.

Active Commands

<!-- BEGIN:COMMANDS -->
CommandDescription
/xarchitectureDesign, analyze, and evolve system architecture using Domain-Driven Design, 12-Factor App, and proven patterns
/xconfigManage project configuration files, environment variables, and application settings
/xcontinueContinue an execution plan from where it left off across sessions
/xdebugInteractive debugging support with error analysis and fix suggestions - integrates with Debug Specialist sub-agent for complex issues
/xdocsGenerate and maintain comprehensive documentation from code
/xexploreExplore a codebase topic before making changes (read-only)
/xgitAutomate git workflow - stage, commit with smart messages, and push to specified branch
/xhelpCommand navigator that recommends the right slash commands for your task
/xpipelineAdvanced CI/CD pipeline configuration, build automation, deployment orchestration, and optimization
/xqualityRun code quality checks with maturity-aware thresholds and centralized-rules integration
/xrefactorInteractive refactoring assistant based on Martin Fowler's catalog and project-specific rules for code smell detection
/xreleaseComprehensive release management with planning, coordination, deployment automation, and monitoring
/xsecurityRun security scans with maturity-aware checks and centralized-rules integration
/xspecMachine-readable specifications with unique identifiers and authority levels for precise AI code generation
/xtddComplete Test-Driven Development workflow automation with Red-Green-Refactor-Commit cycle
/xtestRun tests with smart defaults, maturity-aware thresholds, and centralized-rules integration
/xverifyVerify references before taking action — catch fabricated URLs, placeholder IDs, and unverified claims

Experimental Commands (28)

CommandDescription
/xactLocal GitHub Actions testing with nektos/act for rapid development feedback
/xapiDesign, implement, test, and document APIs with comprehensive automation and best practices
/xatomicBreak complex tasks into 4-8 hour atomic units for efficient development workflow
/xawsAWS integration for credentials, services, and IAM testing with moto mocking
/xbaselineEstablish and track quality, performance, and security baselines with regression detection
/xchoiceGenerate multiple implementation options with trade-off analysis for informed decision-making
/xcomplianceCheck project compliance with standards and generate audit documentation
/xcoverageComprehensive dual coverage analysis for code and specifications
/xdbComprehensive database management, migrations, and performance operations
/xdevcontainerSet up Anthropic's official devcontainer for running Claude Code with --dangerously-skip-permissions safely
/xgovernanceComprehensive development governance framework for policies, audits, and compliance
/xiacComprehensive Infrastructure as Code management with focus on AWS IAM, Terraform, CloudFormation, and infrastructure validation
/ximagespecGenerate specifications and code from visual artifacts — diagrams, mockups, and screenshots
/xincidentIncident response automation, post-mortem analysis, and system reliability improvement through SpecDriven AI methodology
/xinfraManage infrastructure operations, container orchestration, cloud resources, and deployment automation
/xknowledgeManage organizational knowledge, facilitate team onboarding, and create training materials with SpecDriven AI methodology
/xmaturityAssess and improve team's development maturity with actionable insights
/xmetricsAdvanced metrics collection and analysis for development process optimization and SpecDriven AI insights
/xmultirepoCoordinate changes across multiple repositories with parallel agent orchestration
/xnewInitialize a new project with comprehensive CLAUDE.md and specification framework
/xoidcAutomate AWS OIDC role creation for GitHub Actions with local policy discovery
/xplanningAI-assisted project planning with roadmaps, estimation, and risk analysis
/xpolicyGenerate, validate, and test IAM policies with automated policy creation and best practices enforcement
/xproductProduct management and strategic planning tools for feature development and product lifecycle management
/xriskComprehensive risk assessment and mitigation across technical, security, and operational domains
/xstakeholder-updatesGenerate stakeholder update emails from recently completed tasks in any supported issue tracker
/xtraceComprehensive traceability tracking and analysis for SpecDriven AI development with end-to-end requirement tracking
/xuxUser experience optimization, frontend testing, and accessibility compliance with SpecDriven AI methodology integration
<!-- END:COMMANDS -->

Development Guidelines

Command Structure

Each command in slash-commands/active/ and slash-commands/experiments/ follows this pattern:

---
description: "Brief command description"
tags: ["category", "workflow", "automation"]
---

# Command Name

## Description
Detailed explanation of what the command does.

## Usage
Examples of how to use the command with parameters.

## Implementation
The actual command logic and automation steps.

Security Requirements

CRITICAL: This repository only supports defensive security tools and analysis:

  • Security vulnerability scanning and detection
  • Code quality analysis and improvement
  • Compliance checking and governance
  • Defensive security automation
  • Never create offensive security tools
  • Never assist with malicious code or attacks

Command Development Standards

  1. Documentation First: Every command must have comprehensive documentation
  2. Parameter Validation: Validate all inputs and provide clear error messages
  3. Security Focused: Implement security best practices in all automation
  4. Idempotent Operations: Commands should be safe to run multiple times
  5. Clear Output: Provide structured, actionable feedback to users

Testing

# Run NPM package tests
cd claude-dev-toolkit && npm test

# Run shell-based tests
bash tests/test_setup_devcontainer.sh
bash tests/test_devcontainer_advanced.sh

# Sync source files to npm package before publishing
bash scripts/sync-to-npm.sh

Adding New Commands

  1. Create command file in slash-commands/active/ (production) or slash-commands/experiments/ (testing) directory as .md file
  2. Follow naming convention: Use x prefix (e.g., xnewfeature.md)
  3. Include proper documentation with description, usage, and examples
  4. Run sync: bash scripts/sync-to-npm.sh to copy to npm package
  5. Test thoroughly: Deploy and test in actual Claude Code environment
  6. Update documentation: Run bash scripts/generate-command-docs.sh update to regenerate README.md and CLAUDE.md

NPM Package Deployment

# Sync source files to npm package
bash scripts/sync-to-npm.sh

# Run npm package tests
cd claude-dev-toolkit && npm test

# Install globally from npm
npm install -g @paulduvall/claude-dev-toolkit

# Use the CLI
claude-commands install
claude-commands list

Integration Patterns

Commands are designed to work together in workflows:

Development Workflow

/xspec --feature "user-auth"        # Create specifications
/xtdd --component AuthService       # Implement with TDD
/xquality --ruff --mypy --fix      # Check code quality
/xsecurity --scan --report         # Security analysis
/xgit                              # Automated commit workflow

CI/CD Integration

/xtest --coverage --report         # Run comprehensive tests
/xquality --all --baseline        # Quality baseline
/xsecurity --scan --report        # Security scan
/xpipeline --deploy staging       # Deploy pipeline

Security-First Development

/xsecurity --dependencies --code   # Security scanning
/xcompliance --gdpr --audit       # Compliance check
/xpolicy --review --access        # Policy review

Working with Claude Code

Command Expectations

When working with this repository:

  1. Focus on defensive security - Only create tools that help developers build secure software
  2. Maintain documentation - Keep all command documentation current and comprehensive
  3. Test thoroughly - Verify commands work correctly before deployment
  4. Follow security principles - Never compromise on security best practices
  5. Enhance productivity - Commands should genuinely improve developer workflows

File Management

  • Active commands: Store production-ready commands in slash-commands/active/ directory with .md extension
  • Experimental commands: Store experimental commands in slash-commands/experiments/ directory
  • Documentation: Update README.md and relevant docs/ files
  • Hooks: Store in hooks/ directory for security and governance automation
  • Configuration templates: Use templates in templates/ directory for different setup scenarios
  • NPM sync: Run bash scripts/sync-to-npm.sh to sync source files to the npm package

Quality Standards

  • Code Style: Follow markdown formatting standards for command files
  • Documentation: Include usage examples and parameter descriptions
  • Security: Implement input validation and secure practices
  • Performance: Commands should execute efficiently
  • Reliability: Handle errors gracefully with helpful messages

Security Considerations

  • Input Validation: All commands must validate inputs and sanitize parameters
  • Secure Defaults: Use secure defaults for all configuration options
  • Error Handling: Never expose sensitive information in error messages
  • Access Control: Respect file permissions and user access rights
  • Audit Trail: Maintain logs of security-relevant actions

This repository transforms Claude Code into a comprehensive development platform that guides teams through best practices while automating repetitive tasks and ensuring consistent quality and security across all projects.

  • It's unacceptable to have any failing tests. 100% need to be passing before moving onto the next work

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.