agentleFS
metagit-aimetagit-ai/metagit-cli/AGENTS.md

metagit-cli

AGENTS.md4 starsChanged 11 days agoMITView on GitHub

Always-loaded project anchor. Read this first. Contains project identity, non-negotiables, commands, and pointer to .mex/ROUTER.md for full context. Use GitNexus MCP tools for all structural and impact analysis.

43 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

The file

We split this AGENTS.md into the rules it gives an agent

9 rules. 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 38 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After meaningful work, run GROW:

    line 15
  2. Very specific:

    Write: bump last_updated on changed scaffold files and run mex log when rationale matters

    line 20
  3. Very specific:

    MUST run impact before editing: Use impact({target: "symbolName", direction: "upstream"}) or node .gitnexus/run.cjs impact "symbolName" …

    line 101
  4. Very specific:

    MUST analyze graph changes before committing: Use detect_changes({scope: "all"}) (MCP) or node .gitnexus/run.cjs detect-changes --scope all …

    line 102
  5. Very specific:

    MUST warn on HIGH/CRITICAL risk pre-edit.

    line 103
  6. Distinctive:

    NEVER edit a function, class, or method before MCP/CLI impact analysis.

    line 110
  7. Very specific:

    NEVER ignore HIGH or CRITICAL risk warnings from impact analysis, and never read UNKNOWN as an all-clear — it means the walk could not …

    line 111
  8. Very specific:

    NEVER rename symbols with find-and-replace — use rename which understands the call graph.

    line 112
  9. Distinctive:

    NEVER commit before MCP/CLI graph change analysis.

    line 113

“Common” is measured: kept by at least 6 in 10 of the 38 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Metagit

What This Is

Metagit gives you situational awareness across Git repositories. It helps multi-repo projects feel manageable, discoverable, and cohesive. It captures cross-repository relationships and project knowledge in easy to understand version controlled manifests.

Day-1 Agent OS loop: docs/agents-quickstart.md — install → context pack → aos next → compile/ACL → complete.

After Every Task

After meaningful work, run GROW:

  • Prepare: Run task qa:prepush and resolve any errors. Rerun until all failures are resolved.
  • Ground: what changed in reality?
  • Record: update .mex/ROUTER.md and relevant .mex/context/ files
  • Orient: create or update a .mex/patterns/ runbook if this can recur
  • Write: bump last_updated on changed scaffold files and run mex log when rationale matters

Navigation

At the start of every session, read .mex/ROUTER.md before doing anything else. For full project context, patterns, and task guidance — everything is there.

Metagit — agent quick reference

For agents instructed to use Metagit (not necessarily to contribute to this repository).

Install: uv tool install metagit-cli · set METAGIT_AGENT_MODE=true · PyPI name metagit-cli.

Quickstart: docs/agents-quickstart.md · example examples/agent-aos-loop/

Session start (from repo with .metagit.yml):

metagit -c .metagit.yml context pack --tier 0 --json
metagit -c .metagit.yml prompt workspace --kind session-start --text-only

Large umbrellas (500+ repos): keep .metagit.yml on disk. Use search + paged packs + prompt workspace -k large-workspace. Do not run config show --json or workspace list --include-workspace. See docs/reference/context-reduction.md.

Skills: metagit skills install --scope user · MCP: metagit mcp install --scope user

NeedCommand
Workspace map / repo cardsmetagit context pack --tier 0|1|2 --json
Find managed repometagit search "…" --json
Resolve one repo pathmetagit search "…" --path-only (MCP metagit_repo_search path_only: true)
List all managed targetsmetagit workspace repo list --json (MCP metagit_workspace_repos_list)
Repo CI topologymetagit project repo ci show / detect / set (--json)
Search repo file contentsmetagit workspace grep "…" --json
Grep backend (ripgrep)metagit workspace grep info --json
Catalog (paged; no full manifest)metagit workspace list --json
Operational promptsmetagit prompt list
Scoped repo textmetagit context repomix --profile bugfix-local --project P --repo R
Latest release / notesmetagit version check --json
Self-updatemetagit version upgrade --apply --json
Agent profile / applymetagit agent profile show / metagit agent apply --vendor cursor
Campaignsmetagit campaign list · metagit campaign new · metagit campaign status --limit 40 · metagit campaign expand · metagit campaign board-sync · metagit campaign context
Derived surgical projectmetagit project derived create -n N --from P/R or P/R/C [--include-dependencies] · refresh · include · exclude
Skills surfacemetagit skills surface --json
ACL isolate agent checkoutmetagit branch allocate · metagit lease acquire --allocate · metagit worktree create
ACL file claimsmetagit claim declare · metagit claim check (--component optional)
Task graph / intentmetagit task create · metagit task expand · metagit task ready · metagit task complete
Context compilemetagit context compile --project P --repo R [--component NAME] [--depth N] --json
Components (RFC-0026–0032)Nested repos[].components[]; `metagit component listshowresolvegraphdetectinit; metagit claim declare --component; metagit project derived create --from P/R/C; MCP metagit_component_/metagit_claim_; metagit config validate` · docs/concepts/components.md
Context switchmetagit context switch <project> [<repo>] · --json · MCP metagit_context_switch
Nav (human)metagit nav / navigate [--all] [--unmanaged] [--print-path]
Semantic ownershipmetagit semantic declare · metagit semantic owners · metagit semantic conflicts
Merge orchestrationmetagit merge enqueue · metagit merge integrate · metagit merge status
Agent schedulermetagit schedule next · metagit schedule status · metagit schedule policy show
Agent OS (composition)metagit aos status · metagit aos doctor · metagit aos next (coord alias)
Local Atlasmetagit atlas init · metagit atlas generate · metagit atlas validate · metagit atlas query
Organization indexmetagit org index github ORG · metagit org search "query" · metagit graph neighbors REPO · metagit repo materialize REPO
Agent coordination skillmetagit skills show metagit-agent-coordination
Agent OS skillmetagit skills show metagit-aos
Agent coordination (ACL)docs/reference/agent-coordination.md
Task graph (RFC-0008)docs/reference/task-graph.md
Context compiler (RFC-0009)docs/reference/context-compiler.md
Semantic ownership (RFC-0010)docs/reference/semantic-ownership.md
Merge orchestrator (RFC-0011)docs/reference/merge-orchestrator.md
Agent scheduler (RFC-0012)docs/reference/agent-scheduler.md
Agent OS (RFC-0013)docs/reference/aos.md
Metagit Atlas (RFC-0014)docs/reference/atlas.md
Feature registry (all modalities)docs/reference/modality-feature-registry.md

Full guide: docs/agents.md · Index: llms.txt · Skills: docs/skills.md · Docs: https://metagit-ai.github.io/metagit-cli/agents/


<!-- gitnexus:start -->

GitNexus — Code Intelligence

This project is indexed by GitNexus as metagit-cli (17846 symbols, 38515 relationships, 1008 execution flows).

Index stale? Run node .gitnexus/run.cjs analyze --index-only from the project root — it auto-selects an available runner. No .gitnexus/run.cjs yet? Bootstrap with npx, bunx, or pnpm dlx — e.g. bunx gitnexus@latest analyze (npm 11 npx crash; #1939).

Always Do

  • MUST run impact before editing. Use impact({target: "symbolName", direction: "upstream"}) or node .gitnexus/run.cjs impact "symbolName" --direction upstream --repo .; report callers, processes, and risk. Never substitute grep for graph analysis.
  • MUST analyze graph changes before committing. Use detect_changes({scope: "all"}) (MCP) or node .gitnexus/run.cjs detect-changes --scope all --repo . (CLI fallback). partial: true or truncated: true is not a clean check — a zero means unseen, not unaffected; re-run it. For regression review: detect_changes({scope: "compare", base_ref: "main"}) or node .gitnexus/run.cjs detect-changes --scope compare --base-ref "main" --repo ..
  • MUST warn on HIGH/CRITICAL risk pre-edit; never use riskSharedAxes to waive a HIGH/CRITICAL risk warning. Compare File/symbol: MCP File omits axes; Graph-RAG expands File.
  • MUST treat risk: UNKNOWN as unresolved, not as low. An empty caller set is not evidence the symbol is unused — it can also mean the callers are not resolvable by the index (plain-object property access, dynamic dispatch, cross-language calls). impact pairs UNKNOWN with a riskNote saying so. Confirm with a text search before treating the symbol as safe to change or delete; do not proceed on the strength of a zero.
  • MUST use query({search_query: "concept"}) for concepts/flows, context({name: "symbolName"}) for a named symbol, or impact for blast radius, on read-only callers, dependencies, imports, or execution flow. Graph first; text search only for empty/UNKNOWN/literals.
  • For security review, explain({target: "fileOrSymbol"}) lists taint findings (source→sink flows; needs analyze --pdg).

Never Do

  • NEVER edit a function, class, or method before MCP/CLI impact analysis.
  • NEVER ignore HIGH or CRITICAL risk warnings from impact analysis, and never read UNKNOWN as an all-clear — it means the walk could not answer, which is the one verdict that requires confirming by other means.
  • NEVER rename symbols with find-and-replace — use rename which understands the call graph.
  • NEVER commit before MCP/CLI graph change analysis.

Resources

ResourceUse for
gitnexus://repo/metagit-cli/contextCodebase overview, check index freshness
gitnexus://repo/metagit-cli/clustersAll functional areas
gitnexus://repo/metagit-cli/processesAll execution flows
gitnexus://repo/metagit-cli/process/{name}Step-by-step execution trace

CLI

TaskRead this skill file
Understand architecture / "How does X work?".claude/skills/gitnexus-exploring/SKILL.md
Blast radius / "What breaks if I change X?".claude/skills/gitnexus-impact-analysis/SKILL.md
Trace bugs / "Why is X failing?".claude/skills/gitnexus-debugging/SKILL.md
Rename / extract / split / refactor.claude/skills/gitnexus-refactoring/SKILL.md
Tools, resources, schema reference.claude/skills/gitnexus-guide/SKILL.md
Index, status, clean, wiki CLI commands.claude/skills/gitnexus-cli/SKILL.md
<!-- gitnexus:end -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.