spec-probe
Check code against functional requirements in a spec (.md / .docx / .pdf). Use VS Code Copilot chat (/spec-cover, …) or the spec-probe CLI.
Workflow Overview
| Type | Step | Action | Description |
|---|---|---|---|
| One-time (Run once) | 1. Install & Skills | pip install spec-probe && spec-probe-skill --vscode |
Sets up package,.venv, and Copilot skills |
| 2. Auth & Keys | spec-probe-copilot-login + Exacode API key |
Sets up Copilot & Exacode credentials in.env |
|
| 3. Configure Paths | ~/.config/spec-probe/config.yaml |
Setsmodule_path, spec_path, related_modules, codegraph |
|
| 4. Index Code | spec-probe-codegraph |
Builds symbol & call-graph index (excluding tests/mocks) | |
| 5. Domain Pack | /spec-pack (in chat) |
Extracts domain glossary, acronyms, and heuristics | |
| 6. Parse Spec | /spec-cover parse spec summary (in chat) |
Parses spec into requirements catalog inreports/specs/ |
|
| Daily (Run repeatedly) | 1. Verify FRs | /spec-cover verify FR ... (in chat) |
Verifies requirements; generates draft results in cache |
| 2. Audit Report | /spec-audit (in chat) |
Mandatory quality gate: Audits draft results with Gemini 3.8 Flash, validates code evidence, confirms true gaps | |
| 3. Export Report | /spec-cover write report (in chat) |
Exports final verified.md and .html report to user report dir |
1. One-Time Setup
Step 1: Install & Skills
Requires Python ≥ 3.11 and pip ≥ 23.0. On Linux/macOS use python3 (not legacy python).
python3 -m pip install -U pip
python3 -m pip install -U spec-probe
spec-probe --version
spec-probe-skill --vscode
- Installs
spec-probeand sets up Copilot skills in~/.copilot/skills/. - Initializes user directory and
.venvunder~/.config/spec-probe/. - Reload VS Code after running
spec-probe-skill.
Optional for Linux: sudo apt install ripgrep (faster grep search).
Step 2: Authenticate & API Keys (.env)
A. GitHub Copilot Token (Required for Verification & Review)
spec-probe-copilot-login
- Open
https://github.com/login/devicein your browser. - Enter the 8-character code displayed in the terminal.
- Token is saved automatically to
COPILOT_GITHUB_TOKENin~/.config/spec-probe/.env.
B. Exacode API Key (Required for High-Volume Jobs)
Exacode is an LGE-internal free LLM gateway. It powers high-frequency pipeline jobs (enrich, search, rescue, report, wiki) without token cost or external rate limits.
- Open
http://exacode-chat.lge.com/key/(or clear and re-create your key). - Copy Key 2 (EXACODE SWE API).
- Add to
~/.config/spec-probe/.env:EXACODE_API_KEY="your_key_2_here" EXACODE_BASE_URL="http://exacode-chat.lge.com/v1"
(Details: Exacode for Copilot Chat)
Step 3: Configure Target Paths (config.yaml)
Edit ~/.config/spec-probe/config.yaml (use absolute paths):
input:
module_path: /abs/path/to/your/app
spec_path: /abs/path/to/spec.docx
related_modules:
# paths:
# - /abs/path/to/shared/service
# - /abs/path/to/core/service
output:
# Directory to store reports (default: ~/.config/spec-probe/reports)
# report_dir: /path/to/my/reports
codegraph:
# Base codebase / monorepo root to index with codegraph (optional)
# When set, running `spec-probe-codegraph` indexes this root directly.
# If omitted, defaults to indexing module_path and related_modules.paths.
# root_path: /abs/path/to/codebase/root
Step 4: Index Code with Codegraph
Builds an AST symbol table and call-graph database essential for accurate C/C++ cross-module symbol resolution:
spec-probe-codegraph
- When
codegraph.root_pathis set inconfig.yaml, it indexes the codebase root directly with a single command. - If not set, it automatically indexes
module_pathandrelated_modules.paths. - You can also pass paths directly:
spec-probe-codegraph /path1 /path2. Tests and mocks are excluded automatically. Re-running syncs changes.
Step 5: Draft Domain Pack (Run once per module)
In VS Code Copilot chat:
- Select Model in Chat Picker: Choose
Gemini 3.8 Flash(recommended for huge 265k context window and fast code analysis) orGPT-6 Luna. - Run slash command:
/spec-pack
Why run via Copilot Chat Agent instead of internal API calls?
Domain Pack creation is an agentic, multi-step synthesis: it scans AST/symbols, reads 3–8 core architecture and state-machine files, cross-checks spec vocabulary, drafts project-specific rules, and validates patterns with spec_pack.py validate --strict. Running as an interactive Copilot Chat agent lets the developer review and tailor domain heuristics with human-in-the-loop flexibility.
Step 6: Parse Spec (Run once per spec)
In VS Code Copilot chat:
/spec-cover parse spec summary
Parses the requirements document into a structured catalog cached under ~/.config/spec-probe/reports/specs/ so subsequent verifications are fast.
Zero Token Cost by Default (0 LLM Tokens): Spec parsing is 100% deterministic local Python execution (using regex, AST, and table parsing via
load_spec_file). No external LLM API is called, consuming 0 tokens. In Copilot Chat, any chat model picker works equally well (e.g. lightweight models like Haiku or Flash).(Novel / Unstructured Spec Fallback): If a specification lacks standard tables and numbered headers,
spec-probe parse --spec <path> --llm-fallbackuses per-section extraction (llm.jobs.parse) to accurately capture requirements without context overflows.
2. Daily Workflow (VS Code Copilot Chat)
Once one-time setup is complete, use chat for regular verification:
Step 1: Verify Requirements (/spec-cover)
- Verify a specific requirement:
/spec-cover verify FR-001 - Or verify by requirement text:
/spec-cover check requirement: The module shall initialize within 500ms - Or verify a section:
/spec-cover verify section 3.2
(Note: In Copilot chat, typing naturally without /spec-cover like verify FR-001 also works via auto-intent matching, but /spec-cover ... is recommended for explicit routing).
During verification, results and a temporary draft report are automatically persisted to ~/.config/spec-probe/cache/ (last_verify_session.json and draft_verify_latest.md). No unwanted report files are written to your project output directory yet.
Step 2: Audit Report (/spec-audit) — Mandatory Quality Gate
Crucial & Required Step: Automated scan results from Step 1 are treated as unconfirmed hypotheses. This step audits the temporary draft results, eliminates AI hallucinations, validates code citations line-by-line, and confirms true implementation gaps with zero risk of false positives.
(Note on token cost:
/spec-auditis extremely token-efficient — it does not read the entire codebase. It runs targeted ripgrep searches only on suspected gaps and NOT_FOUND items, consuming very few tokens while boosting accuracy to 100%).
In VS Code Copilot chat:
- Select Model in Chat Picker: Choose
Gemini 3.8 Flash(recommended for deep reasoning and whole-file code context) orGPT-6 Luna. - Run slash command:
/spec-audit
Why run via Copilot Chat Agent with a strong model?
Like /spec-pack, /spec-audit is an interactive agentic review. It treats tool verdicts and "missing" bullets as hypotheses, actively reads surrounding source code, traces evidence chains across caller-callee graphs, resolves ambiguous symbols, confirms true implementation gaps, and reports findings directly in the chat.
Step 3: Export Final Report File
Once you have reviewed the audited findings in chat, export the official report:
/spec-cover write report
Generates the final verified .md and standalone .html reports under your configured report directory (e.g. reports/verifications/ or path configured in config.yaml). Because this is run after auditing, your published reports will always represent the highest-accuracy ground truth.
3. Technical Tuning & LLM Jobs (config.json)
config.json is dedicated to technical pipeline tuning and slotting LLM models for each phase.
LLM Pipeline Phases (llm.jobs)
config.json.example sets verify / final_review → gemini-3.8-flash, other jobs → gpt-6-luna (after spec-probe-copilot-login). Re-run spec-probe install --init (or skill install) to sync llm.jobs into ~/.config/spec-probe/config.json. Switch high-volume jobs to internal Exacode:
"enrich": { "provider": "exacode", "model": "Chat-EXACODE-A" }
| Phase / Slot | Role in Pipeline | Default in config.json.example |
Why? |
|---|---|---|---|
verify |
Core verification: Analyzes code candidates against requirement to determine verdicts (IMPLEMENTED, PARTIAL, NOT_FOUND) and cite code evidence. |
Copilot (gemini-3.8-flash) |
Default shipped slot; gpt-6-luna is fine for lighter runs. |
final_review |
Secondary review loop: Inspects full source files to eliminate false positives and catch subtle implementation details. | Copilot (gemini-3.8-flash) |
Whole-file pass; large-context model. |
rescue |
Not-found rescue: Deeper search across caller trees when initial passes yield no candidates. | Copilot (gpt-6-luna) |
Runs only when an FR is NOT_FOUND. |
enrich |
Requirement analysis: Extracts C/C++ function signatures, symbols, keywords, and acronyms from requirement text. | Copilot (gpt-6-luna) |
Alt: Exacode Chat-EXACODE-A (free, internal) for high-frequency preprocess. |
search |
Code search agent: Ranks and filters candidate files and functions. | Copilot (gpt-6-luna) |
Alt: Exacode Chat-EXACODE-A to save Copilot quota. |
report |
Report generation: Formats executive summaries, gap tables, and markdown output. | Copilot (gpt-6-luna) |
Alt: Exacode Chat-EXACODE-A. |
wiki |
Domain knowledge: Generates and retrieves architecture terminology. | Copilot (gpt-6-luna) |
Alt: Exacode Chat-EXACODE-A. |
translate |
Translation: Translates requirements or reports if multi-language output is enabled. | Copilot (gpt-6-luna) |
Alt: Exacode Chat-EXACODE-A (typical for JP spec → EN). |
parse |
Spec extraction fallback: Hybrid per-section extraction for novel/unstructured spec layouts. | Copilot (gpt-6-luna) |
Alt: Exacode Chat-EXACODE-A on unstructured sections only. |
Key Pipeline Parameters (pipeline)
parallel_workers: Number of concurrent workers for batch verification (default: 1 or 4).context_lines: Number of source code context lines included around grep matches (default: 40).batch_size: Batch size when processing large specifications (default: 20).final_review_enabled: Enables the secondary whole-file verification pass (default:true).
4. Updating spec-probe
When a new version is released, updating is a single command:
spec-probe update
- Automatically upgrades the package via
pip(orgit pullif running from a local dev clone). - Refreshes IDE skills and slash commands in
~/.copilot/skills/and~/.cursor/skills/. - Preserves 100% of your configurations: never overwrites
config.yaml,config.json, or.env. - To check if an update is available without installing:
spec-probe update --check-only
CLI (optional)
spec-probe verify --module /abs/app --spec /abs/spec.md --fr FR-001
spec-probe check "The module shall …"
spec-probe parse --spec /abs/spec.md --summary
Paths default from ~/.config/spec-probe/config.yaml when omitted.
Metadata
Release files for spec-probe 0.1.31
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| spec_probe-0.1.31.tar.gz | 309.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spec_probe-0.1.31-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 630.1 kB
Release files / spec_probe-0.1.31.tar.gz
| Download URL | spec_probe-0.1.31.tar.gz |
|---|---|
| Size | 309.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6280e77aa5c7cb5aacb832b5edfc646b3c508f0b4626cccc453569f2919e290a
|
|
BLAKE2b-256 checksum How to use checksums |
6798a1a0b90e421a34cc036939587cb6901278a32075bbb7a8c156210599f5bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / spec_probe-0.1.31-py3-none-any.whl
| Download URL | spec_probe-0.1.31-py3-none-any.whl |
|---|---|
| Size | 321.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ccae64e6c3ecb13393f79996b70a1e3c2b60114739e90d3ceb0ed10e845db3f2
|
|
BLAKE2b-256 checksum How to use checksums |
b8001d4d7243e9f8d1a5d7a915459bdb19c81ae0ad0e71fd0523c54400a9b72f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|