Use when you need to verify a running native app works correctly after code changes, can't use browser DevTools, need to check runtime state without screenshots, or want to confirm a Tauri/Electron app's simulation or UI didn't break. Guides scaffolding of a diagnostic HTTP server with Health, Diff, Assert, Smoke Test patterns plus semantic UI state endpoint.
From interhelmnpx claudepluginhub mistakeknot/interagency-marketplace --plugin interhelmThis skill uses the workspace's default tool permissions.
Executes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
Guides idea refinement into designs: explores context, asks questions one-by-one, proposes approaches, presents sections for approval, writes/review specs before coding.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Use when:
Do NOT use when:
Check if the project already has a diagnostic server:
# Look for existing diagnostic endpoints
grep -r "/diag/" src/ src-tauri/ 2>/dev/null | head -5
# Check for existing health endpoints
grep -r "health" src/ --include="*.rs" --include="*.ts" -l 2>/dev/null | head -5
If found, skip scaffolding and use existing endpoints directly.
Before writing any code, enumerate the app's subsystems that need observability:
Use the templates in templates/rust-hyper/ as starting points. The server exposes two endpoint families:
/diag/* — Read-only observations:
| Endpoint | Method | Purpose |
|---|---|---|
/diag/health | GET | Structured pass/fail per subsystem |
/diag/schema | GET | Self-describing API (available endpoints + params) |
/diag/ui/state | GET | Semantic UI state — active view, panels, selections, values |
/diag/diff | POST | Snapshot current state, optionally take N steps, return deltas |
/diag/assert | POST | Evaluate assertion expression against current state |
/diag/smoke-test | POST | Run full verification sequence, return per-check results |
/control/* — Mutations:
| Endpoint | Method | Purpose |
|---|---|---|
/control/restart | POST | Restart the application/simulation |
/control/reset | POST | Reset specific subsystem to initial state |
/control/step | POST | Advance simulation by N steps |
Key implementation rules:
/diag/* endpoints are read-only — never mutate state in diagnostic handlersEach subsystem reports structured health:
{
"status": "healthy",
"subsystems": {
"simulation": { "status": "healthy", "details": { "tick": 1420, "entities": 156 } },
"economy": { "status": "degraded", "details": { "reason": "negative balance in 3 accounts" } },
"ui": { "status": "healthy", "details": { "active_view": "dashboard", "panels": 4 } }
},
"timestamp": "2026-03-09T14:30:00Z"
}
Health status values: healthy, degraded, unhealthy, unknown.
The /diag/ui/state endpoint returns semantic UI state — what's visible, selected, and active:
{
"active_view": "simulation",
"panels": {
"sidebar": { "visible": true, "selected_tab": "entities" },
"main": { "visible": true, "content": "world_map" },
"inspector": { "visible": true, "selected_entity": "country_42" }
},
"selections": {
"current_entity": { "id": "country_42", "name": "Freedonia" },
"current_tool": "inspect"
},
"form_values": {},
"modal": null
}
This replaces screenshots. Agents query this endpoint instead of taking and OCR-ing screenshots.
POST /diag/diff
{ "steps": 100, "filter": ["simulation", "economy"] }
Response:
{
"before": { "simulation.tick": 1420, "economy.gdp": 50000 },
"after": { "simulation.tick": 1520, "economy.gdp": 52300 },
"deltas": { "simulation.tick": "+100", "economy.gdp": "+2300 (+4.6%)" }
}
POST /diag/assert
{ "expression": "simulation.tick > 0 && economy.gdp > 0" }
Response:
{ "result": true, "expression": "simulation.tick > 0 && economy.gdp > 0", "values": { "simulation.tick": 1520, "economy.gdp": 52300 } }
Use templates/cli/ as starting point. Minimum subcommands:
app-diag health # GET /diag/health (formatted table)
app-diag ui # GET /diag/ui/state (formatted tree)
app-diag diff [--steps N] # POST /diag/diff
app-diag assert "<expr>" # POST /diag/assert
app-diag smoke-test # POST /diag/smoke-test
app-diag watch [--interval] # Poll health every N seconds
app-diag schema # GET /diag/schema
app-diag health — verify all subsystems reportapp-diag ui — verify UI state is accurateapp-diag smoke-test — verify end-to-end flowProjects with a diagnostic server should document it in their CLAUDE.md:
## Diagnostic Server
Port: 9876
CLI: `tools/app-diag`
Patterns: health, diff, assert, smoke-test, ui-state
Agents check for this section to know diagnostic endpoints are available.