metagit-agent-access
Skill4 starsChanged 12 days agoMITView on GitHub
Optimize any repository for minimal-token agent onboarding — llms.txt, AGENTS.md, hidden HTML agent blocks, docs/agents.md. Use when asked to improve agentic access, agent metadata, llms.txt, or run the agent-access optimizer subagent on a project.
In this repository62 other files it gives its agents.
- agentsAGENTS.md
- docs/agents.mdAGENTS.md
- agentsAGENTS.md
- agentsCopilot instructions
- .cursor/rules/github-cli.mdcCursor rule
- .cursor/rules/project-level.mdcCursor rule
- llms.txtllms.txt
- gitnexus-cliSkill
- gitnexus-debuggingSkill
- gitnexus-exploringSkill
- gitnexus-guideSkill
- gitnexus-impact-analysisSkill
- gitnexus-refactoringSkill
- humanizerSkill
- metagit-agent-accessSkill
- metagit-agent-coordinationSkill
- metagit-aosSkill
- metagit-bootstrapSkill
- metagit-campaignSkill
- metagit-cliSkill
- metagit-config-refreshSkill
- metagit-context-packSkill
- metagit-control-centerSkill
- metagit-gatingSkill
- metagit-gitnexusSkill
- metagit-graph-maintainSkill
- metagit-mcp-resourcesSkill
- metagit-multi-repoSkill
- metagit-projectsSkill
- metagit-release-auditSkill
- metagit-repo-impactSkill
- metagit-rewrite-campaignSkill
- metagit-sharing-stateSkill
- metagit-stampSkill
- metagit-upstream-scanSkill
- metagit-upstream-triageSkill
- metagit-workspace-scopeSkill
- metagit-workspace-syncSkill
- metagit-agent-coordinationSkill
- metagit-aosSkill
- metagit-bootstrapSkill
- metagit-campaignSkill
- metagit-cliSkill
- metagit-cliSkill
- metagit-config-refreshSkill
- metagit-context-packSkill
- metagit-control-centerSkill
- metagit-gatingSkill
- metagit-gitnexusSkill
- metagit-graph-maintainSkill
- metagit-mcp-resourcesSkill
- metagit-multi-repoSkill
- metagit-projectsSkill
- metagit-release-auditSkill
- metagit-repo-impactSkill
- metagit-rewrite-campaignSkill
- metagit-sharing-stateSkill
- metagit-stampSkill
- metagit-upstream-scanSkill
- metagit-upstream-triageSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
After adding major CLI/MCP features to a product repo (refresh agent surfaces)
- Distinctive: line 19
Do not run proactively on every task.
- Very specific: line 31
Prefer the PyPI package path (always available when metagit-cli is installed) or metagit skills install --skill metagit-agent-access for a …
- Distinctive: line 49
Run the optimizer Python entrypoint from the installed package:
- Very specific: line 57
If uv is available in the target repo, the shell wrapper is equivalent:
- Distinctive: line 75
When the script report shows gaps the templates cannot fill, or the repo is non-trivial, dispatch a generalPurpose subagent (not …
- Very specific: line 79
Run the optimizer script with --json
- Distinctive: line 81
Add/refine hidden metadata (HTML comments) before visible prose changes
- Distinctive: line 82
Keep human-facing README diff minimal (one short pointer table max)
- Distinctive: line 103
Session block: every artifact set includes install + 2–3 session-start commands
- Very specific: line 108
If target has .metagit.yml, include in generated session block:
- Very specific: line 125
If mkdocs.yml exists, add agents.md to nav and run mkdocs build --strict when docs CI expects it.
≈ “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
Metagit agent access optimizer
On-demand workflow to make a target repository easy for AI agents to grasp with minimal tokens, using conventions that stay out of the human reading path where possible.
When to use
- User asks to optimize agent access, agent onboarding, or
llms.txt - User wants hidden agent metadata in an existing project
- After adding major CLI/MCP features to a product repo (refresh agent surfaces)
Do not run proactively on every task.
Execution modes
| Mode | When |
| Script first | Default — fast audit + scaffold |
| Subagent | Large/unknown repo or user wants full editorial pass |
1) Script (run first)
Hermes skill_manage installs SKILL.md only — local ./scripts/ paths will not exist.
Prefer the PyPI package path (always available when metagit-cli is installed) or
metagit skills install --skill metagit-agent-access for a full skill tree.
From the target repository root (not necessarily metagit-cli):
SKILL_ROOT="$(python3 -c "import metagit, pathlib; print(pathlib.Path(metagit.__file__).parent / 'data/skills/metagit-agent-access')")"
"$SKILL_ROOT/scripts/optimize-agent-access.sh" . --apply --jsonAfter metagit skills install --skill metagit-agent-access:
"${HERMES_HOME:-$HOME/.hermes}/skills/metagit-agent-access/scripts/optimize-agent-access.sh" . --apply --jsonInline fallback (no scripts)
Run the optimizer Python entrypoint from the installed package:
SKILL_ROOT="$(python3 -c "import metagit, pathlib; print(pathlib.Path(metagit.__file__).parent / 'data/skills/metagit-agent-access')")"
python3 "$SKILL_ROOT/scripts/optimize_agent_access.py" . --json
python3 "$SKILL_ROOT/scripts/optimize_agent_access.py" . --apply --jsonIf uv is available in the target repo, the shell wrapper is equivalent:
uv run python "$SKILL_ROOT/scripts/optimize_agent_access.py" . --jsonManual audit when scripts cannot run: check for llms.txt, AGENTS.md, docs/agents.md, and
<!-- agent-access:start --> in README; scaffold from $SKILL_ROOT/templates/ only after
dry-run review.
Flags:
--dry-run(default): report gaps only--apply: create missing scaffolds from templates; inject README HTML comment if absent--json: machine-readable report on stdout
2) Subagent (on demand)
When the script report shows gaps the templates cannot fill, or the repo is non-trivial, dispatch a generalPurpose subagent (not background) with the prompt in subagent-prompt.md.
Replace {{REPO_ROOT}} with the absolute target path. The subagent must:
- Run the optimizer script with
--json - Apply
--applyif safe (no overwrite of human-authored agent sections without diff review) - Add/refine hidden metadata (HTML comments) before visible prose changes
- Keep human-facing README diff minimal (one short pointer table max)
- Return a JSON summary:
files_created,files_updated,token_estimate_llms_txt,follow_ups
Parent agent: merge subagent summary; do not paste full generated files into chat.
Artifacts (priority order)
| Artifact | Audience | Human visibility |
llms.txt | LLM crawlers | Low ( convention ) |
AGENTS.md | Agent hosts | Low ( agent convention ) |
<!-- agent-access:... --> in README | Agents parsing raw MD | Hidden (HTML comment) |
docs/agents.md | Docs site + agents | Medium ( link from README ) |
.agent/manifest.json | Agents only | Hidden ( dot dir ) |
See reference.md for formats.
Quality bar
- Token budget:
llms.txt≤ 80 lines;AGENTS.mdagent section ≤ 120 lines before project-specific content - No duplication:
llms.txtindexes;AGENTS.mdquick reference;docs/agents.mdfull guide - Session block: every artifact set includes install + 2–3 session-start commands
- Idempotent: re-run
--applymust not duplicate HTML comment blocks or sections
Metagit-specific extras
If target has .metagit.yml, include in generated session block:
export METAGIT_AGENT_MODE=true
metagit context pack --tier 2 --json
metagit skills install --scope userVerification
After --apply:
test -f llms.txt && test -f AGENTS.md
rg 'agent-access:start' README.md # hidden block presentIf mkdocs.yml exists, add agents.md to nav and run mkdocs build --strict when docs CI expects it.
Additional resources
- reference.md — hidden metadata patterns
- subagent-prompt.md — full subagent dispatch text
- templates/ — scaffold files
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.

