跳到正文
cccskills
免费在 GitHub 公开

legacy

Apply this opinionated workflow when modernizing legacy systems: strangler fig pattern, branch by abstraction, characterization tests, incremental monolith decomposition, framework upgrades, feature-flagged migration with rollback.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md4.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Legacy Modernization

Incremental migration of running systems. The constraint that shapes every decision here: the system is in production and must keep working while it changes.

The sequence

Order matters more than the individual techniques — each step exists to make the next one safe.

  1. Characterize before changing. Write tests that pin current behaviour, bugs included. You are not testing what the code should do; you are recording what it does, so a behaviour diff becomes visible. When an assertion looks wrong, that is the point — write it down and say so:

    def test_domestic_lightweight():
        order = {"weight": 5, "destination": "domestic", "priority": False}
        # Current behaviour: nothing charged under 10kg. Looks like a bug —
        # pin it here, fix it as its own change after the migration lands.
        assert calculate_shipping_cost(order) == 0.0
    

    Golden-master or approval tests (approvaltests, syrupy) get coverage over gnarly code fastest, because they capture output wholesale instead of requiring you to understand it first.

    Then check the net actually holds: run a mutation tester over the code you are about to change. Characterization suites routinely look thorough and still miss the exact branch you're about to touch — surviving mutants tell you where, before an incident does.

  2. Insert a seam. Branch by abstraction: introduce an interface over the thing you're replacing, and route all callers through it while it still delegates to the old code. This is a no-op change you can ship and verify on its own.

  3. Build the replacement behind the seam, dark or flagged off. It isn't serving traffic yet, so it can be wrong.

  4. Shift traffic incrementally with a flag — internal users, then a percentage, then all. Each step is reversible in the time it takes to flip the flag, which is the property that makes this safe. Name the rollback trigger as a metric and a threshold before each ramp ("error rate above 0.5% for five minutes → back to the previous percentage"). Deciding what counts as bad while it is happening is how a ramp turns into an argument instead of a rollback.

  5. Delete the old path only after the new one has run clean in production for long enough to cover its slow cases — month-end jobs, seasonal peaks, the annual report. Deleting early is how you discover a code path nobody remembered.

Conventions

  • No big-bang rewrites. A rewrite competes with a moving target: the old system keeps shipping features while the new one catches up. Every successful modernization in this playbook is incremental for that reason.
  • Every step ships and is reversible. A migration that only works when fully complete has no safe abort point — and something always interrupts a long migration.
  • Parallel-run before cut-over for anything computing money or state. Run old and new against the same input, compare outputs, log divergence, keep serving the old result. Divergence you can see beats divergence a customer reports.
  • Strangler fig for the overall shape: a facade in front, routing per-feature to old or new, moving one route at a time until nothing reaches the old system and it can be removed.
  • Preserve behaviour by default, including bugs. Something downstream depends on the odd ones. Fix them as separate, visible changes — never folded into a migration, where a behaviour change is indistinguishable from a migration defect.
  • Database migrations expand and contract: add the new column, dual-write, backfill, switch reads, then drop the old — each phase deployable on its own, each compatible with the version of the code running beside it.
  • New code written against the legacy system still meets current standards. Matching the surrounding style "for consistency" is how a modernization ends with more legacy code than it started with.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Write a short, fact-checked reply that answers a colleague's question in one meaning only, ready to copy and paste. The input is their pasted message. Check the claims against the code first, use the project glossary terms, and print only the reply in chat. Read-only — no writes to code, the issue tracker, GitHub, chat or any MCP. Use on "/cortex-communication:answer-buzzkill", "help me answer", "reply to this question", or when the user pastes a colleague's question and asks for an answer in the same manner.

中文简介正在准备中。当前显示原文说明。

alexander-danilenko/cortex-claude-code-plugins172026年10月13日 更新

Apply these opinionated .NET 8 architecture conventions whenever structuring or reviewing a backend service: clean architecture layering and which direction dependencies point, when CQRS with MediatR is worth it, cross-cutting concerns as pipeline behaviours, minimal APIs grouped by feature, keeping DbContext in Infrastructure, health checks and structured logging, WebApplicationFactory integration tests, and when AOT pays off.

中文简介正在准备中。当前显示原文说明。

alexander-danilenko/cortex-claude-code-plugins172026年10月13日 更新

Apply these opinionated testing conventions whenever writing, reviewing, or planning tests: what earns a test and what is coverage theatre, asserting outputs rather than mock calls, the three modes (functional, performance, security), naming and isolation rules, where to mock, and reporting findings for coverage rather than self-filtering. Includes house Jest standards for NestJS unit and contract tests, TDD discipline, and test-report structure.

中文简介正在准备中。当前显示原文说明。

alexander-danilenko/cortex-claude-code-plugins172026年10月13日 更新

Apply these opinionated Python 3.11+ conventions when writing Python in this codebase: type hints with mypy, async/await, pytest fixtures, dataclasses, Poetry packaging, production patterns.

中文简介正在准备中。当前显示原文说明。

alexander-danilenko/cortex-claude-code-plugins172026年10月13日 更新

csharp

免费

Apply these opinionated C# conventions whenever writing or reviewing C# 12 / .NET 8+ code: nullable enabled with warnings as errors, records and primary constructors, pattern matching over cast chains, the Result pattern for expected failures, async all the way with CancellationToken, IOptions config, IHttpClientFactory, and never returning EF entities from an API.

中文简介正在准备中。当前显示原文说明。

alexander-danilenko/cortex-claude-code-plugins172026年10月13日 更新

ALWAYS invoke for any task involving docstrings, JSDoc/TSDoc, or REST API documentation — even when the request seems handleable without it. Enforces Microsoft contract-first conventions and a bare-minimum rule that Claude won't apply by default: never restate the signature, drop @param/@returns that only echo names and types, always document @throws, and document data shapes as WHAT not WHY. Covers Python docstring styles (Google/NumPy/Sphinx), TSDoc tags and @inheritDoc, and API doc patterns for NestJS/Express/FastAPI/Django. Trigger on: adding or auditing docstrings, redundant or missing tags, deleting comment rot, or producing a documentation-health report. Do not skip for documentation tasks — consistent conventions are the whole point.

中文简介正在准备中。当前显示原文说明。

alexander-danilenko/cortex-claude-code-plugins172026年10月13日 更新

查看 alexander-danilenko 的全部技能

报告此技能的问题