Skip to content

Commit 0dac62b

Browse files
authored
Add agents.md creation prompt (#218)
* Add agents.md creation prompt * Refine description and clean up
1 parent a772e15 commit 0dac62b

File tree

2 files changed

+250
-0
lines changed

2 files changed

+250
-0
lines changed

README.prompts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Ready-to-use prompt templates for specific development scenarios and tasks, defi
3232
| [ASP.NET .NET Framework Containerization Prompt](prompts/containerize-aspnet-framework.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcontainerize-aspnet-framework.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcontainerize-aspnet-framework.prompt.md) | Containerize an ASP.NET .NET Framework project by creating Dockerfile and .dockerfile files customized for the project. |
3333
| [ASP.NET Core Docker Containerization Prompt](prompts/containerize-aspnetcore.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcontainerize-aspnetcore.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcontainerize-aspnetcore.prompt.md) | Containerize an ASP.NET Core project by creating Dockerfile and .dockerfile files customized for the project. |
3434
| [Copilot Instructions Blueprint Generator](prompts/copilot-instructions-blueprint-generator.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcopilot-instructions-blueprint-generator.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcopilot-instructions-blueprint-generator.prompt.md) | Technology-agnostic blueprint generator for creating comprehensive copilot-instructions.md files that guide GitHub Copilot to produce code consistent with project standards, architecture patterns, and exact technology versions by analyzing existing codebase patterns and avoiding assumptions. |
35+
| [Create high‑quality AGENTS.md file](prompts/create-agentsmd.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcreate-agentsmd.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcreate-agentsmd.prompt.md) | Prompt for generating an AGENTS.md file for a repository |
3536
| [Create Architectural Decision Record](prompts/create-architectural-decision-record.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcreate-architectural-decision-record.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcreate-architectural-decision-record.prompt.md) | Create an Architectural Decision Record (ADR) document for AI-optimized decision documentation. |
3637
| [Create GitHub Actions Workflow Specification](prompts/create-github-action-workflow-specification.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcreate-github-action-workflow-specification.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcreate-github-action-workflow-specification.prompt.md) | Create a formal specification for an existing GitHub Actions CI/CD workflow, optimized for AI consumption and workflow maintenance. |
3738
| [Create GitHub Issue from Specification](prompts/create-github-issue-feature-from-specification.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcreate-github-issue-feature-from-specification.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcreate-github-issue-feature-from-specification.prompt.md) | Create GitHub Issue for feature request from specification file using feature_request.yml template. |

prompts/create-agentsmd.prompt.md

Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
---
2+
description: "Prompt for generating an AGENTS.md file for a repository"
3+
mode: "agent"
4+
---
5+
6+
# Create high‑quality AGENTS.md file
7+
8+
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/.
9+
10+
AGENTS.md is an open format designed to provide coding agents with the context and instructions they need to work effectively on a project.
11+
12+
## What is AGENTS.md?
13+
14+
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.
15+
16+
## Key Principles
17+
18+
- **Agent-focused**: Contains detailed technical instructions for automated tools
19+
- **Complements README.md**: Doesn't replace human documentation but adds agent-specific context
20+
- **Standardized location**: Placed at repository root (or subproject roots for monorepos)
21+
- **Open format**: Uses standard Markdown with flexible structure
22+
- **Ecosystem compatibility**: Works across 20+ different AI coding tools and agents
23+
24+
## File Structure and Content Guidelines
25+
26+
### 1. Required Setup
27+
28+
- Create the file as `AGENTS.md` in the repository root
29+
- Use standard Markdown formatting
30+
- No required fields - flexible structure based on project needs
31+
32+
### 2. Essential Sections to Include
33+
34+
#### Project Overview
35+
36+
- Brief description of what the project does
37+
- Architecture overview if complex
38+
- Key technologies and frameworks used
39+
40+
#### Setup Commands
41+
42+
- Installation instructions
43+
- Environment setup steps
44+
- Dependency management commands
45+
- Database setup if applicable
46+
47+
#### Development Workflow
48+
49+
- How to start development server
50+
- Build commands
51+
- Watch/hot-reload setup
52+
- Package manager specifics (npm, pnpm, yarn, etc.)
53+
54+
#### Testing Instructions
55+
56+
- How to run tests (unit, integration, e2e)
57+
- Test file locations and naming conventions
58+
- Coverage requirements
59+
- Specific test patterns or frameworks used
60+
- How to run subset of tests or focus on specific areas
61+
62+
#### Code Style Guidelines
63+
64+
- Language-specific conventions
65+
- Linting and formatting rules
66+
- File organization patterns
67+
- Naming conventions
68+
- Import/export patterns
69+
70+
#### Build and Deployment
71+
72+
- Build commands and outputs
73+
- Environment configurations
74+
- Deployment steps and requirements
75+
- CI/CD pipeline information
76+
77+
### 3. Optional but Recommended Sections
78+
79+
#### Security Considerations
80+
81+
- Security testing requirements
82+
- Secrets management
83+
- Authentication patterns
84+
- Permission models
85+
86+
#### Monorepo Instructions (if applicable)
87+
88+
- How to work with multiple packages
89+
- Cross-package dependencies
90+
- Selective building/testing
91+
- Package-specific commands
92+
93+
#### Pull Request Guidelines
94+
95+
- Title format requirements
96+
- Required checks before submission
97+
- Review process
98+
- Commit message conventions
99+
100+
#### Debugging and Troubleshooting
101+
102+
- Common issues and solutions
103+
- Logging patterns
104+
- Debug configuration
105+
- Performance considerations
106+
107+
## Example Template
108+
109+
Use this as a starting template and customize based on the specific project:
110+
111+
```markdown
112+
# AGENTS.md
113+
114+
## Project Overview
115+
116+
[Brief description of the project, its purpose, and key technologies]
117+
118+
## Setup Commands
119+
120+
- Install dependencies: `[package manager] install`
121+
- Start development server: `[command]`
122+
- Build for production: `[command]`
123+
124+
## Development Workflow
125+
126+
- [Development server startup instructions]
127+
- [Hot reload/watch mode information]
128+
- [Environment variable setup]
129+
130+
## Testing Instructions
131+
132+
- Run all tests: `[command]`
133+
- Run unit tests: `[command]`
134+
- Run integration tests: `[command]`
135+
- Test coverage: `[command]`
136+
- [Specific testing patterns or requirements]
137+
138+
## Code Style
139+
140+
- [Language and framework conventions]
141+
- [Linting rules and commands]
142+
- [Formatting requirements]
143+
- [File organization patterns]
144+
145+
## Build and Deployment
146+
147+
- [Build process details]
148+
- [Output directories]
149+
- [Environment-specific builds]
150+
- [Deployment commands]
151+
152+
## Pull Request Guidelines
153+
154+
- Title format: [component] Brief description
155+
- Required checks: `[lint command]`, `[test command]`
156+
- [Review requirements]
157+
158+
## Additional Notes
159+
160+
- [Any project-specific context]
161+
- [Common gotchas or troubleshooting tips]
162+
- [Performance considerations]
163+
```
164+
165+
## Working Example from agents.md
166+
167+
Here's a real example from the agents.md website:
168+
169+
```markdown
170+
# Sample AGENTS.md file
171+
172+
## Dev environment tips
173+
174+
- Use `pnpm dlx turbo run where <project_name>` to jump to a package instead of scanning with `ls`.
175+
- Run `pnpm install --filter <project_name>` to add the package to your workspace so Vite, ESLint, and TypeScript can see it.
176+
- Use `pnpm create vite@latest <project_name> -- --template react-ts` to spin up a new React + Vite package with TypeScript checks ready.
177+
- Check the name field inside each package's package.json to confirm the right name—skip the top-level one.
178+
179+
## Testing instructions
180+
181+
- Find the CI plan in the .github/workflows folder.
182+
- Run `pnpm turbo run test --filter <project_name>` to run every check defined for that package.
183+
- From the package root you can just call `pnpm test`. The commit should pass all tests before you merge.
184+
- To focus on one step, add the Vitest pattern: `pnpm vitest run -t "<test name>"`.
185+
- Fix any test or type errors until the whole suite is green.
186+
- After moving files or changing imports, run `pnpm lint --filter <project_name>` to be sure ESLint and TypeScript rules still pass.
187+
- Add or update tests for the code you change, even if nobody asked.
188+
189+
## PR instructions
190+
191+
- Title format: [<project_name>] <Title>
192+
- Always run `pnpm lint` and `pnpm test` before committing.
193+
```
194+
195+
## Implementation Steps
196+
197+
1. **Analyze the project structure** to understand:
198+
199+
- Programming languages and frameworks used
200+
- Package managers and build tools
201+
- Testing frameworks
202+
- Project architecture (monorepo, single package, etc.)
203+
204+
2. **Identify key workflows** by examining:
205+
206+
- package.json scripts
207+
- Makefile or other build files
208+
- CI/CD configuration files
209+
- Documentation files
210+
211+
3. **Create comprehensive sections** covering:
212+
213+
- All essential setup and development commands
214+
- Testing strategies and commands
215+
- Code style and conventions
216+
- Build and deployment processes
217+
218+
4. **Include specific, actionable commands** that agents can execute directly
219+
220+
5. **Test the instructions** by ensuring all commands work as documented
221+
222+
6. **Keep it focused** on what agents need to know, not general project information
223+
224+
## Best Practices
225+
226+
- **Be specific**: Include exact commands, not vague descriptions
227+
- **Use code blocks**: Wrap commands in backticks for clarity
228+
- **Include context**: Explain why certain steps are needed
229+
- **Stay current**: Update as the project evolves
230+
- **Test commands**: Ensure all listed commands actually work
231+
- **Consider nested files**: For monorepos, create AGENTS.md files in subprojects as needed
232+
233+
## Monorepo Considerations
234+
235+
For large monorepos:
236+
237+
- Place a main AGENTS.md at the repository root
238+
- Create additional AGENTS.md files in subproject directories
239+
- The closest AGENTS.md file takes precedence for any given location
240+
- Include navigation tips between packages/projects
241+
242+
## Final Notes
243+
244+
- AGENTS.md works with 20+ AI coding tools including Cursor, Aider, Gemini CLI, and many others
245+
- The format is intentionally flexible - adapt it to your project's needs
246+
- Focus on actionable instructions that help agents understand and work with your codebase
247+
- This is living documentation - update it as your project evolves
248+
249+
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.

0 commit comments

Comments
 (0)