Skip to content

Configuration Reference ​

SpecLore's configuration file is located at .speclore/config.yaml, automatically generated by speclore setup.


Full Configuration ​

yaml
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 plugins

Profile Modes ​

ProfileUse CaseConstraint Level
strictProduction, multi-person collaborationComplete ModuleRule + naming conventions + forbidden patterns + full feature business rules
normalDaily development (default)Core module boundaries + basic conventions + feature business rules
minimalPrototyping, personal projectsBasic module boundaries

Three-Layer Interaction Model ​

LayerUser TypeInteractionExample
Layer 1BeginnerTalk to AI"Turn this requirement into feature files"
Layer 2Regular userCLI commandsspeclore spec requirements.md
Layer 3Advanced userCLI + configspeclore verify --impact --watch

Command Reference ​

speclore (Smart Mode) ​

Run without arguments to display project status; run with text argument to generate a feature directly.

bash
speclore                           # Show project status
speclore "User registration requires email verification"  # Generate feature from text

speclore setup [--global] ​

One-time project setup. Detects AI tools → writes MCP config → generates rule files.

bash
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.

bash
speclore init

speclore status ​

Display project diagnostics: configuration, context, feature files, AI tool detection, workflow status, and recommended actions.

bash
speclore status

speclore spec <source> ​

Requirement source → .feature files. Supports file paths, URLs, and plain text.

bash
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 module

speclore code [features...] ​

Transform .feature files into AI coding constraints + test scaffolding.

bash
speclore code                          # Process all features
speclore code specs/order/create.feature  # Process specific feature

speclore verify [features...] [--impact] [--watch] [--timeout <min>] ​

Run tests and map results to .feature scenarios.

bash
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 minutes

speclore migrate ​

Migrate existing .feature files to workflow state after upgrade. Scans specs directory and registers untracked features as specified.

bash
speclore migrate

speclore teardown [--global] ​

Uninstall and clean up SpecLore configuration and generated files.

bash
speclore teardown            # Clean project-level config
speclore teardown --global   # Clean global config

Released under the MIT License.