CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

remote-skills-api

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.

Quality

63%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Medium

Suggest reviewing before use

Fix and improve this skill with Tessl

tessl review fix ./.github/skills/remote-skills-api/SKILL.md
SKILL.md
Quality
Evals
Security

Remote Skills API

Purpose

Lightweight 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.

When to Use

  • "I want to run skills from my phone"
  • "Start the remote skills server"
  • "How do I access skills over Tailscale?"
  • Going AFK but leaving PC running

Prerequisites

  1. Node.js 18+ installed
  2. Claude CLI installed and on PATH (claude --version)
  3. Tailscale installed and running on both PC and phone
  4. API_SECRET — set via keyring (automation/api), env var, or project root .env

Quick Start

# 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.

Survive Reboots

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.

Architecture

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)   │
└──────────────────────────────┘

API Endpoints

MethodPathDescription
GET/Mobile chat UI
GET/api/statusServer status + queue info
GET/api/skillsList all discovered skills
POST/api/skills/reloadRe-scan skill directories
GET/api/skills/:nameRead a skill's full SKILL.md
POST/api/chatSend chat message. JSON response by default; SSE stream when Accept: text/event-stream
GET/api/chat/streamSSE streaming chat (?q=...&skill=...)
POST/api/invoke/:skillDirect skill invocation ({args})
POST/api/admin/restartRestart the Node service so start-service.bat relaunches it
POST/api/cancelKill running Claude process
GET/api/recent-notesVault notes touched in the last 7 days (?days=N, ?days=all)
GET/api/notes-by-topicNotes grouped by Library subfolder / podcast show
GET/api/notes-by-weekNotes grouped by ISO week, newest first
GET/api/gym/profilesThe 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/:nWeek prescription plus per-day log status and any podcast picked for the day from <profile>/podcasts.json (?profile=)
GET/api/gym/session/:week/:dayOne day's prescription merged with its log (?profile=)
PUT/api/gym/session/:week/:daySave a partial log (?profile=)
POST/api/gym/session/:week/:day/finishComplete 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/reopenMake a finished session editable again (?profile=)
GET/api/gym/exercisesExercise 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/statsThe athlete's program, week-by-week tonnage, RPE and adherence, 1RM trend, working-load trend and baseline re-checks (?profile=)
GET/api/gym/assessmentsPast 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.
  • A week item may carry an optional 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:

  • Blank reps become the prescribed reps, the prescribed hold for seconds, or the prescribed distance for a carry's metres. On a max-test ramp only for a set with a load (the card says 3). Never on a baseline, or on centimetres, which are a jump's measured height.
  • A blank load with a prescription becomes the weight the card showed. In pounds that is the target rounded the card's way (5 lb, per hand on a pair, the plates on a barbell), not the unrounded kg target. So 50 kg on a 20 kg bar stores as 65 lb of plates, and later reads back as 65, not 66.1.
  • A barbell set (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.

  • A weighted pull-up with no added load becomes 0, bodyweight.

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.

Environment Variables

VariableDefaultDescription
API_SECRET(required)Bearer token for auth
SKILLS_PORT3838Server port
SKILLS_HOST127.0.0.1Listen 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_PATHclaudePath to Claude CLI binary
CLAUDE_MODELsonnetModel for Claude CLI
SESSION_CONTEXT_TTL_HOURS2Max age for reusable chat history within the same skill scope
ALLOW_QUERY_TOKENfalseAllow ?token= authentication on API routes (not recommended)
RESTART_EXIT_CODE75Exit code that tells start-service.bat to relaunch the service
CLAUDE_TIMEOUT_MS300000Kill 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_PATHdevice-tokens.jsonWhere the hashes of device sign-in links are kept (gitignored)
GYM_ASSESSMENT_DISABLEDfalseSet 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.

Conversation Context Guards

  • Chat history is now scope-isolated: only messages from the same skill can be reused in follow-up prompts.
  • Switching from one skill to another immediately clears persisted history instead of carrying context across scopes.
  • Old history is also discarded after SESSION_CONTEXT_TTL_HOURS, even if you return to the same skill later.
  • General chat (no pinned skill / no slash-skill) is treated as its own separate scope and does not inherit skill-specific history.
  • Prompt transport should use Claude stdin mode for large prompts so long SKILL.md content does not trigger Windows spawn ENAMETOOLONG errors.

Security

  • Token auth (default): Header-only Authorization: Bearer <API_SECRET>
  • Tailscale Serve, not Funnel: 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.
  • Loopback only: the server listens on 127.0.0.1, so the LAN and the bare Tailscale IP cannot reach port 3838. Only Tailscale Serve, on this machine, can.
  • Tailscale sign-in: Tailscale Serve stamps each request with the signed-in account (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.
  • No cross-origin access: CORS is off unless CORS_ORIGINS names an origin, so a page open in a browser on this PC cannot call http://localhost:3838 with an Authorization header.
  • Remembered sign-in: any request with the right key also sets 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.
  • Device links: a link of the form 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.
  • Refused sign-ins are logged as [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.
  • URL token bootstrap: ?token= in the UI is only for saving token to localStorage on that device; API query-token auth is disabled by default.
  • Optional compatibility mode: Set ALLOW_QUERY_TOKEN=true only if you intentionally need API query-token auth.

Phone Setup (One-Time)

  1. Install Tailscale on your phone
  2. Open 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 device
  3. The app swaps the key for the device's own sign-in link and puts it in the address bar. Add that page to the Home Screen or bookmark it, and it signs in by itself from then on. For someone else's phone, make a link in Settings → Sign-in links and send it to them instead of the key
  4. Use Settings → API token anytime to update the token on that device
  5. Add to Home Screen for app-like experience (iOS: Share → Add to Home Screen)

UI Features

Bottom tabs — Chat, Reader, Skills, Gym, Settings — replace the old crowded header icon bar. The Gym tab appears only when gym data is present.

  • Chat interface: Natural language, rendered with Markdown
  • Research Reader: Three tab-selectable views over the vault
    • By Topic — Library subfolders and podcast shows as colour-coded cards with note counts; tap to drill into that folder's notes
    • By Date — collapsible ISO-week groups (W32 · Aug 3 – Aug 9), newest open
    • Recent — flat feed of the last 7 days
    • Search box filters across every note regardless of the active view; pull-to-refresh re-scans the vault; every note deep-links into Obsidian mobile
  • Skills tab: Full skill list with All / 🌐 Public / 🔒 Private filters
  • Gym tab: 12-week programs for any number of profiles, each following either the cycling strength block or the strength-tone block
    • A compact athlete menu sits beside the Gym title. It is a native select filled from /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 views
    • Program position follows the sessions done, not the calendar. Sessions go in order, W1 D1 to W12 D3, so a week that takes ten days stays the current week until its third session is done rather than rolling over on Monday
    • Week view opens on the week holding the next session. Each day card reads done, in progress, up next or locked, and a locked session opens read-only with the session that unlocks it. The week shows when its sessions actually happened ("Started 9 Sep · 2 of 3 done") instead of a calendar date range
    • A tracker above the week shows sessions done against where the plan expects them by now, this week's count, the projected finish at the current pace against the planned one, and every other athlete's position in one line. An athlete whose block hasn't started yet shows its start date instead
    • Session view logs load, reps and RPE per set with a numeric keypad, autosaves every change, shows rep ranges ("3 × 10–12") where the week has them, and links each exercise to its how-to and video
    • Each card reads as labelled chips (SETS, LOAD, RPE, REST, each in its own colour) that wrap only between chips, then a NOTE line and a LAST (or TEST) line with the previous session's sets. Barbells read "65 lb plates (109 lb total)", a dumbbell pair "70 lb (35/hand)", a max test "up to 9.5"
    • Weights read and type in the app-wide unit; a blank box shows the card's number and finishes as it. An exercise whose box needs saying gets a short hint ("One dumbbell.", "Plates loaded on the bar end.")
    • RPE is a tap target that opens the values people log (6–10, then 3, 4, 5, 9.5 for ramp warm-ups). The chosen value is green on target, amber over and blue under; on a max test, anything up to the ceiling is green
    • Focus mode: a sticky bar counts sets done ("9 / 21 sets"), the next set's number is highlighted, and an exercise folds to one line ("✓ 120 lb plates × 3, 3 sets · RPE 9 8 7") once every set has its RPE. A set counts as done when its RPE is in, or its number on an exercise with no RPE target; a weight alone doesn't. ▾/▸ folds or unfolds a card by hand, and reopening a session already under way scrolls to the next set
    • A contrast set (pairedWith) 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)
    • A rest timer starts itself when a set's RPE goes in, counting the card's rest, and sits above the tab bar with +15 s and stop. The jump window rolls straight into that set's rest. It chimes and flashes at zero (iPhones don't let a page vibrate, and the chime follows the silent switch). It runs on the wall clock, so a phone that slept shows the right time when it wakes
    • A save that can't reach the PC (no signal, Tailscale dropped) is kept on the phone and retried every few seconds, backing off to 30 s, and again when the connection returns. One calm notice says so, and another says when everything is saved. Closing the app doesn't lose it: the next time that session is opened, the kept sets are sent. Finish says the same thing instead of a bare "Load failed"
    • Cards that share a block letter (both D cards, say) are a superset and alternate their sets: the rest timer after A1 points to B1, after B1 to A2, and the next-set marker follows the same order
    • A timed hold (side plank, front plank) has a ▶ button per set instead of a load box. Tapped as the hold starts, it counts the prescribed seconds down, chimes, and fills in the seconds. A max hold (a test) counts up. Stop records the seconds held so far, and ✕ cancels without recording
    • Big view (the Aa Big view button on a session) shows one exercise, or one superset, at a time, in large type with large boxes and buttons, in black, white and yellow. The setting is remembered per athlete on that device. Back and Next move between exercises, and finishing an exercise's last set moves on by itself after a beat. The last step also shows the day notes and Finish. "Normal view" switches back
    • Typing a load or rep count that differs from the card offers to copy it to the sets still blank ("Use 70 lb plates for sets 2–3?")
    • Finish first shows what will be recorded: sets that finish as the card, test sets that count as triples, and the gaps (no RPE where the card has a target, no number where the number is the measurement). "Fix gaps" marks them in red and scrolls to the first
    • A session with a podcast picked for it shows the episode as a Spotify card, and the week list shows its title under the day
    • Finish workout runs the 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")
    • Stats shows pace (sessions per week so far, projected against planned finish), weekly tonnage, adherence and average RPE. A cycling athlete also sees the estimated 1RM trend and power baselines. A strength-tone athlete sees the pull-up path checks, working loads and core re-checks instead. Every trend with two or more points gets a sparkline across weeks 1–12 with the test weeks (1, 5, 9, 12) ticked
    • Text uses high-contrast tokens, and every number (loads, reps, RPE, stats, tracker counts) is drawn in the primary text colour
    • A finished session is read-only until reopened for safety and audit purposes
  • Skill chip: Pin a skill to scope your messages
  • Settings tab: API token, server restart, cancel request, live server status
  • Status indicator: Green = ready, yellow = processing
  • Cancel button: Kill a long-running request
  • Live streaming feedback: Shows phases (starting, thinking, tool use, writing) while Claude runs
  • Tool activity pills: Displays active/completed tool calls in real time
  • Completion metrics: Shows duration/cost metadata when available
  • Dark theme: Easy on eyes, OLED-friendly

Tips

  • Chat without selecting a skill — Claude sees the full skill list and picks the right one
  • Pin a skill via the ⚡ button for repeated use (e.g., pin obsidian for vault ops)
  • Use /api/invoke/last30days with {args: "AI agents"} for direct invocation
  • The server auto-discovers new skills — add a SKILL.md and hit "reload"
  • After editing server.js or .env, call POST /api/admin/restart so the launcher restarts the process cleanly

Remote Restart

Use 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 $headers

If 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}'

Related Skills

  • obsidian — Vault operations (commonly invoked remotely)
  • last30days — Research (good for phone-triggered research)
  • visual-explainer — Generates HTML visualizations
  • rbc-banking — The original template this was generalised from
Repository

0xRabbidfly/Eric-Cartman

Path

.github/skills/remote-skills-api/SKILL.md

Last updated
First committed
Purpose
DevelopmentAPI developmentWeb designSecurity and complianceInfrastructureDevOpsDocumentation
Form
WorkflowRulesBest practicesReference
Commands
cdnpmnpm installnpm starttailscaletailscale serveNew-ObjectInvoke-RestMethodclaude
Network origins
http://localhost:3838
Usage
One-off

Is this your skill?

If 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.