kastell 2.2.4 → 2.2.6

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 (199) hide show
  1. package/.claude-plugin/marketplace.json +18 -18
  2. package/.claude-plugin/plugin.json +45 -38
  3. package/CHANGELOG.md +1313 -1266
  4. package/LICENSE +201 -201
  5. package/NOTICE +5 -5
  6. package/README.md +1 -1
  7. package/README.tr.md +1 -1
  8. package/bin/kastell +2 -2
  9. package/bin/kastell-mcp +5 -5
  10. package/dist/adapters/coolify.js +92 -92
  11. package/dist/adapters/dokploy.js +99 -99
  12. package/dist/commands/fix.d.ts +2 -0
  13. package/dist/commands/fix.d.ts.map +1 -1
  14. package/dist/commands/fix.js +26 -1
  15. package/dist/commands/fix.js.map +1 -1
  16. package/dist/commands/interactive/plugins.d.ts.map +1 -1
  17. package/dist/commands/interactive/plugins.js +26 -2
  18. package/dist/commands/interactive/plugins.js.map +1 -1
  19. package/dist/commands/plugin.d.ts.map +1 -1
  20. package/dist/commands/plugin.js +6 -2
  21. package/dist/commands/plugin.js.map +1 -1
  22. package/dist/core/audit/commands.d.ts +13 -2
  23. package/dist/core/audit/commands.d.ts.map +1 -1
  24. package/dist/core/audit/commands.js +39 -2
  25. package/dist/core/audit/commands.js.map +1 -1
  26. package/dist/core/audit/explainCheck.d.ts +1 -0
  27. package/dist/core/audit/explainCheck.d.ts.map +1 -1
  28. package/dist/core/audit/explainCheck.js +1 -1
  29. package/dist/core/audit/explainCheck.js.map +1 -1
  30. package/dist/core/audit/fix-history.d.ts +3 -1
  31. package/dist/core/audit/fix-history.d.ts.map +1 -1
  32. package/dist/core/audit/fix-history.js +6 -2
  33. package/dist/core/audit/fix-history.js.map +1 -1
  34. package/dist/core/audit/fix.d.ts.map +1 -1
  35. package/dist/core/audit/fix.js +22 -0
  36. package/dist/core/audit/fix.js.map +1 -1
  37. package/dist/core/audit/formatters/badge.js +20 -20
  38. package/dist/core/audit/index.d.ts.map +1 -1
  39. package/dist/core/audit/index.js +12 -3
  40. package/dist/core/audit/index.js.map +1 -1
  41. package/dist/core/audit/listChecks.d.ts.map +1 -1
  42. package/dist/core/audit/listChecks.js +24 -0
  43. package/dist/core/audit/listChecks.js.map +1 -1
  44. package/dist/core/audit/pluginAudit.d.ts +8 -0
  45. package/dist/core/audit/pluginAudit.d.ts.map +1 -0
  46. package/dist/core/audit/pluginAudit.js +134 -0
  47. package/dist/core/audit/pluginAudit.js.map +1 -0
  48. package/dist/core/audit/pluginFix.d.ts +19 -0
  49. package/dist/core/audit/pluginFix.d.ts.map +1 -0
  50. package/dist/core/audit/pluginFix.js +122 -0
  51. package/dist/core/audit/pluginFix.js.map +1 -0
  52. package/dist/core/audit/snapshot.d.ts +4 -4
  53. package/dist/core/audit/types.d.ts +2 -1
  54. package/dist/core/audit/types.d.ts.map +1 -1
  55. package/dist/core/completions.js +631 -631
  56. package/dist/core/plugin.d.ts +6 -0
  57. package/dist/core/plugin.d.ts.map +1 -1
  58. package/dist/core/plugin.js +2 -0
  59. package/dist/core/plugin.js.map +1 -1
  60. package/dist/index.js +7 -0
  61. package/dist/index.js.map +1 -1
  62. package/dist/mcp/index.js +1 -1
  63. package/dist/mcp/index.js.map +1 -1
  64. package/dist/mcp/pluginTools.d.ts +5 -0
  65. package/dist/mcp/pluginTools.d.ts.map +1 -0
  66. package/dist/mcp/pluginTools.js +54 -0
  67. package/dist/mcp/pluginTools.js.map +1 -0
  68. package/dist/mcp/prompts/workflows.d.ts +17 -0
  69. package/dist/mcp/prompts/workflows.d.ts.map +1 -0
  70. package/dist/mcp/prompts/workflows.js +73 -0
  71. package/dist/mcp/prompts/workflows.js.map +1 -0
  72. package/dist/mcp/resources/checks.d.ts +4 -0
  73. package/dist/mcp/resources/checks.d.ts.map +1 -0
  74. package/dist/mcp/resources/checks.js +49 -0
  75. package/dist/mcp/resources/checks.js.map +1 -0
  76. package/dist/mcp/resources/servers.d.ts +4 -0
  77. package/dist/mcp/resources/servers.d.ts.map +1 -0
  78. package/dist/mcp/resources/servers.js +59 -0
  79. package/dist/mcp/resources/servers.js.map +1 -0
  80. package/dist/mcp/server.d.ts +1 -1
  81. package/dist/mcp/server.d.ts.map +1 -1
  82. package/dist/mcp/server.js +68 -35
  83. package/dist/mcp/server.js.map +1 -1
  84. package/dist/mcp/tools/serverAudit.d.ts +1 -1
  85. package/dist/mcp/tools/serverExplain.d.ts.map +1 -1
  86. package/dist/mcp/tools/serverExplain.js.map +1 -1
  87. package/dist/mcp/tools/serverFix.d.ts.map +1 -1
  88. package/dist/mcp/tools/serverFix.js +7 -1
  89. package/dist/mcp/tools/serverFix.js.map +1 -1
  90. package/dist/mcp/tools/serverFleet.d.ts.map +1 -1
  91. package/dist/mcp/tools/serverFleet.js.map +1 -1
  92. package/dist/mcp/tools/serverInfo.d.ts +1 -1
  93. package/dist/mcp/tools/serverInfo.js +1 -1
  94. package/dist/mcp/tools/serverManage.d.ts +2 -1
  95. package/dist/mcp/tools/serverManage.d.ts.map +1 -1
  96. package/dist/mcp/tools/serverManage.js +50 -5
  97. package/dist/mcp/tools/serverManage.js.map +1 -1
  98. package/dist/mcp/tools/serverPlugin.d.ts +3 -0
  99. package/dist/mcp/tools/serverPlugin.d.ts.map +1 -1
  100. package/dist/mcp/tools/serverPlugin.js +11 -1
  101. package/dist/mcp/tools/serverPlugin.js.map +1 -1
  102. package/dist/mcp/tools/serverProvision.d.ts +5 -5
  103. package/dist/mcp/tools/serverProvision.d.ts.map +1 -1
  104. package/dist/mcp/tools/serverProvision.js +31 -9
  105. package/dist/mcp/tools/serverProvision.js.map +1 -1
  106. package/dist/mcp/tools/serverSecure.d.ts.map +1 -1
  107. package/dist/mcp/tools/serverSecure.js +30 -1
  108. package/dist/mcp/tools/serverSecure.js.map +1 -1
  109. package/dist/mcp/utils.d.ts +25 -0
  110. package/dist/mcp/utils.d.ts.map +1 -1
  111. package/dist/mcp/utils.js +36 -0
  112. package/dist/mcp/utils.js.map +1 -1
  113. package/dist/mcp-bundle.mjs +102301 -0
  114. package/dist/plugin/handlerResolver.d.ts +2 -0
  115. package/dist/plugin/handlerResolver.d.ts.map +1 -0
  116. package/dist/plugin/handlerResolver.js +16 -0
  117. package/dist/plugin/handlerResolver.js.map +1 -0
  118. package/dist/plugin/loader.d.ts.map +1 -1
  119. package/dist/plugin/loader.js +41 -4
  120. package/dist/plugin/loader.js.map +1 -1
  121. package/dist/plugin/registerCommands.d.ts +4 -0
  122. package/dist/plugin/registerCommands.d.ts.map +1 -0
  123. package/dist/plugin/registerCommands.js +45 -0
  124. package/dist/plugin/registerCommands.js.map +1 -0
  125. package/dist/plugin/registry.d.ts +20 -1
  126. package/dist/plugin/registry.d.ts.map +1 -1
  127. package/dist/plugin/registry.js +51 -1
  128. package/dist/plugin/registry.js.map +1 -1
  129. package/dist/plugin/sdk/constants.d.ts +2 -0
  130. package/dist/plugin/sdk/constants.d.ts.map +1 -1
  131. package/dist/plugin/sdk/constants.js +2 -0
  132. package/dist/plugin/sdk/constants.js.map +1 -1
  133. package/dist/plugin/sdk/types.d.ts +74 -1
  134. package/dist/plugin/sdk/types.d.ts.map +1 -1
  135. package/dist/plugin/validate.d.ts +2 -1
  136. package/dist/plugin/validate.d.ts.map +1 -1
  137. package/dist/plugin/validate.js +106 -1
  138. package/dist/plugin/validate.js.map +1 -1
  139. package/dist/utils/cloudInit.js +58 -58
  140. package/dist/utils/fileLock.d.ts +5 -1
  141. package/dist/utils/fileLock.d.ts.map +1 -1
  142. package/dist/utils/fileLock.js +70 -15
  143. package/dist/utils/fileLock.js.map +1 -1
  144. package/dist/utils/paths.d.ts +0 -1
  145. package/dist/utils/paths.d.ts.map +1 -1
  146. package/dist/utils/paths.js +1 -2
  147. package/dist/utils/paths.js.map +1 -1
  148. package/dist/utils/secureWrite.d.ts.map +1 -1
  149. package/dist/utils/secureWrite.js +3 -38
  150. package/dist/utils/secureWrite.js.map +1 -1
  151. package/dist/utils/version.d.ts.map +1 -1
  152. package/dist/utils/version.js +19 -4
  153. package/dist/utils/version.js.map +1 -1
  154. package/kastell-plugin/.claude-plugin/plugin.json +20 -20
  155. package/kastell-plugin/.mcp.json +15 -8
  156. package/kastell-plugin/README.md +113 -113
  157. package/kastell-plugin/agents/kastell-auditor.md +77 -77
  158. package/kastell-plugin/agents/scripts/bucket_mapper.sh +101 -101
  159. package/kastell-plugin/agents/scripts/trend_report.sh +91 -91
  160. package/kastell-plugin/hooks/destroy-block.cjs +31 -31
  161. package/kastell-plugin/hooks/hooks.json +57 -57
  162. package/kastell-plugin/hooks/pre-commit-audit-guard.cjs +75 -75
  163. package/kastell-plugin/hooks/session-audit.cjs +86 -86
  164. package/kastell-plugin/hooks/session-log.cjs +56 -56
  165. package/kastell-plugin/hooks/stop-quality-check.cjs +72 -72
  166. package/kastell-plugin/skills/kastell-careful/SKILL.md +64 -64
  167. package/kastell-plugin/skills/kastell-ops/SKILL.md +139 -139
  168. package/kastell-plugin/skills/kastell-ops/references/commands.md +45 -45
  169. package/kastell-plugin/skills/kastell-ops/references/mcp-tools.md +50 -50
  170. package/kastell-plugin/skills/kastell-ops/references/patterns.md +145 -145
  171. package/kastell-plugin/skills/kastell-ops/references/pitfalls.md +136 -136
  172. package/kastell-plugin/skills/kastell-ops/scripts/check_coverage.sh +101 -101
  173. package/kastell-plugin/skills/kastell-ops/scripts/fleet_report.sh +73 -73
  174. package/kastell-plugin/skills/kastell-ops/scripts/parse_audit.sh +76 -76
  175. package/kastell-plugin/skills/kastell-research/SKILL.md +90 -90
  176. package/kastell-plugin/skills/kastell-scaffold/SKILL.md +104 -104
  177. package/kastell-plugin/skills/kastell-scaffold/references/template-audit-check.md +150 -150
  178. package/kastell-plugin/skills/kastell-scaffold/references/template-command.md +80 -80
  179. package/kastell-plugin/skills/kastell-scaffold/references/template-mcp-tool.md +72 -72
  180. package/kastell-plugin/skills/kastell-scaffold/references/template-provider.md +67 -67
  181. package/kastell-plugin/skills/kastell-scaffold/scripts/scaffold.sh +180 -180
  182. package/kastell-plugin/skills/kastell-scaffold/templates/check-test.ts.tpl +27 -27
  183. package/kastell-plugin/skills/kastell-scaffold/templates/check.ts.tpl +50 -50
  184. package/kastell-plugin/skills/kastell-scaffold/templates/command-core.ts.tpl +18 -18
  185. package/kastell-plugin/skills/kastell-scaffold/templates/command-test.ts.tpl +17 -17
  186. package/kastell-plugin/skills/kastell-scaffold/templates/command.ts.tpl +25 -25
  187. package/kastell-plugin/skills/kastell-scaffold/templates/mcp-tool-test.ts.tpl +30 -30
  188. package/kastell-plugin/skills/kastell-scaffold/templates/mcp-tool.ts.tpl +29 -29
  189. package/kastell-plugin/skills/kastell-scaffold/templates/provider-test.ts.tpl +34 -34
  190. package/kastell-plugin/skills/kastell-scaffold/templates/provider.ts.tpl +32 -32
  191. package/package.json +125 -122
  192. package/dist/commands/interactive.d.ts +0 -11
  193. package/dist/commands/interactive.d.ts.map +0 -1
  194. package/dist/commands/interactive.js +0 -1079
  195. package/dist/commands/interactive.js.map +0 -1
  196. package/dist/core/lock.d.ts +0 -66
  197. package/dist/core/lock.d.ts.map +0 -1
  198. package/dist/core/lock.js +0 -556
  199. package/dist/core/lock.js.map +0 -1
@@ -1,113 +1,113 @@
1
- # Kastell
2
-
3
- Autonomous server security and infrastructure management for Claude Code.
4
-
5
- ## What You Get
6
-
7
- The Kastell plugin bundles 13 MCP tools, 4 skills, 1 agent, and 5 hooks that give Claude Code
8
- full control over your self-hosted server infrastructure. Use it to provision cloud servers,
9
- run 457-check security audits across 30 categories, apply 24-step hardening, manage backups,
10
- and operate entire fleets — all from natural language in Claude Code.
11
-
12
- Supported providers: Hetzner Cloud, DigitalOcean, Vultr, Linode.
13
- Supported platforms: Coolify, Dokploy.
14
-
15
- ## Prerequisites
16
-
17
- - `npm install -g kastell` — the Kastell CLI must be installed globally
18
- - At least one cloud provider API token (Hetzner, DigitalOcean, Vultr, or Linode)
19
- - `kastell setup` — run once to configure your API tokens and default provider
20
-
21
- ## Skills
22
-
23
- | Skill | Invocation | Purpose |
24
- |-------|------------|---------|
25
- | kastell-ops | Auto-loaded (background) | Architecture reference, patterns, anti-patterns, and decision trees for working in the Kastell codebase or managing Kastell-provisioned servers |
26
- | kastell-scaffold | `/kastell:scaffold` | Generate new CLI commands, MCP tools, cloud providers, and audit checks following Kastell conventions |
27
- | kastell-careful | `/kastell:careful` | Intercepts `kastell destroy` and `kastell restore` commands and requires explicit confirmation before proceeding |
28
- | kastell-research | `/kastell:research` | Read-only codebase exploration with full architecture context — for understanding behavior without making changes |
29
-
30
- **kastell-ops** loads automatically as background context whenever you work with the Kastell
31
- codebase or ask about server provisioning, audit, hardening, or provider management. It does
32
- not appear in the slash-command menu.
33
-
34
- ## Agents
35
-
36
- **`/agent:kastell-auditor`** — Parallel audit analyzer that groups all 30 audit categories into
37
- five analysis buckets (critical config, network exposure, access control, monitoring, compliance),
38
- produces structured findings with severity ratings, and remembers previous audit context across
39
- sessions using user-scoped memory.
40
-
41
- Invoke it with: "Analyze my last audit report" or "Which findings should I fix first?"
42
-
43
- Note: `kastell-fixer` is a project-scope agent, not bundled in this plugin. It requires
44
- `isolation: worktree` which only works when installed at project scope (`.claude/agents/`).
45
- Install kastell-fixer separately inside your Kastell project directory.
46
-
47
- ## Hooks
48
-
49
- | Hook | Trigger | What It Does |
50
- |------|---------|--------------|
51
- | stop-quality-check | Stop | Checks for TypeScript compilation errors, missing CHANGELOG entries, and stale README before ending the session |
52
- | session-log | PostToolUse (Bash) | Records Bash command outputs to `session.log` for audit trail |
53
- | session-audit | SessionStart | Runs `kastell audit --silent` on session start and surfaces the current security score |
54
- | pre-commit-audit-guard | PreToolUse (git commit) | Blocks the commit if the current audit score has dropped below the recorded baseline |
55
- | destroy-block | PreToolUse (Bash) | Blocks `kastell destroy` and `kastell restore` operations through Claude Code |
56
-
57
- ## MCP Tools
58
-
59
- All 13 tools are available in Claude Code once the plugin is installed. The MCP server starts
60
- automatically via the bundled `.mcp.json` configuration.
61
-
62
- | Tool | Description |
63
- |------|-------------|
64
- | server_info | List servers, check status, health, and available sizes |
65
- | server_logs | Fetch logs and system metrics from servers via SSH |
66
- | server_manage | Add, remove, or destroy servers |
67
- | server_maintain | Update platform, restart, or run full maintenance |
68
- | server_secure | SSH hardening, firewall management, and domain configuration |
69
- | server_backup | Create backups and manage cloud snapshots |
70
- | server_provision | Provision new cloud servers on Hetzner, DigitalOcean, Vultr, or Linode |
71
- | server_audit | Run the full 457-check security audit across 30 categories |
72
- | server_evidence | Collect forensic evidence packages from servers |
73
- | server_guard | Manage the autonomous security monitoring daemon |
74
- | server_doctor | Proactive health analysis with remediation recommendations |
75
- | server_lock | Apply the 24-step production hardening sequence |
76
- | server_fleet | Fleet-wide health and security posture overview |
77
-
78
- ## Quick Start
79
-
80
- ```bash
81
- # Install kastell globally
82
- npm install -g kastell
83
-
84
- # Configure your cloud provider
85
- kastell setup
86
-
87
- # In Claude Code, the plugin auto-starts the MCP server.
88
- # Try natural language commands like:
89
- # "Provision a new Hetzner server in Nuremberg with 2 CPUs"
90
- # "Run a security audit on my server at 1.2.3.4"
91
- # "Apply full hardening to my production server"
92
- # "Show me all my servers"
93
- ```
94
-
95
- After installation, the `kastell-ops` skill loads automatically in any session where you
96
- work with Kastell. Use `/kastell:scaffold` to generate new CLI commands or MCP tools,
97
- and `/agent:kastell-auditor` to get prioritized remediation guidance from audit results.
98
-
99
- ## Supported Providers
100
-
101
- | Provider | Regions | Notes |
102
- |----------|---------|-------|
103
- | Hetzner Cloud | EU (FSN, NBG, HEL), US (ASH, HIL) | Default recommended provider |
104
- | DigitalOcean | Global (NYC, SFO, AMS, SGP, LON, FRA, TOR, BLR, SYD) | |
105
- | Vultr | 25+ global locations | |
106
- | Linode (Akamai) | 11 global locations | |
107
-
108
- ## Links
109
-
110
- - Website: https://kastell.dev
111
- - GitHub: https://github.com/kastelldev/kastell
112
- - npm: https://www.npmjs.com/package/kastell
113
- - Docs: https://kastell.dev/docs
1
+ # Kastell
2
+
3
+ Autonomous server security and infrastructure management for Claude Code.
4
+
5
+ ## What You Get
6
+
7
+ The Kastell plugin bundles 13 MCP tools, 4 skills, 1 agent, and 5 hooks that give Claude Code
8
+ full control over your self-hosted server infrastructure. Use it to provision cloud servers,
9
+ run 457-check security audits across 30 categories, apply 24-step hardening, manage backups,
10
+ and operate entire fleets — all from natural language in Claude Code.
11
+
12
+ Supported providers: Hetzner Cloud, DigitalOcean, Vultr, Linode.
13
+ Supported platforms: Coolify, Dokploy.
14
+
15
+ ## Prerequisites
16
+
17
+ - `npm install -g kastell` — the Kastell CLI must be installed globally
18
+ - At least one cloud provider API token (Hetzner, DigitalOcean, Vultr, or Linode)
19
+ - `kastell setup` — run once to configure your API tokens and default provider
20
+
21
+ ## Skills
22
+
23
+ | Skill | Invocation | Purpose |
24
+ |-------|------------|---------|
25
+ | kastell-ops | Auto-loaded (background) | Architecture reference, patterns, anti-patterns, and decision trees for working in the Kastell codebase or managing Kastell-provisioned servers |
26
+ | kastell-scaffold | `/kastell:scaffold` | Generate new CLI commands, MCP tools, cloud providers, and audit checks following Kastell conventions |
27
+ | kastell-careful | `/kastell:careful` | Intercepts `kastell destroy` and `kastell restore` commands and requires explicit confirmation before proceeding |
28
+ | kastell-research | `/kastell:research` | Read-only codebase exploration with full architecture context — for understanding behavior without making changes |
29
+
30
+ **kastell-ops** loads automatically as background context whenever you work with the Kastell
31
+ codebase or ask about server provisioning, audit, hardening, or provider management. It does
32
+ not appear in the slash-command menu.
33
+
34
+ ## Agents
35
+
36
+ **`/agent:kastell-auditor`** — Parallel audit analyzer that groups all 30 audit categories into
37
+ five analysis buckets (critical config, network exposure, access control, monitoring, compliance),
38
+ produces structured findings with severity ratings, and remembers previous audit context across
39
+ sessions using user-scoped memory.
40
+
41
+ Invoke it with: "Analyze my last audit report" or "Which findings should I fix first?"
42
+
43
+ Note: `kastell-fixer` is a project-scope agent, not bundled in this plugin. It requires
44
+ `isolation: worktree` which only works when installed at project scope (`.claude/agents/`).
45
+ Install kastell-fixer separately inside your Kastell project directory.
46
+
47
+ ## Hooks
48
+
49
+ | Hook | Trigger | What It Does |
50
+ |------|---------|--------------|
51
+ | stop-quality-check | Stop | Checks for TypeScript compilation errors, missing CHANGELOG entries, and stale README before ending the session |
52
+ | session-log | PostToolUse (Bash) | Records Bash command outputs to `session.log` for audit trail |
53
+ | session-audit | SessionStart | Runs `kastell audit --silent` on session start and surfaces the current security score |
54
+ | pre-commit-audit-guard | PreToolUse (git commit) | Blocks the commit if the current audit score has dropped below the recorded baseline |
55
+ | destroy-block | PreToolUse (Bash) | Blocks `kastell destroy` and `kastell restore` operations through Claude Code |
56
+
57
+ ## MCP Tools
58
+
59
+ All 13 tools are available in Claude Code once the plugin is installed. The MCP server starts
60
+ automatically via the bundled `.mcp.json` configuration.
61
+
62
+ | Tool | Description |
63
+ |------|-------------|
64
+ | server_info | List servers, check status, health, and available sizes |
65
+ | server_logs | Fetch logs and system metrics from servers via SSH |
66
+ | server_manage | Add, remove, or destroy servers |
67
+ | server_maintain | Update platform, restart, or run full maintenance |
68
+ | server_secure | SSH hardening, firewall management, and domain configuration |
69
+ | server_backup | Create backups and manage cloud snapshots |
70
+ | server_provision | Provision new cloud servers on Hetzner, DigitalOcean, Vultr, or Linode |
71
+ | server_audit | Run the full 457-check security audit across 30 categories |
72
+ | server_evidence | Collect forensic evidence packages from servers |
73
+ | server_guard | Manage the autonomous security monitoring daemon |
74
+ | server_doctor | Proactive health analysis with remediation recommendations |
75
+ | server_lock | Apply the 24-step production hardening sequence |
76
+ | server_fleet | Fleet-wide health and security posture overview |
77
+
78
+ ## Quick Start
79
+
80
+ ```bash
81
+ # Install kastell globally
82
+ npm install -g kastell
83
+
84
+ # Configure your cloud provider
85
+ kastell setup
86
+
87
+ # In Claude Code, the plugin auto-starts the MCP server.
88
+ # Try natural language commands like:
89
+ # "Provision a new Hetzner server in Nuremberg with 2 CPUs"
90
+ # "Run a security audit on my server at 1.2.3.4"
91
+ # "Apply full hardening to my production server"
92
+ # "Show me all my servers"
93
+ ```
94
+
95
+ After installation, the `kastell-ops` skill loads automatically in any session where you
96
+ work with Kastell. Use `/kastell:scaffold` to generate new CLI commands or MCP tools,
97
+ and `/agent:kastell-auditor` to get prioritized remediation guidance from audit results.
98
+
99
+ ## Supported Providers
100
+
101
+ | Provider | Regions | Notes |
102
+ |----------|---------|-------|
103
+ | Hetzner Cloud | EU (FSN, NBG, HEL), US (ASH, HIL) | Default recommended provider |
104
+ | DigitalOcean | Global (NYC, SFO, AMS, SGP, LON, FRA, TOR, BLR, SYD) | |
105
+ | Vultr | 25+ global locations | |
106
+ | Linode (Akamai) | 11 global locations | |
107
+
108
+ ## Links
109
+
110
+ - Website: https://kastell.dev
111
+ - GitHub: https://github.com/kastelldev/kastell
112
+ - npm: https://www.npmjs.com/package/kastell
113
+ - Docs: https://kastell.dev/docs
@@ -1,77 +1,77 @@
1
- ---
2
- name: kastell-auditor
3
- description: "Security audit analyzer for Kastell servers. Runs kastell audit, maps results across 5 security domains (perimeter, authentication, runtime, internals, compliance), tracks score trends across sessions. Use when running kastell audit, analyzing server security posture, investigating audit findings, or generating security reports."
4
- tools: Read, Grep, Glob, Bash
5
- model: inherit
6
- effort: high
7
- memory: user
8
- maxTurns: 25
9
- skills:
10
- - kastell-ops
11
- ---
12
-
13
- # Role
14
-
15
- ## Live Context
16
-
17
- **Last audit score:** !`node -e "import('fs').then(f=>{try{const h=JSON.parse(f.readFileSync(process.env.HOME+'/.kastell/audit-history.json','utf8'));const last=h.sort((a,b)=>new Date(b.timestamp)-new Date(a.timestamp))[0];if(last)console.log(last.overallScore+'/100 ('+last.serverName+', '+last.timestamp.split('T')[0]+')');else console.log('No audit history yet')}catch(e){console.log('No audit history yet')}}).catch(()=>console.log('No audit history yet'))" 2>/dev/null || echo "No audit history yet"`
18
-
19
- You are a security audit analyst for Kastell-managed servers. Your purpose is to run `kastell audit`, organize findings into 5 security domains, identify critical failures and quick wins, and track score trends across sessions.
20
-
21
- # Workflow
22
-
23
- 1. **Identify target server** — ask user if not provided; verify with `kastell list`
24
- 2. **Run audit** — `kastell audit <server> --json` to get structured output
25
- 3. **Analyze by bucket** — pipe JSON through `bash scripts/bucket_mapper.sh` for instant 5-domain mapping
26
- 4. **Check memory** — run `bash scripts/trend_report.sh <server>` for score history; or load `audit-history.json` directly
27
- 5. **Report** — per-bucket summary + overall score + trend (if memory available)
28
-
29
- ## Scripts (Deterministic)
30
-
31
- ```bash
32
- # Map audit JSON to 5 security buckets
33
- kastell audit --server <name> --json | bash scripts/bucket_mapper.sh
34
-
35
- # Show audit score trend for a server
36
- bash scripts/trend_report.sh <server-name>
37
- bash scripts/trend_report.sh --all
38
- ```
39
-
40
- # Bucket Map
41
-
42
- | Bucket | Categories | Focus |
43
- |--------|-----------|-------|
44
- | 1 Perimeter | Network, Firewall, DNS Security | External attack surface |
45
- | 2 Authentication | SSH, Auth, Crypto, Accounts | Identity controls |
46
- | 3 Runtime | Docker, Services, Boot, Scheduling | Service exposure |
47
- | 4 Internals | Filesystem, Logging, Kernel, Memory | System hardening |
48
- | 5 Compliance | Updates, File Integrity, Malware, MAC, Secrets, Cloud Metadata, Supply Chain, Backup Hygiene, Resource Limits, Incident Readiness, Banners, Time | Hygiene and compliance |
49
-
50
- # Output Format
51
-
52
- For each bucket:
53
- - **Score:** X/Y checks passed
54
- - **Critical findings** (up to 3): `[FAIL] check-name -- one-line impact`
55
- - **Quick win:** one actionable fix
56
-
57
- After all buckets:
58
- - **Overall score:** X/100
59
- - **Trend** (when memory has prior data): "Last audit: Y -- Delta: +/-Z -- [N] new failures in [bucket]"
60
-
61
- # Memory
62
-
63
- Manage a single file `audit-history.json` in your agent memory directory. Store per server:
64
-
65
- ```json
66
- { "server": "string", "date": "string", "score": 0, "bucketScores": { "perimeter": 0, "authentication": 0, "runtime": 0, "internals": 0, "compliance": 0 }, "failedChecks": [] }
67
- ```
68
-
69
- On each run: load prior record, compute delta, store new record. Discard entries for servers no longer in `kastell list` output.
70
-
71
- # Rules
72
-
73
- - Read-only operations only: `server_audit`, `server_doctor`, `server_fleet`
74
- - Never run `kastell lock`, `kastell secure`, or any write operation
75
- - Recommend fixes but do not apply them — suggest `/agent:kastell-fixer` for implementation
76
- - If multiple servers requested, analyze each sequentially
77
- - English output for analysis structure; follow user's language for explanatory text
1
+ ---
2
+ name: kastell-auditor
3
+ description: "Security audit analyzer for Kastell servers. Runs kastell audit, maps results across 5 security domains (perimeter, authentication, runtime, internals, compliance), tracks score trends across sessions. Use when running kastell audit, analyzing server security posture, investigating audit findings, or generating security reports."
4
+ tools: Read, Grep, Glob, Bash
5
+ model: inherit
6
+ effort: high
7
+ memory: user
8
+ maxTurns: 25
9
+ skills:
10
+ - kastell-ops
11
+ ---
12
+
13
+ # Role
14
+
15
+ ## Live Context
16
+
17
+ **Last audit score:** !`node -e "import('fs').then(f=>{try{const h=JSON.parse(f.readFileSync(process.env.HOME+'/.kastell/audit-history.json','utf8'));const last=h.sort((a,b)=>new Date(b.timestamp)-new Date(a.timestamp))[0];if(last)console.log(last.overallScore+'/100 ('+last.serverName+', '+last.timestamp.split('T')[0]+')');else console.log('No audit history yet')}catch(e){console.log('No audit history yet')}}).catch(()=>console.log('No audit history yet'))" 2>/dev/null || echo "No audit history yet"`
18
+
19
+ You are a security audit analyst for Kastell-managed servers. Your purpose is to run `kastell audit`, organize findings into 5 security domains, identify critical failures and quick wins, and track score trends across sessions.
20
+
21
+ # Workflow
22
+
23
+ 1. **Identify target server** — ask user if not provided; verify with `kastell list`
24
+ 2. **Run audit** — `kastell audit <server> --json` to get structured output
25
+ 3. **Analyze by bucket** — pipe JSON through `bash scripts/bucket_mapper.sh` for instant 5-domain mapping
26
+ 4. **Check memory** — run `bash scripts/trend_report.sh <server>` for score history; or load `audit-history.json` directly
27
+ 5. **Report** — per-bucket summary + overall score + trend (if memory available)
28
+
29
+ ## Scripts (Deterministic)
30
+
31
+ ```bash
32
+ # Map audit JSON to 5 security buckets
33
+ kastell audit --server <name> --json | bash scripts/bucket_mapper.sh
34
+
35
+ # Show audit score trend for a server
36
+ bash scripts/trend_report.sh <server-name>
37
+ bash scripts/trend_report.sh --all
38
+ ```
39
+
40
+ # Bucket Map
41
+
42
+ | Bucket | Categories | Focus |
43
+ |--------|-----------|-------|
44
+ | 1 Perimeter | Network, Firewall, DNS Security | External attack surface |
45
+ | 2 Authentication | SSH, Auth, Crypto, Accounts | Identity controls |
46
+ | 3 Runtime | Docker, Services, Boot, Scheduling | Service exposure |
47
+ | 4 Internals | Filesystem, Logging, Kernel, Memory | System hardening |
48
+ | 5 Compliance | Updates, File Integrity, Malware, MAC, Secrets, Cloud Metadata, Supply Chain, Backup Hygiene, Resource Limits, Incident Readiness, Banners, Time | Hygiene and compliance |
49
+
50
+ # Output Format
51
+
52
+ For each bucket:
53
+ - **Score:** X/Y checks passed
54
+ - **Critical findings** (up to 3): `[FAIL] check-name -- one-line impact`
55
+ - **Quick win:** one actionable fix
56
+
57
+ After all buckets:
58
+ - **Overall score:** X/100
59
+ - **Trend** (when memory has prior data): "Last audit: Y -- Delta: +/-Z -- [N] new failures in [bucket]"
60
+
61
+ # Memory
62
+
63
+ Manage a single file `audit-history.json` in your agent memory directory. Store per server:
64
+
65
+ ```json
66
+ { "server": "string", "date": "string", "score": 0, "bucketScores": { "perimeter": 0, "authentication": 0, "runtime": 0, "internals": 0, "compliance": 0 }, "failedChecks": [] }
67
+ ```
68
+
69
+ On each run: load prior record, compute delta, store new record. Discard entries for servers no longer in `kastell list` output.
70
+
71
+ # Rules
72
+
73
+ - Read-only operations only: `server_audit`, `server_doctor`, `server_fleet`
74
+ - Never run `kastell lock`, `kastell secure`, or any write operation
75
+ - Recommend fixes but do not apply them — suggest `/agent:kastell-fixer` for implementation
76
+ - If multiple servers requested, analyze each sequentially
77
+ - English output for analysis structure; follow user's language for explanatory text
@@ -1,101 +1,101 @@
1
- #!/usr/bin/env bash
2
- # bucket_mapper.sh — Map kastell audit JSON checks to 5 security buckets.
3
- # Usage: kastell audit --server <name> --json | bash bucket_mapper.sh
4
- # OR: bash bucket_mapper.sh < audit-output.json
5
- # OR: bash bucket_mapper.sh audit-output.json
6
- #
7
- # Output: Per-bucket check list with pass/fail status and severity.
8
- # Used by kastell-auditor agent for structured analysis.
9
- #
10
- # Requires: node
11
-
12
- set -euo pipefail
13
-
14
- if [[ -n "${1:-}" && -f "$1" ]]; then
15
- INPUT=$(cat "$1")
16
- elif [[ ! -t 0 ]]; then
17
- INPUT=$(cat)
18
- else
19
- echo "Usage: kastell audit --server <name> --json | bash bucket_mapper.sh" >&2
20
- exit 1
21
- fi
22
-
23
- node -e "
24
- const data = JSON.parse(process.argv[1]);
25
- const checks = data.checks || data.results || [];
26
-
27
- const BUCKETS = {
28
- '1_Perimeter': {
29
- match: ['network', 'firewall', 'dns'],
30
- checks: []
31
- },
32
- '2_Authentication': {
33
- match: ['ssh', 'auth', 'crypto', 'accounts'],
34
- checks: []
35
- },
36
- '3_Runtime': {
37
- match: ['docker', 'services', 'boot', 'scheduling'],
38
- checks: []
39
- },
40
- '4_Internals': {
41
- match: ['filesystem', 'logging', 'kernel', 'memory'],
42
- checks: []
43
- },
44
- '5_Compliance': {
45
- match: [], // catchall
46
- checks: []
47
- }
48
- };
49
-
50
- function getBucket(category) {
51
- const cat = (category || '').toLowerCase();
52
- for (const [name, bucket] of Object.entries(BUCKETS)) {
53
- if (name === '5_Compliance') continue;
54
- if (bucket.match.some(m => cat.includes(m))) return name;
55
- }
56
- return '5_Compliance';
57
- }
58
-
59
- // Map checks to buckets
60
- for (const c of checks) {
61
- const bucket = getBucket(c.category);
62
- BUCKETS[bucket].checks.push({
63
- id: c.id || 'unknown',
64
- name: c.name || '',
65
- severity: c.severity || 'info',
66
- passed: !!c.passed,
67
- category: c.category || ''
68
- });
69
- }
70
-
71
- // Output
72
- const score = data.score ?? data.overallScore ?? 'N/A';
73
- console.log('Score: ' + score + '/100');
74
- console.log('Total checks: ' + checks.length);
75
- console.log('');
76
-
77
- for (const [name, bucket] of Object.entries(BUCKETS)) {
78
- const label = name.replace(/^[0-9]_/, '');
79
- const passed = bucket.checks.filter(c => c.passed).length;
80
- const total = bucket.checks.length;
81
- const critFail = bucket.checks.filter(c => !c.passed && c.severity === 'critical');
82
-
83
- console.log('--- ' + label + ' (' + passed + '/' + total + ') ---');
84
-
85
- // Show failed checks (critical first, then warning)
86
- const failed = bucket.checks
87
- .filter(c => !c.passed)
88
- .sort((a, b) => {
89
- const sev = { critical: 0, warning: 1, info: 2 };
90
- return (sev[a.severity] ?? 3) - (sev[b.severity] ?? 3);
91
- });
92
-
93
- for (const c of failed.slice(0, 5)) {
94
- const icon = c.severity === 'critical' ? '!!' : c.severity === 'warning' ? '! ' : ' ';
95
- console.log(' [FAIL] ' + icon + c.id + ' — ' + c.name);
96
- }
97
- if (failed.length > 5) console.log(' ... and ' + (failed.length - 5) + ' more');
98
- if (failed.length === 0) console.log(' All checks passed');
99
- console.log('');
100
- }
101
- " "$INPUT"
1
+ #!/usr/bin/env bash
2
+ # bucket_mapper.sh — Map kastell audit JSON checks to 5 security buckets.
3
+ # Usage: kastell audit --server <name> --json | bash bucket_mapper.sh
4
+ # OR: bash bucket_mapper.sh < audit-output.json
5
+ # OR: bash bucket_mapper.sh audit-output.json
6
+ #
7
+ # Output: Per-bucket check list with pass/fail status and severity.
8
+ # Used by kastell-auditor agent for structured analysis.
9
+ #
10
+ # Requires: node
11
+
12
+ set -euo pipefail
13
+
14
+ if [[ -n "${1:-}" && -f "$1" ]]; then
15
+ INPUT=$(cat "$1")
16
+ elif [[ ! -t 0 ]]; then
17
+ INPUT=$(cat)
18
+ else
19
+ echo "Usage: kastell audit --server <name> --json | bash bucket_mapper.sh" >&2
20
+ exit 1
21
+ fi
22
+
23
+ node -e "
24
+ const data = JSON.parse(process.argv[1]);
25
+ const checks = data.checks || data.results || [];
26
+
27
+ const BUCKETS = {
28
+ '1_Perimeter': {
29
+ match: ['network', 'firewall', 'dns'],
30
+ checks: []
31
+ },
32
+ '2_Authentication': {
33
+ match: ['ssh', 'auth', 'crypto', 'accounts'],
34
+ checks: []
35
+ },
36
+ '3_Runtime': {
37
+ match: ['docker', 'services', 'boot', 'scheduling'],
38
+ checks: []
39
+ },
40
+ '4_Internals': {
41
+ match: ['filesystem', 'logging', 'kernel', 'memory'],
42
+ checks: []
43
+ },
44
+ '5_Compliance': {
45
+ match: [], // catchall
46
+ checks: []
47
+ }
48
+ };
49
+
50
+ function getBucket(category) {
51
+ const cat = (category || '').toLowerCase();
52
+ for (const [name, bucket] of Object.entries(BUCKETS)) {
53
+ if (name === '5_Compliance') continue;
54
+ if (bucket.match.some(m => cat.includes(m))) return name;
55
+ }
56
+ return '5_Compliance';
57
+ }
58
+
59
+ // Map checks to buckets
60
+ for (const c of checks) {
61
+ const bucket = getBucket(c.category);
62
+ BUCKETS[bucket].checks.push({
63
+ id: c.id || 'unknown',
64
+ name: c.name || '',
65
+ severity: c.severity || 'info',
66
+ passed: !!c.passed,
67
+ category: c.category || ''
68
+ });
69
+ }
70
+
71
+ // Output
72
+ const score = data.score ?? data.overallScore ?? 'N/A';
73
+ console.log('Score: ' + score + '/100');
74
+ console.log('Total checks: ' + checks.length);
75
+ console.log('');
76
+
77
+ for (const [name, bucket] of Object.entries(BUCKETS)) {
78
+ const label = name.replace(/^[0-9]_/, '');
79
+ const passed = bucket.checks.filter(c => c.passed).length;
80
+ const total = bucket.checks.length;
81
+ const critFail = bucket.checks.filter(c => !c.passed && c.severity === 'critical');
82
+
83
+ console.log('--- ' + label + ' (' + passed + '/' + total + ') ---');
84
+
85
+ // Show failed checks (critical first, then warning)
86
+ const failed = bucket.checks
87
+ .filter(c => !c.passed)
88
+ .sort((a, b) => {
89
+ const sev = { critical: 0, warning: 1, info: 2 };
90
+ return (sev[a.severity] ?? 3) - (sev[b.severity] ?? 3);
91
+ });
92
+
93
+ for (const c of failed.slice(0, 5)) {
94
+ const icon = c.severity === 'critical' ? '!!' : c.severity === 'warning' ? '! ' : ' ';
95
+ console.log(' [FAIL] ' + icon + c.id + ' — ' + c.name);
96
+ }
97
+ if (failed.length > 5) console.log(' ... and ' + (failed.length - 5) + ' more');
98
+ if (failed.length === 0) console.log(' All checks passed');
99
+ console.log('');
100
+ }
101
+ " "$INPUT"