code-archaeologist

Analyze legacy codebases and produce a structured refactoring plan with dependencies and risk assessment.

3|2|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/grasberg/sofia --skill code-archaeologist-grasberg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-archaeologist
Source: https://github.com/grasberg/sofia/tree/main/workspace/skills/code-archaeologist
Command: npx skills add https://github.com/grasberg/sofia --skill code-archaeologist-grasberg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Excavate meaning from legacy codebases, enabling safe refactoring, understanding undocumented behavior, and assessing technical debt. Activate for unfamiliar code, old systems, reverse-engineering tasks, dependency analysis, or "why is it built this way" questions.

Core Features & Use Cases

  • Survey and map codebase structure, identify entry points, tests, and key dependencies.
  • Trace data and control flow, identify core domain objects, and document implicit contracts and decisions.
  • Plan incremental refactoring using strategies like the Strangler Fig pattern, and write characterization tests to protect behavior.

Quick Start

Tell the Code Archaeologist to survey a codebase and outline a safe, incremental refactoring plan.

Frequently Asked Questions about code-archaeologist

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

FAQPage Schema
How do I plan safe refactoring for legacy code?

Plan safe refactoring by surveying the codebase structure, tracing data and control flow, and applying incremental strategies like the Strangler Fig pattern alongside characterization tests to protect existing behavior.

What is the Strangler Fig pattern for legacy code migration?

The Strangler Fig pattern enables incremental refactoring by gradually replacing legacy system functionality with new implementations, allowing safe migration without high-risk big-bang rewrites.

How do I reverse engineer undocumented behavior in old systems?

Reverse engineer undocumented behavior by mapping codebase entry points, tracing data and control flow to identify core domain objects, and documenting the implicit contracts and decisions behind legacy code.

How do I write characterization tests for legacy code?

Write characterization tests to capture and protect the current behavior of legacy code before refactoring, ensuring existing undocumented functionality remains unchanged during incremental migration.

What is the best way to analyze dependencies before refactoring?

Analyze dependencies by mapping key relationships within the codebase, assessing technical debt and risk, and producing a structured stepwise refactoring plan with supporting documentation.

When should I not use incremental refactoring on legacy code?

Incremental refactoring may not suit legacy codebases lacking identifiable entry points or core domain objects, as tracing data flow and applying the Strangler Fig pattern requires mappable structure.