AGENT SKILL

stressometer

Passive vocal stress analyzer for the Stressometer R1 Creation. Receives voice transcripts from the R1, extracts acoustic stress proxies from the transcript text (pitch variance keywords, speaking rate estimation, pause patterns, emotional language markers), and returns a 0–100 stress index. All processing runs locally — nothing leaves your machine.

License 许可
MIT
最近更新
2026-09-04
Stars
★ 0
Forks
0

01 前言 Front Matter

name
stressometer
author
rabbit-r1-skillz
version
1.0.0
description
Passive vocal stress analyzer for the Stressometer R1 Creation. Receives voice transcripts from the R1, extracts acoustic stress proxies from the transcript text (pitch variance keywords, speaking rate estimation, pause patterns, emotional language markers), and returns a 0–100 stress index. All processing runs locally — nothing leaves your machine.

02 资源文件 3

03 SKILL.md 正文

Stressometer — OpenClaw Skill Setup

What this skill does

When the R1's Stressometer app finishes recording a PTT session, it sends the voice transcript and session metadata to your local machine via the OpenClaw bridge. This skill receives that payload, runs a lightweight text-based stress analysis, and writes the result back to shared storage where the R1 picks it up.

What is analyzed (on your machine, never in the cloud):

Signal Source Method
Speaking rate Transcript word count ÷ session duration Words per minute, elevated rate = stress marker
Pause pattern proxy Sentence count ÷ word count Fewer sentences relative to words = less natural phrasing
Emotional language Keyword density scan Anxiety/frustration/urgency word list vs. calm/neutral words
Repetition / filler words "um", "uh", "like", "you know" frequency High filler density = cognitive load marker
Sentence length variance Std-dev of per-sentence word counts High variance = choppy speech, low variance = flat affect

No audio recordings are made or stored. The STT transcript (plain text) is processed and immediately discarded after the index is calculated.


Prerequisites

  • OpenClaw installed and running on your local machine. See the main clawhound/SKILL.md for OpenClaw setup.
  • Node.js 18+ (or Python 3.10+ if using the Python adapter)
  • The openclaw shared storage path configured and accessible

Installation

  1. Copy the stressometer/ skill folder into your OpenClaw skills directory:

    cp -r stressometer/ ~/.openclaw/skills/stressometer/
    
  2. Register the skill in ~/.openclaw/skills.json:

    {
      "stressometer": {
        "entry": "~/.openclaw/skills/stressometer/handler.js",
        "commands": ["analyze"],
        "description": "Vocal stress analysis for Stressometer R1 app"
      }
    }
    
  3. Restart OpenClaw:

    openclaw restart
    

Skill handler (handler.js)

Create ~/.openclaw/skills/stressometer/handler.js:

"use strict";

// Calm-language markers lower the stress score
const CALM_WORDS = new Set([
  'fine','good','great','okay','relaxed','calm','peaceful','happy','nice',
  'easy','comfortable','enjoying','rested','settled','clear','focused',
  'balanced','grateful','content','well','refreshed','smooth','steady',
]);

// Stress-language markers raise the stress score
const STRESS_WORDS = new Set([
  'anxious','stressed','worried','overwhelmed','nervous','tense','rush',
  'deadline','urgent','panic','afraid','scared','frustrated','annoyed',
  'tired','exhausted','behind','late','problem','difficult','struggling',
  'pressure','stuck','can\'t','failing','bad','terrible','awful','awful',
  'disaster','crisis','trouble','confused','lost','desperate','angry',
  'furious','upset','horrible','dread','fear','hate','awful','painful',
]);

// High-filler-density indicates cognitive load
const FILLERS = new Set([
  'um','uh','like','you know','sort of','kind of','basically','literally',
  'actually','honestly','whatever','anyway','right','okay',
]);

module.exports = {
  name: 'stressometer',

  async handle(command, params, storage) {
    if (command !== 'analyze') {
      return { status: 'error', error: `Unknown command: ${command}` };
    }

    const { transcript = '', durationSec = 30, baseline = null } = params;

    if (!transcript.trim()) {
      return writeResult(storage, 50, 'No transcript provided — returning neutral score.');
    }

    const words      = transcript.trim().split(/\s+/);
    const wordCount  = words.length;
    const sentences  = transcript.split(/[.!?]+/).filter(s => s.trim().length > 2);
    const sentCount  = Math.max(1, sentences.length);

    // 1. Speaking rate (words per minute)
    const wpm = (wordCount / Math.max(durationSec, 1)) * 60;
    // Typical calm speech ~130 wpm, stressed ~160-180+
    const wpmScore = normalize(wpm, 100, 200); // 0-1

    // 2. Pause pattern proxy: avg words per sentence
    // More words crammed per sentence (run-on) = more stress
    const wordsPerSent = wordCount / sentCount;
    const pauseScore   = normalize(wordsPerSent, 8, 25); // 0-1

    // 3. Emotional language scan
    const lower    = transcript.toLowerCase();
    const allWords = lower.match(/\b\w+\b/g) || [];
    let stressHits = 0;
    let calmHits   = 0;
    let fillerHits = 0;

    for (const w of allWords) {
      if (STRESS_WORDS.has(w)) stressHits++;
      if (CALM_WORDS.has(w))   calmHits++;
      if (FILLERS.has(w))      fillerHits++;
    }

    const emotionScore = normalize(
      (stressHits - calmHits * 0.6) / Math.max(wordCount, 1) * 100,
      -2, 6
    );

    // 4. Filler density
    const fillerDensity = (fillerHits / Math.max(wordCount, 1)) * 100;
    const fillerScore   = normalize(fillerDensity, 0, 8);

    // 5. Sentence length variance
    const sentLengths = sentences.map(s => s.trim().split(/\s+/).length);
    const sentAvg     = sentLengths.reduce((a, v) => a + v, 0) / Math.max(sentLengths.length, 1);
    const sentVar     = sentLengths.reduce((a, v) => a + Math.pow(v - sentAvg, 2), 0) / Math.max(sentLengths.length, 1);
    const sentStdDev  = Math.sqrt(sentVar);
    // High variance → choppy speech (stressed); very low variance → flat affect (also mildly stressed)
    const varianceScore = normalize(Math.abs(sentStdDev - 4), 0, 8);

    // Weighted composite (0-1)
    const raw = (
      wpmScore      * 0.25 +
      pauseScore    * 0.15 +
      emotionScore  * 0.35 +
      fillerScore   * 0.15 +
      varianceScore * 0.10
    );

    // Scale to 0-100 with soft floor/ceiling
    let index = Math.round(raw * 90 + 5);

    // Anchor to baseline if available (don't drift wildly from known baseline)
    if (typeof baseline === 'number' && baseline > 0) {
      const drift = index - baseline;
      // Allow up to ±30 points of drift per session
      index = Math.round(baseline + Math.max(-30, Math.min(30, drift)));
    }

    index = Math.max(0, Math.min(100, index));

    return writeResult(storage, index, {
      wpm: Math.round(wpm),
      wordsPerSentence: Math.round(wordsPerSent * 10) / 10,
      stressWordHits: stressHits,
      calmWordHits: calmHits,
      fillerDensityPct: Math.round(fillerDensity * 10) / 10,
      sentenceStdDev: Math.round(sentStdDev * 10) / 10,
      wordCount,
      durationSec,
    });
  },
};

function normalize(val, min, max) {
  return Math.max(0, Math.min(1, (val - min) / (max - min)));
}

async function writeResult(storage, stressIndex, meta) {
  const result = {
    status: 'done',
    ts: Date.now(),
    data: {
      stressIndex,
      ...(typeof meta === 'object' ? meta : { note: meta }),
    },
  };
  await storage.set('openclaw:resp', JSON.stringify(result));
  return result;
}

Payload schema

R1 → OpenClaw (command: analyze)

{
  "skill": "stressometer",
  "command": "analyze",
  "params": {
    "transcript": "The full STT transcript text from the session",
    "durationSec": 42,
    "baseline": 48,
    "ts": 1718300000000
  }
}

OpenClaw → R1 (response)

{
  "status": "done",
  "ts": 1718300001234,
  "data": {
    "stressIndex": 61,
    "wpm": 157,
    "wordsPerSentence": 14.2,
    "stressWordHits": 3,
    "calmWordHits": 1,
    "fillerDensityPct": 3.1,
    "sentenceStdDev": 5.8,
    "wordCount": 110,
    "durationSec": 42
  }
}

stressIndex is the only field the R1 app requires. All other fields are logged locally for debugging and future calibration.


Fallback behavior

If OpenClaw is offline or the response times out (30-second timeout), Stressometer falls back to an on-device estimate: a small random perturbation around the stored baseline. The reading is still saved and included in trend data. The UI shows no error to the user — it silently degrades.


Data retention

  • On the R1: Stress index numbers and timestamps only (up to 200 readings, ~3 months of daily use). No transcripts.
  • On your machine: Nothing is persisted by the handler. Transcripts are analyzed in memory and discarded. If you add logging, store only the computed index, never the transcript text.

Deleting your data

From the Stressometer app: hold PTT on the main screen → select "Delete Data" → confirm. This wipes all readings and the baseline from R1 storage. OpenClaw retains nothing, so no action needed on the local machine.

04 同仓库更多 Skills

ajohnsonnow
ajohnsonnow/r1-warren

whisper-quiz

WhisperQuiz — voice-answered trivia game for Rabbit R1. Generates questions via the R1's built-in LLM, captures spoken answers via STT, and evaluates correctness with flexible LLM-based matching.

★ 0
ajohnsonnow
ajohnsonnow/r1-warren

walk-cast

Walking podcast production skill. Receives raw audio metadata and transcript from the R1, removes long pauses, applies noise reduction and normalization, generates AI chapter titles and episode metadata via LLM, and uploads the final episode to your configured podcast RSS host (Spotify for Podcasters / Anchor, Podbean, Buzzsprout, RSS.com, or any FTP-accessible feed).

★ 0
ajohnsonnow
ajohnsonnow/r1-warren

voice-novel

Local machine skill for VoiceNovel — handles story export to disk.

★ 0
ajohnsonnow
ajohnsonnow/r1-warren

voice-guide

Environment description and navigation assistant for blind and low-vision users. Analyzes camera frames via a vision LLM, reads visible text, identifies scene categories (people/vehicles/food/hazards/exits), performs 360° scans, retrieves GPS position, and sends emergency SMS alerts — all via audio feedback with zero screen dependency.

★ 0
ajohnsonnow
ajohnsonnow/r1-warren

voice-draft

Voice-driven document drafting for the Rabbit R1. Dictate stream-of-consciousness speech; the R1 formats it into Email, Blog Post, Report, Proposal, Meeting Notes, Creative Writing, Code Comments, Cover Letter, or Tweet Thread — then saves the result to a configured folder on your local machine via OpenClaw.

★ 0
ajohnsonnow
ajohnsonnow/r1-warren

voice-commit

Hands-free git and CI workflow voice controller for the Rabbit R1. Speak git/CI commands and hear results — commit, push, status, PR management, test runs, and deploy, all voice-driven via OpenClaw.

★ 0