Community코딩 & 개발github.com

agents-md-from-codebase

Write or refresh an AGENTS.md for a repository by reading the actual codebase, so coding agents (Claude Code, Cursor, Codex, Copilot and others) know the layout, the real commands, the conventions and the traps from the first message. Use when the user asks for an AGENTS.md, CLAUDE.md or agent instructions, wants an agent to "understand the project", is onboarding agents to a repo, or when agents keep running wrong commands or breaking conventions.

agents-md-from-codebase란 무엇인가요?

agents-md-from-codebase is a Claude Code agent skill that write or refresh an AGENTS.md for a repository by reading the actual codebase, so coding agents (Claude Code, Cursor, Codex, Copilot and others) know the layout, the real commands, the conventions and the traps from the first message. Use when the user asks for an AGENTS.md, CLAUDE.md or agent instructions, wants an agent to "understand the project", is onboarding agents to a repo, or when agents keep running wrong commands or breaking conventions.

지원 대상✓Claude Code✓Codex CLI✓Cursor
npx skills add https://github.com/FarukValjevac/agent-skills/tree/HEAD/skills/agents-md-from-codebase

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

AGENTS.md from codebase

Produce a short, accurate map of the repository for coding agents. Every line must come from something you read or ran in this repo. A wrong command in AGENTS.md is worse than none, because agents trust it.

1. Read before you write

Work through these and take notes. Skip what does not exist.

  • What it is: README*, the package manifest (package.json, pyproject.toml, Cargo.toml, go.mod, *.csproj, pom.xml, build.gradle), top-level folders (ls, then one level into the main source folders).
  • How to run things: scripts in the manifest, Makefile/justfile/Taskfile, .github/workflows/* (CI shows the commands that really gate merges), Dockerfile, docker-compose*, .env.example.
  • Conventions: linter and formatter configs (eslint, biome, prettier, ruff, mypy, tsconfig, .editorconfig), test layout and naming, git log --oneline -30 for commit style, CONTRIBUTING.md, PR templates.
  • Existing agent files: AGENTS.md, CLAUDE.md, .cursor/rules, .cursorrules, .github/copilot-instructions.md. Keep what is still true; mention conflicts to the user instead of silently overwriting them.
  • Architecture rules: monorepo workspaces, layering (for example "domain must not import from web"), generated files that must not be edited by hand, and where secrets and config come from.

2. Verify the commands

Run the install, lint, type-check and test commands you are about to document (with the user's permission if they are slow, need network or touch services). Record what passed. If a command fails on a clean checkout, write it down as a known issue rather than leaving it out. Never invent a command that you have not seen in the repo.

3. Write AGENTS.md

Use the structure in references/template.md. Keep it under about 150 lines: agents read it at the start of every task, and a long file costs tokens and attention each time.

  • Commands first, exact and copy-pasteable, including how to run a single test.
  • Map, not tour: one line per important folder saying what lives there and what does not.
  • Rules as instructions: "Run npm run check before finishing", not "We value quality".
  • Traps: things that already went wrong or easily will (generated files, a slow test suite to skip, a port that must be free, an env var that must be set).
  • Definition of done: the exact checks that must pass before the agent says it is finished.
  • Link to deeper docs instead of copying them.

4. Wire it up for other agents

AGENTS.md is read natively by many agents. For the ones that look elsewhere, offer (do not force) a pointer instead of a copy, so there is one source of truth:

  • Claude Code: CLAUDE.md containing @AGENTS.md, or the user's existing CLAUDE.md with that line added.
  • Cursor: a rule in .cursor/rules/ that references AGENTS.md.
  • GitHub Copilot: .github/copilot-instructions.md pointing to AGENTS.md.

5. Hand over

Tell the user what you documented, which commands you ran and their result, and anything you were unsure about (marked in the file with TODO(confirm): so it is easy to find). Do not commit unless asked.

Refreshing an existing AGENTS.md

Diff the file against the repo: commands that no longer exist, folders that moved, rules the code now breaks. Update in place, keep the author's wording where it is still correct, and list what you changed.

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

관련 스킬