AGENT SKILL

migration

Plan and verify risky migrations and removals. Use when changing a schema or stored data, removing or renaming a public API, flag, config format, or export, replacing a system, or when the task's Risk names item 1 or 3.

License 许可
MIT
所属仓库
carsimax/construct
最近更新
2026-10-30
Stars
★ 1
Forks
1

01 前言 Front Matter

name
migration
description
Plan and verify risky migrations and removals. Use when changing a schema or stored data, removing or renaming a public API, flag, config format, or export, replacing a system, or when the task's Risk names item 1 or 3.

02 资源文件 1

03 SKILL.md 正文

Migration

A migration changes something other code or stored data depends on. Old and new consumers stay valid at every phase, so any phase can stop or roll back.

Rules

  • Never alter a column, field, format, or public name in place. Add the new shape beside the old one.
  • Start with additive steps. The destructive step goes last, by itself, in its own unit, once nothing references the old shape.
  • Each phase carries a verifier and a rollback that was really executed. A down path that was only written means the phase is not ready.
  • Backfills are reversible or backed up, run in bounded batches, and are safe to run twice.
  • Deprecate only with a working replacement. Remove only when usage is proven zero (search results, logs, or metrics; say which).
  • Internal consumers migrate in the same plan. External or unknown consumers get an advisory deprecation. If the down path cannot be proven, removal stops.

Flow

  1. Classify. Stored data or schema, public name, or a whole system. This work is Risk item 1 or 3, so it is tracked in .vault/tasks/ and its units are reviewed (below).
  2. Ask at most one blocking question, only when the answer changes the plan. Without an answer, default to an advisory deprecation with no hard date.
  3. Plan the phases from references/phases.md: pattern, per-phase verifier and rollback, removal condition. The parent writes the plan; it does not edit code itself.
  4. Save the plan with mem_save (type decision) under topic_key migration/<name>. A notice updates that entry.
  5. One phase per unit. Delegate each phase to construct:worker, test-first, with the phase's rollback as an acceptance check. A contract step never shares a unit with an earlier phase.
  6. Review. Each unit is Risk item 1 or 3, so it gets construct:review before it counts as done, and the publication gate denies git push, gh pr create, and gh release create until the lenses approve. command-guard denies --no-verify, and the Risk-line gate blocks added skipped or stub tests, so neither is a way around a failing phase.

Report

Close with, per phase: what changed, its verifier result, its rollback and whether it ran, the removal condition, and the zero-usage evidence for any removal. End the reply with the Risk line naming item 1 or 3.

Reference

  • references/phases.md: expand-migrate-contract, code patterns, deprecation notice, removal, rejected shortcuts.

04 同仓库更多 Skills

carsimax
carsimax/construct

workflow

The ADD protocol for every implementation request, feature plan, resume, task sizing, and the closing Risk line.

★ 1
carsimax
carsimax/construct

sources

Ground version-dependent code in official documentation. Use when you name a specific uncertainty about a library or framework API, a version-dependent pattern, or a deprecation. Skip when the repository already shows the pattern.

★ 1
carsimax
carsimax/construct

review

Mandatory outside review of high-risk work units, by lens agents the hooks feed and record, plus the dual blind review on request. Trigger: a unit whose Risk names an item is ready to publish, the publication gate denied a push, PR, or release, or the user asks for a review, a dual review, or an adversarial review.

★ 1
carsimax
carsimax/construct

delivery

Plan commits, branches, and pull requests as reviewable units. Use when deciding commit contents, opening or preparing a PR, splitting large work into sub-branches of a feature branch, or preparing a release.

★ 1
carsimax
carsimax/construct

delegation

When and how the ADD orchestrator delegates to construct agents: role mapping, allowed edit surfaces, parallel writers, verifier timing, handoff prompts, and relaying a subagent's blocking question or choice menu. Trigger: deciding to delegate, launching an agent, writing a handoff, or a subagent or tool returns a question, menu, or consent request.

★ 1
carsimax
carsimax/construct

debugging

Root-cause debugging for failures and unexpected behavior: stop the line, reproduce, localize, reduce, fix the cause, guard with a RED-first regression test, resume only after the verifier passes. Trigger: failing tests, broken build, a regression, an error or stack trace, or behavior that differs from what was expected. Load it before diagnosing.

★ 1