code-to-spec

Analyze source structure and generate a structured SPEC document from an existing codebase.

207|30|Updated May 16, 2026
One-click install
npx skills add https://github.com/smallnest/goal-workflow --skill code-to-spec-smallnest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-to-spec
Source: https://github.com/smallnest/goal-workflow/tree/main/skills/code-to-spec
Command: npx skills add https://github.com/smallnest/goal-workflow --skill code-to-spec-smallnest

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you understand an existing codebase when the original design documents are missing, outdated, or incomplete. It turns source code into a readable specification so teams can audit behavior, plan rewrites, and onboard contributors faster.

Core Features & Use Cases

  • Reverse-Engineering: Extracts a project’s purpose, architecture, and runtime behavior from its code and configuration.
  • Specification Writing: Produces a structured SPEC covering tech stack, data model, API surface, constraints, and testing strategy.
  • Project Audit: Useful for comparing implemented behavior against documented intent or identifying gaps before a refactor.
  • Use Case: A new engineer joins a legacy repository and needs a reliable document that explains what the system does and how it is organized.

Quick Start

Ask this Skill to analyze the attached repository and generate a structured SPEC document that summarizes its architecture, contracts, configuration, and testing strategy.

Frequently Asked Questions about code-to-spec

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

FAQPage Schema
How do I generate technical documentation from an existing codebase with missing design specs?

To generate technical documentation from a codebase, you can reverse-engineer a project specification by analyzing source structure, entry points, configuration, and tests to produce a structured SPEC document.

What is the best way to reverse-engineer a legacy project architecture for onboarding new engineers?

The best way to reverse-engineer a legacy architecture is to extract the project's purpose, data model, API surface, and constraints from its code and configuration to create a readable onboarding specification.

Can I audit my codebase against its original design intent before planning a rewrite?

Yes, you can audit a codebase by comparing its implemented behavior against documented intent, identifying gaps in the architecture, configuration, and testing strategy to prepare for a rewrite.

How does specification writing from source code handle large repositories?

Specification writing from source code applies to codebases of any size, analyzing dependencies, contracts, and runtime behavior to deliver a complete technical spec regardless of the repository scale.

What do I need to provide to extract a complete SPEC document from my source code?

To extract a complete SPEC document, you need to provide access to the attached repository so the Skill can analyze its source structure, configuration, dependencies, tests, and API contracts.