gmc AGENTS.md

Repository instructions for gmc, a Go command-line tool that lets developers work on multiple Git worktrees in parallel and generate commit messages. A Git worktree is a separate working directory connected to the same repository history.

In plain words
What is it for?
Use them when developing gmc commands, worktree operations, internal logic, tests, or command output.
Why use it?
They keep command handling, business logic, and output responsibilities separate, making the tool easier to test and maintain. They also define conventions agents must follow when changing the code.

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/samzong/gmc/agents-md
Clone the repo
git clone --depth 1 https://github.com/samzong/gmc

Made for: Codex, OpenCode.

Per session 2,039 This file is loaded in full into every session.
When invoked 2,039 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.02039 $0.02039
Opus 5 $0.01019 $0.01019
Sonnet 5 $0.00408 $0.00408
Haiku 4.5 $0.00204 $0.00204

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

Security

Grade A, and why

gmc 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 · 182 lines

How it starts

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

AGENTS.md

Instructions for AI coding agents working in this repository.

What this repo is

gmc is a Go CLI for parallel AI-agent development: worktree management is the primary surface, AI-generated Conventional Commits are secondary.

  • Primary: .bare clone + sibling worktrees (gmc wt add/dup/share/sync/promote/...)
  • Secondary: LLM commit messages from staged diffs (root gmc command)

User-facing command reference: README.md. Runtime usage patterns: skills/gmc/SKILL.md.

Architecture invariants

Three layers — do not blur boundaries:

Layer 1: Command Definition (cmd/*.go)
    cobra.Command + flag binding + Args validation
         │
Layer 2: Runner Function
    build Options → call Layer 3 → format output
         │
Layer 3: Business Logic (internal/*)
    no CLI dependencies; testable in isolation

Rules agents must follow:

Rule Detail
Dependency direction cmd/ imports internal/; internal/ must not import cmd/ or Cobra
Command handlers Use RunE, not Run; always set an Args validator
Output streams stdout = data; stderr = progress/errors; use cmd.OutOrStdout() / errWriter()
Errors Return error; main.go prints it. Use exitcode for structured exit codes; userFacingError in cmd/root.go for generic wrapping
Worktree CLI All worktree operations go through gmc wt <subcommand>. Never invent top-level gmc add, gmc clone, etc.
Generated docs Never hand-edit docs/man/*.1. Man pages are generated from Cobra definitions in cmd/*.go via make man (cmd/gendoc/main.go).

Entry point: main.gocmd.Execute().

Where to change what

Area Location Notes
Root commit workflow cmd/root.go, internal/workflow/ Staging, prompt, interactive confirm, commit
Worktree commands cmd/worktree*.go, internal/worktree/ Split across worktree.go, worktree_share.go, worktree_hook.go, worktree_sync.go, worktree_init.go, worktree_prune.go
Worktree client wiring cmd/worktree_client.go Thin factory over worktree.NewClient
Config cmd/config.go, internal/config/ Viper-based; XDG paths
LLM integration internal/llm/ OpenAI-compatible client
Prompt / formatting internal/formatter/ Templates, diff truncation (diff_truncator.go)
Git operations internal/git/, internal/gitcmd/, internal/gitutil/
Branch naming internal/branch/ --branch flag on root command
Shell integration internal/shell/, cmd/worktree_init.go gmc wt init bash|zsh|fish
Tests for CLI cmd/*_test.go Use isolated command instances; swap outWriterFunc / errWriterFunc
Man pages (generated) docs/man/*.1 Do not edit. Source of truth is Use/Short/Long/Example on commands in cmd/*.go. Regenerate: make man

Read the full file on GitHub · 182 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 · 182 lines · 2,039 tokens per session scan A 8744ceb16e48

Subscribe to this mod's changes

gmc AGENTS.md is an instructions file published in the GitHub repository samzong/gmc (18 stars, last pushed 2mo ago), licensed MIT. It adds 2,039 tokens to every session, about $0.0102 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.