Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

specs

Specs is a fast, deterministic ecosystem for defining and generating production-ready component specifications across platforms. Available as a Figma plugin and a command-line interface, Specs produces compact, schema-valid specs — sidestepping the cost and errors of agentic Figma extraction.

Get started

Plugin

  • Visualize specs on-canvas in incomparable detail
  • Copy and paste compact spec data into LLMs
  • Customize output for styling and layout
  • Configure advanced data settings in the UI

Open the plugin →

CLI

  • Quickly initialize an environment and fetch data
  • Generate 50 component specs in a minute
  • Set up for continuous integration
  • Configure the files, formats, and data you need

Set up the CLI →

Both the plugin and CLI generate specs consistent with the Specs schema, a specifications model architected to unify component definitions for implementation across web, iOS, Android, and Figma.

Repeatable, production-grade specs in seconds

Evaluating and differencing Figma styles and layers across variants is mechanical and predictable — and with Specs, incredibly fast and efficient.

Update Figma → Generate specs → Agents refine → Update component

The result is a spec that's compact yet complete — not noisy like Figma's REST API data — and built on a schema that agents and engineers can extend. Leave inference about behavior, accessibility, motion, and nuanced customization downstream, where AI agents excel.

Specs ecosystemAgentic Figma extraction
Speed~1 sec (CLI) / ~10 sec (Plugin) per component~5–10 minutes per component
AI costScripted — 0 AI tokens per component25/50/100,000+ AI tokens per component
ConsistencyDeterministic and repeatableInference errors, gaps, and overconfidence
OutputSchema-valid YAML/MD, ideal for testing and versioningUnstructured Markdown that complicates repeatable verification
PlatformsTuned for cross-platform output and configurable Figma intentsInterprets and infers intents

Packages

@directededges/specs-cli

Command-line interface (CLI) for generating component specifications from Figma design files.

# 1. Install cli globally to run with the command `specs`
npm install -g @directededges/specs-cli
# 2. Initialize the config/ directory (conventions.yaml, settings.yaml, pipeline.yaml)
specs init
# 3. Edit config/settings.yaml for your Figma file key and preferred settings 
# 4. Set up an .env file with a Figma PAT and – if subscribed - license key
# 5. Fetch raw Figma data (file, variables, styles)
specs fetch
# 6. Scan the file to discover components and build a manifest
specs scan
# 7. Select components in the manifest to be generated
# 8. Generate specs from the manifest
specs generate

Helpful documentation includes:

@directededges/specs-schema

The shared type system and JSON schema that defines the structure of UI component specifications is a dependency of specs-cli and installed when you install the command line interface as above. However, it is also available as a standalone package.

npm install @directededges/specs-schema

Exports include:

  • JSON Schema — the canonical schema for component spec output
  • TypeScript types — complete type definitions for all schema entities (Component, Conventions, Settings, Pipeline, Styles, Element, AnyProp, etc.)
  • DEFAULT_CONVENTIONS, DEFAULT_SETTINGS, DEFAULT_PIPELINE — runtime default objects: a library declaring no conventions, run settings controlling output shape (format, token resolution, variant depth, etc.), and an empty pipeline

Learn more in the Schema docs, including details on each property including component, variants, styles, props and more.

@directededges/specs-from-figma

The specs-from-figma package is the engine that converts Figma assets into specs and is used for both the command line interface and the associated Figma plugin. It is developed in a private repository and its published package is installed as a dependency of the command line interface.

Architectural Decision Records

Schema changes are proposed and tracked through ADRs in the adr/ directory. Each ADR documents the context, options considered, and decision for a type or schema modification.

Contributing

Contributions are welcome. Clone the repo, run npm install at the root, and use npm run build and npm test to validate changes. All packages use Vitest with globals enabled.

Agents

This repo includes Claude Code agent skills for the full ADR lifecycle:

SkillPurpose
/specs.adr.createDraft a new ADR, claim the next number, and reserve it in the index
/specs.adr.implementApply the type and schema changes described in an ADR to types, schema, tests, and changelog
/specs.adr.acceptValidate the implementation is clean, mark the ADR as ACCEPTED, and update the index

Issues

Found a bug or have a feature request? Please check if it already exists in our Issues before creating a new one.

For bug reports, include:

  • Figma version and operating system
  • Steps to reproduce
  • Expected vs actual behavior
  • Screenshots (if applicable)

For feature requests, include:

  • Clear description of the feature
  • Use case and benefits
  • Any relevant mockups or examples

Questions? Visit our Slack community.

Licensing

This repository contains packages with different licenses:

Attribution (Schema)

When extending or reusing the specs schema, you must:

Example attribution:

"This project uses the Specs UI Component Schema by Nathan Curtis of Directed Edges, licensed under CC BY 4.0."


Disclaimer: This is an independent project and is not officially affiliated with Figma Inc.

关于 About

Schema, types, and command line tools to record and manage UI component specifications.

语言 Languages

TypeScript88.2%
MDX4.8%
Astro3.1%
JavaScript1.8%
CSS1.3%
Shell0.9%
HTML0.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
249
Total Commits
峰值: 60次/周
Less
More

核心贡献者 Contributors