Loading...
Loading...
Analyze codebase structure for reverse engineering. Identify entry points, dependencies, modules, and components with file:line traceability. Creates manifest.json for pipeline chaining with Phase 2 (logic visualization). Language-agnostic with optional language reference files. Use when: reverse engineer, analyze structure, structure analysis, codebase analysis, re-structure-analysis.
npx skill4agent add caldiaworks/caldiaworks-marketplace re-structure-analysismanifest.jsonfile:linenamelanguage.cs*.csprojcsharp.pypyproject.tomlsetup.pypython.ts.tsxpackage.jsontypescript.javapom.xmlbuild.gradlejavagenericreferences/{language}.mdmcp__serena__find_symbolmkdir -p docs/reverse/{name}
mkdir -p docs/reverse/{name}/verificationmanifest.json{
"name": "{name}",
"language": "{detected-language}",
"created": "{YYYY-MM-DD}",
"updated": "{YYYY-MM-DD}",
"targets": {
"entry_points": ["{user-specified targets}"],
"classes": ["{extracted class names}"],
"specified_by": "user"
},
"phase1": {
"status": "in_progress",
"output": null,
"verification": null,
"targets_for_phase2": []
},
"phase2": {
"status": "pending",
"completed": [],
"remaining": [],
"targets_for_phase3": []
},
"phase3": {
"status": "pending",
"completed": [],
"remaining": []
},
"phase4": {
"status": "pending",
"output": null,
"verification": null
}
}mcp__serena__get_symbols_overview(relative_path="{target}", depth=1)
mcp__serena__find_symbol(name_path_pattern="Main|main|__main__|app")*.csprojpyproject.tomlpackage.jsonpom.xmlgraph TD
ModuleA --> ModuleB
ModuleA --> ExternalLib
ModuleB --> ModuleC!=>=[]()byte[]List<string>byte arraystring listMethod()MethodA["Node text (L45)"]mcp__serena__search_for_pattern(
substring_pattern="class |interface |def |function ",
restrict_search_to_code_files=true
)
mcp__serena__get_symbols_overview(relative_path="{directory}", depth=2)| Component | Type | File:Line | Description |
|---|---|---|---|
| OrderService | class | src/services/order.py:15 | Order processing service |
{
"class": "OrderService",
"file": "src/services/order.py",
"methods": ["process_order", "validate_order", "calculate_total"]
}docs/reverse/{name}/01-structure-map.md# Structure Map: {name}
**Analysis Date**: {YYYY-MM-DD}
**Target**: {relative path}
**Language**: {language}
**Framework**: {detected framework and version}
**Confidence**: {High / Medium / Low}
**Important**: All paths are relative to workspace root.
## Technology Stack
### Framework and Language
| Component | Version | Source |
|:----------|:--------|:-------|
| {language} | {version} | {file:line} |
### Dependencies
| Package | Version | Purpose | Source |
|:--------|:--------|:--------|:-------|
| {package} | {version} | {purpose} | {config-file:line} |
## Directory Tree
{tree output with functional annotations}
## Entry Points
| Entry Point | File:Line | Purpose | Evidence |
|:------------|:----------|:--------|:---------|
| {name} | [{file}:{line}]({file}:{line}) | {purpose} | Line {N} |
## Dependency Diagram
```mermaid
graph TD
...| Component | Type | File:Line | Description |
|---|---|---|---|
| {name} | {class/interface/function} | {file}:{line} | {description} |
**Update manifest:**
- Set `phase1.status` to `"completed"`
- Set `phase1.output` to `"01-structure-map.md"`
- Populate `phase1.targets_for_phase2` with the Phase 2 target list
- Update `phase2.remaining` with all component names from targets_for_phase2
- Update `updated` timestamp
## Validation Before Completion
Before writing output, verify:
- [ ] Every finding has a `file:line` reference
- [ ] No speculative content (all claims verifiable in source)
- [ ] Mermaid diagrams use valid syntax (no special characters)
- [ ] All file paths are relative to workspace root
- [ ] Component list is exhaustive within target scope
- [ ] manifest.json is valid JSON with all required fields
- [ ] `targets_for_phase2` contains entries for all components with analyzable methods
## Prohibited Actions
- Do NOT execute code or run build commands
- Do NOT infer business logic from variable names alone
- Do NOT add components not present in the source code
- Do NOT modify any source files
- Do NOT include absolute file paths in output