Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
255a545
fix(viewer): map hover flicker, navigation, and modifier/colour fixes
ffedoroff Jun 22, 2026
66238a8
refactor: unify terminology (principle / metric / rule / focus) + off…
ffedoroff Jun 23, 2026
bf5fab9
feat(version): three-version model + required config `version`, bump …
ffedoroff Jun 23, 2026
c0d8a90
docs(prd): drop JSON-schema and plugin internals (business-level PRD)
ffedoroff Jun 23, 2026
555f561
docs: add prompt self-improvement loop playbook
ffedoroff Jun 23, 2026
45f392a
feat(cli): add offline `ai` command; drop `docs` corpus publishing
ffedoroff Jun 23, 2026
19526fb
test(cli): close diff-coverage gaps in ai/report/templates
ffedoroff Jun 23, 2026
90f2939
docs(rust): document visibility-narrowing as an ADP cycle remedy
ffedoroff Jun 23, 2026
42e2213
docs(contrib): self-improving prompt-eval playbook + metrics collector
ffedoroff Jun 23, 2026
c509d78
docs(prompt-eval): unique PROJECT branch names via cr_sha; rust plugi…
ffedoroff Jun 23, 2026
148e92f
meta(prompt-eval): encode session corrections into the self-improve loop
ffedoroff Jun 23, 2026
5335b5c
prompt(scaffolding): front-load --doc {id} as first step before readi…
ffedoroff Jun 23, 2026
c0d6979
meta(prompt-eval): lever hygiene — keep language-specific content out…
ffedoroff Jun 23, 2026
93df812
prompt(AI): make reading --doc <principle> an explicit, non-optional …
ffedoroff Jun 23, 2026
a54ee6f
doc(rust ADP): make visibility-narrowing an explicit step-1 remedy, b…
ffedoroff Jun 23, 2026
24f0243
meta(prompt-eval): note new_cycles false-positive on shrunk cycles
ffedoroff Jun 23, 2026
be583e8
meta(prompt-eval): name PROJECT branch identically to the run build dir
ffedoroff Jun 23, 2026
5bb4812
meta(prompt-eval): note PROMPTEVAL- commit prefix for builddir-named …
ffedoroff Jun 23, 2026
1cc2a0d
chore(studio): initialize Constructor Studio (cfs init + sdlc kit)
ffedoroff Jun 23, 2026
5d78976
docs(toc): sync tables of contents via cfs toc
ffedoroff Jun 23, 2026
31e80da
fix(prompt-eval): make the metrics collector focus-aware (non-cycle m…
ffedoroff Jun 23, 2026
95fa34a
doc(rust HK): order the remedies — narrow artificial fan-in, then spl…
ffedoroff Jun 23, 2026
a6f0f6f
fix(cli/doc): route metric docs through doc_overrides, not always base/
ffedoroff Jun 23, 2026
ce3e1c4
test(e2e): regenerate report goldens for the front-loaded doc_note
ffedoroff Jun 23, 2026
8eded7f
doc(rust HK): make the audiences diagnosis the mandatory first step
ffedoroff Jun 23, 2026
13f4c8f
Revert "doc(rust HK): make the audiences diagnosis the mandatory firs…
ffedoroff Jun 23, 2026
9cfb2ed
meta(prompt-eval): distinguish a prompt gap from a capability ceiling
ffedoroff Jun 23, 2026
00581b1
meta(prompt-eval): workspace-scope verification + sweep mode lessons
ffedoroff Jun 24, 2026
2b586ab
feat(viewer): lowercase brand + version-on-hover, toggleable stat button
ffedoroff Jun 24, 2026
52f73c9
test(cli/doc): cover metric-doc lang-override; drop unreachable brace
ffedoroff Jun 24, 2026
5b743da
style(cli/doc): rustfmt the new doc_rel_path test
ffedoroff Jun 24, 2026
311c9c0
docs: add GitHub App install + website links and the code-ranker badge
ffedoroff Jun 24, 2026
a2d8f2d
feat(cli/config): accept levels.functions as an inline --config override
ffedoroff Jun 25, 2026
82ba4f0
chore(release): v4.0.0
ffedoroff Jun 25, 2026
5c4381f
chore(release): sync 4.0.0 version refs and README status
ffedoroff Jun 25, 2026
47349da
feat(cli): add --output.mode verbosity flag; scorecard tiers as words
ffedoroff Jun 25, 2026
949310c
docs(metrics): document spaces/branches/span_sloc/cycle; fix MI size …
ffedoroff Jun 25, 2026
c2e0519
feat(cli): replace `ai` with `docs <subject>`; drop `report --doc`
ffedoroff Jun 25, 2026
32eaec9
feat(docs): strictly per-plugin catalog; config-aware plugin error; c…
ffedoroff Jun 25, 2026
903b9c5
test: raise coverage on docs/main/log/plugin/pipeline
ffedoroff Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ jobs:
--git.origin="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
--output.html.path=site/index.html \
--output.json.path=site/report.json
- name: Compose the principle/metric doc corpus into ./site
# base/<ID>.md (fallback) + composed <lang>/<ID>.md (base ⊕ overlay), so a
# finding's `doc_url` resolves on Pages once `doc_base` points here.
# `.nojekyll` makes Pages serve the raw Markdown (Jekyll would render it),
# which is what the `remediation` "Download …" links and LLMs want.
run: |
cargo run -q -p code-ranker -- docs --out site
touch site/.nojekyll
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v5
with:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ __pycache__/
*.egg-info/
dist/
build/

# BEGIN Constructor Studio
# Generated Constructor Studio runtime and agent integration files.
# Files matched here are owned by Constructor Studio and may be overwritten.
.cf-studio/
# END Constructor Studio
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "3"

[workspace.package]
version = "3.0.2"
version = "4.0.0"
edition = "2024"
rust-version = "1.88"
license = "Apache-2.0"
Expand All @@ -12,10 +12,10 @@ keywords = ["dependency-graph", "coupling", "refactoring", "code-quality", "stat
categories = ["development-tools", "command-line-utilities"]

[workspace.dependencies]
code-ranker-graph = { path = "crates/code-ranker-graph", version = "3.0.2" }
code-ranker-plugin-api = { path = "crates/code-ranker-plugin-api", version = "3.0.2" }
code-ranker-plugins = { path = "crates/code-ranker-plugins", version = "3.0.2" }
code-ranker-viewer = { path = "crates/code-ranker-viewer", version = "3.0.2" }
code-ranker-graph = { path = "crates/code-ranker-graph", version = "4.0.0" }
code-ranker-plugin-api = { path = "crates/code-ranker-plugin-api", version = "4.0.0" }
code-ranker-plugins = { path = "crates/code-ranker-plugins", version = "4.0.0" }
code-ranker-viewer = { path = "crates/code-ranker-viewer", version = "4.0.0" }

anyhow = "1.0"
cel = "0.13"
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

[![CI](https://github.com/ffedoroff/code-ranker/actions/workflows/ci.yml/badge.svg)](https://github.com/ffedoroff/code-ranker/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/ffedoroff/code-ranker/branch/main/graph/badge.svg)](https://codecov.io/gh/ffedoroff/code-ranker)
[![code-ranker](https://img.shields.io/endpoint?url=https://api.code-ranker.com/badge/ffedoroff/cr-smoke-test.json)](https://reports.code-ranker.com/r/ffedoroff/cr-smoke-test/latest)
[![Crates.io](https://img.shields.io/crates/v/code-ranker.svg)](https://crates.io/crates/code-ranker)
[![npm](https://img.shields.io/npm/v/code-ranker.svg)](https://www.npmjs.com/package/code-ranker)
[![PyPI](https://img.shields.io/pypi/v/code-ranker.svg)](https://pypi.org/project/code-ranker/)
[![License](https://img.shields.io/crates/l/code-ranker.svg)](./LICENSE)

Structural-analysis tool for **Rust, Python, JavaScript and TypeScript** codebases. Built **AI-agent-friendly first** — finds where a project has structural problems and hands an actionable shortlist to a human or an AI agent for the actual refactor.
[![Website](https://img.shields.io/badge/website-code--ranker.com-1abc9c)](https://code-ranker.com)
[![Install the GitHub App](https://img.shields.io/badge/GitHub%20App-install-2c3e50?logo=github&logoColor=white)](https://github.com/apps/code-ranker-app/installations/new)

Structural-analysis tool for **Rust** (production-ready) plus **Python, TypeScript/JavaScript, Go, C, C++, C# and Markdown** (beta) codebases. Built **AI-agent-friendly first** — finds where a project has structural problems and hands an actionable shortlist to a human or an AI agent for the actual refactor.

**👉 Map your codebase's worst structural problems in 30 seconds — [jump to the Rust quick start](#rust-quick-start) and run it on your repo now.**

**Status:** pre-alpha. APIs and output shapes may change without notice.
**Status:** 4.0.0 — the Rust analyzer is production-ready; the other languages are beta, so their output shapes may still change.

## Rust quick start

Expand All @@ -31,14 +35,14 @@ code-ranker always runs **entirely on your machine**. It makes **no network call

## AI agents friendly

**Hand your codebase to an AI agent and let it fix the worst spot.** code-ranker is built to feed work straight to an AI coding agent (Claude Code, Cursor, …). Attach the short playbook [docs/ai-skill.md](docs/ai-skill.md) to your agent's context — it teaches the agent which two metrics matter (dependency cycles `ADP`, coupling `HK`) and the exact fix loop (scorecard → snapshot → fix → re-check → before/after report).
**Hand your codebase to an AI agent and let it fix the worst spot.** code-ranker is built to feed work straight to an AI coding agent (Claude Code, Cursor, …). Run **`code-ranker docs ai`** in your repo — it prints a short, offline playbook (no network) that teaches the agent which two metrics matter (dependency cycles `ADP`, coupling `HK`) and the exact fix loop (scorecard → snapshot → fix → re-check → before/after report), tailored to your project's language.

Then just ask, e.g.:

- *"Read `https://raw.githubusercontent.com/ffedoroff/code-ranker/main/docs/ai-skill.md`. Find the worst dependency cycle in this project and propose a refactor that breaks it — show me the plan before changing code."*
- *"Read `https://raw.githubusercontent.com/ffedoroff/code-ranker/main/docs/ai-skill.md`. Find the most complex / highest-HK file and analyze how to split it; explain what the split buys for me (lower coupling, smaller blast radius). Take a **before report**, apply the split, take an **after report**, and show me the **HTML diff**."*
- *"Run `code-ranker docs ai` and follow it: find the worst dependency cycle in this project and propose a refactor that breaks it — show me the plan before changing code."*
- *"Run `code-ranker docs ai` for the playbook, then find the most complex / highest-HK file and analyze how to split it; explain what the split buys for me (lower coupling, smaller blast radius). Take a **before report**, apply the split, take an **after report**, and show me the **HTML diff**."*

The agent drives the CLI itself — `ai-skill.md` already spells out the commands and the loop, so no glue is needed.
The agent drives the CLI itself — `code-ranker docs ai` spells out the commands and the loop, so no glue is needed. (Prefer a file in context? The same playbook lives at [docs/ai-skill.md](docs/ai-skill.md).)

## What it finds

Expand All @@ -62,6 +66,8 @@ The linter is the `check` command — exits non-zero on any cycle or threshold v

**Add it to your pipeline today** — one `code-ranker check` step stops new cycles and bloat from ever landing.

Prefer zero config? **[Install the GitHub App](https://github.com/apps/code-ranker-app/installations/new)** — it publishes a per-PR HTML structural report on every pull request, no workflow YAML to write. More at **[code-ranker.com](https://code-ranker.com)**.

## Full CLI

Written in Rust — fast, memory-safe, single static-ish binary with **no runtime dependencies** (no Python, no Node, no JVM, no shared libs to install). One file on PATH, done.
Expand Down Expand Up @@ -106,7 +112,7 @@ code-ranker report
code-ranker report . --baseline .code-ranker/before.json
```

Built-in plugins: `rust` (cargo + syn), `python`, `javascript` (also handles TypeScript) — all compiled into the single binary, nothing to install.
Built-in plugins for all nine supported languages (`rust` uses cargo + syn; Rust is production-ready, the rest are beta) — all compiled into the single binary, nothing to install.

## Documentation

Expand Down
1 change: 1 addition & 0 deletions code-ranker.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version = "4.0"
# code-ranker.toml — project-level configuration for code-ranker.
# Discovery order: --config PATH > ./code-ranker.toml > <target>/code-ranker.toml >
# Cargo.toml [workspace.metadata.code-ranker]. CLI flags always win over the file.
Expand Down
Loading
Loading