capture-activity-rpe
Captures RPE (1-10) and subjective notes when the operator replies to a daily fitness-brief notification on any configured channel. Triggers on inbound channel messages matching RPE grammar while state/strava-pending-rpe.json has a sync from the last 24h. Channel-agnostic.
- License 许可
- MIT
- 所属仓库
- gtapps/hermitd
- 最近更新
- 2026-11-15
- Stars
- ★ 85
- Forks
- 16
01 前言 Front Matter
- name
- capture-activity-rpe
- description
- Captures RPE (1-10) and subjective notes when the operator replies to a daily fitness-brief notification on any configured channel. Triggers on inbound channel messages matching RPE grammar while state/strava-pending-rpe.json has a sync from the last 24h. Channel-agnostic.
- allowed-tools
- [ "Read", "Bash(bun *fitness-lab.ts*)", "Bash(rm .hermit/state/strava-pending-rpe.json)", "mcp__plugin_discord_discord__reply" ]
03 SKILL.md 正文
Capture Activity RPE
Records the operator's perceived effort and subjective notes for the most recent synced activity.
Self-triggers on RPE-shaped replies while state/strava-pending-rpe.json is fresh. The skill's description is intentionally narrower than hermitd:channel-responder's so the harness picks it for these specific messages; any non-matching message exits silently and the normal channel-responder flow proceeds. Re-checks allowed_users itself.
Steps
-
Read
.hermit/state/strava-pending-rpe.json. If the file is absent: exit silently. Ifsynced_atis more than 24 hours ago: runrm .hermit/state/strava-pending-rpe.jsonand exit silently (reply window closed). -
Authorization. Read
.hermit/config.json→channels.<channel>.allowed_usersfor the inbound channel (extract the channel name from the inbound message metadata):- If
allowed_usersexists and the sender's platform user ID is not in it: exit silently. No response, no log, no state write. - If
allowed_usersis absent: accept (backwards-compatible). - If
allowed_usersis[]: reject all — exit silently.
- If
-
Parse the inbound message body (case-insensitive, leading/trailing whitespace stripped):
^(?:RPE\s*:?\s*)?(\d{1,2})(?:\s*/\s*10)?(?:[\s,:]+(.+))?$This matches:
7,7/10,RPE 7,RPE: 7,RPE:7,7 heavy legs,RPE 7, heavy legs,RPE: 7 heavy legs.- Extract
rpe(group 1) andnotes(group 2). If group 2 is absent or an empty string after trim, treatnotesasnull. - Validate
rpeis an integer from 1 to 10 inclusive. - If parse fails or validation fails: exit silently. (Bare
yes/no/y/ncannot match\d{1,2}so they are naturally excluded; the micro-approval branch inchannel-responderhandles them.)
- Extract
-
Persist the entry via the script (atomic upsert into
state/activity-notes.json, keyed by<pending.activity_id>, overwriting silently):bun ${CLAUDE_PLUGIN_ROOT}/scripts/fitness-lab.ts rpe <pending.activity_id> <rpe> [notes...]Pass the parsed
rpe; append the notes words only when group 2 matched (omit entirely when notes are null). The script writes{rpe, notes, recorded_at}—notesis always present,nullwhen none were captured — and stampsrecorded_atitself. No Strava call is made (the activity ID is supplied, notlatest), so this never touches the network. -
Run
rm .hermit/state/strava-pending-rpe.jsonso the same sync cannot bind twice. -
Reply via the channel's
replytool with{chat_id, text}.allowed-toolsonly lists Discord (mcp__plugin_discord_discord__reply); on non-Discord channels this step will fail with a permission error, but the RPE is already persisted in step 4. Extendallowed-toolswhen adding Telegram or iMessage.Got it — RPE <rpe>/10 saved for <pending.name>. -
Refresh the deep-dive. If
pending.sportisRun, re-invoke/hermitd-fitness:activity-deep-dive <pending.activity_id>. Thefitness-briefevening run generated this activity's deep-dive before any RPE existed, so re-running now folds the RPE in — the skill readsstate/activity-notes.jsonat its step 3b and overwritescompiled/activity-<id>-*.md. For non-Runsports the brief writes no deep-dive, so skip.
04 同仓库更多 Skills
task-decide
Record the operator's typed task decision.
dream
Nightly memory maintenance from transcript ground truth. Verifies, enriches and tidies auto-memory and topic pages with snapshot validation and undo. Also handles 'undo the dream'.
when-done-switch-to
Arm a deferred model or effort switch. Use for "when done switch to", "after this drop to sonnet", or "switch model when idle".
weekly-review
Generate the weekly review report for the current ISO week. Writes to .hermit/compiled/review-weekly-YYYY-Www.md (dev-facing detail) and sends a plain-language channel summary (Delivered / Decisions / Waiting on you / Spend). Runs every Sunday at 23:00 via routine.
watch
Background events via the config watch monitor or ad-hoc Monitor tool. Quiet watches cost zero tokens.
watch-activate
Activate the config watch monitor.