forgelens 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +113 -131
- package/assets/forgelens-hero.png +0 -0
- package/dist/cli.cjs +1970 -679
- package/dist/cli.js +1972 -681
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `AI_FOCUS_MAP.md` to rank the highest-value files and areas before editing.
|
|
8
|
+
- `AI_COMPACT_CONTEXT.md` for context-limit situations.
|
|
9
|
+
- `ENV_REPORT.md` for env file names, referenced env key names, missing example keys, and public env risk hints without printing secret values.
|
|
10
|
+
- `UI_UX_REPORT.md` for pages, components, forms, loading/empty/error states, responsive signals, and accessibility risk hints.
|
|
11
|
+
- `PERFORMANCE_RISK_REPORT.md` for large files, client components, image usage, fetch calls, uncached fetch hints, and external API failure points.
|
|
12
|
+
- `REPO_REPORT.json` with `--format json` or `--format all` for tool-readable output.
|
|
13
|
+
- File-level focus scores with reasons and priority.
|
|
14
|
+
- `forgelens drift` to compare two `REPO_REPORT.json` files and flag stale context around auth, routes, server actions, database, env, security, and focus files.
|
|
15
|
+
- `forgelens baseline save` to save named baseline reports.
|
|
16
|
+
- `forgelens drift --from <name>` and `forgelens drift --git base..head` workflows.
|
|
17
|
+
- `DRIFT_REPORT.md` and `DRIFT_REPORT.json` when drift output is written to a folder.
|
|
18
|
+
- Grouped env key sections in `ENV_REPORT.md`.
|
|
19
|
+
- Static landing page under `site/` for product demos.
|
|
20
|
+
- Project-specific `AGENTS.md` and `docs/PROJECT_MAP.md` for faster future agent work.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- `forgelens prompt codex` now starts with `AI_COMPACT_CONTEXT.md` for tight context and includes the new reports.
|
|
25
|
+
- `FORGE_CONTEXT.md`, `ARCHITECTURE_MAP.md`, and `RISK_REPORT.md` include the new focus, env, UI/UX, and performance signals.
|
|
26
|
+
- Detector scans ignore test fixtures by default and avoid treating detector/test text as real app provider evidence.
|
|
27
|
+
- Generated Workbox, sourcemap, and generated-code artifacts are ignored by default.
|
|
28
|
+
|
|
3
29
|
## 0.1.0 - 2026-05-18
|
|
4
30
|
|
|
5
31
|
Initial CLI MVP release-readiness baseline.
|
package/README.md
CHANGED
|
@@ -1,84 +1,102 @@
|
|
|
1
1
|
# ForgeLens
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="assets/forgelens-hero.png" alt="ForgeLens hero" width="100%" />
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center"><strong>AI coding workflow tracking for safer AI-assisted code changes.</strong></p>
|
|
8
|
+
<p align="center">ForgeLens maps your repo, tracks drift, and generates AI-ready context before coding agents edit your project.</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://www.npmjs.com/package/forgelens"><img alt="npm package" src="https://img.shields.io/npm/v/forgelens?label=npm%20package" /></a>
|
|
12
|
+
<img alt="MIT license" src="https://img.shields.io/badge/license-MIT-black" />
|
|
13
|
+
<img alt="Local-first" src="https://img.shields.io/badge/local--first-yes-1f6feb" />
|
|
14
|
+
<img alt="No telemetry" src="https://img.shields.io/badge/telemetry-none-2da44e" />
|
|
15
|
+
<img alt="Codex" src="https://img.shields.io/badge/Codex-supported-111111" />
|
|
16
|
+
<img alt="Claude Code" src="https://img.shields.io/badge/Claude%20Code-supported-111111" />
|
|
17
|
+
<img alt="Cursor" src="https://img.shields.io/badge/Cursor-supported-111111" />
|
|
18
|
+
<img alt="Copilot" src="https://img.shields.io/badge/Copilot-supported-111111" />
|
|
19
|
+
<img alt="Gemini CLI" src="https://img.shields.io/badge/Gemini%20CLI-supported-111111" />
|
|
20
|
+
<img alt="OpenCode" src="https://img.shields.io/badge/OpenCode-supported-111111" />
|
|
21
|
+
<img alt="Astro docs" src="https://img.shields.io/badge/Astro%20docs-included-6f42c1" />
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
## Why ForgeLens?
|
|
25
|
+
|
|
26
|
+
AI coding agents often start in the wrong files. That creates slow edits, wasted context, and risky changes.
|
|
27
|
+
|
|
28
|
+
Common problems:
|
|
29
|
+
- Agents miss auth boundaries and session rules.
|
|
30
|
+
- Agents skip database/schema risk and server action risk.
|
|
31
|
+
- Agents ignore route exposure and env/config risk.
|
|
32
|
+
- Project rules drift over time, while old context is still used.
|
|
33
|
+
|
|
34
|
+
ForgeLens solves this with a local-first workflow:
|
|
35
|
+
- Scan the repo and generate compact AI-ready context.
|
|
36
|
+
- Highlight risky files and boundaries first.
|
|
37
|
+
- Save a baseline snapshot.
|
|
38
|
+
- Detect drift between baseline and current reports.
|
|
39
|
+
- Compare drift across git refs with `main..HEAD`.
|
|
40
|
+
|
|
41
|
+
## Quick Start
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx forgelens scan
|
|
45
|
+
npx forgelens baseline save --name current
|
|
46
|
+
npx forgelens drift --from current
|
|
47
|
+
npx forgelens drift --git main..HEAD
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## What ForgeLens Generates
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
AI_COMPACT_CONTEXT.md
|
|
54
|
+
AI_FOCUS_MAP.md
|
|
55
|
+
FORGE_CONTEXT.md
|
|
56
|
+
ARCHITECTURE_MAP.md
|
|
57
|
+
ROUTES_MAP.md
|
|
58
|
+
DATABASE_MAP.md
|
|
59
|
+
SERVER_ACTIONS_MAP.md
|
|
60
|
+
SECURITY_RULES.md
|
|
61
|
+
ENV_REPORT.md
|
|
62
|
+
RISK_REPORT.md
|
|
63
|
+
DRIFT_REPORT.md
|
|
64
|
+
REPO_REPORT.json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Workflow Map
|
|
68
|
+
|
|
69
|
+
```mermaid
|
|
70
|
+
flowchart TD
|
|
71
|
+
A[Scan repo] --> B[Generate AI context]
|
|
72
|
+
B --> C[Risk reports]
|
|
73
|
+
C --> D[Save baseline]
|
|
74
|
+
D --> E[Detect drift]
|
|
75
|
+
E --> F[Git drift]
|
|
76
|
+
F --> G[AI agent reads focused context]
|
|
77
|
+
G --> H[Safer code changes]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Works With
|
|
81
|
+
|
|
82
|
+
ForgeLens is built for Codex, Claude Code, Cursor, Copilot, Gemini CLI, OpenCode, and other AI coding agents.
|
|
66
83
|
|
|
67
84
|
## Install
|
|
68
85
|
|
|
69
|
-
|
|
86
|
+
Quick run:
|
|
70
87
|
|
|
71
88
|
```bash
|
|
72
|
-
|
|
89
|
+
npx forgelens scan
|
|
73
90
|
```
|
|
74
91
|
|
|
75
|
-
|
|
92
|
+
Global install:
|
|
76
93
|
|
|
77
94
|
```bash
|
|
78
|
-
|
|
95
|
+
npm install -g forgelens
|
|
96
|
+
forgelens scan
|
|
79
97
|
```
|
|
80
98
|
|
|
81
|
-
Local development
|
|
99
|
+
Local development:
|
|
82
100
|
|
|
83
101
|
```bash
|
|
84
102
|
pnpm install
|
|
@@ -87,86 +105,50 @@ pnpm link --global
|
|
|
87
105
|
forgelens scan
|
|
88
106
|
```
|
|
89
107
|
|
|
90
|
-
## CLI
|
|
108
|
+
## CLI Commands
|
|
91
109
|
|
|
92
110
|
```bash
|
|
93
111
|
forgelens scan
|
|
94
112
|
forgelens doctor
|
|
113
|
+
forgelens baseline save
|
|
114
|
+
forgelens drift
|
|
95
115
|
forgelens clean --yes
|
|
96
116
|
forgelens prompt codex
|
|
97
117
|
```
|
|
98
118
|
|
|
99
|
-
##
|
|
119
|
+
## Developer Shortcuts
|
|
100
120
|
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
121
|
+
```text
|
|
122
|
+
make check Run typecheck, tests, build, and diff check
|
|
123
|
+
make scan Generate ForgeLens reports
|
|
124
|
+
make baseline Save current ForgeLens baseline
|
|
125
|
+
make drift Compare against saved baseline
|
|
126
|
+
make site Build Astro site
|
|
127
|
+
make release-check Run all release checks
|
|
106
128
|
```
|
|
107
129
|
|
|
108
|
-
##
|
|
109
|
-
|
|
110
|
-
Inside `.forgelens/`:
|
|
111
|
-
|
|
112
|
-
- `FORGE_CONTEXT.md`
|
|
113
|
-
- `ARCHITECTURE_MAP.md`
|
|
114
|
-
- `ROUTES_MAP.md`
|
|
115
|
-
- `DATABASE_MAP.md`
|
|
116
|
-
- `SERVER_ACTIONS_MAP.md`
|
|
117
|
-
- `SECURITY_RULES.md`
|
|
118
|
-
- `RISK_REPORT.md`
|
|
119
|
-
|
|
120
|
-
## Sample output (short)
|
|
121
|
-
|
|
122
|
-
Example from `DATABASE_MAP.md`:
|
|
123
|
-
|
|
124
|
-
```md
|
|
125
|
-
## Detected Providers
|
|
126
|
-
- prisma (confidence: high)
|
|
127
|
-
evidence: `prisma/schema.prisma`
|
|
128
|
-
notes: Prisma dependency and schema files
|
|
129
|
-
```
|
|
130
|
+
## Docs
|
|
130
131
|
|
|
131
|
-
|
|
132
|
+
- Astro product/docs app: [site/](site/)
|
|
133
|
+
- Docs entry page source: [site/src/pages/docs/index.astro](site/src/pages/docs/index.astro)
|
|
134
|
+
- MDX docs content: [site/src/content/docs/](site/src/content/docs/)
|
|
132
135
|
|
|
133
|
-
|
|
134
|
-
## Auth providers/signals detected
|
|
135
|
-
- nextauth-authjs (confidence: high)
|
|
136
|
-
evidence: `lib/auth.ts`
|
|
136
|
+
Run docs locally:
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
- `.env.local`
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Example from `RISK_REPORT.md`:
|
|
144
|
-
|
|
145
|
-
```md
|
|
146
|
-
- Server actions detected (2): `app/admin/actions.ts`, `app/orders/actions.ts`. Verify auth and input validation.
|
|
147
|
-
- API routes detected (1): `app/api/health/route.ts`. Verify auth and input validation.
|
|
138
|
+
```bash
|
|
139
|
+
pnpm site:dev
|
|
148
140
|
```
|
|
149
141
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
1. Run `forgelens scan` in your repo.
|
|
153
|
-
2. Open generated `.forgelens/*.md` files.
|
|
154
|
-
3. Paste `forgelens prompt codex` output into Codex (or equivalent prompt in Claude Code/Cursor/OpenCode).
|
|
155
|
-
4. Ask agent to plan and edit with those context files first.
|
|
156
|
-
|
|
157
|
-
## Safety promise
|
|
158
|
-
|
|
159
|
-
- Source code is never modified by scan/doctor.
|
|
160
|
-
- ForgeLens writes only in the selected output folder.
|
|
161
|
-
- Env file names can be reported, but secret values are never printed.
|
|
162
|
-
- No network/API calls are required for detection.
|
|
142
|
+
Then open `http://127.0.0.1:4321/docs`.
|
|
163
143
|
|
|
164
|
-
##
|
|
144
|
+
## Safety Notes
|
|
165
145
|
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
146
|
+
- Scan and doctor do not modify source files.
|
|
147
|
+
- ForgeLens writes only inside the selected output folder (default `.forgelens/`).
|
|
148
|
+
- Env report includes file names and key names only, never secret values.
|
|
149
|
+
- Detection is static and deterministic; no runtime code execution.
|
|
169
150
|
|
|
170
|
-
##
|
|
151
|
+
## Limits
|
|
171
152
|
|
|
172
|
-
|
|
153
|
+
- This is static analysis, not a full semantic or runtime analyzer.
|
|
154
|
+
- It is not a replacement for security review or penetration testing.
|
|
Binary file
|