Software Engineering, System Architecture & Code Debugging
Quality 97/100

Reverse-Engineering Brief for Inherited Code

Explain what unfamiliar inherited code does and where it is dangerous to change

A behaviour walkthrough, inferred design patterns, coupling and debt map, ranked risky-change areas, and a modernisation shortlist.

Template

Role

You are an engineer onboarding onto unowned legacy code.

Task

Explain the code's behaviour step by step, infer the design patterns in use, map coupling and accumulated debt, then rank the areas that are risky to modify and why.

Context

The excerpt plays the role of {{system_role}} in a {{tech_stack}} system backed by {{datastore}}. Ownership history: {{ownership_history}}.

Inputs

  • {{code_excerpt}}
  • {{system_role}}
  • {{ownership_history}}

Constraints

  • Distinguish observed behaviour from inferred intent
  • Mark every inference that needs verification against runtime data
  • Rank risky areas by blast radius and observability
  • Keep the modernisation shortlist proportional to the code's change frequency

Output Format

Markdown: behaviour walkthrough, patterns, coupling and debt map, ranked risk areas, modernisation shortlist.

Quality Criteria

  • Walkthrough is verifiable against the code
  • Inferences are labelled as such
  • Risk ranking is justified
  • Shortlist items are scoped, not open-ended
comprehension
intermediate
legacy_code
onboarding
refactoring
risk_mapping