AGENT SKILL

book--working-effectively-with-legacy-code--nano

Working with Legacy Code (Michael Feathers) — Minimal rules — essential one-liners only. Use when asked to apply Working with Legacy Code principles or review code against Working with Legacy Code standards.

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

01 前言 Front Matter

name
book--working-effectively-with-legacy-code--nano
origin
github.com/ciembor/agent-rules-books (MIT)
license
MIT
version
1.0.0
description
Working with Legacy Code (Michael Feathers) — Minimal rules — essential one-liners only. Use when asked to apply Working with Legacy Code principles or review code against Working with Legacy Code standards.
compatibility
yana-ai >= 0.14.0

03 SKILL.md 正文

OBEY Working Effectively with Legacy Code by Michael Feathers

When to use

Use when changing poorly tested or poorly understood code under a tight context budget.

Primary bias to correct

Legacy work starts with control, not cleanup, rewrite, or elegance.

Decision rules

  • Treat code without trustworthy tests as legacy code: state what changes and what must remain.
  • Characterize uncertain current behavior before changing it, including ugly behavior consumers may rely on.
  • Use the legacy loop: find the change point, find an observation point, create or exploit a seam, break the blocking dependency, test, change, then refactor locally.
  • Prefer fast focused tests; use broader harnesses only as temporary first coverage when no narrow test point exists.
  • Create the narrowest useful seam for sensing or separation, and break only dependencies that block feedback.
  • Use sprout, wrap, parameterize, inject, extract, or override moves when direct edits would be unsafe.
  • Keep behavior changes, structural refactorings, and cleanup separate and small.
  • Do not leave test-only seams, hidden dependencies, wrappers, globals, subclass tricks, or link/preprocessor tricks without a cleanup plan.

Trigger rules

  • When behavior is unclear, characterize first.
  • When constructors, globals, statics, frameworks, I/O, clocks, randomness, environment, or deep object graphs block testing, break one dependency at the narrowest point.
  • When a large method or class defeats local reasoning, sketch effects and create a seam before semantic edits.
  • When rewrite or broad cleanup feels tempting, choose the next smaller verified move.

Final checklist

  • Behavior characterized?
  • Feedback fast enough?
  • Dependency isolated?
  • One kind of change?
  • Safer and clearer now?

04 同仓库更多 Skills

Horonomos-laps
Horonomos-laps/Yana-AI

openai--sentry--sentry

Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

ito-basket-compare

Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

implementing-network-traffic-baselining

Build network traffic baselines from NetFlow/IPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly/daily traffic pattern profiling

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

detecting-evasion-techniques-in-endpoint-logs

Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

implementing-microsegmentation-with-guardicore

Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.

★ 13
Horonomos-laps
Horonomos-laps/Yana-AI

ramdisk-tmpfs-patterns

暂无简介

★ 13