# Generate Agents Md

> Generate a project-specific AGENTS.md draft from the current repository when the user asks to initialize, create, rewrite, or refine AGENTS.md for this repo. Use when the user wants only repo-specific instructions, not generic coding rules. This skill must inspect the current repository, extract its local conventions and boundaries, present a draft first, and wait for user confirmation before writing or overwriting AGENTS.md.

- Skill: `daqi/generate-agents-md` (Agent Skill)
- Install (CLI): `npx skillmds@latest add daqi/generate-agents-md`
- Raw SKILL.md: https://api.skillmd.com/api/skills/daqi/generate-agents-md/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: daqi (https://skillmd.com/u/daqi)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/daqi/generate-agents-md

---


# Generate AGENTS.md

This skill creates or revises `AGENTS.md` for the current repository.

Its scope is intentionally narrow:
- only use the current repository as the source of truth
- only write project-specific instructions
- do not add generic engineering rules unless the user explicitly asks for them
- present a draft first, then wait for confirmation before writing the file

## When to Use

Use this skill when the user asks for things like:
- "初始化 AGENTS.md"
- "创建 AGENTS.md"
- "根据当前项目写 AGENTS.md"
- "只写这个项目的特殊规则"
- "重写这个仓库的 AGENTS.md"

Do not use this skill for generic prompt-writing, global coding guidelines, or non-repository instruction files.

## Workflow

### 1. Inspect the current repository

Read the smallest set of files needed to understand the repo:
- top-level directory structure
- existing `AGENTS.md` if present
- project docs such as `README*`, schema files, docs indexes, config files, or representative content files

Prefer concrete repo evidence over assumptions. If the repo has clear structural boundaries, operating rules, or content conventions, extract those.

### 2. Derive only project-specific rules

Good project-specific rules usually include:
- what this repository is for
- which directories are inputs vs outputs
- what is read-only vs writable
- required file formats or schema constraints
- naming/frontmatter/linking conventions
- required companion updates when a certain file changes
- scope boundaries: what does not belong in this repo

Do not include generic rules such as:
- think before coding
- keep changes small
- write tests first
- be concise

Unless the user explicitly asks for those.

### 3. Present a draft before writing

Always show the proposed `AGENTS.md` content first.

Keep the explanation short:
- summarize the repo rules you extracted
- show the draft
- ask for confirmation

If an `AGENTS.md` already exists, explain whether you are proposing a patch, rewrite, or compression.

### 4. Wait for confirmation

Do not create or overwrite `AGENTS.md` until the user confirms.

If the user asks for changes, revise the draft and show it again.

### 5. Write the file after approval

Once approved:
- create or update `AGENTS.md`
- keep the file concise
- match the repo's actual structure and terminology

## Writing Guidelines

- Prefer short bullet points over long prose.
- Default to Chinese-simplified unless the user requests another language.
- Use the repository's actual directory names and file names.
- If the repo has a schema or contract file, cite it directly in the draft.
- If a rule is uncertain, say it is a suggestion instead of presenting it as a fact.
- If there are no meaningful project-specific rules, say so plainly instead of inventing content.

## Output Shape

Before approval, the response should look like:
1. one short paragraph explaining the extracted repo-specific boundaries
2. the proposed `AGENTS.md` draft
3. one short confirmation question

After approval, write the file and briefly summarize what was created or changed.

