check-legacy

Analyzes legacy Java Spring Boot code to verify actual behavior against claimed contracts.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/zuldare/apuntesIA --skill check-legacy-zuldare
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: check-legacy
Source: https://github.com/zuldare/apuntesIA/tree/main/skills/check-legacy
Command: npx skills add https://github.com/zuldare/apuntesIA --skill check-legacy-zuldare

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Legacy Java code often lies: method names mislead, variables hold unexpected values, transactions have wrong boundaries, and hidden couplings break production after seemingly safe changes. This Skill performs zero-trust analysis of legacy Spring Boot code before you modify, refactor, or fix bugs in it. ## Core Features & Use Cases - Contract Drift Detection: Compares what methods claim to do (names, javadoc) against what they actually do by tracing execution paths. - Variable & Transaction Audits: Flags sentinel values, null-handling gaps, self-invocation bypassing @Transactional proxies, and checked exceptions that skip rollback. - Hidden Coupling & Database Reality Checks: Finds static state, ThreadLocal leaks, scheduled tasks calling modified code, and entity-to-schema mismatches. - Use Case: Before fixing a bug in an untested OrderService with 200-line methods, run this analysis to discover that a scheduled cleanup job also calls the method and that a DB trigger exists on the ORDERS table — then add characterization tests before changing anything. ## Quick Start Analyze this legacy Spring Boot service class with check-legacy before I refactor it, and report contract drift, transaction issues, and hidden couplings.

Frequently Asked Questions about check-legacy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely refactor legacy Java code with no tests?▼

First document what the code actually does versus what it claims to do, then write characterization tests that capture current behavior before changing anything. These tests detect unintended behavior changes during refactoring, even when the current behavior is wrong.

How to analyze Spring Boot code before fixing a bug?▼

Trace the actual execution path of the affected method, audit variables for null and sentinel values, and check transaction boundaries around the change. Also search for hidden callers like scheduled tasks and event listeners that interact with the modified code.

Why does @Transactional not roll back on exceptions in Spring?▼

Checked exceptions do not trigger rollback by default in Spring; you must specify rollbackFor on the @Transactional annotation. Additionally, self-invocation bypasses the Spring proxy, so @Transactional on a method called via this.method() has no effect.

What is a characterization test in legacy code?▼

A characterization test captures the current behavior of code, even if that behavior is wrong, rather than asserting desired behavior. If it fails after a change, you know behavior changed and can evaluate whether that was intentional.

When should I run legacy code analysis before modifying code?▼

Run it before modifying any legacy class, fixing bugs in old code, or refactoring — especially when code predates Spring Boot 3.x, has no tests, or contains methods longer than 50 lines. It is also essential when a fix worked locally but broke in production.