| name | boo-safety |
| description | Applies implementation safety checklists for Ruby on Rails code changes. Use when writing or reviewing code that touches user input, authorization, database migrations, background jobs, external APIs, or production-critical paths. Triggers on secure, safe migration, pre-merge checklist, rollout risk, data integrity, and production hardening. |
Rails Implementation Safety
Overview
Use this skill before finalizing code to reduce production risk and prevent common Rails failure patterns.
LSP Recommendation
Strongly recommend enabling LSP before running this skill:
ENABLE_LSP_TOOL=1 in the shell running Claude/Codex.
- Run from the Rails app root directory.
- Ensure a Ruby LSP backend is available in the app bundle (
ruby-lsp and/or solargraph).
If LSP is not enabled, continue execution but mark reduced confidence for symbol-level static checks.
Safety Checklist
- Input Safety: strong params, sanitization, no unsafe SQL interpolation.
- Auth Safety: authenticate and authorize all protected flows.
- Data Safety: reversible migrations, constraints, index strategy.
- Async Safety: idempotent jobs, retry behavior, dead-letter handling.
- Runtime Safety: nil handling, explicit error paths, timeouts.
- Deploy Safety: rollout plan, rollback path, observability hooks.
Blockers
Do not mark ready if any blocker exists:
- Unbounded destructive migration.
- Missing authorization on sensitive action.
- Unsanitized user input in dangerous context.
- Unverified background side effects.
Scripted Execution
Use the bundled checker for repeatable safety audits:
scripts/safety_check.sh
scripts/safety_check.sh --project-dir /path/to/rails-app
scripts/safety_check.sh --mode advisory
scripts/safety_check.sh --output-file tmp/safety-report.md
scripts/safety_check.sh --require-lsp (hard fail if ENABLE_LSP_TOOL!=1)
Default behavior:
- Detects blockers for SQL interpolation, command/code injection vectors, risky migrations, XSS-prone rendering helpers, and open redirects.
- Detects warnings for likely strong-params gaps, CSRF layout issues, upload validation gaps, and non-idempotent job patterns.
- Persists logs in
tmp/rails-safety-check-<timestamp>/.
In strict mode, any blocker returns exit code 1.
Output Contract
- Checklist Status.
- Blockers.
- Remediations.
- Residual Risk.
- Rollback Notes.
Final Summary (Required)
Always end execution with:
- Safety outcome: pass, warn, or fail.
- Blockers that must be fixed before merge.
- Warnings and mitigations.
- Rollback readiness note.
- Next safest action.
References
Load references/external-resources.md for Rails Security and OWASP-aligned checks.