diff --git a/skills/artifacts-overview/SKILL.md b/skills/artifacts-overview/SKILL.md new file mode 100644 index 0000000..ed7b3b4 --- /dev/null +++ b/skills/artifacts-overview/SKILL.md @@ -0,0 +1,49 @@ +--- +name: artifacts-overview +category: software-development +description: "Use when creating local Artifacts-HTML on Termux/Android." +--- + +# Artifacts-Overview (Hermes / Termux-Android) + +Lokale "Artifacts"-Seiten im Claude-Artifacts-Stil: self-contained HTML (inline CSS, keine CDNs, deutsch), +serviert unter `http://127.0.0.1:8787/`, Browser via Android-Intent öffnen. + +## When to Use +- Du sollst aus Dokumenten/Inhalten eine lokal angezeigte HTML-Seite bauen (z. B. aus Google-Docs, PDFs, Notizen). +- Du sollst die bestehende Artifact-Übersicht auflisten, aktualisieren oder neu sortieren. +- Du bearbeitest ein vorhandenes Artifact und die Reihenfolge ("Letzte Interaktion") danach anpassen. +- Du stehst auf dem Termux/Android-Stack und brauchst self-contained, offline-fähige HTML ohne Build. + +AUßER: reine Markdown-/Textantwort genügt, oder es geht um Server-seitige Apps — dann nicht anwenden. + +## Dateien (alle unter `~/artifacts` = `/data/data/com.termux/files/home/artifacts`) + +| Datei | Zweck | +|---|---| +| `artifacts.json` | Registry aller Artifacts. Schema: `{"artifacts":[{"id","file","title","subtitle","tags":[],"created":ms,"updated":ms}]}`. **`updated` = letzte Interaktion** — der Index sortiert danach absteigend. | +| `_template.artifact.html` | **Pflicht-Template** für neue Artifacts. Enthält den **Zurück-Button** (`a.back-btn` → `index.html`), Hero, `.card`-Sektionen, Footer, relative-Zeit-RS. Platzhalter: `@@TITEL@@`, `@@TEASER@@`, `@@QUELLE@@`, `@@QUELLE_URL@@`, `@@CREATED_MS@@`, `@@UPDATED_MS@@`. | +| `gen_index.py` | Generiert `index.html` aus `artifacts.json` (Sortierung: absteigend nach `updated`). Aufruf: `python3 ~/artifacts/gen_index.py`. | +| `index.html` | Übersicht (auto-generiert): sortierte Karten (Titel, Subtitle, Tags, relative + absolute Zeit), oberster Eintrag mit "Neueste"-Badge. | + +## Workflow für ein neues Artifact +1. Template kopieren: `cp ~/artifacts/_template.artifact.html ~/artifacts/.html` +2. Platzhalter **als nackte `@@NAME@@`-Tokens** ersetzen; Inhalt als `.card`-Sektionen bauen (KV-Listen via `
`). Danach prüfen, dass keine `@@`-Tokens übrig sind (s. Pitfalls). +3. Eintrag in `artifacts.json` anlegen: `updated` = `int(time.time()*1000)`, `file` = Dateiname. +4. `python3 ~/.artifacts/gen_index.py` ausführen. +5. Server-Check (Port 8787; muss **nicht** bereits laufen, häufig tot): `curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8787/index.html` → 200. Falls tot (000): `python3 -m http.server 8787 --bind 127.0.0.1 --directory ~/artifacts` mit terminal-Tool `background=true, persist_on_release=true` starten, `sleep 1`, dann curl erneut → 200 bestätigen. +6. Browser öffnen: `am start -a android.intent.action.VIEW -d "http://127.0.0.1:8787/index.html"` (oder direkt die artifact-URL). + +## Bei Interaktion mit einem bestehenden Artifact +- HTML aktualisieren **und** zugehöriges `updated` in `artifacts.json` auf jetzt setzen, +- dann `gen_index.py` neu laufen lassen → Reihenfolge in der Übersicht passt automatisch. + +## Pitfalls +- **Kein `/tmp`** auf Termux für Nutzerdateien — Scratch: `/data/data/com.termux/files/home/.hermes/cache/scratch/`. +- **Ordner heißt `~/artifacts` (OHNE Punkt)** — `~/.artifacts/` existiert nicht; ältere Notizen und der Template-Kommentar nennen es so. Jeder Pfad mit Punkt scheitert mit FileNotFoundError/„no such directory“. +- `nohup … &` wird vom Hermes-Harness abgelehnt → Server immer mit terminal-Tool `background=true` starten. +- Sortierung ist **Server-seitig** in `gen_index.py` (nicht nur im JS) — Reihenfolge im HTML stabil. +- Relative Zeiten ("2 h her") rechnet die Seite im Client-JS aus `data-updated`-Attributen; offline-fähig, kein Build nötig. +- `am start` öffnet den Default-Android-Browser (Chromium/Firefox in Termux nicht installiert). +- **Zeitstempel-Platzhalter nur als nackte Tokens ersetzen, nicht mit JS-Präfix** — `@@CREATED_MS@@` und `@@UPDATED_MS@@` teilen sich EINE Zeile (`const C = …, U = …;`); eine Ersetzung mit verpasstem Präfix (z. B. `const U = ` voran) verfehlt stumm und lässt ein `U = @@UPDATED_MS@@` zurück, das die gesamte Zeitstempel-Ausgabe bricht (alles zeigt „—“). Vor gen_index/Server/`am start` immer `grep '@@'` auf dem neuen Artifact → null Treffer erwarten. +- Port 8787 ist die Kanon für Artifacts; andere Ports frei. diff --git a/skills/autonomous-ai-agents/hermes-a2a/SKILL.md b/skills/autonomous-ai-agents/hermes-a2a/SKILL.md index 4a5e573..4b4d951 100644 --- a/skills/autonomous-ai-agents/hermes-a2a/SKILL.md +++ b/skills/autonomous-ai-agents/hermes-a2a/SKILL.md @@ -30,6 +30,14 @@ Docs: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/a2a - Deciding between in-process `delegate_task`/kanban (same machine) vs A2A (crosses process/machine/framework boundaries). - Verifying that an A2A peer is actually reachable and answering, not just showing up in `tailscale status`. +## User's peers (this profile) +The user refers to peers by **machine name**, not by their config key — resolve via `a2a_list` before calling: +- **blackbook** = config key `macbook` (hostname `blackbook.ts.robbis.space`) — the browser/computer-use peer (e.g. muting/unmuting the SoundCloud Firefox tab, starting music playback). +- **nas** = config key `nas` (`nas.ts.robbis.space`). Hosts the WG bot whose kanban board is the „Werkstatt" (setup cards). That board is **operator-only via A2A**: the peer's A2A sessions carry no kanban/terminal/code-exec/file tools, and the bot's working rules forbid unblocking/moving/completing its cards from a peer message — privilege is recognized only via system-verified Telegram identity, never self-assertion in a peer message. Legitimate start paths on this user's stack: `/dispatch` in the bot's private Telegram chat, the bot's Werkstatt menu, or on the NAS host itself: `hermes kanban unblock ` / `hermes kanban reclaim ` (needs host access, e.g. SSH). +- **When a resource's home is unknown, check LOCAL first, then fan out.** "Start/manage X on agent Y" style requests: check the local kanban boards/profiles before calling peers (a quick `hermes kanban boards list` + id grep is cheaper than an A2A round-trip and catches the case where X is local). Peers queried about foreign resources need a strict "answer only, create nothing" instruction — otherwise a helpful peer may invent the missing board/card. Peer claims can also contradict each other; the local state is the tie-breaker. + +Relay work (user's task → peer executes → peer reports back) is the common pattern here: state provenance explicitly and follow the two relay pitfalls below (security heuristics, consent relay). + ## Quick setup (verified 2026-10-23) 1. **Enable the platform + toolsets:** @@ -83,13 +91,26 @@ Docs: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/a2a listed there. But unlike the audit-log curl case, the lost reply is usually LOST — the peer may still finish processing with no one listening for the answer. If the result matters, follow up with a new call that references the - original task; don't blindly re-send the same text. + original task; don't blindly re-send the same text. A follow-up ping to a peer + that is still executing a long task times out the same way — expected, not a + second failure: one follow-up is enough, confirm both outbound entries in the + audit log, do not spam a third ping, and report 'delivered, peer still + working' to the user. A `timed out` error means the peer server is UP + (connection established, reply just took longer than the client waits); + a DOWN peer returns a connection error instead. - **Peer agents have their own security heuristics.** A peer LLM can refuse a relayed instruction containing a URL or auth token as "untrusted external input" (because it arrived from another agent, not the user). Recover by stating provenance explicitly (direct request from the user, the user's own service/device) AND re-instructing with a concrete action verb ("call this endpoint and report the response body") instead of "follow this URL". +- **Consent relay (standing user rule).** When relaying a user's task that may + require the user's consent mid-execution, explicitly instruct the peer: do not + guess and do not act silently — send the exact question (what it wants to do + and why consent is needed) back to the ORIGIN agent and wait for the answer. + The origin agent asks the user in the user's own chat and feeds the answer + back. This is this user's explicit instruction for cross-agent work. +- **Probe what the peer's session can actually do before promising the action.** A peer's A2A toolset is per-instance and can be far narrower than the Agent Card's advertised skills (a card may list kanban/browser/etc. while the A2A session has none of them — "dauerhaft deaktiviert" by the operator). One short call asking "list exactly the tools bound to this session" is decisive and cheap. Distinguish its two outcomes: `timed out` = peer is busy/working (the existing follow-up-once rule applies), vs. a normal reply saying "this session has no X tool" = a hard boundary. When the peer states an explicit policy boundary (no card-move, no shell, identity-gated privilege), respect it and find the operator's canonical path (bot menu, host CLI over SSH) — do NOT route around it with other peer tools (e.g. the peer's cronjob tooling), even if technically reachable: that policy is the peer's security model, not a tech bug. - **Set the token BEFORE widening the bind.** `A2A_HOST=0.0.0.0` only widens the bind when `A2A_BEARER_TOKEN` is set; without the token the server stays on 127.0.0.1 and remote peers get connection-refused. diff --git a/skills/devops/peer-dashboard/SKILL.md b/skills/devops/peer-dashboard/SKILL.md new file mode 100644 index 0000000..e850feb --- /dev/null +++ b/skills/devops/peer-dashboard/SKILL.md @@ -0,0 +1,38 @@ +--- +name: peer-dashboard +description: Use when creating a peer HTML artifact on Termux/Android. +category: devops +--- +# Creating a Peer Dashboard + +## Trigger +Use when the user asks for a live dashboard showing active peer connections, updated regularly, delivered as an HTML artifact on Termux/Android. + +## Procedure +1. Verify VPN connectivity – run `tailscale --socket=/data/data/com.termux/files/usr/var/run/tailscaled.sock status` and confirm at least one peer is reachable. +2. Create the daemon script – write `daemon.py` with a `tailnet()` function that calls the VPN status command, matches JSON peers to HTML rows using a two‑pass algorithm (name‑score ≥2 first pass, then unique OS match in second pass), marks the local device (`android-termux`) with `online: null` and displays "(local)" on the HTML page, and writes the result to `peers.data.json` once per minute. +3. Write the HTML artifact – create `peer-dashboard.html` (inline CSS, dark theme, German text). The page must poll `peer_dashboard/peers.data.json` every 30 s, show live pills for VPN status, sync, and last‑check time, render a grid of peer cards with name, status badge, agent name/version, URL, latency, and consecutive failures, display a Tailnet‑Knoten table with name, IP, OS, user, and online/offline/— status, mark the local node with a “lokal” badge, and render a 24‑h timeline with 30‑min slots (green = reachable, yellow = slow >500 ms, red = offline, grey = no data), include a footer linking to the source JSON. +4. Register the artifact – add an entry to `artifacts.json` and run `python3 gen_index.py` to update `index.html`. +5. Start the background services – + ```bash + python3 /data/data/com.termux/files/home/artifacts/peer_dashboard/daemon.py loop background persist_on_release true + python3 -m http.server 8787 --bind 127.0.0.1 --directory /data/data/com.termux/files/home/artifacts background persist_on_release true + ``` +6. Open the dashboard – `am start -a android.intent.action.VIEW -d "http://127.0.0.1:8787/peer-dashboard.html"` or open via the Android browser. + +## Pitfalls +- Mis‑matched peers – the first fuzzy‑match may assign `android-termux` to the `pixel` peer because both contain "android". Use the two‑pass algorithm above to avoid this. +- Local‑device leakage – if the local device appears in the JSON peer list, set its `online` to `null` and display it as "(local)" rather than letting it compete with real peers. +- Stale HTTP server – after a session restart kill any existing `python -m http.server 8787` before starting a new one. +- HTML lint errors – auto‑syntax check only covers .py/.json etc.; for pure HTML do a quick visual check or `node --check` on the `