@mclawnet/agent 0.5.9 → 0.6.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 (78) hide show
  1. package/cli.js +168 -61
  2. package/dist/__tests__/cli.test.d.ts +2 -0
  3. package/dist/__tests__/cli.test.d.ts.map +1 -0
  4. package/dist/__tests__/service-config.test.d.ts +2 -0
  5. package/dist/__tests__/service-config.test.d.ts.map +1 -0
  6. package/dist/__tests__/service-linux.test.d.ts +2 -0
  7. package/dist/__tests__/service-linux.test.d.ts.map +1 -0
  8. package/dist/__tests__/service-macos.test.d.ts +2 -0
  9. package/dist/__tests__/service-macos.test.d.ts.map +1 -0
  10. package/dist/__tests__/service-windows.test.d.ts +2 -0
  11. package/dist/__tests__/service-windows.test.d.ts.map +1 -0
  12. package/dist/backend-adapter.d.ts +2 -0
  13. package/dist/backend-adapter.d.ts.map +1 -1
  14. package/dist/{chunk-KHPEQTWF.js → chunk-KITKMSBE.js} +166 -90
  15. package/dist/chunk-KITKMSBE.js.map +1 -0
  16. package/dist/chunk-W3LSW4XY.js +95 -0
  17. package/dist/chunk-W3LSW4XY.js.map +1 -0
  18. package/dist/hub-connection.d.ts.map +1 -1
  19. package/dist/index.js +1 -1
  20. package/dist/linux-5KQ4SCAA.js +175 -0
  21. package/dist/linux-5KQ4SCAA.js.map +1 -0
  22. package/dist/macos-FGY546NC.js +173 -0
  23. package/dist/macos-FGY546NC.js.map +1 -0
  24. package/dist/service/config.d.ts +19 -0
  25. package/dist/service/config.d.ts.map +1 -0
  26. package/dist/service/index.d.ts +6 -0
  27. package/dist/service/index.d.ts.map +1 -0
  28. package/dist/service/index.js +46 -0
  29. package/dist/service/index.js.map +1 -0
  30. package/dist/service/linux.d.ts +18 -0
  31. package/dist/service/linux.d.ts.map +1 -0
  32. package/dist/service/macos.d.ts +18 -0
  33. package/dist/service/macos.d.ts.map +1 -0
  34. package/dist/service/types.d.ts +19 -0
  35. package/dist/service/types.d.ts.map +1 -0
  36. package/dist/service/windows.d.ts +18 -0
  37. package/dist/service/windows.d.ts.map +1 -0
  38. package/dist/session-manager.d.ts +4 -7
  39. package/dist/session-manager.d.ts.map +1 -1
  40. package/dist/skill-loader.d.ts +8 -0
  41. package/dist/skill-loader.d.ts.map +1 -0
  42. package/dist/start.d.ts.map +1 -1
  43. package/dist/start.js +1 -1
  44. package/dist/windows-PIJ4CMWX.js +164 -0
  45. package/dist/windows-PIJ4CMWX.js.map +1 -0
  46. package/package.json +8 -6
  47. package/skills/academic-search/SKILL.md +147 -0
  48. package/skills/architecture/SKILL.md +294 -0
  49. package/skills/changelog-generator/SKILL.md +112 -0
  50. package/skills/chart-visualization/SKILL.md +183 -0
  51. package/skills/code-review/SKILL.md +304 -0
  52. package/skills/codebase-health/SKILL.md +281 -0
  53. package/skills/consulting-analysis/SKILL.md +584 -0
  54. package/skills/content-research-writer/SKILL.md +546 -0
  55. package/skills/data-analysis/SKILL.md +194 -0
  56. package/skills/deep-research/SKILL.md +198 -0
  57. package/skills/docx/SKILL.md +211 -0
  58. package/skills/github-deep-research/SKILL.md +207 -0
  59. package/skills/image-generation/SKILL.md +209 -0
  60. package/skills/lead-research-assistant/SKILL.md +207 -0
  61. package/skills/mcp-builder/SKILL.md +304 -0
  62. package/skills/meeting-insights-analyzer/SKILL.md +335 -0
  63. package/skills/pair-programming/SKILL.md +196 -0
  64. package/skills/pdf/SKILL.md +309 -0
  65. package/skills/performance-analysis/SKILL.md +261 -0
  66. package/skills/podcast-generation/SKILL.md +224 -0
  67. package/skills/pptx/SKILL.md +497 -0
  68. package/skills/project-learnings/SKILL.md +280 -0
  69. package/skills/security-audit/SKILL.md +211 -0
  70. package/skills/skill-creator/SKILL.md +200 -0
  71. package/skills/technical-writing/SKILL.md +286 -0
  72. package/skills/testing/SKILL.md +363 -0
  73. package/skills/video-generation/SKILL.md +247 -0
  74. package/skills/web-design-guidelines/SKILL.md +203 -0
  75. package/skills/webapp-testing/SKILL.md +162 -0
  76. package/skills/workflow-automation/SKILL.md +299 -0
  77. package/skills/xlsx/SKILL.md +305 -0
  78. package/dist/chunk-KHPEQTWF.js.map +0 -1
@@ -0,0 +1,281 @@
1
+ ---
2
+ name: codebase-health
3
+ description: Evaluate codebase quality across multiple dimensions including type safety, lint cleanliness, test coverage, dead code, and dependency hygiene. Use when performing health checks, quality audits, tracking code quality trends, or assessing technical debt.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Codebase Health
8
+
9
+ Comprehensive codebase quality assessment across eight dimensions, producing a composite health score with actionable improvement recommendations.
10
+
11
+ ## Overview
12
+
13
+ Code quality is not one metric — it is a composite of type safety, lint cleanliness, test coverage, dead code, dependency health, documentation, complexity, and security posture. This skill runs available project tools, scores each dimension, and produces a clear dashboard so teams can track quality over time and prioritize improvements.
14
+
15
+ **Core principle**: Wrap, don't replace. Run the project's own tools and score their output. Never substitute analysis for what the tool reports.
16
+
17
+ ## When to Use
18
+
19
+ - Periodic health checks (weekly, before releases)
20
+ - Evaluating technical debt before a refactoring effort
21
+ - Assessing code quality on a new project or repo
22
+ - Tracking quality trends over multiple sprints
23
+ - Comparing quality across modules or packages in a monorepo
24
+ - Pre-merge quality gates
25
+
26
+ ## When NOT to Use
27
+
28
+ - **Fixing issues** — this skill diagnoses only; use implementation skills to fix
29
+ - **Code review of a specific PR** — use the `code-review` skill
30
+ - **Performance profiling** — use the `performance-analysis` skill
31
+
32
+ ## Health Dimensions
33
+
34
+ ### 1. Type Safety (Weight: 20%)
35
+
36
+ Does the code leverage the type system to prevent bugs at compile time?
37
+
38
+ **What to check:**
39
+ - Type checker passes cleanly (e.g., `tsc --noEmit`, `mypy`, `go vet`)
40
+ - Strict mode enabled where available (`strict: true` in tsconfig)
41
+ - No `any` escape hatches in TypeScript, no `# type: ignore` in Python
42
+ - Generic types used instead of casting
43
+
44
+ **Scoring:**
45
+ | Score | Criteria |
46
+ |-------|----------|
47
+ | 10 | Clean (zero errors), strict mode on |
48
+ | 7 | < 10 errors or non-strict mode |
49
+ | 4 | < 50 errors |
50
+ | 0 | >= 50 errors or no type checking |
51
+
52
+ ### 2. Lint Cleanliness (Weight: 15%)
53
+
54
+ Is the code consistent and free of common mistakes?
55
+
56
+ **What to check:**
57
+ - Linter passes cleanly (ESLint, Biome, Ruff, clippy)
58
+ - Formatter applied consistently (Prettier, Black, gofmt)
59
+ - No lint rule suppressions without comments explaining why
60
+
61
+ **Scoring:**
62
+ | Score | Criteria |
63
+ |-------|----------|
64
+ | 10 | Clean (zero warnings) |
65
+ | 7 | < 5 warnings |
66
+ | 4 | < 20 warnings |
67
+ | 0 | >= 20 warnings |
68
+
69
+ ### 3. Test Coverage (Weight: 25%)
70
+
71
+ Are the important code paths protected by tests?
72
+
73
+ **What to check:**
74
+ - Test runner passes (`npm test`, `pytest`, `cargo test`)
75
+ - Line coverage percentage
76
+ - Branch coverage percentage
77
+ - All new code has corresponding tests
78
+
79
+ **Scoring:**
80
+ | Score | Criteria |
81
+ |-------|----------|
82
+ | 10 | All pass, line coverage > 80% |
83
+ | 7 | All pass, line coverage > 60% |
84
+ | 4 | Some failures, or coverage < 60% |
85
+ | 0 | Test suite broken or coverage < 30% |
86
+
87
+ ### 4. Dead Code (Weight: 10%)
88
+
89
+ Is there unused code cluttering the codebase?
90
+
91
+ **What to check:**
92
+ - Unused exports, functions, types (knip, ts-prune)
93
+ - Unreachable code branches
94
+ - Commented-out code blocks
95
+ - Unused dependencies in package.json / requirements.txt
96
+
97
+ **Scoring:**
98
+ | Score | Criteria |
99
+ |-------|----------|
100
+ | 10 | Clean (no unused exports or dependencies) |
101
+ | 7 | < 5 unused exports |
102
+ | 4 | < 20 unused exports |
103
+ | 0 | >= 20 unused or many unused dependencies |
104
+
105
+ ### 5. Dependency Health (Weight: 10%)
106
+
107
+ Are dependencies up to date and free of known vulnerabilities?
108
+
109
+ **What to check:**
110
+ - `npm audit` / `pip-audit` / `cargo audit` for security advisories
111
+ - Outdated dependencies (`npm outdated`)
112
+ - Pinned versions vs floating ranges
113
+ - License compatibility
114
+
115
+ **Scoring:**
116
+ | Score | Criteria |
117
+ |-------|----------|
118
+ | 10 | No vulnerabilities, all deps current |
119
+ | 7 | No critical vulns, < 5 outdated |
120
+ | 4 | Critical vulns present but patchable |
121
+ | 0 | Unpatched critical vulns or abandoned deps |
122
+
123
+ ### 6. Documentation (Weight: 5%)
124
+
125
+ Is the project understandable to newcomers?
126
+
127
+ **What to check:**
128
+ - README exists and is current
129
+ - API documentation or JSDoc/docstrings on public interfaces
130
+ - Architecture decision records (ADRs) for key decisions
131
+ - Setup instructions that actually work
132
+
133
+ **Scoring:**
134
+ | Score | Criteria |
135
+ |-------|----------|
136
+ | 10 | Comprehensive docs, setup works first try |
137
+ | 7 | README + basic docs, most things documented |
138
+ | 4 | README only, some gaps |
139
+ | 0 | No docs or docs are outdated/wrong |
140
+
141
+ ### 7. Complexity (Weight: 10%)
142
+
143
+ Is the code maintainable or tangled?
144
+
145
+ **What to check:**
146
+ - Cyclomatic complexity per function (target: < 10)
147
+ - File size (target: < 300 lines per file)
148
+ - Function length (target: < 50 lines per function)
149
+ - Nesting depth (target: < 4 levels)
150
+ - Module coupling (how many dependencies each module has)
151
+
152
+ **Scoring:**
153
+ | Score | Criteria |
154
+ |-------|----------|
155
+ | 10 | All functions < 10 complexity, clean structure |
156
+ | 7 | Few functions > 10 complexity |
157
+ | 4 | Many complex functions, deep nesting |
158
+ | 0 | God classes, 1000+ line files, spaghetti |
159
+
160
+ ### 8. Security Posture (Weight: 5%)
161
+
162
+ Is the code following security best practices?
163
+
164
+ **What to check:**
165
+ - No hardcoded secrets (use git-secrets, gitleaks, or trufflehog)
166
+ - Input validation on user-facing endpoints
167
+ - Authentication/authorization checks in place
168
+ - HTTPS enforced, CORS configured properly
169
+ - Dependencies scanned for CVEs
170
+
171
+ **Scoring:**
172
+ | Score | Criteria |
173
+ |-------|----------|
174
+ | 10 | No findings, security tools configured |
175
+ | 7 | Minor findings, no credential leaks |
176
+ | 4 | Significant findings, some credential exposure risk |
177
+ | 0 | Hardcoded secrets or critical security gaps |
178
+
179
+ ## Health Check Process
180
+
181
+ ### Step 1: Detect Available Tools
182
+
183
+ Auto-detect what's available in the project:
184
+
185
+ ```bash
186
+ # Type checker
187
+ [ -f tsconfig.json ] && echo "typecheck: tsc --noEmit"
188
+ [ -f mypy.ini ] || [ -f pyproject.toml ] && echo "typecheck: mypy ."
189
+
190
+ # Linter
191
+ [ -f biome.json ] && echo "lint: biome check ."
192
+ ls eslint.config.* .eslintrc.* 2>/dev/null && echo "lint: eslint ."
193
+ [ -f pyproject.toml ] && grep -q "ruff" pyproject.toml && echo "lint: ruff check ."
194
+
195
+ # Tests
196
+ [ -f package.json ] && grep -q '"test"' package.json && echo "test: npm test"
197
+ [ -f pyproject.toml ] && grep -q "pytest" pyproject.toml && echo "test: pytest"
198
+
199
+ # Dead code
200
+ command -v knip >/dev/null && echo "deadcode: knip"
201
+
202
+ # Security
203
+ command -v gitleaks >/dev/null && echo "security: gitleaks detect"
204
+ [ -f package.json ] && echo "audit: npm audit"
205
+ ```
206
+
207
+ ### Step 2: Run Each Tool
208
+
209
+ Run each detected tool, capturing:
210
+ - Exit code (pass/fail)
211
+ - Output summary (error/warning counts)
212
+ - Duration
213
+
214
+ ### Step 3: Score and Present
215
+
216
+ Calculate weighted composite score:
217
+
218
+ ```
219
+ composite = Σ (dimension_score × weight)
220
+ ```
221
+
222
+ If a dimension is not measurable (tool unavailable), redistribute its weight proportionally.
223
+
224
+ ### Step 4: Present Dashboard
225
+
226
+ ```
227
+ CODEBASE HEALTH DASHBOARD
228
+ ===========================
229
+ Project: my-project
230
+ Branch: main
231
+ Date: 2026-04-01
232
+
233
+ Dimension Score Status Details
234
+ --------------- ----- --------- -------------------------
235
+ Type Safety 10/10 CLEAN 0 errors, strict mode
236
+ Lint 8/10 WARNING 3 warnings
237
+ Test Coverage 9/10 GOOD 92% line coverage
238
+ Dead Code 7/10 WARNING 4 unused exports
239
+ Dependencies 10/10 CLEAN No vulnerabilities
240
+ Documentation 7/10 WARNING Missing API docs
241
+ Complexity 8/10 GOOD 2 functions > 10 complexity
242
+ Security 10/10 CLEAN No findings
243
+
244
+ COMPOSITE SCORE: 8.7 / 10
245
+
246
+ Status labels: CLEAN (10) | GOOD (8-9) | WARNING (6-7) | NEEDS WORK (4-5) | CRITICAL (0-3)
247
+ ```
248
+
249
+ ### Step 5: Recommendations
250
+
251
+ Prioritize by `weight × (10 - score)`:
252
+
253
+ ```
254
+ RECOMMENDATIONS (by impact)
255
+ ============================
256
+ 1. [HIGH] Address 3 lint warnings (Lint: 8/10, weight 15%)
257
+ 2. [MED] Remove 4 unused exports (Dead Code: 7/10, weight 10%)
258
+ 3. [MED] Add API documentation (Docs: 7/10, weight 5%)
259
+ 4. [LOW] Reduce complexity in 2 functions (Complexity: 8/10, weight 10%)
260
+ ```
261
+
262
+ ## Trend Tracking
263
+
264
+ Run health checks regularly and track changes:
265
+
266
+ ```
267
+ HEALTH TREND (last 5 runs)
268
+ ===========================
269
+ Date Score Change Highlight
270
+ ---------- ----- ------ -------------------------
271
+ 2026-03-15 7.2 — Baseline
272
+ 2026-03-22 7.8 +0.6 Fixed type errors
273
+ 2026-03-29 8.3 +0.5 Added test coverage
274
+ 2026-04-01 8.7 +0.4 Removed dead code
275
+ ```
276
+
277
+ **Interpreting trends:**
278
+ - Steady improvement → team is addressing debt
279
+ - Plateau → time to tackle the next dimension
280
+ - Decline → new code is outpacing quality standards
281
+ - Volatile → inconsistent practices, need better CI gates