Skill: arunnadarasa/clinicaltempo (version 1.0.0)

--- name: clawhub description: >- Clinical Tempo / HealthTech Protocol — full repo context via public/llm-full.txt (or /llm-full.txt), tribal debugging via CLAWHUB.md, Tempo + MPP/x402 patterns, NHS routes, TIP-20 (viem/tempo), dance-extras live routes, EVVM on Tempo testnet. Use when: (1) Onboarding an agent or pasting system context, (2) Debugging 402/MPP, stale API, or port 8787 issues, (3) Editing docs that feed llm-full.txt, (4) Working on hub routes, server/index.js, or integrations (AgentMail, purl, OpenAI MPP, etc.), (5) EVVM deploy/docs, (6) Preparing a ClawHub or Copilot instruction bundle, (7) MPPScan/OpenAPI discovery at GET /openapi.json, (8) OpenClaw — optional **@anyway-sh/anyway-openclaw** plugin, (9) Publishing or consuming a ClawHub skill zip modeled on self-improving-agent rigor. For raw EVVM protocol depth, fetch https://www.evvm.info/llms-full.txt (not vendored in-repo). metadata: {} --- # Clinical Tempo · ClawHub context skill **Clinical Tempo** is the reference **HealthTech Protocol** superapp: React hub + dedicated routes, Node/Express API, **Tempo** settlement, **MPP / x402** machine payments. This skill tells agents **where context lives** and **how to avoid known traps** (see `CLAWHUB.md`). --- ## Quick reference | Situation | Action | | --- | --- | | Need **one file** with README + use cases + protocol + ClawHub | Load **`public/llm-full.txt`** or **`/llm-full.txt`** (running app). | | **`402` / MPP / wallet** confusion | **`CLAWHUB.md`** + relevant route in **`server/index.js`**. | | **UI works but API 404 / HTML** | Backend not running or **stale** process — restart **`npm run server`** (**`8787`**). | | Verify live MPP handler exists | **`GET http://localhost:8787/api/dance-extras/live`** → JSON with `flowKeys`. | | **Which screens exist** | **`src/hubRoutes.ts`**; hub **`/`**. | | **Changed markdown** included in bundle | **`npm run build:llm`** (runs before **`npm run build`**). | | **EVVM** (deploy, CLI, Tempo testnet) | **`docs/EVVM_TEMPO.md`**, **`/evvm`**; deep: **`https://www.evvm.info/llms-full.txt`**. | | **MPPScan / OpenAPI** | **`GET /openapi.json`**; **`npm run discovery`** · **`docs/MPPSCAN_DISCOVERY.md`** | | **OpenClaw + extra capabilities** | Optional plugin: **`openclaw plugins install @anyway-sh/anyway-openclaw`** — then restart gateway if needed; see **`references/openclaw-clinical-tempo.md`** | | **Promotion** of a fix for future agents | Short entry under **Successes** or **Failures** in **`CLAWHUB.md`** (no secrets). | | **TIP-20 mint** (`/nhs/tip20`) — issuer role + envelope `0x76` | **`CLAWHUB.md`** Success §10 / Failure §10; code **`src/tempoTip20Launch.ts`**. Mint needs **`ISSUER_ROLE`**; use **`writeContractSync(grantRole)`**, not **`grantRolesSync`** (batched tx type **0x76** breaks viem + browser wallets). | --- ## When to activate (triggers) Use this skill automatically when: 1. The user @-mentions **`llm-full.txt`**, **`CLAWHUB`**, **Clinical Tempo**, **MPP**, **dance-extras**, or **Tempo testnet/mainnet**. 2. The task touches **`server/index.js`**, **`server/payments.js`**, or **`src/danceExtras*.ts`**. 3. Docs are edited that appear in **`scripts/build-llm-full.mjs`** (bundle sources). 4. The user uploads **ClawHub** / **OpenClaw** / **Copilot** context questions. --- ## Recommended: Cursor / IDE 1. **`@`** `public/llm-full.txt` for broad changes; **`@`** `CLAWHUB.md` when debugging past incidents. 2. Project rules: repo root **`AGENTS.md`** or **`.cursor/rules`** if present — align with **`README.md`**. See **`references/openclaw-clinical-tempo.md`** for OpenClaw workspace file hints. --- ## Installation **From this repository (authoritative):** ```bash # Skill lives at: .cursor/skills/clawhub/ ``` **Manual copy to OpenClaw skills dir (optional):** ```bash cp -r .cursor/skills/clawhub ~/.openclaw/skills/clinicaltempo-clawhub ``` **ClawHub (publish):** Zip **`clawhub/`** (this folder) so the listing includes **`SKILL.md`**, **`references/`**, **`assets/`**, **`hooks/`**, **`scripts/`**. See **`README.md`** in this folder for a file manifest. ### OpenClaw: optional **Anyway** plugin This skill is **context-only**; **`@anyway-sh/anyway-openclaw`** extends the **OpenClaw** runtime with additional capabilities (separate from Clinical Tempo). Install when you want both: ```bash openclaw plugins install @anyway-sh/anyway-openclaw # If your setup requires it: openclaw gateway restart ``` Pair with: **this skill** (or [ClawHub listing](https://clawhub.ai/arunnadarasa/clinicaltempo)) + optional **`clinicaltempo-clawhub`** hook. Details: **`references/openclaw-clinical-tempo.md`**. --- ## Repository map (where to look) ``` clinicaltempo/ ├── public/llm-full.txt # Generated — do not hand-edit; run npm run build:llm ├── CLAWHUB.md # Tribal knowledge: successes, failures, checklists ├── README.md # Routes, stack, quick start ├── HEALTHTECH_USE_CASES.md # Flow-by-flow API contract ├── server/index.js # Express routes, integrations, MPP proxies ├── server/openapi.mjs # OpenAPI 3.1 for GET /openapi.json (MPPScan) ├── server/payments.js # Chain IDs, charge helpers ├── src/hubRoutes.ts # Hub directory of all /routes ├── src/danceExtrasLiveMpp.ts # Browser MPP helpers (live flows) ├── src/danceExtrasJudgeWire.ts # Judge-score wire snippets ├── .github/copilot-instructions.md └── scripts/build-llm-full.mjs # Source list for llm-full.txt ``` --- ## First load (full orientation) 1. Prefer **`public/llm-full.txt`** (or **`/llm-full.txt`** from a running build) — includes **`CLAWHUB.md`** in the bundle. 2. Regenerate after doc edits: **`npm run build:llm`**. ### Bundle sources Exact list: **`assets/LLM-BUNDLE-SOURCES.md`** (mirrors `build-llm-full.mjs`). ### EVVM: `llm-full.txt` vs `llms-full.txt` | Artifact | Role | | --- | --- | | **`public/llm-full.txt`** (singular) | Clinical Tempo-generated; committed; **use first**. | | **`https://www.evvm.info/llms-full.txt`** (plural) | Upstream EVVM protocol dump — **attach for EVVM-only depth**; do not duplicate into `public/` unless you intend to maintain a fork. | --- ## Debugging (tribal knowledge) Read **`CLAWHUB.md`** for: - What succeeded / failed (purl, AgentMail, **`402`** loops, **stale Express on 8787**, etc.) - Repeatable checks (e.g. **`GET /api/dance-extras/live`**) Deeper: **`references/troubleshooting.md`**. --- ## Key implementation pointers | Topic | Location | | --- | --- | | Live MPP dance flows | **`POST /api/dance-extras/live/:flowKey/:network`** — **`GET /api/dance-extras/live`** | | Hub routes | **`src/hubRoutes.ts`** | | Browser MPP | **`src/danceExtrasLiveMpp.ts`**, **`src/danceExtrasJudgeWire.ts`** | | Server | **`server/index.js`** | Concrete snippets: **`references/examples.md`**. --- ## Copilot Chat integration GitHub Copilot does not load this folder automatically. Options: 1. Commit **`/.github/copilot-instructions.md`** (already in Clinical Tempo repo). 2. Paste from **`references/copilot-and-agents.md`** into chat or org instructions. **Quick prompts:** - “Use **`llm-full.txt`** as context for this PR.” - “Scan **`CLAWHUB.md`** for 8787 / MPP / purl before changing the server.” - “After this task, suggest one **CLAWHUB** Success or Failure line (no secrets).” - “Regenerate **`public/llm-full.txt`** — which files are inputs?” → **`assets/LLM-BUNDLE-SOURCES.md`** --- ## Promotion: CLAWHUB vs llm-full | Content | Where | | --- | --- | | **Stable facts** (routes, env *names*, ports) | **`README.md`**, **`HEALTHTECH_USE_CASES.md`**, or relevant **`docs/*.md`** — then **`npm run build:llm`**. | | **Incident / debugging narrative** | **`CLAWHUB.md`** Successes / Failures. | | **EVVM upstream protocol** | Link **`https://www.evvm.info/llms-full.txt`**; keep **`docs/EVVM_TEMPO.md`** for Tempo-specific steps. | --- ## Verification script From repo root (optional): ```bash ./.cursor/skills/clawhub/scripts/verify-clinical-tempo-context.sh ``` Checks that **`public/llm-full.txt`** exists and reminds you of the live MPP **`GET`** check. --- ## OpenClaw hook (optional) Parity with [self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent): injects a **virtual** `CLINICAL_TEMPO_CONTEXT_REMINDER.md` on **`agent:bootstrap`** (skips sub-agents). No network I/O. ```bash # From this skill folder (or repo: .cursor/skills/clawhub/) cp -r hooks/openclaw ~/.openclaw/hooks/clinicaltempo-clawhub openclaw hooks enable clinicaltempo-clawhub ``` - **`hooks/openclaw/HOOK.md`** — metadata + enable/disable. - **`hooks/openclaw/handler.js`** — CommonJS handler (primary). - **`hooks/openclaw/handler.ts`** — TypeScript handler for OpenClaw (types from **`openclaw/hooks`** at runtime). Full notes: **`references/openclaw-clinical-tempo.md`**. --- ## Best practices 1. **Never** paste real **`.env`** secrets into prompts — use **`.env.example`** names only. 2. After editing any file listed in **`build-llm-full.mjs`**, run **`npm run build:llm`** before claiming “docs are updated in the bundle.” 3. Prefer **`GET /api/dance-extras/live`** over guessing whether the server is new. 4. For EVVM, answer **no** to optional Sepolia registry registration until policy allows (see **`docs/EVVM_TEMPO.md`**). --- ## Operations manual (same rigor as [self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent)) This skill mirrors that package’s **shape**: quick reference, OpenClaw integration, optional hooks/scripts, templates, and promotion — but maps “project memory” to **`CLAWHUB.md`** + **`README.md`** instead of only **`.learnings/`**. ### Promotion targets (where tribal knowledge goes) | Finding | Promote to | | --- | --- | | Incident / workaround / “what broke” | **`CLAWHUB.md`** Successes or Failures | | Stable routes, ports, env **names**, stack facts | **`README.md`**, **`HEALTHTECH_USE_CASES.md`**, or **`docs/*.md`**, then **`npm run build:llm`** | | IDE default context | **`.github/copilot-instructions.md`** | | OpenClaw workspace behavior | Workspace **`AGENTS.md` / `TOOLS.md`** (see **`references/openclaw-integration.md`**) | Entry templates: **`assets/templates/CLAWHUB-ENTRY.md`**. ### Optional: `.learnings/` format (LRN / ERR / FEAT) If you maintain a **parallel** log (e.g. in OpenClaw workspace), use the same ID patterns as self-improving-agent (**`LRN-YYYYMMDD-XXX`**, etc.). Starters ship under **`assets/learnings/`**. **Authoritative for this repo** remains **`CLAWHUB.md`**. ### Periodic review (before a large change) ```bash # Grep CLAWHUB for an area rg -n "MPP|402|8787|TIP-20|purl" CLAWHUB.md # Confirm bundle is fresh after doc edits npm run build:llm # Smoke API (server must run on 8787) curl -sS http://127.0.0.1:8787/api/dance-extras/live | head -c 400 ``` ### Detection triggers (load this skill when) - User mentions **`llm-full.txt`**, **`CLAWHUB`**, **Clinical Tempo**, **HealthTech**, **Tempo**, **MPP**, **`402`**, **NHS**, **TIP-20**, **8787**, **ClawHub**, or **OpenClaw**. - Editing **`server/index.js`**, **`scripts/build-llm-full.mjs`**, or **`src/hubRoutes.ts`**. - Preparing a **zip** for [clawhub.ai](https://clawhub.ai/) or debugging a **published** install. ### Claude Code / Codex hooks (optional) | Script | Role | | --- | --- | | **`scripts/activator.sh`** | Small XML-tagged reminder after each prompt (`UserPromptSubmit`) | | **`scripts/error-detector.sh`** | Optional hint after Bash failures (`PostToolUse`) | Configure **`.claude/settings.json`** or **`.codex/settings.json`** — full paths in **`references/hooks-setup.md`**. ### Multi-agent matrix | Agent | How this skill applies | | --- | --- | | **Cursor** | `@` **`public/llm-full.txt`** + **`CLAWHUB.md`**; rules in **`.cursor/rules`** if present | | **GitHub Copilot** | **`.github/copilot-instructions.md`** + **`references/copilot-and-agents.md`** | | **OpenClaw** | Copy skill + optional **`hooks/openclaw`**; see **`references/openclaw-integration.md`** | | **Claude Code** | Optional **`activator.sh`** hook | ### Skill extraction (new package from a fix) When a CLAWHUB entry is **reusable across repos**, consider a standalone skill: ```bash ./.cursor/skills/clawhub/scripts/extract-skill.sh my-org-skill --dry-run ./.cursor/skills/clawhub/scripts/extract-skill.sh my-org-skill ``` Then replace the scaffold under **`.cursor/skills/my-org-skill/`** using **`assets/SKILL-TEMPLATE.md`**. --- ## Files in this package | Path | Purpose | | --- | --- | | `SKILL.md` | This file — primary skill entry | | `README.md` | Package manifest + upload notes for ClawHub | | `_meta.sample.json` | Rename to `_meta.json` after ClawHub assigns IDs (optional) | | `references/copilot-and-agents.md` | Paste blocks for Copilot / chat | | `references/openclaw-clinical-tempo.md` | OpenClaw workspace + Anyway plugin | | `references/openclaw-integration.md` | Full OpenClaw + ClawHub install guide | | `references/hooks-setup.md` | Claude Code / Codex hook paths for `activator.sh` | | `references/examples.md` | Concrete @-mentions, curls, patterns | | `references/troubleshooting.md` | Common failures & fixes | | `assets/LLM-BUNDLE-SOURCES.md` | What feeds `llm-full.txt` | | `assets/SKILL-TEMPLATE.md` | Templates for new skills / forks | | `assets/templates/CLAWHUB-ENTRY.md` | Success / Failure append shapes | | `assets/learnings/*.md` | Optional LRN-style stubs (repo uses **`CLAWHUB.md`**) | | `scripts/verify-clinical-tempo-context.sh` | Quick repo checks | | `scripts/activator.sh` | Optional UserPromptSubmit reminder | | `scripts/error-detector.sh` | Optional PostToolUse (Bash) hint | | `scripts/extract-skill.sh` | Scaffold **`.cursor/skills/<slug>/`** | | `hooks/openclaw/HOOK.md` | OpenClaw hook manifest | | `hooks/openclaw/handler.js` | Bootstrap injector (CommonJS) | | `hooks/openclaw/handler.ts` | Bootstrap injector (TypeScript) | | `hooks/README.md` | Hook folder index | --- ## See also - **Published skill:** [clawhub.ai/arunnadarasa/clinicaltempo](https://clawhub.ai/arunnadarasa/clinicaltempo) — browse **[ClawHub](https://clawhub.ai/)** for versioned skills - **Ecosystem synergy (mpp-nanogpt-modal, nanochat, OpenClaw):** **`docs/ECOSYSTEM_SYNERGY.md`** - Structural inspiration: [self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent) (references, assets, scripts, hooks, `.learnings` patterns) - Clinical Tempo repo: **`README.md`**, **`CLAWHUB.md`**

path: references/examples.md
content: # Clinical Tempo — concrete examples

## Cursor / IDE context

```
@public/llm-full.txt
@CLAWHUB.md
@server/index.js
```

## OpenAPI / MPPScan (server must run)

```bash
curl -sS http://127.0.0.1:8787/openapi.json | head -c 400
npm run discovery
```

## Smoke: live MPP routes (server must run)

```bash
curl -sS http://127.0.0.1:8787/api/dance-extras/live | head
```

Expect JSON including `flowKeys` (array). If you get HTML or connection refused → wrong port or server not started.

## Regenerate LLM bundle

```bash
npm run build:llm
```

## Env names (never paste values)

From **`.env.example`**: `MPP_SECRET_KEY`, `MPP_RECIPIENT`, integration base URLs (`OPENAI_MPP_BASE_URL`, `AGENTMAIL_*`, etc.). **Do not** put real secrets in agent prompts.

## CLAWHUB-style success line (illustrative)

```markdown
3. **`GET /api/dance-extras/live` smoke** — returns `flowKeys` after restart of `npm run server` on 8787.
```

## EVVM deep link (attach in chat)

```
https://www.evvm.info/llms-full.txt
```

Use for protocol-level EVVM work; use **`docs/EVVM_TEMPO.md`** for Tempo testnet deploy steps.


path: references/openclaw-clinical-tempo.md
content: # OpenClaw + Clinical Tempo

This reference aligns **OpenClaw** workspace usage with the **Clinical Tempo** repo and documents the **optional bootstrap hook** (parity with [self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent)).

## Optional: bootstrap hook

Injects a **virtual** file **`CLINICAL_TEMPO_CONTEXT_REMINDER.md`** on **`agent:bootstrap`** so every session sees pointers to **`public/llm-full.txt`**, **`CLAWHUB.md`**, and **`GET /api/dance-extras/live`**. Sub-agent sessions are skipped.

**Install** (from this skill directory):

```bash
cp -r hooks/openclaw ~/.openclaw/hooks/clinicaltempo-clawhub
openclaw hooks enable clinicaltempo-clawhub
```

**Disable:**

```bash
openclaw hooks disable clinicaltempo-clawhub
```

**Files:** `hooks/openclaw/HOOK.md`, `handler.js`, `handler.ts`.

No secrets, no network calls.

---

## Optional: **Anyway** OpenClaw plugin (`@anyway-sh/anyway-openclaw`)

The Clinical Tempo skill does **not** bundle third-party plugins. For OpenClaw users who want **Anyway** capabilities alongside this repo’s skill:

```bash
openclaw plugins install @anyway-sh/anyway-openclaw
openclaw plugins list
# If your gateway needs a reload:
openclaw gateway restart
```

- **Clinical Tempo skill** → *what to read* (`llm-full.txt`, `CLAWHUB.md`, API smoke tests).
- **Anyway plugin** → *extra tools/integrations* inside OpenClaw (upstream package; trust path per your org).

Install order does not matter; both can coexist.

---

## Workspace files (manual injection)

If you use `~/.openclaw/workspace/`:

| Workspace file | Clinical Tempo equivalent |
| --- | --- |
| **`AGENTS.md`** (workspace) | Repo **`AGENTS.md`** if present; else **`README.md`** “Routes” + **`HEALTHTECH_USE_CASES.md`** |
| **`TOOLS.md`** | Integration notes in **`CLAWHUB.md`** + **`server/index.js`** headers |
| **`MEMORY.md`** | Not used in-repo; use **`CLAWHUB.md`** for durable tribal notes |

## Minimum injection blurb

Add to workspace **`AGENTS.md`** or session bootstrap if you **do not** use the hook:

```markdown
## Clinical Tempo
- Full context: `public/llm-full.txt` (regenerate: `npm run build:llm`)
- Debugging: `CLAWHUB.md`
- API smoke: `GET http://localhost:8787/api/dance-extras/live`
```

## Skills directory

Copy this skill for offline use:

```bash
cp -r /path/to/clinicaltempo/.cursor/skills/clawhub ~/.openclaw/skills/clinicaltempo-clawhub
```

Skill entry remains **`SKILL.md`** inside that folder.


path: references/openclaw-integration.md
content: # OpenClaw integration — Clinical Tempo (ClawHub skill)

Complete setup guide for using **this skill** with [OpenClaw](https://openclaw.ai/) and publishing on [ClawHub](https://clawhub.ai/). Structural parity with [self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent): workspace injection, hooks, optional scripts.

## Overview

| Layer | Role |
| --- | --- |
| **`public/llm-full.txt`** | One-shot repo orientation (regenerate: `npm run build:llm`)
| **`CLAWHUB.md`** | Tribal debugging — successes, failures, checklists
| **This skill** (`SKILL.md`) | Tells agents *where* to find the above and *common traps*
| **Optional hook** `clinicaltempo-clawhub` | Injects bootstrap reminder (`hooks/openclaw/`)

## Install the skill

### From ClawHub (recommended)

Browse **[clawhub.ai](https://clawhub.ai/)**, find **Clinical Tempo** / **`arunnadarasa/clinicaltempo`**, and install with the site’s CLI (or download the zip).

Example (when the CLI supports your listing slug):

```bash
npx clawhub@latest install arunnadarasa/clinicaltempo
```

If the CLI syntax differs, use the **Publish** page instructions on the site.

### From this repository (authoritative)

```bash
git clone https://github.com/arunnadarasa/clinicaltempo.git
cp -r clinicaltempo/.cursor/skills/clawhub ~/.openclaw/skills/clinicaltempo-clawhub
```

Skill entry file: **`SKILL.md`** inside that folder.

### Optional: `_meta.json` for tooling

After publishing on ClawHub, you may copy **`_meta.sample.json`** → **`_meta.json`** and fill **`ownerId`** / **`publishedAt`** from the site UI (or keep only the sample in git for reproducible zips).

---

## Workspace structure (OpenClaw)

```
~/.openclaw/
├── workspace/                 # Injected prompts (optional manual copies)
│   ├── AGENTS.md
│   ├── SOUL.md
│   ├── TOOLS.md
│   └── MEMORY.md
├── skills/
│   └── clinicaltempo-clawhub/   # or: clawhub from repo path
│       └── SKILL.md
└── hooks/
    └── clinicaltempo-clawhub/   # optional — copy from skill/hooks/openclaw
        ├── HOOK.md
        └── handler.js
```

---

## Injected prompt alignment

| OpenClaw workspace file | Clinical Tempo source |
| --- | --- |
| **AGENTS.md** | Repo **`README.md`** routes + **`HEALTHTECH_USE_CASES.md`**
| **TOOLS.md** | **`CLAWHUB.md`** integrations + **`server/index.js`**
| **MEMORY.md** (long-term) | Prefer **`CLAWHUB.md`** for durable *incident* notes (committed) |

Minimum blurb for workspace **`AGENTS.md`**:

```markdown
## Clinical Tempo (HealthTech Protocol)
- Full context: clone repo `public/llm-full.txt` or run app `/llm-full.txt`
- Debug: `CLAWHUB.md`
- API smoke: `GET http://localhost:8787/api/dance-extras/live`
```

---

## Install the hook (optional)

Injects **`CLINICAL_TEMPO_CONTEXT_REMINDER.md`** on **`agent:bootstrap`**. No network I/O.

```bash
cp -r /path/to/clinicaltempo/.cursor/skills/clawhub/hooks/openclaw ~/.openclaw/hooks/clinicaltempo-clawhub
openclaw hooks enable clinicaltempo-clawhub
```

Disable: `openclaw hooks disable clinicaltempo-clawhub`

Details: **`hooks/openclaw/HOOK.md`**, **`references/openclaw-clinical-tempo.md`**.

---

## Optional: Anyway plugin

Separate npm package — extra OpenClaw runtime capabilities:

```bash
openclaw plugins install @anyway-sh/anyway-openclaw
```

See **`references/openclaw-clinical-tempo.md`**.

---

## Inter-session patterns

When OpenClaw exposes **sessions_** tools, use them to hand off **file paths** (`CLAWHUB.md`, `server/index.js`) and **network** (testnet vs mainnet) so sub-agents do not re-discover the same traps.

---

## Promotion workflow (repo memory)

| Finding | Where |
| --- | --- |
| Stable product fact (routes, ports, env *names*) | **`README.md`**, **`HEALTHTECH_USE_CASES.md`**, **`docs/*.md`** → then **`npm run build:llm`**
| Incident / debugging narrative | **`CLAWHUB.md`** Successes / Failures |
| Copilot default context | **`.github/copilot-instructions.md`**

Never commit secrets — use **`.env.example`** names only.

---

## See also

- **`SKILL.md`** (main skill)
- **`references/hooks-setup.md`** — Claude Code / Codex UserPromptSubmit hooks for `activator.sh`
- **[ClawHub](https://clawhub.ai/)** — publish and browse skills


path: references/troubleshooting.md
content: # Clinical Tempo — troubleshooting (agents)

Cross-check with **`CLAWHUB.md`** for project-specific history.

## `Cannot POST /api/...` (HTML 404)

- **Cause:** Vite dev server handling the request without proxy, or **Express not running**.
- **Fix:** Run **`npm run server`** (port **8787**). With Vite, use **`npm run dev:full`** or ensure dev proxy targets **8787**.

## Stale API after editing `server/index.js`

- **Cause:** Old **`node`** process still bound to the port.
- **Fix:** Kill the old process; restart **`npm run server`**. Verify with **`GET /api/dance-extras/live`**.

## MPP / `402` loops

- **Cause:** Client not completing payment, wrong network, or server verification mismatch.
- **Fix:** Read **`CLAWHUB.md`** MPP sections; trace the specific route in **`server/index.js`**. Confirm chain (**testnet 42431** vs **mainnet 4217**) matches the UI.

## `purl inspect` / GET on POST-only routes

- **Cause:** **`purl inspect`** defaults to GET; many live routes are POST-only.
- **Fix:** Use **`purl --dry-run -X POST`** (see **`docs/PURL_CLINICAL_TEMPO.md`**).

## Documentation drift

- **Symptom:** **`public/llm-full.txt`** missing recent README changes.
- **Fix:** Run **`npm run build:llm`** after editing any source file in **`scripts/build-llm-full.mjs`**.

## MPPScan / `npm run discovery` fails or shows warnings

- **Cause:** API not running, wrong port, or **`server/openapi.mjs`** drift vs **`server/index.js`** routes.
- **Fix:** Start **`npm run server`** (**8787**). Confirm **`GET /openapi.json`** returns JSON. **`DANCE_EXTRA_LIVE_AMOUNTS`** must be edited only in **`server/openapi.mjs`** (imported by **`server/index.js`**). See **`docs/MPPSCAN_DISCOVERY.md`**. If port **8787** is already taken by a stale process, use another **`PORT`** or kill the old **`node`**.

## EVVM deploy: chain unsupported

- **Symptom:** EVVM CLI rejects **Tempo testnet (42431)**.
- **Fix:** Upstream allowlist — see **`docs/EVVM_TEMPO.md`** and EVVM issues; use local Anvil for experiments per upstream docs if needed.


path: references/copilot-and-agents.md
content: # Copilot & generic agents — copy-paste blocks

Use in **GitHub Copilot** instructions, **Claude** project knowledge, or **Codex** project docs.

**Published skill:** [clawhub.ai/arunnadarasa/clinicaltempo](https://clawhub.ai/arunnadarasa/clinicaltempo)

**OpenClaw (optional):** `openclaw plugins install @anyway-sh/anyway-openclaw` — pairs with this project’s skill; see `references/openclaw-clinical-tempo.md`.

---

## One-liner (system-style)

> Clinical Tempo: load **`public/llm-full.txt`** for full product context; use **`CLAWHUB.md`** for debugging history. API smoke: **`GET /api/dance-extras/live`** on **8787**. Regenerate bundle: **`npm run build:llm`**. Secrets: **`.env.example` names only**.

---

## MPPScan add-on

> Agent discovery: **`GET /openapi.json`** on the API origin. Validate: **`npm run discovery`** (with **`npm run server`**). See **`docs/MPPSCAN_DISCOVERY.md`** · [mppscan.com/discovery](https://www.mppscan.com/discovery).

---

## EVVM add-on

> For EVVM protocol depth beyond `docs/EVVM_TEMPO.md`, attach **`https://www.evvm.info/llms-full.txt`**. Clinical Tempo’s own file is **`llm-full.txt`** (singular), not EVVM’s **`llms-full.txt`**.

---

## After-task (optional)

> If you discovered a repeatable trap (ports, MPP, integration), suggest a short **Success** or **Failure** bullet for **`CLAWHUB.md`** — no credentials.

---

## GitHub Copilot (repo file)

The Clinical Tempo repo includes **`.github/copilot-instructions.md`** — keep that file in sync with this skill when onboarding contributors.


path: references/hooks-setup.md
content: # Hook setup — Clinical Tempo ClawHub skill

Configure **optional** reminders for **Claude Code**, **Codex CLI**, or similar agents that support shell hooks. Mirrors the pattern from [self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent); paths are adjusted for this monorepo.

## Overview

| Script | Purpose | Typical hook |
| --- | --- | --- |
| **`scripts/activator.sh`** | Reminds: `build:llm`, `CLAWHUB.md`, `GET /api/dance-extras/live` | `UserPromptSubmit` |
| **`scripts/error-detector.sh`** | Hints after failed shell steps (optional) | `PostToolUse` (Bash) |

Keep output **small** (~50–150 tokens) to limit overhead.

---

## Path from repo root

When the skill lives at **`.cursor/skills/clawhub/`**:

```text
.cursor/skills/clawhub/scripts/activator.sh
.cursor/skills/clawhub/scripts/error-detector.sh
```

---

## Claude Code — project-level

Create **`.claude/settings.json`** in the **clinicaltempo** repo root:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": ".cursor/skills/clawhub/scripts/activator.sh"
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": ".cursor/skills/clawhub/scripts/error-detector.sh"
          }
        ]
      }
    ]
  }
}
```

### Activator only (lower overhead)

Omit the `PostToolUse` block.

---

## Codex CLI

Same JSON shape under **`.codex/settings.json`** (if your Codex build supports hooks).

---

## Cursor

Cursor does not use this `settings.json` hook system by default. **Rely on** the **Cursor Rules** / **@** mention of **`public/llm-full.txt`** and **`CLAWHUB.md`**, or install the **OpenClaw** hook for gateway sessions.

---

## OpenClaw

Use **`hooks/openclaw/`** in this skill (`clinicaltempo-clawhub` bootstrap) — see **`references/openclaw-integration.md`**.

---

## Troubleshooting

| Issue | Check |
| --- | --- |
| Hook not firing | Paths relative to **repo root**; scripts executable (`chmod +x`)
| Too noisy | Use **activator only**; remove PostToolUse
| Wrong project | Hooks are **per workspace**; copy settings to each clone


path: README.md
content: # `clawhub` — Clinical Tempo · [ClawHub](https://clawhub.ai/) skill

Authoritative copy: **`.cursor/skills/clawhub/`** in the **[Clinical Tempo](https://github.com/arunnadarasa/clinicaltempo)** monorepo.

**Published listing:** [clawhub.ai/arunnadarasa/clinicaltempo](https://clawhub.ai/arunnadarasa/clinicaltempo)

**Rigor model:** Same **package shape** as [self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent) — `SKILL.md`, `references/`, `assets/` (templates + optional learnings stubs), `scripts/` (verify, activator, error-detector, extract-skill), `hooks/openclaw/`, optional `_meta.json` after publish.

---

## Purpose

- Point agents at **`public/llm-full.txt`** (full bundle) and **`CLAWHUB.md`** (tribal debugging).
- Document Tempo, MPP/x402, NHS, TIP-20, EVVM, OpenAPI — without duplicating the whole repo.

---

## Zip layout (upload to ClawHub)

Include **everything** below so installers get hooks + scripts:

| Path | Notes |
| --- | --- |
| `SKILL.md` | **Required** — entrypoint |
| `README.md` | This file |
| `_meta.sample.json` | Rename to `_meta.json` after ClawHub assigns IDs (optional) |
| `references/` | All `*.md` |
| `assets/` | `LLM-BUNDLE-SOURCES.md`, `SKILL-TEMPLATE.md`, `templates/`, `learnings/` |
| `scripts/` | `verify-clinical-tempo-context.sh`, `activator.sh`, `error-detector.sh`, `extract-skill.sh` (executable) |
| `hooks/openclaw/` | `HOOK.md`, `handler.js`, `handler.ts` |
| `hooks/README.md` | Hook index |

Do **not** zip `.git` or secrets.

---

## Install (consumers)

### ClawHub site

Use **Install** on [clawhub.ai](https://clawhub.ai/) or the documented CLI, e.g.:

```bash
npx clawhub@latest install arunnadarasa/clinicaltempo
```

(Syntax may vary — follow the live site.)

### From git

```bash
git clone https://github.com/arunnadarasa/clinicaltempo.git
cp -r clinicaltempo/.cursor/skills/clawhub ~/.openclaw/skills/clinicaltempo-clawhub
```

### OpenClaw hook (optional)

```bash
cp -r hooks/openclaw ~/.openclaw/hooks/clinicaltempo-clawhub
openclaw hooks enable clinicaltempo-clawhub
```

### Anyway plugin (optional)

```bash
openclaw plugins install @anyway-sh/anyway-openclaw
```

---

## Maintainer checklist

- [ ] After editing **`scripts/build-llm-full.mjs`** inputs, update **`assets/LLM-BUNDLE-SOURCES.md`**
- [ ] Run **`npm run build:llm`** before release if docs changed
- [ ] Bump **`_meta.sample.json`** version when publishing a new zip
- [ ] Append non-secret incidents to **`CLAWHUB.md`** in the repo

---

## See also

- **`SKILL.md`** — full skill body
- **`references/openclaw-integration.md`** — OpenClaw + ClawHub end-to-end
- **`references/hooks-setup.md`** — Claude Code hook JSON


path: hooks/openclaw/handler.js
content: /**
 * Clinical Tempo / ClawHub — OpenClaw bootstrap hook
 * Injects a reminder to load llm-full.txt + CLAWHUB.md before deep work.
 */

const REMINDER_CONTENT = `
## Clinical Tempo context (ClawHub skill)

**Published skill:** https://clawhub.ai/arunnadarasa/clinicaltempo

**OpenClaw (optional):** \`openclaw plugins install @anyway-sh/anyway-openclaw\`

**Full repo bundle:** \`public/llm-full.txt\` — regenerate: \`npm run build:llm\` (also runs before \`npm run build\`). Running app: **\`/llm-full.txt\`**.

**Tribal debugging:** \`CLAWHUB.md\` (successes, failures, MPP, port **8787**, purl, AgentMail).

**MPPScan discovery:** \`GET /openapi.json\` — validate: \`npm run discovery\` (server on 8787).

**API smoke (Express on 8787):** \`GET /api/dance-extras/live\` → JSON with \`flowKeys\`. If HTML/404 → wrong server or stale \`node\` process.

**Hub routes:** \`src/hubRoutes.ts\` · **Server:** \`server/index.js\`

**EVVM (optional depth):** \`docs/EVVM_TEMPO.md\` · upstream **\`https://www.evvm.info/llms-full.txt\`** (large; attach when needed).

**Secrets:** never paste real \`.env\` values — use \`.env.example\` names only.

After non-obvious fixes, consider a short line under **Successes** or **Failures** in \`CLAWHUB.md\`.
`.trim();

/** @param {unknown} event */
const handler = async (event) => {
  if (!event || typeof event !== 'object') {
    return;
  }

  const e = /** @type {{ type?: string; action?: string; sessionKey?: string; context?: { bootstrapFiles?: unknown } }} */ (
    event
  );

  if (e.type !== 'agent' || e.action !== 'bootstrap') {
    return;
  }

  const sessionKey = e.sessionKey || '';
  if (sessionKey.includes(':subagent:')) {
    return;
  }

  const ctx = e.context;
  if (!ctx || typeof ctx !== 'object') {
    return;
  }

  const files = ctx.bootstrapFiles;
  if (Array.isArray(files)) {
    files.push({
      path: 'CLINICAL_TEMPO_CONTEXT_REMINDER.md',
      content: REMINDER_CONTENT,
      virtual: true,
    });
  }
};

module.exports = handler;
module.exports.default = handler;


path: hooks/openclaw/HOOK.md
content: ---
name: clinicaltempo-clawhub
description: "Injects Clinical Tempo / ClawHub context reminder during agent bootstrap (llm-full.txt, CLAWHUB.md, API smoke)."
metadata:
  openclaw:
    emoji: "🏥"
    events:
      - agent:bootstrap
---

# Clinical Tempo · ClawHub context hook

Injects a short **virtual bootstrap file** so agents remember where full repo context and tribal debugging live.

## What it does

- Fires on **`agent:bootstrap`** (before workspace files are injected).
- Pushes **`CLINICAL_TEMPO_CONTEXT_REMINDER.md`** into `bootstrapFiles` (virtual).
- Skips **sub-agent** sessions (same pattern as self-improving-agent) to avoid noisy duplicates.

## Enable

```bash
# From the skill directory, or from a copy of this repo’s .cursor/skills/clawhub/
cp -r hooks/openclaw ~/.openclaw/hooks/clinicaltempo-clawhub

openclaw hooks enable clinicaltempo-clawhub
```

Disable:

```bash
openclaw hooks disable clinicaltempo-clawhub
```

## Configuration

None. No network calls; no secrets.

## See also

- Skill: `../../SKILL.md`
- OpenClaw alignment: `../../references/openclaw-clinical-tempo.md`


path: hooks/openclaw/handler.ts
content: /**
 * Clinical Tempo / ClawHub — OpenClaw bootstrap hook
 * Injects a reminder to load llm-full.txt + CLAWHUB.md before deep work.
 *
 * Loaded by OpenClaw at runtime; types come from the OpenClaw package.
 */

import type { HookHandler } from 'openclaw/hooks';

const REMINDER_CONTENT = `## Clinical Tempo context (ClawHub skill)

**Published skill:** https://clawhub.ai/arunnadarasa/clinicaltempo

**OpenClaw (optional):** \`openclaw plugins install @anyway-sh/anyway-openclaw\`

**Full repo bundle:** \`public/llm-full.txt\` — regenerate: \`npm run build:llm\` (also runs before \`npm run build\`). Running app: **\`/llm-full.txt\`**.

**Tribal debugging:** \`CLAWHUB.md\` (successes, failures, MPP, port **8787**, purl, AgentMail).

**MPPScan discovery:** \`GET /openapi.json\` — validate: \`npm run discovery\` (server on 8787).

**API smoke (Express on 8787):** \`GET /api/dance-extras/live\` → JSON with \`flowKeys\`. If HTML/404 → wrong server or stale \`node\` process.

**Hub routes:** \`src/hubRoutes.ts\` · **Server:** \`server/index.js\`

**EVVM (optional depth):** \`docs/EVVM_TEMPO.md\` · upstream **\`https://www.evvm.info/llms-full.txt\`** (large; attach when needed).

**Secrets:** never paste real \`.env\` values — use \`.env.example\` names only.

After non-obvious fixes, consider a short line under **Successes** or **Failures** in \`CLAWHUB.md\`.`;

const handler: HookHandler = async (event) => {
  if (!event || typeof event !== 'object') {
    return;
  }

  if (event.type !== 'agent' || event.action !== 'bootstrap') {
    return;
  }

  const sessionKey = event.sessionKey || '';
  if (sessionKey.includes(':subagent:')) {
    return;
  }

  if (!event.context || typeof event.context !== 'object') {
    return;
  }

  if (Array.isArray(event.context.bootstrapFiles)) {
    event.context.bootstrapFiles.push({
      path: 'CLINICAL_TEMPO_CONTEXT_REMINDER.md',
      content: REMINDER_CONTENT,
      virtual: true,
    });
  }
};

export default handler;


path: hooks/README.md
content: # OpenClaw hooks (Clinical Tempo skill)

This folder mirrors the layout used by [self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent).

## Contents

| Path | Purpose |
| --- | --- |
| **`openclaw/HOOK.md`** | Hook manifest (`name: clinicaltempo-clawhub`, events, enable commands) |
| **`openclaw/handler.js`** | CommonJS handler — injects virtual `CLINICAL_TEMPO_CONTEXT_REMINDER.md` |
| **`openclaw/handler.ts`** | TypeScript handler (same behavior; OpenClaw supplies `openclaw/hooks` types) |

## Install

```bash
cp -r hooks/openclaw ~/.openclaw/hooks/clinicaltempo-clawhub
openclaw hooks enable clinicaltempo-clawhub
```

See **`openclaw/HOOK.md`** for disable and behavior details.

## Related (non-OpenClaw)

For **Claude Code** / **Codex** session reminders, use **`../scripts/activator.sh`** and **`references/hooks-setup.md`** (different mechanism than OpenClaw hooks).


path: scripts/verify-clinical-tempo-context.sh
content: #!/usr/bin/env bash
# Quick checks from repo root: public/llm-full.txt exists; remind API smoke.
set -euo pipefail
# Script: .cursor/skills/clawhub/scripts/ — repo root is four levels up (scripts→clawhub→skills→.cursor→repo)
ROOT="$(cd "$(dirname "$0")/../../../.." && pwd)"
LLM="$ROOT/public/llm-full.txt"
echo "Clinical Tempo context check (repo: $ROOT)"
if [[ ! -f "$LLM" ]]; then
  echo "MISSING: $LLM — run: npm run build:llm"
  exit 1
fi
BYTES=$(wc -c < "$LLM" | tr -d ' ')
echo "OK: llm-full.txt exists ($BYTES bytes)"
echo "Tip: with server on 8787, run: curl -sS http://127.0.0.1:8787/api/dance-extras/live | head"
exit 0


path: scripts/activator.sh
content: #!/bin/bash
# Clinical Tempo / ClawHub skill — lightweight prompt reminder (~50–100 tokens).
# Pair with Claude Code / Codex UserPromptSubmit hooks. See references/hooks-setup.md

set -e

cat << 'EOF'
<clinicaltempo-clawhub-reminder>
Before closing this task on Clinical Tempo:
- If you changed docs that feed the bundle: run `npm run build:llm` and verify `public/llm-full.txt`.
- If you debugged MPP/402/8787: add a one-line Success or Failure to `CLAWHUB.md` (no secrets).
- API smoke: `GET http://localhost:8787/api/dance-extras/live` → JSON `flowKeys` when server is up.
- Full orientation: `@` `public/llm-full.txt`; tribal notes: `CLAWHUB.md`.
</clinicaltempo-clawhub-reminder>
EOF


path: scripts/extract-skill.sh
content: #!/bin/bash
# Scaffold a new Agent Skill folder from this package's template (Clinical Tempo convention).
# Usage: ./extract-skill.sh <skill-slug> [--dry-run]
# Output: ../../<skill-slug>/  (relative to scripts/ → .cursor/skills/<skill-slug>/)

set -e

RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SKILL_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
TEMPLATE="$SKILL_ROOT/assets/SKILL-TEMPLATE.md"
# Parent of `clawhub/` is `.cursor/skills/`
OUT_BASE="$(cd "$SKILL_ROOT/.." && pwd)"

usage() {
  echo "Usage: $(basename "$0") <skill-slug> [--dry-run]"
  echo "Creates: .cursor/skills/<skill-slug>/SKILL.md (from template header) + README stub."
}

SKILL_NAME=""
DRY_RUN=false
while [[ $# -gt 0 ]]; do
  case $1 in
    --dry-run) DRY_RUN=true; shift ;;
    -h|--help) usage; exit 0 ;;
    *) SKILL_NAME="$1"; shift ;;
  esac
done

if [[ -z "$SKILL_NAME" ]] || [[ "$SKILL_NAME" == *" "* ]]; then
  echo -e "${RED}ERROR:${NC} provide a lowercase-hyphenated skill slug" >&2
  usage
  exit 1
fi

DEST="$OUT_BASE/$SKILL_NAME"
if [[ -e "$DEST" ]]; then
  echo -e "${RED}ERROR:${NC} already exists: $DEST" >&2
  exit 1
fi

if $DRY_RUN; then
  echo -e "${GREEN}[dry-run]${NC} would create $DEST"
  exit 0
fi

mkdir -p "$DEST/references" "$DEST/assets" "$DEST/scripts"
cat > "$DEST/SKILL.md" << EOF
---
name: $SKILL_NAME
description: >-
  TODO: one paragraph — triggers, key files, when to load this skill.
metadata: {}
---

# ${SKILL_NAME//-/ }

Brief description. Replace this file with content modeled on \`.cursor/skills/clawhub/SKILL.md\`.

## Quick reference

| Situation | Action |
| --- | --- |
| … | … |

## See also

- Parent patterns: **Clinical Tempo** \`.cursor/skills/clawhub/\`
EOF

cp "$TEMPLATE" "$DEST/assets/SKILL-TEMPLATE.md" 2>/dev/null || true

cat > "$DEST/README.md" << EOF
# \`$SKILL_NAME\`

Scaffolded by \`clawhub/scripts/extract-skill.sh\`. Fill \`SKILL.md\`, add \`references/\`, then zip for [ClawHub](https://clawhub.ai/).
EOF

echo -e "${GREEN}OK:${NC} $DEST"


path: scripts/error-detector.sh
content: #!/bin/bash
# PostToolUse (Bash) — if tool output looks like an error, hint CLAWHUB.md logging.
# Reads CLAUDE_TOOL_OUTPUT when present (Claude Code).

set -e

OUTPUT="${CLAUDE_TOOL_OUTPUT:-}"

ERROR_PATTERNS=(
    "error:"
    "Error:"
    "ERROR:"
    "failed"
    "FAILED"
    "command not found"
    "No such file"
    "Permission denied"
    "fatal:"
    "Exception"
    "Traceback"
    "npm ERR!"
    "Cannot POST /api"
    "Internal JSON-RPC"
    "402"
)

contains_error=false
for pattern in "${ERROR_PATTERNS[@]}"; do
    if [[ "$OUTPUT" == *"$pattern"* ]]; then
        contains_error=true
        break
    fi
done

if [ "$contains_error" = true ]; then
    cat << 'EOF'
<clinical-tempo-error-detected>
Output may indicate a failure. If this was non-obvious, add a **Failures** subsection to `CLAWHUB.md` (symptom / cause / fix). For stale Express routes, restart `npm run server` and check `GET http://localhost:8787/api/dance-extras/live`.
</clinical-tempo-error-detected>
EOF
fi


path: _meta.sample.json
content: ownerId: REPLACE_AFTER_CLAWHUB_PUBLISH
slug: clinicaltempo-clawhub
version: 4.0.0

path: assets/SKILL-TEMPLATE.md
content: # Skill templates (Clinical Tempo / ClawHub)

Fork **this** skill or scaffold with **`scripts/extract-skill.sh`**. Follow the [Agent Skills](https://agentskills.io/specification) convention: YAML frontmatter, **`SKILL.md`** entry, no secrets.

---

## Full `SKILL.md` skeleton

```markdown
---
name: your-skill-slug
description: >-
  One paragraph: product, when to use, concrete triggers (like self-improving-agent),
  key paths (e.g. llm-full.txt, CLAWHUB.md), and out-of-repo links.
metadata: {}
---

# Your skill title

## Quick reference

| Situation | Action |
| --- | --- |
| … | … |

## OpenClaw / ClawHub

- Install: see your README; publish zip to [clawhub.ai](https://clawhub.ai/)
- Optional `_meta.json`: copy `_meta.sample.json` after publish

## Repository map

…

## Best practices

…

## Files in this package

| Path | Purpose |
| --- | --- |
| `SKILL.md` | Entry |
| `README.md` | Manifest + publish notes |
| `references/` | Deep dives |
| `assets/` | Templates |
| `scripts/` | Helpers |
| `hooks/openclaw/` | Optional OpenClaw hook |

## See also

- Reference implementation: **Clinical Tempo** `.cursor/skills/clawhub/`
```

---

## Minimal skeleton

```markdown
---
name: your-skill-slug
description: "What this does and when to activate."
metadata: {}
---

# Title

## Quick reference

| Situation | Action |
| --- | --- |
| … | … |

## Solution

…
```

---

## Naming

- **Slug:** lowercase, hyphens (`clinicaltempo-clawhub`, `api-timeout-patterns`)
- **Description:** lead with triggers (“Use when: (1) … (2) …”)

---

## Extraction checklist

- [ ] `description` lists **triggers** and **files**
- [ ] Quick reference table is actionable
- [ ] No secrets; env names only from **`.env.example`**
- [ ] `README.md` explains zip layout for ClawHub upload


path: assets/learnings/FEATURE_REQUESTS.md
content: # Feature requests (optional)

Append **FEAT-YYYYMMDD-XXX** when tracking capability gaps. For Clinical Tempo product work, prefer **GitHub issues** or **`HEALTHTECH_USE_CASES.md`** updates.

---


path: assets/learnings/ERRORS.md
content: # Errors log (optional)

Append **ERR-YYYYMMDD-XXX** entries when mirroring self-improving-agent format. Primary incident log for this repo: **`CLAWHUB.md`** Failures section.

---


path: assets/learnings/LEARNINGS.md
content: # Learnings log (optional)

**Clinical Tempo** uses repo root **`CLAWHUB.md`** as the primary tribal log. This file is an **optional** scratchpad if you want [self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent)-style **LRN-*** entries in addition to CLAWHUB.

If you only maintain one log, use **`CLAWHUB.md`** and delete this file.

---


path: assets/templates/CLAWHUB-ENTRY.md
content: # CLAWHUB.md entry templates

Use these shapes when appending to repo root **`CLAWHUB.md`** (no secrets). IDs are optional; narrative bullets are enough.

---

## Success (numbered list item)

```markdown
N. **Short title**  
   - One concrete fact or working pattern.  
   - Optional: file path or curl.  
```

Example:

```markdown
11. **TIP-20 mint after `createSync`**  
   - Grant **`ISSUER_ROLE`** before **`mintSync`** if `hasRole(issuer)` is false; use **`writeContractSync(grantRole)`** not **`grantRolesSync`** (envelope `0x76` vs browser wallets).  
   - **`src/tempoTip20Launch.ts`**
```

---

## Failure (subsection)

```markdown
### N) Short title

**Symptom**
- What the user or agent saw.

**Cause**
- Root cause (stale server, wrong role, wrong network).

**Fix**
- Actionable steps; link to code or doc.
```

---

## One-line promotion (from a PR)

```markdown
- **PR #NN**: [area] — [one sentence]; see `path/to/file`.
```

---

## Related

- **`CLAWHUB.md`** in repo (canonical log)
- **Self-improving-agent** style: `.learnings/*.md` — optional; see **`assets/learnings/`** in this skill for stricter LRN/ERR formats if you maintain a parallel log


path: assets/LLM-BUNDLE-SOURCES.md
content: # Sources concatenated into `public/llm-full.txt`

**Generator:** `scripts/build-llm-full.mjs`  
**Command:** `npm run build:llm` (also runs before `npm run build`)

Order matters for LLM context — matches the script’s `FILES` array:

| # | Repo path |
| --- | --- |
| 1 | `README.md` |
| 2 | `CLAWHUB.md` |
| 3 | `HEALTHTECH_USE_CASES.md` |
| 4 | `HEALTH_TECH_PROTOCOL_AZ.md` |
| 5 | `docs/PURL_CLINICAL_TEMPO.md` |
| 6 | `docs/TEMPO_WALLET_TEST.md` |
| 7 | `docs/EVVM_TEMPO.md` |
| 8 | `docs/MPPSCAN_DISCOVERY.md` |
| 9 | `docs/ECOSYSTEM_SYNERGY.md` |

**Do not** hand-edit `public/llm-full.txt`. Edit the sources above, then regenerate.

**Not included:** `https://www.evvm.info/llms-full.txt` (upstream EVVM — attach separately when needed).


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)