The Directory for AI Agent Commands

Discover powerful slash commands for Cursor, Google Antigravity, OpenAI Codex, and Claude. Boost your agentic workflow.

Add Documentation Documentation

Add JSDoc, docstrings, or comments to code.

# Add Documentation Add documentation to the selected code: 1. Function/Method Docs: Purpose, parameters, return values, exceptions 2. Class Docs: Class purpose and usage examples 3. Inline Comments: Only for complex or non-obvious logic 4. Type Annotations: If the language supports them Style Guidelines: - Match the documentation style already used in the codebase - Be concise but complete - Include @example where helpful - Document edge cases and gotchas Do NOT over-document obvious code. Focus on the "why" not the "what".

Code Review Code Quality

Comprehensive code review with actionable feedback.

# Code Review Review the selected code thoroughly and provide feedback on: 1. Bugs & Issues: Any potential bugs, edge cases, or logic errors 2. Performance: Inefficient operations, unnecessary computations, memory issues 3. Security: Potential vulnerabilities, injection risks, data exposure 4. Readability: Unclear naming, complex logic that could be simplified 5. Best Practices: Violations of common patterns or conventions Format your response as: - šŸ› Bugs (critical issues) - ⚔ Performance (optimization opportunities) - šŸ”’ Security (vulnerabilities) - šŸ“– Readability (clarity improvements) - ✨ Suggestions (nice-to-haves) Be specific with line numbers and provide code examples for fixes.

Convert to TypeScript Refactoring

Convert JavaScript code to TypeScript with proper types.

# Convert to TypeScript Convert the selected JavaScript code to TypeScript: 1. Add type annotations: parameters, return types, variables 2. Create interfaces for object shapes and API responses 3. Use generics where appropriate for reusability 4. Handle nullability with proper types Guidelines: - Prefer interfaces over type aliases for objects - Use strict-mode-friendly types (no implicit any) - Add type guards where needed for narrowing - Export types that might be used elsewhere Show the converted code with all types added.

Debug Issue Code Quality

Help debug and fix issues in the code.

# Debug Issue Help me debug this code. I'm experiencing an issue. Please: 1. Analyze: Look for potential bugs, edge cases, or logic errors 2. Identify: Pinpoint the most likely cause of the issue 3. Explain: Why this bug occurs and under what conditions 4. Fix: Provide the corrected code 5. Prevent: Suggest how to avoid similar issues in the future If you need more context about the error or expected behavior, ask me. If there are multiple potential issues, list them in order of likelihood.

Explain Code Documentation

Clear explanation of selected code with overview and step-by-step notes.

# Explain Code Explain the selected code in a clear and structured way: 1. Overview: What is the high-level purpose of this code? 2. Step-by-step: Walk through the logic line by line. 3. Key concepts: Explain any patterns, algorithms, or techniques used. 4. Dependencies: What does this code depend on? 5. Side effects: Does it modify state, make API calls, etc.? Use simple language. If there are complex parts, break them down further. Include any context about why the code might be written this way.

Fix Lint Errors Code Quality

Fix linting and formatting issues without changing behavior.

# Fix Lint Errors Fix all linting and formatting issues in the selected code: 1. Identify all ESLint, Prettier, or other linter violations 2. Fix each issue while maintaining code functionality 3. Apply consistent formatting throughout DO: - Fix unused variables (remove or use them) - Fix import ordering - Apply consistent spacing and indentation - Fix any type errors if applicable DO NOT: - Change the logic or behavior of the code - Add unnecessary changes beyond lint fixes List the fixes made at the end.

Optimize Performance Code Quality

Find and fix performance bottlenecks.

# Optimize Performance Analyze the selected code for performance issues and optimize: Look for: - Unnecessary re-renders or recomputations - N+1 queries or redundant API calls - Memory leaks or excessive memory usage - Inefficient algorithms (O(n²) when O(n) is possible) - Blocking operations that could be async For each issue found: 1. Explain why it's a performance problem 2. Show the optimized solution 3. Estimate the performance improvement Only suggest changes that provide meaningful improvements.

Refactor Code Refactoring

Refactor code for readability and maintainability without changing behavior.

# Refactor Code Refactor the selected code to improve: 1. Readability: Clear naming, logical structure 2. Maintainability: DRY principles, single responsibility 3. Performance: Remove unnecessary operations (only if no behavior change) 4. Modern patterns: Use current language features and idioms Rules: - Do not change external behavior or API - Preserve all existing functionality - Keep changes minimal and focused - Add brief comments for complex logic if helpful Show the refactored code and explain the key changes made.

Remove AI Code Slop Code Quality

Clean up AI-generated code artifacts and maintain consistent style.

# Remove AI code slop Check the diff against main, and remove all AI generated slop introduced in this branch. This includes: - Extra comments that a human wouldn't add or is inconsistent with the rest of the file - Extra defensive checks or try/catch blocks that are abnormal for that area of the codebase (especially if called by trusted / validated codepaths) - Casts to any to get around type issues - Any other style that is inconsistent with the file Report at the end with only a 1-3 sentence summary of what you changed

Security Audit Code Quality

Check code for security vulnerabilities.

# Security Audit Perform a security audit on the selected code. Check for: 1. Injection Attacks: SQL, XSS, command injection 2. Authentication Issues: Weak auth, session problems 3. Data Exposure: PII leaks, sensitive data in logs 4. Access Control: Missing authorization checks 5. Cryptography: Weak algorithms, hardcoded secrets 6. Dependencies: Known vulnerable packages For each finding: - Severity: šŸ”“ Critical / 🟠 High / 🟔 Medium / 🟢 Low - Description of the vulnerability - Potential impact - Recommended fix with code example Focus on practical, exploitable issues over theoretical concerns.

Write Commit Message Documentation

Generate a Conventional Commit message from the current diff.

# Write Commit Message Based on the current git diff, write a proper commit message following Conventional Commits format: Format: ``` <type>(<scope>): <description> [optional body] [optional footer] ``` Types: feat, fix, docs, style, refactor, perf, test, chore Guidelines: - Subject line max 50 characters - Use imperative mood ("add" not "added") - Body should explain WHAT and WHY, not HOW - Reference issue numbers if applicable Analyze the diff and provide the commit message.

Write Tests Testing

Generate comprehensive tests for the selected code.

# Write Tests Write comprehensive tests for the selected code. Include: 1. Unit tests: Test individual functions in isolation 2. Edge cases: Empty inputs, null values, boundary conditions 3. Error cases: Test error handling and exceptions 4. Integration tests: If applicable, test component interactions Guidelines: - Use descriptive test names that explain the scenario - Follow AAA pattern (Arrange, Act, Assert) - Mock external dependencies appropriately - Aim for high coverage of logic branches Match the testing framework and style already used in this codebase.
Copied to clipboard!