Claude
Skills
Sign in
Back

skill-system-ans

Included with Lifetime
$97 forever

Use when cron/autowake/tool reflexes need context-aware composition, physiology-aware fast/slow/handoff routing, or when an operator needs read-only visibility into autonomic state and cron surfaces.

Generalscripts

What this skill does


# Skill System ANS

This skill is the reusable autonomic nervous system layer for wake prompts, tool reflexes, explicit checkpoints, physiology-aware fast/slow routing, metrics, cron observability, and conditional cron-hook orchestration.

## Commands

```bash
python3 scripts/ans sensor finch
python3 scripts/ans compose finch --trigger autowake --sensor-file /tmp/sensor.json
python3 scripts/ans wake finch --trigger cron
python3 scripts/ans tool --event PostToolUse --payload-file /tmp/payload.json
python3 scripts/ans pain status finch --work-root /path/to/Work --human
python3 scripts/ans pain status finch --work-root /path/to/Work --human --cached
python3 scripts/ans physiology status finch --work-root /path/to/Work --human
python3 scripts/ans physiology record-slow-trace finch --work-root /path/to/Work --summary "resolved contradiction with design artifact" --bundle-id B-123
python3 scripts/ans checkpoint close-reports --work-root /path/to/Work
python3 scripts/ans cron status
python3 scripts/ans cron orchestrate --condition "hermes_inbox_unread>0" --action "inject:check-inbox-first" --work-root /path/to/Work --dry-run
python3 scripts/ans metrics report
```

## Rules

- Reuse existing Hermes/Work sensor scripts; do not duplicate all sensor logic.
- `ans cron status` is read-only and must surface drift/staleness explicitly.
- `ans sensor` now exposes nociception/pain, mental fatigue, cognitive mode, and OTel-ish telemetry fields.
- `ans pain status <agent>` turns physiology signals into strong nociception: internal pain, external pain, lesion evidence, containment, repair, prevention, and a closure gate.
- `ans pain status --cached` is the low-latency wake-prompt path; it labels evidence as cache-limited and avoids blocking autowake on live sensor hangs.
- Pain closure is stricter than diagnosis: if severity is not `clear`, `diagnosis_is_progress=false` and closure requires a named repair artifact plus a test/smoke proof.
- `ans physiology status <agent>` is the always-queryable portable physiology surface for operators.
- Hybridization tuning lives in `config/ans.yaml` and can be queried/set via `./sk config get ans.hybridization.mode` / `./sk config set ans.hybridization.mode fast_bias|balanced|slow_bias`.
- Slow-thinking now carries a direction contract: `SLOW_DIRECTION` if `ans.slow_think.current_direction` is set, otherwise `SLOW_FREE_EXPLORE` over bounded high-value zones.
- `ans physiology record-slow-trace` records successful SLOW traces into a lightweight JSONL log so repeated wins can later graduate into myelin candidates.
- `ans checkpoint close-reports` is the safe post-inbox checkpoint for dry-run close-report ingestion before any archive decision.
- `ans cron status` separates runtime health from canonical drift and reports actual/canonical/missing/extra entries.
- `ans cron install|enable|disable` stay dry-run/delegated in Daedalus scope; Work crontab ownership stays with Sisyphus.
- `ans cron orchestrate` is the dry-run design surface for condition-based cron hook installs; no live crontab edit without explicit apply + backup.
- Metrics are JSONL with caller-configurable paths.

## Design basis

- OpenTelemetry GenAI semantic conventions: token/retrieval/latency naming substrate
- DynaThink (EMNLP 2024): confidence/complexity gate for FAST vs SLOW
- System-1.x (ICLR 2025): controller + hybridization factor for subgoal routing
- Dualformer (ICLR 2025): fast/slow/auto modes and shortcut promotion from repeated successful slow traces
- Do LLMs Think Fast and Slow? (2024): caution that dual-process labels must map to measurable routing signals

## Lab mode tuning

```bash
./sk config get ans.hybridization.mode
./sk config get ans.slow_think.current_direction
./sk config set ans.hybridization.mode slow_bias
./sk config set ans.slow_think.current_direction apsipa-paper
./sk ans physiology status finch --work-root /path/to/Work --human
```

- `fast_bias`: raises deliberation thresholds so known reversible work stays FAST longer
- `balanced`: default profile
- `slow_bias`: lowers deliberation thresholds so ambiguity and contradiction route to SLOW earlier
- HANDOFF still wins on high-risk states (for example GPU fuse / PAIN_BLOCK / FATIGUE_HANDOFF)

## Slow-think direction

- `SLOW_DIRECTION`: there is a current tonic direction (for example `apsipa-paper`, `email-writing`, `roadmap`) and slow mode should advance it artifact-first.
- `SLOW_FREE_EXPLORE`: no explicit direction is set, so slow mode falls back to bounded exploration inside configured high-value zones.
- This implements Arthur's rule: slow-think should give itself a direction; if none exists, explore freely but in valuable territory.

Detailed operator flow: `physiology-runbook.md`

```skill-manifest
{
  "schema_version": "2.0",
  "id": "skill-system-ans",
  "version": "0.2.0",
  "capabilities": ["ans-sensor", "ans-compose", "ans-wake", "ans-tool", "ans-pain", "ans-physiology", "ans-checkpoint", "ans-cron", "ans-metrics"],
  "effects": ["fs.read", "fs.write", "proc.exec"],
  "operations": {
    "sensor": {
      "description": "Collect context-aware autonomic state for a target agent.",
      "input": {
        "agent": {"type": "string", "required": true, "description": "finch | wren | cerberus | talos | daedalus | sisyphus"},
        "work_root": {"type": "string", "required": false, "description": "Optional Work root containing .tkt scripts and inboxes"}
      },
      "output": {"description": "Autonomic sensor payload", "fields": {"status": "ok | error", "sensor_state": "object"}},
      "entrypoints": {"unix": ["python3", "scripts/sensor.py", "{agent}"], "windows": ["python", "scripts/sensor.py", "{agent}"]}
    },
    "compose": {
      "description": "Compose wake prompts from sensor state and YAML reflex rules.",
      "input": {
        "agent": {"type": "string", "required": true},
        "trigger": {"type": "string", "required": true},
        "sensor_file": {"type": "string", "required": false},
        "rules": {"type": "string", "required": false},
        "template": {"type": "string", "required": false}
      },
      "output": {"description": "Prompt + matched reflexes", "fields": {"status": "ok | error", "prompt": "string", "matched_reflexes": "array", "estimated_prompt_tokens": "integer"}},
      "entrypoints": {"unix": ["python3", "scripts/composer.py", "{agent}", "--trigger", "{trigger}"], "windows": ["python", "scripts/composer.py", "{agent}", "--trigger", "{trigger}"]}
    },
    "wake": {
      "description": "Run the sensor -> composer -> metrics wake pipeline.",
      "input": {
        "agent": {"type": "string", "required": true},
        "trigger": {"type": "string", "required": true},
        "work_root": {"type": "string", "required": false},
        "rules": {"type": "string", "required": false},
        "template": {"type": "string", "required": false},
        "metrics_path": {"type": "string", "required": false},
        "send": {"type": "boolean", "required": false}
      },
      "output": {"description": "Wake pipeline result", "fields": {"status": "ok | error", "prompt": "string", "matched_reflexes": "array", "sent": "boolean"}},
      "entrypoints": {"unix": ["python3", "scripts/wake.py", "{agent}", "--trigger", "{trigger}"], "windows": ["python", "scripts/wake.py", "{agent}", "--trigger", "{trigger}"]}
    },
    "tool": {
      "description": "Route PreTool/PostTool/PreCompact events through tool reflex rules.",
      "input": {
        "event": {"type": "string", "required": true},
        "payload_file": {"type": "string", "required": true},
        "rules": {"type": "string", "required": false}
      },
      "output": {"description": "Tool reflex result", "fields": {"status": "ok | error", "matched_reflexes": "array", "prompt": "string"}},
      "entrypoints": {"unix": ["python3", "scripts/tool.py", "--event", "{event}", "--payload-file", "{payload_file}"], "windows": ["python", "scripts/tool.py", "--event", "{event}", "--payload-fi
Files: 20
Size: 161.5 KB
Complexity: 71/100
Category: General

Related in General