Scaffold a self-improving agent governance framework (meta-skills, hooks, memory hierarchy) for Claude Code.
Project description
harness-agent-research
A self-improving agent governance framework for Claude Code. Scaffold it into any repository to get a disciplined, self-correcting agent workflow:
- Meta-skills (
/meta-scope-guard,/meta-anti-patterns,/meta-learn,/meta-commit,/meta-self-audit,/meta-evolve,/meta-critique,/meta-red-team, …) that make the agent scope-aware, mistake-avoiding, and self-reflecting. - Hooks that structurally enforce governance — hard-block edits before scope is declared, block session end without reflection, enforce memory budgets — not just docs the agent can ignore.
- A memory hierarchy (
MEMORY.mdroot index → sub-indexes → topic files) with byte budgets and an always-load composition law, keeping cross-session knowledge principle- centric instead of bloating context. - An anti-pattern system (P1–P12 operational principles + an append-only incident log) the agent extends every time it's corrected.
It ships only the reusable core — no domain-specific skills or content. You add your project's skills, rules, and memory on top.
Install
pip install harness-agent-research
Use
From your project root:
harness-agent-research init # scaffold AGENTS.md + .claude/ + .agent/
harness-agent-research link # once per machine: link memory for Claude Code
(har is a short alias for harness-agent-research.)
Then commit and open the project in Claude Code — the governance hooks activate automatically.
git add AGENTS.md .claude .agent && git commit -m "feat: add agent governance framework"
What gets scaffolded
your-project/
├── AGENTS.md # canonical conventions (Claude reads via .claude/CLAUDE.md; Codex natively)
├── .claude/
│ ├── CLAUDE.md # thin @../AGENTS.md import stub
│ ├── settings.json # hook wiring + permission split (non-destructive allow / catastrophic deny)
│ └── {commands,hooks,memory,rules,scripts} -> ../.agent/* (symlinks, created by `init`)
└── .agent/ # the editable home (NOT a Claude Code protected path)
├── commands/ # 14 meta-skills + poe-call + README
├── hooks/ # 6 governance hooks + lib.sh
├── scripts/ # poe_query.py (optional external-LLM helper)
├── rules/structure.md # path-scoped codebase reference (fill in)
└── memory/ # MEMORY.md, indexes, anti-patterns/, ops/, workstreams/, …
Why the .agent/ + .claude/-symlink split: .claude/ is a Claude Code protected
path (edits there always prompt the user), so the editable surface lives in .agent/ and
.claude/ holds only the two files Claude Code reads directly (CLAUDE.md, settings.json)
plus symlinks into .agent/. The symlinks are created by init at scaffold time — they are
not stored in the wheel (so packaging is free of the "symlinks don't survive a wheel"
problem). See .agent/memory/ops/governance-system-reference.md.
After scaffolding
- Fill in AGENTS.md (Project Overview) and
.agent/rules/structure.md(package map). - (Optional) export
POE_API_KEY(or put it in.env) to enable/poe-callsecond opinions in/meta-critiqueand/meta-red-team; otherwise delete.agent/scripts/poe_query.py+.agent/commands/poe-call.md— both skills degrade gracefully to self-critique. - Add your own skills via
/meta-propose-skill; record work via/track-workstream.
Notes
- Excluded by design: GPU/domain profiling skills, a shared-resource scheduler, and the autonomous-work playbook that depended on them. This is the pure meta core.
initnever clobbers an existingAGENTS.md(it writesAGENTS.framework.mdfor you to merge) and refuses to overwrite an existing.agent/without--force.
Develop / publish
pip install -e ".[dev]"
python -m build # sdist + wheel
python -m twine check dist/* # verify metadata
python -m twine upload dist/* # publish to PyPI
Replace chless in pyproject.toml and AGENTS.md before publishing.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file harness_agent_research-0.1.0.tar.gz.
File metadata
- Download URL: harness_agent_research-0.1.0.tar.gz
- Upload date:
- Size: 87.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28b31abc1529b178e8570262f745a41de45c29a3be8e4d478928dba4c218f98a
|
|
| MD5 |
19c0c9c270015320a24a6ce6a5fba597
|
|
| BLAKE2b-256 |
210958c508c190c7166c51f0ea88384aee6648514c2f94fd4e3c7af344055b64
|
File details
Details for the file harness_agent_research-0.1.0-py3-none-any.whl.
File metadata
- Download URL: harness_agent_research-0.1.0-py3-none-any.whl
- Upload date:
- Size: 109.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9111f746614219af4fc51565552647b008be5604df937805213c07727f4056eb
|
|
| MD5 |
0f6be7f6450a19a800d85390f3b668f4
|
|
| BLAKE2b-256 |
cbc8b6e2e01204da449a4f6b75c5f4054f66f8e1f5f599a698aee1644b429094
|