create-agentsmd

作者: github

生成標準化的 AGENTS.md 檔案,協助 AI 編碼代理理解並操作您的儲存庫。提供範本驅動的方法來建立代理專用文件,補充 README.md 中的技術設定、工作流程與測試說明。涵蓋必要章節,包括專案概覽、設定指令、開發流程、測試、程式碼風格、建置/部署及 PR 指南。支援單一儲存庫結構,並提供在...建立 AGENTS.md 檔案的指引。

npx skills add https://github.com/github/awesome-copilot --skill create-agentsmd

Create high‑quality AGENTS.md file

You are a code agent. Your task is to create a complete, accurate AGENTS.md at the root of this repository that follows the public guidance at https://agents.md/.

AGENTS.md is an open format designed to provide coding agents with the context and instructions they need to work effectively on a project.

What is AGENTS.md?

AGENTS.md is a Markdown file that serves as a "README for agents" - a dedicated, predictable place to provide context and instructions to help AI coding agents work on your project. It complements README.md by containing detailed technical context that coding agents need but might clutter a human-focused README.

Key Principles

  • Agent-focused: Contains detailed technical instructions for automated tools
  • Complements README.md: Doesn't replace human documentation but adds agent-specific context
  • Standardized location: Placed at repository root (or subproject roots for monorepos)
  • Open format: Uses standard Markdown with flexible structure
  • Ecosystem compatibility: Works across 20+ different AI coding tools and agents

File Structure and Content Guidelines

1. Required Setup

  • Create the file as AGENTS.md in the repository root
  • Use standard Markdown formatting
  • No required fields - flexible structure based on project needs

2. Essential Sections to Include

Project Overview

  • Brief description of what the project does
  • Architecture overview if complex
  • Key technologies and frameworks used

Setup Commands

  • Installation instructions
  • Environment setup steps
  • Dependency management commands
  • Database setup if applicable

Development Workflow

  • How to start development server
  • Build commands
  • Watch/hot-reload setup
  • Package manager specifics (npm, pnpm, yarn, etc.)

Testing Instructions

  • How to run tests (unit, integration, e2e)
  • Test file locations and naming conventions
  • Coverage requirements
  • Specific test patterns or frameworks used
  • How to run subset of tests or focus on specific areas

Code Style Guidelines

  • Language-specific conventions
  • Linting and formatting rules
  • File organization patterns
  • Naming conventions
  • Import/export patterns

Build and Deployment

  • Build commands and outputs
  • Environment configurations
  • Deployment steps and requirements
  • CI/CD pipeline information

3. Optional but Recommended Sections

Security Considerations

  • Security testing requirements
  • Secrets management
  • Authentication patterns
  • Permission models

Monorepo Instructions (if applicable)

  • How to work with multiple packages
  • Cross-package dependencies
  • Selective building/testing
  • Package-specific commands

Pull Request Guidelines

  • Title format requirements
  • Required checks before submission
  • Review process
  • Commit message conventions

Debugging and Troubleshooting

  • Common issues and solutions
  • Logging patterns
  • Debug configuration
  • Performance considerations

Example Template

Use this as a starting template and customize based on the specific project:

# AGENTS.md

## Project Overview

[Brief description of the project, its purpose, and key technologies]

## Setup Commands

- Install dependencies: `[package manager] install`
- Start development server: `[command]`
- Build for production: `[command]`

## Development Workflow

- [Development server startup instructions]
- [Hot reload/watch mode information]
- [Environment variable setup]

## Testing Instructions

- Run all tests: `[command]`
- Run unit tests: `[command]`
- Run integration tests: `[command]`
- Test coverage: `[command]`
- [Specific testing patterns or requirements]

## Code Style

- [Language and framework conventions]
- [Linting rules and commands]
- [Formatting requirements]
- [File organization patterns]

## Build and Deployment

- [Build process details]
- [Output directories]
- [Environment-specific builds]
- [Deployment commands]

## Pull Request Guidelines

- Title format: [component] Brief description
- Required checks: `[lint command]`, `[test command]`
- [Review requirements]

## Additional Notes

- [Any project-specific context]
- [Common gotchas or troubleshooting tips]
- [Performance considerations]

Working Example from agents.md

Here's a real example from the agents.md website:

# Sample AGENTS.md file

## Dev environment tips

- Use `pnpm dlx turbo run where <project_name>` to jump to a package instead of scanning with `ls`.
- Run `pnpm install --filter <project_name>` to add the package to your workspace so Vite, ESLint, and TypeScript can see it.
- Use `pnpm create vite@latest <project_name> -- --template react-ts` to spin up a new React + Vite package with TypeScript checks ready.
- Check the name field inside each package's package.json to confirm the right name—skip the top-level one.

## Testing instructions

- Find the CI plan in the .github/workflows folder.
- Run `pnpm turbo run test --filter <project_name>` to run every check defined for that package.
- From the package root you can just call `pnpm test`. The commit should pass all tests before you merge.
- To focus on one step, add the Vitest pattern: `pnpm vitest run -t "<test name>"`.
- Fix any test or type errors until the whole suite is green.
- After moving files or changing imports, run `pnpm lint --filter <project_name>` to be sure ESLint and TypeScript rules still pass.
- Add or update tests for the code you change, even if nobody asked.

## PR instructions

- Title format: [<project_name>] <Title>
- Always run `pnpm lint` and `pnpm test` before committing.

Implementation Steps

  1. Analyze the project structure to understand:

    • Programming languages and frameworks used
    • Package managers and build tools
    • Testing frameworks
    • Project architecture (monorepo, single package, etc.)
  2. Identify key workflows by examining:

    • package.json scripts
    • Makefile or other build files
    • CI/CD configuration files
    • Documentation files
  3. Create comprehensive sections covering:

    • All essential setup and development commands
    • Testing strategies and commands
    • Code style and conventions
    • Build and deployment processes
  4. Include specific, actionable commands that agents can execute directly

  5. Test the instructions by ensuring all commands work as documented

  6. Keep it focused on what agents need to know, not general project information

Best Practices

  • Be specific: Include exact commands, not vague descriptions
  • Use code blocks: Wrap commands in backticks for clarity
  • Include context: Explain why certain steps are needed
  • Stay current: Update as the project evolves
  • Test commands: Ensure all listed commands actually work
  • Consider nested files: For monorepos, create AGENTS.md files in subprojects as needed

Monorepo Considerations

For large monorepos:

  • Place a main AGENTS.md at the repository root
  • Create additional AGENTS.md files in subproject directories
  • The closest AGENTS.md file takes precedence for any given location
  • Include navigation tips between packages/projects

Final Notes

  • AGENTS.md works with 20+ AI coding tools including Cursor, Aider, Gemini CLI, and many others
  • The format is intentionally flexible - adapt it to your project's needs
  • Focus on actionable instructions that help agents understand and work with your codebase
  • This is living documentation - update it as your project evolves

When creating the AGENTS.md file, prioritize clarity, completeness, and actionability. The goal is to give any coding agent enough context to effectively contribute to the project without requiring additional human guidance.

來自 github 的更多技能

console-rendering
github
在 Go 中使用基於結構體標籤的控制台渲染系統的說明
official
acquire-codebase-knowledge
github
當使用者明確要求對現有程式碼庫進行映射、文件化或入門引導時,使用此技能。觸發詞如「映射此程式碼庫」、「文件化…」等提示。
official
acreadiness-assess
github
Run the AgentRC readiness assessment on the current repository and produce a static HTML dashboard at reports/index.html. Wraps `npx github:microsoft/agentrc…
official
acreadiness-generate-instructions
github
透過 AgentRC 指令命令生成量身打造的 AI 代理指令檔案。產生 .github/copilot-instructions.md(預設,建議用於 VS Code 中的 Copilot…
official
acreadiness-policy
github
幫助使用者選取、撰寫或套用 AgentRC 政策。政策可透過停用不相關的檢查、覆寫影響/等級、設定…來自訂整備度評分。
official
add-educational-comments
github
為程式碼檔案添加教育性註解,將其轉化為有效的學習資源。根據三個可設定的知識層級(初學者、中級、進階)調整解釋深度與語氣。若未提供檔案,會自動請求提供,並以編號清單對應以便快速選取。僅透過教育性註解將檔案擴充最多125%(嚴格上限:400行新註解;超過1,000行的檔案上限為300行)。保留檔案編碼、縮排風格、語法正確性及……
official
adobe-illustrator-scripting
github
使用 ExtendScript (JavaScript/JSX) 編寫、除錯及最佳化 Adobe Illustrator 自動化腳本。適用於建立或修改操控…的腳本時。
official
agent-governance
github
宣告式政策、意圖分類與稽核軌跡,用於控制AI代理工具存取與行為。可組合的治理政策定義允許/封鎖的工具、內容過濾器、速率限制與核准要求——以配置而非程式碼形式儲存。語意意圖分類在工具執行前,透過基於模式的訊號偵測危險提示(資料外洩、權限提升、提示注入)。工具層級治理裝飾器在函式層級強制執行政策……
official