Skip to content

Commit 06fb744

Browse files
committed
feat(pages): add bilingual playground
1 parent 91817c0 commit 06fb744

36 files changed

Lines changed: 805 additions & 77 deletions

.github/pages/reforge.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ignore-paths = [
1212
"tools/reforge-workflow",
1313
"crates/reforge-unity-engine",
1414
"tools/reforge-unity",
15+
"playground/fixtures",
1516
]
1617

1718
[rules]

.github/workflows/pages.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,8 @@ jobs:
5858
- name: Install mdBook
5959
run: cargo install mdbook --version "$MDBOOK_VERSION" --locked
6060

61-
- name: Generate Codebase example report
62-
run: |
63-
mkdir -p docs/sample
64-
cargo run --locked --release -p reforge-cli -- analyze . \
65-
--config .github/pages/reforge.toml \
66-
--output html \
67-
--output-file docs/sample/index.html \
68-
--reproducible
69-
70-
- name: Validate Codebase example report
71-
run: node scripts/validate-pages-sample.mjs docs/sample/index.html
72-
73-
- name: Build documentation
74-
run: mdbook build --dest-dir _site
61+
- name: Build documentation, sample, and Playground
62+
run: node scripts/build-pages.mjs _site
7563

7664
- name: Configure Pages
7765
uses: actions/configure-pages@v6

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ local-map.json
1616

1717
# Generated documentation sample
1818
docs/sample/index.html
19+
_site/
1920

2021
# Playwright browser artifacts
2122
web/report-app/playwright-report/

README.md

Lines changed: 73 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<h1 align="center">Reforge</h1>
66

77
<p align="center">
8-
Find structural risks in a codebase, understand the evidence, and keep reviewed refactors from drifting back.
8+
Evidence-backed structural analysis for codebases changing faster than they can be reviewed.
99
</p>
1010

1111
<p align="center">
@@ -15,17 +15,46 @@
1515
<a href="https://lylemi.github.io/Reforge/"><img alt="Documentation" src="https://img.shields.io/badge/docs-read-1556ad"></a>
1616
</p>
1717

18-
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.
18+
Reforge is a local CLI that shows maintainers where a codebase is becoming
19+
harder to change. It finds duplicated implementations, oversized
20+
responsibilities, dependency tangles, and architecture drift across the whole
21+
repository—including patterns introduced gradually by coding agents.
1922

20-
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.
23+
It does not assign an opaque health score or ask you to trust a generated
24+
summary. Every finding includes the source locations, measurements, and rule
25+
that produced it. Every report also records what Reforge could and could not
26+
analyze.
27+
28+
<p align="center">
29+
<a href="https://lylemi.github.io/Reforge/playground/"><strong>Try the bilingual Playground / 在线体验 →</strong></a>
30+
&nbsp;·&nbsp;
31+
<a href="https://lylemi.github.io/Reforge/sample/"><strong>Explore Reforge's self-analysis report →</strong></a>
32+
</p>
33+
34+
## See the evidence behind a finding
35+
36+
This finding came from Reforge analyzing its own report application:
37+
38+
```text
39+
Function readability: ReportView in web/report-app/src/reportApp.tsx
40+
41+
Rule: reforge.codebase.complex_function
42+
Location: web/report-app/src/reportApp.tsx:33
43+
Measurement: estimated complexity 15 (threshold 14)
44+
Guidance: Reduce the function to a clear sequence of named responsibilities.
45+
```
46+
47+
The location makes the finding inspectable. The measurement explains why it
48+
was reported. The threshold can be tuned, and a legitimate exception can be
49+
suppressed with its reason preserved. Reforge makes the case for review; it
50+
does not pretend that a measurement can decide the refactor for you.
2151

2252
## Get started
2353

2454
Install the latest release on Linux or macOS:
2555

2656
```sh
2757
curl -fsSL https://raw.githubusercontent.com/LyleMi/Reforge/main/scripts/install.sh | sh
28-
reforge analyze .
2958
```
3059

3160
On Windows PowerShell:
@@ -34,13 +63,6 @@ On Windows PowerShell:
3463
$installer = Join-Path $env:TEMP "install-reforge.ps1"
3564
irm https://raw.githubusercontent.com/LyleMi/Reforge/main/scripts/install.ps1 -OutFile $installer
3665
& $installer
37-
reforge analyze .
38-
```
39-
40-
Reforge runs the Codebase analysis by default. Generate a standalone HTML report to explore the findings:
41-
42-
```sh
43-
reforge analyze . --output html --output-file reforge-report.html
4466
```
4567

4668
Rust users can alternatively build and install the command from crates.io:
@@ -53,9 +75,46 @@ The crates.io package installs the `reforge` binary only. Use the verified
5375
release installer above when you also want the bundled `reforge-analyze` Codex
5476
skill.
5577

56-
<p align="center">
57-
<a href="https://lylemi.github.io/Reforge/sample/"><strong>Explore an example Codebase report →</strong></a>
58-
</p>
78+
Reforge runs Codebase analysis by default. Its rules begin as opt-in previews,
79+
so adopting Reforge does not immediately impose someone else's definition of
80+
maintainability. Initialize a configuration, then enable a small starter set:
81+
82+
```sh
83+
reforge init
84+
```
85+
86+
In the generated `reforge.toml`, start with:
87+
88+
```toml
89+
[rules]
90+
enable = [
91+
"reforge.codebase.large_file",
92+
"reforge.codebase.long_function",
93+
"reforge.codebase.dependency_cycle",
94+
"reforge.codebase.similar_functions",
95+
]
96+
```
97+
98+
Run the review in your repository or generate a standalone HTML report:
99+
100+
```sh
101+
reforge analyze .
102+
reforge analyze . --output html --output-file reforge-report.html
103+
```
104+
105+
## Built for repository-level review
106+
107+
| Need | What Reforge provides |
108+
| --- | --- |
109+
| Find change pressure beyond style errors | Project-wide signals for responsibilities, duplication, dependencies, and drift |
110+
| Verify why something was flagged | Source locations, measurements, thresholds, and rule provenance |
111+
| Trust an empty report appropriately | Coverage receipts and explicit analysis limitations |
112+
| Keep an accepted refactor from regressing | Reproducible baselines and CI gates for new or changed findings |
113+
| Keep source code private | Local analysis with no uploads or telemetry |
114+
115+
Reforge complements compilers, linters, and security scanners. Its job is not
116+
to prove correctness or find vulnerabilities; it identifies structural
117+
pressure that deserves a maintainer's judgment before the next refactor.
59118

60119
## What Codebase finds
61120

assets/report-app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/report-app.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/reforge-output/assets/report-app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/reforge-output/assets/report-app.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<p>Reforge analyzes the structure of a codebase, explains every finding, and makes gaps in analysis visible.</p>
66
<div class="docs-actions">
77
<a class="primary" href="user-guide.html">Get started</a>
8+
<a class="secondary" href="playground/">Try the Playground / 在线体验 <span aria-hidden="true">→</span></a>
89
<a class="secondary" href="sample/">Explore an example report <span aria-hidden="true">→</span></a>
910
</div>
1011
</div>

docs/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[Overview](README.md)
44

5+
- [Try the Playground / 在线体验](playground.md)
6+
57
# Get started
68

79
- [User Guide](user-guide.md)

0 commit comments

Comments
 (0)