trove-refactor
Behavior-preserving change to structure: rename, extract, inline, dedupe, move, or migrate an internal API. Pin behavior first, migrate callers and delete the legacy API in one wave, prove behavior unchanged on the real artifact. Use for refactors and internal-API migrations.
- License 许可
- MIT
- 所属仓库
- bravew/trove
- 最近更新
- 2026-11-12
- Stars
- ★ 10
- Forks
- 1
01 前言 Front Matter
- name
- trove-refactor
- metadata
- { "trove-category": "code", "trove-category-label": "Code" }
- description
- Behavior-preserving change to structure: rename, extract, inline, dedupe, move, or migrate an internal API. Pin behavior first, migrate callers and delete the legacy API in one wave, prove behavior unchanged on the real artifact. Use for refactors and internal-API migrations.
03 SKILL.md 正文
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly --> <!-- Regenerate: bun run build:skills -->
Session Init
This skill ships Trove conventions. Prefer existing project patterns over generic best practices when they conflict.
If a sibling skill in this plugin matches the request more directly, defer to it. See AGENTS.md (or docs/routing.md in the marketplace) for the per-plugin routing index.
trove-refactor
A refactor changes structure while holding behavior constant. The discipline is proving that "constant" is true.
Workflow
- Pin the behavior. Characterization test or snapshot of current behavior first. A type-check and a lint passing are not a behavior pin — they don't catch a changed result.
- Name the target shape. What the structure should be after (use
trove-architectfor non-trivial reshapes). - Subtract before adding. Remove dead weight and duplication first, then build on the simpler base.
- Small behavior-preserving steps. Migrate callers and delete the legacy API in the same wave (
trove-principle-migrate-then-delete); don't leave a compatibility shim. - Prove it unchanged. Re-run the pinned behavior against the real artifact — same inputs, same outputs.
trove-verify. - Confirm reader load dropped. If the change didn't make the code easier to trace, question whether it earned its place.
Anti-patterns
- Smuggling behavior change into a refactor. If behavior must change, that's a separate, named change with its own test — split it out.
- Calling a green type-check "proof". Behavior parity needs a behavioral check, not a compile.
- Leaving the old API alive "just in case." That's two ways to do one thing; delete it in the same wave.
For a large or cross-cutting refactor (a migration across many call sites), treat each component as its own small step with its own behavior pin.
04 同仓库更多 Skills
using-trove
Skill discipline anchor for the Trove marketplace. Loaded once per session; routes the agent to the right trove-* skill before code, planning, review, or git actions.
trove-write-skill
Skill authoring workflow. Use when creating or updating a Codex or Trove skill, including rubrics, tasks, metadata, and validation.
trove-worktree
Git worktree workflow for spikes, risky experiments, and broad refactors that should not disturb the user's current branch.
trove-why
Reconstruct design rationale and decision history from evidence — source control, issue tracker (Linear), docs (Notion), chat (Slack), error tracking (Sentry) — with calibrated confidence. Use for "why does X work this way", "why did we pick Y", regressions, and postmortems. Use trove-explain for how it works now.
trove-verify
Completion verification workflow. Use before claiming done, fixed, complete, ready, or shipped.
trove-unslop
Cut AI tells from writing — PR descriptions, release notes, specs, commit bodies, and replies. Use before finalizing prose, or when the user asks to clean up, de-slop, or make text sound human.