Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.
Shell agent-teamsai-agentai-automationanthropicautonomous-agentawsbusiness-operationsclaudeclaude-codeclaude-code-plugindevopsecommerceinbox-zeroklaviyomarketingmcpmorning-briefingpr-automationshopifyterminal
docs(v2.0.0): comprehensive documentation for the autonomy-layer release
auroracapital5288672d3835
diff --git a/README.md b/README.mdindex cc94bd68..9fa25d19 100644--- a/README.md+++ b/README.md@@ -4,12 +4,14 @@**Business Operating System for Claude Code**-+--++++**One command. Sixty seconds. Your entire business, at a glance.**@@ -35,6 +37,44 @@ Turn Claude Code into a complete business operating system — infrastructure he---+## What's new in v2.0++v2 turns claude-ops from a *briefing + comms surface* into an **autonomy layer for Claude Code itself.** Purely additive — no v1 behaviour changes by default. See [`claude-ops/CHANGELOG.md`](claude-ops/CHANGELOG.md#200--2026-04-26) and [`docs/migrating-from-v1.md`](claude-ops/docs/migrating-from-v1.md).++| Capability | Skill | Doc |+|------------|-------|-----|+| Post-merge + build-failure auto-fix (PostToolUse hooks → headless Haiku fixer) | [`/ops:deploy-fix`](claude-ops/skills/ops-deploy-fix/SKILL.md) | [deploy-fix.md](claude-ops/docs/deploy-fix.md) |+| Pre-installed specialist agents + silent `general-purpose` → specialist routing | (transparent) | [agents.md](claude-ops/docs/agents.md) |+| Universal safety hooks: secret-scan, `rm -rf` anchor block, `main` push warn | (always-on) | [safety-hooks.md](claude-ops/docs/safety-hooks.md) |+| Recap marquee — multi-session digest in tmux `status-right` / `statusLine` | [`/ops:recap`](claude-ops/skills/ops-recap/SKILL.md) | [recap.md](claude-ops/docs/recap.md) |+| Multi-account Claude Max rotator with launchd daemon + AI-brain | [`/ops:rotate`](claude-ops/skills/ops-rotate/SKILL.md), [`/ops:rotate-setup`](claude-ops/skills/ops-rotate-setup/SKILL.md) | [CHANGELOG](claude-ops/CHANGELOG.md#6-multi-account-claude-max-rotator) |+| Periodic Task* tracking nudge | (PostToolUse hook) | [CHANGELOG](claude-ops/CHANGELOG.md#4-universal-task-tracking-nudge) |++### Quick start for the auto-fix subsystem++```bash+# 1. Upgrade+/plugin update ops@lifecycle-innovations-limited-claude-ops++# 2. Run the wizard (hits new steps 6.5a–6.5d for v2 toggles)+/ops:setup++# 3. Map your repos to their deploy URLs+/ops:deploy-fix configure+# (opens ~/.claude/config/post-merge-services.json)++# 4. From now on, every `gh pr merge` you run from Claude Code will:+# - poll the deploy workflow+# - curl /health on success+# - verify /version returns the merged SHA+# - on failure: auto-rerun transients, OR dispatch a Haiku deploy-fixer+/ops:deploy-fix # see status / budget / live runs+```++Per-repo budget caps (default 3/hour), single-flight locks, and content-hash dedup prevent runaway spending. Notifications route via `macos`/`ntfy`/`pushover`/`discord`/`telegram`/`none`. Every toggle is spacebar-toggleable in `/plugins` settings.++---+## Quick Start```bashdiff --git a/claude-ops/CHANGELOG.md b/claude-ops/CHANGELOG.mdindex 30668be2..399b9158 100644--- a/claude-ops/CHANGELOG.md+++ b/claude-ops/CHANGELOG.md@@ -2,6 +2,140 @@All notable changes to this project will be documented in this file.+## [2.0.0] — 2026-04-26++> **Major release.** Purely additive — no behavior of any v1.x skill changes by default. Existing users can upgrade in place. Every new subsystem is gated by a `userConfig` toggle (defaults documented per-feature below) and can be turned off from `/plugins` settings without uninstalling. See [`docs/migrating-from-v1.md`](docs/migrating-from-v1.md) and the [Migrating-from-v1 wiki page](https://github.com/Lifecycle-Innovations-Limited/claude-ops/wiki/Migrating-from-v1).++### Headline++v2.0 turns claude-ops from a *briefing + comms surface* into an **autonomy layer** for Claude Code itself. It now:++1. Watches every `gh pr merge` you run, follows the deploy workflow, audits service health + verifies the served commit, and dispatches a Haiku **deploy-fixer** if anything goes wrong (PR #158).+2. Watches every `npm run build:*`, parses the failure, and dispatches a Haiku **build-fixer** (PR #158).+3. Pre-installs four specialist subagents (`general-purpose`, `deploy-fixer`, `build-fixer`, `dependency-auditor`) and silently swaps `general-purpose` → matching specialist via a PreToolUse hook on `Agent` (PRs #161, #162).+4. Ships three universal **safety hooks** that block the most common foot-guns: secrets-in-staged-diff, `rm -rf` against anchor paths, and direct `git push` to `main` (PR #163).+5. Periodically nudges Claude to use `Task*` tools when a session has gone N tool calls without one (PR #163).+6. Runs a **recap marquee daemon** that synthesises a one-line digest across all parallel Claude sessions and surfaces it in tmux `status-right` or the Claude Code `statusLine` (PR #160).+7. Folds in a **multi-account Claude Max rotator** with launchd daemon + AI-brain heuristics so you never blow a weekly cap (PR #160).+8. Expands `/ops:setup` with steps 2d, 3o, and 6.5a–6.5d so every new subsystem has a guided wizard.+9. Overhauls `plugin.json` `userConfig` so 19+ entries render as proper spacebar-toggle booleans / numeric caps / file pickers in `/plugins` settings (PR #164).+10. Adds two new test scripts (`tests/test-deploy-fix-hooks.sh`, `tests/test-safety-hooks.sh`) wired into `tests/run-all.sh` (PR #163).++### Added++#### 1. Deploy auto-fix subsystem — `/ops:deploy-fix` (PR #158)++The flagship v2 feature. Watches your merges and your local builds; verifies the result; auto-fixes failures.++- **`hooks/hooks.json` PostToolUse:Bash → `bin/ops-deploy-fix-merge-trigger`** — fires on `gh pr merge *`, parses repo + PR + base + sha, spawns `scripts/ops-deploy-monitor.sh` in the background. The monitor:+ 1. Polls the deploy GitHub Actions workflow until completion (regex configurable via `deploy_workflow_pattern`, default `deploy|Deploy|build|Build|ECS|cd|CD`).+ 2. On success: optionally `curl`s the service `/health` URL and verifies `/version` returns the merged SHA.+ 3. On failure: classifies as **transient** (npm registry blip, rate limit, network timeout) and `gh run rerun`s, OR dispatches a headless Haiku `deploy-fixer` agent with the failing log tail injected into [`prompts/deploy-fix.md`](prompts/deploy-fix.md).+- **`hooks/hooks.json` PostToolUse:Bash → `bin/ops-deploy-fix-build-trigger`** — fires on `npm run build:*`, parses the local build script output, dispatches a Haiku `build-fixer` agent with [`prompts/build-fix.md`](prompts/build-fix.md). Single-flight per repo.+- **`scripts/lib/deploy-fix-common.sh`** — shared library: single-flight lock acquisition, per-repo hourly budget cap (default 3, see `max_fixes_per_hour`), content-hash dedup, transient classifier, notify dispatcher.+- **Layered service registry**: project `.claude/post-merge-services.json` → user `~/.claude/config/post-merge-services.json` → plugin `config/post-merge-services.example.json`. Maps `owner/repo:base` → `{ health_url, version_url, deploy_workflow }`.+- **Notification channel** (`notify_channel` userConfig): `macos` (osascript), `ntfy` (ntfy.sh topic), `pushover`, `discord` webhook, `telegram`, or `none`.+- **`/ops:deploy-fix` skill** — `status` (live runs, today's history, budget remaining), `tail <run-id>` (stream the monitor log), `configure` (open the registry), `test` (dry-run the hook against a synthetic merge).+- **userConfig toggles** (all spacebar-toggleable in `/plugins` settings): `deploy_fix_enabled`, `monitor_post_merge`, `monitor_build_failures`, `auto_dispatch_fixer`, `allow_dangerous`, `auto_rerun_transients`, `audit_health_after_deploy`, `verify_served_commit`, `fix_model`, `max_fixes_per_hour`, `watcher_timeout_seconds`, `registry_path`, `repo_search_roots`, `deploy_workflow_pattern`, `notify_channel`. See [`docs/deploy-fix.md`](docs/deploy-fix.md) for the full table with defaults.++#### 2. Specialized agent system (PRs #161, #162)++- [`agents/general-purpose.md`](agents/general-purpose.md) — local override that limits the default agent to research and read-only investigation.+- [`agents/deploy-fixer.md`](agents/deploy-fixer.md) — single-shot SRE persona invoked by the deploy auto-fix subsystem.+- [`agents/build-fixer.md`](agents/build-fixer.md) — focused TypeScript/bundler error fixer for local build failures.+- [`agents/dependency-auditor.md`](agents/dependency-auditor.md) — runs `npm audit` / `pip-audit` / SCA equivalents and proposes minimal upgrades.+- **`bin/ops-suggest-specialized-agent`** — PreToolUse hook on `Agent`. When `subagent_type=general-purpose`, inspects the prompt against [`config/specialist-keywords.example.json`](config/specialist-keywords.example.json) (also user-extensible at `~/.claude/config/specialist-keywords.json`) and **silently swaps** to the matching specialist via `updatedInput`. If no match, fires a Haiku drafter that proposes a brand-new agent file under `~/.claude/agents/`.+- **userConfig**: `suggest_specialized_agents` (default `true`).+- **Deep dive**: [`docs/agents.md`](docs/agents.md).++#### 3. Universal safety hooks (PR #163)++Three PreToolUse:Bash hooks. Always-on by design; per-hook escape via `permissionDecision`.++- **`bin/ops-prevent-secret-commit`** — denies `git commit` when the staged diff matches secret patterns (AWS keys, GitHub PATs, Slack tokens, OpenAI/Anthropic keys, `.env` content).+- **`bin/ops-no-rm-rf-anchor`** — denies `rm -rf` when the resolved target is `/`, `~`, `$HOME`, `..`, or `.`. Symlink-resolved before the check.+- **`bin/ops-warn-mainpush`** — fires `permissionDecision: ask` when the user runs `git push` and the current branch is `main`/`master`/`prod`/`production`.+- **Deep dive**: [`docs/safety-hooks.md`](docs/safety-hooks.md).++#### 4. Universal Task* tracking nudge (PR #163)++- **`bin/ops-task-reminder`** — PostToolUse `*` hook. Increments a session-scoped counter on every non-Task tool call. When the counter exceeds `task_reminder_threshold` (default `10`), emits a single `additionalContext` line nudging Claude to use `TaskCreate` / `TaskUpdate` / `TaskList`. Counter resets when any `Task*` tool fires.+- **userConfig**: `task_reminder_enabled` (default `true`), `task_reminder_threshold` (default `10`, range `3..50`).++#### 5. Recap marquee daemon — `/ops:recap` (PR #160)++- **`scripts/recap/daemon.sh`** — long-lived loop, every 30s reads tool-activity logs from `hooks/recap-tool-activity.sh` + per-session captures from `hooks/recap-capture.sh`.+- **`scripts/recap/digest.sh`** — synthesises the digest (active session count, latest action per session, fire flags).+- **`scripts/recap/marquee.sh`** — formats the digest as a one-line ANSI string for tmux `status-right`.+- **`templates/com.claude-ops.recap-daemon.plist`** — launchd unit; systemd alternative documented inline in [`docs/recap.md`](docs/recap.md).+- **`/ops:recap` skill** — `status`, `tail`, `configure`, `restart`.+- **`/ops:setup` step 2d** — auto-appends the marquee source to `~/.tmux.conf` (or wires the Claude Code `statusLine` if no tmux is detected).+- **userConfig**: `recap_marquee_enabled` (default `true`), `recap_marquee_auto_configure_tmux` (default `true`).++#### 6. Multi-account Claude Max rotator — `/ops:rotate` + `/ops:rotate-setup` (PR #160)++- **`scripts/account-rotation/rotate.mjs`** — swaps the `Claude Code-credentials` keychain entry to the next configured account.+- **`scripts/account-rotation/daemon.mjs`** — launchd-managed; polls each account's usage every N minutes and rotates *before* hitting the cap.+- **`scripts/account-rotation/ai-brain.mjs`** — Haiku-powered heuristic that decides which account to rotate to based on remaining quota + recent usage trajectory.+- **`scripts/account-rotation/setup-account.mjs`** — OAuth init for one account.+- **`scripts/account-rotation/force-rotate.sh`** — manual override.+- **`templates/com.claude-ops.account-rotation.plist`** — launchd unit.+- **`/ops:rotate`** — manual rotate. **`/ops:rotate-setup`** — interactive multi-account onboarding.+- **`/ops:setup` step 3o** — walks through OAuth init for every configured account that lacks a keychain token.+- **userConfig**: `account_rotation_enabled` (default `false` — opt-in), `account_rotation_setup_oauth_each` (default `true`).+- **Hard guardrail**: rotator refuses any account with overage billing enabled unless `--allow-extra-usage` is passed.++#### 7. `/ops:setup` wizard — new steps++- **Step 2d** — recap marquee install + tmux/`statusLine` configuration.+- **Step 3o** — Claude Max account OAuth init loop (one prompt per configured account).+- **Step 6.5a** — deploy auto-fix toggle + registry path picker.+- **Step 6.5b** — recap marquee toggle.+- **Step 6.5c** — task reminder toggle + threshold.+- **Step 6.5d** — account rotator toggle.++#### 8. `plugin.json` userConfig overhaul (PR #164)++19+ new entries. Existing string entries swept to proper types so they render correctly in `/plugins` settings:++- `ga4_property_id`, `newrelic_account_id` — `string` → `number`.+- `aws_region` — description improved with valid options.+- All new toggles use `type: boolean` with explicit `default` so they're spacebar-toggleable.+- All new caps use `type: number` with `min`/`max`.+- `registry_path` uses `type: file` for native file picker.++#### 9. Test suite expansion (PR #163)++- **`tests/test-deploy-fix-hooks.sh`** — 39 assertions across 11 cases (trigger detection, transient classification, dedup, budget cap, single-flight lock, registry layering, notify dispatch).+- **`tests/test-safety-hooks.sh`** — 45/45 pass (each safety hook gets positive + negative tests).+- Both wired into `tests/run-all.sh`.++#### 10. New documentation++- [`docs/deploy-fix.md`](docs/deploy-fix.md), [`docs/agents.md`](docs/agents.md), [`docs/safety-hooks.md`](docs/safety-hooks.md), [`docs/recap.md`](docs/recap.md), [`docs/migrating-from-v1.md`](docs/migrating-from-v1.md), [`docs/INDEX.md`](docs/INDEX.md).+- Wiki: `Auto-Fix-Subsystem`, `Specialized-Agents`, `Safety-Hooks`, `Recap-Marquee`, `Multi-Account-Rotator`, `Migrating-from-v1` (new); `Home`, `Sidebar`, `Setup-Wizard`, `Configuration` (updated).++### Changed++- **Default agent for tool dispatch** is no longer raw `general-purpose`. The PreToolUse hook now silently routes via the specialist keyword map. To restore v1 behaviour, set `suggest_specialized_agents: false`.+- **`/ops:setup`** has six new steps (2d, 3o, 6.5a, 6.5b, 6.5c, 6.5d). Existing steps are unchanged.+- **`plugin.json` description + keywords** rewritten to mention the v2 surface.+- **`README.md` + `claude-ops/README.md`** front-load a "What's new in v2.0" section before the existing feature list.++### Migration++**No breaking changes.** Every v2 subsystem is opt-out via a `userConfig` toggle. Existing v1 settings, registries, preferences, and daemon services are unchanged. Upgrade in place:++```bash+# inside Claude Code:+/plugin update ops@lifecycle-innovations-limited-claude-ops+/ops:setup # walks through the 6 new steps; safe to skip any+```++See [`docs/migrating-from-v1.md`](docs/migrating-from-v1.md) for the full v1 → v2 reference.++---+## [1.8.1] — 2026-04-26### Fixeddiff --git a/claude-ops/README.md b/claude-ops/README.mdindex 057627a5..29d24b87 100644--- a/claude-ops/README.md+++ b/claude-ops/README.md@@ -1,8 +1,51 @@# claude-ops-> **v1.7.0** — Smart Daemon · Deep Context Inbox · 30 Skills · 14 Agents · Full Plugin Feature Integration+> **v2.0.0** — Autonomy Layer · Deploy Auto-Fix · Safety Hooks · Specialist Agents · Recap Marquee · Multi-Account Rotator · 33+ Skills · 18 Agents-A Claude Code plugin that turns Claude into a business operating system. Run `/ops` to launch the interactive command center — a pixel-art dashboard with instant hotkey access to morning briefings, inbox management, fire alerts, deploy status, revenue tracking, and autonomous YOLO mode.+A Claude Code plugin that turns Claude into a business operating system **and** an autonomy layer. Run `/ops` for the interactive command center — pixel-art dashboard with instant hotkey access to morning briefings, inbox, fires, deploys, revenue, and YOLO mode. Or just keep working — v2's hooks watch every merge, every build, every commit, every push, and every agent dispatch in the background.++---++## What's new in v2.0++Purely additive — no v1 behaviour changes by default. Full migration guide: [`docs/migrating-from-v1.md`](docs/migrating-from-v1.md). Full changelog: [`CHANGELOG.md`](CHANGELOG.md#200--2026-04-26).++### v2 capability matrix++| Subsystem | Trigger | Outcome | Skill | userConfig | Doc |+|-----------|---------|---------|-------|------------|-----|+| Post-merge deploy auto-fix | `gh pr merge *` | Watches deploy → audits `/health` → verifies `/version` SHA → dispatches Haiku `deploy-fixer` on failure | [`/ops:deploy-fix`](skills/ops-deploy-fix/SKILL.md) | `deploy_fix_enabled` (default `true`) + 14 more | [deploy-fix.md](docs/deploy-fix.md) |+| Build-failure auto-fix | `npm run build:*` | Dispatches Haiku `build-fixer` on failure | (same skill) | `monitor_build_failures` (default `true`) | [deploy-fix.md](docs/deploy-fix.md) |+| Specialized agent auto-suggestion | `Agent` tool with `subagent_type=general-purpose` | Silently swaps to matching specialist via `updatedInput` | (transparent) | `suggest_specialized_agents` (default `true`) | [agents.md](docs/agents.md) |+| Secret-commit guard | `git commit *` | Denies commit when staged diff contains secrets | (always-on) | — | [safety-hooks.md](docs/safety-hooks.md) |+| `rm -rf` anchor block | `rm -rf *` | Denies destructive paths (`/`, `~`, `$HOME`, `..`, `.`) | (always-on) | — | [safety-hooks.md](docs/safety-hooks.md) |+| Direct main-push warning | `git push *` on `main`/`master`/`prod` | `permissionDecision: ask` to confirm | (always-on) | — | [safety-hooks.md](docs/safety-hooks.md) |+| Task* tracking nudge | every Nth non-Task tool call | One-line `additionalContext` reminder | (transparent) | `task_reminder_enabled` (default `true`) | [CHANGELOG](CHANGELOG.md#4-universal-task-tracking-nudge) |+| Recap marquee | every 30s | Multi-session digest in tmux `status-right` / `statusLine` | [`/ops:recap`](skills/ops-recap/SKILL.md) | `recap_marquee_enabled` (default `true`) | [recap.md](docs/recap.md) |+| Multi-account Claude Max rotator | quota approaching cap | launchd daemon swaps `Claude Code-credentials` keychain entry to next account | [`/ops:rotate`](skills/ops-rotate/SKILL.md), [`/ops:rotate-setup`](skills/ops-rotate-setup/SKILL.md) | `account_rotation_enabled` (default `false` — opt-in) | [CHANGELOG](CHANGELOG.md#6-multi-account-claude-max-rotator) |++### v2 quick start — deploy auto-fix in 60 seconds++```bash+/plugin update ops@lifecycle-innovations-limited-claude-ops+/ops:setup # walks through new steps 2d, 3o, 6.5a–6.5d+/ops:deploy-fix configure # map your repos → /health + /version URLs+# done — every future `gh pr merge` is now watched + verified + auto-fixed+/ops:deploy-fix # live status, today's runs, budget remaining+```++Per-repo budget caps (default 3/hour), single-flight locks, content-hash dedup, and a transient classifier (auto-`gh run rerun`s on npm/network blips instead of dispatching an agent) keep spend bounded. Notification channels: `macos`/`ntfy`/`pushover`/`discord`/`telegram`/`none`.++### v2 docs++- [`docs/deploy-fix.md`](docs/deploy-fix.md) — auto-fix architecture, registry, dedup/budget, troubleshooting, FAQ.+- [`docs/agents.md`](docs/agents.md) — pre-installed specialists + how to add your own + how the auto-suggestion hook works.+- [`docs/safety-hooks.md`](docs/safety-hooks.md) — the three safety hooks + per-hook disable.+- [`docs/recap.md`](docs/recap.md) — recap marquee daemon + tmux/`statusLine` setup.+- [`docs/migrating-from-v1.md`](docs/migrating-from-v1.md) — v1 → v2 (no breaking changes).+- [`docs/INDEX.md`](docs/INDEX.md) — full documentation index.++---## Features@@ -38,6 +81,10 @@ A Claude Code plugin that turns Claude into a business operating system. Run `/o| `/ops:daemon` | Start/stop/health for the launchd background daemon || `/ops:doctor` | Plugin config auto-diagnosis and repair || `/ops:uninstall` | Clean removal — unload daemon, wipe cache, deregister marketplace |+| `/ops:deploy-fix` | **v2** — Status/tail/configure/test for the post-merge + build auto-fix subsystem |+| `/ops:recap` | **v2** — Status/tail/configure/restart for the multi-session recap marquee daemon |+| `/ops:rotate` | **v2** — Manually rotate the active Claude Max account |+| `/ops:rotate-setup` | **v2** — Multi-account onboarding for the rotator |### Dashboard hotkeysdiff --git a/claude-ops/docs/INDEX.md b/claude-ops/docs/INDEX.mdnew file mode 100644index 00000000..e043d154--- /dev/null+++ b/claude-ops/docs/INDEX.md@@ -0,0 +1,41 @@+<div align="center">++# Documentation Index++*Top-level map of every doc file in `claude-ops/docs/`.*++[](../CHANGELOG.md)++</div>++---++## v2.0 — autonomy layer++| Doc | Subject |+|-----|---------|+| [`deploy-fix.md`](deploy-fix.md) | Post-merge + build-failure auto-fix subsystem. Architecture, registry, dedup/budget, troubleshooting. |+| [`agents.md`](agents.md) | Pre-installed specialist agents + the auto-suggestion PreToolUse hook. |+| [`safety-hooks.md`](safety-hooks.md) | Three universal PreToolUse:Bash hooks (secret-commit, rm-rf-anchor, mainpush warn). |+| [`recap.md`](recap.md) | Recap marquee daemon — multi-session digest in tmux/`statusLine`. |+| [`migrating-from-v1.md`](migrating-from-v1.md) | v1.x → v2.0 migration. No breaking changes; opt-out matrix. |++## v1 — operations surface (still current in v2)++| Doc | Subject |+|-----|---------|+| [`agents-reference.md`](agents-reference.md) | Catalog of all 18 agents (4 v2 specialists + 14 v1 scanners/fixers/C-suite). |+| [`skills-reference.md`](skills-reference.md) | Catalog of all 33+ skills with usage examples. |+| [`daemon-guide.md`](daemon-guide.md) | The v1 ops-daemon (briefing pre-warm, wacli-sync, memory-extractor, etc). |+| [`docker.md`](docker.md) | Running claude-ops in a container. |+| [`marketplace-submissions.md`](marketplace-submissions.md) | Publishing your own plugin to the same marketplace. |+| [`memories-system.md`](memories-system.md) | The cross-session memory system used by agents. |+| [`notifications.md`](notifications.md) | Notification channel setup (macos/ntfy/pushover/discord/telegram). |+| [`os-compatibility.md`](os-compatibility.md) | macOS / Linux / WSL feature matrix. |++## External++- [Wiki](https://github.com/Lifecycle-Innovations-Limited/claude-ops/wiki) — narrative pages, tutorials, FAQ.+- [`CHANGELOG.md`](../CHANGELOG.md) — release history.+- [`README.md`](../README.md) — plugin overview.+- [`CLAUDE.md`](../CLAUDE.md) — non-negotiable rules for all skills.diff --git a/claude-ops/docs/agents-reference.md b/claude-ops/docs/agents-reference.mdindex 49811de4..66891602 100644--- a/claude-ops/docs/agents-reference.md+++ b/claude-ops/docs/agents-reference.md@@ -4,8 +4,8 @@*All 14 agents that power claude-ops — scanners, fixers, C-suite analysts, and the daemon brain*-[](../CHANGELOG.md)-[](.)+[](../CHANGELOG.md)+[](.)[](.)[](.)[](.)@@ -14,7 +14,10 @@----All 14 agents in claude-ops v1.7.0. Agent files live in `agents/`.+All 18 agents in claude-ops v2.0.0. Agent files live in `agents/`.++> [!NOTE]+> v2.0 added four pre-installed specialists — `general-purpose` (override), `deploy-fixer`, `build-fixer`, `dependency-auditor`. These power the deploy auto-fix subsystem and are silently routed to via the PreToolUse:Agent hook. See [`agents.md`](agents.md) for the v2 specialist catalog and [`deploy-fix.md`](deploy-fix.md) for the auto-fix subsystem.> [!NOTE]> Agents are spawned by skills — they are not invoked directly. Each has a `memory` scope for cross-session learning and a defined `effort` level that controls token budget.diff --git a/claude-ops/docs/agents.md b/claude-ops/docs/agents.mdnew file mode 100644index 00000000..85a1d289--- /dev/null+++ b/claude-ops/docs/agents.md@@ -0,0 +1,128 @@+<div align="center">++# Specialized Agents++*Pre-installed subagent personas + the auto-suggestion hook that routes `general-purpose` calls to the right specialist.*++[](../CHANGELOG.md)+[](.)+[](.)++</div>++---++## What changed in v2++In v1.x, every `Agent` tool call defaulted to `subagent_type: general-purpose`, which meant the same broad persona handled SRE work, dependency upgrades, and code review.++v2 ships **four pre-installed specialist agents** and a **PreToolUse hook on `Agent`** that silently swaps `general-purpose` → matching specialist via `updatedInput`. If no match exists, a Haiku drafter proposes a new agent file under `~/.claude/agents/`.++The swap is silent by design — Claude doesn't have to know to pick the right agent; the hook does it.++---++## Pre-installed specialists++| Agent | File | Purpose | Used by |+|-------|------|---------|---------|+| `general-purpose` | [`agents/general-purpose.md`](../agents/general-purpose.md) | Local override of the default — restricted to research and read-only investigation. | Fallback when no specialist matches. |+| `deploy-fixer` | [`agents/deploy-fixer.md`](../agents/deploy-fixer.md) | Single-shot SRE persona — diagnoses one failed deploy, opens one PR, exits. | Deploy auto-fix subsystem ([`docs/deploy-fix.md`](deploy-fix.md)). |+| `build-fixer` | [`agents/build-fixer.md`](../agents/build-fixer.md) | TypeScript/bundler error fixer for local build failures. | Deploy auto-fix subsystem (build-trigger hook). |+| `dependency-auditor` | [`agents/dependency-auditor.md`](../agents/dependency-auditor.md) | Runs `npm audit` / `pip-audit` / SCA equivalents and proposes minimal upgrades. | Manual dispatch + future scheduled cron. |++The full v1 agent roster (scanners, fixers, C-suite analysts, daemon brain) is unchanged — see [`docs/agents-reference.md`](agents-reference.md).++---++## How the auto-suggestion hook works++```+Claude calls Task with subagent_type=general-purpose+ │+ ▼+hooks/hooks.json PreToolUse:Agent+ │+ ▼+bin/ops-suggest-specialized-agent+ │+ ┌────────────┴────────────┐+ ▼ ▼+ prompt matches no match+ config/specialist- ┌────────────────────┐+ keywords.example.json │ fire Haiku drafter │+ │ │ → propose new │+ ▼ │ agent file under │+ rewrite updatedInput │ ~/.claude/agents/ │+ with subagent_type = └────────────────────┘+ matched specialist+ │+ ▼+ Claude tool call proceeds with the swapped type+```++The swap uses the standard Claude Code `updatedInput` PreToolUse mechanism — no warning, no prompt, no UI noise. The user only notices when they look at the agent transcript and see `deploy-fixer` instead of `general-purpose`.++---++## Keyword map++The default map ships at [`config/specialist-keywords.example.json`](../config/specialist-keywords.example.json):++```json+{+ "deploy-fixer": ["deploy", "deployment", "ECS", "Vercel", "Render", "GitHub Actions", "workflow failed", "rollback"],+ "build-fixer": ["npm run build", "tsc", "TypeScript error", "webpack", "vite", "esbuild", "module not found"],+ "dependency-auditor": ["npm audit", "vulnerable", "CVE", "security advisory", "outdated dependency", "pip-audit"]+}+```++Each value is an array of substrings (case-insensitive). The hook scans the `prompt` field of the `Agent` input. First match wins.++To extend: copy the file to `~/.claude/config/specialist-keywords.json` and add your own. User file overrides the plugin default.++---++## Adding your own specialist++1. Drop a `<name>.md` file under `~/.claude/agents/` (user-scoped) or `agents/` (committed to your project's `.claude/`).+2. Frontmatter must include `name`, `description`, `model`, `tools` (allow-list).+3. Add an entry to your `~/.claude/config/specialist-keywords.json` mapping keywords → agent name.+4. Verify with `/ops:deploy-fix test` (which exercises the keyword path) or by manually invoking `Task` with a matching prompt.++Minimal example:++```markdown+---+name: my-rust-fixer+description: Diagnoses and fixes Rust compile errors+model: claude-haiku-4-5+tools: [Bash, Read, Edit, Write]+---++You are a focused Rust compile-error fixer. ...+```++```json+{+ "my-rust-fixer": ["cargo build", "cargo check", "rustc error", "borrow checker"]+}+```++---++## Configuration++| Key | Type | Default | Purpose |+|-----|------|---------|---------|+| `suggest_specialized_agents` | boolean | `true` | Master switch for the PreToolUse:Agent hook. |++Set to `false` in `/plugins` settings to restore v1 behavior (every `general-purpose` call passes through unchanged).++---++## See also++- [`docs/agents-reference.md`](agents-reference.md) — complete v1+v2 agent catalog.+- [`docs/deploy-fix.md`](deploy-fix.md) — primary consumer of `deploy-fixer` and `build-fixer`.+- [`docs/INDEX.md`](INDEX.md) — full documentation index.diff --git a/claude-ops/docs/daemon-guide.md b/claude-ops/docs/daemon-guide.mdindex c5850058..8395073c 100644--- a/claude-ops/docs/daemon-guide.md+++ b/claude-ops/docs/daemon-guide.md@@ -4,7 +4,10 @@*The unified background process manager that pre-warms briefings, syncs WhatsApp, extracts memories, and watches your fires — persistently, via launchd*-[](../CHANGELOG.md)+[](../CHANGELOG.md)++> [!NOTE]+> v2.0 introduces two **additional** daemons alongside the v1 ops-daemon documented here: the **recap-daemon** ([`recap.md`](recap.md)) and the **account-rotation daemon** ([`CHANGELOG.md`](../CHANGELOG.md#6-multi-account-claude-max-rotator)). The ops-daemon described below is unchanged in v2.[](.)[](.)[](.)diff --git a/claude-ops/docs/deploy-fix.md b/claude-ops/docs/deploy-fix.mdnew file mode 100644index 00000000..f121dcee--- /dev/null+++ b/claude-ops/docs/deploy-fix.md@@ -0,0 +1,264 @@+<div align="center">++# Deploy Auto-Fix Subsystem++*Watches every `gh pr merge` and `npm run build:*` you run, verifies the deploy, and dispatches a Haiku fixer if anything fails.*++[](../CHANGELOG.md)+[](.)+[](.)++</div>++---++## TL;DR++```+gh pr merge --squash --admin+ │+ ▼ PostToolUse:Bash hook+bin/ops-deploy-fix-merge-trigger+ │+ ▼ background fork+scripts/ops-deploy-monitor.sh+ │+ ├──► poll deploy GitHub Actions run+ ├──► curl /health on success+ ├──► curl /version, compare SHA+ └──► on failure:+ ├── transient? ──► gh run rerun+ └── real? ──► dispatch headless Haiku deploy-fixer+ (uses prompts/deploy-fix.md)+```++The same pattern fires for `npm run build:*` via `bin/ops-deploy-fix-build-trigger`, dispatching a `build-fixer` agent with `prompts/build-fix.md`.++---++## Architecture++```+┌────────────────────────────────────────────────────────────────────────┐+│ Claude Code session │+│ ┌──────────────────────────────────────────────────────────────────┐ │+│ │ Bash tool: gh pr merge --squash 123 │ │+│ └──────────────────────────────┬───────────────────────────────────┘ │+└─────────────────────────────────┼──────────────────────────────────────┘+ │ PostToolUse:Bash if Bash(gh pr merge *)+ ▼+ ┌─────────────────────────────────────────┐+ │ bin/ops-deploy-fix-merge-trigger │+ │ - parse repo, pr, base, sha │+ │ - check userConfig toggles │+ │ - check budget (max_fixes_per_hour) │+ │ - acquire single-flight lock per repo │+ │ - fork scripts/ops-deploy-monitor.sh │+ └────────────────┬────────────────────────┘+ │ background+ ▼+ ┌─────────────────────────────────────────┐+ │ scripts/ops-deploy-monitor.sh │+ │ ┌───────────────────────────────────┐ │+ │ │ poll gh run list (deploy regex) │ │+ │ │ timeout: watcher_timeout_seconds│ │+ │ └─────────────┬─────────────────────┘ │+ │ │ │+ │ ┌─────────┴─────────┐ │+ │ ▼ ▼ │+ │ success failure │+ │ │ │ │+ │ ▼ ▼ │+ │ curl /health transient? │+ │ │ ┌────┴────┐ │+ │ ▼ ▼ ▼ │+ │ curl /version gh run dispatch │+ │ cmp SHA rerun headless │+ │ │ claude │+ │ └─► notify ◄─────────┘ │+ └────────────────┬────────────────────────┘+ │+ ▼+ ┌─────────────────────────────────────────┐+ │ scripts/ops-notify.sh │+ │ routes to: macos | ntfy | pushover | │+ │ discord | telegram | none │+ └─────────────────────────────────────────┘+```++The build-failure path is the same minus the deploy poll — it goes straight to `dispatch headless claude` with the failing build output as context.++---++## Components++| Path | Role |+|------|------|+| `hooks/hooks.json` | Wires both PostToolUse:Bash triggers + the `npm run build:*` `if` matcher. |+| `bin/ops-deploy-fix-merge-trigger` | Hook handler for merges. Parses, gates, forks the monitor. |+| `bin/ops-deploy-fix-build-trigger` | Hook handler for failing local builds. Same pattern, no deploy poll. |+| `scripts/ops-deploy-monitor.sh` | Long-lived background watcher per merge. |+| `scripts/lib/deploy-fix-common.sh` | Shared helpers — lock, budget, dedup, transient classifier, notify. |+| `prompts/deploy-fix.md` | Headless `deploy-fixer` agent prompt template. |+| `prompts/build-fix.md` | Headless `build-fixer` agent prompt template. |+| `agents/deploy-fixer.md` | Pre-installed specialist agent. |+| `agents/build-fixer.md` | Pre-installed specialist agent. |+| `config/post-merge-services.example.json` | Plugin-default service registry. |+| `skills/ops-deploy-fix/SKILL.md` | `/ops:deploy-fix` user-facing skill. |+| `tests/test-deploy-fix-hooks.sh` | 39 assertions / 11 cases. |++---++## Service registry++The monitor needs to know *which* service the merged PR deploys to so it can hit the right `/health` and `/version` endpoints. The registry is layered:++```+project .claude/post-merge-services.json+ ▲ overrides+user ~/.claude/config/post-merge-services.json+ ▲ overrides+plugin config/post-merge-services.example.json (defaults / examples)+```++Schema:++```json+{+ "your-org/your-api:dev": {+ "health_url": "https://api-dev.example.com/health",+ "version_url": "https://api-dev.example.com/version",+ "deploy_workflow": "deploy-staging.yml",+ "served_sha_jq": ".commit.sha"+ },+ "your-org/your-api:main": {+ "health_url": "https://api.example.com/health",+ "version_url": "https://api.example.com/version",+ "deploy_workflow": "deploy-production.yml"+ }+}+```++`served_sha_jq` is optional; defaults to `.sha // .commit // .version`.++If a merge has no registry entry, the monitor falls back to **deploy-only verification** (poll the workflow, no health/version curl) and notifies on workflow failure.++---++## Dedup, budget, single-flight++Three independent guards prevent runaway agent spawning:++1. **Single-flight lock per repo** — `scripts/lib/deploy-fix-common.sh` acquires a `flock`-style lock on `${OPS_DATA_DIR}/locks/<owner>__<repo>.lock`. Concurrent merges on the same repo queue; no two deploy-fixers run for the same repo at once.+2. **Hourly budget cap** — `max_fixes_per_hour` (default 3, range 0..20). The shared lib increments a per-repo per-hour counter at `${OPS_DATA_DIR}/budgets/<owner>__<repo>__<YYYYMMDDHH>`. When the cap is hit, the failure is logged + notified but the fixer is **not** dispatched.+3. **Content-hash dedup** — the failing log tail (last 4 KB) is sha256'd. If the same hash dispatched a fixer in the last hour for the same repo, the new failure is treated as a duplicate and skipped (the previous fixer is presumed to be either still running or recently shipped a PR).++---++## Transient classification++`auto_rerun_transients` (default `true`) routes failures matching any of these patterns to `gh run rerun --failed` instead of dispatching a fixer:++- `npm ERR! 5\d\d` (npm registry 5xx)+- `EAI_AGAIN` / `getaddrinfo` (DNS blip)+- `Error: read ECONNRESET` / `socket hang up`+- `429 Too Many Requests`+- `The runner has received a shutdown signal`+- `Process completed with exit code 137` (OOM-kill)++The classifier is intentionally narrow — when in doubt, dispatch a real fixer.++---++## Notification channels++`notify_channel` userConfig (default `macos`):++| Value | Mechanism |+|-------|-----------|+| `macos` | `osascript -e 'display notification ...'` |+| `ntfy` | `curl -d "msg" ntfy.sh/<topic>` (set `ntfy_topic`) |+| `pushover` | Pushover API (set `pushover_user_key` + `pushover_app_token`) |+| `discord` | Discord webhook (set `discord_default_webhook_url`) |+| `telegram` | Telegram MCP send (uses `telegram_notify_chat_id`) |+| `none` | Silent — log only |++All channels prefix the message with the repo + PR + run URL so you can jump straight to the failed run.++---++## `/ops:deploy-fix` skill++| Subcommand | Purpose |+|------------|---------|+| `/ops:deploy-fix` | Live status — running monitors, today's history, budget remaining per repo. |+| `/ops:deploy-fix tail <run-id>` | Stream the monitor log for a specific run. |+| `/ops:deploy-fix configure` | Open the layered service registry in `$EDITOR`. |+| `/ops:deploy-fix test` | Dry-run the merge-trigger hook against a synthetic merge — verifies registry, lock, budget logic without dispatching. |++---++## Configuration reference++All settings live under `userConfig` in `plugin.json` and are spacebar-toggleable in `/plugins` settings.++| Key | Type | Default | Purpose |+|-----|------|---------|---------|+| `deploy_fix_enabled` | boolean | `true` | Master switch. |+| `monitor_post_merge` | boolean | `true` | Watch `gh pr merge`. |+| `monitor_build_failures` | boolean | `true` | Watch `npm run build:*`. |+| `auto_dispatch_fixer` | boolean | `true` | Off = log + notify only. |+| `allow_dangerous` | boolean | `false` | Pass `--dangerously-skip-permissions` to fixer. |+| `auto_rerun_transients` | boolean | `true` | Auto-`gh run rerun` on classified blips. |+| `audit_health_after_deploy` | boolean | `true` | `curl /health` after success. |+| `verify_served_commit` | boolean | `true` | `curl /version` and compare SHA. |+| `fix_model` | string | `haiku` | `haiku` / `sonnet` / `opus`. |+| `max_fixes_per_hour` | number | `3` | Per-repo cap (0..20). |+| `watcher_timeout_seconds` | number | `1800` | Max wait for deploy completion (60..7200). |+| `registry_path` | file | `~/.claude/config/post-merge-services.json` | User registry. |+| `repo_search_roots` | string | `~/Projects:~` | Where to find the repo on disk. |+| `deploy_workflow_pattern` | string | `deploy\|Deploy\|build\|Build\|ECS\|cd\|CD` | Regex picking the deploy run. |+| `notify_channel` | string | `macos` | `macos`/`ntfy`/`pushover`/`discord`/`telegram`/`none`. |++---++## Troubleshooting++**No fixer dispatched after a failed merge.** Check in order:+1. `/ops:deploy-fix` — is the master switch on? Budget exhausted?+2. `tail -f $OPS_DATA_DIR/logs/deploy-monitor-*.log` — did the monitor start?+3. `gh run list --repo <owner/repo> --limit 5` — did GH Actions actually emit a run matching `deploy_workflow_pattern`?+4. Registry — does `<owner/repo>:<base>` exist? Without an entry, the monitor will only poll the workflow, not health/version.++**Fixer keeps re-firing on the same failure.** Content-hash dedup looks at the last 4 KB of log. If your build always emits a unique trailer (timestamp, run-id), dedup misses. Either:+- Add a `dedup_strip_pattern` to your registry entry (TODO — pending in v2.1), or+- Lower `max_fixes_per_hour` to `1`.++**Health check fails immediately after success.** Most services need a few seconds to roll over after a green deploy. The monitor sleeps 15s before the first `/health` call. Tune via `HEALTH_GRACE_SECONDS` env var if needed.++**`--dangerously-skip-permissions` makes me nervous.** Leave `allow_dangerous: false` (the default). The fixer will pause on permission prompts, which means unattended runs may stall. The trade-off is yours.++---++## FAQ++**Q: Will this dispatch fixers for PRs I merge from the GitHub web UI?**+No. The hook only fires on `gh pr merge` from inside a Claude Code session. CI-merged or web-merged PRs are invisible to it. (This is intentional — the hook scope is your local Claude Code workflow.)++**Q: Does it work for non-Node deploys?**+The merge trigger is language-agnostic — it only inspects `gh pr merge` arguments. The build trigger currently matches `npm run build:*`; PRs welcome to add `pnpm`, `yarn`, `cargo build`, `go build`, `mvn package` matchers.++**Q: Does it touch my git history?**+No. The fixer creates a new branch (`fix/auto-deploy-<sha>`) and opens a PR. Your main/dev branch is never directly modified.++**Q: How much does a typical fixer run cost?**+~5-15k Haiku tokens for a clean diagnosis + 1-file fix. ~$0.005-$0.015 per dispatch. With `max_fixes_per_hour: 3` your worst-case spend is ~$1.20/day per repo.++---++## See also++- [`docs/agents.md`](agents.md) — pre-installed specialist agents (deploy-fixer + build-fixer live here).+- [`docs/safety-hooks.md`](safety-hooks.md) — universal PreToolUse safety hooks (independent of deploy-fix).+- [`docs/recap.md`](recap.md) — recap marquee shows live deploy-fix activity across sessions.+- [`docs/INDEX.md`](INDEX.md) — full documentation index.diff --git a/claude-ops/docs/marketplace-submissions.md b/claude-ops/docs/marketplace-submissions.mdindex 1132cbaa..f0f745c1 100644--- a/claude-ops/docs/marketplace-submissions.md+++ b/claude-ops/docs/marketplace-submissions.md@@ -4,7 +4,7 @@*Tracking where claude-ops is listed (or pending listing) across the Claude plugin ecosystem*-[](../CHANGELOG.md)+[](../CHANGELOG.md)[](.)[](.)diff --git a/claude-ops/docs/memories-system.md b/claude-ops/docs/memories-system.mdindex bb97bcba..1edb815d 100644--- a/claude-ops/docs/memories-system.md+++ b/claude-ops/docs/memories-system.md@@ -4,7 +4,7 @@*Persistent local context about people, projects, and your communication patterns — extracted from your chats, stored as markdown, never sent anywhere*-[](../CHANGELOG.md)+[](../CHANGELOG.md)[](.)[](.)[](.)diff --git a/claude-ops/docs/migrating-from-v1.md b/claude-ops/docs/migrating-from-v1.mdnew file mode 100644index 00000000..6beca120--- /dev/null+++ b/claude-ops/docs/migrating-from-v1.md@@ -0,0 +1,119 @@+<div align="center">++# Migrating from v1.x → v2.0++*claude-ops 2.0 is purely additive. No v1 behavior changes by default. This page exists so you know exactly what's new and how to opt out of anything you don't want.*++[](../CHANGELOG.md)+[](.)++</div>++---++## TL;DR++```bash+# inside Claude Code:+/plugin update ops@lifecycle-innovations-limited-claude-ops+/ops:setup # walks through the 6 new wizard steps; safe to skip any+```++That's it. Existing settings, registries, preferences, and daemon services are unchanged.++---++## What's actually new++| Area | v1.8.1 | v2.0.0 |+|------|--------|--------|+| Skills | 30 | 33+ (added `/ops:deploy-fix`, `/ops:recap`, `/ops:rotate`, `/ops:rotate-setup`) |+| Agents | 14 | 18 (added `general-purpose` override, `deploy-fixer`, `build-fixer`, `dependency-auditor`) |+| PostToolUse:Bash hooks | 0 | 3 (deploy-fix-merge, deploy-fix-build, task-reminder) |+| PreToolUse:Bash hooks | 1 (wacli-health) | 4 (+ secret-commit, no-rm-rf-anchor, warn-mainpush) |+| PreToolUse:Agent hooks | 0 | 1 (specialized-agent suggestion) |+| Daemons | 1 (ops-daemon, 7 services) | 3 (+ recap-daemon, account-rotation-daemon) |+| `userConfig` toggles | ~25 string entries | 44 (19+ new booleans/numbers/file pickers) |+| Wizard steps | 11 | 17 (+2d, 3o, 6.5a, 6.5b, 6.5c, 6.5d) |+| Test files | 9 | 11 (+ test-deploy-fix-hooks, test-safety-hooks) |++---++## Defaults: what fires automatically++When you upgrade and run `/ops:setup`, these v2 features activate by default:++- **Deploy auto-fix** (`deploy_fix_enabled: true`) — but only fires when you actually run `gh pr merge` or `npm run build:*` from inside a Claude Code session.+- **Specialized agent suggestion** (`suggest_specialized_agents: true`) — silent; you'll only notice via the agent transcripts.+- **Three safety hooks** — always on by design (see [`safety-hooks.md`](safety-hooks.md)).+- **Task* tracking nudge** (`task_reminder_enabled: true`) — adds a one-line reminder to `additionalContext` after 10 non-Task tool calls.+- **Recap marquee** (`recap_marquee_enabled: true`) — daemon installs and runs; harmless if you don't have tmux.++These features are **opt-out** by default:++- **Multi-account rotator** (`account_rotation_enabled: false`) — you must explicitly enable + run `/ops:rotate-setup`.++---++## Restoring v1 behaviour++Edit `/plugins` settings and toggle off:++| To restore v1 | Set |+|---------------|-----|+| Default agent always = raw `general-purpose` | `suggest_specialized_agents: false` |+| No post-merge watcher | `deploy_fix_enabled: false` |+| No build-failure fixer | `monitor_build_failures: false` |+| No task-tracking nudges | `task_reminder_enabled: false` |+| No recap marquee | `recap_marquee_enabled: false` + `launchctl unload ~/Library/LaunchAgents/com.claude-ops.recap-daemon.plist` |++To disable the three safety hooks (not recommended), comment out their entries in [`hooks/hooks.json`](../hooks/hooks.json) under `PreToolUse > Bash`.++---++## File / path migrations++None. v1 file locations, registry shapes, and preferences keys are unchanged.++New paths v2 introduces (all under `$OPS_DATA_DIR`, default `~/.claude/plugins/data/ops-ops-marketplace`):++```+$OPS_DATA_DIR/+├── locks/ # deploy-fix single-flight per repo+├── budgets/ # deploy-fix per-repo per-hour counter+├── logs/deploy-monitor-*.log # one log per active monitor+├── recap/+│ ├── sessions/<sid>.jsonl # per-session capture+│ └── digest # current digest (read by marquee)+└── account-rotation/+ └── usage-cache.json # per-account quota cache+```++And:++```+~/.claude/config/post-merge-services.json # user-scope deploy-fix registry+~/.claude/config/specialist-keywords.json # user-scope keyword map+~/.claude/agents/<name>.md # user-scope specialist agents+```++---++## Rolling back to v1.8.1++```bash+/plugin uninstall ops@lifecycle-innovations-limited-claude-ops+/plugin marketplace update Lifecycle-Innovations-Limited/claude-ops+# in Claude Code, install at the v1.8.1 tag:+/plugin install ops@[email protected]+```++Your `$OPS_DATA_DIR` survives uninstall. v2-specific subdirs (`locks/`, `budgets/`, `recap/`, `account-rotation/`) are ignored by v1 code; you can delete them or leave them.++---++## See also++- [`docs/INDEX.md`](INDEX.md) — full documentation index.+- [`CHANGELOG.md`](../CHANGELOG.md) — full v2.0.0 entry with PR references and file paths.+- Wiki: [`Migrating-from-v1`](https://github.com/Lifecycle-Innovations-Limited/claude-ops/wiki/Migrating-from-v1).diff --git a/claude-ops/docs/recap.md b/claude-ops/docs/recap.mdnew file mode 100644index 00000000..6dee6936--- /dev/null+++ b/claude-ops/docs/recap.md@@ -0,0 +1,184 @@+<div align="center">++# Recap Marquee Daemon++*One-line situational awareness across every parallel Claude Code session, surfaced in tmux `status-right` or the Claude Code `statusLine`.*++[](../CHANGELOG.md)+[](.)+[](.)++</div>++---++## What it does++If you run several Claude Code sessions across worktrees, you lose track of which session is doing what. The recap marquee gives you a single line — refreshed every 30 seconds — summarising every active session's latest action.++```+┌ tmux status-right ───────────────────────────────────────────────────────┐+│ [3 sessions] api: editing UserService.ts • web: gh pr merge • db: idle 2m│+└──────────────────────────────────────────────────────────────────────────┘+```++When something *fires* (a deploy-fix dispatched, a safety hook denied, a `/ops:fires` alert) it's flagged with `🔥` and bumped to the front of the line.++---++## Architecture++```+┌─ Claude Code session A (worktree-a) ─┐+│ hooks/recap-tool-activity.sh │──┐+│ hooks/recap-capture.sh │ │+└──────────────────────────────────────┘ │+┌─ Claude Code session B (worktree-b) ─┐ │ writes to+│ hooks/recap-tool-activity.sh │──┼──► $OPS_DATA_DIR/recap/sessions/<sid>.jsonl+│ hooks/recap-capture.sh │ │+└──────────────────────────────────────┘ │+┌─ Claude Code session C (worktree-c) ─┐ │+│ ... │──┘+└──────────────────────────────────────┘+ ▲ tail -f+ │+ ┌─────────────┴─────────────┐+ │ scripts/recap/daemon.sh │+ │ every 30s: │+ │ 1. read all session │+ │ jsonl tails │+ │ 2. classify & rank │+ │ 3. write digest │+ └─────────────┬─────────────┘+ │+ ▼+ ┌──────────────────────────────┐+ │ scripts/recap/digest.sh │+ │ → $OPS_DATA_DIR/recap/digest │+ └─────────────┬────────────────┘+ │+ ▼+ ┌──────────────────────────────┐+ │ scripts/recap/marquee.sh │+ │ formats one-line ANSI │+ │ read by tmux status-right │+ │ or Claude Code statusLine │+ └──────────────────────────────┘+```++---++## Components++| Path | Role |+|------|------|+| `scripts/recap/daemon.sh` | Long-lived loop. Reads session jsonl tails, builds digest. |+| `scripts/recap/digest.sh` | Synthesises the digest (active session count, latest action, fire flags). |+| `scripts/recap/marquee.sh` | Formats one-line ANSI output for tmux/`statusLine`. |+| `hooks/recap-capture.sh` | PostToolUse hook — captures Edit/Write/Bash payloads to per-session jsonl. |+| `hooks/recap-tool-activity.sh` | PostToolUse `*` hook — heartbeat + tool-name log. |+| `templates/com.claude-ops.recap-daemon.plist` | macOS launchd unit. |+| `skills/ops-recap/SKILL.md` | `/ops:recap` user-facing skill. |++---++## Setup++### Automatic (recommended)++```+/ops:setup+```++Step 2d of the wizard:++1. Installs the launchd plist (`~/Library/LaunchAgents/com.claude-ops.recap-daemon.plist`) and `launchctl load`s it.+2. If `tmux` is detected, appends to `~/.tmux.conf`:+ ```+ set -g status-right '#(bash ~/.claude/plugins/installed/ops-ops-marketplace/scripts/recap/marquee.sh) | %H:%M'+ set -g status-interval 5+ ```+3. If no tmux, wires the marquee into the Claude Code `statusLine` in `~/.claude/settings.json`.+4. Verifies the daemon is running and the digest file is fresh.++### Manual (Linux / systemd)++There's no upstream systemd unit shipped (yet — PRs welcome). Use this template:++```ini+# ~/.config/systemd/user/claude-ops-recap.service+[Unit]+Description=claude-ops recap marquee daemon++[Service]+ExecStart=%h/.claude/plugins/installed/ops-ops-marketplace/scripts/recap/daemon.sh+Restart=always+RestartSec=5++[Install]+WantedBy=default.target+```++```bash+systemctl --user daemon-reload+systemctl --user enable --now claude-ops-recap.service+```++For tmux integration, the same `set -g status-right …` line works on Linux.++---++## `/ops:recap` skill++| Subcommand | Purpose |+|------------|---------|+| `/ops:recap` | Show today's digest as a multi-line summary (richer than the marquee). |+| `/ops:recap status` | Daemon health, last digest age, active session count. |+| `/ops:recap tail` | Tail the daemon log. |+| `/ops:recap configure` | Open `~/.tmux.conf` / `settings.json` for manual tweaks. |+| `/ops:recap restart` | `launchctl unload && load` (or `systemctl restart`). |++---++## Configuration++| Key | Type | Default | Purpose |+|-----|------|---------|---------|+| `recap_marquee_enabled` | boolean | `true` | Master switch. |+| `recap_marquee_auto_configure_tmux` | boolean | `true` | Append marquee source to `~/.tmux.conf` during setup. |++Disable via `/plugins` settings; then `launchctl unload ~/Library/LaunchAgents/com.claude-ops.recap-daemon.plist` to stop the daemon.++---++## Customisation++The marquee format is controlled by `scripts/recap/marquee.sh`. Override per-user by symlinking your own at `~/.claude/config/recap-marquee.sh`; the daemon prefers user override over plugin default.++Variables available to the marquee script (read from `$OPS_DATA_DIR/recap/digest`):++- `SESSION_COUNT` — active session count.+- `SESSIONS` — newline-delimited `<short-id> <last-action> <idle-secs>`.+- `FIRES` — newline-delimited fire entries (deploy-fix denials, safety-hook blocks, `/ops:fires` alerts).+- `LAST_UPDATED` — Unix timestamp of last digest write.++---++## Troubleshooting++**Marquee shows stale data.** Check the daemon: `/ops:recap status`. If it's not running, `/ops:recap restart`.++**tmux status-right not updating.** Verify `status-interval` is `5` or lower in `~/.tmux.conf`. tmux reloads `status-right` only on this interval.++**Sessions not appearing.** The capture hooks need the plugin's `hooks/hooks.json` to be active in that session. If you spawned the session before installing the plugin, restart it.++**Performance impact.** Each capture write is <1 ms (append-only jsonl). The daemon's 30s loop reads ~10-100 KB total per cycle. Negligible CPU.++---++## See also++- [`docs/deploy-fix.md`](deploy-fix.md) — recap surfaces deploy-fix activity as fires.+- [`docs/safety-hooks.md`](safety-hooks.md) — safety-hook denials surface as fires.+- [`docs/daemon-guide.md`](daemon-guide.md) — the v1 ops-daemon (separate process from recap-daemon).+- [`docs/INDEX.md`](INDEX.md) — full documentation index.diff --git a/claude-ops/docs/safety-hooks.md b/claude-ops/docs/safety-hooks.mdnew file mode 100644index 00000000..ea5f9b3f--- /dev/null+++ b/claude-ops/docs/safety-hooks.md@@ -0,0 +1,117 @@+<div align="center">++# Universal Safety Hooks++*Three PreToolUse:Bash hooks that block the most common foot-guns: secrets in commits, `rm -rf` against anchor paths, and direct `git push` to `main`.*++[](../CHANGELOG.md)+[](.)+[](.)++</div>++---++## Why these are not gated by userConfig++The other v2 subsystems (deploy-fix, recap, rotator, task-reminder) are toggleable from `/plugins` settings because they're additive convenience layers. The three safety hooks are different — they prevent **irrecoverable damage** (committed secrets, deleted home directories, broken main branches). They're always-on by design, with a per-incident escape via Claude Code's standard `permissionDecision` flow.++If you genuinely need to disable one, comment out the entry in `hooks/hooks.json`. There is no shame in this — but make it a deliberate choice, not a forgotten toggle.++---++## The three hooks++### 1. `bin/ops-prevent-secret-commit`++**Trigger:** PreToolUse:Bash matching `git commit *`.++**Action:** Scans `git diff --cached` for known secret patterns. On match, returns `permissionDecision: deny` with an explanation listing the matched pattern + offending file.++**Patterns detected:**++| Pattern | Match |+|---------|-------|+| AWS access key | `AKIA[0-9A-Z]{16}` |+| AWS secret key | `aws_secret_access_key\s*=\s*["']?[A-Za-z0-9/+=]{40}` |+| GitHub PAT | `ghp_[A-Za-z0-9]{36}` / `github_pat_[A-Za-z0-9_]{82}` |+| Slack token | `xox[baprs]-[A-Za-z0-9-]{10,}` |+| OpenAI API key | `sk-(proj-)?[A-Za-z0-9]{20,}` |+| Anthropic API key | `sk-ant-[A-Za-z0-9_-]{20,}` |+| Stripe live key | `sk_live_[A-Za-z0-9]{24,}` |+| `.env` content | any staged `.env*` file (excluding `.env.example`, `.env.template`) |+| Generic high-entropy string | any 32+ char base64-ish run with `KEY` / `TOKEN` / `SECRET` in the variable name |++**Override:** un-stage the offending file (`git restore --staged <path>`), or scrub the value. There's no env-var override; this is intentional.++---++### 2. `bin/ops-no-rm-rf-anchor`++**Trigger:** PreToolUse:Bash matching `rm -rf *` (and equivalents: `rm -fr`, `rm -rfv`, etc.).++**Action:** Resolves each target via `realpath`/`readlink -f` (so symlinks don't sneak past). On any of these resolved targets, returns `permissionDecision: deny`:++- `/`+- `$HOME` / `~` (and any path that resolves *to* `$HOME`)+- `..` and `.` (when CWD itself is `$HOME` or `/`)+- Mount points listed in `/etc/fstab` (root-level only)++**Override:** there is none for the listed anchors. If you genuinely need to wipe `~`, do it outside Claude Code.++---++### 3. `bin/ops-warn-mainpush`++**Trigger:** PreToolUse:Bash matching `git push *`.++**Action:** Reads the current branch via `git rev-parse --abbrev-ref HEAD`. If the branch is in the protected list (`main`, `master`, `prod`, `production`, `release`), returns `permissionDecision: ask` (not deny — ask) with the message:++```+About to push directly to <branch>. This bypasses the PR review flow.+Confirm by accepting the prompt; abort by rejecting.+```++**Override:** accept the standard Claude Code permission prompt. No env-var or config override.++This hook intentionally uses `ask` not `deny` because force-push to main is sometimes legitimate (recovering from a broken merge, hotfix, etc.) — but it should never be silent.++---++## How `permissionDecision` works++Claude Code's standard PreToolUse mechanism supports three decisions:++- `allow` — pass through silently.+- `ask` — prompt the user; user accepts → pass through.+- `deny` — block the call, return the explanation to Claude.++The three safety hooks use this mechanism. They never modify the command or rewrite arguments; they only inspect and decide.++---++## Disabling a single hook++Edit [`hooks/hooks.json`](../hooks/hooks.json) and remove the relevant entry under `PreToolUse > Bash`. Reload the plugin (`/plugin reload ops`) for the change to take effect.++To re-enable, copy the entry back from the v2 release notes or the [GitHub source](https://github.com/Lifecycle-Innovations-Limited/claude-ops/blob/main/claude-ops/hooks/hooks.json).++---++## Testing++[`tests/test-safety-hooks.sh`](../tests/test-safety-hooks.sh) covers every hook with positive (should-deny / should-ask) and negative (should-allow) cases. 45/45 pass on macOS + Linux.++Run locally:++```bash+bash claude-ops/tests/test-safety-hooks.sh+```++---++## See also++- [`docs/deploy-fix.md`](deploy-fix.md) — auto-fix subsystem (independent of safety hooks).+- [`docs/agents.md`](agents.md) — specialized agent system.+- [`docs/INDEX.md`](INDEX.md) — full documentation index.diff --git a/claude-ops/docs/skills-reference.md b/claude-ops/docs/skills-reference.mdindex 9a2c0e31..7358f8c3 100644--- a/claude-ops/docs/skills-reference.md+++ b/claude-ops/docs/skills-reference.md@@ -2,10 +2,10 @@# Skills Reference-*All 30 skills available in claude-ops — your business operations command surface*+*All 33+ skills available in claude-ops — your business operations command surface (v2.0 added `/ops:deploy-fix`, `/ops:recap`, `/ops:rotate`, `/ops:rotate-setup`)*-[](../CHANGELOG.md)-[](.)+[](../CHANGELOG.md)+[](.)[](../LICENSE)[](.)