harness-engineer
Skill4 starsChanged 5 days agoMITView on GitHub
Inspect, audit/score, and improve THIS pi harness — AGENTS.md budget, skill catalog, token efficiency, portability, prompt anti-patterns (emphasis boosters, verification rituals, stale examples, contradictions, dated configs, secret hygiene). Use when: "audit harness", "anti-pattern audit", "audit my skills/prompts/extensions", "health score", "trim skills", "improve the harness", or the harness feels bloated.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- fhgomes/my-awesome-agents-skillstheir own version, first seen Oct 13, 2026
- nihao555-hub/claude-code-agent-skillstheir own version, first seen Apr 1, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- fhgomes/my-awesome-agents-skills★ 5same name
- nihao555-hub/claude-code-agent-skills★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- archifySkill
- authSkill
- brainstormingSkill
- browser-toolsSkill
- code-reviewerSkill
- documentation-writerSkill
- fallow-auditSkill
- frontend-designSkill
- github-actionsSkill
- grill-meSkill
- impeccableSkill
- linkedinSkill
- map-integrationSkill
- pidocSkill
- playwright-testerSkill
- ponytailSkill
- refactoring-uiSkill
- rust-skillsSkill
- sdk-developmentSkill
- self-learnSkill
- session-auditSkill
- skill-managerSkill
- systematic-debuggingSkill
- web-searchSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Never move permanent behavioral rules out of AGENTS.md into skills.
- Distinctive: line 28
Before any edit + at end, capture:
- Very specific: line 53
Every skill: description char count → tokens (extract frontmatter only, never load bodies).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Harness Engineer
Make harness leaner, more cache-stable, fully portable (macOS+Linux). Evidence over opinion. Prefer deletion + lazy-loading.
Non-negotiable principles
- Minimal core — delete before add. Never bloat permanent prefix.
- Cache sacred — system prompt + tool defs + AGENTS.md + skill descriptions byte-stable per session. Fresh session after prefix changes.
- rg first — code navigation via
rg. Bash only for real side-effects (tests, builds, git, pkg managers). - Progressive disclosure — skills expose name + description only; bodies load on demand.
- Portability — no absolute user paths in functional files (
~/$HOMEonly). No unguarded OS-only commands. No pi env vars for config location (default~/.pi/agent). - Never move permanent behavioral rules out of
AGENTS.mdinto skills.
Snapshot loop (mandatory)
Before any edit + at end, capture:
wc -c ~/.pi/agent/AGENTS.md
# skill count + description byte sizes
ls ~/.pi/agent/prompts/*.md 2>/dev/null | wc -l
# portability hits (check below)Report BEFORE → AFTER every field. No improvement claim without number.
Scope
~/.pi/agent/(+ project.pi/):AGENTS.md,settings.json,models.json, skills, promptsREADME.md,CHANGELOG.md,audit-reports/skills/skills-audit.md— living map; re-read before any change
README.md missing → create minimal first.
Audit mode
One skill = full loop: inspect → audit/score → diagnose → change → measure → log. Audit-only: modify nothing (except report, watermark advance, 30-day session prune) unless user asks.
- Watermark check — read
~/.pi/agent/audit-reports/.watermark.json(auditedThrough, ISO ts). Session-derived scans scope strictly to session files whose filename timestamp is newer (parse it — filenames dash the timeYYYY-MM-DDTHH-MM-SS…; plain string compare mis-orders same-hour case vs colon-format watermark); never re-audit covered sessions. No watermark → everything unaudited. - Inventory (chars/4 = token heuristic):
- Context files:
AGENTS.md(+ always-loaded files) byte size → tokens. - Every skill:
descriptionchar count → tokens (extract frontmatter only, never load bodies).
wc -c ~/.pi/agent/AGENTS.md awk '/^description:/{f=1;next} /^---/{f=0} f' ~/.pi/agent/skills/*/SKILL.md | wc -c - Context files:
- Permanent floor = context tokens + Σ skill-description tokens.
- Health Score — start 100, deduct:
- context > 800 tok: −10
- context > 1,300 tok (hard ceiling): −30 + report carries a trim proposal or a recorded user sign-off — floor growth is a decision, never drift
- skill count > 15: −10
- any single desc > 250 tok: −10
- avg desc > 100 tok: −10
- huge body (>2,000 tok) AND long desc (>100 tok): −5/skill (progressive-disclosure failure)
- AGENTS.md ↔ skill rule duplication: −5/overlap
- vague/missing descriptions: −5 each
- skills-dir pollution (node_modules, .zip, ._*): −5/class
- portability quick-check hits in functional files: −5/class
- Anti-pattern sweep — prompt-quality + security checks orthogonal to score: run references/anti-pattern-audit.md checklist over skills, prompts, extensions (rg-signature pass first, read flagged regions only, calibrate earned emphasis vs boosters). Findings get own report section; fixes = separate proposals (Workflow step 3).
- Report → matching
~/.pi/agent/audit-reports/{harness,skills,sessions}/subdir,<date>T<time>Z-<topic>.md(filename carries date; header records machine provenance —uname -srm+uname -n, repo runs from multiple machines/OSes) — structure: executive summary, inventory table, top consumers, overlaps, score breakdown, delta vs previous report if present. If permission-gate/extensions changed since the previous report: runnpm run gate:evalfirst and include the pass-rate delta (standing eval cadence — harness changes re-verify like releases). - Report BEFORE → AFTER numbers; recommendations ranked by impact. Implement only on request, then log per Workflow step 5.
- Close audit — advance
.watermark.jsonauditedThroughto newest covered session; prune: delete~/.pi/agent/sessions/**/*.jsonlunmodified 30 days, remove emptied cwd-slug dirs.
Workflow
- Discover — loaded context files, skills (name + desc + path), prompts, non-portable items. Re-read
README.md. BEFORE snapshot. - Diagnose — rank by impact: unused/overlapping skills, AGENTS.md bloat belonging in a skill, bash-used-for-search, non-portable paths, unstable prefix material.
- Propose — prefer deletions/merges. Per change: path, before→after, why (cache/tokens/portability), risk, rollback.
- Implement — approved/safe edits only. Ask before destructive/large writes. Tell user fresh session after prefix changes.
- Persist — dated entry at TOP of
CHANGELOG.md(latest-first; includeMeasured:before→after). UpdateREADME.md/skills-audit.mdwhen architecture or skill set changes.
Optional deep evidence (only on request — skill-usage/token audit):
pidx --report usage— per-model token profile (input/output/reasoning per turn, cache %, cost), top-5 cost-tail sessions, first-turn prefix trend. Reads pidx's cached extracts, so it costs milliseconds; the active session is excluded by pidx's discover invariant. Prefer this over hand-written JSONL analysis.python3 scripts/audit_toolcall_rules.py [path]— checks session .jsonl (or dir; default last 5) for AGENTS.md Token-Economy violations (grep-on-file, cat-for-viewing, re-runs, speculative previews, pollution) + per-turn call batching stats.python3 scripts/error_audit.py [path]— error mining: joins toolResult.isError back to originating toolCall input; reports by tool/kind/project + top failing command heads (default all sessions).- A/B prefix cost:
bash scripts/make_test_home.sh <skills-csv> [dest]builds temp HOME with those skills model-visible (real harness untouched);bash scripts/ab_prefix.sh "<prompt>" <dest> [model]runs one prompt under both configs, prints first-turn tokens / cache-read / cost / wall time. - Evidence (L2-vs-L3 benchmark, 10 runs):
assets/l2-vs-l3-matrix.json— only tavily-search fired (enabled model-visible as result); L3-as-a-set failed ≤20% median-cost rule. - pi sessions:
~/.pi/agent/sessions/*/*.jsonl— skill loads,/skill:invocations, correction words - Rank skills: auto-load vs explicit vs never fire —
uv run --script scripts/skill_usage_audit.py(from skill dir) counts per-skill invocations across all sessions, tiers high/medium/low/unused
Portability quick-check
rg -n '/Users/|/home/|pbcopy|pbpaste|osascript|/opt/homebrew|launchctl' \
~/.pi/agent/AGENTS.md ~/.pi/agent/settings.json ~/.pi/agent/models.json \
~/.pi/agent/*.sh ~/.pi/agent/prompts/ ~/.pi/agent/skills/ \
--glob '!**/harness-engineer/**' --glob '!**/node_modules/**'Zero hits required in functional files.
Output format
- BEFORE snapshot
- Problems (by impact)
- Recommended changes (diffs + risk)
- Actions taken
- AFTER snapshot + delta
- Portability status
- Changelog entry (
Measured:line required)
Goal
Smaller, stable, cache-friendly, rg-first, fully portable harness.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

