AugmentClaude

Design System Extractor

Reverse-engineer design tokens, components, and patterns from live products or screenshots.

Installation

  1. Make sure Claude is on your device and in your terminal.

    Skills load from ~/.claude/skills/ when Claude Code starts up β€” so you need it on your machine first. If you don't have it yet, install it once with the command below, then run claude in any terminal to verify.

    One-time setup
    npm i -g @anthropic-ai/claude-code

    Already have it? Skip ahead.

  2. Paste into Claude Code or into your terminal.

    This copies the whole skill folder into ~/.claude/skills/skill-extract-nyldn/ β€” the SKILL.md plus any scripts, reference docs, or templates the skill ships with. Safe default: works for every skill.

    Faster alternative (instruction-only skills)

    Skips the clone and grabs only the SKILL.md file. Don't use this if the skill ships Python scripts, reference markdowns, or asset templates β€” they won't be downloaded and the skill will fail when it tries to load them.

    Quick install (SKILL.md only)
    Sign up to copy
  3. Restart Claude Code.

    Quit and reopen Claude Code (or any other agent that loads from ~/.claude/skills/). New skills are picked up on startup.

  4. Just ask Claude.

    Skills auto-activate when your request matches the skill's description β€” no slash command needed. Trigger phrases live in the skill's own frontmatter; you can read them in the β€œWhat this skill does” section above.

Prefer to read the source first? Open on GitHub.

When Claude uses it

Reverse-engineer design systems, tokens, and components from live products or screenshots

What this skill does

Extract Skill - Implementation Guide

Overview

The extract skill provides comprehensive reverse-engineering capabilities for design systems and product architectures. It transforms undocumented codebases into structured, implementation-ready documentation.

Capabilities

Design System Extraction

  • Token Extraction: Colors, typography, spacing, shadows from code or CSS
  • Component Analysis: Props, variants, usage patterns across React/Vue/Svelte
  • Pattern Detection: Layout patterns, design rules, accessibility guidelines
  • Storybook Generation: Auto-generated stories with variants and controls

Product Architecture Extraction

  • Service Detection: Microservice boundaries, modules, domain boundaries
  • API Mapping: REST, GraphQL, tRPC, gRPC endpoint cataloging
  • Data Modeling: ORM schema extraction (Prisma, TypeORM, Sequelize)
  • Feature Inventory: Route-based and domain-based feature detection
  • C4 Diagrams: Automated architecture visualization (Mermaid)

Technical Implementation

Token Extraction Pipeline

Priority Order (High to Low Confidence):

  1. Code-Defined (95%): theme.ts, tokens.json, Tailwind config
  2. CSS Variables (90%): :root declarations
  3. Computed Styles (60%): DOM analysis
  4. Inferred (40-60%): Color clustering, scale detection

Color Clustering Algorithm:

  • Uses CIEDE2000 for perceptually-accurate color distance
  • K-means++ initialization for stable clustering
  • Default k=8 clusters for primary palettes
  • Ξ”E < 2 threshold for duplicate detection

Component Analysis

Detection Strategies:

  • AST parsing for TypeScript/JavaScript
  • Prop extraction from interfaces and PropTypes
  • Variant detection from union types
  • Usage tracking across codebase

Supported Frameworks:

  • React (functional, class, hooks)
  • Vue (SFC, Composition API, Options API)
  • Svelte (script/template separation)

Architecture Detection

Service Boundary Heuristics:

  • Package.json in subdirectories
  • Independent deployment configs
  • Team ownership boundaries
  • Communication pattern analysis

API Endpoint Detection:

  • Decorator-based routing (NestJS, routing-controllers)
  • Express/Fastify route definitions
  • GraphQL resolver classes
  • tRPC router procedures
  • Protocol Buffer (.proto) files

Multi-AI Orchestration

When enabled, the extract feature uses multiple AI providers for higher accuracy:

Provider Roles:

  • Claude: Synthesis, conflict resolution, documentation
  • Codex: Code-level analysis, type extraction, architecture
  • Antigravity: Pattern recognition, alternative interpretations, UX insights

Consensus Mechanism:

  • Threshold: extraction quality gates require the configured consensus threshold (default 67%); when no numeric vote data exists, the quorum resolver selects the strongest matching proposal from up to 3 provider perspectives and logs disagreements.
  • Disagreements logged in 90_evidence/disagreements.md
  • Confidence scores attached to all outputs

Output Structure

octopus-extract/
└── project-name/
    └── timestamp/
        β”œβ”€β”€ README.md                   # Navigation and summary
        β”œβ”€β”€ metadata.json               # Extraction parameters
        β”‚
        β”œβ”€β”€ 00_intent/
        β”‚   β”œβ”€β”€ answers.json            # User intent responses
        β”‚   β”œβ”€β”€ intent-contract.md      # Human-readable summary
        β”‚   └── detection-report.md     # Stack auto-detection results
        β”‚
        β”œβ”€β”€ 10_design/
        β”‚   β”œβ”€β”€ tokens.json             # W3C Design Tokens format
        β”‚   β”œβ”€β”€ tokens.css              # CSS custom properties
        β”‚   β”œβ”€β”€ tokens.md               # Human-readable token docs
        β”‚   β”œβ”€β”€ components.csv          # Component inventory (tabular)
        β”‚   β”œβ”€β”€ components.json         # Structured component data
        β”‚   β”œβ”€β”€ patterns.md             # Layout and design patterns
        β”‚   └── storybook/              # Storybook scaffold (optional)
        β”‚       β”œβ”€β”€ .storybook/
        β”‚       └── stories/
        β”‚
        β”œβ”€β”€ 20_product/
        β”‚   β”œβ”€β”€ product-overview.md     # What, who, key journeys
        β”‚   β”œβ”€β”€ feature-inventory.md    # Features by domain
        β”‚   β”œβ”€β”€ architecture.md         # C4 text description
        β”‚   β”œβ”€β”€ architecture.mmd        # Mermaid C4 diagrams
        β”‚   β”œβ”€β”€ PRD.md                  # AI-agent executable PRD
        β”‚   β”œβ”€β”€ user-stories.md         # Gherkin-style scenarios
        β”‚   β”œβ”€β”€ api-contracts.md        # Endpoint specifications
        β”‚   β”œβ”€β”€ data-model.md           # Entity relationships
        β”‚   └── implementation-plan.md  # Phased milestones
        β”‚
        └── 90_evidence/
            β”œβ”€β”€ quality-report.md       # Coverage and confidence metrics
            β”œβ”€β”€ disagreements.md        # Multi-AI conflicts
            β”œβ”€β”€ extraction-log.md       # Timestamped progress log
            └── references.json         # File paths per claim

Quality Gates

Automated validation ensures extraction quality:

  1. Token Coverage: Fail if 0 tokens in design mode
  2. Component Coverage: Warn if < 50% of component files detected
  3. Architecture Completeness: Warn if no services detected in product mode
  4. Multi-AI Consensus: Fail if agreement is below the configured consensus threshold (default 67%) on key outputs

Usage Patterns

Basic Extraction

/octo:extract ./my-app

Design-Only Extraction

/octo:extract ./my-app --mode design --storybook true

Deep Analysis with Multi-AI

/octo:extract ./my-app --depth deep --multi-ai force

URL Extraction

/octo:extract https://example.com --mode design --depth quick

Integration with Other Skills

  • /octo:review: Review extracted outputs for quality
  • /octo:deliver: Validate extraction completeness
  • /octo:docs: Generate additional documentation from extractions

Error Handling

Common error codes:

  • ERR-001: Invalid input (path/URL not found)
  • ERR-002: Network timeout (URL extraction)
  • ERR-003: Permission denied
  • ERR-004: Out of memory (use --depth quick)
  • VAL-001: Validation failed (no tokens detected)
  • VAL-004: Low multi-AI consensus

Performance Targets

DepthTime TargetCoverage Target
Quick< 2 min70% coverage, basic analysis
Standard2-5 min85% coverage, comprehensive
Deep5-15 min95% coverage, multi-AI validation

Research Sources

This skill is informed by research on:

Implementation Status

Current Version: 1.0.0 (Skeleton)

Implemented:

  • βœ… Command structure
  • βœ… CLI argument parsing
  • βœ… Output directory setup
  • βœ… Metadata generation
  • βœ… Multi-AI detection

In Progress:

  • 🚧 Token extraction pipeline
  • 🚧 Component analysis engine
  • 🚧 Architecture detection
  • 🚧 PRD generation
  • 🚧 Quality gates

Planned:

  • ⏳ Storybook scaffold generation
  • ⏳ C4 diagram generation
  • ⏳ URL extraction mode
  • ⏳ CSS inference algorithms

Contributing

See implementation plan in project documentation.

Implementation phases:

  1. Foundation & CLI (Week 1)
  2. Auto-Detection Engine (Week 2)
  3. Design Extraction (Week 3-4)
  4. Product Extraction (Week 5-6)
  5. Multi-AI Orchestration (Week 7)
  6. Quality Gates (Week 8)
  7. Testing & Documentation (Week 10)

This skill implements the design specified in PRD v2.0 (AI-Executable)

Related skills