AGENT SKILL

legacy-seams

When changing untested legacy code, pin the observed results with characterization tests and open the smallest seam that substitutes only the blocking dependency, separate from any later logic change. Use when a clock, random source, I/O, global, or hidden constructor blocks a test or a safe edit. Use test-driven-development for a new behavior or a bug, refactoring-guru for one named structural refactor after the seam exists, and code-refactoring-tech-debt to choose which legacy to replace.

License 许可
MIT
最近更新
2026-11-14
Stars
★ 0
Forks
0

01 前言 Front Matter

name
legacy-seams
license
MIT
description
When changing untested legacy code, pin the observed results with characterization tests and open the smallest seam that substitutes only the blocking dependency, separate from any later logic change. Use when a clock, random source, I/O, global, or hidden constructor blocks a test or a safe edit. Use test-driven-development for a new behavior or a bug, refactoring-guru for one named structural refactor after the seam exists, and code-refactoring-tech-debt to choose which legacy to replace.

02 资源文件 3

03 SKILL.md 正文

Legacy seams

Pin what the untested code does now. Open one seam. Substitute only the dependency that blocks the change. Keep the logic edit in a later change.

When to Use

Use when the code you must change has no test at the change point, and a clock, a random source, I/O, a global, or a hidden constructor blocks that test or a safe edit.

Skip code that already has a test there. Skip a greenfield routine.

Other skills keep their jobs:

  • test-driven-development owns a failing test for a new behavior or a bug.
  • refactoring-guru owns one named structural refactor after this seam exists.
  • code-perfection owns smell judgment on the lines you change.
  • code-refactoring-tech-debt owns which legacy to replace, and the larger strangler program.

Before the edit

  1. Read references/rules.md. Apply it to this change.
  2. Name the observed result that must stay, quirks included. Name the one dependency that blocks the test.
  3. Write a characterization test at the change point. Run it on the current code. It passes for the behavior you found, not the behavior you want.
  4. Name the seam and its enabling point. Select the substitute only at that point.

While editing

  • Open the seam in one behavior-preserving edit. Do not change a decision, a calculation, or an error in that edit.
  • Prefer a parameter or an object seam. Use a link or a preprocessing seam only when no explicit seam reaches the dependency.
  • Call pure single-implementation code directly. Do not wrap it.
  • If the legacy body cannot be covered in time, put the new behavior in tested code and call it from one line in the old path.
  • Translate a foreign legacy type at the seam. Do not let it enter the new model.
  • Do not add a pass-through type, a locator, or a container. Delete a transitional seam once callers no longer need it.

Stop

Stop when the characterization test passes, the blocking dependency is substitutable at the named enabling point, and the logic change is still unmixed. Log that logic change as the next edit.

Report

Report the seam name, the enabling point, the dependency substituted, the characterization test you ran, and any logic change left for later. If a transitional seam remains, say what deletes it.

Limitations

This skill does not pick which system to replace. It does not perform the named refactor. It does not write the failing test for a new rule. The rules are a distillation. Cite references/sources.md. Do not copy a locator from a source example. Conflict winners live only in that file.

04 同仓库更多 Skills

w0rxbend
w0rxbend/dot-agents

wiki-builder

Create and maintain a local Markdown research wiki (sources with provenance, compiled concept/source pages, index, maintenance log) driven by a per-wiki config. Use when the user wants to start a wiki or knowledge base, ingest sources into one, or query and update it; use wiki-page-writer for a single code deep-dive page.

★ 0
w0rxbend
w0rxbend/dot-agents

refactoring-guru

Diagnose a named code smell and apply the smallest behavior-preserving refactoring, with verification before and after and an explicit stop condition. Use for structural refactors (extract, move, consolidate, change ownership), not for feature or bug work; for readability cleanup of recent changes use code-simplification.

★ 0
w0rxbend
w0rxbend/dot-agents

idea-refine

Refine a raw idea into a one-page brief (problem statement, recommended direction, assumptions to validate, MVP scope, not-doing list) through divergent then convergent thinking. Use when an idea is still vague or you want options and a stress test before committing; use interview-me when the goal itself is unclear and spec-driven-development once the direction is chosen.

★ 0
w0rxbend
w0rxbend/dot-agents

code-review-and-quality

Review rubric and approval standard for any change before merge, including code written by you, another agent, or a human: five axes (correctness, readability, architecture, security, performance), change sizing, structural remedies, severity labels, and feedback technique. Use to judge whether a change is fit to merge; use code-review to run a PR or diff review end to end.

★ 0
w0rxbend
w0rxbend/dot-agents

code-perfection

Smell and style gate for code you write or change. Bans known code smells (long method, large class, primitive obsession, long parameter list, data clumps, duplicate code, dead code, feature envy, shotgun surgery, flag arguments, message chains) and enforces behavior-preserving structure. On Scala files, enforces worxbend style. Use while implementing, reviewing a diff for smells, or when a smell or style violation is suspected. Routine construction stays with code-complete. SOLID and DRY stay with clean-code-guard. One named structural refactor stays with refactoring-guru.

★ 0
w0rxbend
w0rxbend/dot-agents

code-complete

Construction discipline from Steve McConnell's Code Complete for implementing code: routine and class design, variable naming and data types, simple control flow, defensive checks at trust boundaries, and pseudocode-first design for complex routines. Use while writing or restructuring routines; for a post-edit quality pass use clean-code-guard.

★ 0