openlore-analyze-codeb…
Run a full static OpenLore analysis and summarize architecture, call graph, refactoring issues, and duplicate code. Use when…
Retrieve relevant functions, callers, spec sections, and insertion points from OpenLore before reading source files. Use when starting work that needs structural orientation in an existing codebase.
$ npx -y skills add clay-good/OpenLore --skill openlore-orient --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/openlore-orientContext preview
The summary Claude sees to decide when to auto-load this skill.
Retrieve relevant functions, callers, spec sections, and insertion points from OpenLore before reading source files. Use when starting work that needs structural orientation in an existing codebase.
name: openlore-orient description: Retrieve relevant functions, callers, spec sections, and insertion points from OpenLore before reading source files. Use when starting work that needs structural orientation in an existing codebase.
This project uses **OpenLore** to maintain a deterministic, graph-native model of the codebase: every function, every caller, every spec section, every file. The `orient` tool collapses what would otherwise be a chain of `analyze_codebase → search_code → search_specs → suggest_insertion_points` into a single call.
The single most important habit when working in this repo: **call `orient` before opening source files for any non-trivial task.**
Call `orient` at the start of any of these:
If you are reading source files without having called `orient` first, you are probably wasting tokens.
If `openlore` is registered as an MCP server in this project (look for `.mcp.json` → `mcpServers.openlore` — the project-scope file Claude Code reads; **not** `.claude/settings.json`, which it ignores for MCP), call the `orient` tool directly through the MCP interface. This is the lowest-latency path and gives the model access to whatever tool surface the server was wired with — the lean 10-tool `navigation` preset by default (`openlore install --preset full` wires all 62), not just `orient`.
bash scripts/orient.sh "<task description>"
(On Windows: `powershell -File scripts/orient.ps1 "<task description>"`)
The wrapper tries the direct CLI subcommand first (`npx --yes openlore orient --json --task "<task>"`) and falls back to driving the `openlore mcp` server over stdio JSON-RPC via the sibling `orient-via-mcp.mjs` helper on older openlore versions that predate the CLI subcommand. Either path produces real orient JSON on stdout. Parse these arrays from the result:
The result fields are **camelCase** (matching `orient --json`):
Always start by reading **`specDomains`**, then **`callPaths`**, then jump into source only at the **`insertionPoints`** you actually plan to edit.
For a quick "who calls X" / "where is Y defined" lookup, pass **`lean: true`** (or `orient --lean`): it returns just the navigation core (`relevantFunctions` with `expand` handles, `callPaths`, `specDomains`) — ~40% smaller — and drops the provenance / change-coupling / insertion-points / specs / decisions enrichment, each still one `expand` handle or dedicated tool call away. Omit `lean` when you actually need that enrichment (planning an edit, checking specs/decisions). Caveat (measured, Spec 27): on a *trivial* lookup in a small/familiar repo, even a lean orient call can cost more than just grepping — `orient` earns its keep on unfamiliar or multi-hop work, not one-line facts you could find in 2 reads.
> **Note:** the `openlore orient --json --task` CLI subcommand is available, so the wrappers use it directly. The MCP fallback in the wrappers only kicks in on older openlore versions that predate the subcommand.
> **Want to measure it on your own repo?** Pass `--metrics` (off by default) to have `orient` report its wall time and output size to stderr. Nothing is measured or printed unless you ask for it.
If `orient` returns an empty result or errors:
1. **Empty `relevantFunctions` array** — the task description didn't match the graph. Try rephrasing using a known module name, function name, or domain word from the spec. Do not fall back silently — tell the user that `orient` didn't match and you're going to grep. 2. **Wrapper output contains `"error": "No analysis found"`** — the codebase hasn't been analyzed yet. Run `npx openlore analyze` once to seed the graph, then retry. The wrapper itself is healthy in this case; the underlying tool is telling you what's missing. 3. **Graph is stale (mtime o
Deterministic, local-first memory and guardrails for AI coding agents with no LLM in the hot path.
Run a full static OpenLore analysis and summarize architecture, call graph, refactoring issues, and duplicate code. Use when…
Transform a feature idea into an annotated story using a Domain Sketch or Constrained Option Tree. Use when asked to brainstorm,…
Debug with OpenLore structural context, an explicit root-cause hypothesis, and RED/GREEN verification. Use when a bug, failure,…
Apply a confirmed .openlore/refactor-plan.md with a test gate after each change. Use when asked to execute or continue an…
Author a new OpenSpec domain specification from deterministic OpenLore MCP evidence. Use when asked to reverse-engineer,…
Implement a brownfield story with OpenLore orientation, risk checks, spec validation, tests, and drift detection. Use when asked…