Paths: File paths (shared/, ../ln-030-vps-bootstrap/references/) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.
ln-034-vps-environment-diagnostics
Type: L3 Worker
Category: 0XX Shared / Infrastructure
Inspects one VPS project environment and reports health, drift, logs, auth state, ports, systemd, tmux, and bounded safe repairs.
MANDATORY READ
MANDATORY READ: Load shared/references/worker_runtime_contract.md, shared/references/coordinator_summary_contract.md, and shared/references/vps_runtime_contract.md
MANDATORY READ: Load ../ln-030-vps-bootstrap/references/scope_layers.md, ../ln-030-vps-bootstrap/references/troubleshooting.md, and ../ln-030-vps-bootstrap/references/verification_recipes.md
Input / Output
| Direction |
Content |
| Input |
mode, project/VPS variables, optional repair_scope, optional dry_run, optional runId, optional summaryArtifactPath |
| Output |
vps-environment-diagnostics summary with status, findings, drift, safe repairs, warnings, blockers, and verification |
If summaryArtifactPath is provided, write the same summary JSON there. If not provided, return the summary inline and write it to the standalone run-scoped path. Generate a standalone run_id when runId is absent.
Modes
| Mode |
Behavior |
inspect |
Read-only health and drift report |
verify |
Read-only post-install/post-redeploy verification |
repair_safe |
Apply only documented bounded safe repairs selected by repair_scope |
Workflow
Phase 1: Scope And Safety
Resolve target environment and set mutation guard:
inspect and verify are read-only
repair_safe requires explicit repair_scope
dry_run=true converts repairs to planned actions
Phase 2: Host And Shared Runtime
Inspect:
- required binaries
${BOT_USER}
- Node/Claude/Codex versions
- auth health indicators without printing tokens
${AGENT_SKILLS_DIR} git state
- marketplace/plugin health
agent-update.timer and log tail
Phase 3: Project Runtime
Inspect:
${PROJECT_DIR} git state
/etc/${PROJECT_NAME} and /var/lib/${PROJECT_NAME}
${SERVICE_PREFIX}-god@*.service
- tmux socket and targets
- dispatch timer/service
- provider credential wiring without secret output
Phase 4: Relay Runtime
When Telegram/relay is enabled, inspect:
${SERVICE_PREFIX}-hex-relay.service
/opt/${SERVICE_PREFIX}-hex-relay
- HTTP
/health
- relay DB presence/schema
- old
relay-bot service/path drift
RELAY_HOOK_PORT listener collisions
Phase 5: Safe Repair
Allowed safe repairs only:
- restart a named inactive project service after confirming unit file exists
- re-enable an expected timer
- recreate missing non-secret directories with documented owner/mode
- rerun
systemctl daemon-reload
- report, but do not rewrite, missing auth or secrets
Forbidden repairs:
- secret creation or token edits
- deleting DB files
- deleting project repos
- changing Git remotes/branches
- changing shared auth
- broad package upgrades
Phase 6: Summary
Write a vps-environment-diagnostics summary artifact with:
- health verdict
- drift list
- repair actions applied or planned
- blockers
- warnings
- verification evidence
Critical Rules
- This worker diagnoses one environment at a time.
- Fleet target selection belongs outside this worker.
- Read-only modes must not mutate remote or local state.
- Repair actions are bounded and explicit.
- Never print secrets or auth tokens.
Definition of Done
Version: 1.0.0
Last Updated: 2026-05-05
1---
2name: ln-034-vps-environment-diagnostics
3description: "Use when inspecting health, drift, logs, auth, ports, systemd, tmux, or safe repair needs for one VPS project environment."
4license: MIT
5allowed-tools: Bash, Read, mcp__hex-ssh__remote-ssh, mcp__hex-ssh__ssh-read-lines, mcp__hex-ssh__ssh-write-chunk, mcp__hex-ssh__ssh-edit-block
6metadata:
7 source: https://skillmd.com/skills/aibot88/ln-034-vps-environment-diagnostics
8---
9
10<!-- markdownlint-disable MD012 MD022 MD032 MD040 MD041 MD060 -->
11
12> **Paths:** File paths (`shared/`, `../ln-030-vps-bootstrap/references/`) are relative to skills repo root. If not found at CWD, locate this `SKILL.md` directory and go up one level for repo root.
13
14# ln-034-vps-environment-diagnostics
15
16**Type:** L3 Worker
17**Category:** 0XX Shared / Infrastructure
18
19Inspects one VPS project environment and reports health, drift, logs, auth state, ports, systemd, tmux, and bounded safe repairs.
20
21## MANDATORY READ
22
23**MANDATORY READ:** Load `shared/references/worker_runtime_contract.md`, `shared/references/coordinator_summary_contract.md`, and `shared/references/vps_runtime_contract.md`
24**MANDATORY READ:** Load `../ln-030-vps-bootstrap/references/scope_layers.md`, `../ln-030-vps-bootstrap/references/troubleshooting.md`, and `../ln-030-vps-bootstrap/references/verification_recipes.md`
25
26---
27
28## Input / Output
29
30| Direction | Content |
31|---|---|
32| Input | `mode`, project/VPS variables, optional `repair_scope`, optional `dry_run`, optional `runId`, optional `summaryArtifactPath` |
33| Output | `vps-environment-diagnostics` summary with status, findings, drift, safe repairs, warnings, blockers, and verification |
34
35If `summaryArtifactPath` is provided, write the same summary JSON there. If not provided, return the summary inline and write it to the standalone run-scoped path. Generate a standalone `run_id` when `runId` is absent.
36
37## Modes
38
39| Mode | Behavior |
40|---|---|
41| `inspect` | Read-only health and drift report |
42| `verify` | Read-only post-install/post-redeploy verification |
43| `repair_safe` | Apply only documented bounded safe repairs selected by `repair_scope` |
44
45## Workflow
46
47### Phase 1: Scope And Safety
48
49Resolve target environment and set mutation guard:
50- `inspect` and `verify` are read-only
51- `repair_safe` requires explicit `repair_scope`
52- `dry_run=true` converts repairs to planned actions
53
54### Phase 2: Host And Shared Runtime
55
56Inspect:
57- required binaries
58- `${BOT_USER}`
59- Node/Claude/Codex versions
60- auth health indicators without printing tokens
61- `${AGENT_SKILLS_DIR}` git state
62- marketplace/plugin health
63- `agent-update.timer` and log tail
64
65### Phase 3: Project Runtime
66
67Inspect:
68- `${PROJECT_DIR}` git state
69- `/etc/${PROJECT_NAME}` and `/var/lib/${PROJECT_NAME}`
70- `${SERVICE_PREFIX}-god@*.service`
71- tmux socket and targets
72- dispatch timer/service
73- provider credential wiring without secret output
74
75### Phase 4: Relay Runtime
76
77When Telegram/relay is enabled, inspect:
78- `${SERVICE_PREFIX}-hex-relay.service`
79- `/opt/${SERVICE_PREFIX}-hex-relay`
80- HTTP `/health`
81- relay DB presence/schema
82- old `relay-bot` service/path drift
83- `RELAY_HOOK_PORT` listener collisions
84
85### Phase 5: Safe Repair
86
87Allowed safe repairs only:
88- restart a named inactive project service after confirming unit file exists
89- re-enable an expected timer
90- recreate missing non-secret directories with documented owner/mode
91- rerun `systemctl daemon-reload`
92- report, but do not rewrite, missing auth or secrets
93
94Forbidden repairs:
95- secret creation or token edits
96- deleting DB files
97- deleting project repos
98- changing Git remotes/branches
99- changing shared auth
100- broad package upgrades
101
102### Phase 6: Summary
103
104Write a `vps-environment-diagnostics` summary artifact with:
105- health verdict
106- drift list
107- repair actions applied or planned
108- blockers
109- warnings
110- verification evidence
111
112## Critical Rules
113
114- This worker diagnoses one environment at a time.
115- Fleet target selection belongs outside this worker.
116- Read-only modes must not mutate remote or local state.
117- Repair actions are bounded and explicit.
118- Never print secrets or auth tokens.
119
120## Definition of Done
121
122- [ ] Target environment and mutation guard resolved.
123- [ ] Host/shared runtime health inspected.
124- [ ] Project runtime health inspected.
125- [ ] Relay runtime health inspected or gated `N/A:`.
126- [ ] Drift and blockers reported with concrete evidence.
127- [ ] Safe repair actions were explicit, bounded, and recorded.
128- [ ] Forbidden repair categories were not performed.
129- [ ] `dry_run=true`, `inspect`, and `verify` performed no mutation.
130- [ ] Structured `vps-environment-diagnostics` summary artifact written.
131
132---
133
134**Version:** 1.0.0
135**Last Updated:** 2026-05-05