Configuration
SpecLeft configuration is intentionally lightweight. Most teams start with the default .specleft/specs/ and tests/ directories and rely on CLI flags when they need overrides.
Default layout
Section titled “Default layout”Specs live in .specleft/specs/ using Markdown files and YAML frontmatter.
.specleft/specs/└── authentication.md└── reset-password.mdTests are generated into tests/ by default.
Common CLI overrides
Section titled “Common CLI overrides”Use flags to point SpecLeft at non-default locations:
specleft features validate --dir specsspecleft test skeleton --features-dir specs --output-dir integration-testsspecleft status --dir specsFrontmatter fields
Section titled “Frontmatter fields”Spec metadata is defined in YAML frontmatter at the top of each file.
Feature example:
---feature_id: authenticationcomponent: identityowner: auth-teampriority: hightags: [auth, security]---
# Feature: User AuthenticationStory example:
---story_id: loginfeature_id: authenticationpriority: hightags: [auth, login]---
# Story: User LoginScenario example:
---scenario_id: successful-loginstory_id: loginfeature_id: authenticationpriority: criticalexecution_time: fasttags: [smoke, login]---
# Scenario: Successful loginValid values
Section titled “Valid values”- Priority:
critical,high,medium,low - Execution time:
fast,medium,slow - Step keywords:
Given,When,Then,And,But
ID rules
Section titled “ID rules”Feature, story, and scenario IDs must be unique and match ^[a-z0-9-]+$.
Parameterized scenarios
Section titled “Parameterized scenarios”Add a ## Test Data table to parameterize steps:
## Test Data| username | password | expected ||----------|----------|----------|| alice | secret | success || bob | wrong | error |
## Steps- **Given** a user with username `{username}` and password `{password}`- **When** they attempt to log in- **Then** the result is `{expected}`