migration
Applies a database migration/SQL to production with a safe protocol.
Skill by stage2dev
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/stage2dev-migration
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/migration
Tools it pre-approves 4
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Bash(sh"${CLAUDE_PLUGIN_ROOT}/scripts/py"scripts/guarda.pyinfo)
What's inside
- Skill name
migration- Description
- Applies a database migration/SQL to production with a safe protocol. Use on: merged, apply the migration, where is the SQL; mergeei, pode aplicar, aplica a migration. Only on the owner's explicit request this turn.
- License
- MIT
- Allowed tools
- Bash(sh, "${CLAUDE_PLUGIN_ROOT}/scripts/py", scripts/guarda.py, info)
- Instructions
- 41 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves some shell commands
Files (1)
- SKILL.md
SKILL.md (first lines)
# Migration in production
Target: $ARGUMENTS
## Context (injected)
Context: !`sh "${CLAUDE_PLUGIN_ROOT}/scripts/py" scripts/guarda.py info`
Fields: `language`, `owner`, `reply_style`, `names{}`, `models{}`, `forbidden_subagent_models` (default `["fable"]`), `profile_path`, `plans_dir`, `setup_done`, `tools`, `plugin_source`, `catalog_path`. Write every reply and document in `language`. Never hardcode marker or document names: use the values in `names` (keys such as `need_you`, `progress`, `part_closed`). Call the user `owner`. If the JSON did not load, run the command once with Bash.
Short final reply. Read the project profile (`profile_path`): what production is, ids, database tools, type regeneration, what never to touch.
## Steps
1. **Request in this turn.** Writing to production needs the owner's request in their own words THIS turn ("go ahead and apply", "apply it"). A "yes" to another question, a vague "go", or "recommended" do not count. Without it: write `names.need_you` asking for the words, and stop.
2. **Deploy order.** Is the PR merged? (`gh pr view --json state`). The migration goes BEFORE the backend that depends on it. If the backend already shipped without the migration, warn about the risk before applying.
3. **Read the whole file.** Every statement. Look for: DROP, REVOKE, DELETE without WHERE, triggers, `SECURITY DEFINER`, backfill, long locks.
4. **Pre-checks (SELECT only on production).** Current state: columns and tables, real production policies (the repo may be stale), affected data (count), whether the migration was already applied.
5. **Backup and undo.** Before touching data: back up the affected rows and write the SQL that undoes it. Keep them in the scratchpad.
6. **Apply.** One of two routes:
- Through the database tool in the profile, in small slices: one DELETE per call; DROP/REVOKE in a block often fails.
- A single file `BEGIN; ...; migration-table record; COMMIT;` + a verification SELECT, tested first on a local Postgres, then copied to the clipboard for the owner to paste in the SQL editor.
7. **Verify the effect.** Query the catalog (columns, policies, functions, counts). "Success" proves nothing.
8. **Stamp.** The version stored in the migrations table may differ from the file name in the repo. If it differs, note it to align.
9. **Types.** If the profile says to regenerate types after a schema change, do it and leave it as a local change for the PR.
10. **Record.** Progress file of the phase (`names.progress`): what was applied, time, verification, undo. If the project has a Claude memory, record a short note there too.
## Rules
- Denied by the permission classifier: do not retry another way. Hand over the ready SQL and ask the owner to apply it.
- Failed midway: stop. Say what was already applied and run the state queries before any retry.
- Real customer data in production: only with a clear request and a backup done.
- Never write a secret (connection string, password) in a file, PR or memory.
## Answer
- What was applied and the proof (query + result).
- How to undo.
- Next step in the deploy order and whose it is (owner or you).From stage2dev/tune-up, MIT.
More from stage2dev/tune-up
- 0.567score
setup
stage2dev
First-run setup of tune-up - language, owner, reply style, kinds of use, user.json, optional tools (gh, claude-mem, fast-jev, Caveman, Ponytail, Graphify, ECC).
SkillAFreshness: AClaude Code +9 - 0.567score
design
stage2dev
Builds the design system (DESIGN.md with tokens) and a static HTML prototype made from it.
SkillAFreshness: AClaude Code +9 - 0.561score
evaluate
stage2dev
Evaluates a third-party repo, skill or plugin before importing it.
SkillAFreshness: AClaude Code +9 - 0.561score
handoff
stage2dev
Writes a HANDOFF.md plus a pasteable prompt to continue in a new session.
SkillAFreshness: AClaude Code +9 - 0.561score
investigate
stage2dev
Investigates a bug, pasted error, "stopped answering", failed booking or customer conversation.
SkillAFreshness: AClaude Code +9 - 0.561score
learn
stage2dev
Records a new rule in memory, project or user rules (or the plugin source, if set).
SkillAFreshness: AClaude Code +9 - 0.561score
new-project
stage2dev
Creates a new project folder with git, docs, plans, tests, CI and agent rules from the talk's vision; the user picks the stack.
SkillAFreshness: AClaude Code +9 - 0.561score
part
stage2dev
Runs ONE Part of an already planned phase item by item, with Opus reviewers and a gate, then STOPS.
SkillAFreshness: AClaude Code +9 - 0.561score
profile
stage2dev
Creates or updates the project profile (.tune-up/project.md and config.json) by detecting git, stack, tests, database and deploy.
SkillAFreshness: AClaude Code +9 - 0.561score
research
stage2dev
Research that changes NOTHING.
SkillAFreshness: AClaude Code +9 - 0.561score
ship
stage2dev
Commits and opens the PR with an honest body.
SkillAFreshness: AClaude Code +9 - 0.561score
skills
stage2dev
Finds the right skill for a task in the tune-up skills catalog and loads only that one.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 20, 2026 (8 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/stage2dev/tune-up
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from stage2dev
- 0.567score
design
stage2dev
Builds the design system (DESIGN.md with tokens) and a static HTML prototype made from it.
SkillAFreshness: AClaude Code +9 - 0.567score
setup
stage2dev
First-run setup of tune-up - language, owner, reply style, kinds of use, user.json, optional tools (gh, claude-mem, fast-jev, Caveman, Ponytail, Graphify, ECC).
SkillAFreshness: AClaude Code +9 - 0.561score
investigate
stage2dev
Investigates a bug, pasted error, "stopped answering", failed booking or customer conversation.
SkillAFreshness: AClaude Code +9 - 0.561score
handoff
stage2dev
Writes a HANDOFF.md plus a pasteable prompt to continue in a new session.
SkillAFreshness: AClaude Code +9 - 0.561score
evaluate
stage2dev
Evaluates a third-party repo, skill or plugin before importing it.
SkillAFreshness: AClaude Code +9 - 0.561score
talk
stage2dev
Talk mode - interview, brainstorm and persona debate that turns an idea into project documents, no code.
SkillAFreshness: AClaude Code +9
Cite this page
migration skill. Agent Mart. https://agentmart.dev/skills/stage2dev-migration (last updated 2026-10-24)