Spec package manager for Gherkin behavioral contracts. Install shared .feature specs, audit requirement ID (RID) integrity, and verify bidirectional traceability between specs and test results.
If your team writes Gherkin specs with requirement IDs (@RID-AUTH-001, @RID-PAY-003), specdrive gives you:
- Shared specs as packages -- fetch
.featurefiles from git repos and vendor them into your project, with lockfile-based version pinning. - RID integrity auditing -- validate RID format, catch duplicates, and enumerate your spec inventory.
- Traceability verification -- cross-reference declared RIDs against JUnit XML test reports to find coverage gaps.
- Framework-aware setup -- auto-detect your test framework and generate the bridging code that maps requirement tags into JUnit XML properties.
Specdrive is language-agnostic. It works with any project that produces JUnit XML test output -- Python (pytest), JavaScript/TypeScript (Vitest, Jest), Java (JUnit 5), and more.
npm install -g specdriveOr use without installing:
npx specdrive initDetect your test framework, generate requirement-to-JUnit bridging code, and scaffold a specdrive.yaml config file.
npx specdrive initSupported frameworks:
| Framework | Status |
|---|---|
| pytest (pytest-bdd) | Supported |
| Vitest (QuickPickle) | Supported |
| Generic (JUnit XML) | Fallback |
Adding a new framework adapter is one file -- see Adding Adapters below.
Fetch spec packages from git repos or local paths, vendor into specs/_specdrive/, and write a lockfile.
npx specdrive installValidate RID format, check for duplicates, and enumerate specs with counts.
npx specdrive auditCross-reference declared RIDs against a JUnit XML test report. Shows coverage percentage and lists uncovered RIDs with source locations.
npx specdrive verify test-results.xmlShow declared specs, versions, and RID counts.
npx specdrive statusCreate a specdrive.yaml in your project root:
# Local spec directories (relative to project root)
localSpecs:
- specs/auth
- specs/billing
# Shared spec packages (fetched from git)
specs:
- name: core-spec
source: github:org/spec-repo@v1.0.0
- name: integration-spec
source: git:https://gitlab.com/team/specs.git@main
# Fail on tests without RID annotations (default: false)
strictTraceability: trueAt least one of specs or localSpecs must be present.
| Scheme | Example | Description |
|---|---|---|
path: |
path:../local-spec |
Local filesystem |
github: |
github:org/repo@v1.0 |
GitHub repository |
gist: |
gist:abc123@main |
GitHub Gist |
git: |
git:https://host/repo.git@v2.0 |
Any git URL |
All remote sources require an @ref (tag, branch, or SHA).
Requirement IDs (RIDs) are tags on Gherkin scenarios that create traceability links between specs and tests:
@RID-AUTH-001
Scenario: User can log in with valid credentials
Given a registered user
When they provide correct credentials
Then they are authenticatedSpecdrive ensures every RID is well-formed, unique across your spec inventory, and covered by a passing test.
After setup, your project will have:
specdrive.yaml # config: specs and/or localSpecs
.specdrive-lock.yaml # locked versions with SHAs (commit this)
.specdrive/cache/ # git clones (gitignore this)
specs/_specdrive/ # vendored feature files (gitignore this)
Each adapter is a single file at src/init/adapters/<framework>.ts implementing the Adapter interface:
detect(dir)-- inspect project files, return confidence level + evidencefiles(dir)-- bridging code files to generateconfigEdits(dir)-- modifications to existing config files
Register it in src/init/adapters/index.ts. The orchestrator does not need to change.
Adapters are idempotent (marker comments prevent duplication), safe (only automates edits it can parse reliably), and communicative (shows a plan before applying).
pnpm install
pnpm test # 122 unit tests
pnpm run build # tsc -> dist/
pnpm run coverage # 96% thresholdOr with just:
just dev-install
just check-all # format, lint, typecheck, coveragePrint the installed version.
See CONTRIBUTING.md for development setup, coding standards, and contribution guidelines.