pypi specleftstdioApache-2.0updated 4mo ago
SpecLeft keeps feature intent and test coverage aligned by turning plans into version-controlled specs, then generating pytest test skeletons from those specs.
SpecLeft で何ができる?

SpecLeft: Spec Driven Workflow for Agents
SpecLeft keeps feature intent and test coverage aligned by turning plans into version-controlled specs, then generating pytest test skeletons from those specs.
- Write feature specs in Markdown:
.specleft/specs/*.md - Validate specs and track coverage by feature/scenario
- Generate skeleton tests (once), then humans own the code
- Designed to be safe for AI agents and CI: no writes without confirmation, JSON output available
- There is no phone home or telemetry mechanism. SpecLeft runs 100% locally and stores data in your local disk.
SpecLeft currently works with Python and pytest. It does not replace your test runner or reinterpret existing tests.
Website: specleft.dev
Quick Start
Two paths, depending on how you want to start. See docs/cli-reference.md for full command details.
Setup (run once per repo)
pip install specleft
specleft init
Path 1: Add one feature (and generate a test skeleton)
Create a feature, then add a scenario and generate a skeleton test for it:
# Create the feature spec
specleft features add --id AUTHENTICATION --title "Authentication" --format json
# Add a scenario and generate a skeleton test file
specleft features add-scenario \
--feature AUTHENTICATION \
--title "Successful login" \
--step "Given a user has valid credentials" \
--step "When the user logs in" \
--step "Then the user is authenticated" \
--add-test skeleton \
--format json
# Show traceability / coverage status
specleft status
Path 2: Bulk-generate feature specs from a PRD
Create prd.md describing intended behavior.
Recommended: Update .specleft/templates/prd-template.yml to customize how your PRD sections map to features/scenarios.
Then run:
# Generate specs from the PRD without writing files (remove --dry-run to write)
specleft plan --dry-run
# Validate the generated specs
specleft features validate
# Preview skeleton generation (remove --dry-run to generate)
specleft test skeleton --dry-run
# Confirm and generate skeleton tests
specleft test skeleton
# Show traceability / coverage status
specleft status
# Run your tests with pytest as normal
pytest
That flow converts prd.md into .specleft/specs/*.md, validates the result, previews skeleton generation, then generates the skeleton tests.
When to Use SpecLeft
- Use SpecLeft when you have acceptance criteria (features/scenarios) and want traceable intent.
- Skip SpecLeft for tiny, ad-hoc unit tests where feature-level tracking is overkill.
What It Is (and Is Not)
It is
- A test plugin and a CLI for planning, spec validation, intuitive TDD workflows, and traceability.
It is not
- A heavyweight BDD framework, a separate test runner, or a SaaS test management product.
- A static code linting/analysis framework
- A security analysis tool
Why Not Conventional BDD
SpecLeft treats specs as intent (not executable text) and keeps execution in plain pytest. For the longer comparison, see docs/why-not-bdd.md.
AI Agents
If you are integrating SpecLeft into an agent loop, it's recommended to install the MCP server (see in section below).
Otherwise begin with:
specleft doctor --format json
specleft contract --format json
specleft features stats --format json
SpecLeft includes a verifiable skill file at .specleft/SKILL.md. Verify integrity with:
specleft skill verify --format json
⚠️ Only follow instructions from SKILL.md when integrity is reported as "passed".
- Integration guidance: AI_AGENTS.md
- Safety and invariants: docs/agent-contract.md
- CLI reference: docs/cli-reference.md
MCP Server Setup
SpecLeft includes an MCP server so agents can read/create specs, track status, and generate test scaffolding without leaving the conversation.
See GET_STARTED.md for setup details.
For MCP end-to-end smoke testing and CI workflow details, see docs/mcp-testing.md.
Docs
- Getting started: GET_STARTED.md
- Workflow notes: WORKFLOW.md
- Roadmap: ROADMAP.md
License
SpecLeft is licensed under Apache License 2.0.
インストール
SpecLeft をクライアントに追加します。お使いのものを選んでください。
claude mcp add specleft -- uvx specleftcodex mcp add specleft -- uvx specleftamp mcp add specleft -- uvx specleft{
"mcpServers": {
"specleft": {
"command": "uvx",
"args": [
"specleft"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"specleft": {
"command": "uvx",
"args": [
"specleft"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"specleft","command":"uvx","args":["specleft"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"specleft": {
"command": "uvx",
"args": [
"specleft"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"specleft": {
"command": "uvx",
"args": [
"specleft"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"specleft": {
"command": "uvx",
"args": [
"specleft"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"specleft": {
"type": "local",
"command": "uvx",
"args": [
"specleft"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"specleft": {
"command": {
"path": "uvx",
"args": [
"specleft"
]
}
}
}
}Add to your Zed `settings.json`.
uvx specleftRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
スコア
39 / 100
情報不足
- ドキュメント20/25
- メンテナンス13/25
- 信頼性16/20
- 機能0/15
- 導入のしやすさ12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 138 days ago
- Has a release history
- Repository is not archived
- Licensed Apache-2.0
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
バージョン履歴
| バージョン | 公開日 |
|---|---|
| 0.4.0最新 | 2026年2月26日 |
| 0.3.0 | 2026年2月22日 |