GitWand AGENTS.md

A set of rules for GitWand, a monorepo containing several related applications and packages in one repository.

In plain words
What is it for?
Use it when working on GitWand's desktop app, command-line tool, server, extension, or shared packages.
Why use it?
It prevents unsafe Git and file operations, such as building shell commands from unchecked user input or bypassing path checks.

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

Made for: Codex, OpenCode.

Per session 2,296 This file is loaded in full into every session.
When invoked 2,296 The same file — it is already loaded in full.
Security scan A 1 finding. 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.02296 $0.02296
Opus 5 $0.01148 $0.01148
Sonnet 5 $0.00459 $0.00459
Haiku 4.5 $0.00230 $0.00230

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

Security

Grade A, and why

GitWand AGENTS.md scanned grade A with 1 finding 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

introduce Node.js-only modules (e.g., `fs`, `path`, `child_process`) as
AGENTS.md · 317 lines

How it starts

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

AGENTS.md — GitWand AI Agent Rules

This file is read by all AI agents (Claude, Codex, Cursor, etc.) working on this repository. Follow every rule below exactly. When in doubt, ask rather than guess.


Monorepo Structure

apps/desktop/        — Tauri 2 + Vue 3 desktop git client
packages/core/       — TypeScript conflict-resolution engine
packages/cli/        — @gitwand/cli (Node.js CLI)
packages/mcp/        — @gitwand/mcp (MCP server)
packages/vscode/     — VS Code extension
scripts/             — Maintenance scripts (bump-version.sh, etc.)

Package manager: pnpm only (never npm, never yarn).


Security — Critical Rules

No shell string interpolation in git commands

Never build git commands via string interpolation. Always pass arguments as a discrete array or use .arg() chaining.

// WRONG
Command::new("git").arg(format!("checkout {}", branch_name))

// CORRECT
Command::new("git").args(["checkout", &branch_name])

Never bypass safe_repo_path()

apps/desktop/src-tauri/src/lib.rs contains safe_repo_path() which guards against path-traversal attacks. Every file-system operation on user-supplied paths must go through this function. Do not inline your own path validation.

Never log secrets

  • API keys, tokens, and passwords must never appear in log output or in spawned process arguments.
  • Strip environment variables that carry secrets before spawning any external process. Pass only the specific env vars the child process needs.

Version Management

Never edit version files by hand

The following files are managed automatically — do not touch them directly:

  • package.json (any workspace)
  • Cargo.toml
  • apps/desktop/src-tauri/tauri.conf.json

Always use the bump script

./scripts/bump-version.sh X.Y.Z

This script aligns all version fields in one shot — desktop, core, cli, mcp, website, README, and HomeLanding.vue. It derives the current version from packages/core/package.json and replaces it everywhere.

Read the full file on GitHub · 317 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 · 317 lines · 2,296 tokens per session scan A 2dad406154bd

Subscribe to this mod's changes

GitWand AGENTS.md is an instructions file published in the GitHub repository devlint/GitWand (167 stars, last pushed 4d ago), licensed MIT. It adds 2,296 tokens to every session, about $0.0115 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.