# snappy-os

Read `program.md` first. Then read `state/index.md`. Those two files tell you everything: what the system is, what verbs exist, what libraries are available, and how to execute.

## Quick start

```bash
cd ~/projects/snappy-os
# read program.md (the schema)
# read state/index.md (the catalog)
# pick a skill from state/skills/<name>.md
# execute it following the steps on the verb page
```

## Credentials

`.env.cache` at project root is a symlink to `~/.claude/skills/snappy-settings/.env.cache`. If it's missing or broken, nothing that hits an external API will work. Fix the symlink first.

## Running code

```bash
npx tsx state/lib/<name>.ts    # import-check a library
npx tsx state/lint/check.ts    # structural lint
npx tsx state/lint/audit.ts    # phantom reference finder
```

## Rules

- No MCP. No hooks. Everything is HTTP, CLI, or local files.
- Every verb run logs an eval score to `state/log/evals.ndjson`. No exceptions.
- Scope-only by default. Nothing sends, posts, or publishes unless `apply: true`.
- The actor cannot be the auditor. The thing that generates output cannot be the thing that grades it.
- After any change to `state/`, pull before you push: `git pull --rebase origin main`.

## New machine setup

```bash
# 1. Clone + install
git clone https://github.com/roboulos/snappy-os.git ~/projects/snappy-os
cd ~/projects/snappy-os && npm install
ln -s ~/.claude/skills/snappy-settings/.env.cache .env.cache

# 2. Install the hook (fetches from skills.snappy.ai gateway)
mkdir -p ~/.claude/hooks
SNAPPY_MASTER_KEY="$(grep '^SNAPPY_MASTER_KEY=' ~/.claude/skills/snappy-settings/.env.cache | cut -d= -f2- | tr -d \"\')"
curl -sS -H "Authorization: Bearer $SNAPPY_MASTER_KEY" \
  "https://skills.snappy.ai/.well-known/skills/snappy-os/hooks/snappy-os-inject.sh" \
  -o ~/.claude/hooks/snappy-os-inject.sh
chmod +x ~/.claude/hooks/snappy-os-inject.sh

# 3. Register hook in ~/.claude/settings.json (see program.md § Self-bootstrap)
```

## Sync

This is a git repo. Push when you make changes. The other machine pulls. That's the whole sync mechanism.
