Created
February 15, 2026 18:07
-
-
Save robb1e/a84cfe735e0379bc5633c6e726666299 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| APP_ROOT="$(cd "$(dirname "$0")/.." && pwd)" | |
| cd "$APP_ROOT" | |
| TOOLS="Bash,Read,Edit,Write,Glob,Grep" | |
| run_step() { | |
| local name="$1" | |
| local prompt="$2" | |
| echo "" | |
| echo "========================================" | |
| echo " $name" | |
| echo "========================================" | |
| echo "" | |
| claude -p "$prompt" \ | |
| --allowedTools "$TOOLS" \ | |
| --verbose \ | |
| --output-format stream-json \ | |
| | jq -rj 'select(.type == "assistant") | .message.content[]? | select(.type == "text") | .text' | |
| echo "" | |
| } | |
| run_step "Dead Code" \ | |
| "Scan the codebase for dead code: unused methods, unreferenced partials, unused routes, unused helpers, unused JavaScript controllers, and unused CSS classes. Remove any dead code you find with confidence. Run the tests afterwards to confirm nothing breaks." | |
| run_step "Dependencies" \ | |
| "Check Gemfile and Gemfile.lock for outdated or unused gems. Check importmap.rb and package.json (if present) for outdated or unused JavaScript dependencies. Recommend and apply safe updates. Run the tests afterwards to confirm nothing breaks." | |
| run_step "Security" \ | |
| "Run bin/brakeman and bin/bundler-audit to find security vulnerabilities. Review the codebase for OWASP top 10 issues: SQL injection, XSS, CSRF, mass assignment, insecure direct object references, and sensitive data exposure. Fix any issues found. Run the tests afterwards to confirm nothing breaks." | |
| run_step "Rails Conventions" \ | |
| "Review the codebase for Rails convention violations: N+1 queries, missing database indexes, callbacks that should be service objects, fat controllers, business logic in views, missing validations, non-RESTful routes, and incorrect use of Rails helpers. Fix any issues found following Rails best practices. Run the tests afterwards to confirm nothing breaks." | |
| run_step "Tests" \ | |
| "Review the existing test suite for coverage gaps. Look for untested controller actions, model validations, edge cases, and error paths. Add missing tests. Ensure all tests pass by running bin/rails test." | |
| run_step "Hotwire Architecture" \ | |
| "Review the codebase to ensure Hotwire (Turbo + Stimulus) is used consistently throughout. Check for: pages that should use Turbo Frames but don't, forms missing Turbo Stream responses, JavaScript that could be replaced with Stimulus controllers, and inline scripts that should use Stimulus. Fix any issues found. Run the tests afterwards to confirm nothing breaks." | |
| run_step "Documentation" \ | |
| "Review and update CLAUDE.md to accurately reflect the current state of the project: models, controllers, routes, conventions, and architecture. Keep it concise and useful as a developer reference. Do not add emoji." | |
| echo "" | |
| echo "========================================" | |
| echo " Assembly complete" | |
| echo "========================================" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment