rails-cto-production-pr
Skill15 starsChanged 7 months agoMITView on GitHub
Create a production pull request merging staging into main using the gh CLI. Use this skill whenever the user asks to create a production PR, deploy to production, cut a release, or says things like "release to production", "production PR", "deploy this", "ship to prod", "create a production PR", or "merge staging to main". Also triggers for "/production-pr". Do NOT use for creating feature PRs to staging — use rails-cto-pull-request for that.
- Commits and pushes
In this repository17 other files it gives its agents.
- claude/CLAUDE.mdCLAUDE.md
- rails-cto-apiSkill
- rails-cto-architectSkill
- rails-cto-commitSkill
- rails-cto-engineerSkill
- rails-cto-erbSkill
- rails-cto-minitestSkill
- rails-cto-pull-requestSkill
- rails-cto-qaSkill
- rails-cto-restfulSkill
- rails-cto-securitySkill
- rails-ctoSkill
- rails-cto-static-analysisSkill
- rails-cto-stimulusSkill
- rails-cto-tailwindSkill
- rails-upgradeSkill
- rails-viewcomponentsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Create a pull request to merge staging into main for a production release using the gh CLI.
- Distinctive: line 18
If there are any uncommitted or unstaged changes, warn the user and stop.
- Very specific: line 32
If an open PR from staging to main already exists, warn the user with the existing PR link and stop.
- Very specific: line 36
Before creating the PR, merge main into staging so the branches stay in sync and the PR is clean.
- Very specific: line 44
Check out staging and merge main into it:
- Distinctive: line 51
If there are merge conflicts, try to resolve them.
- Distinctive: line 58
If you cannot resolve the conflicts, abort the merge, return to the original branch, and tell the user which files have conflicts so they …
- Distinctive: line 65
After a successful merge, push staging:
- Distinctive: line 80
Read the commit messages and diffs to understand what changed and why.
- Distinctive: line 84
Use this exact format with today's date:
- Distinctive: line 92
Write the description in plain language that anyone can understand.
- Distinctive: line 94
Do NOT include co-authorship lines or reference "Claude" or any AI tool anywhere.
- Distinctive: line 121
If there are only major changes, omit the "Minor Changes" section.
- Distinctive: line 142
After creation, show the user the PR URL.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Production Release
Create a pull request to merge staging into main for a production release using the gh CLI.
Workflow
1. Check for uncommitted changes
git status --porcelainIf there are any uncommitted or unstaged changes, warn the user and stop. Production releases should start from a clean working tree.
2. Fetch the latest
git fetch origin3. Check for an existing release PR
gh pr list --head staging --base main --state openIf an open PR from staging to main already exists, warn the user with the existing PR link and stop.
4. Sync staging with main
Before creating the PR, merge main into staging so the branches stay in sync and the PR is clean.
Save the current branch so you can return to it later:
ORIGINAL_BRANCH=$(git branch --show-current)Check out staging and merge main into it:
git checkout staging
git merge origin/mainIf there are merge conflicts, try to resolve them. Read the conflicting files, understand both sides, and make the appropriate fix. After resolving, stage the resolved files and complete the merge:
git add -A
git merge --continueIf you cannot resolve the conflicts, abort the merge, return to the original branch, and tell the user which files have conflicts so they can handle it manually:
git merge --abort
git checkout "$ORIGINAL_BRANCH"After a successful merge, push staging:
git push origin staging5. Gather the changes
Review what staging has that main doesn't:
git log origin/main..origin/staging --oneline
git diff origin/main...origin/staging --statRead the commit messages and diffs to understand what changed and why.
6. Write the PR title
Use this exact format with today's date:
Production Release: mm-dd-yyyy7. Write the PR description
Write the description in plain language that anyone can understand. Use emojis for section headers. Organize changes so readers can quickly tell what's significant and what's minor.
Do NOT include co-authorship lines or reference "Claude" or any AI tool anywhere. Do NOT list individual files changed.
Use this structure:
## 🚀 Summary
A 1-2 sentence overview of what this release includes and why it matters.
## 🔥 Major Changes
- Describe significant changes here — new features, important fixes, behavior changes
- Each bullet should explain what changed from a user or product perspective
- Include enough context that someone unfamiliar with the code understands the impact
## 🔧 Minor Changes
- Small tweaks, formatting fixes, config updates, copy changes
- Things that are good to know about but don't need close review
## 🧪 Test Plan
- Describe what should be tested before deploying
- List specific areas to verify based on the changes
- Do not use checkboxes — use plain bullet pointsIf there are only major changes, omit the "Minor Changes" section. If everything is minor, omit "Major Changes." Use your judgment.
8. Create the PR
gh pr create --base main --head staging --title "Production Release: mm-dd-yyyy" --body "$(cat <<'EOF'
## 🚀 Summary
...
## 🔥 Major Changes
...
## 🔧 Minor Changes
...
## 🧪 Test Plan
...
EOF
)"After creation, show the user the PR URL.
9. Return to the original branch
git checkout "$ORIGINAL_BRANCH"Return the user to whatever branch they were on before running this skill.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

