repoctx

v2.6.0
io.github.nugehs/repoctx Checked 1 hour ago Published 4 months ago

Local-first code context, impact analysis, and merge-readiness verdicts for AI agents.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

repo_inspect Inspect Repository

Inspect repository shape, languages, package managers, script names, entrypoints, and git metadata. Returns up to 200 representative file paths; pass includeScripts:true to get full script command bodies instead of just names.

ParameterTypeDescription
includeScriptsbooleanInclude full package.json script command bodies, not just their names. Defaults to false.
pathstringRepository path. Defaults to current working directory.

repo_map Map Repository

Map a repository into a compact JSON code map, optionally narrowed by domain, file kind, or controller route. Pass domain to find files for a feature, kind to find files of a type (route, controller, service, apiClient, component, test), or route to match Nest controller routes by substring/regex. Replaces the old find_domain, find_file_kind, find_backend_route, and find_frontend_api_client tools. Writes a local .dev-context/index.json cache into the target repo; the call is idempotent and does not change source files.

ParameterTypeDescription
domainstringOptional domain filter such as booking, payment, email, events.
includeFilesbooleanInclude matching files in the response. Defaults to false.
kindstringOptional file kind filter such as route, controller, service, apiClient, component, test.
limitnumberMaximum files to include. Defaults to 100.
pathstringRepository path. Defaults to current working directory.
routestringOptional route filter. Substring or regex matched against each controller's combined route (controllerBasePath + httpMethods paths) and file path.

repo_index Index Repositories

Index local repositories: generate .dev-context indexes and add them to the local catalog. Pass discover:true to find repository roots under the given paths first. Pass dryRun:true to discover and report without writing any indexes or catalog (read-only); this replaces the old repo_discover tool. Without dryRun this mutates the persistent local catalog, so it is not a pure read.

ParameterTypeDescription
catalogstringOptional catalog JSON path.
depthnumberMaximum discovery depth.
discoverbooleanDiscover repositories under the provided paths before indexing.
dryRunbooleanDiscover and report repositories without writing indexes or mutating the catalog. Read-only. Defaults to false.
limitnumberMaximum discovered repositories.
pathstringSingle repository path.
pathsarrayRepository paths, or roots when discover is true.

context_pack Context Pack

Generate a task-aware local context packet with primary files, related files, tests, patterns, and validation commands. Writes a local .dev-context/index.json cache into the target repo; the call is idempotent and does not change source files.

ParameterTypeDescription
query *stringTask or question to gather context for.
includeEvidencebooleanInclude per-file imports, exports, and symbol slices as source evidence. Defaults to false to keep the packet compact.
includeMarkdownbooleanReturn a compact human-readable markdown report instead of the full JSON packet. Defaults to false.
limitnumberMaximum primary, related, and test files per section. Defaults to 8.
pathstringRepository path. Defaults to current working directory.
pathsarrayRepository paths for a multi-repo context packet.

change_impact Change Impact

Given a plain-English change request, rank the files most likely to own the change, with risk flags, suggested tests, and an implementation plan. Optional diff base validates predictions against actual changed files. Writes a local .dev-context/index.json cache into the target repo; the call is idempotent and does not change source files.

ParameterTypeDescription
query *stringPlain-English change request.
diffBasestringOptional git ref to validate predictions against (e.g. origin/main, HEAD).
includeMarkdownbooleanReturn a compact human-readable markdown report instead of the full JSON. Defaults to false.
pathstringRepository path. Defaults to current working directory.
topnumberNumber of files to return. Defaults to 10.

agent_experience Agent Experience (AX)

Score Agent Experience (AX): a single 0–100 number answering "how cheap and safe is it for an agent to make this change here?", blending Changeability (token cost), Containment (blast radius), Guardrails (tests / validation / CODEOWNERS / CI), and Clarity (task groundedness). Deterministic and composed from the change_impact, token-estimate, and CODEOWNERS engines — no new analysis. Returns sub-scores, drivers, and concrete recommendations for raising AX. Writes a local .dev-context/index.json cache into the target repo; the call is idempotent and does not change source files.

ParameterTypeDescription
query *stringPlain-English change request to score, e.g. "add a new MCP tool".
includeMarkdownbooleanReturn a compact human-readable markdown report instead of the full JSON. Defaults to false.
pathstringRepository path. Defaults to current working directory.
topnumberNumber of impact files to consider when scoring blast radius. Defaults to 8.

convergence_score Convergence Score

Score convergence: a deterministic 0–100 measure of the distance between a stated task (intent) and the actual git diff (execution), with sub-scores for Coverage (did the intent happen?), Scope (did only the intent happen?), and Risk alignment (did unrequested drift land on risk-sensitive paths?). Composed from the change_impact diff comparison and the shared risk vocabulary — no model, no new analysis. Emits a recomputable receipt (a timestamp-free hash anyone can regenerate and verify) as durable evidence. Requires a base git ref to diff against.

ParameterTypeDescription
base *stringGit ref to diff against (e.g. origin/main, HEAD~1). Required.
query *stringThe stated task / intent to measure against the diff, e.g. "add Stripe refunds".
includeMarkdownbooleanReturn a compact human-readable markdown report instead of the full JSON. Defaults to false.
pathstringRepository path. Defaults to current working directory.
topnumberNumber of predicted owner files to consider. Defaults to 10.

review_gate Review Gate

Gate a change for merge and return a PASS / WARN / FAIL verdict. Omit pr to run the local, no-GitHub gate against a base ref (changed files, secret safety, risk-sensitive paths, release discipline, validation commands, dependency audit, policy profile). Set pr to gate an open GitHub PR via `gh` (PR state, review decision, CODEOWNERS approvals, unresolved conversations, branch protection, status checks). Merges the old merge_readiness and pr_merge_readiness tools. Use review_verdict instead when you want the full impact + review + gate composite, or review_context when you want diff/comment con…

ParameterTypeDescription
basestringBase ref for the local gate. Defaults to origin/main, then HEAD. Ignored in PR mode.
governancestringGovernance: team (default) or solo.
minConvergencenumberOptional minimum convergence score (0–100). Enables a failing gate when the task/diff score is below this floor.
pathstringRepository path. Defaults to current working directory.
policystringPolicy profile: standard (default), company, or high-risk.
prstringOptional PR selector (number, URL, or branch). When set, runs the GitHub gate; when absent, runs the local gate.
receiptstringOptional convergence receipt id, hash, JSON object, or path to a JSON receipt artifact. Must match the current task, base, and commit.
requeststringOptional change request for context evidence output.
stagedbooleanInspect only the Git index. Use this for automatic pre-commit readiness; ignored in GitHub PR mode.

review_verdict Review Verdict

Run the full review pipeline in one shot: change_impact plus review_context plus review_gate, returning a unified verdict with a derived confidence score. Use review_verdict when you want the complete picture of a change in a single call. Use review_context instead for diff metadata only (no verdict), or review_gate for the gate verdict alone.

ParameterTypeDescription
basestringBase ref for local diff. Defaults to origin/main, then HEAD.
governancestringGovernance: team (default) or solo.
impactTopnumberNumber of impact files. Defaults to 8.
minConvergencenumberOptional minimum convergence score (0–100) enforced by the merge gate.
pathstringRepository path. Defaults to current working directory.
policystringPolicy profile: standard (default), company, or high-risk.
prstringOptional PR selector. When set, pass-pr runs against GitHub instead of local mode.
receiptstringOptional convergence receipt id, hash, JSON object, or path to a JSON receipt artifact.
requeststringPlain-English change request for impact scoring.

workspace_report Workspace Report

Generate a product-level report across multiple related repositories.

ParameterTypeDescription
paths *arrayRepository paths to inspect together.
includeMarkdownbooleanReturn a compact human-readable markdown report instead of the full JSON. Defaults to false.

review_context Review Context

Produce PR review context from local git diff metadata, optionally enriched with GitHub PR comments. Use review_context when you want the raw diff/comment context for a change, not a verdict. Use review_verdict instead for the full impact + review + gate composite, or review_gate for the gate verdict alone.

ParameterTypeDescription
basestringBase ref. Defaults to PR base, upstream, origin/main, or main.
commentbooleanCreate or update a sticky GitHub PR comment using gh. This writes to GitHub.
githubbooleanAsk gh to infer the current branch PR.
headstringHead ref. Defaults to HEAD.
includeMarkdownbooleanReturn a compact human-readable markdown report instead of the full JSON. Defaults to false.
numbernumberOptional GitHub PR number for gh enrichment.
pathstringRepository path. Defaults to current working directory.

repo_harness Repository Harness

Generate setup, validation, runtime, and context commands for an agent or CI harness.

ParameterTypeDescription
includeMarkdownbooleanReturn a compact human-readable markdown report instead of the full JSON. Defaults to false.
pathstringRepository path. Defaults to current working directory.