local-agent-harness
Copilot instructions0 starsChanged 7 months agoMITView on GitHub
Pre-commit hooks (gitleaks, ruff, file hygiene) are configured in .pre-commit-config.yaml. The tool is a Python CLI (typer) that manages AI-agent harness files for repositories. It operates in three modes—check (read-only audit), init (render missing files), refresh (backup + rewrite stale files with --apply)—and scales its output to the repo's maturity stage (S0 → S3). Data flow: CLI commands call core/ functions. scaffold_manifests reads templates from skill_data/local-agent-harness/assets/ (located via _paths.assets_dir()), delegates stage detection to assess_repo.detect(), and drift detection to diff_manifests. Core…
- Installs packages
The file
We split this copilot-instructions.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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
- Very specific: line 59
Every file starts with from __future__ import annotations.
- Distinctive: line 85
Commit style: Conventional Commits.
≈ “Common” is an estimate: at least 1 in 5 of the 3,894 Copilot instructions 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
GitHub Copilot Instructions
Build, Test, and Lint
# Install in editable mode with dev dependencies
pip install -e '.[dev]'
# Lint (ruff, line-length 100, target py3.11)
ruff check src tests
# Type-check (mypy strict)
mypy src/local_agent_harness
# Run all tests (95% coverage threshold enforced)
pytest --cov=local_agent_harness --cov-fail-under=95
# Run a single test
pytest tests/unit/test_scaffold.py::test_init_dry_run_does_not_write
# Run only unit or integration tests
pytest tests/unit/
pytest tests/integration/Pre-commit hooks (gitleaks, ruff, file hygiene) are configured in .pre-commit-config.yaml.
Architecture
The tool is a Python CLI (typer) that manages AI-agent harness files for repositories. It operates in three modes—check (read-only audit), init (render missing files), refresh (backup + rewrite stale files with --apply)—and scales its output to the repo's maturity stage (S0 → S3).
src/local_agent_harness/
├── cli/
│ ├── app.py # Typer app wiring all cmd_*.py subcommands
│ └── cmd_*.py # One module per CLI subcommand
├── core/
│ ├── assess_repo.py # Detect stage (S0–S3) + score 5 axes (0–5 each, max 25)
│ ├── diff_manifests.py # Detect drift: missing / stale / relaxed / out-of-stage
│ ├── scaffold_manifests.py # Render .tmpl templates into the target repo
│ ├── manifest_regression.py # Invariant assertions on rendered manifests
│ ├── readiness_report.py # Machine-readable AI-readiness report
│ ├── redaction_smoke.py # Verify no Red-class data leaks in manifests
│ └── _paths.py # Locate bundled skill_data via importlib.resources
└── skill_data/local-agent-harness/
├── SKILL.md
├── assets/ # .tmpl template files for every manifest
│ ├── AGENTS.md.tmpl, GROUNDING.md.tmpl, plan.md.tmpl
│ ├── ci/, devcontainer.json.tmpl, pre-commit-config.yaml.tmpl
│ └── runtime-overlays/ # CLAUDE.md, .codex/config, copilot-cli, cursor
└── references/ # Markdown reference docs (rubric, anti-patterns, etc.)Data flow: CLI commands call core/ functions. scaffold_manifests reads templates from skill_data/local-agent-harness/assets/ (located via _paths.assets_dir()), delegates stage detection to assess_repo.detect(), and drift detection to diff_manifests. Core modules also double as standalone scripts with argparse + if __name__ == "__main__".
Key Conventions
Python style
- Every file starts with
from __future__ import annotations. mypy --strictis enforced onsrc/. Tests are excluded from strict typing.ruffignoresE701(multiple statements on one line) andE731(lambda assignment); severalcore/files also ignoreE402(import order) because of the_pathsbootstrapping pattern.
Template system
- Templates live in
skill_data/local-agent-harness/assets/as.tmplfiles. _paths.assets_dir()locates them viaimportlib.resources— works in both editable and wheel installs.- Adding a new manifest: add the
.tmpl, register it inscaffold_manifests.py(CORE_FILES,STAGE_INFRA, orRUNTIME_OVERLAYS), and add anchor strings to theTARGETSlist indiff_manifests.py.
Stage / maturity model
assess_repo.detect()assigns S0–S3 based on source files, tests, CI, and tags.- Stage gates control which templates are rendered; S0 = minimal kit, S3 = full governance.
- Five readiness axes:
agent_config,documentation,ci_cd,code_structure,security— each 0–5; total max 25.
Test fixtures (tests/conftest.py)
empty_repo— creates a temporarygit initdirectory; use for scaffold/check tests.isolated_skill_root— monkeypatches_paths.skill_data_rootso tests can freely mutate asset copies without corrupting the packaged source._protect_skill_data(session-scoped, autouse) — snapshots and restoresskill_data/if tests accidentally delete it.
CI gates
verify.yml— lint → unit tests (≥95% coverage) → gitleaks secrets scan → manifest regression.governance.yml— assertsAGENTS.md/GROUNDING.mdpresent; blocks PRs that removeHC*hard-constraint lines fromGROUNDING.md; checks AI-readiness does not regress.- Both workflows must be green to merge.
Commit and branch conventions (from GROUNDING.md / AGENTS.md)
- Branch naming:
agent/<task-slug>. - Commit style: Conventional Commits.
GROUNDING.mdhard constraints (HC1–HC6) may never be removed; changes require a dedicated PR.
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.

