@dedesfr/prompter 0.8.12 → 0.8.14
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 +13 -0
- package/dist/cli/index.js +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/init.js.map +1 -1
- package/package.json +1 -1
- package/skills/ai-context-generator/SKILL.md +54 -0
- package/skills/ai-context-generator/references/AGENTS.template.md +83 -0
- package/skills/ai-context-generator/references/CLAUDE.template.md +39 -0
- package/skills/ai-context-generator/references/behavioral-guidelines.md +71 -0
- package/skills/ai-context-generator/references/discovery-checklist.md +40 -0
- package/skills/ai-context-generator/references/examples/AGENTS.good.md +103 -0
- package/skills/ai-context-generator/references/extraction-checklist.md +23 -0
- package/skills/ai-context-generator/references/overlays/laravel.md +44 -0
- package/skills/ui-ux-pro-v2/SKILL.md +41 -40
- package/src/cli/index.ts +1 -1
- package/src/commands/init.ts +1 -1
- package/skills/agents-md-generator/SKILL.md +0 -238
- package/skills/agents-md-generator/assets/agents-md-template.md +0 -81
- package/skills/agents-md-generator/references/best-practices.md +0 -215
|
@@ -1,215 +0,0 @@
|
|
|
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/)
|