This document shows how external tools should consume repo-signal's stable JSON contracts.
| Command | Schema | Purpose |
|---|---|---|
repo-signal inspect --json |
inspect.v1 |
Fast repo status for tools and menus |
repo-signal doctor --json |
doctor.v1 |
Deeper readiness, docs, release, and AI-readiness diagnosis |
repo-signal report --format json |
report.v1 |
Unified report artifact for CI and assistant workflows |
repo-signal suggest --format json |
suggest.v1 |
Read-only improvement suggestions with no repository mutation |
Every consumer must check schema before reading fields. If the schema is
unknown, fail safely instead of parsing terminal text.
Always use the JSON output, not the terminal text:
repo-signal inspect --json
repo-signal inspect --json ~/some-repoThe first field to check is schema:
{
"schema": "inspect.v1"
}If schema is not "inspect.v1", treat the output as unknown and fail safely.
Full field reference: INSPECT_SCHEMA.md
Use doctor.v1 when a tool needs broader readiness context:
repo-signal doctor --json
repo-signal doctor . --format jsonSafe consumption pattern:
import json
import subprocess
def repo_doctor_json(path: str = ".") -> dict | None:
result = subprocess.run(
["repo-signal", "doctor", "--json", path],
capture_output=True, text=True, timeout=30,
)
if result.returncode != 0:
return None
try:
data = json.loads(result.stdout)
except json.JSONDecodeError:
return None
if data.get("schema") != "doctor.v1":
return None
return dataUseful fields:
scores.repo_healthscores.release_maturityscores.docs_qualityscores.ai_readinessrepoaware_context.summarysuggested_prioritiessuggested_skills
Full field reference: DOCTOR_SCHEMA.md
Use report.v1 when a CI job or assistant needs one combined artifact:
repo-signal report . --format jsonSafe consumption pattern:
import json
import subprocess
def repo_report_json(path: str = ".") -> dict | None:
result = subprocess.run(
["repo-signal", "report", path, "--format", "json"],
capture_output=True, text=True, timeout=30,
)
if result.returncode != 0:
return None
try:
data = json.loads(result.stdout)
except json.JSONDecodeError:
return None
if data.get("schema") != "report.v1":
return None
return dataUseful fields:
repogitpublic_readinessissuesrecommended_next_commitsections
Full field reference: REPORT_SCHEMA.md
Use suggest.v1 when a tool needs next-step improvement suggestions without
letting repo-signal mutate files:
repo-signal suggest . --format jsonSafe consumption pattern:
import json
import subprocess
def repo_suggest_json(path: str = ".") -> dict | None:
result = subprocess.run(
["repo-signal", "suggest", path, "--format", "json"],
capture_output=True, text=True, timeout=30,
)
if result.returncode != 0:
return None
try:
data = json.loads(result.stdout)
except json.JSONDecodeError:
return None
if data.get("schema") != "suggest.v1":
return None
return dataUseful fields:
suggestionssuggestions[].risksuggestions[].commit_groupsuggestions[].diff_previewno_mutation_guarantee
Full field reference: SUGGEST_SCHEMA.md
mqlaunch uses inspect.v1 to show live repo status in the menu system and
to drive smart repo-picker actions.
_inspect_json() {
local repo="${1:-.}"
repo-signal inspect --json "$repo" 2>/dev/null
}
_repo_name() {
_inspect_json "$1" | python3 -c "
import json, sys
d = json.load(sys.stdin)
if d.get('schema') != 'inspect.v1':
sys.exit(1)
print(d['repo']['name'])
"
}
_repo_status() {
_inspect_json "$1" | python3 -c "
import json, sys
d = json.load(sys.stdin)
if d.get('schema') != 'inspect.v1':
sys.exit(1)
score = d['public_readiness']['score']
total = d['public_readiness']['total']
branch = d['git']['branch']
clean = 'clean' if d['git']['clean'] else 'dirty'
print(f'{score}/{total} {branch} {clean}')
"
}run_repo_status_picker() {
local repo
repo=$(gh repo list --json name,url --jq '.[].name' | fzf --prompt "Repo > ")
[ -z "$repo" ] && return
local clone_path="$HOME/repos/$repo"
if [ -d "$clone_path" ]; then
repo-signal inspect --json "$clone_path" | python3 -m json.tool
else
echo "Not cloned: $clone_path"
fi
}mq-mcp exposes inspect.v1 as an MCP tool so Bridget and other MCP clients
can query live repo status.
@mcp.tool()
def repo_inspect(repo_path: str = ".") -> dict:
"""Return inspect.v1 status for the given repository path."""
import subprocess, json
result = subprocess.run(
["repo-signal", "inspect", "--json", repo_path],
capture_output=True, text=True, timeout=30,
)
if result.returncode != 0:
return {"error": result.stderr.strip()}
try:
data = json.loads(result.stdout)
except json.JSONDecodeError:
return {"error": "invalid JSON from repo-signal"}
if data.get("schema") != "inspect.v1":
return {"error": f"unknown schema: {data.get('schema')}"}
return dataWhen Bridget asks about repo status, the MCP tool returns the full inspect.v1
payload. Bridget should surface:
repo.name— repo namegit.branch+git.clean— current branch, working tree statepublic_readiness.summary— publish scoreissues— list of detected problemsrecommended_next_commit— what to do next
mq-hal uses inspect.v1 to drive repo-status commands and to populate
the repo health context sent to AI reasoning pipelines.
def doctor_commands(repo_path: str = ".") -> dict:
import subprocess, json
result = subprocess.run(
["repo-signal", "inspect", "--json", repo_path],
capture_output=True, text=True, timeout=30,
)
if result.returncode != 0:
return {"error": result.stderr.strip()}
data = json.loads(result.stdout)
if data.get("schema") != "inspect.v1":
return {"error": f"unexpected schema: {data.get('schema')}"}
return {
"repo": data["repo"]["name"],
"branch": data["git"]["branch"],
"clean": data["git"]["clean"],
"score": data["public_readiness"]["score"],
"issues": data["issues"],
"next": data["recommended_next_commit"],
"next_commands": data["useful_next_commands"],
}When injecting repo context into a prompt:
def repo_context_block(repo_path: str = ".") -> str:
status = doctor_commands(repo_path)
if "error" in status:
return f"[repo-signal error: {status['error']}]"
lines = [
f"repo: {status['repo']}",
f"branch: {status['branch']} ({'clean' if status['clean'] else 'dirty'})",
f"publish score: {status['score']}/16",
]
if status["issues"]:
lines.append("issues: " + ", ".join(i.get("label", str(i)) for i in status["issues"]))
lines.append(f"next: {status['next']}")
return "\n".join(lines)mq-agent uses inspect.v1 for repo scoring, doctor.v1 for semantic memory
context, report.v1 for combined review artifacts, and suggest.v1 for safe
improvement planning.
mq-agent score .Internally calls repo-signal inspect --json . and reads public_readiness.score.
mq-agent memory status
mq-agent memory build .
mq-agent memory refresh . --approveUses repo-signal semantic-upload to push repository context to a vector store.
import subprocess, json
def repo_inspect_json(path: str = ".") -> dict | None:
result = subprocess.run(
["repo-signal", "inspect", "--json", path],
capture_output=True, text=True, timeout=30,
)
if result.returncode != 0:
return None
try:
data = json.loads(result.stdout)
except json.JSONDecodeError:
return None
if data.get("schema") != "inspect.v1":
return None
return dataEvery consumer must check schema before using any fields:
data = json.loads(output)
if data.get("schema") != "inspect.v1":
raise ValueError(f"Unexpected schema: {data.get('schema')!r}")This ensures consumers fail safely when repo-signal is missing, outdated,
or returns an error message instead of JSON.
| Field | Type | Use |
|---|---|---|
schema |
string | Always check first — must be inspect.v1 |
repo.name |
string | Display name |
repo.type |
string | Project type label |
git.branch |
string | Current branch |
git.clean |
boolean | True if working tree is clean |
git.change_count |
int | Number of working tree changes |
public_readiness.score |
int | Publish score (0–16) |
public_readiness.summary |
string | Human-readable score summary |
issues |
array | Detected problems |
recommended_next_commit |
string | Next action suggestion |
useful_next_commands |
array | Suggested follow-up CLI commands |
detected.languages |
object | Language → file count map |
detected.tooling |
array | Detected tools/frameworks |
Full schema: INSPECT_SCHEMA.md