Created
February 27, 2026 12:03
-
-
Save robb1e/6af64f139490eae118a78fd88f413bcb to your computer and use it in GitHub Desktop.
Rails as Skill using tasks
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
| --- | |
| disable-model-invocation: true | |
| description: Run the full assembly pipeline - 9 sequential code quality steps using sub-agents. | |
| --- | |
| # /assemble - Assembly Pipeline | |
| Run 9 sequential code quality steps. Each step is dispatched as a `general-purpose` sub-agent via the Task tool. Steps run **sequentially** because each modifies code and runs tests - parallel execution would cause conflicts. | |
| **Fail-fast**: If any step's sub-agent reports a failure attempt to resolve the failure first. | |
| ## How to execute | |
| For each step below, in order: | |
| 1. Use `TaskCreate` to create a task for the step (mark it `in_progress` immediately via `TaskUpdate`) | |
| 2. Call the `Task` tool with `subagent_type: "general-purpose"` and the prompt listed below | |
| 3. Wait for the sub-agent to complete | |
| 4. Check the result - if the sub-agent reports failure or tests not passing, STOP and report the failure | |
| 5. Mark the task as `completed` via `TaskUpdate` | |
| 6. Move to the next step | |
| After all 9 steps complete successfully, report a summary of what each step did. | |
| ## Steps | |
| ### Step 1: RuboCop | |
| ``` | |
| prompt: "Run bin/rubocop and fix any offenses it reports. Apply auto-corrections where possible (bin/rubocop -a), then manually fix any remaining issues following the project's .rubocop.yml configuration. Run the tests afterwards with bin/rails test to confirm nothing breaks. Report what you fixed and whether tests pass." | |
| ``` | |
| ### Step 2: Dead Code | |
| ``` | |
| prompt: "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 with bin/rails test to confirm nothing breaks. Report what you removed and whether tests pass." | |
| ``` | |
| ### Step 3: Dependencies | |
| ``` | |
| prompt: "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 with bin/rails test to confirm nothing breaks. Report what you changed and whether tests pass." | |
| ``` | |
| ### Step 4: Security | |
| ``` | |
| prompt: "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 with bin/rails test to confirm nothing breaks. Report what you fixed and whether tests pass." | |
| ``` | |
| ### Step 5: Rails Conventions | |
| ``` | |
| prompt: "Review the codebase for Rails convention violations, including making full use of Hotwire: 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 with bin/rails test to confirm nothing breaks. Report what you fixed and whether tests pass." | |
| ``` | |
| ### Step 6: Tests | |
| ``` | |
| prompt: "Review the existing test suite for coverage gaps. Look for untested controller actions, model validations, edge cases, and error paths. Add missing tests using Minitest and fixtures (not factories) following the project conventions in CLAUDE.md. Ensure all tests pass by running bin/rails test. Report what tests you added and the final test results." | |
| ``` | |
| ### Step 7: Hotwire Architecture | |
| ``` | |
| prompt: "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 with bin/rails test to confirm nothing breaks. Report what you changed and whether tests pass." | |
| ``` | |
| ### Step 8: Design | |
| ``` | |
| prompt: "Check if the directory ./docs/design exists. If it does NOT exist, skip this step and report 'No design docs found, skipping.' If it DOES exist, review the design files in ./docs/design against the current app implementation and make changes to better conform the app to the design. Run the tests afterwards with bin/rails test to confirm nothing breaks. Report what you changed and whether tests pass." | |
| ``` | |
| ### Step 9: Documentation | |
| ``` | |
| prompt: "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. Report what you changed." | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment