@chappibunny/repolens 1.9.0 โ†’ 1.9.2

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
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to RepoLens will be documented in this file.
4
4
 
5
+ ## 1.9.2
6
+
7
+ ### ๐Ÿ› Bug Fixes
8
+
9
+ - **Notion duplicate pages fixed**: Publishing no longer creates duplicate pages on every release. Added Notion Search API as primary lookup method for existing pages (more reliable than child block iteration), with case-insensitive title matching fallback.
10
+ - **Confluence empty pages fixed**: Executive Summary, System Overview, Business Domains and other AI-generated docs now publish correctly to Confluence. Added defensive null/empty content checks with helpful fallback messages instead of blank pages.
11
+ - **Document generation validation**: All document generators now validate output and provide error placeholders if generation fails, ensuring publishers always have content to work with.
12
+ - **Notion publisher robustness**: Now iterates over all rendered pages (not just config-defined ones), with content length logging for debugging.
13
+
14
+ ### ๐Ÿงช Tests
15
+
16
+ - Added test for `markdownToConfluenceStorage` handling of empty/null content
17
+ - **380 tests passing** across 22 test files
18
+
5
19
  ## 1.8.2
6
20
 
7
21
  ### ๐Ÿ› Bug Fixes
package/README.md CHANGED
@@ -10,14 +10,14 @@
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/@chappibunny/repolens)](https://www.npmjs.com/package/@chappibunny/repolens)
12
12
  [![VS Code Extension](https://img.shields.io/visual-studio-marketplace/v/CHAPIBUNNY.repolens-architecture?label=VS%20Code)](https://marketplace.visualstudio.com/items?itemName=CHAPIBUNNY.repolens-architecture)
13
- [![Tests](https://img.shields.io/badge/tests-379%20passing-brightgreen)](https://github.com/CHAPIBUNNY/repolens/actions)
13
+ [![Tests](https://img.shields.io/badge/tests-380%20passing-brightgreen)](https://github.com/CHAPIBUNNY/repolens/actions)
14
14
  [![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
15
15
 
16
16
  **Your architecture docs are already outdated.** RepoLens fixes that.
17
17
 
18
18
  RepoLens scans your repository, generates living architecture documentation, and publishes it to Notion, Confluence, GitHub Wiki, or Markdown โ€” automatically on every push. Engineers get technical docs. Stakeholders get readable system overviews. Nobody writes a word.
19
19
 
20
- > Stable as of v1.0 โ€” [API guarantees](STABILITY.md) ยท [Security hardened](SECURITY.md) ยท v1.8.1
20
+ > Stable as of v1.0 โ€” [API guarantees](docs/STABILITY.md) ยท [Security hardened](SECURITY.md) ยท v1.9.2
21
21
 
22
22
  ---
23
23
 
@@ -29,6 +29,14 @@ RepoLens scans your repository, generates living architecture documentation, and
29
29
 
30
30
  โ–ถ๏ธ *Click to watch on YouTube*
31
31
 
32
+ <details>
33
+ <summary>๐Ÿ” <strong>Supported Languages</strong> (16 auto-detected)</summary>
34
+
35
+ `JavaScript` `TypeScript` `Python` `Go` `Rust` `Java` `C` `C++` `C#` `Ruby` `PHP` `Swift` `Kotlin` `Scala` `Shell` `SQL`
36
+
37
+ Plus framework detection: **Django** ยท **FastAPI** ยท **Flask** ยท **Gin** ยท **Echo** ยท **Fiber** ยท **Actix** ยท **Rocket** โ€” and all major JS frameworks (React, Next.js, Vue, Angular, Express, NestJS, Svelte, etc.)
38
+ </details>
39
+
32
40
  ---
33
41
 
34
42
  ## ๐Ÿš€ Quick Start (60 seconds)
@@ -69,7 +77,7 @@ npx @chappibunny/repolens publish
69
77
  **Done!** Your docs are now live in Notion, Confluence, and/or `.repolens/` directory.
70
78
 
71
79
  **๐Ÿ”„ Upgrading from v0.3.0 or earlier?**
72
- Run `npx @chappibunny/repolens migrate` to automatically update your workflow files. See [MIGRATION.md](MIGRATION.md) for details.
80
+ Run `npx @chappibunny/repolens migrate` to automatically update your workflow files. See [MIGRATION.md](docs/MIGRATION.md) for details.
73
81
 
74
82
  ---
75
83
 
@@ -110,7 +118,7 @@ npm install @chappibunny/repolens
110
118
 
111
119
  Or try instantly without installing: `npx @chappibunny/repolens demo`
112
120
 
113
- For alternative methods, see [INSTALLATION.md](INSTALLATION.md).
121
+ For alternative methods, see [INSTALLATION.md](docs/INSTALLATION.md).
114
122
 
115
123
  ---
116
124
 
@@ -140,7 +148,7 @@ The extension reads your `.repolens.yml` configuration and provides an interacti
140
148
 
141
149
  Step-by-step setup for publishers, AI features, Notion, Confluence, GitHub Wiki, Discord, and CI/CD automation.
142
150
 
143
- **[โ†’ Full Onboarding Guide](ONBOARDING.md)**
151
+ **[โ†’ Full Onboarding Guide](docs/ONBOARDING.md)**
144
152
 
145
153
  ---
146
154
 
@@ -154,7 +162,7 @@ Step-by-step setup for publishers, AI features, Notion, Confluence, GitHub Wiki,
154
162
  | `npx @chappibunny/repolens demo` | Quick local preview โ€” no API keys needed |
155
163
  | `npx @chappibunny/repolens doctor` | Validate your setup |
156
164
  | `npx @chappibunny/repolens watch` | Auto-regenerate docs on file changes |
157
- | `npx @chappibunny/repolens migrate` | Upgrade from v0.3.0 workflows ([details](MIGRATION.md)) |
165
+ | `npx @chappibunny/repolens migrate` | Upgrade from v0.3.0 workflows ([details](docs/MIGRATION.md)) |
158
166
  | `npx @chappibunny/repolens uninstall` | Remove all RepoLens files (config, docs, workflow) |
159
167
  | `npx @chappibunny/repolens uninstall --force` | Remove without confirmation prompt |
160
168
  | `npx @chappibunny/repolens feedback` | Send feedback to the team |
@@ -228,7 +236,7 @@ When you open a pull request, RepoLens posts:
228
236
 
229
237
  ## ๐Ÿ”’ Privacy & Security
230
238
 
231
- - **Telemetry is opt-in and disabled by default** โ€” no code, secrets, or personal data leaves your machine. See [TELEMETRY.md](TELEMETRY.md).
239
+ - **Telemetry is opt-in and disabled by default** โ€” no code, secrets, or personal data leaves your machine. See [TELEMETRY.md](docs/TELEMETRY.md).
232
240
  - **Defense-in-depth security** โ€” input validation, secret detection (15+ patterns), rate limiting, injection prevention, supply chain hardening. See [SECURITY.md](SECURITY.md).
233
241
  - **Report vulnerabilities** to trades@rabitaitrades.com (not public issues). Response within 48 hours.
234
242
 
@@ -238,16 +246,16 @@ When you open a pull request, RepoLens posts:
238
246
 
239
247
  | Guide | Description |
240
248
  |---|---|
241
- | [Onboarding Guide](ONBOARDING.md) | Step-by-step setup: publishers, AI, Notion, Confluence, Discord |
242
- | [Configuration](CONFIGURATION.md) | Complete `.repolens.yml` schema and examples |
243
- | [Environment Variables](ENVIRONMENT.md) | All env vars by publisher and feature |
244
- | [Architecture](ARCHITECTURE.md) | Pipeline diagram, project structure |
245
- | [Development](DEVELOPMENT.md) | Setup, tests (379 across 22 files), release process |
249
+ | [Onboarding Guide](docs/ONBOARDING.md) | Step-by-step setup: publishers, AI, Notion, Confluence, Discord |
250
+ | [Configuration](docs/CONFIGURATION.md) | Complete `.repolens.yml` schema and examples |
251
+ | [Environment Variables](docs/ENVIRONMENT.md) | All env vars by publisher and feature |
252
+ | [Architecture](docs/ARCHITECTURE.md) | Pipeline diagram, project structure |
253
+ | [Development](docs/DEVELOPMENT.md) | Setup, tests (380 across 22 files), release process |
246
254
  | [Security](SECURITY.md) | Threat model, secret detection, validation layers |
247
- | [Telemetry](TELEMETRY.md) | Opt-in privacy-first usage analytics |
248
- | [Troubleshooting](TROUBLESHOOTING.md) | Common issues and fixes |
249
- | [Migration](MIGRATION.md) | Upgrading from v0.3.0 or earlier |
250
- | [Stability](STABILITY.md) | API contract and semver guarantees |
255
+ | [Telemetry](docs/TELEMETRY.md) | Opt-in privacy-first usage analytics |
256
+ | [Troubleshooting](docs/TROUBLESHOOTING.md) | Common issues and fixes |
257
+ | [Migration](docs/MIGRATION.md) | Upgrading from v0.3.0 or earlier |
258
+ | [Stability](docs/STABILITY.md) | API contract and semver guarantees |
251
259
 
252
260
  ---
253
261
 
@@ -273,7 +281,7 @@ v1.0+ features complete โ€” CLI, config schema, and plugin interface are frozen.
273
281
  - [ ] Obsidian publisher
274
282
  - [ ] GitHub App
275
283
 
276
- See [ROADMAP.md](ROADMAP.md) for detailed planning.
284
+ See [ROADMAP.md](docs/ROADMAP.md) for detailed planning.
277
285
 
278
286
  ---
279
287
 
@@ -285,7 +293,7 @@ MIT
285
293
 
286
294
  ## ๐Ÿ’ฌ Support & Contact
287
295
 
288
- - **Troubleshooting**: [TROUBLESHOOTING.md](TROUBLESHOOTING.md) โ€” installation, config, publishing, AI, and CI/CD issues
296
+ - **Troubleshooting**: [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) โ€” installation, config, publishing, AI, and CI/CD issues
289
297
  - **Diagnostics**: Run `npx @chappibunny/repolens doctor` to validate your setup
290
298
  - **Issues**: [GitHub Issues](https://github.com/CHAPIBUNNY/repolens/issues)
291
299
  - **Discussions**: [GitHub Discussions](https://github.com/CHAPIBUNNY/repolens/discussions)
package/docs/AI.md ADDED
@@ -0,0 +1,329 @@
1
+ # AI-Enhanced Documentation
2
+
3
+ As of v0.4.0, RepoLens supports AI-powered documentation generation that creates clear, audience-specific documentation for both technical and non-technical readers. This feature is available in the current version (v1.4.0).
4
+
5
+ ## Overview
6
+
7
+ RepoLens uses a hybrid approach:
8
+
9
+ 1. **Deterministic extraction** - Scans your repository structure, files, routes, APIs, and technologies
10
+ 2. **Structured context** - Builds intermediate JSON artifacts with facts about your codebase
11
+ 3. **AI synthesis** - Uses LLMs to generate human-readable explanations and insights
12
+ 4. **Audience-aware output** - Creates documents for engineers, PMs, stakeholders, and executives
13
+
14
+ This approach prevents hallucination while providing rich, readable documentation.
15
+
16
+ ## Document Structure
17
+
18
+ RepoLens generates up to 15 documents:
19
+
20
+ ### For Non-Technical Audiences
21
+
22
+ - **00-executive-summary.md** - What the system does, who it serves, key risks
23
+ - **02-business-domains.md** - Codebase structure in business language
24
+
25
+ ### For Mixed Audiences
26
+
27
+ - **01-system-overview.md** - High-level technical snapshot
28
+ - **05-route-map.md** - User-facing pages and capabilities
29
+ - **07-data-flows.md** - How information moves through the system
30
+ - **08-change-impact.md** - PR/diff analysis in plain language
31
+ - **09-system-map.md** - Visual diagram with explanation
32
+
33
+ ### For Technical Audiences
34
+
35
+ - **03-architecture-overview.md** - Layered architecture analysis
36
+ - **04-module-catalog.md** - Complete code module inventory
37
+ - **06-api-surface.md** - Backend API documentation
38
+ - **10-developer-onboarding.md** - Quick start for new engineers
39
+
40
+ ### Extended Analysis (New in v0.8.0)
41
+
42
+ - **11-graphql-schema.md** - GraphQL types, queries, mutations, and resolvers
43
+ - **12-type-graph.md** - TypeScript interfaces, classes, and type relationships
44
+ - **13-dependency-graph.md** - Import analysis with circular dependency detection
45
+ - **14-architecture-drift.md** - Structural changes tracked against baseline
46
+
47
+ ## Enabling AI Features
48
+
49
+ ### 1. Set Environment Variables
50
+
51
+ Create a `.env` file (or set in GitHub Actions secrets):
52
+
53
+ ```bash
54
+ # Enable AI features
55
+ REPOLENS_AI_ENABLED=true
56
+
57
+ # Your OpenAI API key (or compatible provider)
58
+ REPOLENS_AI_API_KEY=sk-xxx
59
+
60
+ # API endpoint (optional, defaults to OpenAI)
61
+ REPOLENS_AI_BASE_URL=https://api.openai.com/v1
62
+
63
+ # Model to use
64
+ REPOLENS_AI_MODEL=gpt-5-mini
65
+ ```
66
+
67
+ ### 2. Configure in .repolens.yml
68
+
69
+ ```yaml
70
+ features:
71
+ executive_summary: true
72
+ business_domains: true
73
+ architecture_overview: true
74
+ data_flows: true
75
+ developer_onboarding: true
76
+ ai_enrichment: true
77
+
78
+ ai:
79
+ enabled: true
80
+ mode: "hybrid" # deterministic facts + AI explanations
81
+ max_tokens: 2500
82
+ ```
83
+
84
+ ### 3. Run Publish
85
+
86
+ ```bash
87
+ npx @chappibunny/repolens publish
88
+ ```
89
+
90
+ ## AI Providers
91
+
92
+ RepoLens supports multiple AI providers natively. Set `REPOLENS_AI_PROVIDER` to select one.
93
+
94
+ ### GitHub Models (Free โ€” Recommended for GitHub Actions)
95
+
96
+ Every GitHub repository gets free access to AI models via [GitHub Models](https://github.com/marketplace/models). In GitHub Actions, the `GITHUB_TOKEN` is already available โ€” no API key signup needed.
97
+
98
+ ```bash
99
+ REPOLENS_AI_ENABLED=true
100
+ REPOLENS_AI_PROVIDER=github
101
+ # Uses GITHUB_TOKEN automatically โ€” no REPOLENS_AI_API_KEY needed
102
+ # Default model: gpt-4o-mini (free tier)
103
+ ```
104
+
105
+ **GitHub Actions workflow:**
106
+ ```yaml
107
+ env:
108
+ REPOLENS_AI_ENABLED: true
109
+ REPOLENS_AI_PROVIDER: github
110
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111
+ ```
112
+
113
+ > **Free tier limits:** ~150 requests/day for gpt-4o-mini. RepoLens makes ~15 AI calls per run, so this is more than sufficient.
114
+
115
+ ### OpenAI
116
+
117
+ ```bash
118
+ REPOLENS_AI_PROVIDER=openai_compatible
119
+ REPOLENS_AI_BASE_URL=https://api.openai.com/v1
120
+ REPOLENS_AI_API_KEY=sk-xxx
121
+ REPOLENS_AI_MODEL=gpt-5-mini
122
+ ```
123
+
124
+ ### Anthropic
125
+
126
+ ```bash
127
+ REPOLENS_AI_PROVIDER=anthropic
128
+ REPOLENS_AI_API_KEY=sk-ant-xxx
129
+ REPOLENS_AI_MODEL=claude-sonnet-4-20250514
130
+ ```
131
+
132
+ ### Google Gemini
133
+
134
+ ```bash
135
+ REPOLENS_AI_PROVIDER=google
136
+ REPOLENS_AI_API_KEY=xxx
137
+ REPOLENS_AI_MODEL=gemini-pro
138
+ ```
139
+
140
+ ### Azure OpenAI
141
+
142
+ ```bash
143
+ REPOLENS_AI_PROVIDER=openai_compatible
144
+ REPOLENS_AI_BASE_URL=https://your-resource.openai.azure.com/openai/deployments/your-deployment
145
+ REPOLENS_AI_API_KEY=xxx
146
+ REPOLENS_AI_MODEL=gpt-5-mini
147
+ ```
148
+
149
+ ### Local Models (Ollama, LM Studio, etc.)
150
+
151
+ ```bash
152
+ REPOLENS_AI_PROVIDER=openai_compatible
153
+ REPOLENS_AI_BASE_URL=http://localhost:11434/v1
154
+ REPOLENS_AI_API_KEY=dummy # not used for local
155
+ REPOLENS_AI_MODEL=llama3
156
+ ```
157
+
158
+ ## Configuration Options
159
+
160
+ ### AI Section
161
+
162
+ ```yaml
163
+ ai:
164
+ enabled: true # Master switch
165
+
166
+ mode: "hybrid" # Options: hybrid, full, off
167
+ # hybrid: Deterministic facts + AI explanations
168
+ # full: More AI-generated content
169
+ # off: Deterministic only
170
+
171
+ audience_default: "mixed" # Default target audience
172
+ # mixed: Readable by technical and non-technical
173
+ # technical: Developer-focused
174
+ # non-technical: Leadership/stakeholder-focused
175
+
176
+ max_tokens: 2500 # Maximum response length
177
+ ```
178
+
179
+ ### Business Domains
180
+
181
+ Help AI understand your codebase by defining business domains:
182
+
183
+ ```yaml
184
+ domains:
185
+ authentication:
186
+ match: ["auth", "login", "session"]
187
+ description: "User authentication flows"
188
+
189
+ payments:
190
+ match: ["payment", "stripe", "checkout"]
191
+ description: "Payment processing"
192
+
193
+ market_data:
194
+ match: ["stock", "chart", "price"]
195
+ description: "Financial market data"
196
+ ```
197
+
198
+ ### Documentation Output
199
+
200
+ ```yaml
201
+ documentation:
202
+ output_dir: ".repolens" # Where to write files
203
+ include_artifacts: true # Save JSON for debugging
204
+ file_prefix: true # Add 00-, 01- numbers
205
+
206
+ sections: # Which documents to generate
207
+ - executive_summary
208
+ - system_overview
209
+ - business_domains
210
+ - architecture_overview
211
+ - module_catalog
212
+ - route_map
213
+ - api_surface
214
+ - data_flows
215
+ - change_impact
216
+ - system_map
217
+ - developer_onboarding
218
+ ```
219
+
220
+ ## Cost Considerations
221
+
222
+ AI generation adds cost. Typical pricing (GPT-5-mini):
223
+
224
+ - Small repo (~50 modules): $0.10 - $0.30 per run
225
+ - Medium repo (~200 modules): $0.30 - $0.80 per run
226
+ - Large repo (~500 modules): $0.80 - $2.00 per run
227
+
228
+ Tips to reduce cost:
229
+
230
+ 1. Use `gpt-5-nano` for faster, cheaper results
231
+ 2. Disable documents you don't need in `documentation.sections`
232
+ 3. Run on main branch only (configure `notion.branches`)
233
+ 4. Use local models for free (quality varies)
234
+
235
+ ## Fallback Behavior
236
+
237
+ If AI is disabled or fails, RepoLens generates deterministic documentation automatically. You'll see a note: "AI-enhanced documentation is disabled."
238
+
239
+ ## Zero Hallucination Policy
240
+
241
+ RepoLens prompts are designed to prevent AI from inventing facts:
242
+
243
+ - AI receives only structured JSON context (not raw code)
244
+ - Prompts explicitly forbid fabrication
245
+ - AI must state uncertainty when context is insufficient
246
+ - Deterministic facts (file counts, routes, modules) are never AI-generated
247
+
248
+ ## Example Outputs
249
+
250
+ ### Executive Summary (with AI)
251
+
252
+ ```markdown
253
+ # Executive Summary
254
+
255
+ ## What this system does
256
+
257
+ Based on the detected modules and routing structure, this appears to be
258
+ a financial analytics platform that combines market data visualization,
259
+ user account management, and research content delivery.
260
+
261
+ ## Who it serves
262
+
263
+ The system serves retail investors and financial analysts who need...
264
+
265
+ ## Core capabilities
266
+
267
+ 1. Real-time market data analysis with interactive charts
268
+ 2. Portfolio tracking and trade management
269
+ 3. Research articles and investment insights
270
+ ...
271
+ ```
272
+
273
+ ### Executive Summary (without AI)
274
+
275
+ ```markdown
276
+ # Executive Summary
277
+
278
+ ## What this system does
279
+
280
+ my-project is a Next.js, React application with 271 modules across
281
+ 1139 files.
282
+
283
+ ## Main system areas
284
+
285
+ The codebase is organized into 12 main domains:
286
+ - Market Data & Analysis: 45 modules
287
+ - Authentication: 8 modules
288
+ ...
289
+
290
+ Note: AI-enhanced documentation is disabled.
291
+ ```
292
+
293
+ ## Troubleshooting
294
+
295
+ ### "AI features are disabled"
296
+
297
+ Set `REPOLENS_AI_ENABLED=true`
298
+
299
+ ### "Missing API key"
300
+
301
+ Set `REPOLENS_AI_API_KEY=your-key`
302
+
303
+ ### "Request timeout"
304
+
305
+ Increase timeout: `REPOLENS_AI_TIMEOUT_MS=120000` (2 minutes)
306
+
307
+ ### "Rate limit exceeded"
308
+
309
+ Wait and retry, or reduce `max_tokens`
310
+
311
+ ### Poor quality output
312
+
313
+ - Try `gpt-5.4` for highest quality output
314
+ - Increase `max_tokens`
315
+ - Add more detail to `domains` configuration
316
+
317
+ ### Running costs too high
318
+
319
+ - Use `gpt-5-nano` instead of `gpt-5-mini`
320
+ - Reduce number of documents in `documentation.sections`
321
+ - Run less frequently (only on main branch merges)
322
+
323
+ ## Next Steps
324
+
325
+ 1. Start with default settings and `gpt-5-mini`
326
+ 2. Review generated documentation
327
+ 3. Add business domains to improve quality
328
+ 4. Adjust `max_tokens` as needed
329
+ 5. Switch to `gpt-5-nano` to reduce costs if quality is acceptable
@@ -0,0 +1,145 @@
1
+ # ๐Ÿ—๏ธ Architecture & Design
2
+
3
+ ## How RepoLens Works
4
+
5
+ ```
6
+ 1. SCAN 2. ANALYZE 3. RENDER 4. PUBLISH
7
+ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
8
+ Read files โ†’ Detect tech โ†’ Generate docs โ†’ Notion pages
9
+ from patterns stack patterns with insights + Confluence pages
10
+ + Markdown files
11
+ ```
12
+
13
+ **Scan Phase:**
14
+ - Uses `fast-glob` to match your `scan.include` patterns
15
+ - Filters out `scan.ignore` patterns
16
+ - Reads package.json for framework/tool detection
17
+ - Analyzes file paths for Next.js routes, API endpoints
18
+
19
+ **Analyze Phase:**
20
+ - Extracts frameworks (Next.js, React, Vue, Express, etc.)
21
+ - Detects build tools (Vite, Webpack, Turbo, esbuild)
22
+ - Identifies test frameworks (Vitest, Jest, Playwright)
23
+ - Infers module relationships and dependencies
24
+
25
+ **Render Phase:**
26
+ - Groups files into modules based on `module_roots`
27
+ - Generates Mermaid diagrams showing module dependencies
28
+ - Creates technical profiles with actual stack insights
29
+ - Renders Markdown documentation
30
+
31
+ **Publish Phase:**
32
+ - Markdown: Writes files to `.repolens/` directory
33
+ - Notion: Creates/updates pages via API with retry logic
34
+ - Confluence: Creates/updates pages via REST API v1 (storage format)
35
+
36
+ ## Module Dependency Detection
37
+
38
+ RepoLens infers relationships by analyzing import patterns:
39
+
40
+ ```typescript
41
+ // In src/publishers/notion.js
42
+ import { renderSystemOverview } from "../renderers/render.js";
43
+ // โ†’ Publishers depend on Renderers
44
+
45
+ // In src/renderers/render.js
46
+ import { scanRepo } from "../core/scan.js";
47
+ // โ†’ Renderers depend on Core
48
+
49
+ // Result: Dependency graph shows Publishers โ†’ Renderers โ†’ Core
50
+ ```
51
+
52
+ ## System Map
53
+
54
+ ```mermaid
55
+ graph LR
56
+ CLI[bin/repolens<br/>1 file] --> Core[src/core<br/>4 files]
57
+ Publishers[src/publishers<br/>6 files] --> Core
58
+ Publishers --> Renderers[src/renderers<br/>4 files]
59
+ Publishers --> Utils[src/utils<br/>10 files]
60
+ Renderers --> Core
61
+ Delivery[src/delivery<br/>1 file] --> Publishers
62
+ Tests[tests<br/>15 files] -. tests .-> CLI
63
+ Tests -. tests .-> Core
64
+ Tests -. tests .-> Publishers
65
+
66
+ style CLI fill:#9b59b6,color:#fff
67
+ style Core fill:#f39c12,color:#000
68
+ style Publishers fill:#27ae60,color:#fff
69
+ style Renderers fill:#27ae60,color:#fff
70
+ style Delivery fill:#16a085,color:#fff
71
+ style Utils fill:#95a5a6,color:#000
72
+ style Tests fill:#e67e22,color:#fff
73
+ ```
74
+
75
+ ## Project Structure
76
+
77
+ ```
78
+ repolens/
79
+ โ”œโ”€โ”€ bin/
80
+ โ”‚ โ””โ”€โ”€ repolens.js # CLI executable wrapper
81
+ โ”œโ”€โ”€ src/
82
+ โ”‚ โ”œโ”€โ”€ cli.js # Command orchestration + banner
83
+ โ”‚ โ”œโ”€โ”€ init.js # Scaffolding command (+ interactive wizard)
84
+ โ”‚ โ”œโ”€โ”€ doctor.js # Validation command
85
+ โ”‚ โ”œโ”€โ”€ migrate.js # Workflow migration (legacy โ†’ current)
86
+ โ”‚ โ”œโ”€โ”€ watch.js # Watch mode for local development
87
+ โ”‚ โ”œโ”€โ”€ core/
88
+ โ”‚ โ”‚ โ”œโ”€โ”€ config.js # Config loading + validation
89
+ โ”‚ โ”‚ โ”œโ”€โ”€ config-schema.js # Schema version tracking
90
+ โ”‚ โ”‚ โ”œโ”€โ”€ diff.js # Git diff operations
91
+ โ”‚ โ”‚ โ””โ”€โ”€ scan.js # Repository scanning + metadata extraction
92
+ โ”‚ โ”œโ”€โ”€ analyzers/
93
+ โ”‚ โ”‚ โ”œโ”€โ”€ domain-inference.js # Business domain mapping
94
+ โ”‚ โ”‚ โ”œโ”€โ”€ context-builder.js # Structured AI context assembly
95
+ โ”‚ โ”‚ โ”œโ”€โ”€ flow-inference.js # Data flow detection
96
+ โ”‚ โ”‚ โ”œโ”€โ”€ graphql-analyzer.js # GraphQL schema detection
97
+ โ”‚ โ”‚ โ”œโ”€โ”€ typescript-analyzer.js # TypeScript type graph analysis
98
+ โ”‚ โ”‚ โ”œโ”€โ”€ dependency-graph.js # Import graph with cycle detection
99
+ โ”‚ โ”‚ โ””โ”€โ”€ drift-detector.js # Architecture drift detection
100
+ โ”‚ โ”œโ”€โ”€ ai/
101
+ โ”‚ โ”‚ โ”œโ”€โ”€ provider.js # Provider-agnostic AI generation
102
+ โ”‚ โ”‚ โ”œโ”€โ”€ prompts.js # Strict prompt templates
103
+ โ”‚ โ”‚ โ”œโ”€โ”€ document-plan.js # Document structure definition
104
+ โ”‚ โ”‚ โ””โ”€โ”€ generate-sections.js # AI section generation + fallbacks
105
+ โ”‚ โ”œโ”€โ”€ docs/
106
+ โ”‚ โ”‚ โ”œโ”€โ”€ generate-doc-set.js # Document generation orchestration
107
+ โ”‚ โ”‚ โ””โ”€โ”€ write-doc-set.js # Write docs to disk
108
+ โ”‚ โ”œโ”€โ”€ renderers/
109
+ โ”‚ โ”‚ โ”œโ”€โ”€ render.js # System overview, catalog, API, routes
110
+ โ”‚ โ”‚ โ”œโ”€โ”€ renderDiff.js # Architecture diff rendering
111
+ โ”‚ โ”‚ โ”œโ”€โ”€ renderMap.js # Unicode dependency diagrams
112
+ โ”‚ โ”‚ โ””โ”€โ”€ renderAnalysis.js # Extended analysis renderers
113
+ โ”‚ โ”œโ”€โ”€ publishers/
114
+ โ”‚ โ”‚ โ”œโ”€โ”€ index.js # Publisher orchestration + branch filtering
115
+ โ”‚ โ”‚ โ”œโ”€โ”€ publish.js # Publishing pipeline
116
+ โ”‚ โ”‚ โ”œโ”€โ”€ notion.js # Notion API integration
117
+ โ”‚ โ”‚ โ”œโ”€โ”€ confluence.js # Confluence REST API integration
118
+ โ”‚ โ”‚ โ”œโ”€โ”€ github-wiki.js # GitHub Wiki publisher (git-based)
119
+ โ”‚ โ”‚ โ””โ”€โ”€ markdown.js # Local Markdown generation
120
+ โ”‚ โ”œโ”€โ”€ integrations/
121
+ โ”‚ โ”‚ โ””โ”€โ”€ discord.js # Discord webhook notifications
122
+ โ”‚ โ”œโ”€โ”€ delivery/
123
+ โ”‚ โ”‚ โ””โ”€โ”€ comment.js # PR comment delivery
124
+ โ”‚ โ”œโ”€โ”€ plugins/
125
+ โ”‚ โ”‚ โ”œโ”€โ”€ loader.js # Plugin resolution and dynamic import
126
+ โ”‚ โ”‚ โ””โ”€โ”€ manager.js # Plugin registry and lifecycle orchestration
127
+ โ”‚ โ””โ”€โ”€ utils/
128
+ โ”‚ โ”œโ”€โ”€ logger.js # Logging utilities
129
+ โ”‚ โ”œโ”€โ”€ retry.js # API retry logic (exponential backoff)
130
+ โ”‚ โ”œโ”€โ”€ branch.js # Branch detection (multi-platform)
131
+ โ”‚ โ”œโ”€โ”€ validate.js # Configuration validation & security
132
+ โ”‚ โ”œโ”€โ”€ metrics.js # Documentation coverage & health scoring
133
+ โ”‚ โ”œโ”€โ”€ rate-limit.js # Token bucket rate limiter for APIs
134
+ โ”‚ โ”œโ”€โ”€ secrets.js # Secret detection & sanitization
135
+ โ”‚ โ”œโ”€โ”€ telemetry.js # Opt-in error tracking + performance timers
136
+ โ”‚ โ”œโ”€โ”€ errors.js # Enhanced error messages with guidance
137
+ โ”‚ โ””โ”€โ”€ update-check.js # Version update notifications
138
+ โ”œโ”€โ”€ tests/ # Vitest test suite (185 tests across 15 files)
139
+ โ”œโ”€โ”€ .repolens.yml # Dogfooding config
140
+ โ”œโ”€โ”€ package.json
141
+ โ”œโ”€โ”€ CHANGELOG.md
142
+ โ”œโ”€โ”€ STABILITY.md
143
+ โ”œโ”€โ”€ RELEASE.md
144
+ โ””โ”€โ”€ ROADMAP.md
145
+ ```