Reverse-engineer a legacy codebase into ATDD-ready, traceable specifications
69
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
--incremental)Re-analyze only the modules affected by code changes since the last doc-this run. Requires a completed previous run (at least through Writer) and either LSP or UA for blast-radius computation.
state.json.phase is "review" or in completed (full pipeline ran before)state.json.structural_extraction.lsp_available is true OR state.json.structural_extraction.ua_detected is truecheckpoints.writer entry exists in state.jsonIf prerequisites are not met, inform the user and suggest --regenerate=<phase> instead.
git diff <base_commit>..HEAD --name-onlyWhere <base_commit> is the most recent of:
state.json.checkpoints.writer.completed_at timestamp → git log --before="<timestamp>" -1 --format=%Hstate.json.structural_extraction.ua_commit_hash (if UA was used)Filter the diff to only source files (exclude .doc-this-sdd/, .doc-this/, docs/, test files, config files). If no source files changed, inform the user and exit.
Match each changed file path against .doc-this/context/surface.json → modules[] to identify which doc-this modules are directly affected.
For each changed file:
documentSymbol to get all exported symbolsincomingCalls → collect all calling filessurface.json)For each changed file:
knowledge-graph.json for nodes matching the file pathtarget with type imports or callssource nodes to their file paths and map to modulesUse LSP for blast radius (more accurate), cross-validate with UA edges. Log any modules that UA identifies but LSP misses — those may be non-code dependencies (config-driven wiring).
Create .doc-this/incremental-plan.md:
# Incremental Re-Analysis — [project]
**Changed files**: [list]
**Directly affected modules**: [list]
**Blast radius modules**: [list]
**Total modules to re-analyze**: [count] of [total]
## Code Analyst — re-analyze affected modules
- [ ] Module: [name] (directly affected)
- [ ] Module: [name] (blast radius)
## Detective — re-check rules in affected modules
- [ ] Re-extract rules for [module]
## Architect — update affected diagrams
- [ ] Update spec-impact-matrix rows for affected components
- [ ] Update C4 Components diagram if module boundaries shifted
## Writer — regenerate affected unit specs
- [ ] Unit: [name]
## Reviewer — validate changed specs
- [ ] Cross-check updated specsPresent the plan and ask: "[Name], I identified [N] modules affected by [M] file changes. Want to proceed with incremental re-analysis?"
Run each agent only on affected modules:
code-analysis.md sections and modules.json entries. Preserve unchanged module sections.domain.md entries. Preserve unchanged rules.Updated content replaces the corresponding section in existing artifacts:
Never delete sections for modules that weren't re-analyzed.
Update state.json:
{
"incremental": {
"base_commit": "<commit used>",
"changed_files": ["..."],
"affected_modules": ["..."],
"blast_radius_modules": ["..."],
"source": "lsp" | "ua" | "lsp+ua",
"completed_at": "2026-05-25T10:00:00Z"
}
}--regenerate=reconnaissance if the project structure changed significantly.modules.json and code-analysis.md. Flag to the user if a deleted file was the primary file for a module.git diff --diff-filter=R detects renames. Update file paths in artifacts without re-analyzing the module content.--incremental --deep → follow 2-hop call chains instead of 1-hop for blast radius. Use when user suspects wider impact..tessl-plugin
hooks
skills
doc-this
references
scripts
doc-this-architect
references
doc-this-code-analyst
references
doc-this-data-master
doc-this-design-system
doc-this-detective
references
doc-this-help
doc-this-promote
doc-this-reviewer
doc-this-scout
doc-this-tracer
doc-this-viewer
doc-this-visor
doc-this-writer