git-machete AGENTS.md

A set of working rules for AI coding agents contributing to the git-machete project. It explains which project commands to use for formatting, linting, testing, imports, and Git work.

In plain words
What is it for?
Guiding coding agents while changing git-machete: running the approved tests and checks, following import conventions, and handling its branch-layout files safely.
Why use it?
It prevents inconsistent local checks and environment-related test failures by directing agents through the project's pinned tooling. It also warns against commands that can overwrite branch-layout decisions or hang.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/virtuslab/git-machete/agents-md
Clone the repo
git clone --depth 1 https://github.com/VirtusLab/git-machete

Made for: Codex, OpenCode.

Per session 1,620 This file is loaded in full into every session.
When invoked 1,620 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01620 $0.01620
Opus 5 $0.00810 $0.00810
Sonnet 5 $0.00324 $0.00324
Haiku 4.5 $0.00162 $0.00162

Measured 2d ago against content hash eb02b26f34a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

git-machete AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 92 lines

How it starts

The opening of the file, as written. The whole thing — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Conventions for AI coding agents

Tooling

  • Run autoformatters and linters via tox. Never invoke flake8, isort, mypy, vulture, pylint (etc.) directly - go through their respective tox -e <env> invocation so dependency versions stay pinned.
  • Exception: do NOT run tox -e flake8 or tox -e vulture (or those binaries directly). They hang indefinitely inside Cursor's terminal for an unidentified reason - rely on CI to catch any violations.
  • Run tests with tox -e py [-- <pytest flags like -k>...]. Do NOT run pytest, python -m pytest, or any tox-built venv's pytest binary directly. Tox's passenv shielding is what keeps test runs deterministic
    • bypassing it lets dev-shell env vars (e.g. GIT_MACHETE_DIFF_OPTS) leak into the test process and produce failures that don't reproduce in CI.
  • Use tox -e py (the full suite, several minutes) sparingly - by default scope it to the most likely affected tests via -k, -m, or explicit file/class/method selectors, e.g. tox -e py -- tests/test_cli.py tests/test_anno.py -k mutex. Only fall back to the full suite when the change is wide in scope (parser refactors, shared fixtures, base classes, ...) or when a scoped run already passes and you want a final pre-push sanity check.
  • On macOS, skip the zsh subset of completion E2E tests (flaky on Mac): tox -e test-completions -- -k "not zsh". CI runs the full set on Linux.

Git

  • Don't git commit or git push unless explicitly asked.

Tests

  • Skip tests that require a minimum Git version with @pytest.mark.skipif(get_git_version() < (X, Y), reason="..."), not with an if get_git_version() < (X, Y): return early-return at the top of the test body. The decorator surfaces the skip in pytest's report (and in the JUnit XML CI uploads); the early-return silently masquerades as a pass.
  • Prefer assert_success(cmd_and_args, expected_output) over a bare launch_command(cmd_and_args) whenever a command is run for its effect. A bare launch_command throws the command's entire output on the floor, so any regression in what it prints (a reworded message, a wrong/missing branch name, a stray extra line, a wrong singular/plural) goes completely unnoticed - the call still "passes". assert_success pins the whole output down, so it doubles as the regression test for that output. Reserve a bare launch_command for the cases where asserting the full output is genuinely troublesome (non-deterministic output such as commit hashes or --verbose/git-subprocess noise leaking into the captured text), and even then prefer asserting whatever deterministic prefix/suffix you can.
  • Assert on the full command output rather than substring presence. Use assert_success(cmd_and_args, expected_output) (or, for ANSI/colored runs where --color=always produces escape codes, raw_output = launch_command(...); assert raw_output == expected_ansi) so the whole rendering is pinned down at once. Avoid assert "<phrase>" in output / assert "<phrase>" not in output for command-output checks - a substring match silently tolerates stray extra lines, misordered sections, the same phrase landing on the wrong row, or new (unintended) labels appearing elsewhere, all of which a full-output equality assertion would catch on the first run. Exception: substring checks are legitimate when the asserted invariant is genuinely scoped to one fragment of the output (e.g. "this warning text appears somewhere") and the rest of the output is either non-deterministic or already covered by another test.

Read the full file on GitHub · 92 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 92 lines · 1,620 tokens per session scan A eb02b26f34a8

Subscribe to this mod's changes

git-machete AGENTS.md is an instructions file published in the GitHub repository VirtusLab/git-machete (1,137 stars, last pushed 3d ago), licensed MIT. It adds 1,620 tokens to every session, about $0.0081 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

GitWand AGENTS.md

Instructions for devlint/GitWand, covering agents.md — gitwand ai agent rules, monorepo structure, security — critical rules, no shell string interpolation in git commands and never bypass saferepopath().

devlint/GitWand · 2,296 tokens

GitWand CLAUDE.md

Instructions for devlint/GitWand, covering gitwand — vue d'ensemble, architecture monorepo, séparation des responsabilités, setup développement and prérequis : node 22.13+, pnpm 11+, rust stable.

devlint/GitWand · 1,141 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens