Agent skill

Schematic

by blader in blader/schematic

Reverse engineer a detailed product and technical specification document from a git branch's implementation.

MITAuto-check passedProduct & Project Management

Install Schematic

skills CLI
$ npx skills add blader/schematic --skill schematic -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install blader/schematic schematic --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
schematic
GitHub stars
240
Token cost
~2.2k tokens
SKILL.md length
698 words
Files
3
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Reverse engineer a detailed product and technical specification document from a git branch's implementation.

  • Works in 5 steps: Scope the Branch → Parallel Deep Exploration → Cross-Check for Gaps → …
  • A branch has shipped
  • SKILL.md covers Problem, Context / Trigger Conditions, Solution and Verification, plus 2 more sections
  • Calls git and gh

What it does

Schematic is an agent skill from blader/schematic. Reverse engineer a detailed product and technical specification document from a git branch's implementation. Use when: (1) a branch has shipped or is in-progress and needs documentation, (2) you need to understand what a branch does at product and architecture level, (3) onboarding to someone else's feature branch, (4) creating PR descriptions or design docs after the fact, (5) user asks to "analyze this branch", "write a spec from the code", or "document what this branch does". Produces a structured markdown…

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `README.md`).

It sits in Product & Project Management, covering Git workflow, PRD writing and Architecture decision records. The repository describes itself as: Claude Code / Codex skill: reverse engineer a product & technical spec from a git branch. The licence is MIT.

When your agent uses it

  • A branch has shipped
  • Is in-progress and needs documentation
  • You need to understand what a branch does at product and architecture level
  • Onboarding to someone elses feature branch

Example prompts

  • “analyze this branch”
  • “write a spec from the code”
  • “document what this branch does”
  • “/schematic”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Scope the Branch
  2. Parallel Deep Exploration
  3. Cross-Check for Gaps
  4. Write the Spec Document
  5. Verify Completeness

What it can do on your machine

Read from SKILL.md and the folder at commit 297fb73. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Schematic loads about 2.2k tokens when it runs. Until then it costs about 168 tokens; SKILL.md has 698 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~168
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from blader/schematic at commit 297fb73, republished under its MIT licence (© blader). 698 words, ~2,159 tokens.

Download SKILL.mdSave it as .claude/skills/schematic/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
schematic
description
Reverse engineer a detailed product and technical specification document from a git branch's implementation. Use when: (1) a branch has shipped or is in-progress and needs documentation, (2) you need to understand what a branch does at product and architecture level, (3) onboarding to someone else's feature branch, (4) creating PR descriptions or design docs after the fact, (5) user asks to "analyze this branch", "write a spec from the code", or "document what this branch does". Produces a structured markdown spec covering problem statement, product requirements, architecture, technical design, file inventories, testing strategy, rollout plan, and risks.
author
Codex
version
1.0.0
date
2026-02-15
tags
documentation, git, branch-analysis, spec, reverse-engineering

Reverse Engineer Spec from Branch Implementation

Problem

Feature branches often ship without comprehensive documentation. After the fact, teams need product specs, architectural docs, or onboarding materials that explain what was built and why. Manually reading every file change is slow and error-prone. This skill systematically extracts a complete spec from a branch's diff.

Context / Trigger Conditions

  • User asks to "analyze this branch" or "reverse engineer a spec"
  • User asks to "document what this branch does"
  • User wants a product spec, technical spec, or design doc from existing code
  • A branch has many commits and files changed and needs a coherent explanation
  • Onboarding to an unfamiliar feature branch

Solution

Phase 1: Scope the Branch

Get the full picture of what changed before reading any files.

bash
# 1. Identify the base branch (usually main or latest)
git log --oneline <base>..HEAD | head -50

# 2. Get file-level diff stats
git diff --stat <base>...HEAD

# 3. Count the scale
git diff --stat <base>...HEAD | tail -1

Hitchhiker commit detection (CRITICAL): Before proceeding, check whether the branch contains commits from other PRs that were separately merged to the target branch. This is common on un-rebased branches.

bash
# Get PR commits from GitHub (if a PR exists)
BRANCH_NAME=$(git branch --show-current)
ALL_COMMITS=$(git log --oneline <base>..HEAD | wc -l)
PR_SHAS=$(gh pr list --head "$BRANCH_NAME" --json commits --jq '.[0].commits[].oid' 2>/dev/null)
PR_COMMIT_COUNT=$(echo "$PR_SHAS" | grep -c . 2>/dev/null || echo 0)

# If counts differ, scope to PR-only files
if [ -n "$PR_SHAS" ] && [ "$PR_COMMIT_COUNT" -lt "$ALL_COMMITS" ]; then
  echo "HITCHHIKER COMMITS: $ALL_COMMITS on branch, $PR_COMMIT_COUNT in PR"
  # Get files touched ONLY by PR commits
  PR_FILES=$(for sha in $PR_SHAS; do git diff-tree --no-commit-id --name-only -r "$sha"; done | sort -u)
  # Use: git diff <base>...HEAD -- $PR_FILES (simulates post-rebase diff)
fi

When hitchhiker commits are detected, use git diff <base>...HEAD -- <PR_FILES> for all subsequent analysis. State this scoping in the output. When not detected, use the full diff.

From the diff stats (scoped if needed), categorize files into groups:

  • Core implementation (new modules, business logic)
  • Integration points (modified selectors, reducers, hooks, components)
  • Tests (unit tests, integration tests, e2e tests)
  • Configuration (feature flags, env vars, types, configs)
  • Incidental (formatting, imports, minor refactors)
Phase 2: Parallel Deep Exploration

Launch 2-4 parallel exploration agents, each focused on a different file group. This is critical for efficiency — reading 50+ files sequentially is too slow.

Agent 1: Core Implementation

  • All new files (the heart of the feature)
  • Focus on: purpose, key types, exported functions, data flow, inter-module connections

Agent 2: Integration Points

  • Modified selectors, reducers, hooks, components
  • Focus on: what changed, why (inferred), how it connects to core implementation

Agent 3: Tests

  • All test files (unit, integration, e2e)
  • Focus on: what behaviors are validated, key assertions, what product requirements they encode

Agent 4 (if needed): Configuration & Infrastructure

  • Feature flags, env vars, build configs, type declarations
  • Focus on: rollout strategy, gating mechanisms, deployment concerns

Each agent prompt should ask for:

  • Purpose of each file
  • Key exports and types
  • Data flow and dependencies
  • How each file connects to others in the group
Phase 3: Cross-Check for Gaps

After agents return, diff the analyzed files against the full file list:

bash
# List all non-test changed files
git diff --stat <base>...HEAD -- '*.ts' '*.tsx' | awk '{print $1}' | sort

# Show small diffs for any files not yet analyzed
git diff <base>...HEAD -- <uncovered-files>

Read the remaining small diffs directly. These often contain important details:

  • Type declarations (new fields on models)
  • Feature flag definitions
  • Bug fixes discovered during development
  • Proxy/compatibility changes in existing code
Show full SKILL.md (284 more words)Show less
Phase 4: Write the Spec Document

Structure the spec with these sections (skip sections that don't apply):

markdown
# [Feature Name]
## Reverse-Engineered Product & Technical Specification

## 1. Problem Statement
Why this feature exists. What user/business pain it addresses.
Infer from the nature of the changes and any comments in the code.

## 2. Solution Overview
High-level description of the approach. Key design properties
(transparent, lazy, bounded, etc.).

## 3. Product Requirements
### 3.1 User-Facing Behavior
Table of requirements inferred from tests and UI changes.

### 3.2 Supported Workflows
List of workflows validated by tests.

### 3.3 Scope Boundaries
What is and isn't included.

## 4. Architecture
### 4.1 System Diagram
ASCII diagram showing component relationships and data flow.

### 4.2 Data Lifecycle
Step-by-step flow from initial state through steady state.

## 5. Technical Design
Subsections for each major design decision:
- Feature flags and gating
- Data models / schema changes
- Key algorithms or patterns
- Integration patterns (how existing code was modified)
- Cache/performance design
- Error handling and fallbacks

## 6. New Files
Table: file path, purpose (one line each).

## 7. Modified Files (Key Changes)
Table: file path, what changed (one line each).
Include ALL files — even minor ones. The cross-check in Phase 3
catches files that agents missed.

## 8. Testing Strategy
### Unit Tests
### Integration / E2E Tests
### Instrumentation / Observability

## 9. Rollout Strategy
How the feature is gated, incremental rollout steps, kill switches.

## 10. Risks and Mitigations
Table: risk, mitigation.

## 11. Summary
Key metrics: files added/modified, lines changed, scope of impact.
Phase 5: Verify Completeness

Cross-check the spec against the branch:

  1. Every file in git diff --stat should appear in Section 6 or 7
  2. Every test file should be referenced in Section 8
  3. Feature flags mentioned in code should appear in Section 5/9
  4. The architecture diagram should match the actual data flow discovered by agents

Verification

  • Every changed file on the branch is accounted for in the spec
  • The architecture diagram accurately represents the data flow
  • Product requirements match what the tests actually validate
  • No significant design decisions are missing from the technical design section

Example

See the canonical offload spec produced for the test-parity-mem-exp-99-with-pr16393 branch: a 12-section document covering 74 changed files across 12 commits, with architecture diagrams, IndexedDB schema documentation, proxy design details, cache eviction policies, testing strategy against a real customer dataset, and a complete file inventory.

Notes

  • Parallel agents are essential: A branch with 50+ files takes too long to analyze sequentially. 3-4 parallel agents cut analysis time by 3-4x.
  • Cross-check is critical: Agents inevitably miss some files. The Phase 3 cross-check catches small but important changes (type declarations, bug fixes, compatibility shims).
  • Infer the "why": Code shows "what" but not always "why". Use test assertions, comments, commit messages, and the shape of changes to infer product motivation.
  • Save to docs/: Write the spec to a docs/ directory in the repo so it's discoverable.
  • Don't over-document incidentals: Formatting changes, import reordering, and trailing commas can be mentioned in a single line rather than getting their own subsection.
  • Use tables liberally: File inventories, feature flags, risks — tables are scannable and compact.

© blader, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in the repository root of blader/schematic.

  • SKILL.md
  • LICENSE
  • README.md

Open the folder on GitHubat commit 297fb73

Compare with similar skills

Schematic next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Schematic compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Schematic this skillblader/schematic240—~2.2kAutomated safety check: PassMIT
App Spec Packagerinstructa/agent-skills139—~1.5kAutomated safety check: PassNone
Foreman PlanVisionForge-OU/foreman443—~1kAutomated safety check: PassCustom licence
Cabloy Spec Generationcabloy/cabloy982—~3.2kAutomated safety check: NotesMIT
Ad Archivealexandremendoncaalvaro/CorridorKey-Runtime7551 repos~1.6kAutomated safety check: PassCustom licence
Shep Workstreamsshep-ai/shep264—~2.5kAutomated safety check: PassMIT

Similar skills

  • App Spec Packager

    instructa/agent-skills

    A skill your agent uses when the user wants to turn an application, product, startup idea, SaaS, mobile app, web app, API, AI product, or internal tool into a production-ready Markdown specification…

    139 GitHub stars~1.5k tokensUpdated 9 days ago
    Product & Project ManagementAuto-check passed
  • Foreman Plan

    VisionForge-OU/foreman

    Headless implementation-plan authoring for the Foreman planning stage.

    443 GitHub stars~1k tokensUpdated 3 mo ago
    Agent WorkflowsAuto-check passed
  • A skill your agent uses to create or maintain Cabloy suite specifications under repo-specs, including PRD, SRS, PDP/WBS, acceptance planning, progress, and suite ADRs.

    982 GitHub stars~3.2k tokensUpdated today
    Product & Project ManagementAuto-check: notes
  • Ad Archive

    alexandremendoncaalvaro/CorridorKey-Runtime

    Sweep completed plan files (tasks Status:done, specs Status:shipped, PRDs Status:superseded, ADRs Status:superseded or deprecated) out of the working tree and into git history via git rm.

    755 GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Shep Workstreams

    shep-ai/shep

    A skill your agent uses when a large body of work (a version milestone, an epic, a roadmap, a set of PRDs/design docs) needs to be broken into parallel workstreams and executed with the shep CLI.

    264 GitHub stars~2.5k tokensUpdated 3 days ago
    Product & Project ManagementAuto-check passed
  • Write new TiDB documentation or update existing TiDB documentation from code changes, PRs, issues, design docs, product specs, rough drafts, existing docs, or short feature descriptions.

    616 GitHub stars~2.3k tokensUpdated yesterday
    Product & Project ManagementAuto-check passed

Questions about Schematic

What does Schematic do?

Reverse engineer a detailed product and technical specification document from a git branch's implementation. Schematic is an agent skill from blader/schematic. Reverse engineer a detailed product and technical specification document from a git branch's implementation.

When should I use Schematic?

Schematic fits situations like: A branch has shipped; is in-progress and needs documentation; you need to understand what a branch does at product and architecture level; onboarding to someone elses feature branch.

How do I install Schematic in Claude Code?

Run `npx skills add blader/schematic --skill schematic -a claude-code`. Or copy the skill folder (the blader/schematic repository) into .claude/skills/schematic in your project. Claude Code loads it when a task matches its description.

How do I install Schematic in Codex?

Run `npx skills add blader/schematic --skill schematic -a codex`. Or copy the skill folder (the blader/schematic repository) into .agents/skills/schematic in your project. Codex loads it when a task matches its description.

Can I use Schematic in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add blader/schematic --skill schematic -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/schematic, .gemini/skills/schematic, .github/skills/schematic and .opencode/skills/schematic in your project.

What does Schematic need to run?

Going by SKILL.md and its folder, Schematic needs the command-line tools its instructions call (git and gh).

Does Schematic access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Schematic safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Schematic use?

Schematic is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Schematic use?

About 2.2k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Schematic?

Skills that share tags, products or a category with Schematic: App Spec Packager (instructa/agent-skills, 139 stars), Foreman Plan (VisionForge-OU/foreman, 443 stars), Cabloy Spec Generation (cabloy/cabloy, 982 stars) and Ad Archive (alexandremendoncaalvaro/CorridorKey-Runtime, 755 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Schematic?

blader (a GitHub user) maintains it in blader/schematic, which has 240 GitHub stars. The repository was last updated on March 11, 2026.

Source: blader/schematic on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.