Agents Md Generator banner
nyosegawa nyosegawa

Agents Md Generator

Git community

Description

Auto AGENTS.md Generator for Git - Automatically creates starter AGENTS.md (with CLAUDE.md symlink) when cloning empty repositories

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

agents-md-generator

[日本語](README-ja.md)

A shell wrapper that automatically creates a starter `AGENTS.md` (with `CLAUDE.md` symlink) when you clone an empty repository.

Blog post: [AGENTS.mdを自動で育てる仕組みを作った](https://nyosegawa.github.io/posts/agents-md-generator/)

Why

Every new repository needs an `AGENTS.md` — the [open standard](https://agents.md/) for guiding AI coding agents (Cursor, Zed, Codex, Gemini CLI, GitHub Copilot, etc.). Claude Code reads `CLAUDE.md`. Setting up both manually every time is tedious.

This wrapper plants the seed automatically. You just grow it as your project evolves.

Setup

Add to your `.bashrc` or `.zshrc`:

source /path/to/agents-md-seed.sh

If you use ghq:

ghq get nyosegawa/agents-md-generator
# .zshrc / .bashrc
source "$(ghq root)/github.com/nyosegawa/agents-md-generator/agents-md-seed.sh"

Or download directly:

curl -sL https://raw.githubusercontent.com/nyosegawa/agents-md-generator/main/agents-md-seed.sh -o ~/.agents-md-seed.sh
echo 'source ~/.agents-md-seed.sh' >> ~/.zshrc  # or .bashrc

Usage

# Just clone as usual
git clone git@github.com:you/new-repo.git

# AGENTS.md and CLAUDE.md (symlink) are already there
ls new-repo/
# AGENTS.md  CLAUDE.md -> AGENTS.md

# Works with ghq too
ghq get you/new-repo

How It Works

The script defines thin `git()` and `ghq()` wrapper functions that run after every `git clone` / `ghq get`:

  1. Parses arguments to find the target directory
  2. Checks if the repo is empty (< 3 items excluding .git)
  3. Skips if AGENTS.md already exists
  4. Creates AGENTS.md from a built-in template (or custom template)
  5. Creates CLAUDE.md as a symlink to AGENTS.md

Customization

Custom template

Set `AGENTS_MD_TEMPLATE` or place a template at `~/.config/agents-md/template.md`:

export AGENTS_MD_TEMPLATE="$HOME/my-agents-template.md"

Empty-repo threshold

The default threshold is 3 items. To change it, modify the `((