Skip to content

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.

Specs live in .specleft/specs/ using Markdown files and YAML frontmatter.

.specleft/specs/
└── authentication.md
└── reset-password.md

Tests are generated into tests/ by default.

Use flags to point SpecLeft at non-default locations:

Terminal window
specleft features validate --dir specs
specleft test skeleton --features-dir specs --output-dir integration-tests
specleft status --dir specs

Spec metadata is defined in YAML frontmatter at the top of each file.

Feature example:

---
feature_id: authentication
component: identity
owner: auth-team
priority: high
tags: [auth, security]
---
# Feature: User Authentication

Story example:

---
story_id: login
feature_id: authentication
priority: high
tags: [auth, login]
---
# Story: User Login

Scenario example:

---
scenario_id: successful-login
story_id: login
feature_id: authentication
priority: critical
execution_time: fast
tags: [smoke, login]
---
# Scenario: Successful login
  • Priority: critical, high, medium, low
  • Execution time: fast, medium, slow
  • Step keywords: Given, When, Then, And, But

Feature, story, and scenario IDs must be unique and match ^[a-z0-9-]+$.

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}`