@dedesfr/prompter 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/cli/index.js +1 -1
- package/package.json +1 -1
- package/skills/agents-md-generator/SKILL.md +238 -0
- package/skills/agents-md-generator/assets/agents-md-template.md +81 -0
- package/skills/agents-md-generator/references/best-practices.md +215 -0
- package/skills/code-review/SKILL.md +373 -0
- package/skills/code-review/assets/report-template-agent.md +212 -0
- package/skills/code-review/assets/report-template-compact.md +81 -0
- package/skills/code-review/assets/report-template-full.md +264 -0
- package/skills/code-review/assets/report-template-human.md +168 -0
- package/skills/code-review/references/universal-patterns.md +495 -0
- package/skills/meeting-notes/SKILL.md +159 -0
- package/skills/meeting-notes/evals/evals.json +23 -0
- package/skills/project-orchestrator/SKILL.md +394 -0
- package/skills/project-orchestrator/assets/plan-summary-template.md +123 -0
- package/skills/prompter-specs/SKILL.md +115 -0
- package/skills/ui-ux-pro/SKILL.md +348 -0
- package/skills/ui-ux-pro/assets/design-spec-template.md +173 -0
- package/skills/ui-ux-pro/references/component-patterns.md +255 -0
- package/skills/ui-ux-pro/references/design-principles.md +167 -0
- package/src/cli/index.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## [0.8.1] - 2026-03-30
|
|
4
|
+
|
|
5
|
+
### ✨ Added
|
|
6
|
+
- **agents-md-generator Skill**: Generate or update `AGENTS.md` files in any project
|
|
7
|
+
- Analyzes project structure, tech stack, and conventions to create comprehensive AI agent context
|
|
8
|
+
- Automatic discovery from package manifests, config files, CI/CD pipelines, and existing docs
|
|
9
|
+
- Interactive interview mode to fill gaps in project understanding
|
|
10
|
+
- Template-based generation with 18 optional sections for maximum flexibility
|
|
11
|
+
- Support for monorepo projects with nested AGENTS.md files
|
|
12
|
+
- **code-review Skill**: Automated code review with multiple report formats
|
|
13
|
+
- Analyzes code for bugs, performance issues, security concerns, and best practices
|
|
14
|
+
- Generates review reports in agent, compact, full, and human-friendly formats
|
|
15
|
+
- Leverages universal patterns from 2,500+ repositories for consistent quality standards
|
|
16
|
+
- **meeting-notes Skill**: Transcribe, summarize, and organize meeting notes
|
|
17
|
+
- Captures action items, decisions, and key discussions
|
|
18
|
+
- Structures notes for easy reference and follow-up
|
|
19
|
+
- Includes evaluation framework for meeting effectiveness
|
|
20
|
+
- **project-orchestrator Skill**: Plan and coordinate multi-step project initiatives
|
|
21
|
+
- Breaks down complex projects into manageable tasks and phases
|
|
22
|
+
- Generates structured project plans with dependencies and timelines
|
|
23
|
+
- Provides summaries for stakeholder communication
|
|
24
|
+
- **prompter-specs Skill**: Create and manage change proposals using the Prompter specification format
|
|
25
|
+
- Guides creation of formal specs for planning, proposals, and breaking changes
|
|
26
|
+
- Ensures consistency with project architecture and guidelines
|
|
27
|
+
- **ui-ux-pro Skill**: Design and improve user interfaces with professional standards
|
|
28
|
+
- Comprehensive design specification generation based on requirements
|
|
29
|
+
- Component pattern library aligned with modern design principles
|
|
30
|
+
- Best practices for accessibility, responsiveness, and design systems
|
|
31
|
+
|
|
3
32
|
## [0.8.0] - 2026-03-29
|
|
4
33
|
|
|
5
34
|
### ✨ Added
|
package/dist/cli/index.js
CHANGED
|
@@ -16,7 +16,7 @@ const program = new Command();
|
|
|
16
16
|
program
|
|
17
17
|
.name('prompter')
|
|
18
18
|
.description('Enhance prompts directly in your AI coding workflow')
|
|
19
|
-
.version('0.8.
|
|
19
|
+
.version('0.8.1');
|
|
20
20
|
program
|
|
21
21
|
.command('init')
|
|
22
22
|
.description('Initialize Prompter in your project')
|
package/package.json
CHANGED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agents-md-generator
|
|
3
|
+
description: Generate or update an AGENTS.md file in any project's root directory. Creates a comprehensive, well-structured AGENTS.md following industry best practices from analysis of 2,500+ repositories. Works from existing project docs (README, package.json, config files), codebase analysis, or direct user input. Use this skill whenever the user wants to create an AGENTS.md, update an existing one, improve AI agent instructions for a project, or mentions setting up agent context for any codebase. Also trigger when users mention wanting better AI coding assistant results, agent configuration, or project onboarding for AI tools.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AGENTS.md Generator
|
|
7
|
+
|
|
8
|
+
Generate or update a project's AGENTS.md file — the standard open-format file that gives AI coding agents the context they need to work effectively in a codebase.
|
|
9
|
+
|
|
10
|
+
## Why AGENTS.md matters
|
|
11
|
+
|
|
12
|
+
AGENTS.md is the "README for AI agents." Unlike README files written for humans, AGENTS.md provides the specific, structured context that AI coding agents need: exact commands with flags, concrete code examples, clear boundaries on what to never touch, and project-specific conventions that aren't obvious from the code alone. A well-written AGENTS.md dramatically improves the quality of AI-generated code by reducing hallucinated endpoints, mismatched coding styles, and violations of project constraints.
|
|
13
|
+
|
|
14
|
+
## Step 0: Determine Mode
|
|
15
|
+
|
|
16
|
+
Present these options to the user:
|
|
17
|
+
|
|
18
|
+
**What would you like to do?**
|
|
19
|
+
|
|
20
|
+
1. **Generate new AGENTS.md** — Create from scratch by analyzing the project
|
|
21
|
+
2. **Update existing AGENTS.md** — Improve or add sections to an existing file
|
|
22
|
+
3. **Generate from docs** — Build AGENTS.md from existing documentation (README, wiki, docs/)
|
|
23
|
+
|
|
24
|
+
Wait for the user's selection before proceeding.
|
|
25
|
+
|
|
26
|
+
## Step 1: Gather Project Context
|
|
27
|
+
|
|
28
|
+
The quality of the AGENTS.md depends entirely on understanding the project. Collect context from these sources, in priority order:
|
|
29
|
+
|
|
30
|
+
### 1.1 Automatic Discovery (always do this)
|
|
31
|
+
|
|
32
|
+
Scan the project root for context signals:
|
|
33
|
+
|
|
34
|
+
- **Package manifest**: `package.json`, `Cargo.toml`, `pyproject.toml`, `go.mod`, `composer.json`, `Gemfile`, `pom.xml`, `build.gradle`
|
|
35
|
+
- **Config files**: `tsconfig.json`, `.eslintrc*`, `.prettierrc*`, `tailwind.config.*`, `vite.config.*`, `webpack.config.*`, `docker-compose.yml`
|
|
36
|
+
- **CI/CD**: `.github/workflows/`, `.gitlab-ci.yml`, `Jenkinsfile`
|
|
37
|
+
- **Existing docs**: `README.md`, `CONTRIBUTING.md`, `docs/`, `wiki/`
|
|
38
|
+
- **Existing AI config**: `CLAUDE.md`, `.cursorrules`, `.github/copilot-instructions.md`, `.windsurfrules`
|
|
39
|
+
- **Test setup**: test directories, test config files, test scripts in package manifest
|
|
40
|
+
- **Git history**: recent commit patterns, active contributors
|
|
41
|
+
|
|
42
|
+
Read these files to extract:
|
|
43
|
+
- Tech stack and versions
|
|
44
|
+
- Build/test/lint commands
|
|
45
|
+
- Project structure patterns
|
|
46
|
+
- Coding conventions
|
|
47
|
+
- Architecture decisions
|
|
48
|
+
|
|
49
|
+
### 1.2 User-Provided Docs (if mode is "Generate from docs")
|
|
50
|
+
|
|
51
|
+
Ask the user to point to their documentation:
|
|
52
|
+
- "Which docs should I use as source material? (paths, URLs, or paste content directly)"
|
|
53
|
+
|
|
54
|
+
Read and synthesize the provided documentation into AGENTS.md sections.
|
|
55
|
+
|
|
56
|
+
### 1.3 Interactive Interview (fill gaps)
|
|
57
|
+
|
|
58
|
+
After automatic discovery, identify what's still missing and ask the user targeted questions. Don't ask about things you already know from the codebase. Focus on:
|
|
59
|
+
|
|
60
|
+
- **Project purpose**: What does this project do? (if not clear from README)
|
|
61
|
+
- **Architecture decisions**: Any non-obvious patterns or constraints?
|
|
62
|
+
- **Boundaries**: What should AI agents never touch? (secrets, vendor dirs, generated files, production configs)
|
|
63
|
+
- **Domain vocabulary**: Any project-specific terms agents need to know?
|
|
64
|
+
- **Common pitfalls**: What mistakes do new contributors (or AI agents) commonly make?
|
|
65
|
+
- **Testing requirements**: Any specific testing patterns or requirements?
|
|
66
|
+
|
|
67
|
+
Keep the interview short — 3-5 questions max, focused on what you genuinely couldn't determine from the code.
|
|
68
|
+
|
|
69
|
+
## Step 2: Structure the AGENTS.md
|
|
70
|
+
|
|
71
|
+
Use the template at `assets/agents-md-template.md` as a starting point. The template has 18 sections — not all are required for every project. Include a section only if you have substantive content for it. An empty or placeholder section ("Not specified") is worse than omitting it entirely.
|
|
72
|
+
|
|
73
|
+
### Section Priority
|
|
74
|
+
|
|
75
|
+
**Always include** (these are the highest-value sections based on empirical analysis):
|
|
76
|
+
1. **Project Summary** — What this project does, in 2-3 sentences
|
|
77
|
+
2. **Tech Stack** — Languages, frameworks, runtime versions
|
|
78
|
+
3. **Commands** — Build, test, lint, deploy commands with exact flags
|
|
79
|
+
4. **Folder Structure** — Key directories and their purposes
|
|
80
|
+
5. **Coding Conventions** — Real code examples, not verbal descriptions
|
|
81
|
+
6. **Development Rules for AI Agents** — Boundaries and constraints
|
|
82
|
+
|
|
83
|
+
**Include when relevant:**
|
|
84
|
+
7. **Architecture Overview** — Module structure, data flow
|
|
85
|
+
8. **Core Business Logic** — Domain rules that aren't obvious from code
|
|
86
|
+
9. **Data Models** — Key entities and relationships
|
|
87
|
+
10. **Domain Vocabulary** — Project-specific terms
|
|
88
|
+
11. **Security/Privacy Rules** — Auth flows, sensitive data handling
|
|
89
|
+
12. **Testing Strategy** — Frameworks, patterns, coverage expectations
|
|
90
|
+
13. **Integration Map** — External services, APIs, third-party tools
|
|
91
|
+
|
|
92
|
+
**Include only if substantive:**
|
|
93
|
+
14. **Target Users** — Who uses this and how
|
|
94
|
+
15. **UI/UX Principles** — Design patterns and constraints
|
|
95
|
+
16. **Roadmap** — Active initiatives
|
|
96
|
+
17. **Known Issues** — Current limitations
|
|
97
|
+
18. **Troubleshooting** — Common problems and fixes
|
|
98
|
+
19. **Ownership Map** — Who owns what
|
|
99
|
+
|
|
100
|
+
### Writing Guidelines
|
|
101
|
+
|
|
102
|
+
Follow these principles — they come from analysis of what actually makes AGENTS.md effective:
|
|
103
|
+
|
|
104
|
+
**Be specific, not vague.**
|
|
105
|
+
```markdown
|
|
106
|
+
# Bad
|
|
107
|
+
- Use TypeScript
|
|
108
|
+
- Follow best practices
|
|
109
|
+
|
|
110
|
+
# Good
|
|
111
|
+
- TypeScript 5.4 with strict mode enabled
|
|
112
|
+
- ESM imports with explicit `.js` extensions in compiled output
|
|
113
|
+
- Prefer `interface` over `type` for object shapes
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Lead with executable commands.**
|
|
117
|
+
```markdown
|
|
118
|
+
# Commands
|
|
119
|
+
npm run build # Compile TypeScript to dist/
|
|
120
|
+
npm test # Run vitest test suite
|
|
121
|
+
npm run lint # ESLint with --fix
|
|
122
|
+
npm run typecheck # tsc --noEmit
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Show code examples for conventions.**
|
|
126
|
+
```markdown
|
|
127
|
+
# Component pattern
|
|
128
|
+
export function UserCard({ user }: { user: User }) {
|
|
129
|
+
// Components use named exports, PascalCase
|
|
130
|
+
// Props defined inline for simple cases
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Use three-tier boundaries.**
|
|
135
|
+
```markdown
|
|
136
|
+
## Development Rules for AI Agents
|
|
137
|
+
### Always do:
|
|
138
|
+
- Run `npm run typecheck` before committing
|
|
139
|
+
- Use existing utility functions from `src/utils/`
|
|
140
|
+
|
|
141
|
+
### Ask first:
|
|
142
|
+
- Adding new dependencies
|
|
143
|
+
- Modifying database schemas
|
|
144
|
+
- Changes to CI/CD pipelines
|
|
145
|
+
|
|
146
|
+
### Never do:
|
|
147
|
+
- Commit `.env` files or secrets
|
|
148
|
+
- Modify `vendor/` or generated files
|
|
149
|
+
- Run destructive database commands
|
|
150
|
+
- Invent API endpoints that don't exist
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Include file-scoped commands** for common per-file operations:
|
|
154
|
+
```markdown
|
|
155
|
+
# File-scoped commands
|
|
156
|
+
npx vitest run src/utils/parse.test.ts # Run single test file
|
|
157
|
+
npx eslint --fix src/components/Card.tsx # Lint single file
|
|
158
|
+
npx tsc --noEmit src/types.ts # Type-check single file
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Step 3: Generate or Update
|
|
162
|
+
|
|
163
|
+
### For new AGENTS.md (Mode 1 or 3)
|
|
164
|
+
|
|
165
|
+
1. Read the template from `assets/agents-md-template.md`
|
|
166
|
+
2. Fill in each section with discovered and user-provided content
|
|
167
|
+
3. Remove sections that have no substantive content
|
|
168
|
+
4. Write to `AGENTS.md` in the project root
|
|
169
|
+
|
|
170
|
+
### For updating existing AGENTS.md (Mode 2)
|
|
171
|
+
|
|
172
|
+
1. Read the existing `AGENTS.md`
|
|
173
|
+
2. Identify which sections exist and their quality
|
|
174
|
+
3. Ask the user what they want to improve:
|
|
175
|
+
- "Add missing sections"
|
|
176
|
+
- "Update outdated information"
|
|
177
|
+
- "Improve specific sections" (let them pick)
|
|
178
|
+
- "Full refresh" (regenerate while preserving custom content)
|
|
179
|
+
4. Make targeted updates, preserving any custom content the user has added
|
|
180
|
+
5. If the file has managed markers (like `<!-- PROMPTER:START -->`), preserve those sections untouched
|
|
181
|
+
|
|
182
|
+
### Monorepo Support
|
|
183
|
+
|
|
184
|
+
For monorepos or multi-package projects, offer to create nested AGENTS.md files:
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
project-root/
|
|
188
|
+
├── AGENTS.md # Project-wide context
|
|
189
|
+
├── packages/
|
|
190
|
+
│ ├── frontend/
|
|
191
|
+
│ │ └── AGENTS.md # Frontend-specific context
|
|
192
|
+
│ └── backend/
|
|
193
|
+
│ └── AGENTS.md # Backend-specific context
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The root AGENTS.md should reference subdirectory files and provide shared context. Subdirectory files should focus on package-specific details.
|
|
197
|
+
|
|
198
|
+
## Step 4: Validate and Review
|
|
199
|
+
|
|
200
|
+
Before finalizing, check:
|
|
201
|
+
|
|
202
|
+
- [ ] No placeholder text remains ("Not specified", "TODO", "TBD")
|
|
203
|
+
- [ ] Commands are accurate and runnable
|
|
204
|
+
- [ ] File paths referenced actually exist in the project
|
|
205
|
+
- [ ] Tech stack versions match what's in config files
|
|
206
|
+
- [ ] No sensitive information included (API keys, internal URLs, credentials)
|
|
207
|
+
- [ ] Sections are ordered by value (most useful first)
|
|
208
|
+
- [ ] Code examples match the project's actual coding style
|
|
209
|
+
|
|
210
|
+
Present a summary to the user:
|
|
211
|
+
- Which sections were generated
|
|
212
|
+
- Any sections skipped (and why)
|
|
213
|
+
- Suggestions for sections they could add later
|
|
214
|
+
|
|
215
|
+
## Step 5: Save
|
|
216
|
+
|
|
217
|
+
Save the AGENTS.md to the project root path (or the path the user specifies).
|
|
218
|
+
|
|
219
|
+
Print a summary:
|
|
220
|
+
```
|
|
221
|
+
AGENTS.md generated at <path>
|
|
222
|
+
Sections: <count> of 18
|
|
223
|
+
Sources used: <list of files analyzed>
|
|
224
|
+
Suggested improvements: <any sections that could be enhanced with more info>
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Edge Cases
|
|
228
|
+
|
|
229
|
+
- **No package manifest found**: Ask the user about the tech stack directly
|
|
230
|
+
- **Multiple languages**: Create sections for each, clearly labeled
|
|
231
|
+
- **Existing CLAUDE.md / .cursorrules**: Offer to consolidate into AGENTS.md (which is the cross-tool standard) or keep both
|
|
232
|
+
- **Very large project**: Focus on the most important directories and patterns rather than trying to document everything
|
|
233
|
+
- **No README**: The interview step becomes more important — ask more questions
|
|
234
|
+
|
|
235
|
+
## Resources
|
|
236
|
+
|
|
237
|
+
- Template: `assets/agents-md-template.md`
|
|
238
|
+
- Best practices reference: `references/best-practices.md`
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# AGENTS — Project Knowledge Base
|
|
2
|
+
|
|
3
|
+
## 1. Project Summary
|
|
4
|
+
{{PROJECT_SUMMARY}}
|
|
5
|
+
|
|
6
|
+
## 2. Tech Stack
|
|
7
|
+
{{TECH_STACK}}
|
|
8
|
+
|
|
9
|
+
## 3. Architecture Overview
|
|
10
|
+
{{ARCHITECTURE_OVERVIEW}}
|
|
11
|
+
|
|
12
|
+
## 4. Folder Structure & Important Files
|
|
13
|
+
{{FOLDER_STRUCTURE}}
|
|
14
|
+
|
|
15
|
+
## 5. Commands
|
|
16
|
+
```bash
|
|
17
|
+
# Build
|
|
18
|
+
{{BUILD_COMMAND}}
|
|
19
|
+
|
|
20
|
+
# Test
|
|
21
|
+
{{TEST_COMMAND}}
|
|
22
|
+
|
|
23
|
+
# Lint / Format
|
|
24
|
+
{{LINT_COMMAND}}
|
|
25
|
+
|
|
26
|
+
# Type check
|
|
27
|
+
{{TYPECHECK_COMMAND}}
|
|
28
|
+
|
|
29
|
+
# File-scoped commands
|
|
30
|
+
{{FILE_SCOPED_COMMANDS}}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 6. Core Business Logic & Domain Rules
|
|
34
|
+
{{BUSINESS_LOGIC}}
|
|
35
|
+
|
|
36
|
+
## 7. Data Models / Entities
|
|
37
|
+
{{DATA_MODELS}}
|
|
38
|
+
|
|
39
|
+
## 8. Domain Vocabulary / Glossary
|
|
40
|
+
{{DOMAIN_VOCABULARY}}
|
|
41
|
+
|
|
42
|
+
## 9. Target Users & Personas
|
|
43
|
+
{{TARGET_USERS}}
|
|
44
|
+
|
|
45
|
+
## 10. UI/UX Principles
|
|
46
|
+
{{UI_UX_PRINCIPLES}}
|
|
47
|
+
|
|
48
|
+
## 11. Security / Privacy Rules
|
|
49
|
+
{{SECURITY_RULES}}
|
|
50
|
+
|
|
51
|
+
## 12. Coding Conventions & Standards
|
|
52
|
+
{{CODING_CONVENTIONS}}
|
|
53
|
+
|
|
54
|
+
## 13. Development Rules for AI Agents
|
|
55
|
+
|
|
56
|
+
### Always do:
|
|
57
|
+
{{ALWAYS_DO_RULES}}
|
|
58
|
+
|
|
59
|
+
### Ask first:
|
|
60
|
+
{{ASK_FIRST_RULES}}
|
|
61
|
+
|
|
62
|
+
### Never do:
|
|
63
|
+
{{NEVER_DO_RULES}}
|
|
64
|
+
|
|
65
|
+
## 14. Integration Map
|
|
66
|
+
{{INTEGRATION_MAP}}
|
|
67
|
+
|
|
68
|
+
## 15. Testing Strategy
|
|
69
|
+
{{TESTING_STRATEGY}}
|
|
70
|
+
|
|
71
|
+
## 16. Roadmap & Future Plans
|
|
72
|
+
{{ROADMAP}}
|
|
73
|
+
|
|
74
|
+
## 17. Known Issues / Limitations
|
|
75
|
+
{{KNOWN_ISSUES}}
|
|
76
|
+
|
|
77
|
+
## 18. Troubleshooting Guide
|
|
78
|
+
{{TROUBLESHOOTING}}
|
|
79
|
+
|
|
80
|
+
## 19. Ownership / Responsibility Map
|
|
81
|
+
{{OWNERSHIP_MAP}}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# AGENTS.md Best Practices Reference
|
|
2
|
+
|
|
3
|
+
Compiled from analysis of 2,500+ repositories and official documentation from GitHub, GitLab, Windsurf, and the agents.md specification.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
1. [Six Essential Areas](#six-essential-areas)
|
|
8
|
+
2. [Writing Principles](#writing-principles)
|
|
9
|
+
3. [Common Anti-Patterns](#common-anti-patterns)
|
|
10
|
+
4. [Monorepo Patterns](#monorepo-patterns)
|
|
11
|
+
5. [Cross-Tool Compatibility](#cross-tool-compatibility)
|
|
12
|
+
6. [Section-Specific Guidance](#section-specific-guidance)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Six Essential Areas
|
|
17
|
+
|
|
18
|
+
The highest-impact sections, based on empirical analysis of what actually improves AI agent output:
|
|
19
|
+
|
|
20
|
+
| Area | Why It Matters | Example |
|
|
21
|
+
|------|---------------|---------|
|
|
22
|
+
| **Commands** | Agents need exact executable commands, not descriptions | `npm test -- --watch` not "run the tests" |
|
|
23
|
+
| **Testing** | Framework-specific practices prevent wrong test patterns | `vitest` vs `jest` syntax differences |
|
|
24
|
+
| **Project Structure** | Agents need exact file locations, not guesses | `src/api/routes/` not "the API folder" |
|
|
25
|
+
| **Code Style** | Real examples prevent style drift | Show actual component code |
|
|
26
|
+
| **Git Workflow** | Prevents wrong branching, commit, and PR patterns | `feat/`, `fix/` branch prefixes |
|
|
27
|
+
| **Boundaries** | Clear "never do" rules prevent the worst mistakes | Never commit `.env`, never modify `vendor/` |
|
|
28
|
+
|
|
29
|
+
## Writing Principles
|
|
30
|
+
|
|
31
|
+
### Specificity Over Generality
|
|
32
|
+
|
|
33
|
+
The #1 predictor of AGENTS.md effectiveness is specificity. Vague instructions get vague results.
|
|
34
|
+
|
|
35
|
+
**Versions matter:**
|
|
36
|
+
```markdown
|
|
37
|
+
# Vague
|
|
38
|
+
- Uses React and TypeScript
|
|
39
|
+
|
|
40
|
+
# Specific
|
|
41
|
+
- React 18.3 with TypeScript 5.4
|
|
42
|
+
- Node.js >= 20 (uses native fetch)
|
|
43
|
+
- Tailwind CSS 3.4 with custom design tokens in tailwind.config.ts
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Commands must be copy-pasteable:**
|
|
47
|
+
```markdown
|
|
48
|
+
# Vague
|
|
49
|
+
- Run the tests before committing
|
|
50
|
+
|
|
51
|
+
# Specific
|
|
52
|
+
- npm test # Full test suite
|
|
53
|
+
- npx vitest run src/utils/parse.test.ts # Single test file
|
|
54
|
+
- npx vitest --reporter=verbose # Detailed output
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Show, Don't Tell
|
|
58
|
+
|
|
59
|
+
Real code examples are 3-5x more effective than verbal descriptions for coding conventions.
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
# Verbal (less effective)
|
|
63
|
+
- Use functional components with TypeScript props
|
|
64
|
+
|
|
65
|
+
# Example (more effective)
|
|
66
|
+
## Component Pattern
|
|
67
|
+
export function UserCard({ user, onSelect }: UserCardProps) {
|
|
68
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
69
|
+
// Named exports, PascalCase, destructured props
|
|
70
|
+
// State hooks at top, handlers below
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Three-Tier Boundaries
|
|
75
|
+
|
|
76
|
+
The most impactful part of any AGENTS.md. Structure as:
|
|
77
|
+
|
|
78
|
+
1. **Always do** — Required behaviors (run typecheck, use existing utils)
|
|
79
|
+
2. **Ask first** — Needs human approval (new deps, schema changes, CI changes)
|
|
80
|
+
3. **Never do** — Absolute prohibitions (commit secrets, modify generated files, invent APIs)
|
|
81
|
+
|
|
82
|
+
"Never commit secrets" was identified as the single most helpful boundary rule across all analyzed repositories.
|
|
83
|
+
|
|
84
|
+
### Progressive Disclosure
|
|
85
|
+
|
|
86
|
+
Don't dump everything upfront. Structure information so agents encounter what they need when they need it:
|
|
87
|
+
|
|
88
|
+
- Put the most frequently needed info (commands, structure) at the top
|
|
89
|
+
- Put specialized info (troubleshooting, edge cases) at the bottom
|
|
90
|
+
- For complex topics, link to separate docs rather than inlining everything
|
|
91
|
+
|
|
92
|
+
## Common Anti-Patterns
|
|
93
|
+
|
|
94
|
+
### 1. Placeholder Sections
|
|
95
|
+
```markdown
|
|
96
|
+
# Bad — worse than omitting the section entirely
|
|
97
|
+
## Roadmap
|
|
98
|
+
- TBD
|
|
99
|
+
|
|
100
|
+
## Ownership
|
|
101
|
+
- Not specified
|
|
102
|
+
```
|
|
103
|
+
Empty sections signal that the document is incomplete and may be untrustworthy. Omit sections you can't fill meaningfully.
|
|
104
|
+
|
|
105
|
+
### 2. Vague Boundaries
|
|
106
|
+
```markdown
|
|
107
|
+
# Bad
|
|
108
|
+
- Be careful with the database
|
|
109
|
+
- Follow best practices
|
|
110
|
+
|
|
111
|
+
# Good
|
|
112
|
+
- Never run DROP, TRUNCATE, or DELETE without WHERE clause
|
|
113
|
+
- Always use parameterized queries, never string interpolation for SQL
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 3. Describing Style Without Examples
|
|
117
|
+
```markdown
|
|
118
|
+
# Bad
|
|
119
|
+
- Use consistent naming conventions
|
|
120
|
+
- Follow the project's component pattern
|
|
121
|
+
|
|
122
|
+
# Good
|
|
123
|
+
- Variables: camelCase (userId, isActive)
|
|
124
|
+
- Components: PascalCase (UserCard, NavBar)
|
|
125
|
+
- Files: kebab-case (user-card.tsx, nav-bar.tsx)
|
|
126
|
+
- Constants: UPPER_SNAKE (MAX_RETRIES, API_BASE_URL)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 4. Duplicating README Content
|
|
130
|
+
AGENTS.md should contain agent-specific guidance that would clutter a human README. Don't copy your README — reference it and add the agent-specific context.
|
|
131
|
+
|
|
132
|
+
### 5. One-Time Setup, Never Updated
|
|
133
|
+
AGENTS.md should evolve with the project. After each time an AI agent makes a mistake that better instructions would have prevented, update the AGENTS.md.
|
|
134
|
+
|
|
135
|
+
## Monorepo Patterns
|
|
136
|
+
|
|
137
|
+
Place AGENTS.md files at multiple levels:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
project/
|
|
141
|
+
├── AGENTS.md # Shared: monorepo conventions, CI, tooling
|
|
142
|
+
├── packages/
|
|
143
|
+
│ ├── api/
|
|
144
|
+
│ │ └── AGENTS.md # API-specific: routes, middleware, DB patterns
|
|
145
|
+
│ ├── web/
|
|
146
|
+
│ │ └── AGENTS.md # Frontend-specific: components, state, styling
|
|
147
|
+
│ └── shared/
|
|
148
|
+
│ └── AGENTS.md # Shared lib: export patterns, versioning
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Rules:**
|
|
152
|
+
- The closest AGENTS.md to the working file takes precedence
|
|
153
|
+
- Root AGENTS.md should contain cross-cutting concerns only
|
|
154
|
+
- Subdirectory files should not repeat root-level content
|
|
155
|
+
|
|
156
|
+
## Cross-Tool Compatibility
|
|
157
|
+
|
|
158
|
+
AGENTS.md is recognized by multiple AI coding tools:
|
|
159
|
+
|
|
160
|
+
| Tool | File | Precedence |
|
|
161
|
+
|------|------|-----------|
|
|
162
|
+
| GitHub Copilot | `AGENTS.md` | Standard |
|
|
163
|
+
| OpenAI Codex | `AGENTS.md`, `AGENTS.override.md` | Override > Standard |
|
|
164
|
+
| Claude Code | `CLAUDE.md`, `AGENTS.md` | Both read |
|
|
165
|
+
| Windsurf | `AGENTS.md`, `.windsurfrules` | Both read |
|
|
166
|
+
| Cursor | `.cursorrules`, `AGENTS.md` | Tool-specific first |
|
|
167
|
+
| GitLab Duo | `AGENTS.md` | Standard |
|
|
168
|
+
| Android Studio (Gemini) | `AGENTS.md` | Standard |
|
|
169
|
+
|
|
170
|
+
When a project has both AGENTS.md and tool-specific files (CLAUDE.md, .cursorrules), the tool-specific file typically takes precedence for that tool. AGENTS.md serves as the cross-tool baseline.
|
|
171
|
+
|
|
172
|
+
## Section-Specific Guidance
|
|
173
|
+
|
|
174
|
+
### Commands Section
|
|
175
|
+
- Include every command a developer might need
|
|
176
|
+
- Show exact flags, not just the base command
|
|
177
|
+
- Group by purpose (build, test, lint, deploy)
|
|
178
|
+
- Include file-scoped variants where applicable
|
|
179
|
+
- Note any required environment variables
|
|
180
|
+
|
|
181
|
+
### Project Structure Section
|
|
182
|
+
- Focus on directories agents will actually work in
|
|
183
|
+
- Explain naming conventions for files within each directory
|
|
184
|
+
- Call out generated or auto-maintained files (don't edit these)
|
|
185
|
+
- Note any files with special significance (entry points, config)
|
|
186
|
+
|
|
187
|
+
### Coding Conventions Section
|
|
188
|
+
- Show 2-3 real examples from the codebase for each convention
|
|
189
|
+
- Include import ordering rules
|
|
190
|
+
- Document error handling patterns
|
|
191
|
+
- Show preferred patterns for common operations (API calls, state management, etc.)
|
|
192
|
+
|
|
193
|
+
### Testing Section
|
|
194
|
+
- Include the exact test command with all needed flags
|
|
195
|
+
- Show the test file naming convention
|
|
196
|
+
- Provide a minimal test example in the project's style
|
|
197
|
+
- Document any test utilities or helpers available
|
|
198
|
+
- Note coverage thresholds if enforced
|
|
199
|
+
|
|
200
|
+
### Security Section
|
|
201
|
+
- List all files/directories that must never be committed
|
|
202
|
+
- Document authentication/authorization patterns
|
|
203
|
+
- Note any data handling requirements (PII, encryption)
|
|
204
|
+
- Call out environment-specific configurations
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Sources
|
|
209
|
+
|
|
210
|
+
- [agents.md — Official Specification](https://agents.md/)
|
|
211
|
+
- [GitHub Blog — Lessons from 2,500+ Repositories](https://github.blog/ai-and-ml/github-copilot/how-to-write-a-great-agents-md-lessons-from-over-2500-repositories/)
|
|
212
|
+
- [Builder.io — Best Tips for AGENTS.md](https://www.builder.io/blog/agents-md)
|
|
213
|
+
- [Factory Documentation](https://docs.factory.ai/cli/configuration/agents-md)
|
|
214
|
+
- [Windsurf Documentation](https://docs.windsurf.com/windsurf/cascade/agents-md)
|
|
215
|
+
- [GitLab Documentation](https://docs.gitlab.com/user/duo_agent_platform/customize/agents_md/)
|