一键导入
retro-discovery
Scans a legacy codebase to identify projects, modules, technology stack, boundaries, and produces a structured discovery manifest
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scans a legacy codebase to identify projects, modules, technology stack, boundaries, and produces a structured discovery manifest
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Test failure diagnosis, source code fixes, and regression detection
Environment verification, dependency installation, baseline test verification
Contract-first single-task implementation dispatched by Coder Coordinator
Integration test writing for component boundaries and external dependencies
Unit test writing and execution with coverage threshold enforcement
API reference documentation skill. Produces and updates API endpoint documentation from contract files in .sdd/docs/api-reference.md.
| name | retro-discovery |
| description | Scans a legacy codebase to identify projects, modules, technology stack, boundaries, and produces a structured discovery manifest |
| argument-hint | Invoked by Retro-Spec Coordinator - do not call directly |
This skill is invoked by the Retro-Spec Coordinator as the FIRST skill in the pipeline. It scans the legacy codebase to identify project boundaries, module structure, technology stack, entry points, and produces a discovery manifest that guides all subsequent extraction skills.
| # | Input | Description |
|---|---|---|
| 1 | skill_path | Path to this SKILL.md file |
| 2 | source_path | Root path of the legacy codebase to scan |
| 3 | output_path | Path for the discovery manifest (.sdd/retro/discovery-manifest.md) |
list_dir recursively (max 3 levels initially). Use #tool:search/searchSubagent with the Explore agent for broad codebase structure questions.#tool:search/usages to trace symbol references and dependency graphs.output_pathnode_modules/, vendor/, venv/, .venv/, __pycache__/, dist/, build/, .git/, target/, bin/, obj/ directoriespackage.json, pyproject.toml, go.mod, Cargo.toml, pom.xml, *.csproj, *.sln, Gemfile, composer.json, CMakeLists.txtlerna.json, pnpm-workspace.yaml, nx.json, turbo.json, Cargo.toml with [workspace], settings.gradleREADME.md, CONTRIBUTING.md, docs/.github/workflows/, Jenkinsfile, .gitlab-ci.yml, .circleci/, Dockerfile, docker-compose.yml.env, .env.example, config directoriesFor each potential project root:
Record for each project:
name: Project/package name from manifestpath: Relative path from codebase rootlanguage: Primary programming languageframework: Detected framework (Express, Django, React, Spring, etc.)runtime: Runtime environment (Node.js, CPython, JVM, .NET, etc.)build_tool: Build system (npm, pip, cargo, maven, etc.)For each project, identify modules/packages:
index.ts, __init__.py, mod.rs)Record for each module:
name: Module/package namepath: Relative path from project roottype: feature | layer | utility | config | test | infrastructureentry_point: Primary entry file (if identifiable)estimated_loc: Approximate lines of code (source files only)dependencies: Other modules this module imports from (internal deps)Identify all application entry points:
main functions or equivalentapp.ts, server.py, main.go)Scan for:
Scan for:
*.test.ts, *_test.go, test_*.py, *Spec.java)Produce the following markdown document:
# Discovery Manifest
> **Codebase**: <root_path>
> **Scanned**: <ISO 8601 timestamp>
> **Total projects**: <count>
> **Total modules**: <count>
> **Total estimated LOC**: <count>
---
## 1. Codebase Overview
<2-3 sentence summary of what this codebase appears to be>
### 1.1 Project Structure
| # | Project | Path | Language | Framework | Build Tool | Est. LOC |
|---|---------|------|----------|-----------|------------|----------|
| 1 | <name> | <path> | <lang> | <framework> | <tool> | <loc> |
### 1.2 Architecture Pattern
<Inferred overall architecture: monolith, microservices, monorepo, serverless, etc.>
Evidence: <list of directory patterns and files that support this inference>
---
## 2. Project: <project-name>
### 2.1 Technology Stack
| Layer | Technology | Version | Source |
|-------|-----------|---------|--------|
| Language | <lang> | <version from manifest> | <manifest file> |
| Framework | <framework> | <version> | <manifest file> |
| Database | <db> | <version if detectable> | <config/migration file> |
| ...
### 2.2 Modules
| # | Module | Path | Type | Entry Point | Est. LOC | Internal Deps |
|---|--------|------|------|-------------|----------|---------------|
| 1 | <name> | <path> | <type> | <entry file> | <loc> | <dep list> |
### 2.3 Entry Points
| # | Entry Point | Path | Purpose |
|---|------------|------|---------|
| 1 | <name> | <path> | <what it starts/does> |
### 2.4 Infrastructure Dependencies
| # | Service | Type | Config Source |
|---|---------|------|---------------|
| 1 | PostgreSQL | Database | <path to config/migration> |
| 2 | Redis | Cache | <path to config> |
### 2.5 Test Infrastructure
| Aspect | Detail |
|--------|--------|
| Framework | <jest/pytest/vitest/etc.> |
| Config | <path> |
| Test directories | <paths> |
| Naming convention | <pattern> |
| Estimated test files | <count> |
### 2.6 Configuration
| Config File | Purpose | Key Settings |
|-------------|---------|--------------|
| <path> | <purpose> | <notable env vars or settings> |
(Repeat Section 2 for each project)
---
## 3. Cross-Project Dependencies
| From | To | Type | Evidence |
|------|-----|------|----------|
| <project A> | <project B> | <shared lib / API call / DB> | <file evidence> |
---
## 4. Exclusions
Files and directories skipped during discovery:
- <path>: <reason>
To estimate LOC without reading every file:
file_search with language-specific glob patterns to count source filesestimated_loc = file_count * average_locThis avoids reading hundreds of files while giving a useful size estimate.