UNPKG

@claude-powers/slash-commands

Version:

๐Ÿš€ Claude Powers - Essential slash commands for Claude Code

389 lines (314 loc) โ€ข 10.1 kB
# ๐Ÿš€ Claude Powers <div align="center"> <a href="https://www.npmjs.com/package/@claude-powers/slash-commands"> <img src="https://badge.fury.io/js/@claude-powers%2Fslash-commands.svg" alt="npm version"> </a> <a href="https://opensource.org/licenses/MIT"> <img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"> </a> </div> <div align="center"> <h3>Essential slash commands for Claude Code</h3> <p>Development tools and code analysis</p> </div> --- ## โœจ Key Features ๐Ÿ” **Intelligent Bug Detection** - Automatically finds problematic patterns โšก **Fast Analysis** - Scans complete projects in seconds ๐Ÿ› ๏ธ **Fix Suggestions** - Get automatic solutions for detected issues ๐Ÿ“Š **Detailed Reports** - Clear outputs with metrics and statistics โš™๏ธ **Flexible Configuration** - Customize rules according to your project ๐ŸŒ **Multi-language** - Support for JS, TS, React, Node.js and more ## ๐Ÿš€ Installation ### ๐Ÿ“ฆ **NPM** ```bash # Global installation npm install -g @claude-powers/slash-commands # Or in your project npm install @claude-powers/slash-commands npx claude-powers install ``` ### โœ… **Verify Installation** ```bash npx claude-powers --version npx claude-powers --help ``` ## ๐ŸŽฏ Immediate Usage Once installed, you can use the commands directly in Claude Code: ### Find Bugs ``` /find-bugs ``` ``` /find-bugs src/components --types=react --severity=high ``` ### Find Unused Code ``` /find-unused-code ``` ``` /find-unused-code src/ --types=variables,functions --severity=medium ``` ### Automate Git Workflow ``` /auto-commit ``` ``` /create-pr --type=feature --reviewers=@team ``` ### Automatic Code Review ``` /code-review ``` ``` /code-review src/ --aspects=security,quality --severity=strict ``` ### Specific Analysis ``` /find-bugs backend/ --types=node,js --output=json /find-unused-code --types=deps --bundle-impact=true /auto-commit --type=hotfix --validate=all ``` ## ๐Ÿ“‹ Available Commands ### ๐Ÿ”ฅ **Super Powers** (Most Impactful) | Command | Description | Impact | Status | |---------|-------------|---------|--------| | `/generate-tests` | Automatic test generation with 90%+ coverage | โญโญโญโญโญ | โœ… Available | | `/fix-bugs` | Auto-detection and bug fixing (90% reduction) | โญโญโญโญโญ | โœ… Available | | `/performance-turbo` | Automatic optimization (60%+ improvement) | โญโญโญโญโญ | โœ… Available | | `/security-fortress` | Automatic protection (95%+ vulnerabilities) | โญโญโญโญโญ | โœ… Available | | `/explain-code` | Personal code teacher (80% onboarding) | โญโญโญโญโญ | โœ… Available | ### ๐Ÿ› ๏ธ **Base Commands** | Command | Description | Status | |---------|-------------|--------| | `/find-bugs` | Detects bugs and problematic patterns | โœ… Available | | `/find-unused-code` | Finds unused code, variables and files | โœ… Available | | `/auto-commit` | Generates automatic commits with AI | โœ… Available | | `/create-pr` | Creates intelligent pull requests | โœ… Available | | `/code-review` | Complete automatic code review | โœ… Available | ## ๐Ÿ” Usage Examples ### ๐Ÿ”ฅ **Super Powers Examples** #### Generate Tests - Save 70% testing time ```bash /generate-tests src/components/UserProfile.tsx --coverage=95% ``` **Result:** 24 unit tests + 6 integration tests + 8 edge cases in 2 minutes #### Fix Bugs - Reduce production bugs 90% ```bash /fix-bugs --types=memory-leaks,null-pointers --confidence=high ``` **Result:** 12 memory leaks + 8 null pointers fixed automatically #### Performance Turbo - 60%+ automatic improvement ```bash /performance-turbo --target=web --budget=strict ``` **Result:** Bundle 847KBโ†’287KB, LCP 3.2sโ†’1.4s, Lighthouse 45โ†’94 #### Security Fortress - Impenetrable fortress ```bash /security-fortress --compliance=gdpr,owasp --harden=paranoid ``` **Result:** 23 vulnerabilities eliminated, OWASP Top 10 compliant #### Explain Code - Personal teacher ```bash /explain-code src/algorithm.js --level=beginner --diagram=flowchart ``` **Result:** Step-by-step explanation + diagrams + interactive examples --- ### ๐Ÿ› ๏ธ **Base Commands Examples** ### Find Bugs ```bash # Ejecutar en tu proyecto /find-bugs src/ ``` **Expected output:** ``` ๐Ÿ› CLAUDE POWERS - FIND BUGS REPORT =================================== ๐Ÿ“Š SUMMARY: โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Severity โ”‚ Count โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ High โ”‚ 2 โ”‚ โ”‚ Medium โ”‚ 5 โ”‚ โ”‚ Low โ”‚ 8 โ”‚ โ”‚ Total โ”‚ 15 โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ๐Ÿ” DETAILS: ๐Ÿ“ src/components/UserForm.tsx โŒ [HIGH] Line 23 - Comparison with == null โš ๏ธ [MEDIUM] Line 45 - useEffect without dependencies ๐Ÿ› ๏ธ SUGGESTIONS: โ€ข 12 automatic fixes available โ€ข 2 critical issues require manual review ``` ### Find Unused Code ```bash # Detect unused code /find-unused-code ``` **Expected output:** ``` ๐Ÿงน CLAUDE POWERS - UNUSED CODE REPORT ===================================== ๐Ÿ“Š SUMMARY: โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Category โ”‚ Count โ”‚ Size โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Variables โ”‚ 12 โ”‚ 35 LOC โ”‚ โ”‚ Functions โ”‚ 5 โ”‚ 85 LOC โ”‚ โ”‚ Imports โ”‚ 18 โ”‚ 18 LOC โ”‚ โ”‚ Files โ”‚ 3 โ”‚ 210 LOC โ”‚ โ”‚ Total โ”‚ 38 โ”‚ 348 LOC โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ๐Ÿ’พ IMPACT: Bundle reducible by ~32KB ``` ### Auto Commit & PR ```bash # Generate intelligent commit /auto-commit --interactive ``` **Expected output:** ``` ๐Ÿค– CLAUDE POWERS - AUTO COMMIT ANALYSIS ======================================= ๐Ÿ“Š DETECTED CHANGES: โ€ข Detected type: feat โ€ข Suggested scope: auth โ€ข 8 files changed, +292 -109 ๐Ÿ’ฌ GENERATED MESSAGE: feat(auth): implement OAuth2 authentication system - Add LoginForm component with validation - Implement AuthProvider for state management - Add comprehensive test suite โœ… READY TO COMMIT ``` ### Automatic Code Review ```bash # Review code quality /code-review --format=summary ``` **Expected output:** ``` ๐Ÿ‘จโ€๐Ÿ’ป CLAUDE POWERS - CODE REVIEW REPORT ======================================= ๐Ÿ“Š OVERALL SCORE: 8.2/10 (GOOD) ๐ŸŽฏ EVALUATED ASPECTS: โ€ข Quality: 8.5/10 (Excellent) โ€ข Architecture: 7.8/10 (Good) โ€ข Performance: 9.1/10 (Excellent) โ€ข Security: 7.2/10 (Good) โ€ข Testing: 7.9/10 (Good) ๐Ÿšฆ STATUS: โœ… APPROVED WITH SUGGESTIONS ``` ## โš™๏ธ Configuration ### Basic Configuration Create `.claude/find-bugs-config.json` in your project: ```json { "severity": "medium", "rules": { "javascript": true, "typescript": true, "react": true, "node": true }, "exclude": [ "node_modules", "dist", "*.test.js" ] } ``` ### Advanced Configuration ```json { "rules": { "javascript": { "enabled": true, "checks": { "equalityChecks": true, "asyncAwait": true, "promiseHandling": true } } }, "customPatterns": [ { "pattern": "console\\.log\\(", "message": "Console.log detected", "severity": "low" } ] } ``` ## ๐Ÿ› ๏ธ For Developers ### Project Structure ``` claude-powers/ โ”œโ”€โ”€ .claude/ โ”‚ โ”œโ”€โ”€ commands/ # Command definitions โ”‚ โ””โ”€โ”€ find-bugs-config.json โ”œโ”€โ”€ scripts/ # Installation scripts โ”œโ”€โ”€ package.json โ””โ”€โ”€ README.md ``` ### Contributing 1. **Fork** the repository 2. **Create** a feature branch: `git checkout -b feature/new-command` 3. **Commit** your changes: `git commit -am 'Add new command'` 4. **Push** to the branch: `git push origin feature/new-command` 5. **Create** a Pull Request ### Adding New Commands 1. Create the command file in `.claude/commands/command-name.md` 2. Define the configuration in `.claude/command-name-config.json` 3. Update the installation script 4. Add tests if applicable ## ๐ŸŒŸ Use Cases ### Daily Development ```bash # Complete automated workflow /find-bugs --severity=high /find-unused-code --types=variables,imports --severity=medium /code-review --aspects=quality,security --format=summary /auto-commit --validate=lint,test /create-pr --type=feature --draft=true # Specific component review /find-bugs src/components/Dashboard.tsx --types=react /find-unused-code components/ --types=react --min-size=5 ``` ### CI/CD Pipeline ```yaml # .github/workflows/quality.yml - name: Analyze Code run: npx claude-powers find-bugs --output=json --severity=high ``` ### Pre-commit Hook ```bash #!/bin/sh npx claude-powers find-bugs --severity=high ``` ## ๐Ÿ“Š Roadmap ### v1.1.0 - Q1 2024 - [ ] `/fix-bugs` command with auto-correction - [ ] ESLint integration - [ ] Vue.js support ### v1.2.0 - Q2 2024 - [ ] `/analyze-performance` command - [ ] Historical metrics - [ ] Web dashboard ### v2.0.0 - Q3 2024 - [ ] Advanced AI for detection - [ ] Customizable commands - [ ] Command marketplace ## ๐Ÿ“ฆ Distribution Claude Powers is available on npm for easy and fast installation. ## ๐Ÿ“ License MIT License - see [LICENSE](./LICENSE) for complete details. ## ๐ŸŽฏ Brand & Colors - **Primary Color**: `#009a7f` (Occupational Therapists Chile) - **Typography**: Inter, SF Pro, system-ui - **Icons**: Phosphor Icons --- <div align="center"> <p>Made with โค๏ธ for developers</p> </div>