No slash command · from kastell
Provides Kastell CLI architecture, commands, provider patterns, and platform adapter contracts for self-hosted server provisioning, security hardening, and infrastructure management.
Ships in kastell. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Kastell is a CLI toolkit for provisioning, securing, and managing self-hosted servers. TypeScript, ESM, strict mode. CLI commands, first-party MCP tools, 4 cloud providers (hetzner, digitalocean, vultr, linode), 2 platform adapters (coolify, dokploy).
Version: !node -e "import('fs').then(f=>console.log(JSON.parse(f.readFileSync('package.json','utf8')).version)).catch(()=>console.log('unknown'))"
Registered servers:
!kastell list 2>/dev/null || echo "No servers registered"
src/
commands/ # 31 thin CLI wrappers (parse args + delegate only)
core/ # Business logic (ALL computation here)
providers/ # Cloud API: hetzner, digitalocean, vultr, linode
adapters/ # Platform abstraction: coolify, dokploy
interface.ts # PlatformAdapter contract
factory.ts # getAdapter(), detectPlatform(), resolvePlatform()
mcp/
server.ts # 13 tool registrations
tools/ # Handler files (Zod schema + handler per tool)
utils/ # ssh, config, cloudInit, modeGuard, migration
types/ # ServerMode, ServerRecord, Platform
constants.ts # PROVIDER_REGISTRY (single source of truth)
index.ts # CLI entry point
| Layer | Path | Responsibility | Rule |
|---|---|---|---|
| Commands | src/commands/ | Parse CLI args, call core, display output | ZERO business logic |
| Core | src/core/ | All business logic, orchestration | No UI/chalk/ora imports |
| Providers | src/providers/ | Cloud API calls per provider | Implements cloud CRUD |
| Adapters | src/adapters/ | Platform-specific ops (Coolify/Dokploy) | Via PlatformAdapter interface |
| MCP | src/mcp/ | MCP server + tool handlers | Delegates to core |
| Utils | src/utils/ | SSH, config, modeGuard, errorMapper | Shared infrastructure |
Access adapters via getAdapter(platform) from src/adapters/factory.ts. Never import CoolifyAdapter or DokployAdapter directly in commands.
interface PlatformAdapter {
readonly name: string; // "coolify" | "dokploy"
readonly port: number; // 8000 (Coolify) | 3000 (Dokploy)
readonly defaultLogService: string; // matches platform name
readonly platformPorts: readonly number[]; // ports protected from firewall removal
getCloudInit(serverName: string): string;
healthCheck(ip: string, domain?: string): Promise<HealthResult>;
createBackup(ip: string, serverName: string, provider: string): Promise<PlatformBackupResult>;
getStatus(ip: string): Promise<PlatformStatusResult>;
update(ip: string): Promise<UpdateResult>;
restoreBackup?(ip, backupPath, manifest): Promise<PlatformRestoreResult>; // optional
}
Factory exports: getAdapter(platform), detectPlatform(ip), resolvePlatform(server)
| Provider | Env Key | Display Name |
|---|---|---|
| hetzner | HETZNER_TOKEN | Hetzner Cloud |
| digitalocean | DIGITALOCEAN_TOKEN | DigitalOcean |
| vultr | VULTR_TOKEN | Vultr |
| linode | LINODE_TOKEN | Linode (Akamai) |
PROVIDER_REGISTRY in src/constants.ts is the single source of truth for providers.
src/commands/<name>.ts — thin wrapper (parse + delegate, no logic)src/core/<name>.ts — all business logic heresrc/index.ts — register with programsrc/__tests__/ — test core, not commandsrc/core/audit/<category>/ — add to existing categorysrc/core/audit/catalog.tskastell auditsrc/providers/<name>.ts — implements base.ts contractsrc/constants.ts — add to PROVIDER_REGISTRYsrc/mcp/tools/server<Name>.ts — Zod schema + handlersrc/mcp/server.ts — import + registerTool()readOnlyHint / destructiveHint / idempotentHint"type": "module") — import, not requireKASTELL_SAFE_MODE + isSafeMode() = destructive operation guardassertValidIp() before every SSH operationsanitizedEnv for subprocess callssanitizeResponseData() whitelist approach for API error responseskastell/ directory (auto-migrated from legacy name)PROVIDER_REGISTRY = single source of truth for providerswithProviderErrorHandling HOF for consistent provider error handlingdescribe.each with jest.resetAllMocks() (not clearAllMocks())Run without LLM — deterministic analysis scripts:
# Parse audit JSON into 5 security domain summaries
kastell audit --server myserver --json > /tmp/audit.json
scripts/parse_audit.sh /tmp/audit.json
# Generate fleet-wide server score table
kastell fleet --json > /tmp/fleet.json
scripts/fleet_report.sh /tmp/fleet.json
# Compare audit check count vs test coverage
scripts/check_coverage.sh
references/commands.md (opens in a new tab)references/mcp-tools.md (opens in a new tab)references/patterns.md (opens in a new tab)references/pitfalls.md (opens in a new tab)scripts/check_coverage.sh (opens in a new tab)scripts/fleet_report.sh (opens in a new tab)scripts/parse_audit.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
mediumThree short reads, in order
Generated from the plugin's indexed repository (kastelldev/kastell) — no native marketplace selected
npx claudepluginhub p/kastelldev-kastell4 skills in this plugin
/kastell-carefulSafety guard for destructive Kastell operations. Intercepts destroy and restore commands and requires explicit confirmation before proceeding./kastell-researchRead-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./kastell-scaffoldGenerate new Kastell components from templates. Creates boilerplate for CLI commands, audit checks, providers, and MCP tools following current architecture (commands thin, core fat, adapters dispatch).Other plugins' skills for the same job