oh-my-claude-sisyphus 3.4.0 → 3.4.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.
Files changed (104) hide show
  1. package/README.md +71 -5
  2. package/commands/cancel-ecomode.md +71 -0
  3. package/commands/cancel.md +75 -0
  4. package/commands/pipeline.md +231 -0
  5. package/commands/planner.md +174 -0
  6. package/commands/swarm.md +280 -0
  7. package/dist/analytics/cost-estimator.d.ts +14 -0
  8. package/dist/analytics/cost-estimator.d.ts.map +1 -0
  9. package/dist/analytics/cost-estimator.js +70 -0
  10. package/dist/analytics/cost-estimator.js.map +1 -0
  11. package/dist/analytics/export.d.ts +7 -0
  12. package/dist/analytics/export.d.ts.map +1 -0
  13. package/dist/analytics/export.js +93 -0
  14. package/dist/analytics/export.js.map +1 -0
  15. package/dist/analytics/index.d.ts +14 -0
  16. package/dist/analytics/index.d.ts.map +1 -0
  17. package/dist/analytics/index.js +14 -0
  18. package/dist/analytics/index.js.map +1 -0
  19. package/dist/analytics/metrics-collector.d.ts +30 -0
  20. package/dist/analytics/metrics-collector.d.ts.map +1 -0
  21. package/dist/analytics/metrics-collector.js +96 -0
  22. package/dist/analytics/metrics-collector.js.map +1 -0
  23. package/dist/analytics/query-engine.d.ts +32 -0
  24. package/dist/analytics/query-engine.d.ts.map +1 -0
  25. package/dist/analytics/query-engine.js +151 -0
  26. package/dist/analytics/query-engine.js.map +1 -0
  27. package/dist/analytics/session-manager.d.ts +26 -0
  28. package/dist/analytics/session-manager.d.ts.map +1 -0
  29. package/dist/analytics/session-manager.js +201 -0
  30. package/dist/analytics/session-manager.js.map +1 -0
  31. package/dist/analytics/session-types.d.ts +37 -0
  32. package/dist/analytics/session-types.d.ts.map +1 -0
  33. package/dist/analytics/session-types.js +2 -0
  34. package/dist/analytics/session-types.js.map +1 -0
  35. package/dist/analytics/token-tracker.d.ts +24 -0
  36. package/dist/analytics/token-tracker.d.ts.map +1 -0
  37. package/dist/analytics/token-tracker.js +161 -0
  38. package/dist/analytics/token-tracker.js.map +1 -0
  39. package/dist/analytics/types.d.ts +37 -0
  40. package/dist/analytics/types.d.ts.map +1 -0
  41. package/dist/analytics/types.js +21 -0
  42. package/dist/analytics/types.js.map +1 -0
  43. package/dist/cli/analytics.d.ts +3 -0
  44. package/dist/cli/analytics.d.ts.map +1 -0
  45. package/dist/cli/analytics.js +74 -0
  46. package/dist/cli/analytics.js.map +1 -0
  47. package/dist/cli/commands/agents.d.ts +5 -0
  48. package/dist/cli/commands/agents.d.ts.map +1 -0
  49. package/dist/cli/commands/agents.js +29 -0
  50. package/dist/cli/commands/agents.js.map +1 -0
  51. package/dist/cli/commands/cleanup.d.ts +4 -0
  52. package/dist/cli/commands/cleanup.d.ts.map +1 -0
  53. package/dist/cli/commands/cleanup.js +17 -0
  54. package/dist/cli/commands/cleanup.js.map +1 -0
  55. package/dist/cli/commands/cost.d.ts +4 -0
  56. package/dist/cli/commands/cost.d.ts.map +1 -0
  57. package/dist/cli/commands/cost.js +53 -0
  58. package/dist/cli/commands/cost.js.map +1 -0
  59. package/dist/cli/commands/export.d.ts +5 -0
  60. package/dist/cli/commands/export.d.ts.map +1 -0
  61. package/dist/cli/commands/export.js +30 -0
  62. package/dist/cli/commands/export.js.map +1 -0
  63. package/dist/cli/commands/sessions.d.ts +5 -0
  64. package/dist/cli/commands/sessions.d.ts.map +1 -0
  65. package/dist/cli/commands/sessions.js +37 -0
  66. package/dist/cli/commands/sessions.js.map +1 -0
  67. package/dist/cli/commands/stats.d.ts +4 -0
  68. package/dist/cli/commands/stats.d.ts.map +1 -0
  69. package/dist/cli/commands/stats.js +43 -0
  70. package/dist/cli/commands/stats.js.map +1 -0
  71. package/dist/cli/utils/formatting.d.ts +22 -0
  72. package/dist/cli/utils/formatting.d.ts.map +1 -0
  73. package/dist/cli/utils/formatting.js +70 -0
  74. package/dist/cli/utils/formatting.js.map +1 -0
  75. package/dist/hud/analytics-display.d.ts +28 -0
  76. package/dist/hud/analytics-display.d.ts.map +1 -0
  77. package/dist/hud/analytics-display.js +105 -0
  78. package/dist/hud/analytics-display.js.map +1 -0
  79. package/dist/hud/background-cleanup.d.ts +28 -0
  80. package/dist/hud/background-cleanup.d.ts.map +1 -0
  81. package/dist/hud/background-cleanup.js +92 -0
  82. package/dist/hud/background-cleanup.js.map +1 -0
  83. package/dist/hud/index.js +4 -2
  84. package/dist/hud/index.js.map +1 -1
  85. package/dist/hud/render.d.ts +1 -1
  86. package/dist/hud/render.d.ts.map +1 -1
  87. package/dist/hud/render.js +32 -1
  88. package/dist/hud/render.js.map +1 -1
  89. package/dist/hud/state.d.ts +5 -0
  90. package/dist/hud/state.d.ts.map +1 -1
  91. package/dist/hud/state.js +13 -0
  92. package/dist/hud/state.js.map +1 -1
  93. package/dist/hud/types.d.ts +11 -1
  94. package/dist/hud/types.d.ts.map +1 -1
  95. package/dist/hud/types.js +19 -0
  96. package/dist/hud/types.js.map +1 -1
  97. package/docs/FULL-README.md +130 -16
  98. package/docs/MIGRATION.md +222 -1
  99. package/docs/SYNC-SYSTEM.md +528 -0
  100. package/package.json +8 -2
  101. package/scripts/sync-metadata.ts +363 -0
  102. package/skills/build-fix/SKILL.md +123 -0
  103. package/skills/code-review/SKILL.md +179 -0
  104. package/skills/security-review/SKILL.md +254 -0
@@ -0,0 +1,528 @@
1
+ # Metadata Sync System
2
+
3
+ ## Overview
4
+
5
+ The metadata sync system ensures consistency between `package.json` (source of truth) and all documentation files across the project. It prevents version drift, outdated badges, and manual update errors.
6
+
7
+ ## Why We Need This
8
+
9
+ ### The Problem
10
+
11
+ In a typical project lifecycle:
12
+
13
+ 1. Developer bumps version in `package.json` to `3.5.0`
14
+ 2. Creates a release commit
15
+ 3. **Forgets** to update version badge in `README.md` (still shows `3.4.0`)
16
+ 4. **Forgets** to update version header in `FULL-README.md`
17
+ 5. **Forgets** to update agent count in `.github/CLAUDE.md` after adding new agents
18
+ 6. Users see inconsistent version information across documentation
19
+ 7. CI builds look professional but contain stale metadata
20
+
21
+ **Result:** Confusion, reduced trust, unprofessional appearance.
22
+
23
+ ### The Solution
24
+
25
+ A single automated script that:
26
+ - Reads canonical metadata from `package.json`
27
+ - Updates all documentation files in one pass
28
+ - Can verify sync status (for CI/CD)
29
+ - Supports dry-run mode for safety
30
+ - Reports exactly what changed
31
+
32
+ ## How It Works
33
+
34
+ ### Source of Truth
35
+
36
+ `package.json` is the **single source of truth** for:
37
+
38
+ | Field | Used For |
39
+ |-------|----------|
40
+ | `version` | Version badges, headers, references |
41
+ | `name` | npm package links, download badges |
42
+ | `description` | Project taglines (future) |
43
+ | `keywords` | SEO metadata (future) |
44
+ | `repository.url` | GitHub links |
45
+ | `homepage` | Website links |
46
+
47
+ ### Target Files
48
+
49
+ The script syncs these files:
50
+
51
+ | File | What Gets Updated |
52
+ |------|-------------------|
53
+ | `README.md` | npm version/download badges |
54
+ | `docs/FULL-README.md` | Version badges, version headers |
55
+ | `.github/CLAUDE.md` | Agent count, skill count |
56
+ | `docs/ARCHITECTURE.md` | Version references |
57
+ | `CHANGELOG.md` | Latest version header (verify only) |
58
+
59
+ ### Dynamic Metadata
60
+
61
+ Some metadata is computed, not read:
62
+
63
+ - **Agent count** - Counts `.yaml`/`.yml` files in `agents/` directory
64
+ - **Skill count** - Counts `.md` files in `skills/` directory
65
+
66
+ This ensures documentation always reflects current state.
67
+
68
+ ## Usage
69
+
70
+ ### Basic Sync
71
+
72
+ ```bash
73
+ npm run sync-metadata
74
+ ```
75
+
76
+ Syncs all files. Output:
77
+ ```
78
+ 📦 Metadata Sync System
79
+ ========================
80
+
81
+ Version: 3.5.0
82
+ Package: oh-my-claude-sisyphus
83
+ Agents: 32
84
+ Skills: 45
85
+
86
+ ✓ README.md
87
+ - npm version badge
88
+
89
+ ✓ docs/FULL-README.md
90
+ - Version badge
91
+ - Version header
92
+
93
+ ✓ .github/CLAUDE.md
94
+ - Agent count
95
+ - Slash command count
96
+
97
+ ✅ Successfully synced 3 file(s)!
98
+ ```
99
+
100
+ ### Dry Run (Preview Changes)
101
+
102
+ ```bash
103
+ npm run sync-metadata -- --dry-run
104
+ ```
105
+
106
+ Shows what **would** change without writing files:
107
+
108
+ ```
109
+ 🔍 DRY RUN MODE - No files will be modified
110
+
111
+ 📝 README.md
112
+ - npm version badge
113
+
114
+ 📝 docs/FULL-README.md
115
+ - Version badge
116
+
117
+ 📊 2 file(s) would be updated
118
+ Run without --dry-run to apply changes
119
+ ```
120
+
121
+ ### Verify Sync (CI/CD)
122
+
123
+ ```bash
124
+ npm run sync-metadata -- --verify
125
+ ```
126
+
127
+ Checks if files are in sync. Exits with status code:
128
+ - `0` - All files in sync
129
+ - `1` - Files out of sync (shows which ones)
130
+
131
+ ```
132
+ 🔍 Verifying metadata sync...
133
+ ✓ README.md
134
+ ✗ docs/FULL-README.md
135
+ - Version badge needs update
136
+
137
+ ❌ Files are out of sync!
138
+ Run: npm run sync-metadata
139
+ ```
140
+
141
+ ### Help
142
+
143
+ ```bash
144
+ npm run sync-metadata -- --help
145
+ ```
146
+
147
+ ## When to Run
148
+
149
+ ### Manual Workflow
150
+
151
+ Run sync **before** committing version changes:
152
+
153
+ ```bash
154
+ # 1. Bump version
155
+ npm version patch
156
+
157
+ # 2. Sync metadata
158
+ npm run sync-metadata
159
+
160
+ # 3. Commit everything together
161
+ git add .
162
+ git commit -m "chore: release v3.5.0"
163
+ ```
164
+
165
+ ### Automated Workflow (Recommended)
166
+
167
+ Add to `package.json`:
168
+
169
+ ```json
170
+ {
171
+ "scripts": {
172
+ "version": "npm run sync-metadata && git add ."
173
+ }
174
+ }
175
+ ```
176
+
177
+ Now `npm version patch` automatically:
178
+ 1. Bumps version in `package.json`
179
+ 2. Runs sync script
180
+ 3. Stages synced files
181
+ 4. Creates version commit
182
+
183
+ ### Pre-Commit Hook
184
+
185
+ Add to `.husky/pre-commit`:
186
+
187
+ ```bash
188
+ #!/bin/sh
189
+ . "$(dirname "$0")/_/husky.sh"
190
+
191
+ # Verify metadata is in sync
192
+ npm run sync-metadata -- --verify
193
+
194
+ if [ $? -ne 0 ]; then
195
+ echo "❌ Metadata out of sync! Run: npm run sync-metadata"
196
+ exit 1
197
+ fi
198
+ ```
199
+
200
+ ### CI/CD Pipeline
201
+
202
+ Add verification step to GitHub Actions:
203
+
204
+ ```yaml
205
+ - name: Verify Metadata Sync
206
+ run: npm run sync-metadata -- --verify
207
+ ```
208
+
209
+ ## How to Extend
210
+
211
+ ### Adding a New Target File
212
+
213
+ Edit `scripts/sync-metadata.ts`:
214
+
215
+ ```typescript
216
+ function getFileSyncConfigs(): FileSync[] {
217
+ return [
218
+ // ... existing configs ...
219
+ {
220
+ path: 'docs/NEW-FILE.md',
221
+ replacements: [
222
+ {
223
+ pattern: /version \d+\.\d+\.\d+/gi,
224
+ replacement: (m) => `version ${m.version}`,
225
+ description: 'Version references',
226
+ },
227
+ {
228
+ pattern: /\*\*\d+ features\*\*/g,
229
+ replacement: (m) => `**${getFeatureCount()} features**`,
230
+ description: 'Feature count',
231
+ },
232
+ ],
233
+ },
234
+ ];
235
+ }
236
+ ```
237
+
238
+ ### Adding Dynamic Metadata
239
+
240
+ Add a new function:
241
+
242
+ ```typescript
243
+ function getFeatureCount(): number {
244
+ const featuresDir = join(projectRoot, 'features');
245
+ const files = readdirSync(featuresDir);
246
+ return files.filter(f => f.endsWith('.ts')).length;
247
+ }
248
+ ```
249
+
250
+ Use in replacement:
251
+
252
+ ```typescript
253
+ {
254
+ pattern: /\*\*\d+ features\*\*/g,
255
+ replacement: () => `**${getFeatureCount()} features**`,
256
+ description: 'Feature count',
257
+ }
258
+ ```
259
+
260
+ ### Adding New Metadata Sources
261
+
262
+ Extend the `Metadata` interface:
263
+
264
+ ```typescript
265
+ interface Metadata {
266
+ version: string;
267
+ description: string;
268
+ keywords: string[];
269
+ repository: string;
270
+ homepage: string;
271
+ npmPackage: string;
272
+ // NEW:
273
+ author: string;
274
+ license: string;
275
+ engines: { node: string };
276
+ }
277
+ ```
278
+
279
+ Update `loadMetadata()`:
280
+
281
+ ```typescript
282
+ function loadMetadata(): Metadata {
283
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
284
+
285
+ return {
286
+ // ... existing fields ...
287
+ author: packageJson.author || '',
288
+ license: packageJson.license || '',
289
+ engines: packageJson.engines || { node: '>=20.0.0' },
290
+ };
291
+ }
292
+ ```
293
+
294
+ ## Implementation Details
295
+
296
+ ### Safe Replacement Strategy
297
+
298
+ The script uses **regex-based replacement** with safeguards:
299
+
300
+ 1. **Read entire file** into memory
301
+ 2. **Apply all replacements** to string
302
+ 3. **Compare** original vs modified content
303
+ 4. **Only write** if content changed
304
+
305
+ This prevents:
306
+ - Unnecessary file writes (preserves timestamps)
307
+ - Partial updates (atomic operation)
308
+ - Permission errors (fails before write)
309
+
310
+ ### Pattern Design
311
+
312
+ Patterns are designed to be:
313
+
314
+ **Specific enough** to match only intended content:
315
+ ```typescript
316
+ // GOOD - matches only npm badge
317
+ /\[!\[npm version\]\(https:\/\/img\.shields\.io\/npm\/v\/[^)]+\)/g
318
+
319
+ // BAD - too broad, matches any badge
320
+ /\[!\[[^\]]+\]\([^)]+\)/g
321
+ ```
322
+
323
+ **Flexible enough** to handle variations:
324
+ ```typescript
325
+ // Matches: 3.4.0, 10.0.0, 2.1.3-beta
326
+ /\d+\.\d+\.\d+(-[a-z0-9]+)?/
327
+ ```
328
+
329
+ ### Error Handling
330
+
331
+ The script handles:
332
+
333
+ - **Missing files** - Warns but continues
334
+ - **Invalid package.json** - Fails fast with clear error
335
+ - **Permission errors** - Reports and exits
336
+ - **Regex failures** - Reports pattern that failed
337
+
338
+ ### Performance
339
+
340
+ For a typical project:
341
+ - **Files read:** 5-10
342
+ - **Execution time:** <100ms
343
+ - **Memory usage:** <10MB
344
+
345
+ Scales linearly with number of target files.
346
+
347
+ ## Testing
348
+
349
+ ### Manual Testing
350
+
351
+ ```bash
352
+ # 1. Make a change to package.json
353
+ npm version patch
354
+
355
+ # 2. Run dry-run to preview
356
+ npm run sync-metadata -- --dry-run
357
+
358
+ # 3. Apply changes
359
+ npm run sync-metadata
360
+
361
+ # 4. Verify with git
362
+ git diff
363
+ ```
364
+
365
+ ### Automated Testing
366
+
367
+ The script exports functions for testing:
368
+
369
+ ```typescript
370
+ import { loadMetadata, syncFile, verifySync } from './scripts/sync-metadata.js';
371
+
372
+ test('loads metadata correctly', () => {
373
+ const metadata = loadMetadata();
374
+ expect(metadata.version).toMatch(/^\d+\.\d+\.\d+$/);
375
+ });
376
+
377
+ test('syncs README badges', () => {
378
+ const config = getFileSyncConfigs().find(c => c.path === 'README.md');
379
+ const result = syncFile(config, mockMetadata, true, projectRoot);
380
+ expect(result.changed).toBe(true);
381
+ });
382
+ ```
383
+
384
+ ## Troubleshooting
385
+
386
+ ### "File not found" warnings
387
+
388
+ **Symptom:** Script reports files as not found.
389
+
390
+ **Cause:** File moved or deleted.
391
+
392
+ **Fix:** Remove from `getFileSyncConfigs()` or update path.
393
+
394
+ ### "No changes detected" but files are stale
395
+
396
+ **Symptom:** Script reports no changes, but files show old version.
397
+
398
+ **Cause:** Pattern doesn't match current file format.
399
+
400
+ **Fix:** Update regex pattern to match actual content.
401
+
402
+ ### Version updated but badge still old
403
+
404
+ **Symptom:** package.json has new version, badge unchanged.
405
+
406
+ **Cause:** Badge may be cached by shields.io CDN.
407
+
408
+ **Fix:** Wait 5 minutes or use `?cache=bust` parameter.
409
+
410
+ ### Permission denied errors
411
+
412
+ **Symptom:** Script fails with EACCES.
413
+
414
+ **Cause:** Files are read-only or owned by different user.
415
+
416
+ **Fix:**
417
+ ```bash
418
+ chmod +w docs/*.md
419
+ # or
420
+ sudo chown $USER docs/*.md
421
+ ```
422
+
423
+ ## Best Practices
424
+
425
+ ### 1. Always dry-run first
426
+
427
+ Before releasing:
428
+ ```bash
429
+ npm run sync-metadata -- --dry-run
430
+ ```
431
+
432
+ Review changes, then apply.
433
+
434
+ ### 2. Sync before committing
435
+
436
+ Add to your workflow:
437
+ ```bash
438
+ npm run sync-metadata && git add -A
439
+ ```
440
+
441
+ ### 3. Use verification in CI
442
+
443
+ Catch stale docs in pull requests:
444
+ ```yaml
445
+ - run: npm run sync-metadata -- --verify
446
+ ```
447
+
448
+ ### 4. Keep patterns maintainable
449
+
450
+ Document complex regex:
451
+ ```typescript
452
+ {
453
+ // Matches: [![Version](https://img.shields.io/badge/version-3.4.0-ff6b6b)]
454
+ // Captures: version number only
455
+ pattern: /\[!\[Version\]\(https:\/\/img\.shields\.io\/badge\/version-([^-]+)-[^)]+\)/g,
456
+ replacement: (m) => `[![Version](https://img.shields.io/badge/version-${m.version}-ff6b6b)]`,
457
+ description: 'Version badge in FULL-README',
458
+ }
459
+ ```
460
+
461
+ ### 5. Test after package.json changes
462
+
463
+ After any change to package.json:
464
+ ```bash
465
+ npm run sync-metadata -- --verify
466
+ ```
467
+
468
+ ## Migration Guide
469
+
470
+ If you're adding this to an existing project:
471
+
472
+ ### Step 1: Audit Current State
473
+
474
+ Find all hardcoded versions:
475
+ ```bash
476
+ grep -r "3\.4\.0" docs/ README.md .github/
477
+ ```
478
+
479
+ ### Step 2: Standardize Format
480
+
481
+ Choose consistent badge format:
482
+ ```markdown
483
+ [![Version](https://img.shields.io/badge/version-3.4.0-ff6b6b)]
484
+ ```
485
+
486
+ Update all instances manually.
487
+
488
+ ### Step 3: Run Initial Sync
489
+
490
+ ```bash
491
+ npm run sync-metadata
492
+ ```
493
+
494
+ Should report "All files are already in sync".
495
+
496
+ ### Step 4: Add to Workflow
497
+
498
+ Add npm script, pre-commit hook, CI verification.
499
+
500
+ ### Step 5: Document for Team
501
+
502
+ Update CONTRIBUTING.md:
503
+ ```markdown
504
+ ## Releasing
505
+
506
+ 1. Bump version: `npm version patch`
507
+ 2. Sync metadata: `npm run sync-metadata`
508
+ 3. Commit and tag
509
+ ```
510
+
511
+ ## Future Enhancements
512
+
513
+ Potential improvements:
514
+
515
+ - [ ] Support for multi-language docs (i18n)
516
+ - [ ] Sync to website/landing page
517
+ - [ ] Extract feature count from source code
518
+ - [ ] Auto-update dependency versions in docs
519
+ - [ ] Integration with release workflow
520
+ - [ ] Markdown AST-based updates (safer than regex)
521
+ - [ ] Configuration file for custom patterns
522
+ - [ ] Plugin system for custom metadata sources
523
+
524
+ ## Related
525
+
526
+ - [Release Workflow](./RELEASE-WORKFLOW.md)
527
+ - [Version Management](./VERSIONING.md)
528
+ - [CI/CD Pipeline](../.github/workflows/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-claude-sisyphus",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "Multi-agent orchestration system for Claude Code - Inspired by oh-my-opencode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -12,7 +12,9 @@
12
12
  }
13
13
  },
14
14
  "bin": {
15
- "oh-my-claudecode": "dist/cli/index.js"
15
+ "oh-my-claudecode": "dist/cli/index.js",
16
+ "omc-analytics": "dist/cli/analytics.js",
17
+ "omc-cli": "dist/cli/index.js"
16
18
  },
17
19
  "files": [
18
20
  "dist",
@@ -37,6 +39,9 @@
37
39
  "test:coverage": "vitest run --coverage",
38
40
  "lint": "eslint src",
39
41
  "format": "prettier --write src/**/*.ts",
42
+ "sync-metadata": "tsx scripts/sync-metadata.ts",
43
+ "sync-metadata:verify": "tsx scripts/sync-metadata.ts --verify",
44
+ "sync-metadata:dry-run": "tsx scripts/sync-metadata.ts --dry-run",
40
45
  "prepare": "npm run build",
41
46
  "prepublishOnly": "npm run build"
42
47
  },
@@ -57,6 +62,7 @@
57
62
  "@vitest/ui": "^4.0.17",
58
63
  "eslint": "^9.17.0",
59
64
  "prettier": "^3.4.2",
65
+ "tsx": "^4.19.2",
60
66
  "typescript": "^5.7.2",
61
67
  "typescript-eslint": "^8.53.0",
62
68
  "vitest": "^4.0.17"