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 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
- ForgeLens is a local-first CLI that scans a codebase and generates clean repository context files for AI coding agents.
4
-
5
- ## Status
6
-
7
- - ForgeLens is currently `v0.1.0`.
8
- - It is a local-first CLI for deterministic static analysis.
9
- - It is useful for generating AI repo context before edits.
10
- - It is not a full semantic analyzer.
11
- - It is not a security audit.
12
-
13
- ## Why this tool exists
14
-
15
- AI coding agents work better when repo structure, auth boundaries, routes, and risk areas are explicit.
16
- Without clean context, agents guess more, make riskier edits, and miss architecture rules.
17
-
18
- ForgeLens solves this by producing deterministic Markdown context from static analysis.
19
-
20
- ## Who this is for
21
-
22
- - Developers using Codex, Claude Code, Cursor, OpenCode, and similar tools
23
- - Teams that want shared repo understanding before AI-assisted edits
24
-
25
- ## What ForgeLens does
26
-
27
- - Scans repository in read-only mode
28
- - Detects project signals (framework, routes, server actions, database, auth, middleware, env files)
29
- - Classifies database/auth detections with confidence (`high`, `medium`, `low`)
30
- - Shows evidence files for each detected signal
31
- - Writes context files to output folder only (default `.forgelens/`)
32
-
33
- ## Supported signals/providers
34
-
35
- Database/provider signals:
36
- - Supabase
37
- - Prisma
38
- - Drizzle
39
- - TypeORM
40
- - Mongoose/MongoDB
41
- - Firebase/Firestore
42
- - PostgreSQL clients
43
- - MySQL clients
44
- - SQLite
45
- - SQL migrations
46
- - custom database layer
47
- - unknown
48
-
49
- Auth/provider signals:
50
- - Clerk
51
- - NextAuth/Auth.js
52
- - Supabase Auth
53
- - Firebase Auth
54
- - Lucia
55
- - Better Auth
56
- - JWT custom auth
57
- - cookie/session custom auth
58
- - middleware-based auth
59
- - custom auth
60
- - unknown
61
-
62
- ## Requirements
63
-
64
- - Node.js 18+
65
- - Works with npm, pnpm, yarn, and bun projects where package metadata is available
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
- ForgeLens is not published to npm yet. After npm release, install with:
86
+ Quick run:
70
87
 
71
88
  ```bash
72
- npm install -g forgelens
89
+ npx forgelens scan
73
90
  ```
74
91
 
75
- After npm release, use without global install:
92
+ Global install:
76
93
 
77
94
  ```bash
78
- npx forgelens scan
95
+ npm install -g forgelens
96
+ forgelens scan
79
97
  ```
80
98
 
81
- Local development usage:
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 commands
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
- ## Common usage
119
+ ## Developer Shortcuts
100
120
 
101
- ```bash
102
- forgelens scan --root . --out .forgelens --format markdown --verbose
103
- forgelens doctor --root . --out .forgelens
104
- forgelens clean --root . --out .forgelens --yes
105
- forgelens prompt codex
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
- ## Generated files
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
- Example from `SECURITY_RULES.md`:
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
- ```md
134
- ## Auth providers/signals detected
135
- - nextauth-authjs (confidence: high)
136
- evidence: `lib/auth.ts`
136
+ Run docs locally:
137
137
 
138
- ## Environment files (names only)
139
- - `.env.example`
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
- ## Example workflow with AI agents
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
- ## Limitations
144
+ ## Safety Notes
165
145
 
166
- - Static analysis only; dynamic/runtime behavior is not executed.
167
- - Confidence is evidence-based, not guaranteed truth.
168
- - Custom frameworks and unusual repo layouts may require manual review.
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
- ## Important warning
151
+ ## Limits
171
152
 
172
- ForgeLens is not a security audit and not a replacement for code review, AppSec review, or penetration testing.
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