en un clic
openlore-analyze-codebase
// Run a full static analysis of a project using openlore and summarise the results — architecture, call graph, top refactoring issues, and duplicate code. No LLM required.
// Run a full static analysis of a project using openlore and summarise the results — architecture, call graph, top refactoring issues, and duplicate code. No LLM required.
Persistent architectural memory for this codebase. Call `orient(task)` before reading source files to get the relevant functions, callers, spec sections, and insertion points for any task — saving 15,000–50,000 tokens of file-by-file rediscovery.
Transform a feature idea into an annotated story. Detects greenfield vs brownfield automatically — uses Domain Sketch for greenfield (no existing code), Constrained Option Tree for brownfield (existing codebase with openlore analysis).
Debug a problem by anchoring root-cause analysis in openlore structural knowledge. Uses orient + search_specs + analyze_impact to form an explicit hypothesis before reading code. Enforces RED/GREEN test verification.
Apply the refactoring plan produced by openlore-plan-refactor. Reads .openlore/refactor-plan.md and re-reads it before each change to stay on track. Requires a confirmed plan to exist before running.
Reverse-engineer OpenSpec specifications from an existing codebase. Performs "code archaeology" — extracting what code actually does and documenting it as structured OpenSpec specs across all detected domains.
Implement a story on a brownfield codebase using openlore structural context. Runs orient + risk check before coding, validates against specs, enforces a test gate before drift check.
| name | openlore-analyze-codebase |
| description | Run a full static analysis of a project using openlore and summarise the results — architecture, call graph, top refactoring issues, and duplicate code. No LLM required. |
| license | MIT |
| compatibility | openlore MCP server |
| user-invocable | true |
| allowed-tools | ["ask_followup_question","use_mcp_tool","openlore-plan-refactor"] |
Trigger this skill whenever the user asks to analyze a codebase with openlore, with phrasings like:
/openlore-analyze-codebaseThis skill is read-only — it modifies no files. It produces a report and suggests next steps.
Ask the user which project to analyze, or confirm the current workspace root.
Which project directory should I analyze?
Options: current workspace root | enter a different path
<use_mcp_tool>
<server_name>openlore</server_name>
<tool_name>analyze_codebase</tool_name>
<arguments>{"directory": "$DIRECTORY"}</arguments>
</use_mcp_tool>
Present a concise summary:
Also report stack inventory (read directly from .openlore/analysis/ — no extra MCP call needed):
route-inventory.json existsschema-inventory.json existsenv-inventory.json existsui-inventory.json existsIf none of these files exist, skip this section and suggest running openlore analyze --force.
<use_mcp_tool>
<server_name>openlore</server_name>
<tool_name>get_call_graph</tool_name>
<arguments>{"directory": "$DIRECTORY"}</arguments>
</use_mcp_tool>
Highlight:
<use_mcp_tool>
<server_name>openlore</server_name>
<tool_name>get_duplicate_report</tool_name>
<arguments>{"directory": "$DIRECTORY"}</arguments>
</use_mcp_tool>
Present a concise summary:
Based on the analysis, guide the user through the natural next actions in order:
get_minimal_context on the highest-priority function — returns callers, callees, body, and test coverage in one call (~300 tokens). Use instead of get_subgraph + get_signatures separately.get_cluster on any function to see its full community (tightly coupled neighbors across directories).detect_changes to rank recently changed functions by blast radius — spot riskiest commits before reviewing./openlore-plan-refactor once the user has enough context to act, then /openlore-execute-refactor to apply the planlist_spec_domains then search_specs to enable
spec-first reasoning (question → requirements → linked source files). To activate search_specs,
run openlore analyze --embed or openlore analyze --reindex-specs.