init
Initialize the config/ directory — conventions.yaml, settings.yaml, and pipeline.yaml — with production-ready defaults.
Usage
specs init [options]Purpose
The init command scaffolds three configuration files, each answering one question:
config/conventions.yaml— facts about the Figma library: naming patterns, state classification, how images are expressed. See Conventions.config/settings.yaml— choices about this run: sources, spec output, assets. See Settings.config/pipeline.yaml— transformers and analyses to run. See Pipeline.
Each file ships with sensible defaults and inline documentation with links to the full configuration reference. settings.yaml includes an empty data.sources object ready for your Figma file keys.
This is the recommended way to get started with Specs in a new project.
What Gets Created
config/ conventions.yaml # what the library is settings.yaml # how output behaves, and where it goes pipeline.yaml # what to runconfig/conventions.yaml declares how the library is authored — most conventions start commented out, since absence means the library declares no such convention:
# Facts about the Figma library — every consumer of that library declares the same values.figma: # naming: NONE
# glyphs: # match: 'DS Icon Glyph / {i}'
subcomponents: # scope: NESTED match: - '{C} / _ / {S}' # exclude: # - '{C} / Examples / {S}'
slotConstraints: false
# states: # hover: # prop: state # value: hoverconfig/settings.yaml declares run choices, grouped by concern:
# Choices about this run — sources, spec output, assets.author: <Your Name Here>
data: directory: ./data sources: {}
spec: directory: ./specs format: JSON keys: SAFE layout: LAYOUT tokens: TOKEN color: HEX variantDepth: 9999 details: LAYERED # splitComponents: true # splitConcerns: true # useSubfolders: trueconfig/pipeline.yaml declares the work to run — everything commented out until you opt in:
# Work this workspace runs: transformers and analyses.# transformers:# - name: contract# - name: css# - name: react
# analyses:# - name: dependenciesEach section includes inline comments with references to the full documentation.
Options
--force
Overwrite existing config files without prompting.
By default, if any of the three files exists, init prompts before overwriting. Use --force to skip the prompt.
# Prompt before overwrite (default)specs init
# Overwrite without promptingspecs init --force--config <path> / -c <path>
Custom directory to write the config/ folder into (default: current directory).
# Scaffold config/ inside a workspace subdirectoryspecs init --config ./workspaces/library# Creates ./workspaces/library/config/{conventions,settings,pipeline}.yamlExamples
Example 1: Basic Initialization
cd my-design-systemspecs init
# Output:# ✓ Created config/conventions.yaml# ✓ Created config/settings.yaml# ✓ Created config/pipeline.yaml# 📚 Next steps:# 1. Edit the config file to add your Figma file keys# 2. Run: specs fetch# 3. Run: specs scan# 4. Run: specs generateExample 2: Multiple Workspaces
# One config/ directory per workspacespecs init --config ./workspaces/dev --forcespecs init --config ./workspaces/prod --force
# Use with --config flag on other commandsspecs fetch --config ./workspaces/dev/configspecs generate data/library.file.json -c "Button" --config ./workspaces/prod/configExample 3: Force Overwrite
# If you accidentally delete your config, recreate itspecs init --forceUpgrading from a single config file
A pre-split specs.config.yaml (or .json) is no longer read (ADR-071), and init refuses to run while one is present — scaffolding defaults over it would quietly replace whatever the workspace actually declared:
Error: found specs.config.yaml — a pre-split configuration (ADR-071). Run `specs migrate config` to convert it, keeping what this workspace declares. To scaffold fresh defaults instead, remove specs.config.yaml first.Run specs migrate config to convert the file into the three-file layout — the Settings and Conventions references show where each former member now lives. Use init only for a workspace with no existing configuration.
See Also:
- Configuration Reference - Config file options
- Getting Started - Quick start guide