@chappibunny/repolens 0.4.3 → 0.6.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 +131 -0
- package/README.md +414 -64
- package/package.json +16 -4
- package/src/ai/provider.js +48 -45
- package/src/cli.js +117 -9
- package/src/core/config-schema.js +43 -1
- package/src/core/config.js +20 -3
- package/src/core/scan.js +184 -3
- package/src/init.js +46 -4
- package/src/integrations/discord.js +261 -0
- package/src/migrate.js +7 -0
- package/src/publishers/confluence.js +428 -0
- package/src/publishers/index.js +112 -4
- package/src/publishers/notion.js +20 -16
- package/src/publishers/publish.js +1 -1
- package/src/renderers/render.js +32 -2
- package/src/utils/branch.js +32 -0
- package/src/utils/logger.js +21 -4
- package/src/utils/metrics.js +361 -0
- package/src/utils/rate-limit.js +289 -0
- package/src/utils/secrets.js +240 -0
- package/src/utils/telemetry.js +375 -0
- package/src/utils/validate.js +382 -0
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="Avatar.png" alt="RepoLens" width="120" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
1
5
|
```
|
|
2
6
|
██████╗ ███████╗██████╗ ██████╗ ██╗ ███████╗███╗ ██╗███████╗
|
|
3
7
|
██╔══██╗██╔════╝██╔══██╗██╔═══██╗██║ ██╔════╝████╗ ██║██╔════╝
|
|
@@ -8,9 +12,15 @@
|
|
|
8
12
|
🔍 Repository Intelligence CLI 📊
|
|
9
13
|
```
|
|
10
14
|
|
|
15
|
+
[](https://github.com/CHAPIBUNNY/repolens/actions)
|
|
16
|
+
[](SECURITY.md)
|
|
17
|
+
[](SECURITY.md)
|
|
18
|
+
[](LICENSE)
|
|
19
|
+
[](SECURITY.md)
|
|
20
|
+
|
|
11
21
|
AI-assisted documentation intelligence system that generates architecture docs for engineers AND readable system docs for stakeholders
|
|
12
22
|
|
|
13
|
-
**Current Status**: v0.
|
|
23
|
+
**Current Status**: v0.6.1 — Confluence Publisher & Team Features
|
|
14
24
|
|
|
15
25
|
RepoLens automatically generates and maintains living architecture documentation by analyzing your repository structure, extracting meaningful insights from your package.json, and creating visual dependency graphs. Run it once, or let it auto-update on every push.
|
|
16
26
|
|
|
@@ -22,7 +32,7 @@ RepoLens automatically generates and maintains living architecture documentation
|
|
|
22
32
|
|
|
23
33
|
**Step 1: Install**
|
|
24
34
|
```bash
|
|
25
|
-
npm install
|
|
35
|
+
npm install @chappibunny/repolens
|
|
26
36
|
```
|
|
27
37
|
|
|
28
38
|
**Step 2: Initialize** (creates config + GitHub Actions workflow)
|
|
@@ -30,19 +40,30 @@ npm install github:CHAPIBUNNY/repolens
|
|
|
30
40
|
npx @chappibunny/repolens init
|
|
31
41
|
```
|
|
32
42
|
|
|
33
|
-
**Step 3: Configure
|
|
43
|
+
**Step 3: Configure Publishing** (optional, skip if using Markdown only)
|
|
44
|
+
|
|
45
|
+
For Notion:
|
|
34
46
|
```bash
|
|
35
47
|
# Edit .env and add:
|
|
36
48
|
NOTION_TOKEN=secret_xxx
|
|
37
49
|
NOTION_PARENT_PAGE_ID=xxx
|
|
38
50
|
```
|
|
39
51
|
|
|
52
|
+
For Confluence:
|
|
53
|
+
```bash
|
|
54
|
+
# Edit .env and add:
|
|
55
|
+
CONFLUENCE_URL=https://your-company.atlassian.net/wiki
|
|
56
|
+
CONFLUENCE_EMAIL=trades@rabitaitrades.com
|
|
57
|
+
CONFLUENCE_API_TOKEN=your-token
|
|
58
|
+
CONFLUENCE_SPACE_KEY=DOCS
|
|
59
|
+
```
|
|
60
|
+
|
|
40
61
|
**Step 4: Publish**
|
|
41
62
|
```bash
|
|
42
63
|
npx @chappibunny/repolens publish
|
|
43
64
|
```
|
|
44
65
|
|
|
45
|
-
**Done!** Your docs are now live in Notion and/or `.repolens/` directory.
|
|
66
|
+
**Done!** Your docs are now live in Notion, Confluence, and/or `.repolens/` directory.
|
|
46
67
|
|
|
47
68
|
**🔄 Upgrading from v0.3.0 or earlier?**
|
|
48
69
|
Run `npx @chappibunny/repolens migrate` to automatically update your workflow files. See [MIGRATION.md](MIGRATION.md) for details.
|
|
@@ -107,53 +128,103 @@ RepoLens automatically detects:
|
|
|
107
128
|
✅ **Deterministic Fallback** - Always generates docs even if AI unavailable
|
|
108
129
|
✅ **Business Domain Inference** - Automatically maps code to business functions
|
|
109
130
|
✅ **Data Flow Analysis** - Understands how information moves through your system
|
|
110
|
-
✅ **Multiple Publishers** - Output to Notion, Markdown, or
|
|
131
|
+
✅ **Multiple Publishers** - Output to Notion, Confluence, Markdown, or all three
|
|
111
132
|
✅ **Branch-Aware** - Prevent doc conflicts across branches
|
|
112
133
|
✅ **GitHub Actions** - Autonomous operation on every push
|
|
134
|
+
✅ **Team Notifications** - Discord integration with rich embeds (NEW in v0.6.0)
|
|
135
|
+
✅ **Health Score Tracking** - Monitor documentation quality over time (NEW in v0.6.0)
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 👥 Team Features (New in v0.6.0)
|
|
140
|
+
|
|
141
|
+
### 💬 Discord Notifications
|
|
142
|
+
|
|
143
|
+
Get notified when documentation changes significantly:
|
|
144
|
+
|
|
145
|
+
**Features:**
|
|
146
|
+
- Rich embeds with coverage, health score, and change percentage
|
|
147
|
+
- Threshold-based notifications (only for significant changes)
|
|
148
|
+
- Branch filtering with glob pattern support
|
|
149
|
+
- Secure webhook configuration via environment variable
|
|
150
|
+
|
|
151
|
+
**Setup Discord Notifications:**
|
|
152
|
+
|
|
153
|
+
1. **Create a webhook** in your Discord server:
|
|
154
|
+
- Server Settings → Integrations → Webhooks → New Webhook
|
|
155
|
+
- Copy the webhook URL
|
|
156
|
+
|
|
157
|
+
2. **Add to environment**:
|
|
158
|
+
```bash
|
|
159
|
+
# .env (never commit!)
|
|
160
|
+
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/xxx/xxx
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
3. **Configure in `.repolens.yml`** (optional):
|
|
164
|
+
```yaml
|
|
165
|
+
discord:
|
|
166
|
+
enabled: true # Default: true (if webhook configured)
|
|
167
|
+
notifyOn: significant # Options: always, significant, never
|
|
168
|
+
significantThreshold: 10 # Notify if change >10% (default)
|
|
169
|
+
branches: # Which branches to notify (default: all)
|
|
170
|
+
- main
|
|
171
|
+
- develop
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
4. **Add GitHub Actions secret** (for CI/CD):
|
|
175
|
+
- Repo Settings → Secrets and variables → Actions
|
|
176
|
+
- New repository secret: `DISCORD_WEBHOOK_URL`
|
|
177
|
+
|
|
178
|
+
**Notification includes:**
|
|
179
|
+
- Branch and commit information
|
|
180
|
+
- Files scanned and modules analyzed
|
|
181
|
+
- Coverage percentage and health score
|
|
182
|
+
- Change percentage from previous run
|
|
183
|
+
- Direct links to Notion and GitHub documentation
|
|
113
184
|
|
|
114
185
|
---
|
|
115
186
|
|
|
116
187
|
## 📦 Installation
|
|
117
188
|
|
|
118
|
-
### Recommended:
|
|
189
|
+
### Recommended: npm Registry
|
|
119
190
|
|
|
120
191
|
```bash
|
|
121
|
-
npm install
|
|
192
|
+
npm install @chappibunny/repolens
|
|
122
193
|
```
|
|
123
194
|
|
|
124
|
-
|
|
195
|
+
Installs from npm registry.
|
|
125
196
|
|
|
126
197
|
### Alternative Methods
|
|
127
198
|
|
|
128
199
|
<details>
|
|
129
|
-
<summary><b>Option B:
|
|
200
|
+
<summary><b>Option B: GitHub Direct Install</b></summary>
|
|
130
201
|
|
|
131
|
-
|
|
202
|
+
Install from the latest GitHub commit:
|
|
132
203
|
|
|
133
204
|
```bash
|
|
134
|
-
|
|
135
|
-
cd repolens
|
|
136
|
-
npm link
|
|
205
|
+
npm install github:CHAPIBUNNY/repolens
|
|
137
206
|
```
|
|
138
207
|
</details>
|
|
139
208
|
|
|
140
209
|
<details>
|
|
141
|
-
<summary><b>Option C:
|
|
210
|
+
<summary><b>Option C: Local Development</b></summary>
|
|
142
211
|
|
|
143
|
-
|
|
212
|
+
Clone and link for development:
|
|
144
213
|
|
|
145
214
|
```bash
|
|
146
|
-
|
|
215
|
+
git clone https://github.com/CHAPIBUNNY/repolens.git
|
|
216
|
+
cd repolens
|
|
217
|
+
npm link
|
|
147
218
|
```
|
|
148
219
|
</details>
|
|
149
220
|
|
|
150
221
|
<details>
|
|
151
|
-
<summary><b>Option D:
|
|
222
|
+
<summary><b>Option D: GitHub Release Tarball</b></summary>
|
|
152
223
|
|
|
153
|
-
|
|
224
|
+
Install from a specific version:
|
|
154
225
|
|
|
155
226
|
```bash
|
|
156
|
-
npm install -
|
|
227
|
+
npm install https://github.com/CHAPIBUNNY/repolens/releases/download/v0.6.1/chappibunny-repolens-0.6.1.tgz
|
|
157
228
|
```
|
|
158
229
|
</details>
|
|
159
230
|
|
|
@@ -187,8 +258,9 @@ Open `.repolens.yml` and verify the `publishers` section:
|
|
|
187
258
|
|
|
188
259
|
```yaml
|
|
189
260
|
publishers:
|
|
190
|
-
- markdown
|
|
191
|
-
- notion
|
|
261
|
+
- markdown # Always works, no setup needed
|
|
262
|
+
- notion # Requires NOTION_TOKEN and NOTION_PARENT_PAGE_ID
|
|
263
|
+
- confluence # Requires CONFLUENCE_URL, CONFLUENCE_EMAIL, CONFLUENCE_API_TOKEN, CONFLUENCE_SPACE_KEY
|
|
192
264
|
```
|
|
193
265
|
|
|
194
266
|
**Markdown Only** (simplest):
|
|
@@ -196,6 +268,18 @@ publishers:
|
|
|
196
268
|
publishers:
|
|
197
269
|
- markdown
|
|
198
270
|
```
|
|
271
|
+
|
|
272
|
+
**Notion Only**:
|
|
273
|
+
```yaml
|
|
274
|
+
publishers:
|
|
275
|
+
- notion
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**Confluence Only**:
|
|
279
|
+
```yaml
|
|
280
|
+
publishers:
|
|
281
|
+
- confluence
|
|
282
|
+
```
|
|
199
283
|
Documentation lands in `.repolens/` directory. Commit these files or ignore them.
|
|
200
284
|
|
|
201
285
|
**Notion + Markdown** (recommended):
|
|
@@ -206,6 +290,23 @@ publishers:
|
|
|
206
290
|
```
|
|
207
291
|
Docs published to Notion for team visibility, plus local Markdown backups.
|
|
208
292
|
|
|
293
|
+
**Confluence + Markdown**:
|
|
294
|
+
```yaml
|
|
295
|
+
publishers:
|
|
296
|
+
- confluence
|
|
297
|
+
- markdown
|
|
298
|
+
```
|
|
299
|
+
Docs published to Confluence for enterprise teams, plus local Markdown backups.
|
|
300
|
+
|
|
301
|
+
**All Three**:
|
|
302
|
+
```yaml
|
|
303
|
+
publishers:
|
|
304
|
+
- notion
|
|
305
|
+
- confluence
|
|
306
|
+
- markdown
|
|
307
|
+
```
|
|
308
|
+
Maximum visibility: Notion for async collaboration, Confluence for enterprise docs, Markdown for local backups.
|
|
309
|
+
|
|
209
310
|
### Step 3: Enable AI Features (Optional)
|
|
210
311
|
|
|
211
312
|
**AI-enhanced documentation adds natural language explanations for non-technical audiences.**
|
|
@@ -296,15 +397,82 @@ Add as repository secrets:
|
|
|
296
397
|
- Name: `NOTION_TOKEN`, Value: `secret_xxxxx`
|
|
297
398
|
- Name: `NOTION_PARENT_PAGE_ID`, Value: `xxxxxx`
|
|
298
399
|
|
|
400
|
+
### Step 4a: Set Up Confluence Integration (Optional)
|
|
401
|
+
|
|
402
|
+
If using the Confluence publisher:
|
|
403
|
+
|
|
404
|
+
**4a.1: Generate Confluence API Token**
|
|
405
|
+
1. Go to [id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens)
|
|
406
|
+
2. Click **"Create API token"**
|
|
407
|
+
3. Name it **"RepoLens"**
|
|
408
|
+
4. Copy the generated token (save it securely - you won't see it again!)
|
|
409
|
+
|
|
410
|
+
**4a.2: Find Your Space Key**
|
|
411
|
+
1. Navigate to your Confluence space
|
|
412
|
+
2. Go to **Space Settings** → **Space details**
|
|
413
|
+
3. Note the **Space Key** (e.g., `DOCS`, `ENG`, `TECH`)
|
|
414
|
+
|
|
415
|
+
**4a.3: Get Parent Page ID (Optional)**
|
|
416
|
+
1. Navigate to the page where you want RepoLens docs nested
|
|
417
|
+
2. Click **"..."** menu → **"Page information"**
|
|
418
|
+
3. Copy the page ID from the URL: `pageId=123456789`
|
|
419
|
+
4. If skipped, docs will be created at space root level
|
|
420
|
+
|
|
421
|
+
**4a.4: Add Environment Variables**
|
|
422
|
+
|
|
423
|
+
**For Local Development:**
|
|
424
|
+
Create `.env` in your project root:
|
|
425
|
+
```bash
|
|
426
|
+
CONFLUENCE_URL=https://your-company.atlassian.net/wiki
|
|
427
|
+
CONFLUENCE_EMAIL=trades@rabitaitrades.com
|
|
428
|
+
CONFLUENCE_API_TOKEN=your-api-token-here
|
|
429
|
+
CONFLUENCE_SPACE_KEY=DOCS
|
|
430
|
+
CONFLUENCE_PARENT_PAGE_ID=123456789 # Optional
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
**For Confluence Server/Data Center** (self-hosted):
|
|
434
|
+
```bash
|
|
435
|
+
CONFLUENCE_URL=https://confluence.yourcompany.com
|
|
436
|
+
CONFLUENCE_EMAIL=your-username # Use username instead of email
|
|
437
|
+
CONFLUENCE_API_TOKEN=your-personal-access-token
|
|
438
|
+
CONFLUENCE_SPACE_KEY=DOCS
|
|
439
|
+
CONFLUENCE_PARENT_PAGE_ID=123456789 # Optional
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
**For GitHub Actions:**
|
|
443
|
+
Add as repository secrets:
|
|
444
|
+
1. Go to your repo → **Settings** → **Secrets and variables** → **Actions**
|
|
445
|
+
2. Click **"New repository secret"**
|
|
446
|
+
3. Add:
|
|
447
|
+
- Name: `CONFLUENCE_URL`, Value: `https://your-company.atlassian.net/wiki`
|
|
448
|
+
- Name: `CONFLUENCE_EMAIL`, Value: `trades@rabitaitrades.com`
|
|
449
|
+
- Name: `CONFLUENCE_API_TOKEN`, Value: `your-token`
|
|
450
|
+
- Name: `CONFLUENCE_SPACE_KEY`, Value: `DOCS`
|
|
451
|
+
- Name: `CONFLUENCE_PARENT_PAGE_ID`, Value: `123456789` (optional)
|
|
452
|
+
|
|
453
|
+
**Confluence + Notion + Markdown** (all three!):
|
|
454
|
+
```yaml
|
|
455
|
+
publishers:
|
|
456
|
+
- markdown
|
|
457
|
+
- notion
|
|
458
|
+
- confluence
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
Docs published to both Notion and Confluence for maximum visibility!
|
|
462
|
+
|
|
299
463
|
### Step 5: Configure Branch Publishing (Recommended)
|
|
300
464
|
|
|
301
|
-
Prevent documentation conflicts by limiting which branches publish to Notion:
|
|
465
|
+
Prevent documentation conflicts by limiting which branches publish to Notion/Confluence:
|
|
302
466
|
|
|
303
467
|
```yaml
|
|
304
468
|
notion:
|
|
305
469
|
branches:
|
|
306
470
|
- main # Only main branch publishes
|
|
307
471
|
includeBranchInTitle: false # Clean titles (no [branch-name] suffix)
|
|
472
|
+
|
|
473
|
+
confluence:
|
|
474
|
+
branches:
|
|
475
|
+
- main # Only main branch publishes to Confluence
|
|
308
476
|
```
|
|
309
477
|
|
|
310
478
|
**Options:**
|
|
@@ -348,8 +516,8 @@ npx @chappibunny/repolens publish
|
|
|
348
516
|
|
|
349
517
|
**Expected output:**
|
|
350
518
|
```
|
|
351
|
-
RepoLens
|
|
352
|
-
|
|
519
|
+
RepoLens 🔍
|
|
520
|
+
────────────────────────────────────────────────────
|
|
353
521
|
[RepoLens] Using config: /path/to/.repolens.yml
|
|
354
522
|
[RepoLens] Loading configuration...
|
|
355
523
|
[RepoLens] Scanning repository...
|
|
@@ -373,7 +541,7 @@ ls .repolens/
|
|
|
373
541
|
# api_surface.md
|
|
374
542
|
# route_map.md
|
|
375
543
|
# system_map.md
|
|
376
|
-
#
|
|
544
|
+
# system_map.md
|
|
377
545
|
```
|
|
378
546
|
|
|
379
547
|
**Notion Output:**
|
|
@@ -443,7 +611,7 @@ Validates:
|
|
|
443
611
|
- ✅ Required config fields present
|
|
444
612
|
- ✅ Publishers configured correctly
|
|
445
613
|
- ✅ Scan patterns defined
|
|
446
|
-
- ✅
|
|
614
|
+
- ✅ Publisher configuration valid
|
|
447
615
|
|
|
448
616
|
### Migrate Workflows
|
|
449
617
|
|
|
@@ -547,6 +715,131 @@ When you open a pull request, RepoLens posts:
|
|
|
547
715
|
|
|
548
716
|
---
|
|
549
717
|
|
|
718
|
+
## 🔒 Privacy & Telemetry
|
|
719
|
+
|
|
720
|
+
RepoLens includes **opt-in** error tracking and usage telemetry to help improve reliability, understand adoption patterns, and prioritize features.
|
|
721
|
+
|
|
722
|
+
**Privacy First:**
|
|
723
|
+
- ✅ **Disabled by default** - telemetry is opt-in
|
|
724
|
+
- ✅ **No code collection** - your source code never leaves your machine
|
|
725
|
+
- ✅ **No secrets** - API keys and tokens are never sent
|
|
726
|
+
- ✅ **Anonymous** - no personal information or repository names
|
|
727
|
+
- ✅ **Transparent** - see exactly what data is collected
|
|
728
|
+
|
|
729
|
+
**To enable telemetry**, add to `.env`:
|
|
730
|
+
```bash
|
|
731
|
+
REPOLENS_TELEMETRY_ENABLED=true
|
|
732
|
+
```
|
|
733
|
+
|
|
734
|
+
**What's collected (when enabled):**
|
|
735
|
+
|
|
736
|
+
*Error Tracking (Phase 1):*
|
|
737
|
+
- Error messages and stack traces (for debugging)
|
|
738
|
+
- Command that failed (e.g., `publish`, `migrate`)
|
|
739
|
+
- Basic system info (Node version, platform)
|
|
740
|
+
|
|
741
|
+
*Usage Metrics (Phase 2):*
|
|
742
|
+
- Command execution times (scan, render, publish)
|
|
743
|
+
- Repository size (file count, module count)
|
|
744
|
+
- Feature usage (AI enabled, publishers used)
|
|
745
|
+
- Success/failure rates
|
|
746
|
+
|
|
747
|
+
**Why enable it?**
|
|
748
|
+
- 🐛 **Faster bug fixes** - issues you encounter are fixed proactively
|
|
749
|
+
- 📊 **Better features** - development focused on real-world usage
|
|
750
|
+
- ⚡ **Performance** - optimizations based on actual bottlenecks
|
|
751
|
+
- 🎯 **Prioritization** - roadmap guided by community needs
|
|
752
|
+
|
|
753
|
+
For full details and example data, see [TELEMETRY.md](TELEMETRY.md).
|
|
754
|
+
|
|
755
|
+
---
|
|
756
|
+
|
|
757
|
+
## 🛡️ Security
|
|
758
|
+
|
|
759
|
+
RepoLens implements **defense-in-depth** security to protect your credentials, code, and infrastructure.
|
|
760
|
+
|
|
761
|
+
### Security Architecture (Phase 3)
|
|
762
|
+
|
|
763
|
+
**Layer 1: Input Validation** (`src/utils/validate.js`)
|
|
764
|
+
- ✅ Schema validation with required field enforcement
|
|
765
|
+
- ✅ Injection attack detection (shell, command substitution)
|
|
766
|
+
- ✅ Directory traversal prevention (`..`, absolute paths, null bytes)
|
|
767
|
+
- ✅ Secret scanning in configuration files
|
|
768
|
+
- ✅ Circular reference protection (depth limit: 20 levels)
|
|
769
|
+
|
|
770
|
+
**Layer 2: Secret Detection** (`src/utils/secrets.js`)
|
|
771
|
+
- ✅ **15+ credential patterns**: OpenAI, GitHub, AWS, Notion, Generic API keys
|
|
772
|
+
- ✅ **Entropy-based detection**: High-entropy strings (Shannon entropy > 4.5)
|
|
773
|
+
- ✅ **Automatic sanitization**: All logger output, telemetry, error messages
|
|
774
|
+
- ✅ **Format**: `sk-abc123xyz` → `sk-ab***yz` (first 2 + last 2 chars visible)
|
|
775
|
+
|
|
776
|
+
**Layer 3: Rate Limiting** (`src/utils/rate-limit.js`)
|
|
777
|
+
- ✅ **Token bucket algorithm**: 3 requests/second for Notion & AI APIs
|
|
778
|
+
- ✅ **Exponential backoff**: Automatic retry with jitter (500ms → 1s → 2s)
|
|
779
|
+
- ✅ **Cost protection**: Prevents runaway API usage
|
|
780
|
+
- ✅ **Retryable errors**: 429, 500, 502, 503, 504, network timeouts
|
|
781
|
+
|
|
782
|
+
**Layer 4: Supply Chain Security**
|
|
783
|
+
- ✅ **Action pinning**: GitHub Actions pinned to commit SHAs (not tags)
|
|
784
|
+
- ✅ **Minimal permissions**: `contents: read` or `contents: write` only
|
|
785
|
+
- ✅ **Dependency audits**: CI/CD fails on critical/high vulnerabilities
|
|
786
|
+
- ✅ **npm audit**: 0 vulnerabilities in 519 dependencies
|
|
787
|
+
|
|
788
|
+
**Layer 5: Comprehensive Testing**
|
|
789
|
+
- ✅ **43 security tests**: Fuzzing, injection, boundary conditions
|
|
790
|
+
- ✅ **Attack vectors tested**: SQL, command, path, YAML, NoSQL, LDAP, XML
|
|
791
|
+
- ✅ **90 total tests**: 47 functional + 43 security (100% passing)
|
|
792
|
+
|
|
793
|
+
### Security Validation (Automatic)
|
|
794
|
+
|
|
795
|
+
```bash
|
|
796
|
+
# Every configuration load:
|
|
797
|
+
✅ No injection patterns detected (;|&`$())
|
|
798
|
+
✅ No secrets in configuration files
|
|
799
|
+
✅ Safe path patterns only (no .. or absolute paths)
|
|
800
|
+
✅ Valid schema (configVersion: 1)
|
|
801
|
+
|
|
802
|
+
# Every runtime operation:
|
|
803
|
+
✅ All logs sanitized (secrets redacted)
|
|
804
|
+
✅ Telemetry sanitized (no credentials sent)
|
|
805
|
+
✅ Rate limiting active (3 req/sec)
|
|
806
|
+
✅ Type validation active (prevents type confusion)
|
|
807
|
+
|
|
808
|
+
# Every CI/CD run:
|
|
809
|
+
✅ npm audit passing (0 vulnerabilities)
|
|
810
|
+
✅ Security tests passing (43/43)
|
|
811
|
+
✅ Secrets scanner passing (no hardcoded credentials)
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
### Vulnerability Reporting
|
|
815
|
+
|
|
816
|
+
- 📧 **Email**: trades@rabitaitrades.com
|
|
817
|
+
- 🚨 **DO NOT** open public issues for security bugs
|
|
818
|
+
- ⏱️ **Response**: Within 48 hours
|
|
819
|
+
- 🔒 **Fix Timeline**: Critical issues within 7 days, others within 30 days
|
|
820
|
+
- 📢 **Disclosure**: Coordinated disclosure after fix is released
|
|
821
|
+
|
|
822
|
+
### Security Best Practices
|
|
823
|
+
|
|
824
|
+
**✅ DO:**
|
|
825
|
+
- Store secrets in GitHub Secrets (not `.repolens.yml`)
|
|
826
|
+
- Use environment variables for sensitive data
|
|
827
|
+
- Review generated documentation before publishing
|
|
828
|
+
- Enable telemetry to catch security issues early
|
|
829
|
+
- Run `npm audit` regularly
|
|
830
|
+
- Pin workflows to specific versions
|
|
831
|
+
|
|
832
|
+
**❌ DON'T:**
|
|
833
|
+
- Commit API keys to version control
|
|
834
|
+
- Share `.env` files publicly
|
|
835
|
+
- Disable security validation
|
|
836
|
+
- Use overly broad scan patterns (`**/*`)
|
|
837
|
+
- Ignore security warnings
|
|
838
|
+
|
|
839
|
+
For complete security documentation and threat model, see [SECURITY.md](SECURITY.md).
|
|
840
|
+
|
|
841
|
+
---
|
|
842
|
+
|
|
550
843
|
## ⚙️ Configuration Reference
|
|
551
844
|
|
|
552
845
|
### Complete Example
|
|
@@ -561,6 +854,7 @@ project:
|
|
|
561
854
|
# Configure output destinations
|
|
562
855
|
publishers:
|
|
563
856
|
- notion
|
|
857
|
+
- confluence
|
|
564
858
|
- markdown
|
|
565
859
|
|
|
566
860
|
# Notion-specific settings (optional)
|
|
@@ -571,6 +865,20 @@ notion:
|
|
|
571
865
|
- release/* # Glob patterns supported
|
|
572
866
|
includeBranchInTitle: false # Clean titles without [branch-name]
|
|
573
867
|
|
|
868
|
+
# Confluence-specific settings (optional)
|
|
869
|
+
confluence:
|
|
870
|
+
branches:
|
|
871
|
+
- main # Only main branch publishes to Confluence
|
|
872
|
+
|
|
873
|
+
# Discord notifications (optional, new in v0.6.0)
|
|
874
|
+
discord:
|
|
875
|
+
enabled: true # Default: true (if DISCORD_WEBHOOK_URL set)
|
|
876
|
+
notifyOn: significant # Options: always, significant, never
|
|
877
|
+
significantThreshold: 10 # Notify if change >10% (default)
|
|
878
|
+
branches: # Which branches to notify (default: all)
|
|
879
|
+
- main
|
|
880
|
+
- develop
|
|
881
|
+
|
|
574
882
|
# GitHub integration (optional)
|
|
575
883
|
github:
|
|
576
884
|
owner: "your-username"
|
|
@@ -630,11 +938,16 @@ features:
|
|
|
630
938
|
| `configVersion` | number | No | Schema version (current: 1) for future migrations |
|
|
631
939
|
| `project.name` | string | Yes | Project name |
|
|
632
940
|
| `project.docs_title_prefix` | string | No | Prefix for documentation titles (default: project name) |
|
|
633
|
-
| `publishers` | array | Yes | Output targets: `notion`, `markdown` |
|
|
941
|
+
| `publishers` | array | Yes | Output targets: `notion`, `confluence`, `markdown` |
|
|
634
942
|
| `notion.branches` | array | No | Branch whitelist for Notion publishing. Supports globs. |
|
|
635
943
|
| `notion.includeBranchInTitle` | boolean | No | Add `[branch-name]` to titles (default: `true`) |
|
|
636
|
-
| `
|
|
637
|
-
| `
|
|
944
|
+
| `confluence.branches` | array | No | Branch whitelist for Confluence publishing. Supports globs. |
|
|
945
|
+
| `discord.enabled` | boolean | No | Enable Discord notifications (default: `true` if webhook set) |
|
|
946
|
+
| `discord.notifyOn` | string | No | Notification policy: `always`, `significant`, `never` (default: `significant`) |
|
|
947
|
+
| `discord.significantThreshold` | number | No | Change % threshold for notifications (default: `10`) |
|
|
948
|
+
| `discord.branches` | array | No | Branch filter for notifications. Supports globs. (default: all) |
|
|
949
|
+
| `github.owner` | string | No | GitHub org/username |
|
|
950
|
+
| `github.repo` | string | No | Repository name |
|
|
638
951
|
| `scan.include` | array | Yes | Glob patterns for files to scan |
|
|
639
952
|
| `scan.ignore` | array | Yes | Glob patterns to exclude |
|
|
640
953
|
| `module_roots` | array | No | Root directories for module detection |
|
|
@@ -653,6 +966,22 @@ Required for Notion publisher:
|
|
|
653
966
|
| `NOTION_PARENT_PAGE_ID` | Yes | Page ID where docs will be created |
|
|
654
967
|
| `NOTION_VERSION` | No | API version (default: `2022-06-28`) |
|
|
655
968
|
|
|
969
|
+
Required for Confluence publisher:
|
|
970
|
+
|
|
971
|
+
| Variable | Required | Description |
|
|
972
|
+
|----------|----------|-------------|
|
|
973
|
+
| `CONFLUENCE_URL` | Yes | Base URL (e.g., `https://your-company.atlassian.net/wiki`) |
|
|
974
|
+
| `CONFLUENCE_EMAIL` | Yes | Atlassian account email |
|
|
975
|
+
| `CONFLUENCE_API_TOKEN` | Yes | API token from [Atlassian](https://id.atlassian.com/manage-profile/security/api-tokens) |
|
|
976
|
+
| `CONFLUENCE_SPACE_KEY` | Yes | Target space key (e.g., `DOCS`, `ENG`) |
|
|
977
|
+
| `CONFLUENCE_PARENT_PAGE_ID` | No | Parent page ID (docs created at space root if omitted) |
|
|
978
|
+
|
|
979
|
+
Optional for Discord notifications:
|
|
980
|
+
|
|
981
|
+
| Variable | Required | Description |
|
|
982
|
+
|----------|----------|-------------|
|
|
983
|
+
| `DISCORD_WEBHOOK_URL` | No | Discord webhook URL for team notifications |
|
|
984
|
+
|
|
656
985
|
**Local Development:** Create `.env` file in project root
|
|
657
986
|
**GitHub Actions:** Add as repository secrets in Settings → Secrets and variables → Actions
|
|
658
987
|
|
|
@@ -666,8 +995,8 @@ Required for Notion publisher:
|
|
|
666
995
|
1. SCAN 2. ANALYZE 3. RENDER 4. PUBLISH
|
|
667
996
|
──────────────────────────────────────────────────────────────────
|
|
668
997
|
Read files → Detect tech → Generate docs → Notion pages
|
|
669
|
-
from patterns stack patterns with insights +
|
|
670
|
-
+
|
|
998
|
+
from patterns stack patterns with insights + Confluence pages
|
|
999
|
+
+ Markdown files
|
|
671
1000
|
```
|
|
672
1001
|
|
|
673
1002
|
**Scan Phase:**
|
|
@@ -691,8 +1020,7 @@ from patterns stack patterns with insights + Markdown files
|
|
|
691
1020
|
**Publish Phase:**
|
|
692
1021
|
- Markdown: Writes files to `.repolens/` directory
|
|
693
1022
|
- Notion: Creates/updates pages via API with retry logic
|
|
694
|
-
-
|
|
695
|
-
- Git: Commits diagrams back to repo for GitHub CDN hosting
|
|
1023
|
+
- Confluence: Creates/updates pages via REST API v1 (storage format)
|
|
696
1024
|
|
|
697
1025
|
### Module Dependency Detection
|
|
698
1026
|
|
|
@@ -738,7 +1066,7 @@ npm test
|
|
|
738
1066
|
- Integration workflows
|
|
739
1067
|
- Doctor command validation
|
|
740
1068
|
|
|
741
|
-
**Coverage:**
|
|
1069
|
+
**Coverage:** 90 tests passing across 11 test files
|
|
742
1070
|
|
|
743
1071
|
### Test Package Installation Locally
|
|
744
1072
|
|
|
@@ -749,7 +1077,7 @@ Simulates the full user installation experience:
|
|
|
749
1077
|
npm pack
|
|
750
1078
|
|
|
751
1079
|
# Install globally from tarball
|
|
752
|
-
npm install -g repolens-0.
|
|
1080
|
+
npm install -g chappibunny-repolens-0.6.1.tgz
|
|
753
1081
|
|
|
754
1082
|
# Verify
|
|
755
1083
|
repolens --version
|
|
@@ -765,28 +1093,49 @@ repolens/
|
|
|
765
1093
|
│ ├── cli.js # Command orchestration + banner
|
|
766
1094
|
│ ├── init.js # Scaffolding command
|
|
767
1095
|
│ ├── doctor.js # Validation command
|
|
1096
|
+
│ ├── migrate.js # Workflow migration (legacy → current)
|
|
768
1097
|
│ ├── core/
|
|
769
1098
|
│ │ ├── config.js # Config loading + validation
|
|
770
1099
|
│ │ ├── config-schema.js # Schema version tracking
|
|
771
1100
|
│ │ ├── diff.js # Git diff operations
|
|
772
1101
|
│ │ └── scan.js # Repository scanning + metadata extraction
|
|
1102
|
+
│ ├── analyzers/
|
|
1103
|
+
│ │ ├── domain-inference.js # Business domain mapping
|
|
1104
|
+
│ │ ├── context-builder.js # Structured AI context assembly
|
|
1105
|
+
│ │ └── flow-inference.js # Data flow detection
|
|
1106
|
+
│ ├── ai/
|
|
1107
|
+
│ │ ├── provider.js # Provider-agnostic AI generation
|
|
1108
|
+
│ │ ├── prompts.js # Strict prompt templates
|
|
1109
|
+
│ │ ├── document-plan.js # Document structure definition
|
|
1110
|
+
│ │ └── generate-sections.js # AI section generation + fallbacks
|
|
1111
|
+
│ ├── docs/
|
|
1112
|
+
│ │ ├── generate-doc-set.js # Document generation orchestration
|
|
1113
|
+
│ │ └── write-doc-set.js # Write docs to disk
|
|
773
1114
|
│ ├── renderers/
|
|
774
1115
|
│ │ ├── render.js # System overview, catalog, API, routes
|
|
775
1116
|
│ │ ├── renderDiff.js # Architecture diff rendering
|
|
776
|
-
│ │ └── renderMap.js #
|
|
1117
|
+
│ │ └── renderMap.js # Unicode dependency diagrams
|
|
777
1118
|
│ ├── publishers/
|
|
778
1119
|
│ │ ├── index.js # Publisher orchestration + branch filtering
|
|
779
|
-
│ │ ├── publish.js #
|
|
1120
|
+
│ │ ├── publish.js # Publishing pipeline
|
|
780
1121
|
│ │ ├── notion.js # Notion API integration
|
|
1122
|
+
│ │ ├── confluence.js # Confluence REST API integration
|
|
781
1123
|
│ │ └── markdown.js # Local Markdown generation
|
|
1124
|
+
│ ├── integrations/
|
|
1125
|
+
│ │ └── discord.js # Discord webhook notifications
|
|
782
1126
|
│ ├── delivery/
|
|
783
1127
|
│ │ └── comment.js # PR comment delivery
|
|
784
1128
|
│ └── utils/
|
|
785
1129
|
│ ├── logger.js # Logging utilities
|
|
786
|
-
│ ├── retry.js # API retry logic
|
|
1130
|
+
│ ├── retry.js # API retry logic (exponential backoff)
|
|
787
1131
|
│ ├── branch.js # Branch detection (multi-platform)
|
|
788
|
-
│
|
|
789
|
-
├──
|
|
1132
|
+
│ ├── validate.js # Configuration validation & security
|
|
1133
|
+
│ ├── metrics.js # Documentation coverage & health scoring
|
|
1134
|
+
│ ├── rate-limit.js # Token bucket rate limiter for APIs
|
|
1135
|
+
│ ├── secrets.js # Secret detection & sanitization
|
|
1136
|
+
│ ├── telemetry.js # Opt-in error tracking (Sentry)
|
|
1137
|
+
│ └── update-check.js # Version update notifications
|
|
1138
|
+
├── tests/ # Vitest test suite (90 tests across 11 files)
|
|
790
1139
|
├── .repolens.yml # Dogfooding config
|
|
791
1140
|
├── package.json
|
|
792
1141
|
├── CHANGELOG.md
|
|
@@ -803,13 +1152,13 @@ RepoLens uses automated GitHub Actions releases.
|
|
|
803
1152
|
### Creating a Release
|
|
804
1153
|
|
|
805
1154
|
```bash
|
|
806
|
-
# Patch version (0.
|
|
1155
|
+
# Patch version (0.6.1 → 0.6.2) - Bug fixes
|
|
807
1156
|
npm run release:patch
|
|
808
1157
|
|
|
809
|
-
# Minor version (0.
|
|
1158
|
+
# Minor version (0.6.1 → 0.7.0) - New features
|
|
810
1159
|
npm run release:minor
|
|
811
1160
|
|
|
812
|
-
# Major version (0.
|
|
1161
|
+
# Major version (0.6.1 → 1.0.0) - Breaking changes
|
|
813
1162
|
npm run release:major
|
|
814
1163
|
|
|
815
1164
|
# Push the tag to trigger workflow
|
|
@@ -817,10 +1166,11 @@ git push --follow-tags
|
|
|
817
1166
|
```
|
|
818
1167
|
|
|
819
1168
|
**What happens:**
|
|
820
|
-
1. ✅
|
|
821
|
-
2. ✅
|
|
822
|
-
3. ✅
|
|
823
|
-
4. ✅
|
|
1169
|
+
1. ✅ Security audit runs (dependency audit + secret scanning)
|
|
1170
|
+
2. ✅ All tests run
|
|
1171
|
+
3. ✅ Package tarball created
|
|
1172
|
+
4. ✅ GitHub Release published with tarball attached
|
|
1173
|
+
5. ✅ npm package published to `@chappibunny/repolens`
|
|
824
1174
|
|
|
825
1175
|
See [RELEASE.md](./RELEASE.md) for detailed workflow.
|
|
826
1176
|
|
|
@@ -840,30 +1190,30 @@ RepoLens is currently in early access. v1.0 will open for community contribution
|
|
|
840
1190
|
|
|
841
1191
|
## 🗺️ Roadmap to v1.0
|
|
842
1192
|
|
|
843
|
-
**Current Status:** v0.
|
|
1193
|
+
**Current Status:** v0.6.1 — Confluence Publisher & Team Features
|
|
844
1194
|
|
|
845
1195
|
### Completed ✅
|
|
846
1196
|
|
|
847
|
-
- [x] CLI commands: `init`, `doctor`, `publish`, `version`, `help`
|
|
1197
|
+
- [x] CLI commands: `init`, `doctor`, `publish`, `migrate`, `version`, `help`
|
|
848
1198
|
- [x] Config schema v1 with validation
|
|
849
1199
|
- [x] Auto-discovery of `.repolens.yml`
|
|
850
|
-
- [x] Publishers: Notion + Markdown
|
|
1200
|
+
- [x] Publishers: Notion + Confluence + Markdown
|
|
851
1201
|
- [x] Branch-aware publishing with filtering
|
|
852
1202
|
- [x] Smart tech stack detection from package.json
|
|
853
|
-
- [x]
|
|
854
|
-
- [x]
|
|
855
|
-
- [x]
|
|
1203
|
+
- [x] Unicode dependency diagrams (no external deps)
|
|
1204
|
+
- [x] AI-assisted documentation intelligence (provider-agnostic)
|
|
1205
|
+
- [x] Business domain inference & data flow analysis
|
|
1206
|
+
- [x] GitHub Actions automation (publish + release)
|
|
856
1207
|
- [x] PR architecture diff comments
|
|
857
1208
|
- [x] Performance guardrails (10k warning, 50k limit)
|
|
858
|
-
- [x] Comprehensive test suite (
|
|
859
|
-
- [x]
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
- [
|
|
864
|
-
- [
|
|
865
|
-
- [
|
|
866
|
-
- [ ] Additional framework detection (Remix, SvelteKit, Astro)
|
|
1209
|
+
- [x] Comprehensive test suite (90 tests across 11 files)
|
|
1210
|
+
- [x] Security hardening (secret detection, injection prevention, fuzzing)
|
|
1211
|
+
- [x] Discord notifications with rich embeds
|
|
1212
|
+
- [x] Documentation coverage & health scoring
|
|
1213
|
+
- [x] Opt-in telemetry (Sentry)
|
|
1214
|
+
- [x] npm registry publication (`@chappibunny/repolens`)
|
|
1215
|
+
- [x] Automated npm releases via GitHub Actions
|
|
1216
|
+
- [x] Workflow migration command (`repolens migrate`)
|
|
867
1217
|
|
|
868
1218
|
### Planned for v1.0 🎯
|
|
869
1219
|
|
|
@@ -872,7 +1222,7 @@ RepoLens is currently in early access. v1.0 will open for community contribution
|
|
|
872
1222
|
- [ ] TypeScript type graph analysis
|
|
873
1223
|
- [ ] Interactive configuration wizard
|
|
874
1224
|
- [ ] Watch mode for local development
|
|
875
|
-
- [ ]
|
|
1225
|
+
- [ ] Additional publishers (GitHub Wiki, Obsidian)
|
|
876
1226
|
|
|
877
1227
|
See [ROADMAP.md](./ROADMAP.md) for detailed planning.
|
|
878
1228
|
|
|
@@ -894,6 +1244,6 @@ MIT
|
|
|
894
1244
|
|
|
895
1245
|
<div align="center">
|
|
896
1246
|
|
|
897
|
-
**Made with
|
|
1247
|
+
**Made with ❤️ by RepoLens for developers who care about architecture**
|
|
898
1248
|
|
|
899
1249
|
</div>
|