Configuration Reference
SpecLore's configuration file is located at .speclore/config.yaml, automatically generated by speclore setup.
Full Configuration
project:
name: my-project # Project name
language: typescript # Project language (typescript | javascript | python | go, etc.)
framework: nestjs # Framework (nestjs | express | react | vue, etc.)
profile: normal # Constraint level: strict | normal | minimal
modules: # Module definitions
order:
path: src/order # Module source path
responsibility: Order management and processing # Module responsibility
dependsOn: [inventory, payment] # Dependent modules
entities: [Order, OrderItem] # Core entities
apis: [createOrder, getOrder] # Public APIs
ai:
provider: openai-compatible # AI provider: openai-compatible | claude | ollama
baseUrl: https://api.openai.com/v1 # API endpoint
model: gpt-4 # Model name
apiKeyEnv: OPENAI_API_KEY # API Key environment variable name
spec:
outputDir: specs # .feature file output directory
defaultLanguage: en # Default language (zh-CN | en)
confidenceThreshold: 0.6 # Scenarios below this are marked as needsReview
verify:
command: npm test # Test command
timeout: 300 # Timeout (seconds)
reportFormat: [json, html] # Report formats
mapping:
patterns: # feature ↔ test mapping rules
- feature: "specs/{module}/{name}.feature"
test: "tests/{module}/{name}.test.*"
plugins:
readers: [] # Custom Reader plugins
writers: [] # Custom Writer plugins
parsers: [] # Custom Parser pluginsProfile Modes
| Profile | Use Case | Constraint Level |
|---|---|---|
| strict | Production, multi-person collaboration | Complete ModuleRule + naming conventions + forbidden patterns + full feature business rules |
| normal | Daily development (default) | Core module boundaries + basic conventions + feature business rules |
| minimal | Prototyping, personal projects | Basic module boundaries |
Three-Layer Interaction Model
| Layer | User Type | Interaction | Example |
|---|---|---|---|
| Layer 1 | Beginner | Talk to AI | "Turn this requirement into feature files" |
| Layer 2 | Regular user | CLI commands | speclore spec requirements.md |
| Layer 3 | Advanced user | CLI + config | speclore verify --impact --watch |
Command Reference
speclore (Smart Mode)
Run without arguments to display project status; run with text argument to generate a feature directly.
speclore # Show project status
speclore "User registration requires email verification" # Generate feature from textspeclore setup [--global]
One-time project setup. Detects AI tools → writes MCP config → generates rule files.
speclore setup # Project-level config
speclore setup --global # Global config (~/.speclore/)speclore init
Initialize project context. Scans project structure → detects modules → generates .speclore/context.json.
speclore initspeclore status
Display project diagnostics: configuration, context, feature files, AI tool detection, workflow status, and recommended actions.
speclore statusspeclore spec <source>
Requirement source → .feature files. Supports file paths, URLs, and plain text.
speclore spec requirements.md # Markdown file
speclore spec https://jira.example.com/issue/PROJ-123 # URL
speclore spec "Users need to be able to reset passwords" # Plain text
speclore spec design.docx # Word document
speclore spec specs.xlsx # Excel spreadsheet
speclore spec mockup.png # Image (OCR)
speclore spec req.pdf # PDF document
speclore spec requirements.md -m order # Specify target modulespeclore code [features...]
Transform .feature files into AI coding constraints + test scaffolding.
speclore code # Process all features
speclore code specs/order/create.feature # Process specific featurespeclore verify [features...] [--impact] [--watch] [--timeout <min>]
Run tests and map results to .feature scenarios.
speclore verify # Run all verifications
speclore verify --impact # With change impact analysis
speclore verify --watch # Watch mode (auto-rerun on file changes)
speclore verify --watch --timeout 60 # Watch for 60 minutesspeclore migrate
Migrate existing .feature files to workflow state after upgrade. Scans specs directory and registers untracked features as specified.
speclore migratespeclore teardown [--global]
Uninstall and clean up SpecLore configuration and generated files.
speclore teardown # Clean project-level config
speclore teardown --global # Clean global config