generate-retro-spec
Reverse-engineers legacy code into strict, DRY, SDD-compliant Markdown specifications using a root index and standardized child templates.
Skill by jericbas
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/jericbas-generate-retro-spec
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/generate-retro-spec
What's inside
- Skill name
generate-retro-spec- Description
- Reverse-engineers legacy code into strict, DRY, SDD-compliant Markdown specifications using a root index and standardized child templates.
- License
- MIT
- Instructions
- 57 lines in SKILL.md · view on GitHub
Files (3)
- README.md
- SKILL.md
- SDD-TEMPLATE.md · templates/
SKILL.md (first lines)
## Install
Run:
`npx skills add jericbas/skills --skill generate-retro-spec`
# Trigger Command: /generate-retro-spec
**Purpose:** Interactively scans undocumented legacy code and reverse-engineers it into a structured, SDD-compliant Markdown specification. It uses a root `spec.md` as an index and generates standardized child files (`spec-[name].md`). It prioritizes reading a local `tmp/.retro-spec-config.json` file to bypass manual data entry, integrates `/graphify` for dependency mapping, and actively prevents cross-module architectural conflicts.
## Instructions for the Agent:
1. **Step 1: Configuration Pre-Flight Check**
* Scan the repository root for a configuration file located at `tmp/.retro-spec-config.json`.
* If the file exists, read the `targetOutputDir` (where specs live) and acknowledge it to the user. Do not treat `targetInput` as persisted config state; it is expected to be provided live for each run.
* If the file does not exist, or if `targetOutputDir` is missing, proceed to Step 2.
* If the user must provide the `targetInput`, ask for it explicitly and treat it as required before continuing.
* Validate the live `targetInput` path before continuing: if it does not exist, ask again and do not proceed until it is valid.
* If `targetOutputDir` does not exist, create it before continuing.
* If the root `spec.md` file is missing in `targetOutputDir`, create a minimal index file before appending new links.
2. **Step 2: Manual Target Inputs (Fallback)**
* Ask the user: "Which specific directory or file path needs to be analyzed? (e.g., `src/legacy/utils/`)"
* Wait for user input and use it as the live `targetInput` for this run.
* Ask the user: "What is the root specification directory where the index `spec.md` lives? (e.g., `./docs/specs/`)"
* Wait for user input and store it as `targetOutputDir`.
* Save only `targetOutputDir` to `tmp/.retro-spec-config.json` in the repository root so the workflow can reuse it on future runs.
* Do not save `targetInput` in the config file; keep it as a runtime input for the current analysis.
* Recommended config shape: `{ "targetOutputDir": "./docs/specs/" }` plus optional metadata such as `lastUpdated` if needed.
* Do not proceed until both values are established.
3. **Step 3: The Adjacency, Legacy Docs & Graphify Check**
* Automatically scan the repository for existing, related specification files or partial documentation (like a legacy `README.md`), and also use the live `targetInput` to identify adjacent files.
* **Graphify Integration:** If `/graphify` is available, run it in the same step to map dependencies and adjacent files for the target input so the analysis has better context.
* If no related docs are found, or the user provides `none`, proceed without them. Do not pause for a separate confirmation; use both checks together.
* Scope guard: stay within the target module and immediate dependency surface. Do not broaden the spec into unrelated subsystems unless the code path explicitly requires it.
4. **Step 4: Code Analysis & SDD Generation**
* Read the code in the Target Input (including all child files if a directory).
* Review `/graphify` output (if utilized) and read any adjacent files/docs identified in Step 3.
* Determine a URL-safe, kebab-case name for the new specification based on the module (e.g., if analyzing a Button component, use `button-component`).
* If a spec file with that name already exists, append a numeric suffix such as `-2`, `-3`, etc., instead of overwriting the original.
* **Template Extraction:** Locate and read the official SDD template at [SDD-TEMPLATE.md](templates/SDD-TEMPLATE.md).
* Draft the new specification document by strictly filling out the exact structure, headers, and bullet points defined in that template. Do not hallucinate new sections.
* Write a `Plain-language summary` (2–4 short sentences) at the top of the spec that explains the module to non-technical readers.
* Add an `Examples (input → output)` section with at least one concrete example showing expected behavior in everyday language.
* Include a `Technical specification (structured)` section that contains the original SDD headings (Intent & Context, The Core Contract, Strict Constraints & Rules, Critical Dependencies, Edge Cases & Error Handling, Definition of Done). For each heading, provide a 1–2 sentence plain-language explanation followed by a `Technical notes` block with exact schemas, error codes, and implementation details.
* Separate verified facts from inferred behavior clearly so unknowns are called out instead of silently guessed.
5. **Step 5: Execution & Root Linking**
* Save the drafted document as `spec-[name].md` inside the established `targetOutputDir`.
* Open the root `spec.md` file located in that same directory.
* Append a markdown link to the newly created `spec-[name].md` inside the root `spec.md` file so it acts as an updated index.
* Ensure the saved `spec-[name].md` includes the `Plain-language summary` and `Examples` sections so non-technical stakeholders can read it easily.
* Ensure the saved `spec-[name].md` also includes the `Technical specification (structured)` section so engineers have precise, testable details.
* The output contract is: one newly created spec file, one root index updated with a markdown link, and a completion summary that includes the plain-language summary.
* Inform the user of completion, listing the files created/modified and include the plain-language summary in the completion message.From jericbas/skills, MIT.
More from jericbas/skills
- 0.521score
repo-onboarding
jericbas
Educates new programmers on any application's purpose, workflow, and architecture using simple English, text flowcharts, and clear uncertainty flags.
SkillBFreshness: BClaude Code +9 - 0.521score
apply-master-strategy
jericbas
A master strategist decision-making engine that filters logic through power dynamics, operational constraints, and mastery gates.
SkillBFreshness: BClaude Code +9 - 0.518score
teachme
jericbas
Teaches a skill through Binary Diagnostics, forcing 100% success-rate retrieval practice before logging mastery.
SkillBFreshness: BClaude Code +9 - 0.471score
graphify-map
jericbas
Gathers context and builds a strict execution map for a new feature using the local Graphify knowledge graph to prevent context bloat.
SkillCFreshness: CClaude Code +9 - 0.469score
depcruise-run
jericbas
Comprehensive CLI wrapper for dependency-cruiser to validate rules, find circular dependencies, and generate graphs.
SkillCFreshness: CClaude Code +9 - 0.468score
madge-cli
jericbas
Comprehensive wrapper for Madge CLI.
SkillCFreshness: CClaude Code +9 - 0.467score
graphify-patch
jericbas
Manages the reviewable patch lifecycle (validate -> dry-run -> apply) for canonical entities safely without directly mutating derived files.
SkillCFreshness: CClaude Code +9 - 0.467score
react-srp-dry-analyzer
jericbas
Scans the provided React component and identifies SRP/DRY violations, then suggests refactors into smaller components or custom hooks.
SkillCFreshness: CClaude Code +9 - 0.467score
detect-prop-drilling
jericbas
Uses react-docgen to extract React component props and detect unnecessary prop drilling through intermediate components.
SkillCFreshness: CClaude Code +9 - 0.464score
madge-setup
jericbas
Safely sets up Madge for dependency visualization.
SkillCFreshness: CClaude Code +9 - 0.464score
react-declarative-analyzer
jericbas
Scans the provided React file (JSX/TSX) and suggests refactoring imperative logic into declarative patterns.
SkillCFreshness: CClaude Code +9 - 0.464score
graphify-review
jericbas
Checks the blast radius, impacted communities, and test gaps of changed files before a commit.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 13, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/jericbas/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from jericbas
- 0.521score
apply-master-strategy
jericbas
A master strategist decision-making engine that filters logic through power dynamics, operational constraints, and mastery gates.
SkillBFreshness: BClaude Code +9 - 0.521score
repo-onboarding
jericbas
Educates new programmers on any application's purpose, workflow, and architecture using simple English, text flowcharts, and clear uncertainty flags.
SkillBFreshness: BClaude Code +9 - 0.518score
teachme
jericbas
Teaches a skill through Binary Diagnostics, forcing 100% success-rate retrieval practice before logging mastery.
SkillBFreshness: BClaude Code +9 - 0.471score
graphify-map
jericbas
Gathers context and builds a strict execution map for a new feature using the local Graphify knowledge graph to prevent context bloat.
SkillCFreshness: CClaude Code +9 - 0.469score
depcruise-run
jericbas
Comprehensive CLI wrapper for dependency-cruiser to validate rules, find circular dependencies, and generate graphs.
SkillCFreshness: CClaude Code +9 - 0.468score
madge-cli
jericbas
Comprehensive wrapper for Madge CLI.
SkillCFreshness: CClaude Code +9
Cite this page
generate-retro-spec skill. Agent Mart. https://agentmart.dev/skills/jericbas-generate-retro-spec (last updated 2026-10-24)