kastell 2.2.0 → 2.2.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 (292) hide show
  1. package/.claude-plugin/marketplace.json +18 -0
  2. package/.claude-plugin/plugin.json +39 -0
  3. package/CHANGELOG.md +1266 -1266
  4. package/LICENSE +201 -201
  5. package/NOTICE +5 -5
  6. package/bin/kastell +2 -2
  7. package/bin/kastell-mcp +5 -5
  8. package/dist/adapters/coolify.js +92 -92
  9. package/dist/adapters/dokploy.js +99 -99
  10. package/dist/adapters/shared.d.ts.map +1 -1
  11. package/dist/adapters/shared.js +4 -2
  12. package/dist/adapters/shared.js.map +1 -1
  13. package/dist/commands/add.d.ts.map +1 -1
  14. package/dist/commands/add.js +6 -9
  15. package/dist/commands/add.js.map +1 -1
  16. package/dist/commands/auth.d.ts.map +1 -1
  17. package/dist/commands/auth.js +12 -12
  18. package/dist/commands/auth.js.map +1 -1
  19. package/dist/commands/doctor.js +1 -1
  20. package/dist/commands/doctor.js.map +1 -1
  21. package/dist/commands/evidence.d.ts.map +1 -1
  22. package/dist/commands/evidence.js +8 -9
  23. package/dist/commands/evidence.js.map +1 -1
  24. package/dist/commands/fix.js +3 -3
  25. package/dist/commands/fix.js.map +1 -1
  26. package/dist/commands/init.d.ts.map +1 -1
  27. package/dist/commands/init.js +4 -7
  28. package/dist/commands/init.js.map +1 -1
  29. package/dist/commands/interactive/backup-maintenance.d.ts +8 -0
  30. package/dist/commands/interactive/backup-maintenance.d.ts.map +1 -0
  31. package/dist/commands/interactive/backup-maintenance.js +120 -0
  32. package/dist/commands/interactive/backup-maintenance.js.map +1 -0
  33. package/dist/commands/interactive/index.d.ts +4 -0
  34. package/dist/commands/interactive/index.d.ts.map +1 -0
  35. package/dist/commands/interactive/index.js +94 -0
  36. package/dist/commands/interactive/index.js.map +1 -0
  37. package/dist/commands/interactive/menu.d.ts +23 -0
  38. package/dist/commands/interactive/menu.d.ts.map +1 -0
  39. package/dist/commands/interactive/menu.js +121 -0
  40. package/dist/commands/interactive/menu.js.map +1 -0
  41. package/dist/commands/interactive/monitoring.d.ts +5 -0
  42. package/dist/commands/interactive/monitoring.d.ts.map +1 -0
  43. package/dist/commands/interactive/monitoring.js +96 -0
  44. package/dist/commands/interactive/monitoring.js.map +1 -0
  45. package/dist/commands/interactive/plugins.d.ts +2 -0
  46. package/dist/commands/interactive/plugins.d.ts.map +1 -0
  47. package/dist/commands/interactive/plugins.js +30 -0
  48. package/dist/commands/interactive/plugins.js.map +1 -0
  49. package/dist/commands/interactive/security.d.ts +9 -0
  50. package/dist/commands/interactive/security.d.ts.map +1 -0
  51. package/dist/commands/interactive/security.js +535 -0
  52. package/dist/commands/interactive/security.js.map +1 -0
  53. package/dist/commands/interactive/server-management.d.ts +5 -0
  54. package/dist/commands/interactive/server-management.d.ts.map +1 -0
  55. package/dist/commands/interactive/server-management.js +79 -0
  56. package/dist/commands/interactive/server-management.js.map +1 -0
  57. package/dist/commands/interactive/shared.d.ts +12 -0
  58. package/dist/commands/interactive/shared.d.ts.map +1 -0
  59. package/dist/commands/interactive/shared.js +30 -0
  60. package/dist/commands/interactive/shared.js.map +1 -0
  61. package/dist/commands/lock.js +1 -1
  62. package/dist/commands/lock.js.map +1 -1
  63. package/dist/commands/regression.d.ts.map +1 -1
  64. package/dist/commands/regression.js +1 -2
  65. package/dist/commands/regression.js.map +1 -1
  66. package/dist/commands/restart.d.ts.map +1 -1
  67. package/dist/commands/restart.js +3 -2
  68. package/dist/commands/restart.js.map +1 -1
  69. package/dist/commands/schedule.js +2 -2
  70. package/dist/commands/schedule.js.map +1 -1
  71. package/dist/core/audit/formatters/badge.js +20 -20
  72. package/dist/core/backup.d.ts.map +1 -1
  73. package/dist/core/backup.js +10 -5
  74. package/dist/core/backup.js.map +1 -1
  75. package/dist/core/completions.js +631 -631
  76. package/dist/core/deploy.d.ts.map +1 -1
  77. package/dist/core/deploy.js +7 -4
  78. package/dist/core/deploy.js.map +1 -1
  79. package/dist/core/lock/auth.d.ts +7 -0
  80. package/dist/core/lock/auth.d.ts.map +1 -0
  81. package/dist/core/lock/auth.js +59 -0
  82. package/dist/core/lock/auth.js.map +1 -0
  83. package/dist/core/lock/docker.d.ts +4 -0
  84. package/dist/core/lock/docker.d.ts.map +1 -0
  85. package/dist/core/lock/docker.js +28 -0
  86. package/dist/core/lock/docker.js.map +1 -0
  87. package/dist/core/lock/index.d.ts +11 -0
  88. package/dist/core/lock/index.d.ts.map +1 -0
  89. package/dist/core/lock/index.js +247 -0
  90. package/dist/core/lock/index.js.map +1 -0
  91. package/dist/core/lock/monitoring.d.ts +4 -0
  92. package/dist/core/lock/monitoring.d.ts.map +1 -0
  93. package/dist/core/lock/monitoring.js +55 -0
  94. package/dist/core/lock/monitoring.js.map +1 -0
  95. package/dist/core/lock/network.d.ts +6 -0
  96. package/dist/core/lock/network.d.ts.map +1 -0
  97. package/dist/core/lock/network.js +59 -0
  98. package/dist/core/lock/network.js.map +1 -0
  99. package/dist/core/lock/ssh.d.ts +5 -0
  100. package/dist/core/lock/ssh.d.ts.map +1 -0
  101. package/dist/core/lock/ssh.js +49 -0
  102. package/dist/core/lock/ssh.js.map +1 -0
  103. package/dist/core/lock/system.d.ts +9 -0
  104. package/dist/core/lock/system.d.ts.map +1 -0
  105. package/dist/core/lock/system.js +80 -0
  106. package/dist/core/lock/system.js.map +1 -0
  107. package/dist/core/lock/types.d.ts +41 -0
  108. package/dist/core/lock/types.d.ts.map +1 -0
  109. package/dist/core/lock/types.js +2 -0
  110. package/dist/core/lock/types.js.map +1 -0
  111. package/dist/core/maintain.d.ts.map +1 -1
  112. package/dist/core/maintain.js +3 -1
  113. package/dist/core/maintain.js.map +1 -1
  114. package/dist/core/manage.d.ts.map +1 -1
  115. package/dist/core/manage.js +5 -3
  116. package/dist/core/manage.js.map +1 -1
  117. package/dist/core/notifyStore.d.ts.map +1 -1
  118. package/dist/core/notifyStore.js +3 -1
  119. package/dist/core/notifyStore.js.map +1 -1
  120. package/dist/core/provision.d.ts.map +1 -1
  121. package/dist/core/provision.js +9 -4
  122. package/dist/core/provision.js.map +1 -1
  123. package/dist/core/scheduleManager.d.ts.map +1 -1
  124. package/dist/core/scheduleManager.js +5 -2
  125. package/dist/core/scheduleManager.js.map +1 -1
  126. package/dist/index.js +1 -1
  127. package/dist/index.js.map +1 -1
  128. package/dist/mcp/schemas/audit.d.ts +34 -0
  129. package/dist/mcp/schemas/audit.d.ts.map +1 -0
  130. package/dist/mcp/schemas/audit.js +23 -0
  131. package/dist/mcp/schemas/audit.js.map +1 -0
  132. package/dist/mcp/schemas/common.d.ts +16 -0
  133. package/dist/mcp/schemas/common.d.ts.map +1 -0
  134. package/dist/mcp/schemas/common.js +14 -0
  135. package/dist/mcp/schemas/common.js.map +1 -0
  136. package/dist/mcp/schemas/health.d.ts +14 -0
  137. package/dist/mcp/schemas/health.d.ts.map +1 -0
  138. package/dist/mcp/schemas/health.js +13 -0
  139. package/dist/mcp/schemas/health.js.map +1 -0
  140. package/dist/mcp/schemas/index.d.ts +5 -0
  141. package/dist/mcp/schemas/index.d.ts.map +1 -0
  142. package/dist/mcp/schemas/index.js +5 -0
  143. package/dist/mcp/schemas/index.js.map +1 -0
  144. package/dist/mcp/schemas/server.d.ts +18 -0
  145. package/dist/mcp/schemas/server.d.ts.map +1 -0
  146. package/dist/mcp/schemas/server.js +16 -0
  147. package/dist/mcp/schemas/server.js.map +1 -0
  148. package/dist/mcp/server.d.ts.map +1 -1
  149. package/dist/mcp/server.js +56 -39
  150. package/dist/mcp/server.js.map +1 -1
  151. package/dist/mcp/tools/serverAudit.d.ts +63 -1
  152. package/dist/mcp/tools/serverAudit.d.ts.map +1 -1
  153. package/dist/mcp/tools/serverAudit.js +63 -6
  154. package/dist/mcp/tools/serverAudit.js.map +1 -1
  155. package/dist/mcp/tools/serverBackup.d.ts +100 -2
  156. package/dist/mcp/tools/serverBackup.d.ts.map +1 -1
  157. package/dist/mcp/tools/serverBackup.handlers.d.ts.map +1 -1
  158. package/dist/mcp/tools/serverBackup.handlers.js +9 -0
  159. package/dist/mcp/tools/serverBackup.handlers.js.map +1 -1
  160. package/dist/mcp/tools/serverBackup.js +74 -0
  161. package/dist/mcp/tools/serverBackup.js.map +1 -1
  162. package/dist/mcp/tools/serverCompare.d.ts +33 -0
  163. package/dist/mcp/tools/serverCompare.d.ts.map +1 -1
  164. package/dist/mcp/tools/serverCompare.js +45 -2
  165. package/dist/mcp/tools/serverCompare.js.map +1 -1
  166. package/dist/mcp/tools/serverDoctor.d.ts +14 -0
  167. package/dist/mcp/tools/serverDoctor.d.ts.map +1 -1
  168. package/dist/mcp/tools/serverDoctor.js +15 -0
  169. package/dist/mcp/tools/serverDoctor.js.map +1 -1
  170. package/dist/mcp/tools/serverEvidence.d.ts +13 -0
  171. package/dist/mcp/tools/serverEvidence.d.ts.map +1 -1
  172. package/dist/mcp/tools/serverEvidence.js +17 -2
  173. package/dist/mcp/tools/serverEvidence.js.map +1 -1
  174. package/dist/mcp/tools/serverExplain.d.ts +17 -0
  175. package/dist/mcp/tools/serverExplain.d.ts.map +1 -1
  176. package/dist/mcp/tools/serverExplain.js +33 -1
  177. package/dist/mcp/tools/serverExplain.js.map +1 -1
  178. package/dist/mcp/tools/serverFix.d.ts +78 -0
  179. package/dist/mcp/tools/serverFix.d.ts.map +1 -1
  180. package/dist/mcp/tools/serverFix.js +84 -0
  181. package/dist/mcp/tools/serverFix.js.map +1 -1
  182. package/dist/mcp/tools/serverFleet.d.ts +24 -1
  183. package/dist/mcp/tools/serverFleet.d.ts.map +1 -1
  184. package/dist/mcp/tools/serverFleet.js +24 -1
  185. package/dist/mcp/tools/serverFleet.js.map +1 -1
  186. package/dist/mcp/tools/serverGuard.d.ts +12 -0
  187. package/dist/mcp/tools/serverGuard.d.ts.map +1 -1
  188. package/dist/mcp/tools/serverGuard.js +16 -0
  189. package/dist/mcp/tools/serverGuard.js.map +1 -1
  190. package/dist/mcp/tools/serverInfo.d.ts +77 -1
  191. package/dist/mcp/tools/serverInfo.d.ts.map +1 -1
  192. package/dist/mcp/tools/serverInfo.js +77 -4
  193. package/dist/mcp/tools/serverInfo.js.map +1 -1
  194. package/dist/mcp/tools/serverLock.d.ts +10 -0
  195. package/dist/mcp/tools/serverLock.d.ts.map +1 -1
  196. package/dist/mcp/tools/serverLock.js +15 -3
  197. package/dist/mcp/tools/serverLock.js.map +1 -1
  198. package/dist/mcp/tools/serverLogs.d.ts +43 -0
  199. package/dist/mcp/tools/serverLogs.d.ts.map +1 -1
  200. package/dist/mcp/tools/serverLogs.js +28 -0
  201. package/dist/mcp/tools/serverLogs.js.map +1 -1
  202. package/dist/mcp/tools/serverMaintain.d.ts +47 -0
  203. package/dist/mcp/tools/serverMaintain.d.ts.map +1 -1
  204. package/dist/mcp/tools/serverMaintain.js +75 -41
  205. package/dist/mcp/tools/serverMaintain.js.map +1 -1
  206. package/dist/mcp/tools/serverManage.d.ts +50 -0
  207. package/dist/mcp/tools/serverManage.d.ts.map +1 -1
  208. package/dist/mcp/tools/serverManage.js +49 -0
  209. package/dist/mcp/tools/serverManage.js.map +1 -1
  210. package/dist/mcp/tools/serverPlugin.d.ts +18 -0
  211. package/dist/mcp/tools/serverPlugin.d.ts.map +1 -1
  212. package/dist/mcp/tools/serverPlugin.js +26 -1
  213. package/dist/mcp/tools/serverPlugin.js.map +1 -1
  214. package/dist/mcp/tools/serverProvision.d.ts +22 -0
  215. package/dist/mcp/tools/serverProvision.d.ts.map +1 -1
  216. package/dist/mcp/tools/serverProvision.js +22 -2
  217. package/dist/mcp/tools/serverProvision.js.map +1 -1
  218. package/dist/mcp/tools/serverSecure.d.ts +120 -0
  219. package/dist/mcp/tools/serverSecure.d.ts.map +1 -1
  220. package/dist/mcp/tools/serverSecure.handlers.d.ts.map +1 -1
  221. package/dist/mcp/tools/serverSecure.handlers.js +39 -98
  222. package/dist/mcp/tools/serverSecure.handlers.js.map +1 -1
  223. package/dist/mcp/tools/serverSecure.js +101 -0
  224. package/dist/mcp/tools/serverSecure.js.map +1 -1
  225. package/dist/mcp/utils.d.ts +1 -0
  226. package/dist/mcp/utils.d.ts.map +1 -1
  227. package/dist/mcp/utils.js +5 -1
  228. package/dist/mcp/utils.js.map +1 -1
  229. package/dist/plugin/registry.d.ts.map +1 -1
  230. package/dist/plugin/registry.js +5 -3
  231. package/dist/plugin/registry.js.map +1 -1
  232. package/dist/providers/linode.d.ts +1 -0
  233. package/dist/providers/linode.d.ts.map +1 -1
  234. package/dist/providers/linode.js +4 -0
  235. package/dist/providers/linode.js.map +1 -1
  236. package/dist/utils/cloudInit.js +58 -58
  237. package/dist/utils/config.d.ts +3 -0
  238. package/dist/utils/config.d.ts.map +1 -1
  239. package/dist/utils/config.js +11 -6
  240. package/dist/utils/config.js.map +1 -1
  241. package/dist/utils/encryption.d.ts.map +1 -1
  242. package/dist/utils/encryption.js +4 -1
  243. package/dist/utils/encryption.js.map +1 -1
  244. package/dist/utils/migration.d.ts.map +1 -1
  245. package/dist/utils/migration.js +25 -14
  246. package/dist/utils/migration.js.map +1 -1
  247. package/dist/utils/safeMode.d.ts.map +1 -1
  248. package/dist/utils/safeMode.js +3 -2
  249. package/dist/utils/safeMode.js.map +1 -1
  250. package/dist/utils/securityLogger.d.ts.map +1 -1
  251. package/dist/utils/securityLogger.js +7 -3
  252. package/dist/utils/securityLogger.js.map +1 -1
  253. package/kastell-plugin/.claude-plugin/plugin.json +20 -0
  254. package/kastell-plugin/.mcp.json +8 -0
  255. package/kastell-plugin/README.md +113 -0
  256. package/kastell-plugin/agents/.gitkeep +0 -0
  257. package/kastell-plugin/agents/kastell-auditor.md +77 -0
  258. package/kastell-plugin/agents/scripts/bucket_mapper.sh +101 -0
  259. package/kastell-plugin/agents/scripts/trend_report.sh +91 -0
  260. package/kastell-plugin/hooks/destroy-block.cjs +31 -0
  261. package/kastell-plugin/hooks/hooks.json +57 -0
  262. package/kastell-plugin/hooks/pre-commit-audit-guard.cjs +75 -0
  263. package/kastell-plugin/hooks/session-audit.cjs +86 -0
  264. package/kastell-plugin/hooks/session-log.cjs +56 -0
  265. package/kastell-plugin/hooks/stop-quality-check.cjs +72 -0
  266. package/kastell-plugin/skills/.gitkeep +0 -0
  267. package/kastell-plugin/skills/kastell-careful/SKILL.md +64 -0
  268. package/kastell-plugin/skills/kastell-ops/SKILL.md +139 -0
  269. package/kastell-plugin/skills/kastell-ops/references/commands.md +45 -0
  270. package/kastell-plugin/skills/kastell-ops/references/mcp-tools.md +50 -0
  271. package/kastell-plugin/skills/kastell-ops/references/patterns.md +145 -0
  272. package/kastell-plugin/skills/kastell-ops/references/pitfalls.md +136 -0
  273. package/kastell-plugin/skills/kastell-ops/scripts/check_coverage.sh +101 -0
  274. package/kastell-plugin/skills/kastell-ops/scripts/fleet_report.sh +73 -0
  275. package/kastell-plugin/skills/kastell-ops/scripts/parse_audit.sh +76 -0
  276. package/kastell-plugin/skills/kastell-research/SKILL.md +90 -0
  277. package/kastell-plugin/skills/kastell-scaffold/SKILL.md +104 -0
  278. package/kastell-plugin/skills/kastell-scaffold/references/template-audit-check.md +150 -0
  279. package/kastell-plugin/skills/kastell-scaffold/references/template-command.md +80 -0
  280. package/kastell-plugin/skills/kastell-scaffold/references/template-mcp-tool.md +72 -0
  281. package/kastell-plugin/skills/kastell-scaffold/references/template-provider.md +67 -0
  282. package/kastell-plugin/skills/kastell-scaffold/scripts/scaffold.sh +180 -0
  283. package/kastell-plugin/skills/kastell-scaffold/templates/check-test.ts.tpl +27 -0
  284. package/kastell-plugin/skills/kastell-scaffold/templates/check.ts.tpl +50 -0
  285. package/kastell-plugin/skills/kastell-scaffold/templates/command-core.ts.tpl +18 -0
  286. package/kastell-plugin/skills/kastell-scaffold/templates/command-test.ts.tpl +17 -0
  287. package/kastell-plugin/skills/kastell-scaffold/templates/command.ts.tpl +25 -0
  288. package/kastell-plugin/skills/kastell-scaffold/templates/mcp-tool-test.ts.tpl +30 -0
  289. package/kastell-plugin/skills/kastell-scaffold/templates/mcp-tool.ts.tpl +29 -0
  290. package/kastell-plugin/skills/kastell-scaffold/templates/provider-test.ts.tpl +34 -0
  291. package/kastell-plugin/skills/kastell-scaffold/templates/provider.ts.tpl +32 -0
  292. package/package.json +122 -115
@@ -0,0 +1,145 @@
1
+ # Kastell Patterns
2
+
3
+ ## Do / Don't
4
+
5
+ | Do | Don't |
6
+ |-----------------------------------------------------------------------|--------------------------------------------------------------------|
7
+ | Put all business logic in `src/core/` | Put logic in `src/commands/` — commands are thin wrappers only |
8
+ | Use `getAdapter(platform)` from `factory.ts` | Import `CoolifyAdapter` / `DokployAdapter` directly in commands |
9
+ | Use `adapter.port`, `adapter.defaultLogService`, `adapter.platformPorts` | Hardcode port numbers (8000, 3000) in command files |
10
+ | Use `withProviderErrorHandling` HOF for provider operations | Write per-command try/catch around provider API calls |
11
+ | Use `assertValidIp()` before every SSH operation | Call `sshExec` without IP validation |
12
+ | Use `sanitizedEnv` for subprocess calls | Pass raw `process.env` to child processes |
13
+ | Use `sanitizeResponseData()` for API error responses | Leak raw API error objects to the user |
14
+ | Use `createMockAdapter()` from `tests/helpers/mockAdapter.ts` | Write inline `{ healthCheck: jest.fn() }` objects in tests |
15
+ | Batch SSH commands (fast config + slow probes) in audit operations | Call `sshExec` multiple times fetching overlapping data |
16
+ | Return plain data objects from `src/core/` functions | Import `chalk` or `ora` in `src/core/` files |
17
+ | Use `jest.resetAllMocks()` with `describe.each` | Use `clearAllMocks()` with `describe.each` (causes cross-test bleed) |
18
+
19
+ ## Testing Patterns
20
+
21
+ ### Pattern 1: Mock Adapter Factory
22
+
23
+ Use `createMockAdapter()` from `tests/helpers/mockAdapter.ts`. Never write inline mock adapter objects.
24
+
25
+ ```typescript
26
+ import { createMockAdapter } from '../../tests/helpers/mockAdapter.js';
27
+
28
+ // Basic usage — gets correct defaults for the platform
29
+ const adapter = createMockAdapter({ name: 'coolify' });
30
+ // adapter.port === 8000, adapter.defaultLogService === 'coolify'
31
+
32
+ // Override specific methods
33
+ const adapter = createMockAdapter({
34
+ name: 'dokploy',
35
+ overrides: {
36
+ healthCheck: jest.fn(async () => ({ status: 'not reachable' as const })),
37
+ },
38
+ });
39
+
40
+ // In the test — inject via jest.mock or direct parameter
41
+ jest.mock('../../src/adapters/factory.js', () => ({
42
+ getAdapter: jest.fn(() => adapter),
43
+ resolvePlatform: jest.fn(() => 'coolify'),
44
+ }));
45
+ ```
46
+
47
+ ### Pattern 2: SSH Mock
48
+
49
+ Mock `sshExec` at the module level. Use `mockResolvedValueOnce` for sequential calls.
50
+
51
+ ```typescript
52
+ import { sshExec } from '../../src/utils/ssh.js';
53
+ jest.mock('../../src/utils/ssh.js');
54
+ const mockSshExec = sshExec as jest.MockedFunction<typeof sshExec>;
55
+
56
+ // Single call
57
+ mockSshExec.mockResolvedValueOnce({ code: 0, stdout: 'active', stderr: '' });
58
+
59
+ // Multiple sequential calls (batch grouping pattern)
60
+ mockSshExec
61
+ .mockResolvedValueOnce({ code: 0, stdout: 'ufw active', stderr: '' }) // fast config
62
+ .mockResolvedValueOnce({ code: 0, stdout: '{"load": 0.5}', stderr: '' }); // slow probe
63
+ ```
64
+
65
+ ### Pattern 3: MCP Handler Test
66
+
67
+ Import the handler directly and call it with the expected parameters. Assert on `result.content[0].text`.
68
+
69
+ ```typescript
70
+ import { handleServerAudit } from '../serverAudit.js';
71
+
72
+ // Mock the core dependency
73
+ jest.mock('../../src/core/audit/runner.js');
74
+ import { runAudit } from '../../src/core/audit/runner.js';
75
+ const mockRunAudit = runAudit as jest.MockedFunction<typeof runAudit>;
76
+
77
+ describe('handleServerAudit', () => {
78
+ beforeEach(() => jest.resetAllMocks());
79
+
80
+ it('returns audit results', async () => {
81
+ mockRunAudit.mockResolvedValueOnce({ score: 85, checks: [] });
82
+
83
+ const result = await handleServerAudit({
84
+ server: 'test-server',
85
+ category: 'ssh',
86
+ });
87
+
88
+ expect(result.isError).toBeUndefined();
89
+ expect(result.content[0].text).toContain('85');
90
+ });
91
+
92
+ it('returns error on failure', async () => {
93
+ mockRunAudit.mockRejectedValueOnce(new Error('SSH timeout'));
94
+
95
+ const result = await handleServerAudit({ server: 'test-server' });
96
+
97
+ expect(result.isError).toBe(true);
98
+ expect(result.content[0].text).toContain('SSH timeout');
99
+ });
100
+ });
101
+ ```
102
+
103
+ ### Pattern 4: Command Test (mock core, not low-level deps)
104
+
105
+ Test commands by mocking the core module — not `sshExec`, not providers. This verifies delegation.
106
+
107
+ ```typescript
108
+ jest.mock('../../src/core/backup.js');
109
+ import { backupServer } from '../../src/core/backup.js';
110
+ const mockBackupServer = backupServer as jest.MockedFunction<typeof backupServer>;
111
+
112
+ describe('backup command', () => {
113
+ beforeEach(() => jest.resetAllMocks());
114
+
115
+ it('delegates to backupServer core function', async () => {
116
+ mockBackupServer.mockResolvedValueOnce({
117
+ success: true,
118
+ backupPath: '/home/user/.kastell/backups/myserver',
119
+ });
120
+
121
+ // Execute command action directly (Commander action callback)
122
+ await backupAction({ server: 'myserver' });
123
+
124
+ expect(mockBackupServer).toHaveBeenCalledWith('myserver');
125
+ });
126
+ });
127
+ ```
128
+
129
+ ## Core Function Signature Conventions
130
+
131
+ Core functions return typed result objects, never throw to the caller:
132
+
133
+ ```typescript
134
+ // Pattern: return { success, data?, error?, hint? }
135
+ export async function exampleCore(server: string): Promise<ExampleResult> {
136
+ try {
137
+ const record = getServerRecord(server); // throws if not found
138
+ assertValidIp(record.ip); // throws if invalid
139
+ // ... business logic ...
140
+ return { success: true, data: result };
141
+ } catch (err) {
142
+ return { success: false, error: String(err) };
143
+ }
144
+ }
145
+ ```
@@ -0,0 +1,136 @@
1
+ # Kastell Pitfalls
2
+
3
+ Known traps, symptoms, and fixes. Severity: HIGH (blocks correct behavior), MEDIUM (causes test/maintenance pain), LOW (minor inconsistency).
4
+
5
+ ---
6
+
7
+ ## 1. Adapter Bypass (HIGH)
8
+
9
+ **Symptom:** `if (server.platform === 'coolify') { port = 8000 } else { port = 3000 }` in `src/commands/`
10
+
11
+ **Root cause:** Command accesses platform properties directly instead of using the adapter.
12
+
13
+ **Fix:** Use `getAdapter(platform)` from `factory.ts` and read `adapter.port`, `adapter.defaultLogService`, `adapter.platformPorts`.
14
+
15
+ ```typescript
16
+ // WRONG
17
+ const port = server.platform === 'coolify' ? 8000 : 3000;
18
+
19
+ // CORRECT
20
+ import { getAdapter } from '../../src/adapters/factory.js';
21
+ const adapter = getAdapter(server.platform);
22
+ const port = adapter.port;
23
+ ```
24
+
25
+ ---
26
+
27
+ ## 2. Business Logic in Commands (HIGH)
28
+
29
+ **Symptom:** Complex calculations, API calls, try/catch blocks, or SSH calls in `src/commands/*.ts`.
30
+
31
+ **Root cause:** Logic was not extracted to `src/core/`.
32
+
33
+ **Fix:** Extract all logic to a new `src/core/<name>.ts` function. Command only calls core and displays the result.
34
+
35
+ ---
36
+
37
+ ## 3. UI in Core (HIGH)
38
+
39
+ **Symptom:** `chalk.green(...)`, `ora('...').start()`, or `console.log()` in `src/core/*.ts`.
40
+
41
+ **Root cause:** Core function was handling display instead of returning data.
42
+
43
+ **Fix:** Core functions return plain data objects. The command layer (or MCP handler) handles display using chalk/ora.
44
+
45
+ ---
46
+
47
+ ## 4. Direct Adapter Import (MEDIUM)
48
+
49
+ **Symptom:** `import { CoolifyAdapter } from '../../src/adapters/coolify.js'` in a command or core file.
50
+
51
+ **Root cause:** Bypasses the factory cache and breaks the abstraction boundary.
52
+
53
+ **Fix:** Always use `getAdapter(platform)` from `src/adapters/factory.ts`.
54
+
55
+ ---
56
+
57
+ ## 5. Inline Adapter Mocks in Tests (MEDIUM)
58
+
59
+ **Symptom:** `const adapter = { healthCheck: jest.fn(), port: 8000, ... }` scattered across test files.
60
+
61
+ **Root cause:** Not using the centralized mock factory.
62
+
63
+ **Fix:** Use `createMockAdapter()` from `tests/helpers/mockAdapter.ts`. When the `PlatformAdapter` interface gains new methods, only `mockAdapter.ts` needs updating.
64
+
65
+ ---
66
+
67
+ ## 6. SSH Batch Grouping (MEDIUM)
68
+
69
+ **Symptom:** Audit or health commands call `sshExec` 4-6 times sequentially, each fetching partially overlapping data.
70
+
71
+ **Root cause:** Each check independently fetches data instead of using shared batched results.
72
+
73
+ **Fix:** Batch fast config commands together (single SSH call), batch slow probe commands together. Use head limits appropriate to the data volume (e.g., `head -50` for audit log checks).
74
+
75
+ ---
76
+
77
+ ## 7. Jest requireActual Crash (MEDIUM)
78
+
79
+ **Symptom:** Tests crash on Node v24+ with an error related to `jest.requireActual`.
80
+
81
+ **Root cause:** `jest.requireActual` behavior changed in Node v24.
82
+
83
+ **Fix:** Use inline `jest.fn()` mocks instead of `jest.requireActual`. For module-level mocks, use `jest.mock()` with a factory function.
84
+
85
+ ---
86
+
87
+ ## 8. Module-Level Side Effects (MEDIUM)
88
+
89
+ **Symptom:** Test imports a module that registers listeners or modifies globals at load time, causing unexpected behavior when other tests run.
90
+
91
+ **Root cause:** Module has top-level side effects (e.g., `process.on('SIGINT', ...)` at module scope).
92
+
93
+ **Fix:** Mock the module in ALL test files that import it, not just the direct test file. Side effects occur at import time.
94
+
95
+ ---
96
+
97
+ ## 9. Hardcoded Port Numbers (LOW)
98
+
99
+ **Symptom:** `8000` or `3000` literals appear in `src/commands/` or `src/core/` files.
100
+
101
+ **Root cause:** Port copied from constants instead of read from adapter.
102
+
103
+ **Fix:** Use `adapter.port` for platform HTTP port, `adapter.platformPorts` for firewall protection list.
104
+
105
+ ---
106
+
107
+ ## 10. PROVIDER_REGISTRY Mismatch (LOW)
108
+
109
+ **Symptom:** New provider works via direct code path but fails CLI validation, completion, or `--provider` flag parsing.
110
+
111
+ **Root cause:** Provider added to `src/providers/` but not added to `PROVIDER_REGISTRY` in `src/constants.ts`.
112
+
113
+ **Fix:** Always add to `PROVIDER_REGISTRY` first — it is the single source of truth for provider enumeration, validation, and display.
114
+
115
+ ---
116
+
117
+ ## 11. SSH Timeout Too Short (LOW)
118
+
119
+ **Symptom:** Long-running commands (lock, audit, update) fail silently or with cryptic timeout errors.
120
+
121
+ **Root cause:** Default SSH timeout (30s) is insufficient for operations like platform update (~3 minutes).
122
+
123
+ **Fix:** Use 180s timeout for slow operations:
124
+ ```typescript
125
+ await sshExec(ip, command, { timeout: 180_000 });
126
+ ```
127
+
128
+ ---
129
+
130
+ ## 12. describe.each + clearAllMocks (LOW)
131
+
132
+ **Symptom:** Tests pass individually but fail when the full suite runs. Mock call counts are wrong in later tests.
133
+
134
+ **Root cause:** `jest.clearAllMocks()` clears call history but does not reset mock implementations. `describe.each` reuses the same mock instance across parameterized runs.
135
+
136
+ **Fix:** Use `jest.resetAllMocks()` in `beforeEach` when using `describe.each`. This resets both call history and implementations.
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env bash
2
+ # check_coverage.sh — Compare audit check count vs test count.
3
+ # Usage: bash check_coverage.sh [project-root]
4
+ #
5
+ # Counts audit checks defined in src/core/audit/checks/ and matching tests.
6
+ # Requires: node
7
+
8
+ set -euo pipefail
9
+
10
+ PROJECT_ROOT="${1:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
11
+
12
+ node -e "
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+
16
+ const root = process.argv[1];
17
+ const checksDir = path.join(root, 'src', 'core', 'audit', 'checks');
18
+
19
+ if (!fs.existsSync(checksDir)) {
20
+ console.error('Error: ' + checksDir + ' not found');
21
+ process.exit(1);
22
+ }
23
+
24
+ // Read all .ts files in checks dir (excluding index.ts)
25
+ const checkFiles = fs.readdirSync(checksDir)
26
+ .filter(f => f.endsWith('.ts') && f !== 'index.ts');
27
+
28
+ let totalChecks = 0;
29
+ const uniqueIds = new Set();
30
+ const perFile = [];
31
+
32
+ for (const file of checkFiles) {
33
+ const content = fs.readFileSync(path.join(checksDir, file), 'utf8');
34
+ const ids = [...content.matchAll(/id:\s*['\"]([^'\"]+)['\"]/g)].map(m => m[1]);
35
+ totalChecks += ids.length;
36
+ ids.forEach(id => uniqueIds.add(id));
37
+ perFile.push({ name: file.replace('.ts', ''), checks: ids.length });
38
+ }
39
+
40
+ // Count categories from index.ts
41
+ let categories = 0;
42
+ const indexPath = path.join(checksDir, 'index.ts');
43
+ if (fs.existsSync(indexPath)) {
44
+ const indexContent = fs.readFileSync(indexPath, 'utf8');
45
+ categories = (indexContent.match(/sectionName/g) || []).length;
46
+ }
47
+
48
+ // Find audit test files recursively
49
+ function findTests(dir) {
50
+ let count = 0;
51
+ if (!fs.existsSync(dir)) return 0;
52
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
53
+ const full = path.join(dir, entry.name);
54
+ if (entry.isDirectory()) count += findTests(full);
55
+ else if (entry.name.endsWith('.test.ts') && entry.name.includes('audit') ||
56
+ full.includes('audit') && entry.name.endsWith('.test.ts')) {
57
+ count++;
58
+ }
59
+ }
60
+ return count;
61
+ }
62
+ const testCount = findTests(path.join(root, 'src'));
63
+
64
+ // Pre-index all test file contents once (avoids N+1 file reads)
65
+ const testIndex = new Set();
66
+ function indexTests(dir) {
67
+ try {
68
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
69
+ const full = path.join(dir, entry.name);
70
+ if (entry.isDirectory()) indexTests(full);
71
+ else if (entry.name.endsWith('.test.ts')) {
72
+ const content = fs.readFileSync(full, 'utf8');
73
+ // Extract referenced module names from imports and test descriptions
74
+ for (const match of content.matchAll(/['\"]([^'\"]*audit[^'\"]*)['\"]|from\s+['\"]([^'\"]+)['\"]/g)) {
75
+ const ref = match[1] || match[2] || '';
76
+ ref.split('/').forEach(part => testIndex.add(part.replace('.js', '').replace('.ts', '')));
77
+ }
78
+ }
79
+ }
80
+ } catch {}
81
+ }
82
+ indexTests(path.join(root, 'src'));
83
+ function hasTestFor(name) { return testIndex.has(name); }
84
+
85
+ console.log('=== Audit Check Coverage ===');
86
+ console.log('Project: ' + root);
87
+ console.log('');
88
+ console.log('Check source files: ' + checkFiles.length);
89
+ console.log('Categories: ' + categories);
90
+ console.log('Checks defined: ' + totalChecks);
91
+ console.log('Unique check IDs: ' + uniqueIds.size);
92
+ console.log('Audit test files: ' + testCount);
93
+ console.log('');
94
+ console.log('Per-file breakdown:');
95
+
96
+ perFile.sort((a, b) => a.name.localeCompare(b.name));
97
+ for (const f of perFile) {
98
+ const tested = hasTestFor(f.name) ? '✓' : '✗';
99
+ console.log(' ' + tested + ' ' + f.name.padEnd(20) + ' ' + String(f.checks).padStart(3) + ' checks');
100
+ }
101
+ " "$PROJECT_ROOT"
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env bash
2
+ # fleet_report.sh — Generate a fleet-wide server score table.
3
+ # Usage: kastell fleet --json | bash fleet_report.sh
4
+ # OR: bash fleet_report.sh < fleet-output.json
5
+ # OR: bash fleet_report.sh fleet-output.json
6
+ #
7
+ # Requires: node
8
+
9
+ set -euo pipefail
10
+
11
+ if [[ -n "${1:-}" && -f "$1" ]]; then
12
+ INPUT=$(cat "$1")
13
+ elif [[ ! -t 0 ]]; then
14
+ INPUT=$(cat)
15
+ else
16
+ echo "Usage: kastell fleet --json | bash fleet_report.sh" >&2
17
+ exit 1
18
+ fi
19
+
20
+ node -e "
21
+ const data = JSON.parse(process.argv[1]);
22
+ const servers = data.servers || data.fleet || data || [];
23
+
24
+ if (!Array.isArray(servers) || servers.length === 0) {
25
+ console.log('No servers found in fleet data.');
26
+ process.exit(0);
27
+ }
28
+
29
+ // Header
30
+ const cols = { name: 20, ip: 16, provider: 12, mode: 8, score: 6, health: 10 };
31
+ const pad = (s, n) => String(s || '-').slice(0, n).padEnd(n);
32
+ const sep = '-'.repeat(Object.values(cols).reduce((a, b) => a + b + 3, 0));
33
+
34
+ console.log('=== Kastell Fleet Report ===');
35
+ console.log('Servers: ' + servers.length);
36
+ console.log('');
37
+ console.log(
38
+ pad('Name', cols.name) + ' | ' +
39
+ pad('IP', cols.ip) + ' | ' +
40
+ pad('Provider', cols.provider) + ' | ' +
41
+ pad('Mode', cols.mode) + ' | ' +
42
+ pad('Score', cols.score) + ' | ' +
43
+ pad('Health', cols.health)
44
+ );
45
+ console.log(sep);
46
+
47
+ // Sort by score (lowest first = needs attention)
48
+ const sorted = [...servers].sort((a, b) => (a.score ?? 0) - (b.score ?? 0));
49
+
50
+ for (const s of sorted) {
51
+ const score = s.score ?? s.auditScore ?? '-';
52
+ const health = s.health ?? s.status ?? '-';
53
+ const icon = health === 'ONLINE' ? '●' : health === 'DEGRADED' ? '◐' : '○';
54
+ console.log(
55
+ pad(s.name, cols.name) + ' | ' +
56
+ pad(s.ip, cols.ip) + ' | ' +
57
+ pad(s.provider, cols.provider) + ' | ' +
58
+ pad(s.mode, cols.mode) + ' | ' +
59
+ pad(score, cols.score) + ' | ' +
60
+ icon + ' ' + pad(health, cols.health - 2)
61
+ );
62
+ }
63
+
64
+ // Summary
65
+ const scores = sorted.map(s => s.score ?? s.auditScore).filter(s => typeof s === 'number');
66
+ if (scores.length > 0) {
67
+ const avg = Math.round(scores.reduce((a, b) => a + b, 0) / scores.length);
68
+ const min = Math.min(...scores);
69
+ const max = Math.max(...scores);
70
+ console.log('');
71
+ console.log('Avg: ' + avg + ' | Min: ' + min + ' | Max: ' + max);
72
+ }
73
+ " "$INPUT"
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env bash
2
+ # parse_audit.sh — Parse kastell audit JSON into 5 security domain summaries.
3
+ # Usage: kastell audit --server <name> --json | bash parse_audit.sh
4
+ # OR: bash parse_audit.sh < audit-output.json
5
+ # OR: bash parse_audit.sh audit-output.json
6
+ #
7
+ # Requires: node (uses inline JS for JSON parsing — no jq dependency)
8
+
9
+ set -euo pipefail
10
+
11
+ # Read JSON from file arg, stdin, or pipe
12
+ if [[ -n "${1:-}" && -f "$1" ]]; then
13
+ INPUT=$(cat "$1")
14
+ elif [[ ! -t 0 ]]; then
15
+ INPUT=$(cat)
16
+ else
17
+ echo "Usage: kastell audit --server <name> --json | bash parse_audit.sh" >&2
18
+ echo " OR: bash parse_audit.sh <audit-json-file>" >&2
19
+ exit 1
20
+ fi
21
+
22
+ node -e "
23
+ const data = JSON.parse(process.argv[1]);
24
+ const checks = data.checks || data.results || [];
25
+
26
+ // 5 security domain mapping
27
+ const DOMAINS = {
28
+ 'Perimeter': ['Network', 'Firewall', 'DNS Security'],
29
+ 'Authentication': ['SSH', 'Auth', 'Crypto', 'Accounts'],
30
+ 'Runtime': ['Docker', 'Services', 'Boot', 'Scheduling'],
31
+ 'Internals': ['Filesystem', 'Logging', 'Kernel', 'Memory'],
32
+ 'Compliance': ['Updates', 'File Integrity', 'Malware', 'MAC', 'Secrets',
33
+ 'Cloud Metadata', 'Supply Chain', 'Backup Hygiene',
34
+ 'Resource Limits', 'Incident Readiness', 'Banners', 'Time',
35
+ 'TLS', 'HTTP Security Headers'],
36
+ };
37
+
38
+ // Map categories to domains
39
+ const catToDomain = {};
40
+ for (const [domain, cats] of Object.entries(DOMAINS)) {
41
+ for (const cat of cats) catToDomain[cat.toLowerCase()] = domain;
42
+ }
43
+
44
+ // Bucket checks
45
+ const buckets = {};
46
+ for (const d of Object.keys(DOMAINS)) buckets[d] = { passed: 0, failed: 0, critical: [] };
47
+
48
+ for (const c of checks) {
49
+ const cat = (c.category || '').toLowerCase();
50
+ let domain = 'Compliance'; // default
51
+ for (const [key, val] of Object.entries(catToDomain)) {
52
+ if (cat.includes(key)) { domain = val; break; }
53
+ }
54
+ if (c.passed) buckets[domain].passed++;
55
+ else {
56
+ buckets[domain].failed++;
57
+ if (c.severity === 'critical') buckets[domain].critical.push(c.id || c.name);
58
+ }
59
+ }
60
+
61
+ // Output
62
+ const score = data.score ?? data.overallScore ?? 'N/A';
63
+ console.log('=== Kastell Audit Domain Summary ===');
64
+ console.log('Overall Score: ' + score + '/100');
65
+ console.log('');
66
+
67
+ for (const [domain, b] of Object.entries(buckets)) {
68
+ const total = b.passed + b.failed;
69
+ const pct = total > 0 ? Math.round(b.passed / total * 100) : 0;
70
+ const bar = '█'.repeat(Math.round(pct / 5)) + '░'.repeat(20 - Math.round(pct / 5));
71
+ console.log(domain + ': ' + b.passed + '/' + total + ' (' + pct + '%) ' + bar);
72
+ if (b.critical.length > 0) {
73
+ console.log(' Critical: ' + b.critical.slice(0, 3).join(', '));
74
+ }
75
+ }
76
+ " "$INPUT"
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: kastell-research
3
+ description: Read-only Kastell codebase exploration. Use when tracing a bug across files, mapping callsites before refactoring, or exploring unfamiliar subsystems. Runs in isolated context with Explore agent.
4
+ context: fork
5
+ agent: Explore
6
+ allowed-tools: Read, Grep, Glob
7
+ effort: medium
8
+ memory: project
9
+ ---
10
+
11
+ # Kastell Research
12
+
13
+ ## Purpose
14
+
15
+ Explore the Kastell codebase using read-only tools (Read, Grep, Glob). Runs in a forked Explore agent with Kastell architecture knowledge inlined.
16
+
17
+ ## When to Use
18
+
19
+ - **Bug investigation:** Trace a bug from CLI command through core logic to adapters/providers. Start at the command file, follow imports to core, check utils and adapters.
20
+ - **Feature mapping:** Map all callsites of a function, trace the import chain, understand how subsystems connect before making changes.
21
+ - **Architecture question:** Understand how audit categories work, how the adapter dispatch flows, or how lock hardening steps are structured.
22
+
23
+ ## Live Codebase
24
+
25
+ **Commands:**
26
+ !`node -e "import('fs').then(f=>console.log(f.readdirSync('src/commands').filter(x=>x.endsWith('.ts')).map(x=>x.replace('.ts','')).join(', '))).catch(()=>console.log('commands dir not found'))"`
27
+ **Provider registry:**
28
+ !`node -e "import('fs').then(f=>{const c=f.readFileSync('src/constants.ts','utf8');const m=c.match(/PROVIDER_REGISTRY[\s\S]{0,200}/);console.log(m?m[0].split('\n').slice(0,4).join('\n'):'not found')}).catch(()=>console.log('constants.ts not found'))"`
29
+
30
+ ## Architecture Map
31
+
32
+ ```
33
+ src/
34
+ commands/ # 31 thin CLI wrappers (parse args + delegate only)
35
+ core/ # Business logic (ALL computation here)
36
+ audit/ # 30 audit categories, 457+ checks
37
+ lock/ # 24-step server hardening
38
+ providers/ # Cloud API: hetzner, digitalocean, vultr, linode
39
+ adapters/ # Platform abstraction: coolify, dokploy
40
+ factory.ts # getAdapter(platform) — entry point
41
+ mcp/
42
+ server.ts # 13 tool registrations
43
+ tools/ # Handler files
44
+ utils/ # ssh, config, cloudInit, modeGuard
45
+ types/ # ServerMode, ServerRecord, Platform
46
+ constants.ts # PROVIDER_REGISTRY
47
+ ```
48
+
49
+ ## Layer Flow
50
+
51
+ Commands (parse args) --> Core (business logic) --> Providers (cloud API) / Adapters (platform ops). MCP tools also delegate to Core.
52
+
53
+ ## Research Workflows
54
+
55
+ **Bug investigation:**
56
+ 1. Find the command file (`src/commands/<name>.ts`)
57
+ 2. Follow the core import (`src/core/<name>.ts`)
58
+ 3. Check adapter/provider calls
59
+ 4. Check utils (ssh, config)
60
+
61
+ **Feature mapping:**
62
+ 1. Grep for the function name
63
+ 2. Follow import chain
64
+ 3. Map all callsites
65
+ 4. Check test coverage in `__tests__/`
66
+
67
+ **Architecture question:**
68
+ 1. Read the Architecture Map above
69
+ 2. Read `kastell-plugin/skills/kastell-ops/SKILL.md` for full detail (adapter contract, provider registry, layer rules)
70
+ 3. Trace specific files
71
+
72
+ ## Debug by Symptom
73
+
74
+ Common failure patterns and where to look first:
75
+
76
+ | Symptom | Start Here | Then Check |
77
+ |---------|-----------|------------|
78
+ | SSH auth failure | `src/utils/ssh.ts` → `sshExec()` | `assertValidIp()`, server config `~/.kastell/servers.json`, banner parsing |
79
+ | Provider API error | `src/providers/<name>.ts` | `withProviderErrorHandling()` in `src/utils/retry.ts`, API token config |
80
+ | Audit check false positive | `src/core/audit/checks/<category>.ts` | SSH command output parsing, regex pattern, `sshExec` mock in test |
81
+ | Fix rejected (SAFE tier) | `src/core/fix.ts` → `resolveTier()` | `FORBIDDEN_PATTERNS`, shell redirect/pipe in fixCommand string |
82
+ | MCP tool error | `src/mcp/tools/<name>.ts` | Handler → core delegation, Zod schema validation, `result.content` format |
83
+ | Lock step failure | `src/core/lock.ts` | Step's SSH command, `sshExec` stderr, cloud-init completion |
84
+ | Config not found | `src/utils/config.ts` | `~/.kastell/` dir existence, `servers.json` format, migration from `~/.quicklify/` |
85
+
86
+ **Known pitfalls:** See `kastell-plugin/skills/kastell-ops/references/pitfalls.md`
87
+
88
+ ## ARGUMENTS
89
+
90
+ $ARGUMENTS