Configuration
There are three ways to configure storybook-to-skills-md: configuration files, environment variables, and CLI flags. They are prioritized in that order (CLI flags override everything).
Configuration File
Section titled “Configuration File”Create a .skillgenrc.json file in your project root:
{ "storybookUrl": "https://your-storybook.com", "indexFile": "./storybook-static/index.json", "sourceDir": "./src/components", "outputDir": "./skills", "provider": "openai", "model": "gpt-4o", "apiKey": "sk-...", "concurrency": 3, "timeout": 60000, "retries": 2, "fetchRetries": 3, "extractionConcurrency": 3, "include": ["Components/**", "Patterns/**"], "exclude": ["**/Internal/**", "**/Deprecated/**"], "verbose": false, "dryRun": false, "force": false, "serverOnly": false, "indexSkill": true, "indexSkillTemplate": "./templates/index-skill.md", "promptFile": "./prompts/custom.md", "logPrompts": "./debug-logs"}Custom Config Path
Section titled “Custom Config Path”You can specify a custom config file path:
storybook-to-skills-md generate --config ./config/custom.jsonEnvironment Variables
Section titled “Environment Variables”All configuration options can be set via environment variables with the SKILLGEN_ prefix:
export SKILLGEN_STORYBOOK_URL=https://your-storybook.comexport SKILLGEN_INDEX_FILE=./storybook-static/index.jsonexport SKILLGEN_SOURCE_DIR=./src/componentsexport SKILLGEN_OUTPUT_DIR=./skillsexport SKILLGEN_PROVIDER=openaiexport SKILLGEN_MODEL=gpt-4oexport SKILLGEN_API_KEY=sk-...export SKILLGEN_CONCURRENCY=3export SKILLGEN_TIMEOUT=60000export SKILLGEN_RETRIES=2export SKILLGEN_FETCH_RETRIES=3export SKILLGEN_EXTRACTION_CONCURRENCY=3export SKILLGEN_VERBOSE=trueexport SKILLGEN_PROMPT_FILE=./prompts/custom.mdNote: Array options like include and exclude are not supported via environment variables. Use a config file for these.
CLI Flags
Section titled “CLI Flags”CLI flags override both config files and environment variables. See the Commands reference for all available flags.
Priority Order
Section titled “Priority Order”Configuration is resolved in this order (later overrides earlier):
- Default values (hardcoded in the tool)
- Configuration file (
.skillgenrc.jsonor--config) - Environment variables (
SKILLGEN_*) - CLI flags (highest priority)
Example: Mixed Configuration
Section titled “Example: Mixed Configuration”You can mix and match approaches. For example:
.skillgenrc.json:
{ "sourceDir": "./src/components", "outputDir": "./skills", "provider": "openai", "model": "gpt-4o", "concurrency": 3, "include": ["Components/**"], "exclude": ["**/Internal/**"]}Environment:
export SKILLGEN_API_KEY=sk-...Command:
storybook-to-skills-md generate --storybook-url https://storybook.example.comThis keeps sensitive data (API keys) in environment variables, common settings in the config file, and variable options (like URLs) in CLI flags.
Best Practices
Section titled “Best Practices”- Store API keys in environment variables - Never commit them to version control
- Use config files for project-specific settings - Commit
.skillgenrc.jsonto your repo - Use CLI flags for one-off overrides - Great for testing different models or providers
- Use
.gitignore- Add.skillgenrc.jsonif it contains sensitive data
Common Configurations
Section titled “Common Configurations”CI/CD Environment
Section titled “CI/CD Environment”{ "indexFile": "./storybook-static/index.json", "sourceDir": "./src", "outputDir": "./skills", "provider": "anthropic", "model": "claude-3-5-sonnet-20241022", "concurrency": 5, "force": true}Then use environment variable for API key:
export SKILLGEN_API_KEY=$ANTHROPIC_API_KEYLocal Development
Section titled “Local Development”{ "storybookUrl": "http://localhost:6006", "sourceDir": "./src/components", "outputDir": "./skills", "provider": "openai", "model": "gpt-4o", "verbose": true, "logPrompts": "./debug"}Production
Section titled “Production”{ "storybookUrl": "https://design-system.example.com", "sourceDir": "./packages/components/src", "outputDir": "./docs/skills", "provider": "anthropic", "model": "claude-3-5-sonnet-20241022", "concurrency": 5, "timeout": 120000, "retries": 3, "include": ["Components/**", "Patterns/**"], "exclude": ["**/Internal/**", "**/Experimental/**"]}