Skip to content

Commit 604c2e8

Browse files
committed
feat(skills): add agent workflow controls
1 parent 4bf3a9c commit 604c2e8

14 files changed

Lines changed: 4243 additions & 11 deletions

File tree

AGENTS.MD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ Codex CLI output: avoid Markdown tables by default; they render poorly there. Us
7171
## Runtime Safety
7272

7373
- zsh: don't use `status` as a variable.
74+
- Recovery may gracefully stop or terminate only a verified task-owned process after recording its PID, command, parent, start time, and task evidence. Never kill an unknown, shared, or user-owned application process as incidental recovery.
75+
- Never move, delete, rewrite, or reset another application's caches, databases, configuration, profiles, sessions, keychains, or credential state without Bram's explicit approval for those exact targets. Use read-only diagnosis and task-local retries first; if those fail, preserve evidence and stop for direction.
7476
- Passwords/secrets: check `~/.profile` first. `op`/1Password CLI is last resort, must always run inside `tmux`, never directly.
7577
- NEVER run `op` directly in a normal shell. No exceptions. This includes harmless-looking diagnostics: no direct `op --version`, `op account list`, `op whoami`, `op vault list`, `op item list`, `op read`, or `op item get`.
7678
- `tmux` is necessary for `op`, but not sufficient: do not spam 1Password. No parallel `op`; no repeated probe sessions; no broad vault/item enumeration; no trial-and-error secret discovery.

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ summary: Timeline of guardrail helper changes mirrored from Sweetistics and rela
44

55
# Changelog
66

7+
## 2026-08-12 — Agent Performance Audit
8+
- Added a reusable personal skill and deterministic CLI for repository-scoped Codex-history audits with separate Claude activity coverage, injected-prompt exclusion, correction and shell-tool-output denominators, cumulative-delta per-turn token accounting, baseline comparisons, redacted causal notes, privacy validation, and self-contained local HTML reports.
9+
10+
## 2026-08-12 — External-State Recovery Boundary
11+
- Added a global recovery rule plus PatchProof, 1Password, and maintainer-loop guidance: terminate only verified task-owned processes, preserve diagnostics, never mutate another application's caches/databases/configuration/credential state without exact approval, and stop after documented task-local recovery fails.
12+
13+
## 2026-08-12 — Maintainer Loop Structured Monitoring
14+
- Replaced repeated worker transcript polling with batched cursor-based waits, a compact current-state ledger, explicit 5/15/30/60-minute backoff, targeted raw-history recovery, and counters for verifying heartbeat and automation overhead reductions.
15+
716
## 2026-07-22 — Autoreview From Canonical Source
817
- Replaced the vendored `autoreview` skill with the canonical `openclaw/agent-skills` copy at `c4ab5e7` (helper 2,485 -> 12,001 lines), including its scripts, test suite, fixtures, and the skill-level `AGENTS.md` sync rule.
918
- Gains TruffleHog secret scanning over the reviewed diff, a Scope Governor that classifies findings as in-scope blocker / follow-up / stop-and-escalate, oversized-bundle handling, release-branch rules, and Codex `gpt-5.6-sol` with an access-only fallback to `gpt-5.6-terra`.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
name: agent-performance-audit
3+
description: "Audit local Codex agent histories for a repository, record separate Claude activity coverage, compare correction and efficiency trends, and generate privacy-minimized JSON plus self-contained HTML. Use for Theo-style agent audits, monthly agent-performance checks, or post-issue-batch workflow reviews."
4+
---
5+
6+
# Agent Performance Audit
7+
8+
Produce comparable Codex behavioral audits without copying raw conversations
9+
into the report. Claude history contributes separate coverage counts, not the
10+
Codex behavioral metrics. Keep source histories local and read-only.
11+
12+
## Run
13+
14+
1. Resolve the repository, an exact lowercase marker matching its repository
15+
basename, and an inclusive date window. The marker is a sanity check;
16+
histories are scoped by the target's canonical checkout path or normalized
17+
remote identity. Use a monthly window or the period since the previous major
18+
issue batch. Codex turns are included by task-start date and retained whole
19+
across date boundaries.
20+
2. Use the task visualization directory for output. Identify the current audit
21+
task's session ID when available and pass `--exclude-session`; this validates
22+
that it contains a detectable audit turn but never drops the session's other
23+
turns. The script also detects audit turns by invocation/request markers.
24+
3. Run:
25+
26+
```bash
27+
python3 <skill-dir>/scripts/audit_agent_history.py \
28+
--repo /absolute/repository/path \
29+
--marker repository-name \
30+
--since YYYY-MM-DD \
31+
--until YYYY-MM-DD \
32+
--output-dir /absolute/visualization/path
33+
```
34+
35+
4. For a comparison, pass the previous generated JSON with `--baseline`.
36+
5. Inspect aggregate results. Read raw surrounding history only for a small
37+
number of representative causal cases; keep those notes short and abstract.
38+
Never paste full messages, commands, outputs, or hidden instructions.
39+
6. If causal notes materially improve the report, write a JSON array with
40+
`title`, `cause`, `control`, and `status`, then rerun with `--case-notes`.
41+
7. Deliver the generated HTML link. Keep JSON beside it as reproducible evidence.
42+
43+
Run `python3 <skill-dir>/scripts/audit_agent_history.py --help` for all flags.
44+
45+
## Privacy Contract
46+
47+
- Emit aggregate counts, rates, tool categories, duration percentiles,
48+
category-only correction summaries, and concise causal notes only.
49+
- Exclude injected AGENTS/skill/plugin/browser/environment/automation messages,
50+
explicit audit sessions, session IDs, source paths, cwd values, raw tool
51+
inputs/outputs, full user messages, and result excerpts.
52+
- Redact URLs, emails, home paths, UUIDs, secret-shaped strings, and long hashes.
53+
- Keep the HTML self-contained, script-free, under 512 KB, and free of local
54+
filesystem paths or private links.
55+
- Do not upload or publish the report unless Bram explicitly requests it.
56+
57+
## Interpretation
58+
59+
- Correction detection favors precision and misses polite dissatisfaction.
60+
- Nonzero shell output is not automatically agent error; separate test/build
61+
failures, probes, invocation errors, missing paths/modules, and permissions.
62+
Batched shell wrappers without per-command result envelopes are reported as
63+
uncovered and excluded from per-shell-output denominators.
64+
- Token counts are model-accounted usage, not unique text or a billing estimate.
65+
- Compare schema-2 datasets produced by this script for the same repository and
66+
matching-duration windows. Schema 2 derives each turn from cumulative Codex
67+
token deltas. Do not compare it directly with older one-off or schema-1 data.
68+
- A local HTML report is diagnostic evidence, not a public performance claim.
69+
70+
## Cadence
71+
72+
Run monthly or after a major issue batch. Create a recurring automation only
73+
when Bram explicitly requests scheduling.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Agent Performance Audit"
3+
short_description: "Audit agent history with privacy-safe reports"
4+
default_prompt: "Use $agent-performance-audit to compare recent repository Codex performance with the previous audit and report Claude activity coverage separately."

0 commit comments

Comments
 (0)