home / skills / steveclarke / dotfiles / rails-upgrade-assistant

rails-upgrade-assistant skill

/ai/skills/rails-upgrade-assistant

This skill analyzes Rails projects and generates stepwise upgrade reports for Rails 7.0 to 8.1, including deprecations and migration guidance.

npx playbooks add skill steveclarke/dotfiles --skill rails-upgrade-assistant

Review the files below or copy the command above to add this skill to your agents.

Files (29)
SKILL.md
5.0 KB
---
name: rails-upgrade-assistant
description: Analyzes Rails applications and generates comprehensive upgrade reports with breaking changes, deprecations, and step-by-step migration guides for Rails 7.0 through 8.1.1. Use when upgrading Rails applications, planning multi-hop upgrades, or querying version-specific changes.
---

# Rails Upgrade Assistant Skill v1.0

## How It Works

Three-step process:

1. **Detection Script** — Generate a bash script that scans the codebase for breaking changes with file:line references
2. **User Runs Script** — User executes it, gets `rails_{version}_upgrade_findings.txt`
3. **Reports** — Generate upgrade report and app:update preview based on actual findings (not hypothetical)

---

## Sequential Upgrade Strategy

### ⚠️ Version Skipping is NOT Allowed

Rails upgrades MUST follow this exact sequence:
```
7.0.x → 7.1.x → 7.2.x → 8.0.x → 8.1.x
```

**You CANNOT skip versions.** Examples:
- ❌ 7.0 → 7.2 (skips 7.1)
- ❌ 7.0 → 8.0 (skips 7.1 and 7.2)
- ✅ 7.0 → 7.1 (correct)
- ✅ 7.1 → 7.2 (correct)

If user requests a multi-hop upgrade (e.g., 7.0 → 8.1):
1. Explain the sequential requirement
2. Break it into individual hops
3. Generate separate reports for each hop
4. Recommend completing each hop fully before moving to next

---

## Available Resources

### Core Documentation
- `docs/README.md` - Human-readable overview
- `docs/QUICK-REFERENCE.md` - Command cheat sheet
- `docs/USAGE-GUIDE.md` - Comprehensive how-to

### Version-Specific Guides (Load as needed)
- `version-guides/upgrade-7.0-to-7.1.md` - Rails 7.0 → 7.1
- `version-guides/upgrade-7.1-to-7.2.md` - Rails 7.1 → 7.2
- `version-guides/upgrade-7.2-to-8.0.md` - Rails 7.2 → 8.0
- `version-guides/upgrade-8.0-to-8.1.md` - Rails 8.0 → 8.1

### Workflow Guides (Load when generating deliverables)
- `workflows/upgrade-report-workflow.md` - How to generate upgrade reports
- `workflows/detection-script-workflow.md` - How to generate detection scripts
- `workflows/app-update-preview-workflow.md` - How to generate app:update previews

### Examples (Load when user needs clarification)
- `examples/simple-upgrade.md` - Single-hop upgrade example
- `examples/multi-hop-upgrade.md` - Multi-hop upgrade example
- `examples/detection-script-only.md` - Detection script only request
- `examples/preview-only.md` - Preview only request

### Reference Materials
- `reference/breaking-changes-by-version.md` - Quick lookup
- `reference/multi-hop-strategy.md` - Multi-version planning
- `reference/deprecations-timeline.md` - Deprecation tracking
- `reference/testing-checklist.md` - Comprehensive testing
- `reference/pattern-file-guide.md` - How to use pattern files
- `reference/quality-checklist.md` - Pre-delivery verification
- `reference/troubleshooting.md` - Common issues and solutions

### Detection Script Resources
- `detection-scripts/patterns/rails-72-patterns.yml` - Rails 7.2 patterns
- `detection-scripts/patterns/rails-80-patterns.yml` - Rails 8.0 patterns
- `detection-scripts/patterns/rails-81-patterns.yml` - Rails 8.1 patterns
- `detection-scripts/templates/detection-script-template.sh` - Bash template

### Report Templates
- `templates/upgrade-report-template.md` - Main upgrade report structure
- `templates/app-update-preview-template.md` - Configuration preview

---

## Workflow

### Phase 1: Generate Detection Script

1. Detect current Rails version from `Gemfile.lock`
2. Read `detection-scripts/patterns/rails-{VERSION}-patterns.yml`
3. Read `detection-scripts/templates/detection-script-template.sh`
4. Read `workflows/detection-script-workflow.md`
5. Generate version-specific bash script and deliver to user

### Phase 2: User Runs Script

User runs the script, gets findings. Wait for them to share `rails_{version}_upgrade_findings.txt`.

### Phase 3: Generate Reports

1. Parse findings.txt — extract breaking changes and affected files
2. Read `version-guides/upgrade-{FROM}-to-{TO}.md`
3. Read `workflows/upgrade-report-workflow.md` and `workflows/app-update-preview-workflow.md`
4. Generate **Comprehensive Upgrade Report** with real code from the user's project
5. Generate **app:update Preview** with actual config file diffs

---

## Quality

Before delivering any output, verify against `reference/quality-checklist.md`. Key rules:
- Replace all {PLACEHOLDERS} with actual values
- Use ACTUAL findings from the script, not generic examples
- Include real file:line references and real code from the user's project
- Flag custom code with warnings

---

## Bundled Resources

Load these as needed — don't read everything upfront:

| Directory | When to load |
|-----------|-------------|
| `workflows/` | Before generating detection scripts or reports |
| `version-guides/` | When you need version-specific breaking changes |
| `templates/` | When generating report output |
| `detection-scripts/patterns/` | When building the detection script |
| `examples/` | When user needs clarification on the process |
| `reference/` | For quality checks, troubleshooting, pattern file format |

Overview

This skill analyzes Ruby on Rails applications and generates actionable, version-specific upgrade deliverables for Rails 7.0 through 8.1.1. It produces a detection script, parses real findings from your codebase, and emits a comprehensive upgrade report plus an app:update preview tailored to the actual files it scanned. The output focuses on breaking changes, deprecations, and step-by-step migration guidance.

How this skill works

I generate a version-aware bash detection script that scans your repository for known breaking changes and patterns, producing a findings file with file:line references. After you run that script and provide the findings, I parse the results and assemble an upgrade report and an app:update preview using the exact occurrences from your codebase. For multi-hop requests I enforce the required sequential upgrade path and produce separate reports for each hop.

When to use it

  • Preparing to upgrade a Rails app from any 7.0.x through 8.1.1 target
  • Planning a multi-hop upgrade (e.g., 7.0 → 8.1) and needing per-hop guidance
  • Verifying code for version-specific deprecations and breaking changes before CI runs
  • Generating an app:update preview showing real config diffs
  • Creating a prioritized list of code changes with file:line references for development sprints

Best practices

  • Always perform upgrades sequentially: 7.0 → 7.1 → 7.2 → 8.0 → 8.1; do not skip versions
  • Run the generated detection script on the actual codebase and supply the findings file before requesting final reports
  • Complete and test each hop fully before moving to the next hop in a multi-hop plan
  • Use the app:update preview to review config diffs in a branch and run your full test suite after applying changes
  • Flag and review custom or monkey-patched code manually — the tool flags but does not automatically fix bespoke logic

Example use cases

  • Single-hop upgrade: generate a detection script for 7.1 and get a focused report upgrading 7.0 → 7.1
  • Multi-hop plan: request reports for 7.0 → 7.1, 7.1 → 7.2, etc., produced one hop at a time
  • Detection-only: ask for the detection script and run it in CI to surface deprecations early
  • App:update preview only: provide findings and get a patch-like preview of config updates and recommended generator changes

FAQ

Can I skip versions when upgrading?

No. Rails upgrades must follow the sequence 7.0 → 7.1 → 7.2 → 8.0 → 8.1. The skill will break multi-hop requests into individual hops and produce separate reports.

What do I need to provide to get a full report?

Run the generated detection script in your repo and provide the resulting findings file (rails_{version}_upgrade_findings.txt). Reports are built from those real findings.

Will the tool edit my code automatically?

No. It generates precise change lists, migration steps, and an app:update preview. All edits should be reviewed and applied in your own branches.