About Spec Gen
Spec Gen is an MCP server published by clay-good in the Documentation category: deterministic, local-first code and contract intelligence and guardrails for AI coding agents, with no LLM in the hot path. Conduid read 85 tools from its source: analyze_codebase, analyze_env_impact, analyze_error_propagation, analyze_impact, annotate_story, approve_decision and 79 more. It is published to npm as openlore and starts with npx.
The repository has 370 stars and 52 forks, is licensed MIT, and its last commit was on 1 Dec 2026. The latest release is v3.9.0 (29 Nov 2026): Your agent now gets short, exact facts when it needs them, and much less standing text every turn. It follows v3.8.0 (22 Nov 2026), and the 5 most recent releases go back to v3.5.0 (25 Oct 2026). It passes 4 of the 5 static checks Conduid ran on the repository; it does not pass No dynamic code execution. Its topics include api-documentation, automated-documentation, code-analysis, code-archaeology, dependency-graph and devtools.
Install
claude mcp add spec-gen -- npx -y openlorenpx -y openloregit clone https://github.com/clay-good/OpenLoreTools (85)
analyze_codebaseUSE THIS WHEN: the project has never been analyzed, or the user says the code changed significantly since the last run, or other tools return "no cache found". Builds the call graph, dependency graph, and refactor priorities — all without an LLM. Results are cached for 1 hour; skip this if the cache is recent.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| force | boolean | Force re-analysis even if a recent cache exists (default: false) |
analyze_env_impactUSE THIS WHEN: you are about to remove or rename an environment variable — "what breaks?". The config analogue of analyze_impact: for an env var `name`, returns line-precise `readSites` (file/line/enclosing function, or module-level), `affectedFunctions` (callers that transitively reach a read), `reachingTests`, whether the var is declared with a default, and per-site `required` (a read with no site-local fallback is a hard break). SCOPE: env reads in TS/JS/Python/Go/Ruby; config-object key reads are a disclosed out-of-scope boundary, never guessed. An unknown var returns not-found + candidates (never "unused"); module-level reads and call-graph limits are disclosed in `boundaries`, so the blast radius is a SOUND LOWER BOUND. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| maxDepth | number | Backward-reachability depth bound (default 12, clamped to [1, 30]). Truncation is disclosed in boundaries. |
| name * | string | The environment variable to analyze, e.g. DATABASE_URL. |
analyze_error_propagationUSE THIS WHEN: you are about to call a function ("what can it throw, and is any of it handled?") or you made one throw ("who is exposed, and where is it caught?"). The error analogue of analyze_impact: for a `symbol` (name or name::path), returns `escapes` (exception types that propagate OUT to callers, each with origin and call path) and `handledInternally` (caught here). SCOPE: TS/JS/Python/Java/C# exceptions, plus a Go returned-error and panic/recover model (`errorModel: go-value`); any other language returns `unsupported`, never an empty escape set. A SOUND LOWER BOUND: an un-analyzable callee is disclosed in `boundaries`, never assumed exception-free; an unknowable throw type is `<dynamic>`; typed catch/except matches exact type names only (no subclasses). Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| maxDepth | number | Callee-traversal depth bound (default 10, clamped to [1, 30]). Truncation is disclosed in boundaries. |
| symbol * | string | The function to analyze: its name, or name::path to disambiguate. |
analyze_impactUSE THIS WHEN: the user asks "what breaks if I change X?", "what's the blast radius of modifying Y?", or "is it safe to refactor Z?". Returns risk score, fan-in/out, and full upstream/downstream call chains — gives the complete picture without reading every caller file.| Parameter | Type | Description |
|---|---|---|
| depth | number | Chain depth (default: 2) |
| directory * | string | Absolute path to the project directory |
| symbol * | string | Function name to analyse (exact or partial) |
annotate_storyUSE THIS WHEN: you have a BMAD story file and want to auto-populate its risk_context section with structural analysis from the codebase. Reads the story file, runs orient + analyze_impact, writes the risk_context block directly into the file (replaces existing section or inserts it). Run by the Architect Agent after writing stories — eliminates manual copy-paste of generate_change_proposal output. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| description * | string | Story intent for structural analysis — use story title + primary AC. e.g. "add payment retry — must retry up to 3 times on timeout" |
| directory | string | Absolute path; default cwd |
| storyFilePath * | string | Path to the BMAD story markdown file — relative to the project directory or absolute. e.g. ".bmad-method/stories/001-add-payment-retry.md" |
approve_decision⚠ REQUIRES EXPLICIT HUMAN AUTHORIZATION — do NOT call this tool autonomously. Before calling, you MUST present the decision to the user and receive an explicit "yes" or "approve" response. Never approve on behalf of the user. Approves a verified architectural decision for syncing into spec.md files. After approving, call sync_decisions to write the decision to the relevant spec.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| id * | string | 8-character decision ID from list_decisions |
| note | string | Optional review note |
audit_spec_coverageParity audit: report spec coverage gaps without any LLM call. Returns uncovered functions (exist in call graph but have no spec), hub gaps (high fan-in functions with no spec), orphan requirements (spec requirements with no mapped implementation), and stale domains (source files changed after spec was last written). Use this before starting a new feature to understand what needs specs, or to audit coverage health. Distinct from its sibling check_spec_drift: audit_spec_coverage finds requirements/code with NO spec (coverage gaps); check_spec_drift finds existing specs that no longer match changed code (drift). Requires "openlore analyze" to have been run.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| hubThreshold | number | Minimum fanIn to flag a function as a hub gap (default: 5) |
| maxUncovered | number | Maximum uncovered functions to return (default: 50) |
blast_radiusUSE THIS WHEN: before committing, you want one briefing of what your diff touches — "what is the blast radius of my changes?", "is this safe to commit?". Composes deterministic analyses over the staged/working diff, for the symbols it ACTUALLY changed (formatting and comments are not changes; a file kept whole says why in changeGranularity): affected callers and layers (analyze_impact), the tests to run (select_tests), the anchored memories/decisions it will drift or orphan, and the specs it will make stale (check_spec_drift). Advisory. Siblings: structural_diff is the raw graph delta + newly-stale callers; change_impact_certificate certifies the paths a diff newly opens into a sensitive surface; this is the all-in-one pre-commit briefing. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| baseRef | string | Git ref to diff the working tree against (e.g. "HEAD", "main"). Default HEAD (uncommitted changes). |
| depth | number | Impact-analysis traversal depth (default 2). |
| directory | string | Absolute path; default cwd |
| maxSymbols | number | Cap on the number of highest-fan-in changed symbols analyzed for impact (default 12). Truncation is reported. |
briefing_sinceUSE THIS WHEN: a lot changed since you last looked and you want the changes that STRUCTURALLY MATTER. Unlike blast_radius / change_impact_certificate (YOUR pending diff), this briefs everything SINCE a base ref. Changed production symbols are ranked in a fixed tier order, surprising-change (a hub whose file rarely changed) > hub-change > chokepoint-change > ordinary-change, from existing labels, NOT a weighted score; each carries raw evidence (fan-in, fan-out, prior churn), grouped by region, with the tests to run. Renames are listed under carried, and a file kept whole says why in changeGranularity; surprising-change is withheld when history is too shallow; a bounded briefing carries a truncation receipt and never drops a higher tier for a lower one. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| baseRef | string | Git ref to brief changes SINCE (e.g. "main", a PR base, "HEAD~20"). Default "auto": resolves main → master → HEAD~1 → empty tree. |
| directory | string | Absolute path; default cwd |
| filePattern | string | Region scope — only brief changes whose file path contains this substring. |
| maxResults | number | Bound on briefed symbols, highest-tier-first (default 50, max 200). Overflow is reported in the truncation receipt. |
certify_mergeUSE THIS WHEN: before landing two branches that merge cleanly — "will these combine correctly, or does one break what the other calls?". Builds the call graph at the merge-base and each side, and reports where one side ADDS a call into a symbol the other side changed incompatibly or removed: the "git merges cleanly, the combination is broken" failure textual merge cannot see. Each finding is incompatible (removed / breaking signature) or potentially-incompatible (unprovable), never silently safe; the overall verdict is a sound lower bound ("no detected incompatibility"). Follows plan_parallel_work (dispatch) and map_in_flight_conflicts (in flight); the merge-tree oracle says whether git textually conflicts, this says what breaks when it does not. No LLM.| Parameter | Type | Description |
|---|---|---|
| base | string | Merge base to compare against (default: the git merge-base of ours and theirs). |
| directory | string | Absolute path; default cwd |
| maxFindings | number | Cap on reported conflicts (default 200). |
| ours * | string | One side to merge (a git ref). |
| theirs * | string | The other side to merge (a git ref). |
certify_provenanceEmit a reproducible, content-addressed record of WHAT A CHANGE DOES, for attachment to the repo's supply-chain provenance (SLSA / in-toto). Composes change_impact_certificate (blast radius, paths newly opened into a declared surface, drifted specs, tests to run) + structural_diff (added/removed/re-signed functions), serialized canonically and hashed (sha256) so any consumer can RECOMPUTE and verify it — checkable, not merely signed. Emit as an in-toto predicate (format "in-toto") or standalone JSON. OpenLore emits, it does not sign. Bad base is fatal; boundaries disclosed (the claim is a lower bound, never "safe"). Sibling change_impact_certificate briefs YOUR pending diff in-session; this is the portable attestation a third party recomputes. No LLM.| Parameter | Type | Description |
|---|---|---|
| allowBaseFallback | boolean | Accept the disclosed main → master → HEAD~1 base fallback instead of failing on an unresolvable base. |
| baseRef | string | Git ref to diff the working tree against (default HEAD). |
| change | string | Change id recorded on the certificate (spec-store context; default "working-tree"). |
| directory | string | Absolute path; default cwd |
| format | string | Output shape: an unsigned in-toto Statement v1 envelope (its shape structurally checked locally), or standalone JSON (default json). |
certify_public_surfaceUSE THIS WHEN: shipping a library change — "did I break my consumers' contract?" (removed/renamed export, new required param, narrowed types, reduced visibility). No base ref: the PUBLIC SURFACE (exports + signatures). With a base ref: a breaking-change VERDICT for the working-tree diff, each changed export breaking | non-breaking | potentially-breaking; a breaking one is breaking-consumed (with consumers) or breaking-unconsumed-in-index (never "safe"); federation also counts indexed sibling repos. Breakages accepted in .openlore/public-surface-baseline.jsonl are listed as accepted. Unprovable = potentially-breaking. Renames stay renames. Distinct from change_impact_certificate (paths into a surface). Signatures: TS/JS/Python; others fail-soft. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| baseRef | string | Git ref to diff the working tree's public surface against (e.g. "HEAD", "main"). Omit to return the surface itself. |
| directory | string | Absolute path; default cwd |
| maxResults | number | Limit the surface listing in surface mode (default 200, capped 500). |
certify_service_contractUSE THIS WHEN: you change an OpenAPI, protobuf or GraphQL schema or the code serving it. Unlike certify_public_surface (exported code), this certifies the HTTP contract. No baseRef: declared operations and parity with indexed route handlers. With baseRef: a closed-table verdict per changed element vs the merge-base (breaking | dangerous | non-breaking | potentially-breaking), breaking ones with their in-repo client call sites, and a suggestedBump. An unreadable spec is notAssessed, never unchanged. Advisory findings can be gated by enforcement.policy.| Parameter | Type | Description |
|---|---|---|
| allowBaseFallback | boolean | Fall back to the default branch when baseRef does not resolve (disclosed). |
| baseRef | string | Compare with this ref (its merge-base with HEAD). |
| directory | string | Absolute path; default cwd |
| federation | boolean | Also census client call sites in indexed sibling repositories (.openlore/federation.json). A service's consumers are usually not in its own repository; every sibling not censused is disclosed. |
| federationRepos | array | Limit the federation census to these registry repo names (default: all). |
| maxResults | number | Cap per list (default 100, max 1000). |
change_impact_certificateCertify what the current diff touches before it lands. ONE conclusion-shaped certificate: blast radius, the paths the change NEWLY OPENS into each declared covering surface (reachable after but not before — computed differentially), drifted specs, and tests to run. Decays via the freshness lease; advisory, never blocks. Declare surfaces under "impactCertificate.surfaces". Unlike its change-family siblings — blast_radius (all-in-one pre-commit briefing) and structural_diff (raw graph delta + stale callers) — this certifies the paths a diff NEWLY OPENS into a sensitive surface. No LLM.| Parameter | Type | Description |
|---|---|---|
| baseRef | string | Git ref to diff the working tree against (default HEAD). |
| change | string | Change id to record on the certificate (spec-store context; default "working-tree"). |
| directory | string | Absolute path; default cwd |
| persist | boolean | Persist under .openlore/impact-certificates/ so the spec-store health check can re-fire it when it decays. |
check_architectureUSE THIS BEFORE adding an import to check it against the repo's architecture rules, or to list current architecture violations. Opt-in and inert unless the repo declares rules in .openlore/architecture.json (layers / forbidden / allowedOnly / required / circular / reachable / orphan / moreUnstable) or via an "Invariant:" marker in a synced ADR. Pre-edit mode: pass {from, to} ("may a file under <from> import <to>?") for a deterministic allowed/denied + the governing rule + why, BEFORE you write the code. Scan mode: pass only {directory} for the full current-violations report. Cross-language, offline, deterministic; complements (does not replace) CI linters. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| from | string | Pre-edit mode: the file that would gain the import (relative or absolute). Requires "to". |
| to | string | Pre-edit mode: the target file path or exported symbol being imported. Requires "from". |
check_spec_driftUSE THIS WHEN: you've modified code and want to know if the specs are still aligned, or when asked "is the code in sync with the spec?", "what changed since the last spec run?". Compares git-changed files against spec coverage — impossible to replicate by reading files. Distinct from its sibling audit_spec_coverage: check_spec_drift asks whether EXISTING specs still match code you changed (drift), while audit_spec_coverage asks what requirements/code have NO spec at all (coverage gaps). Requires openlore generate to have been run at least once. No LLM required.| Parameter | Type | Description |
|---|---|---|
| base | string | Git ref to compare against (default: auto-detect main/master) |
| directory | string | Absolute path; default cwd |
| domains | array | Only check these spec domains (default: all domains) |
| failOn | string | Minimum severity to report (default: "warning") |
| files | array | Specific files to check (default: all changed files) |
| maxFiles | integer | Maximum number of changed files to analyze (default: 100) |
configure_openloreInspect repository configuration without an index or daemon; preview, apply, verify or revert a revision-bound plan. Writes require a scoped host startup grant. Does not reason with an internal model.| Parameter | Type | Description |
|---|---|---|
| action * | string | inspect; preview a candidate; apply/verify/revert a preview plan. |
| candidate | any | |
| directory | string | Absolute path; default cwd |
| plan | object | Exact complete preview result, unchanged, required for apply/verify/revert. |
| scope | string | Repository-relative directory to inspect (default: root). |
declare_footprintUSE THIS WHEN: several agents work in worktrees of one clone and you start a task. Publishes your writeSet/readSet (symbols or files; unknown names = intended creations) to the clone's peer board and returns hazards vs live peers (the plan_parallel_work classes plus duplicate-intent). action: release when done, list to read. Entries end on release, merged or deleted branch, or 30 min idle, never on a check git could not answer. Advisory; peer text local-unreviewed.| Parameter | Type | Description |
|---|---|---|
| action | string | declare (default), release, or list. |
| actorId | string | Stable agent id (default <branch>@<worktree>). |
| directory | string | Absolute path; default cwd |
| readSet | array | Symbols or files this agent depends on but will not edit. |
| title | string | Task title (120 chars). |
| writeMode | string | "append" for pure registration-site additions (default "modify"). |
| writeSet | array | Symbols or files this agent will edit; a name not in the index is an intended creation. |
detect_changesDetect recently changed functions and rank them by blast radius. Runs git diff against a base ref (default HEAD), maps changed lines to function nodes, then scores each changed function by fan-in + transitive callers. Highest-scored functions are the riskiest to break. Also reports test coverage for each changed function via tested_by edges. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| base | string | Git ref to diff against (default: HEAD). Use "HEAD~1" for last commit, "main" for branch diff. |
| directory | string | Absolute path; default cwd |
explain_retrieval_missExplain why one named target missed search_code or search_specs; unlike either search, requires an exact target.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| domain | string | The domain filter the search used (surface "spec" only). |
| language | string | The language filter the search used (surface "code" only). |
| limit | integer | The limit the search used (default 10). |
| minFanIn | integer | The minFanIn filter the search used (surface "code" only). |
| query * | string | The query that missed, exactly as passed to the search. |
| section | string | The section filter the search used (surface "spec" only). |
| surface * | string | "code" for search_code, "spec" for search_specs. |
| target * | object | The result you expected the search to return. |
federation_statusReport the multi-repo federation registry (.openlore/federation.json) and each registered repo's live index state (indexed/stale/unindexed/missing). Index-of-indexes: no merged graph. Read-only.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
find_clonesUSE THIS WHEN: you are about to write a function — "does a near-duplicate already exist that I should reuse?". Unlike get_duplicate_report (the whole-repo audit of every clone group), this answers ONE query: `symbol` (name or name::path in the index) or `snippet` (raw code, checked BEFORE you write it). Returns clones ranked exact > structural (renamed identifiers) > near (token overlap ≥ floor), each with file, function, line range, similarity, and language. One-vs-all, so it works where the whole-repo O(n²) pass is skipped. An unknown symbol is not-found with candidates, never "unique"; a query below the evidence floor is "too small to compare"; the query never matches itself; HTML inline-script symbols are excluded. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| maxResults | number | Cap on returned matches (default 25, max 200). |
| minSimilarity | number | Near-clone Jaccard floor for this query (default 0.7, clamped to [0.1, 1]). Exact/structural matches are always included. |
| snippet | string | Raw code to find clones of (need not be in the index) — answers the pre-write "does this already exist?". Provide exactly one of symbol or snippet. |
| symbol | string | A function in the index to find clones of: its name, or name::path to disambiguate. Provide exactly one of symbol or snippet. |
find_dead_codeUSE THIS WHEN: "what code is unreachable / dead?", "is anything calling X?", or "what becomes dead if I delete X?". Cross-language mark-and-sweep reachability from roots (tests, imported symbols, route handlers, main, files a config invokes) over the call graph. Pass ifDeleted to get the downstream-only-reachable set for a symbol. Results are confidence-tagged CANDIDATES, never deletion authority — dynamic dispatch, DI, and external consumers cause false positives, stated in the response. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directResolvedOnly | boolean | Restrict reachability to directly-resolved edges, ignoring synthesized dynamic-dispatch edges — strict certainty over completeness (default false). |
| directory | string | Absolute path; default cwd |
| filePattern | string | Only report candidates whose file path contains this substring |
| ifDeleted | string | Symbol name — returns what becomes dead if it is deleted (delete-impact mode) |
| maxResults | number | Max candidate-dead results (default 100) |
find_pathFind the route from A to B in the call graph. `from`/`to` may be exact/fuzzy function names OR selectors: landmark:<id>, role:entrypoint|hub|sink, file:<path>. Returns the single CHEAPEST path (by call-distance, or fewest hops if useCallDistance=false) plus a few bounded alternates and a reason — not a raw multi-path dump. "No path within budget" is an explicit answer. Distinct from trace_execution_path, which enumerates ALL paths for debugging: reach for find_path to select the cheapest route (by name, role, or landmark), trace_execution_path to see every path. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directResolvedOnly | boolean | Traverse only directly-resolved edges, ignoring synthesized dynamic-dispatch edges (default false). |
| directory | string | Absolute path; default cwd |
| from * | string | Start endpoint: a function name, or landmark:<id> / role:entrypoint|hub|sink / file:<path> |
| to * | string | Goal endpoint: a function name, or landmark:<id> / role:entrypoint|hub|sink / file:<path> |
| useCallDistance | boolean | Rank by confidence-weighted call-distance (default true); false ranks by fewest hops |
fleet_statusUSE THIS WHEN: coordinating parallel agents/branches off a moving base — "which of my recorded verdicts still hold, and what is the coordination picture?". Re-checks each recorded coordination verdict (a clean blast radius, a stable public surface, a passed certify_merge) against the current graph via the freshness lease: still-valid / carried / invalidated / needs-reverification; a verdict is never served fresh once its base moved without the check. Composes plan_parallel_work → map_in_flight_conflicts → certify_merge. A record ENDS on board-entry evidence (30 min idle, dir gone, branch deleted or merged): then a count with its reason, not a live verdict. A rule it could not evaluate is in unknownPredicates, never read as ended. Advisory.| Parameter | Type | Description |
|---|---|---|
| branches | array | In-flight branches to compose the arc for (attribution + the tools to run per branch). |
| directory | string | Absolute path; default cwd |
generate_change_proposalUSE THIS WHEN: you have a BMAD story, a feature description, or a spec delta request, and want to create a structured OpenSpec change proposal before writing any code. Combines orient + search_specs + analyze_impact to produce a pre-filled <spec root>/changes/{slug}/proposal.md (spec root = openspecPath, default openspec) — no LLM required. Output includes affected domains, touched requirements, risk scores, and insertion points. Run analyze_codebase first; spec index optional (degrades gracefully).| Parameter | Type | Description |
|---|---|---|
| description * | string | Intent of the change — story title + primary AC, or a free-form feature description. e.g. "add retry logic to payment processing — must retry up to 3 times on timeout" |
| directory | string | Absolute path; default cwd |
| slug * | string | Change identifier used as the directory name, e.g. "add-payment-retry". Will be lowercased and hyphenated automatically. |
| storyContent | string | Optional: full BMAD story content (markdown). If provided, it is embedded verbatim in the proposal for traceability. |
generate_testsGenerate spec-driven test files from OpenSpec scenarios. Supports vitest, playwright (JS/TS), pytest (Python), gtest and catch2 (C++), junit (Java/Kotlin) and gotest (Go). A THEN clause pattern engine emits real assertions for common patterns (HTTP status codes, property presence, error messages) without any LLM call. Pass useLlm:true to enrich unmatched clauses using mapped function source. Each generated test is tagged with a parseable openlore: metadata comment that enables spec coverage tracking via get_test_coverage. Defaults to dryRun:true — set dryRun:false to write files to disk.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| domains | array | Only generate tests for these spec domains (omit for all) |
| dryRun | boolean | Preview generated content without writing files (default: true) |
| framework | string | Test framework (default: auto-detect from project files) |
| useLlm | boolean | Use LLM to fill in assertions the pattern engine cannot match |
get_architecture_overviewUSE THIS WHEN: the user asks "how is this project organized?", "what are the main components?", or wants a broad overview before diving in. Returns domain clusters, cross-cluster dependencies, global entry points, and critical hubs in one call — faster than reading package.json + directory tree yourself.| Parameter | Type | Description |
|---|---|---|
| directory * | string | Absolute path to the project directory |
get_call_graphUSE THIS WHEN: the user asks "which functions are called the most?", "what are the critical bottlenecks?", or "are there layer violations?". Returns hub functions, entry points, and architecture violations across all files — impossible to reconstruct by reading individual files.| Parameter | Type | Description |
|---|---|---|
| directory * | string | Absolute path to the project directory |
get_change_couplingUSE THIS WHEN: "what changes together with this file?" or "what is the most volatile code?". Mined from local git history (not the call graph): co-change coupling surfaces invisible coupling with no import/call edge (the config + parser that move in lockstep), and volatility/churn flags risky high-change code. Pass a file for its coupling, or omit for the most-volatile overview. Advisory signal (correlation, not causation); bulk commits filtered. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| file | string | A file to query its coupling/volatility. Omit for the most-volatile overview. |
| limit | number | Cap results (default 20) |
get_clusterReturn all functions in the same community as the given function. Communities are computed via label propagation on the call graph at analyze time — tightly coupled functions land in the same cluster regardless of directory. Use this to understand the "blast radius neighbourhood" without traversing the graph manually. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| functionName * | string | Function name to look up the community for |
get_critical_hubsUSE THIS WHEN: the user asks "what's the most central code?", "what should I refactor to reduce coupling?", or "which functions are shared the most?". Lists the highest fan-in functions — modifying them has the widest blast radius.| Parameter | Type | Description |
|---|---|---|
| directory * | string | Absolute path to the project directory |
| limit | number | Maximum hubs to return (default: 10) |
| minFanIn | number | Minimum fan-in threshold (default: 3) |
get_duplicate_reportDetect duplicate code (clone groups) across the codebase using pure static analysis. Detects Type 1 (exact clones — identical after whitespace/comment normalization), Type 2 (structural clones — same structure with renamed variables), and Type 3 (near-clones with Jaccard similarity ≥ 0.7 on token n-grams). This is the WHOLE-REPO audit of every clone group; for the pre-write "does a near-duplicate of THIS function already exist?" one-vs-all query, use find_clones instead. Returns a concise summary (stats + top clone groups + a truncation receipt) by default; pass responseFormat:"detailed" for the full report. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| responseFormat | string | Output verbosity. "concise" (default): stats + the top clone groups + a truncation receipt. "detailed": the full report. |
get_env_varsReturn all environment variables referenced in the project: names, which files use them, whether they have a known default (from .env.example), and whether they are required (used without a fallback in source code). Reads the pre-computed env-inventory.json artifact when available, otherwise scans source files live. Supports JS/TS (process.env), Python (os.environ/os.getenv), Go (os.Getenv), Ruby (ENV[]). Returns a concise summary by default; pass responseFormat:"detailed" for the full inventory. Run analyze_codebase first for the fastest results.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| responseFormat | any |
get_external_packagesReturn all direct external dependencies declared in package manifests: package.json (npm), pyproject.toml / requirements.txt (pypi), Cargo.toml (cargo), go.mod (go). Each entry includes name, version, ecosystem, and isDev flag. Reads the pre-computed external-packages.json artifact when available, otherwise scans manifests live. Run analyze_codebase first for the fastest results.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
get_file_dependenciesUSE THIS WHEN: the user asks "what does file X import?", "what files depend on Y?", or when planning a refactor and needing to understand coupling before touching a file. Uses pre-computed in/out degree — no need to grep import statements across the codebase.| Parameter | Type | Description |
|---|---|---|
| direction | string | "imports", "importedBy", or "both" (default) |
| directory * | string | Absolute path to the project directory |
| filePath * | string | Relative file path, e.g. "src/core/analyzer/vector-index.ts" |
get_function_bodyReturn the exact source code of a named function in a file. Use focus plus focusKind for stored variable/callee evidence; omit both for the full implementation. Prior analysis enables exact byte ranges; otherwise it parses the file now and errors if no definition is found.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| filePath * | string | File path relative to the project directory, e.g. "src/auth/jwt.ts" |
| focus | string | Variable or callee name; requires focusKind. |
| focusKind | string | Required with focus; selects its evidence kind. |
| functionName * | string | Name of the function to extract, e.g. "verifyToken" |
get_function_skeletonReturn a noise-stripped skeleton of a source file: logs, inline comments, and non-JSDoc block comments are removed while signatures, control flow (if/for/try), return/throw statements, and call expressions are preserved. Use this before refactoring a god function to get a compact structural view without reading thousands of lines of raw source.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| filePath * | string | Path to the file, relative to the project directory |
get_god_functionsUSE THIS WHEN: the user asks "which functions do too much?", "what are the worst SRP violations?", or "which functions should be split?". Finds high fan-out orchestrators — the functions most likely to need decomposition.| Parameter | Type | Description |
|---|---|---|
| directory * | string | Absolute path to the project directory |
| fanOutThreshold | number | Minimum fan-out (default: 8) |
| filePath | string | Optional: restrict to a specific file |
get_handoff_briefingUSE THIS WHEN: you take over in-flight work in a fresh context (after compaction, a cleared session, or another machine) and need the state of the change, not a prose summary. Unlike blast_radius (a pending diff), briefing_since (others' landed changes) and orient (a new task), this hands over an in-flight change: the touched symbols (working tree, plus this session's commits when a session ledger is live) with callers, open openspec changes naming them with unchecked tasks quoted, reaching tests, in-scope memories and decisions (orphaned ones withheld), specs that may go stale, uncommitted files, and the index lease. A budget trims the least central sections first, with omission receipts. A clean tree says nothing is in flight. Reads no transcript.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| tokenBudget | number | Approximate token budget for the briefing (default 1500, 300-8000). |
get_health_mapReturn a structural health dashboard: hubs (high fan-in), god functions (high fan-out), layer violations, and volatile files — aggregated in one call and ranked by severity. Use this as a starting point before a refactor or code review to identify the riskiest areas. Drill in with get_critical_hubs, get_god_functions, get_change_coupling, or find_dead_code. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| limit | number | Max items per hotspot list and max topRisks (default: 10, max: 50) |
get_landmarksWhole-repo structural anchors as LABELED signals with evidence: the union of hub/orchestrator/chokepoint/volatile/entrypoint/dead (each per-signal tool exposes only one). Each function carries its earned labels + raw evidence (e.g. hub:{fanIn}); no blended score — rank as your task needs. Optionally filter to one label. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| label | string | Optional: return only landmarks carrying this label (hub | orchestrator | chokepoint | volatile | entrypoint | dead) |
| limit | number | Max landmarks to return, ordered by fan-in (default: 20, max: 200) |
get_language_supportUSE THIS WHEN: a result for a file looks empty or weak and you need to know whether that means "nothing found" or "this language is only partly supported". Returns the deterministic capability matrix (${LANGUAGE_CAPABILITIES.join(', ')}) for the repo's DETECTED languages, or, with a`language` name, that one language (an unknown language returns an all-unsupported record, never an error). An unsupported capability yields nothing, never a guess. Repo mode needs analyze_codebase first; a named language does not.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| language | string | Optional: a specific language name (e.g. "Go", "Kotlin"). Omit to report the repo's detected languages. |
get_leaf_functionsReturn functions that make no internal calls (leaves of the call graph). These are the safest refactoring targets: self-contained, easy to unit-test, zero downstream blast radius. Best entry point for bottom-up refactoring. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| filePattern | string | Optional substring to restrict results to matching file paths |
| limit | number | Maximum number of results to return (default: 20) |
| sortBy | string | Sort order: "fanIn" (most-called leaves first, default), "name", or "file" |
get_low_risk_refactor_candidatesReturn the safest functions to refactor first: low fan-in (few callers), low fan-out (few dependencies), no cyclic involvement, not a hub. Ideal starting point for incremental, low-risk refactoring sessions. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| filePattern | string | Optional substring to restrict candidates to matching file paths |
| limit | number | Maximum number of candidates to return (default: 5) |
get_mapThe lay of the land: a coarse-to-fine map of the call graph. With no communityId, returns the REGION view — each code community as a super-node (label, size, top files, top landmark) plus weighted inter-region connections, no function bodies — so you can see where regions connect without reading any code. Pass a communityId to drill into one region at function granularity. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| communityId | string | Optional: drill into this region (a communityId from the region view) at function granularity |
| directory | string | Absolute path; default cwd |
get_mappingReturn the requirement → function mapping produced by openlore generate. Shows which functions implement which spec requirements, confidence level (llm / heuristic), and orphan functions not covered by any requirement. Requires openlore generate to have been run at least once.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| domain | string | Filter by domain name (e.g. "auth", "crawler") |
| orphansOnly | boolean | Return only orphan functions (not covered by any requirement) |
get_middleware_inventoryReturn the middleware inventory for the project: all detected middleware entries with type (auth, cors, rate-limit, validation, logging, error-handler, custom), framework, source file, line number, and name. Reads the pre-computed middleware-inventory.json artifact when available, otherwise scans source files live. Supports Express, Hono, Fastify, NestJS, Next.js, and more. Returns a concise summary by default; pass responseFormat:"detailed" for the full inventory. Run analyze_codebase first for the fastest results.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| responseFormat | any |
get_minimal_contextReturn the minimum context needed to safely modify a function: its signature and body, direct callers (signatures only), direct callees (signatures only), and which test files cover it. Use this instead of orient when you already know exactly which function to modify. Typically 200-600 tokens vs orient's 2000+. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| filePath | string | Optional relative file path to disambiguate when multiple functions share the name |
| functionName * | string | Exact function or method name |
| rankBy | string | Opt-in caller/callee ordering (default "distance"). "pagerank" orders neighbours by personalized PageRank seeded on the target and attaches a per-neighbour `relevance`. Default output unchanged. |
| tokenBudget | number | Optional (pagerank mode): cap callers+callees to ~this many tokens, keeping highest-relevance neighbours and reporting `omittedForBudget` instead of truncating. |
get_refactor_reportUSE THIS WHEN: the user asks "what should I clean up?", "what's the biggest technical debt?", or "what are the worst code quality issues?". Returns a prioritized list: unreachable code, hub overload, god functions, SRP violations, cyclic dependencies — all in one report.| Parameter | Type | Description |
|---|---|---|
| directory * | string | Absolute path to the project directory |
get_route_inventoryReturn the full HTTP/API route inventory for the project: total count, breakdown by HTTP method and framework, and the list of individual routes with method, path, framework, source file, and handler name. Reads the pre-computed route-inventory.json artifact when available (runs in < 1 ms), otherwise scans source files live. Supports Express, Hono, Fastify, NestJS, Next.js App Router, FastAPI, Flask, Django, and more. Run analyze_codebase first for the fastest results.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
get_schema_inventoryReturn the database schema inventory for the project: all detected ORM model/table definitions with their fields, types, and nullability. Reads the pre-computed schema-inventory.json artifact when available, otherwise scans source files live. Supports Prisma, TypeORM, Drizzle ORM, and SQLAlchemy. Returns a concise summary by default; pass responseFormat:"detailed" for the full inventory. Run analyze_codebase first for the fastest results.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| responseFormat | any |
get_signaturesReturn compact function and class signatures for files in a project. Useful for understanding a codebase's public API without reading full source. Optionally filter by file path pattern. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| filePattern | string | Optional substring to filter file paths (e.g. "services", "api", ".py") |
get_specUSE THIS WHEN: the user asks to read a specific spec domain — "show me the auth spec", "what does the analyzer spec say?", "read the API spec". Returns the full spec content and the functions that implement it, in one call.| Parameter | Type | Description |
|---|---|---|
| directory * | string | Absolute path to the project directory |
| domain * | string | Domain name, e.g. "auth" or "analyzer" |
get_style_fingerprintUSE THIS WHEN: you are about to write or edit code and want to match the house style instead of your training default. Returns a DESCRIPTIVE idiom profile measured from the AST: per language, the dominant choice for a fixed set of idioms (arrow vs. declared function, const vs. let, ternary vs. if, await vs. .then, template vs. concatenation, function-naming case) as { dominant, ratio, samples }. Repository profile by default; pass communityId for a region (from get_map) or filePath for one file. An idiom below the evidence floor, or one the language or formatter enforces (Go ties case to visibility), reports a null signal, never a guess. No lint judgment, no composite style score. Languages: TypeScript, JavaScript, Python, Go (others fail-soft). Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| communityId | string | Profile one community/region by id (list ids with get_map). |
| directory | string | Absolute path; default cwd |
| filePath | string | Profile a single file (exact path or a unique path suffix). Most specific scope: if both filePath and communityId are given, filePath wins. |
| language | string | Restrict the returned languages to this one (e.g. "TypeScript"). |
get_subgraphUSE THIS WHEN: the user needs to trace calls from or to a specific function — "what does X call?", "who calls Y?", "show me the call chain for Z". More targeted than get_call_graph. Works across all files without you having to grep through each one.| Parameter | Type | Description |
|---|---|---|
| direction | string | Direction (default: downstream) |
| directory * | string | Absolute path to the project directory |
| functionName * | string | Function name (exact or partial match) |
| maxDepth | number | BFS depth limit (default: 3) |
get_surprising_connectionsFind unexpected structural coupling via composite scoring: cross-community edges, peripheral-to-hub calls, and cross-test-boundary dependencies. Use before a refactor or code review to spot accidental dependencies. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| limit | number | Max results to return (default: 15, max: 50) |
get_test_coverageReport which OpenSpec scenarios have corresponding test coverage. Scans test files for // openlore: {JSON} or # openlore: {JSON} metadata tags (added automatically by generate_tests). Returns coverage percentage by domain, a list of uncovered scenarios, and flags domains where spec drift was detected. Use minCoverage to enforce a CI coverage gate.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| domains | array | Only check these spec domains (omit for all) |
| minCoverage | number | Report belowThreshold:true if effective coverage is below this percentage |
get_ui_component_inventoryReturn the UI component inventory for the project: all detected components with their framework, props, source file, and line number. Reads the pre-computed ui-inventory.json artifact when available, otherwise scans source files live. Supports React, Vue, Svelte, and Angular. Returns a concise summary by default; pass responseFormat:"detailed" for the full inventory. Run analyze_codebase first for the fastest results.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| responseFormat | any |
list_decisionsList architectural decisions recorded during the current session. Shows draft, consolidated, verified, approved, rejected, and synced decisions. Use approve_decision or reject_decision to act on verified decisions, then sync_decisions to write them to spec.md files.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| status | string | Filter by status (default: returns all) |
list_spec_domainsList all OpenSpec domains available in this project. Use this first when you need to discover what domains exist before doing a targeted search_specs call.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
locate_symbol_spanUSE THIS WHEN: you know WHICH symbol to edit and need its exact location, instead of re-finding it by string-matching a fresh read. Resolves `symbol` (a name, or name::path to disambiguate) and returns the span (startByte/endByte as UTF-16 code-unit offsets + 1-based startLine/endLine) with a freshness VERDICT: `fresh` (the index matches the file; safe to edit at, with a contentHash token), `stale` (the file changed since analysis; a re-analyze hint and NO offset), `ambiguous` (name::path candidates), or `not-found` (candidates). Unlike suggest_insertion_points (where to ADD code), this pinpoints an EXISTING symbol. Read-only: the host applies the edit with its own edit tool. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| symbol * | string | The symbol to locate: its name, or name::path to disambiguate. |
map_in_flight_conflictsUSE THIS WHEN: many humans/agents edit one codebase and you want to know, before merge, which in-flight changes collide. Builds ONE conflict graph over local branches, open PRs (via gh), and supplied agent task descriptors. Each footprint comes from the ACTUAL diff (per-symbol append vs modify, so two PRs appending disjoint registry entries do NOT falsely conflict); the WAW/RAW/shared-append/WAR classifier runs across all of them. Per conflict: the two actors, hazard, shared symbols, landing order, and git merge-tree textualMerge. A change whose diff can't be fetched or whose symbols don't resolve is "not assessed", never "no conflict". Read-only, advisory. Same classifier as plan_parallel_work, which plans a caller-supplied task list instead. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| baseRef | string | Git ref every change is diffed against (default: resolved default branch). |
| branches | array | Restrict to these branch names (default: all ahead of base). |
| directory | string | Absolute path; default cwd |
| includeBranches | boolean | Include local branches ahead of base (default true). |
| includePullRequests | boolean | Include open PRs via gh (default true; absent gh degrades). |
| maxChanges | number | Cap on assessed changes (default 40). |
| tasks | array | Optional agent task descriptors that join as first-class nodes (plan_parallel_work shape: id + seedSymbols/seedFiles + optional writeMode). |
orientSTART HERE. USE THIS WHEN: beginning any new task — "add X", "fix Y", "where does Z live?". Returns relevant functions, files, spec domains, call neighbours, and insertion points in ONE call. Replaces the need to chain search_code → search_specs → suggest_insertion_points manually.| Parameter | Type | Description |
|---|---|---|
| directory * | string | Absolute path to the project directory |
| limit | number | Number of relevant functions to return (default: 5) |
| task * | string | Natural language description of the task |
plan_parallel_workUSE THIS WHEN: before fanning N tasks out across agents/worktrees — "which of these tasks are safe to run concurrently, and in what order?". Given a caller-supplied task list (id + seed symbols/files each), returns the plan: a hazard-typed conflict graph (WAW/shared-append/RAW/WAR/soft-coupling), a wave schedule (wave 1 = dispatch now), and the critical path (minimum rounds with unlimited agents). Stateless, advisory; re-invoke with remaining tasks to re-plan. Mark registration-site touches writeMode:"append" so they are not falsely serialized. Same hazard classifier as map_in_flight_conflicts, different input: this plans a caller-supplied task list, map_in_flight_conflicts harvests changes already in flight (branches/PRs). Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| includeBoard | boolean | Also plan the live peer-board agents (declare_footprint) as tasks board:<actorId>. |
| tasks * | array | Task descriptors; each needs an id and ≥1 seed (symbol or file). The list is never invented or decomposed. |
prepare_spec_generationReturn paged evidence for a host to author an OpenSpec domain. Read-only; no LLM or writes.| Parameter | Type | Description |
|---|---|---|
| cursor | string | Continuation cursor. |
| directory | string | Absolute path; default cwd |
| domain * | string | Analyzed domain to document. |
| maxItems | number | Page size (default 80). |
| maxResponseBytes | number | Byte budget (default 49,152). |
prepare_spec_repairReturn paged evidence for a host to repair an OpenSpec domain. Read-only; no LLM or writes.| Parameter | Type | Description |
|---|---|---|
| baseRef | string | Drift comparison ref. |
| cursor | string | Continuation cursor. |
| directory | string | Absolute path; default cwd |
| domain * | string | Existing domain to repair. |
| maxItems | number | Maximum evidence records per page (default 80). |
| maxResponseBytes | number | Byte budget (default 49,152). |
recallRecall code-anchored memories (notes + decisions) for a task with a freshness verdict: fresh, drifted (verify), or orphaned (in needsReanchoring, never authoritative). Two authoritative memories on one symbol surface in unreconciled. Optional: asOf/changedSince (commit-ish) for history, type filter, federation (surface producer-repo memory on interfaces you call). Omit task to scan all.| Parameter | Type | Description |
|---|---|---|
| asOf | string | Commit-ish: memory authoritative as of that commit. |
| changedSince | string | Commit-ish: memory recorded/invalidated after it. |
| directory | string | Absolute path; default cwd |
| limit | number | Max memories to return (default: 10). |
| task | string | What you are about to work on (optional). |
| tokenBudget | number | Optional token cap; reports withheld count. |
| type | string | Restrict notes to this type (decisions excluded when set). |
record_decisionRecord an architectural decision. Call this on a significant design choice: data structure, library, API contract, auth strategy. Under decision autopilot (the default unless a blocking decisions gate is installed) it is accepted at once as auto-approved and a human reviews it later; otherwise it is a DRAFT, and diff-grounded consolidation then promotes it (possibly rewording it, keeping your text as authorStatement), merges it, or rejects it — always with a stated reason. The response returns the draft id and the command that reads the verdict; re-recording a decided draft returns that verdict instead of a second draft. Use supersedes when a later decision replaces an earlier one.| Parameter | Type | Description |
|---|---|---|
| affectedFiles | array | Source files most relevant to this decision (optional) |
| consequences | string | What changes as a result (optional) |
| constraints | object | Optional versioned architecture constraints. Rules use the existing layers / forbidden / allowedOnly vocabulary and inherit this decision's lifecycle. |
| directory | string | Absolute path; default cwd |
| rationale * | string | Why this decision was made |
| scope | string | Decision scope. local: single file; component: single module/service; cross-domain: multiple spec domains or service contracts; system: global constraint. Only cross-domain and system generate ADR files. Defaults to component; auto-promoted to cross-domain when multiple domains inferred. |
| supersedes | string | ID of a prior decision this one replaces (optional) |
| title * | string | Short imperative statement, e.g. "Use UUIDs for decision IDs" |
reject_decisionReject a pending decision. Rejected decisions are never synced to spec files.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| id * | string | 8-character decision ID from list_decisions |
| note | string | Optional reason for rejection |
rememberPersist a durable, code-anchored memory to recall later (invariant/gotcha/rationale). Pass anchors (symbol and/or file) so it self-invalidates when that code changes. Optional: type (default note) and supersedes=<id> to retire a prior memory; re-recording the same content+anchor updates in place. For spec-synced decisions use record_decision.| Parameter | Type | Description |
|---|---|---|
| anchors | array | Code this memory is about; each anchor names a symbol and/or file. |
| claims | array | verify_claim claims it rests on; must hold now, rechecked at recall. |
| content * | string | The memory to persist (one self-contained fact). |
| directory | string | Absolute path; default cwd |
| pinned | boolean | Push into every full orient briefing (cap 10). |
| supersedes | string | Id of a prior memory to retire (kept queryable via asOf). |
| tags | array | Optional retrieval tags. |
| trigger | object | One predicate; pushed into orient/blast_radius on a match. Globs: * ? **. |
| type | string | Classification (default note); never inferred. |
report_coverage_gapsUSE THIS WHEN: you need to know which important code has NO test reaching it — "is the risky part of this change tested?", where to start improving coverage, or the untested HUBS ranked. Computes the structural inverse of select_tests over the whole graph (functions in no test's reachable set), ranked by hub/chokepoint significance. SOUND DIRECTION ONLY: it reports "no reaching test" and NEVER claims a symbol is "tested"; reachable-from-a-test is not behavior-verified. Distinct from find_dead_code (a gap with no caller at all is labeled also-dead) and from get_test_coverage (spec-tag based). No runtime, no coverage tool, deterministic. Scope to a diff (changedSymbols/diffRef) or a region (filePattern). Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| changedSymbols | array | Restrict to gaps among these changed symbols (diff scope). |
| diffRef | string | Git ref to diff the working tree against for diff scope (e.g. "HEAD", "main"). |
| directResolvedOnly | boolean | Count only directly-resolved edges as test-reach (ignore synthesized dynamic-dispatch); reports more gaps, more certainly. Default false. |
| directory | string | Absolute path; default cwd |
| filePattern | string | Only report gaps whose file path contains this substring (region scope). |
| maxResults | number | Limit reported gaps (default 100, capped 500). |
search_codeUSE THIS WHEN: you don't know which file or function handles a concept — "where is rate limiting implemented?", "which function validates tokens?", "what handles authentication?". Beats grep when the function name is unknown. Falls back to keyword search automatically if the embedding server is down.| Parameter | Type | Description |
|---|---|---|
| directory * | string | Absolute path to the project directory |
| limit | number | Results to return (default: 10) |
| query * | string | Natural language search query |
search_specsUSE THIS WHEN: the user asks "which spec covers X?", "what does the spec say about Y?", "which requirement describes Z?", or "what domains exist?". Omit query to list available spec domains. Provide a query to search by meaning. Returns linked source files for graph highlighting.| Parameter | Type | Description |
|---|---|---|
| directory * | string | Absolute path to the project directory |
| domain | string | Filter by domain name (e.g. "auth", "analyzer") |
| limit | number | Results to return (default: 10) |
| query | string | Natural language search query (omit to list domains) |
| section | string | Filter by section type: "requirements", "purpose", "design", "architecture", "entities" |
search_unifiedUSE THIS WHEN: you want to find where something is implemented AND what the spec says about it in a single call. Searches both code functions and spec requirements simultaneously, then cross-boosts results that are linked through mapping.json — so a function that implements a matching requirement ranks higher than one found by code search alone. Returns results with type "code", "spec", or "both" and a mappingBoost score. Requires "openlore analyze --embed" and a prior "openlore generate" run.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| domain | string | Filter spec results by domain name |
| language | string | Filter code results by language (e.g. "TypeScript") |
| limit | number | Maximum number of results to return (default: 10) |
| query * | string | Natural language query, e.g. "validate user authentication" |
| section | string | Filter spec results by section type: "requirements", "purpose", etc. |
select_testsUSE THIS WHEN: you changed code and want to know which tests to run — "which tests cover parseConfig?", "what should I run for this diff?". Walks the call graph BACKWARD from the change to every test that reaches it, with the reaching path per test, and always includes changed and new test files; each test says why it was selected. An over-approximate PRIORITIZER (run these first), not a sound replacement for the full suite; the response states its confidence and coverage. A diff resolves to the symbols that changed (formatting and comments are not changes); a file kept whole says why in changeGranularity. The inverse of report_coverage_gaps (important code NO test reaches). Deterministic, offline, no test run. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| changedSymbols | array | Changed function/method names. Optional — if neither this nor diffRef is given, defaults to your current working-tree changes vs HEAD. |
| diffRef | string | Git ref to diff the working tree against (e.g. "HEAD", "main"). Optional — defaults to HEAD when neither this nor changedSymbols is given. |
| directResolvedOnly | boolean | Traverse only directly-resolved edges, ignoring synthesized dynamic-dispatch edges (default false). |
| directory | string | Absolute path; default cwd |
| maxDepth | number | Backward reachability depth (default 12) |
spec_store_statusReport the health of a spec-store binding: an external spec repository (.openlore/config.json "specStore") whose declared target/reference repositories are resolved against the federation registry. Returns conclusion-shaped findings with stable codes (target-unresolved, index-stale, reference-missing, …) and pasteable remediations. Read-only; never blocks.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
structural_diffUSE THIS WHEN reviewing or refactoring a change: "what changed structurally?", "whose callers are now stale?". A graph diff (complement to git diff) between two states (working tree vs a ref, or two refs): functions/edges added & removed, signature changes, and the existing callers now STALE because a callee signature moved under them. Rename/move ambiguity is flagged, not guessed. Deterministic, offline. This is the raw graph delta; for the all-in-one pre-commit briefing use blast_radius, and for paths a diff newly opens into a sensitive surface use change_impact_certificate. Run analyze_codebase first for stale-caller analysis. Opt-in escape check: pass declaredFootprint to also flag symbols modified OUTSIDE the declared write-set and conflicts they open against peerFootprints.| Parameter | Type | Description |
|---|---|---|
| baseRef | string | Old state to diff against (default "HEAD") |
| declaredFootprint | object | OPT-IN escape check: the task's declared write-footprint (a plan_parallel_work `Footprint`). Shape { taskId?, writeSet: [{ id:"file::name", filePath?, writeMode?:append|modify }], readSet?:string[] }. Adds an `escapeAnalysis` block; omit = unchanged behavior. |
| directory | string | Absolute path; default cwd |
| files | array | Optional repository-relative files to analyze. Applied before category limits. |
| headRef | string | New state (a git ref). Omit to use the working tree. |
| maxResults | number | Cap reported items per category (default 200) |
| peerFootprints | array | Declared footprints of OTHER in-flight tasks (same shape as declaredFootprint). An escape landing in a peer's write-set opens a newly-reported conflict naming that peer. |
suggest_insertion_pointsUSE THIS WHEN: the user asks "where should I add X?", "where's the best place to implement Y?", or "how do I integrate Z into the existing code?". Combines semantic search + call graph to find ranked candidates with context — far more targeted than grepping for similar patterns.| Parameter | Type | Description |
|---|---|---|
| description * | string | Natural language description of the feature |
| directory * | string | Absolute path to the project directory |
| limit | number | Number of candidates (default: 5) |
sync_decisionsWrite all approved decisions into their target spec.md files. Appends new Requirement blocks and Decision sections (append-only, never overwrites). Creates ADR files in openspec/decisions/ for architectural decisions. Pass dryRun=true to preview without writing. Pass id to sync a single decision by ID.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| dryRun | boolean | Preview without writing files (default: false) |
| id | string | Sync only this specific decision ID (default: all approved) |
trace_execution_pathUSE THIS WHEN debugging: "how does request X reach function Y?", "which call chain produced this error?", "is there a path from A to B?". Returns all paths ordered by hop count. Complements get_subgraph (neighbourhood) with point-to-point tracing.| Parameter | Type | Description |
|---|---|---|
| directory * | string | Absolute path to the project directory |
| entryFunction * | string | Starting function name (exact or partial) |
| maxDepth | number | Max path length in hops (default: 6) |
| maxPaths | number | Max paths returned (default: 10) |
| targetFunction * | string | Target function name (exact or partial) |
unified_searchUSE THIS WHEN: the user asks to search across both code and specs — "find everything related to authentication", "show me code and specs for user validation", or "search for rate limiting implementation and requirements". Combines code and spec indexes with cross-scoring to boost results that are linked through bidirectional mappings. Results include provenance tags (code, spec, or both).| Parameter | Type | Description |
|---|---|---|
| directory * | string | Absolute path to the project directory |
| domain | string | Filter by spec domain (e.g., "auth", "analyzer") |
| language | string | Filter by language (e.g., "TypeScript", "Python") |
| limit | number | Results to return (default: 10) |
| query * | string | Natural language search query |
| section | string | Filter by spec section type: "requirements", "purpose", "design", etc. |
verify_changeUSE THIS WHEN: you just made a change and want ONE checklist before landing — "what did I break and what must I re-run?". One severity-ranked receipt of what the diff adds, each item with its subject, check, severity, and the fact behind it, plus the tests to run: removed or re-signed functions, breaking exports and their consumers, contract breaks, env keys still set in infrastructure, new architecture violations, added credentials, new import cycles, weakened checks, phantom imports, spec drift. Composes blast_radius and structural_diff; no LLM. Advisory: it runs and edits nothing. Its sibling blast_radius returns the full briefing. Run analyze_codebase first.| Parameter | Type | Description |
|---|---|---|
| baseRef | string | Git ref to diff the working tree against (e.g. "HEAD", "main"). Default HEAD (uncommitted changes). |
| directory | string | Absolute path; default cwd |
| staged | boolean | Grade the staged diff. Fails, naming the files, when the working tree has unstaged or untracked changes. |
verify_claimUSE THIS BEFORE asserting a structural fact ("X is dead", "Y calls Z", "this is safe to change") or citing a decision ("ADR abc12345 governs this"). Returns a deterministic verdict (confirmed | refuted | unverifiable) + a citation receipt — a graph computation, never an LLM guess. kinds: calls, reaches, impacts, dead, safe-to-change (structural); decision-current (is a recorded decision still authoritative?); decision-governed (a symbol); endpoint-implemented, endpoint-consumed ("METHOD /path"); tested (does a test assert on a symbol's output?); log-origin (which code prints a log line?). "unverifiable" is first-class when the claim hits a dynamic-dispatch blind spot or names an unknown decision — hedge or read the source. Run analyze_codebase first for structural kinds.| Parameter | Type | Description |
|---|---|---|
| directory | string | Absolute path; default cwd |
| kind * | string | The kind of claim to verify. |
| object | string | The second symbol — required for relational kinds (calls, reaches, impacts). |
| subject * | string | A symbol, decision id, "METHOD /path", leaseToken or log line. |
working_set_contextAssemble the working-set structural briefing for an active change in a spec-store binding: orient, generalized from one repo to the change's target repositories. Reads the change's proposal under the bound store, orients each resolved+indexed target on that intent, and returns ONE deterministic, token-budgeted briefing whose items are attributed per target (symbol, callers, spec domains, insertion points) plus fresh in-scope anchored intent. Conclusion-shaped, read-only, never blocks; orphaned intent is withheld and drifted intent is flagged. No LLM.| Parameter | Type | Description |
|---|---|---|
| change | string | The active change id to brief (its proposal lives under the bound store). |
| directory | string | Absolute path; default cwd |
| tokenBudget | number | Cap the merged briefing to ~this many tokens (default 8000). |
Security checks
Static checks derived from the repository 2 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 1.3K words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by flake.lock and 2 more.
- !No dynamic code executionScanned 587 source files and found 1 call to eval or shell execution, in src/cli/commands/drift.ts:177. Review how tool inputs reach them before granting credentials.
1 check has not been run yet.
What the source scan found
- Transport
- stdiosrc/cli/commands/mcp.ts:2846
- Starts other programs
- 34 callssrc/cli/commands/drift.ts:177, src/cli/commands/drift.ts:216, src/cli/commands/drift.ts:224
- Outbound network calls
- 37 callssrc/api/health.ts:115, src/cli/commands/doctor.ts:1185, src/cli/commands/serve-descriptor.ts:228
- Writes or deletes files
- 3 callssrc/utils/shutdown.ts:152, src/utils/shutdown.ts:168, src/utils/shutdown.ts:170
- Lockfile
- flake.lock and 2 more
Pattern matches on the source text of 587 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 1.3K words, fetched 2 days ago. The original in the repository is authoritative.
Read full README