This guide explains how to install and start a Node.js/Express server for discovering and invoking skills remotely, including startup and restart procedures over Tailscale. It documents the API, mobile and gym features, and security controls such as token authentication, loopback-only access, and device sign-in links.
63%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Medium
Suggest reviewing before use
Fix and improve this skill with Tessl
tessl review fix ./.github/skills/remote-skills-api/SKILL.mdLightweight Express.js server that auto-discovers all skills from .github/skills/
and .claude/skills/, exposes them via a chat-style API, and serves a mobile-first
web UI. Access your entire skill library from your phone over Tailscale while on
vacation.
claude --version)automation/api), env var, or project root .env# 1. Install dependencies (first time only)
cd .github/skills/remote-skills-api
npm install
# 2. Start the server
npm start
# 3. Publish it to your tailnet over HTTPS (start-service.bat does this)
tailscale serve --bg 3838
# 4. Open on phone: https://<pc-name>.<tailnet>.ts.net
# The server listens on 127.0.0.1 only, so http://<tailscale-ip>:3838
# does not answer. Tailscale Serve is the only way in.A startup shortcut is installed in shell:startup so the server launches
minimized when you log in. To set it up manually:
# Creates a shortcut in your Windows Startup folder
$s = [Environment]::GetFolderPath('Startup')
$ws = (New-Object -ComObject WScript.Shell).CreateShortcut("$s\RemoteSkillsAPI.lnk")
$ws.TargetPath = "$PWD\.github\skills\remote-skills-api\start-service.bat"
$ws.WorkingDirectory = "$PWD"
$ws.WindowStyle = 7 # minimized
$ws.Save()The included start-service.bat sets the correct working directory and
supervises the Node process. A minimized cmd window stays in your taskbar.
If the API exits with the configured restart code, the batch file relaunches it
automatically.
Phone (Safari/Chrome)
│
│ HTTPS over Tailscale VPN
▼
┌──────────────────────────────┐
│ Express.js (port 3838) │
│ ┌────────────────────────┐ │
│ │ Skill Discovery │ │ Reads all SKILL.md files
│ │ .github/skills/* │ │ Builds registry at startup
│ │ .claude/skills/* │ │
│ ├────────────────────────┤ │
│ │ Chat Router │ │ Natural language → skill match
│ │ Request Queue │ │ Serial Claude CLI execution
│ ├────────────────────────┤ │
│ │ Claude CLI Backend │ │ claude -p <prompt>
│ │ MCP servers attached │ │ (.mcp.json — Playwright, etc.)
│ └────────────────────────┘ │
│ Mobile-first UI (ui.html) │
└──────────────────────────────┘| Method | Path | Description |
|---|---|---|
| GET | / | Mobile chat UI |
| GET | /api/status | Server status + queue info |
| GET | /api/skills | List all discovered skills |
| POST | /api/skills/reload | Re-scan skill directories |
| GET | /api/skills/:name | Read a skill's full SKILL.md |
| POST | /api/chat | Send chat message. JSON response by default; SSE stream when Accept: text/event-stream |
| GET | /api/chat/stream | SSE streaming chat (?q=...&skill=...) |
| POST | /api/invoke/:skill | Direct skill invocation ({args}) |
| POST | /api/admin/restart | Restart the Node service so start-service.bat relaunches it |
| POST | /api/cancel | Kill running Claude process |
| GET | /api/recent-notes | Vault notes touched in the last 7 days (?days=N, ?days=all) |
| GET | /api/notes-by-topic | Notes grouped by Library subfolder / podcast show |
| GET | /api/notes-by-week | Notes grouped by ISO week, newest first |
| GET | /api/gym/profiles | The app-wide weight units (kg or lb) and gym profiles with each one's program, next session, program week and pace against the plan ({enabled:false} when no gym data) |
| GET | /api/gym/week/:n | Week prescription plus per-day log status and any podcast picked for the day from <profile>/podcasts.json (?profile=) |
| GET | /api/gym/session/:week/:day | One day's prescription merged with its log (?profile=) |
| PUT | /api/gym/session/:week/:day | Save a partial log (?profile=) |
| POST | /api/gym/session/:week/:day/finish | Complete the session, fill blank reps, barbell loads and weighted pull-up loads (each marked assumed), and start the assessment; body {performedOn: "YYYY-MM-DD"} is the phone's local date, used when the log has none and within a day of the server's; returns {jobId} (?profile=) |
| POST | /api/gym/session/:week/:day/reopen | Make a finished session editable again (?profile=) |
| GET | /api/gym/exercises | Exercise library with how-tos and videos, from the tracked gym-library/exercises.json. Barbell lifts carry barKg, the empty bar in kilograms; single-weight lifts may carry a loadHint saying what to type (?profile=) |
| GET | /api/gym/stats | The athlete's program, week-by-week tonnage, RPE and adherence, 1RM trend, working-load trend and baseline re-checks (?profile=) |
| GET | /api/gym/assessments | Past session assessments, newest first (?profile=) |
All three note endpoints scan Research/Library and Podcasts in the vault
(skipping 00 MOC, attachments, transcripts, show index files, and stubs
under 1 KB) and return Obsidian deep links.
The vault name in those links is the vault name on the phone that opens the
link, which has nothing to do with this machine's folder name — here the
folder is Obsidian Vault while the phone's vault is Rabbidfly Vault.
Override with OBSIDIAN_VAULT_NAME if the phone's vault is renamed.
A link only resolves once the note has reached the device. The server lists notes the moment they hit the vault filesystem, so a note written minutes ago is listed here and still absent on the phone until Obsidian Sync pushes it — the phone then opens Obsidian and reports the file missing, which is true. That is a sync delay, not a bad link; the writing pipelines now end by leaving Obsidian running so Sync gets a window.
The gym routes read a private data store outside version control. When it is
absent, /api/gym/profiles reports enabled: false, every other gym route
returns 404 gym_not_configured, and the UI hides the Gym tab, so a fresh clone
behaves exactly as it did before this feature existed.
Gym sessions are done in program order: W1 D1, D2, D3, then W2 D1. The PUT and
finish routes accept any session already done and the next one, and answer
409 with code gym_session_out_of_sequence for anything later. A locked
session can still be read with GET, and reopen is unaffected, since it only
applies to a session already finished.
Each profile in profiles.json names its program, and a profile without one
is cycling. Both programs share the 12 weeks × 3 sessions structure, so
sequence, locking and pace work the same way for every athlete:
cycling opens with 3RM ramps and derives loads from the estimated 1RM.strength-tone never tests a max. Its working sets stop at RPE 8 and
progress by reps and load. Its only tested numbers are isBaseline checks
in weeks 1, 5, 9 and 12, including rep-count baselines where 0 is a valid
result. Stats reports those as baselineTrend and the heaviest working set
per exercise per week as loadTrend.repsMax, which makes its prescription a
range: 3 × 10–12.Weights are always stored in kilograms. profiles.json may set units: "lb"
for the whole app. The UI then takes pounds, stores them as kilograms to three
decimals so they read back exactly as typed, and shows prescribed loads in
5 lb steps, per hand for a dumbbell pair. gymlib.py --lb-target in the
gym-cyclist skill rounds the same way, so assessment notes match the app.
Finishing a session fills blanks the athlete skipped because they matched the
plan, and lists each in the entry's assumed array:
barKg in the library) with nothing prescribed and left
blank, or at 0, becomes the empty bar. On a max-test ramp only a typed 0 does.On a barbell the app takes only the plates, both ends added together, and adds
the library's barKg before saving. Stored loads stay totals with the bar in.
The card shows the target as plates to load, in 5 lb steps, with the total
beside it.
Typing into a field the server filled removes that field from assumed.
A set on an item with pairedWith (a contrast week's heavy set, followed by
box jumps) may also carry pairedResult: the box height in cm for those jumps.
It is a measurement and is never assumed.
A profile may also have <profile>/podcasts.json, keyed W<week>D<day>, with
an episode picked for that session. It is kept out of the week files, so
regenerating a week never drops it.
| Variable | Default | Description |
|---|---|---|
API_SECRET | (required) | Bearer token for auth |
SKILLS_PORT | 3838 | Server port |
SKILLS_HOST | 127.0.0.1 | Listen address. Loopback only, because Tailscale Serve proxies to it. 0.0.0.0 opens the port to the LAN |
TAILSCALE_HOST | (unset) | This machine's Tailscale name, e.g. my-pc.tailnet.ts.net. Needed for Tailscale sign-in |
TAILSCALE_ALLOWED_LOGINS | (unset) | Comma-separated Tailscale accounts that are signed in with no key, e.g. me@example.com,partner@example.com. Unset turns Tailscale sign-in off |
CORS_ORIGINS | (unset) | Comma-separated origins allowed to call the API from a browser. The UI needs none |
CLAUDE_PATH | claude | Path to Claude CLI binary |
CLAUDE_MODEL | sonnet | Model for Claude CLI |
SESSION_CONTEXT_TTL_HOURS | 2 | Max age for reusable chat history within the same skill scope |
ALLOW_QUERY_TOKEN | false | Allow ?token= authentication on API routes (not recommended) |
RESTART_EXIT_CODE | 75 | Exit code that tells start-service.bat to relaunch the service |
CLAUDE_TIMEOUT_MS | 300000 | Kill Claude process after this many ms (0 = no timeout) |
PUBLIC_URL | (Tailscale name) | Origin that device sign-in links point at, e.g. the Funnel address. Unset, it is read from tailscale status |
DEVICE_TOKENS_PATH | device-tokens.json | Where the hashes of device sign-in links are kept (gitignored) |
GYM_ASSESSMENT_DISABLED | false | Set to 1, true or yes to save finished gym sessions without running an assessment. The route tests set it so a test run can never spend a real model call. |
SESSION_CONTEXT_TTL_HOURS, even if you return to the same skill later.spawn ENAMETOOLONG errors.Authorization: Bearer <API_SECRET>start-service.bat runs tailscale serve --bg 3838, which publishes the app to the tailnet only. Funnel would put it on the public internet, where the key is all that stands between a stranger and a Claude CLI that runs with permissions bypassed. Do not turn Funnel on for this port.127.0.0.1, so the LAN and the bare Tailscale IP cannot reach port 3838. Only Tailscale Serve, on this machine, can.Tailscale-User-Login) and overwrites any copy the client sent. An account in TAILSCALE_ALLOWED_LOGINS is let in with no key, link or cookie. The header is believed only when the request came over loopback, names TAILSCALE_HOST, and was sent by the app's own page (Sec-Fetch-Site: same-origin, or a matching Origin from an older browser). Tailscale signs in every request a device makes, including one another website makes the browser send, so anything cross-site falls back to the key, link or cookie. To let someone outside the tailnet in, share the machine with their Tailscale account and add that account to the list.CORS_ORIGINS names an origin, so a page open in a browser on this PC cannot call http://localhost:3838 with an Authorization header.skills_auth, an HttpOnly, SameSite=Strict cookie that lasts 400 days and is refreshed on use. It holds an HMAC of the secret, not the secret, so rotating API_SECRET signs every device out. The page tries the cookie before asking for the key, so a device whose localStorage was wiped (common on iOS) doesn't have to type it again. POST /api/auth/logout clears it.https://<host>/#device=<token> signs one device in by itself every time it is opened, even where the browser keeps nothing (a private tab, a browser that clears site data, a chat app's in-app browser). The token rides in the URL fragment, which browsers never send to a server or in a Referer. The server keeps only its SHA-256 in device-tokens.json (gitignored, path overridable with DEVICE_TOKENS_PATH), each link can be removed on its own, and a device's cookie is tied to its link, so removing the link signs that device out too. Typing the key once in the app swaps it for that device's own link, puts the link in the address bar and suggests Add to Home Screen. Settings → Sign-in links lists the links with when each was last used, removes one, or makes one for another phone to open (Share or Copy). Links point at PUBLIC_URL when set, otherwise this machine's Tailscale (Funnel) name. At most 20 are kept; past that, the one unused the longest goes. API: GET/POST /api/auth/devices, DELETE /api/auth/devices/:id.[Auth] 401 <route> · <why> · <device kind> in server.log, for example no key, link or cookie · iPhone, an in-app browser. Nothing secret is logged. When someone keeps being asked for the key, these lines say why.?token= in the UI is only for saving token to localStorage on that device; API query-token auth is disabled by default.ALLOW_QUERY_TOKEN=true only if you intentionally need API query-token auth.https://<pc-name>.<tailnet>.ts.net. An account listed in TAILSCALE_ALLOWED_LOGINS is signed in by Tailscale and never sees the key prompt. Anyone else adds ?token=YOUR_API_SECRET once on a new deviceBottom tabs — Chat, Reader, Skills, Gym, Settings — replace the old crowded header icon bar. The Gym tab appears only when gym data is present.
/api/gym/profiles, so it takes any number of athletes and
opens the phone's own picker. The choice is remembered on the device, and
a remembered athlete who no longer exists falls back to the first without
losing the saved choice. Below it are the Week, Stats and Notes viewspairedWith) shows its jumps as their own step under each
set: a ▶ 20 s button for the jump window and a box for the height
(pairedResult)gym-cyclist skill and shows the assessment inline.
Above it, "New bests" lists anything that session's tests improved, read
from the maxes the server recomputed ("Squat 3RM 129 lb +15", "Pull-up
bodyweight × 3, was 2 reps")obsidian for vault ops)/api/invoke/last30days with {args: "AI agents"} for direct invocationserver.js or .env, call POST /api/admin/restart so the launcher restarts the process cleanlyUse this when you changed server code or environment settings and need a full process restart instead of a skill registry reload.
$headers = @{ Authorization = "Bearer $env:API_SECRET" }
Invoke-RestMethod -Method Post -Uri "http://localhost:3838/api/admin/restart" -Headers $headersIf a Claude request is still running, the endpoint returns 409 unless you force it:
$headers = @{ Authorization = "Bearer $env:API_SECRET"; 'Content-Type' = 'application/json' }
Invoke-RestMethod -Method Post -Uri "http://localhost:3838/api/admin/restart" -Headers $headers -Body '{"force":true}'obsidian — Vault operations (commonly invoked remotely)last30days — Research (good for phone-triggered research)visual-explainer — Generates HTML visualizationsrbc-banking — The original template this was generalised from0xRabbidfly/Eric-Cartman
88a17a1
cdnpmnpm installnpm starttailscaletailscale serveNew-ObjectInvoke-RestMethodclaudehttp://localhost:3838If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.