From d0ae31c24c3c98ae89eebd67227c0c0d01606ed5 Mon Sep 17 00:00:00 2001 From: Clawd Date: Sat, 11 Apr 2026 20:43:41 -0700 Subject: Add ship-* Claude skills and plan Introduces a skills/ directory with 8 Claude skills that reimagine ship as a set of composable, human-driven deployment tools backed by Claude's reasoning rather than a rigid CLI. Skills: - ship-setup: one-time VPS config, saves host to ~/.config/ship/config.json - ship-status: derives live state from server, no local state file - ship-env: read/write env vars with merge semantics, never overwrites - ship-binary: deploy Go binaries with SQLite backup, correct restart behavior - ship-caddy: manage per-app Caddyfile with validate-before-reload - ship-service: systemd management and log inspection - ship-static: rsync static sites with SPA routing support - ship-deploy: orchestration runbook tying the others together Also adds SKILLS_PLAN.md documenting the architecture and rationale. Co-Authored-By: Claude Sonnet 4.6 --- skills/ship-service/SKILL.md | 133 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 skills/ship-service/SKILL.md (limited to 'skills/ship-service') diff --git a/skills/ship-service/SKILL.md b/skills/ship-service/SKILL.md new file mode 100644 index 0000000..e4d7510 --- /dev/null +++ b/skills/ship-service/SKILL.md @@ -0,0 +1,133 @@ +--- +name: ship-service +description: Manage systemd services for deployed apps. Start, stop, restart, view status and logs. Use when you need to control a running service or diagnose problems. +argument-hint: " [start|stop|restart|status|logs] [host-nickname]" +--- + +# ship-service + +Manage systemd services for apps deployed on a ship VPS. + +## Read Config + +```bash +python3 -c " +import json, os +cfg = json.load(open(os.path.expanduser('~/.config/ship/config.json'))) +nick = '' +h = cfg['hosts'].get(nick, cfg['hosts'][cfg['default']]) +print(h['host']) +" +``` + +## Usage Patterns + +### Status + +```bash +ssh "sudo systemctl status --no-pager" +``` + +Shows whether the service is running, its PID, memory usage, and recent log lines. + +### Restart + +```bash +ssh "sudo systemctl restart " +``` + +Use after changing env vars or replacing the binary. + +### Stop + +```bash +ssh "sudo systemctl stop " +``` + +### Start + +```bash +ssh "sudo systemctl start " +``` + +### View logs + +Recent logs (last 50 lines): +```bash +ssh "sudo journalctl -u -n 50 --no-pager" +``` + +Follow live logs: +```bash +ssh "sudo journalctl -u -f" +``` + +Logs since last boot: +```bash +ssh "sudo journalctl -u -b --no-pager" +``` + +### Enable (start on boot) + +```bash +ssh "sudo systemctl enable " +``` + +### Disable (don't start on boot) + +```bash +ssh "sudo systemctl disable " +``` + +### View the systemd unit file + +```bash +ssh "sudo cat /etc/systemd/system/.service" +``` + +### Remove a service entirely + +Only do this if the user explicitly asks to remove/uninstall an app: + +```bash +ssh "sudo systemctl stop && sudo systemctl disable && sudo rm /etc/systemd/system/.service && sudo systemctl daemon-reload" +``` + +Confirm with the user before removing. Note that this does not delete the binary, +data directory, env file, or Caddy config — those are managed separately. + +## Diagnosing Problems + +If a service is failing, check: + +1. Service status for the error: +```bash +ssh "sudo systemctl status --no-pager" +``` + +2. Full logs for context: +```bash +ssh "sudo journalctl -u -n 100 --no-pager" +``` + +3. Whether the binary exists and is executable: +```bash +ssh "ls -la /usr/local/bin/" +``` + +4. Whether the env file exists and looks correct: +```bash +ssh "sudo cat /etc/ship/env/.env" +``` + +5. Whether the port is already in use by something else: +```bash +ssh "sudo ss -tlnp | grep " +``` + +## Notes + +- If the user just says "restart foodtracker" or "check the logs for myapp", infer the action +- After a restart, give it a moment then check status to confirm it came up +- If a service repeatedly crashes, look at the logs before suggesting a fix +- Use default host unless another is specified -- cgit v1.2.3