@chappibunny/repolens 1.12.2 โ 1.13.0
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 +100 -0
- package/README.md +25 -36
- package/bin/repolens.js +21 -1
- package/package.json +20 -11
- package/src/ai/provider.js +1 -2
- package/src/analyzers/monorepo-detector.js +8 -20
- package/src/cli-args.js +60 -0
- package/src/cli.js +80 -100
- package/src/core/config-schema.js +47 -1
- package/src/core/config.js +5 -2
- package/src/core/diff.js +43 -20
- package/src/core/scan.js +24 -4
- package/src/delivery/comment.js +5 -2
- package/src/docs/write-doc-set.js +9 -7
- package/src/doctor.js +16 -3
- package/src/help.js +54 -0
- package/src/index.js +13 -0
- package/src/init.js +99 -62
- package/src/integrations/discord.js +16 -2
- package/src/migrate.js +2 -2
- package/src/publishers/confluence.js +17 -3
- package/src/publishers/github-wiki.js +61 -32
- package/src/publishers/index.js +24 -9
- package/src/publishers/markdown.js +3 -2
- package/src/publishers/notion.js +10 -4
- package/src/publishers/obsidian.js +716 -0
- package/src/utils/branch.js +37 -42
- package/src/utils/github-repo.js +8 -0
- package/src/utils/interactive.js +20 -0
- package/src/utils/logger.js +5 -1
- package/src/utils/retry.js +30 -6
- package/src/utils/safe-path.js +50 -0
- package/src/utils/secrets.js +3 -1
- package/src/utils/telemetry.js +34 -6
- package/src/utils/update-check.js +23 -6
- package/src/utils/validate.js +70 -1
- package/src/utils/yaml.js +27 -0
- package/src/watch.js +1 -1
- package/docs/AI.md +0 -329
- package/docs/ARCHITECTURE.md +0 -145
- package/docs/CONFIGURATION.md +0 -121
- package/docs/DEVELOPMENT.md +0 -79
- package/docs/ENVIRONMENT.md +0 -79
- package/docs/INSTALLATION.md +0 -45
- package/docs/KNOWN_ISSUES.md +0 -309
- package/docs/MIGRATION.md +0 -311
- package/docs/ONBOARDING.md +0 -382
- package/docs/PRODUCTION_CHECKLIST.md +0 -470
- package/docs/RELEASE.md +0 -76
- package/docs/ROADMAP.md +0 -151
- package/docs/STABILITY.md +0 -265
- package/docs/TELEMETRY.md +0 -166
- package/docs/TROUBLESHOOTING.md +0 -377
package/docs/AI.md
DELETED
|
@@ -1,329 +0,0 @@
|
|
|
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
|
package/docs/ARCHITECTURE.md
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
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
|
-
```
|
package/docs/CONFIGURATION.md
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
# โ๏ธ Configuration Reference
|
|
2
|
-
|
|
3
|
-
## Complete Example
|
|
4
|
-
|
|
5
|
-
```yaml
|
|
6
|
-
configVersion: 1 # Schema version for future migrations
|
|
7
|
-
|
|
8
|
-
project:
|
|
9
|
-
name: "my-awesome-app"
|
|
10
|
-
docs_title_prefix: "MyApp"
|
|
11
|
-
|
|
12
|
-
# Configure output destinations
|
|
13
|
-
publishers:
|
|
14
|
-
- notion
|
|
15
|
-
- confluence
|
|
16
|
-
- markdown
|
|
17
|
-
|
|
18
|
-
# Notion-specific settings (optional)
|
|
19
|
-
notion:
|
|
20
|
-
branches:
|
|
21
|
-
- main # Only main branch publishes
|
|
22
|
-
- staging # Also staging
|
|
23
|
-
- release/* # Glob patterns supported
|
|
24
|
-
includeBranchInTitle: false # Clean titles without [branch-name]
|
|
25
|
-
|
|
26
|
-
# Confluence-specific settings (optional)
|
|
27
|
-
confluence:
|
|
28
|
-
branches:
|
|
29
|
-
- main # Only main branch publishes to Confluence
|
|
30
|
-
|
|
31
|
-
# Discord notifications (optional)
|
|
32
|
-
discord:
|
|
33
|
-
enabled: true # Default: true (if DISCORD_WEBHOOK_URL set)
|
|
34
|
-
notifyOn: significant # Options: always, significant, never
|
|
35
|
-
significantThreshold: 10 # Notify if change >10% (default)
|
|
36
|
-
branches: # Which branches to notify (default: all)
|
|
37
|
-
- main
|
|
38
|
-
- develop
|
|
39
|
-
|
|
40
|
-
# GitHub integration (optional)
|
|
41
|
-
github:
|
|
42
|
-
owner: "your-username"
|
|
43
|
-
repo: "your-repo-name"
|
|
44
|
-
|
|
45
|
-
# File scanning configuration
|
|
46
|
-
scan:
|
|
47
|
-
include:
|
|
48
|
-
- "src/**/*.{ts,tsx,js,jsx}"
|
|
49
|
-
- "app/**/*.{ts,tsx,js,jsx}"
|
|
50
|
-
- "pages/**/*.{ts,tsx,js,jsx}"
|
|
51
|
-
- "lib/**/*.{ts,tsx,js,jsx}"
|
|
52
|
-
ignore:
|
|
53
|
-
- "node_modules/**"
|
|
54
|
-
- ".next/**"
|
|
55
|
-
- "dist/**"
|
|
56
|
-
- "build/**"
|
|
57
|
-
- "coverage/**"
|
|
58
|
-
|
|
59
|
-
# Module organization
|
|
60
|
-
module_roots:
|
|
61
|
-
- "src"
|
|
62
|
-
- "app"
|
|
63
|
-
- "lib"
|
|
64
|
-
- "pages"
|
|
65
|
-
|
|
66
|
-
# Documentation pages to generate
|
|
67
|
-
outputs:
|
|
68
|
-
pages:
|
|
69
|
-
- key: "system_overview"
|
|
70
|
-
title: "System Overview"
|
|
71
|
-
description: "High-level snapshot and tech stack"
|
|
72
|
-
- key: "module_catalog"
|
|
73
|
-
title: "Module Catalog"
|
|
74
|
-
description: "Complete module inventory"
|
|
75
|
-
- key: "api_surface"
|
|
76
|
-
title: "API Surface"
|
|
77
|
-
description: "REST endpoints and methods"
|
|
78
|
-
- key: "route_map"
|
|
79
|
-
title: "Route Map"
|
|
80
|
-
description: "Frontend routes and pages"
|
|
81
|
-
- key: "system_map"
|
|
82
|
-
title: "System Map"
|
|
83
|
-
description: "Visual dependency graph"
|
|
84
|
-
|
|
85
|
-
# Feature flags (optional, experimental)
|
|
86
|
-
features:
|
|
87
|
-
architecture_diff: true
|
|
88
|
-
route_map: true
|
|
89
|
-
visual_diagrams: true
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Configuration Fields
|
|
93
|
-
|
|
94
|
-
| Field | Type | Required | Description |
|
|
95
|
-
|-------|------|----------|-------------|
|
|
96
|
-
| `configVersion` | number | **Yes** | Schema version (must be `1`) |
|
|
97
|
-
| `project.name` | string | Yes | Project name |
|
|
98
|
-
| `project.docs_title_prefix` | string | No | Prefix for documentation titles (default: project name) |
|
|
99
|
-
| `publishers` | array | Yes | Output targets: `notion`, `confluence`, `github_wiki`, `markdown` (+ plugin publishers) |
|
|
100
|
-
| `plugins` | array | No | Plugin paths or npm package names |
|
|
101
|
-
| `notion.branches` | array | No | Branch whitelist for Notion publishing. Supports globs. |
|
|
102
|
-
| `notion.includeBranchInTitle` | boolean | No | Add `[branch-name]` to titles (default: `true`) |
|
|
103
|
-
| `confluence.branches` | array | No | Branch whitelist for Confluence publishing. Supports globs. |
|
|
104
|
-
| `github_wiki.branches` | array | No | Branch whitelist for GitHub Wiki publishing. Supports globs. |
|
|
105
|
-
| `github_wiki.sidebar` | boolean | No | Generate `_Sidebar.md` navigation (default: `true`) |
|
|
106
|
-
| `github_wiki.footer` | boolean | No | Generate `_Footer.md` (default: `true`) |
|
|
107
|
-
| `discord.enabled` | boolean | No | Enable Discord notifications (default: `true` if webhook set) |
|
|
108
|
-
| `discord.notifyOn` | string | No | Notification policy: `always`, `significant`, `never` (default: `significant`) |
|
|
109
|
-
| `discord.significantThreshold` | number | No | Change % threshold for notifications (default: `10`) |
|
|
110
|
-
| `discord.branches` | array | No | Branch filter for notifications. Supports globs. (default: all) |
|
|
111
|
-
| `github.owner` | string | No | GitHub org/username |
|
|
112
|
-
| `github.repo` | string | No | Repository name |
|
|
113
|
-
| `scan.include` | array | Yes | Glob patterns for files to scan |
|
|
114
|
-
| `scan.ignore` | array | Yes | Glob patterns to exclude |
|
|
115
|
-
| `module_roots` | array | No | Root directories for module detection |
|
|
116
|
-
| `outputs.pages` | array | Yes | Documentation pages to generate |
|
|
117
|
-
| `features` | object | No | Feature flags (boolean values) |
|
|
118
|
-
| `ai.enabled` | boolean | No | Enable AI-powered documentation |
|
|
119
|
-
| `ai.mode` | string | No | AI mode: `hybrid`, `full`, or `off` |
|
|
120
|
-
| `ai.temperature` | number | No | Generation temperature (0โ2). Not supported by all models (e.g. gpt-5-mini ignores it) |
|
|
121
|
-
| `ai.max_tokens` | number | No | Max completion tokens per request (>0) |
|
package/docs/DEVELOPMENT.md
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# ๐งช Development
|
|
2
|
-
|
|
3
|
-
## Setup
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
git clone https://github.com/CHAPIBUNNY/repolens.git
|
|
7
|
-
cd repolens
|
|
8
|
-
npm install
|
|
9
|
-
npm link # Makes 'repolens' command available globally
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## Run Tests
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm test
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
**Test Suite:**
|
|
19
|
-
- Config discovery and validation
|
|
20
|
-
- Branch detection (GitHub/GitLab/CircleCI)
|
|
21
|
-
- CLI commands (version, help, uninstall)
|
|
22
|
-
- Markdown publisher and parser tests (Notion, Confluence)
|
|
23
|
-
- Integration and HTTP integration workflows
|
|
24
|
-
- Doctor command validation
|
|
25
|
-
- Init wizard and scaffolding
|
|
26
|
-
- AI provider and structured output tests
|
|
27
|
-
- Extended analysis (GraphQL, TypeScript, dependency graph, drift)
|
|
28
|
-
- Plugin system (loader, manager, config)
|
|
29
|
-
- Renderers (system map, diff, analysis)
|
|
30
|
-
- Deterministic enrichment (all 6 AI-enhanced doc types)
|
|
31
|
-
- Security fuzzing and rate-limit stress tests
|
|
32
|
-
- Watch mode and migration (including e2e)
|
|
33
|
-
- Robustness (timeout, partial-publish, error isolation)
|
|
34
|
-
|
|
35
|
-
**Coverage:** 380 tests passing across 22 test files
|
|
36
|
-
|
|
37
|
-
## Test Package Installation Locally
|
|
38
|
-
|
|
39
|
-
Simulates the full user installation experience:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
# Pack the tarball
|
|
43
|
-
npm pack
|
|
44
|
-
|
|
45
|
-
# Install globally from tarball
|
|
46
|
-
npm install -g chappibunny-repolens-1.8.1.tgz
|
|
47
|
-
|
|
48
|
-
# Verify
|
|
49
|
-
repolens --version
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Release Process
|
|
53
|
-
|
|
54
|
-
RepoLens uses automated GitHub Actions releases.
|
|
55
|
-
|
|
56
|
-
### Creating a Release
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
# Patch version (1.0.0 โ 1.0.1) - Bug fixes
|
|
60
|
-
npm run release:patch
|
|
61
|
-
|
|
62
|
-
# Minor version (1.0.0 โ 1.1.0) - New features
|
|
63
|
-
npm run release:minor
|
|
64
|
-
|
|
65
|
-
# Major version (1.0.0 โ 2.0.0) - Breaking changes
|
|
66
|
-
npm run release:major
|
|
67
|
-
|
|
68
|
-
# Push the tag to trigger workflow
|
|
69
|
-
git push --follow-tags
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**What happens:**
|
|
73
|
-
1. Security audit runs (dependency audit + secret scanning)
|
|
74
|
-
2. All tests run
|
|
75
|
-
3. Package tarball created
|
|
76
|
-
4. GitHub Release published with tarball attached
|
|
77
|
-
5. npm package published to `@chappibunny/repolens`
|
|
78
|
-
|
|
79
|
-
See [RELEASE.md](./RELEASE.md) for detailed workflow.
|