analyze-dependencies
Please perform a comprehensive dependency analysis of this codebase:
Please help me ensure my code is ready for review.
How it fires
How this command gets triggered: by you, by Claude, or both.
/pre-review-checkContext preview
What this command does when you run it.
Please help me ensure my code is ready for review.
Please help me ensure my code is ready for review.
PR/Branch: ${PR_BRANCH:-current branch} Focus areas: ${FOCUS_AREAS:-all changes}
1. **Find and fix debug code**:
# Find TODOs that need addressing ch cq todos --with-context # Remove debug logs ch cq console-logs # Check for commented code chs find-code "^\\s*//.*\\b(console|debug|test)"
2. **Check code quality metrics**:
# Find overly large files
ch cq large-files ${MAX_LINES:-500}
# Check complexity
ch cq complexity ${MAX_COMPLEXITY:-10}
# Look for duplicated code patterns
chs find-code "$PATTERN" --count3. **Security scan**:
# Scan for hardcoded secrets ch cq secrets-scan # Check for sensitive data in logs chs find-code "password|token|secret|key" --exclude .env
4. **Verify test coverage**:
# Find untested files
if ! git diff --name-only origin/main...HEAD 2>/dev/null | while IFS= read -r f; do
echo "Checking tests for: $f"
chs find-file "*.test.*" | xargs grep -l "$(basename "$f" .js)" 2>/dev/null || echo " No tests found for $f"
done; then
echo "Note: Could not compare with origin/main"
fi
# Run tests
ch ts test5. **Check dependencies**:
# Audit for vulnerabilities ch ts audit # Check for unused dependencies ch ts deps --check-unused
6. **Documentation check**:
1. **Generate context for reviewers**:
# Create summary ch ctx summarize > PR_CONTEXT.md # Show what changed git diff --stat origin/main...HEAD
2. **Check commit history**:
# Review commits git log --oneline origin/main..HEAD # Consider squashing if needed
3. **Update PR if exists**:
# Check if PR exists
PR_NUMBER=$(gh pr list --head "$(git branch --show-current)" --json number -q ".[0].number")
if [ -n "$PR_NUMBER" ]; then
# Update PR description with context
gh pr edit "$PR_NUMBER" --body "$(gh pr view "$PR_NUMBER" --json body -q .body)\n\n## Review Context\n\n$(cat PR_CONTEXT.md)"
# Mark as ready if it's a draft
gh pr ready "$PR_NUMBER" 2>/dev/null || echo "PR already ready for review"
# Add review request if needed
gh pr edit "$PR_NUMBER" --add-reviewer "${REVIEWER:-@me}"
else
echo "No PR found. Create one with: gh pr create"
fiPlease review my changes and confirm they meet quality standards.
Give Claude the super powers it deserves with this power user collection of bash scripts and slash commands
Please perform a comprehensive dependency analysis of this codebase:
Please help me document all APIs in this codebase systematically:
Automatically identify and fix CI failures or review feedback on the current PR, then push the fixes.