Skip to content

Repository files navigation

Reforge

Reforge

Find structural risks in a codebase, understand the evidence, and keep reviewed refactors from drifting back.

CI Release License Documentation

Reforge is a local codebase analyzer for maintainers and coding agents. It surfaces refactoring opportunities such as duplicated implementations, oversized responsibilities, dependency tangles, and naming drift.

Every finding includes the source locations and measurements that produced it. Reports also say what could not be analyzed, so an empty result is never presented as stronger evidence than it is.

Get started

Install the latest release on Linux or macOS:

curl -fsSL https://raw.githubusercontent.com/LyleMi/Reforge/main/scripts/install.sh | sh
reforge analyze .

On Windows PowerShell:

$installer = Join-Path $env:TEMP "install-reforge.ps1"
irm https://raw.githubusercontent.com/LyleMi/Reforge/main/scripts/install.ps1 -OutFile $installer
& $installer
reforge analyze .

Reforge runs the Codebase analysis by default. Generate a standalone HTML report to explore the findings:

reforge analyze . --output html --output-file reforge-report.html

Rust users can alternatively build and install the command from crates.io:

cargo install reforge-cli --locked

The crates.io package installs the reforge binary only. Use the verified release installer above when you also want the bundled reforge-analyze Codex skill.

Explore an example Codebase report →

What Codebase finds

Area Examples
Responsibilities Large files, long or complex functions, deep nesting, broad public surfaces
Duplication Similar functions, repeated literals, repeated test setup, overlapping type shapes
Architecture drift Dependency cycles, generic buckets, parallel implementations, boundary bypasses
Repository consistency Naming drift, stale compatibility paths, TODO/FIXME clusters

Each finding points to a concrete subject and includes the rule, source locations, and measurements that produced it. Coverage shows which languages and capabilities were actually observed. Reforge does not turn these signals into a health score, severity, or defect prediction—the decision stays with the reviewer.

Codebase supports Rust, JavaScript, TypeScript/TSX, Vue, Python, Go, Java, C#, Kotlin, PHP, Ruby, Bash, and PowerShell. Dependency rules also recognize C and C++.

Analysis runs locally. Reforge does not upload source code or collect telemetry.

Use it in CI

Keep configuration in reforge.toml, review a JSON report as a baseline, then gate new or changed policy findings:

reforge analyze . --output json --output-file current.json \
  --baseline reforge-baseline.json --gate new --reproducible

Rules begin as opt-in previews. This keeps adoption deliberate: enable the signals that fit your codebase, review their evidence, and enforce only the policies your team has accepted.

Learn more

Reforge also includes an advanced, opt-in Dataflow analysis for exact value-path and boundary-policy inspection.

Development

Reforge is a Rust 2024 workspace. Run the full validation suite with:

cargo fmt --all -- --check
cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
cargo test --locked --workspace --all-targets --all-features

About

Auditable refactoring guardrails for agent-written code with explicit evidence and coverage.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages