ai-agent-rules 0.15.2__py3-none-any.whl

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.
Files changed (52) hide show
  1. ai_agent_rules-0.15.2.dist-info/METADATA +451 -0
  2. ai_agent_rules-0.15.2.dist-info/RECORD +52 -0
  3. ai_agent_rules-0.15.2.dist-info/WHEEL +5 -0
  4. ai_agent_rules-0.15.2.dist-info/entry_points.txt +3 -0
  5. ai_agent_rules-0.15.2.dist-info/licenses/LICENSE +22 -0
  6. ai_agent_rules-0.15.2.dist-info/top_level.txt +1 -0
  7. ai_rules/__init__.py +8 -0
  8. ai_rules/agents/__init__.py +1 -0
  9. ai_rules/agents/base.py +68 -0
  10. ai_rules/agents/claude.py +123 -0
  11. ai_rules/agents/cursor.py +70 -0
  12. ai_rules/agents/goose.py +47 -0
  13. ai_rules/agents/shared.py +35 -0
  14. ai_rules/bootstrap/__init__.py +75 -0
  15. ai_rules/bootstrap/config.py +261 -0
  16. ai_rules/bootstrap/installer.py +279 -0
  17. ai_rules/bootstrap/updater.py +344 -0
  18. ai_rules/bootstrap/version.py +52 -0
  19. ai_rules/cli.py +2434 -0
  20. ai_rules/completions.py +194 -0
  21. ai_rules/config/AGENTS.md +249 -0
  22. ai_rules/config/chat_agent_hints.md +1 -0
  23. ai_rules/config/claude/CLAUDE.md +1 -0
  24. ai_rules/config/claude/agents/code-reviewer.md +121 -0
  25. ai_rules/config/claude/commands/agents-md.md +422 -0
  26. ai_rules/config/claude/commands/annotate-changelog.md +191 -0
  27. ai_rules/config/claude/commands/comment-cleanup.md +161 -0
  28. ai_rules/config/claude/commands/continue-crash.md +38 -0
  29. ai_rules/config/claude/commands/dev-docs.md +169 -0
  30. ai_rules/config/claude/commands/pr-creator.md +247 -0
  31. ai_rules/config/claude/commands/test-cleanup.md +244 -0
  32. ai_rules/config/claude/commands/update-docs.md +324 -0
  33. ai_rules/config/claude/hooks/subagentStop.py +92 -0
  34. ai_rules/config/claude/mcps.json +1 -0
  35. ai_rules/config/claude/settings.json +119 -0
  36. ai_rules/config/claude/skills/doc-writer/SKILL.md +293 -0
  37. ai_rules/config/claude/skills/doc-writer/resources/templates.md +495 -0
  38. ai_rules/config/claude/skills/prompt-engineer/SKILL.md +272 -0
  39. ai_rules/config/claude/skills/prompt-engineer/resources/prompt_engineering_guide_2025.md +855 -0
  40. ai_rules/config/claude/skills/prompt-engineer/resources/templates.md +232 -0
  41. ai_rules/config/cursor/keybindings.json +14 -0
  42. ai_rules/config/cursor/settings.json +81 -0
  43. ai_rules/config/goose/.goosehints +1 -0
  44. ai_rules/config/goose/config.yaml +55 -0
  45. ai_rules/config/profiles/default.yaml +6 -0
  46. ai_rules/config/profiles/work.yaml +11 -0
  47. ai_rules/config.py +644 -0
  48. ai_rules/display.py +40 -0
  49. ai_rules/mcp.py +369 -0
  50. ai_rules/profiles.py +187 -0
  51. ai_rules/symlinks.py +207 -0
  52. ai_rules/utils.py +35 -0
@@ -0,0 +1,422 @@
1
+ ---
2
+ description: Creates or updates AGENTS.md with comprehensive repo documentation for LLM coding agents
3
+ allowed-tools: Bash, Read, Write, Edit, Grep, Glob, TodoWrite
4
+ model: sonnet
5
+ ---
6
+
7
+ ## Context
8
+
9
+ - Mode: !`[ -f "$(git rev-parse --show-toplevel 2>/dev/null)/AGENTS.md" ] && echo "UPDATE_MODE" || echo "CREATE_MODE"`
10
+ - Git root: !`git rev-parse --show-toplevel 2>/dev/null || echo "NOT_IN_GIT_REPO"`
11
+ - Project name: !`sh -c 'ROOT=$(git rev-parse --show-toplevel 2>/dev/null); [ -z "$ROOT" ] && echo "UNKNOWN" || (cd "$ROOT" && (grep -m1 "name" package.json 2>/dev/null | sed -E "s/.*\"name\"[[:space:]]*:[[:space:]]*\"([^\"]+)\".*/\\1/" || grep -m1 "^name = " pyproject.toml 2>/dev/null | sed -E "s/name = \"([^\"]+)\"/\\1/" || grep -m1 "^name = " Cargo.toml 2>/dev/null | sed -E "s/name = \"([^\"]+)\"/\\1/" || basename "$ROOT"))'`
12
+ - Tooling: !`sh -c 'ROOT=$(git rev-parse --show-toplevel 2>/dev/null); [ -z "$ROOT" ] && echo "NONE" || (cd "$ROOT" && tools=""; [ -f Makefile ] && tools="${tools}make,"; [ -f Justfile ] && tools="${tools}just,"; [ -f package.json ] && tools="${tools}npm,"; [ -f pyproject.toml ] && tools="${tools}python,"; [ -f Cargo.toml ] && tools="${tools}rust,"; [ -f go.mod ] && tools="${tools}go,"; echo "${tools%,}" | sed "s/^$/NONE/")'`
13
+ - Primary language: !`sh -c 'ROOT=$(git rev-parse --show-toplevel 2>/dev/null); [ -z "$ROOT" ] && echo "UNKNOWN" || (cd "$ROOT" && (find . -type f -name "*.py" 2>/dev/null | head -1 | grep -q . && echo "Python") || (find . -type f -name "*.js" -o -name "*.ts" 2>/dev/null | head -1 | grep -q . && echo "JavaScript/TypeScript") || (find . -type f -name "*.rs" 2>/dev/null | head -1 | grep -q . && echo "Rust") || (find . -type f -name "*.go" 2>/dev/null | head -1 | grep -q . && echo "Go") || echo "UNKNOWN")'`
14
+ - Directory: !`pwd`
15
+
16
+ # Create or Update AGENTS.md
17
+
18
+ You are creating comprehensive documentation to help LLM coding agents (Claude Code, Cursor, Goose, etc.) work effectively in this repository. Your goal is to discover and document everything an agent needs to understand the project quickly: commands, structure, patterns, gotchas, and conventions.
19
+
20
+ **Target audience:** LLM coding agents starting fresh on this codebase
21
+ **Output:** AGENTS.md file at repository root with actionable, concise guidance
22
+
23
+ ## Phase 1: Determine Mode
24
+
25
+ Check the "Mode" field from Context section:
26
+
27
+ ### CREATE_MODE
28
+ AGENTS.md does not exist. You will create a new file from scratch by exploring the repository comprehensively.
29
+
30
+ **Action:**
31
+ 1. Inform user you're creating AGENTS.md for `{Project name}`
32
+ 2. Proceed to Phase 2: Deep Exploration
33
+
34
+ ### UPDATE_MODE
35
+ AGENTS.md already exists. You will read the existing file, explore for new information, and merge updates while preserving user customizations.
36
+
37
+ **Action:**
38
+ 1. Inform user you're updating existing AGENTS.md
39
+ 2. Read current AGENTS.md file
40
+ 3. Proceed to Phase 2: Deep Exploration (focusing on changes/additions)
41
+
42
+ ## Phase 2: Deep Exploration
43
+
44
+ Explore the repository systematically across all key areas. Use the findings to populate AGENTS.md sections.
45
+
46
+ ### Area 1: Project Identity & Overview
47
+
48
+ **Goal:** Understand what this project is and what it does
49
+
50
+ **Explore:**
51
+ 1. Read README.md for project description and purpose
52
+ 2. Check package files (package.json, pyproject.toml, Cargo.toml, go.mod) for:
53
+ - Official project name
54
+ - Version
55
+ - Description field
56
+ - Main entry points
57
+ 3. Identify if this is a library, CLI tool, web app, service, or other
58
+
59
+ **Document in:** Opening paragraph (1-2 sentences)
60
+
61
+ ### Area 2: Quick Commands (PRIORITY: Document First)
62
+
63
+ **Goal:** Find all essential build/test/run commands
64
+
65
+ **Explore (in priority order):**
66
+
67
+ 1. **Makefile** (if exists):
68
+ ```bash
69
+ make help # Try first
70
+ grep "^[a-zA-Z]" Makefile | head -20 # List targets
71
+ ```
72
+
73
+ 2. **Justfile** (if exists):
74
+ ```bash
75
+ just --list
76
+ ```
77
+
78
+ 3. **package.json** (if exists):
79
+ ```bash
80
+ cat package.json | grep -A 50 '"scripts"'
81
+ ```
82
+
83
+ 4. **pyproject.toml** (if exists):
84
+ - Check for tool commands
85
+ - Look for `[tool.pytest]`, `[tool.ruff]`, etc.
86
+ - Common: `pytest`, `ruff check`, `ruff format`, `mypy`
87
+
88
+ 5. **README.md**:
89
+ - Search for "Getting Started", "Installation", "Development"
90
+ - Extract command examples
91
+
92
+ 6. **CI/CD config** (.github/workflows/, .gitlab-ci.yml):
93
+ - Commands used in CI are canonical
94
+
95
+ **Critical:** Document the ACTUAL commands agents should run:
96
+ - Setup/installation
97
+ - Build/compile
98
+ - Run locally
99
+ - Test (full suite AND file-scoped if different)
100
+ - Lint
101
+ - Format
102
+ - Type check
103
+
104
+ **Document in:** `## Quick Commands` section (put at top, most important)
105
+
106
+ ### Area 3: Project Structure
107
+
108
+ **Goal:** Map the directory layout and key modules
109
+
110
+ **Explore:**
111
+ 1. Run `tree -d -L 3` or `ls -R` to see directory structure
112
+ 2. Identify key directories:
113
+ - Source code location (src/, lib/, app/, pkg/)
114
+ - Test location (tests/, test/, __tests__)
115
+ - Config location (config/, .config/)
116
+ - Documentation location (docs/, documentation/)
117
+ 3. For each major directory, understand its purpose
118
+ 4. Note any monorepo structure (packages/, apps/)
119
+
120
+ **Document in:** `## Project Structure` section (tree view or annotated list)
121
+
122
+ ### Area 4: Tech Stack
123
+
124
+ **Goal:** Document specific technologies with versions
125
+
126
+ **Explore:**
127
+ 1. Language and version (from package files or README)
128
+ 2. Framework (React, Django, Express, etc.) with major version
129
+ 3. Key libraries/dependencies (check package files)
130
+ 4. Database (if any - check docker-compose.yml, env examples)
131
+ 5. Build tools (Webpack, Vite, esbuild, etc.)
132
+ 6. Package manager (npm, yarn, pnpm, uv, cargo, etc.)
133
+
134
+ **Be specific:** "React 18 with TypeScript" not just "React"
135
+
136
+ **Document in:** `## Tech Stack` section (bulleted list)
137
+
138
+ ### Area 5: Key Patterns & Conventions
139
+
140
+ **Goal:** Discover architectural patterns and coding conventions agents must follow
141
+
142
+ **Explore:**
143
+ 1. **Architecture patterns:**
144
+ - Read 2-3 example source files
145
+ - Look for: MVC, component patterns, service layers, repository patterns
146
+ - Check for dependency injection, factories, builders
147
+
148
+ 2. **Code organization conventions:**
149
+ - Naming patterns (camelCase, snake_case, PascalCase for what?)
150
+ - File naming (index.js patterns, _private.py, test_*.py)
151
+ - Import/export patterns
152
+
153
+ 3. **Abstractions to use:**
154
+ - Base classes (check for `Base*`, `Abstract*`)
155
+ - Utilities (lib/, utils/, helpers/)
156
+ - Shared components/modules
157
+
158
+ 4. **Framework-specific patterns:**
159
+ - React: Hook patterns, component structure
160
+ - Python: Class decorators, context managers
161
+ - Go: Interface patterns
162
+
163
+ **Look at real code examples** to understand conventions
164
+
165
+ **Document in:** `## Key Patterns` section with brief explanations
166
+
167
+ ### Area 6: Code Style
168
+
169
+ **Goal:** Document style guidelines NOT covered by linters
170
+
171
+ **Explore:**
172
+ 1. Check for style guide docs (CONTRIBUTING.md, docs/style.md)
173
+ 2. Read linter configs (.eslintrc, .ruff.toml, etc.) for what's enforced
174
+ 3. Look for patterns in existing code:
175
+ - Comment style (docstrings, JSDoc, inline)
176
+ - Function/method length norms
177
+ - Prefer composition or inheritance?
178
+
179
+ **Important:**
180
+ - Only document what linters DON'T catch
181
+ - Use code examples over prose when possible
182
+ - Keep brief (linters handle most style)
183
+
184
+ **Document in:** `## Code Style` section (brief, example-focused)
185
+
186
+ ### Area 7: Testing
187
+
188
+ **Goal:** How to run tests and where they live
189
+
190
+ **Explore:**
191
+ 1. Test framework (pytest, vitest, jest, go test, cargo test)
192
+ 2. Test file locations and naming
193
+ 3. Test commands:
194
+ - Full suite
195
+ - Single file
196
+ - Watch mode
197
+ - Coverage
198
+ 4. CI test commands (check .github/workflows/)
199
+ 5. Test patterns/conventions (fixtures, mocks, factories)
200
+
201
+ **Document in:** `## Testing` section
202
+
203
+ ### Area 8: Common Gotchas (HIGH VALUE)
204
+
205
+ **Goal:** Capture edge cases and traps that cause bugs
206
+
207
+ **Explore:**
208
+ 1. Check comments with "NOTE:", "WARNING:", "FIXME:", "HACK:"
209
+ 2. Read existing AGENTS.md, CLAUDE.md, or similar files for gotchas
210
+ 3. Look for complex setup (environment vars, secrets, external services)
211
+ 4. Check for version-specific issues (e.g., "Must use Python 3.11+")
212
+ 5. Review git hooks (.git/hooks/) or pre-commit config
213
+ 6. Look for common failure modes in issues/PRs if public repo
214
+
215
+ **Examples of good gotchas:**
216
+ - "Array path notation: Use `hooks.SubagentStop[0].command` for setting arrays"
217
+ - "Mocking HOME in tests requires patching both environ and Path.home"
218
+ - "Must run migrations before tests: `make migrate-test`"
219
+
220
+ **Document in:** `## Common Gotchas` section (numbered list)
221
+
222
+ ### Area 9: Key Files by Task
223
+
224
+ **Goal:** Map tasks to relevant files for faster navigation
225
+
226
+ **Explore:**
227
+ 1. Identify common tasks based on project type:
228
+ - Add CLI command → which files?
229
+ - Add API endpoint → which files?
230
+ - Add new component → which files?
231
+ - Change config behavior → which files?
232
+ - Add new agent/plugin → which files?
233
+
234
+ 2. Document the mapping as a table
235
+
236
+ **Document in:** `## Key Files by Task` section (table format)
237
+
238
+ ## Phase 3: Synthesize Findings
239
+
240
+ Organize your exploration findings into a well-structured AGENTS.md file.
241
+
242
+ ### Structure Requirements
243
+
244
+ Use this exact structure (based on research of 2,500+ repositories):
245
+
246
+ ```markdown
247
+ # AGENTS.md
248
+
249
+ [1-2 sentence project description from Area 1]
250
+
251
+ ## Quick Commands
252
+
253
+ ```bash
254
+ [Commands from Area 2 - setup, build, test, lint, format]
255
+ ```
256
+
257
+ ## Project Structure
258
+
259
+ ```
260
+ [Directory tree from Area 3 with annotations]
261
+ ```
262
+
263
+ ## Tech Stack
264
+
265
+ - [Language + version]
266
+ - [Framework + version]
267
+ - [Key libraries]
268
+ - [Build tools]
269
+ - [Database if applicable]
270
+
271
+ ## Key Patterns
272
+
273
+ [Findings from Area 5 - conventions, abstractions, architectural patterns]
274
+
275
+ ## Code Style
276
+
277
+ [Findings from Area 6 - brief, with code examples if helpful]
278
+
279
+ ## Testing
280
+
281
+ ```bash
282
+ [Test commands from Area 7]
283
+ ```
284
+
285
+ [Test structure notes]
286
+
287
+ ## Common Gotchas
288
+
289
+ 1. [Gotcha from Area 8]
290
+ 2. [Another gotcha]
291
+ ...
292
+
293
+ ## Key Files by Task
294
+
295
+ | Task | Files |
296
+ |------|-------|
297
+ [Mapping from Area 9]
298
+ ```
299
+
300
+ ### Quality Standards
301
+
302
+ **Conciseness:**
303
+ - Target: Under 60 lines total (up to 100 for complex projects)
304
+ - Be specific and actionable, avoid prose
305
+ - One line per item where possible
306
+ - Put commands early (they're used most)
307
+
308
+ **Specificity:**
309
+ - Include version numbers ("React 18" not "React")
310
+ - Use exact commands with flags (`pytest -v` not "run tests")
311
+ - Reference actual file paths (`src/cli.py` not "CLI file")
312
+
313
+ **Examples over explanation:**
314
+ ```markdown
315
+ # Bad
316
+ "Use meaningful variable names"
317
+
318
+ # Good
319
+ user_email = get_email() # Not: e = get_email()
320
+ ```
321
+
322
+ **Boundaries (Optional but valuable):**
323
+ Consider adding a boundaries section if there are critical constraints:
324
+ ```markdown
325
+ ## Boundaries
326
+
327
+ **Always:**
328
+ - Run tests before committing
329
+ - Use existing components from src/components/
330
+
331
+ **Ask first:**
332
+ - Adding new dependencies
333
+ - Database schema changes
334
+
335
+ **Never:**
336
+ - Commit secrets or credentials
337
+ - Delete existing tests without replacement
338
+ ```
339
+
340
+ ## Phase 4: Write or Update File
341
+
342
+ ### For CREATE_MODE
343
+
344
+ 1. **Generate complete AGENTS.md** using structure from Phase 3
345
+ 2. Write to: `{Git root}/AGENTS.md`
346
+ 3. **Validate:**
347
+ - File under 100 lines
348
+ - Commands section is first (after overview)
349
+ - Specific versions included
350
+ - All sections have content (no empty placeholders)
351
+ - No sensitive information included
352
+
353
+ 4. **Report to user:**
354
+ - File path
355
+ - Line count
356
+ - Key sections included
357
+
358
+ ### For UPDATE_MODE
359
+
360
+ 1. **Read existing AGENTS.md** (already done in Phase 1)
361
+ 2. **Compare** existing content vs. new findings:
362
+ - Identify new commands not documented
363
+ - Identify new gotchas discovered
364
+ - Check if versions are outdated
365
+ - Look for structural improvements
366
+
367
+ 3. **Merge strategy:**
368
+ - **Preserve** user customizations and manual additions
369
+ - **Add** new findings to appropriate sections
370
+ - **Update** outdated information (versions, commands)
371
+ - **Don't remove** user content unless clearly obsolete
372
+
373
+ 4. **Apply updates** using Edit tool:
374
+ - Match exact old_string with proper formatting
375
+ - Add new items to lists/sections
376
+ - Update version numbers where stale
377
+
378
+ 5. **Report to user:**
379
+ - File path
380
+ - What was added/updated
381
+ - Summary of changes (X commands added, Y gotchas updated, etc.)
382
+
383
+ ## Critical Requirements
384
+
385
+ **File Location:**
386
+ - ALWAYS write to `{Git root}/AGENTS.md`
387
+ - NEVER write to subdirectories (root-level only)
388
+ - Confirm git root from Context section
389
+
390
+ **Exploration Depth:**
391
+ - READ actual files, don't guess content
392
+ - Run commands to see real output (make --help, just --list, etc.)
393
+ - Check multiple sources for same information
394
+ - Prefer CI config for canonical commands
395
+
396
+ **Content Quality:**
397
+ - Specific over vague ("pytest -v" not "run tests")
398
+ - Actionable over descriptive
399
+ - Examples over explanations
400
+ - Brief over comprehensive
401
+ - Accurate over complete
402
+
403
+ **Avoid:**
404
+ - Sensitive information (API keys, credentials, tokens)
405
+ - Duplicating linter rules in Code Style
406
+ - Generic advice ("write good code", "test your changes")
407
+ - Personal opinions not grounded in codebase
408
+ - Unnecessary prose
409
+
410
+ **Update Mode:**
411
+ - Preserve user customizations
412
+ - Don't remove manual additions
413
+ - Only update what changed
414
+ - Maintain user's organizational preferences
415
+
416
+ **Documentation:**
417
+ - This is for LLM agents, not humans
418
+ - Focus on information NOT in README
419
+ - Commands are most important (put first)
420
+ - Gotchas are high-value (include prominent section)
421
+
422
+ Your AGENTS.md should enable any LLM coding agent to start contributing effectively within minutes of reading it.
@@ -0,0 +1,191 @@
1
+ ---
2
+ description: Annotates auto-generated changelog entries with detailed descriptions
3
+ allowed-tools: AskUserQuestion, Bash, Edit, Glob, Grep, Read, TodoWrite
4
+ model: sonnet
5
+ ---
6
+
7
+ ## Context
8
+
9
+ - Changelog file: !`find . -maxdepth 1 -name "CHANGELOG*" -type f | head -1`
10
+ - Recent commits: !`git log --oneline -20 2>/dev/null || echo "NO_COMMITS"`
11
+ - Git repo root: !`git rev-parse --show-toplevel 2>/dev/null || pwd`
12
+
13
+ # Annotate Changelog
14
+
15
+ **Usage:**
16
+ - `/annotate-changelog` - Add detailed descriptions to terse auto-generated changelog entries
17
+
18
+ Enhances auto-generated changelogs (from semantic-release, conventional commits, etc.) by adding user-facing descriptions beneath terse commit messages. Gathers context from git diffs, commit messages, and PR descriptions to explain what changed and why it matters.
19
+
20
+ ## Workflow
21
+
22
+ ### Phase 1: Parse Changelog
23
+
24
+ 1. **Read CHANGELOG.md** (from Context above)
25
+ 2. **Identify entries needing annotation:**
26
+ - Look for terse commit messages ("Cc perms", "Still flaky", "Llms are dumb")
27
+ - Short descriptions without explanation of impact
28
+ - Entries with just commit SHA links but no detail
29
+ 3. **Extract commit information:**
30
+ - Parse version sections (e.g., `## [0.10.3] - 2024-12-05`)
31
+ - Find commit SHAs in links (e.g., `[9dd366c]`)
32
+ - Note existing structure (bullets, sections like "### Added")
33
+
34
+ ### Phase 2: Gather Context
35
+
36
+ For each entry needing annotation:
37
+
38
+ 1. **Get full commit message:**
39
+ ```bash
40
+ git log -1 --format="%B" <sha>
41
+ ```
42
+ The full body often has more detail than the subject line.
43
+
44
+ 2. **Get commit diff summary:**
45
+ ```bash
46
+ git show --stat <sha>
47
+ ```
48
+ Shows which files changed, gives technical context.
49
+
50
+ 3. **Search for related PR:**
51
+ ```bash
52
+ gh pr list --search "<sha>" --state merged --json number,title
53
+ ```
54
+ Find if this commit was part of a pull request.
55
+
56
+ 4. **If PR found, get description:**
57
+ ```bash
58
+ gh pr view <pr_number> --json body --jq .body
59
+ ```
60
+ PR descriptions often have better user-facing explanations.
61
+
62
+ 5. **If context is insufficient** (all sources are terse or unclear):
63
+ - Use AskUserQuestion tool
64
+ - Show the commit SHA and message
65
+ - Ask: "What was the user-facing change in this commit?"
66
+
67
+ ### Phase 3: Generate Annotations
68
+
69
+ For each entry:
70
+
71
+ 1. **Analyze context gathered:**
72
+ - What files changed? (from diff)
73
+ - What's the user-facing impact?
74
+ - Why did this change happen? (bug fix, new feature, breaking change)
75
+
76
+ 2. **Write annotation:**
77
+ - Focus on user-facing impact, not implementation details
78
+ - Explain WHAT changed for users, not HOW it was implemented
79
+ - Keep it concise (1-2 sentences)
80
+ - Match existing changelog tone/style
81
+
82
+ 3. **Format:**
83
+ ```markdown
84
+ - Terse commit message ([commit_sha])
85
+ > Detailed annotation explaining user-facing impact
86
+ ```
87
+
88
+ ### Phase 4: Update Changelog
89
+
90
+ 1. **Preserve structure:**
91
+ - Keep version headers intact
92
+ - Maintain section organization (Added, Fixed, etc.)
93
+ - Keep commit SHA links as-is
94
+ - Don't remove or replace original entries
95
+
96
+ 2. **Add annotations:**
97
+ - Insert description as blockquote below entry
98
+ - Use `>` for blockquote formatting
99
+ - Maintain consistent indentation
100
+
101
+ 3. **Present changes:**
102
+ - Show diff before applying
103
+ - Explain how many entries were annotated
104
+ - Give user chance to review
105
+
106
+ 4. **Apply edits:**
107
+ - Use Edit tool to update CHANGELOG.md
108
+ - Make one edit per entry or batch similar entries
109
+
110
+ ## Example Transformation
111
+
112
+ **Before:**
113
+ ```markdown
114
+ ## [0.10.3] - 2024-12-05
115
+
116
+ ### Bug Fixes
117
+
118
+ - Cc perms ([9dd366c])
119
+ ```
120
+
121
+ **After:**
122
+ ```markdown
123
+ ## [0.10.3] - 2024-12-05
124
+
125
+ ### Bug Fixes
126
+
127
+ - Cc perms ([9dd366c])
128
+ > Fixed Claude Code permissions in settings.json to allow the doc-writer skill
129
+ ```
130
+
131
+ **Before:**
132
+ ```markdown
133
+ ### Added
134
+
135
+ - Doc-writer skill for claude code ([e293e4c])
136
+ ```
137
+
138
+ **After:**
139
+ ```markdown
140
+ ### Added
141
+
142
+ - Doc-writer skill for claude code ([e293e4c])
143
+ > Added new Claude Code skill that provides guidance for writing compact, effective technical documentation including README, ARCHITECTURE, and API docs
144
+ ```
145
+
146
+ ## Key Principles
147
+
148
+ **Focus on user impact:**
149
+ - "Added X feature that lets users do Y"
150
+ - "Fixed bug where Z would fail"
151
+ - NOT: "Updated function foo() to call bar()"
152
+
153
+ **Be concise:**
154
+ - 1-2 sentences max
155
+ - Don't repeat obvious information from commit message
156
+ - Add value, don't just restate
157
+
158
+ **Preserve changelog structure:**
159
+ - Don't change version numbers, dates, or commit links
160
+ - Don't reorganize sections
161
+ - Don't remove entries (even if trivial)
162
+
163
+ **Match style:**
164
+ - Use same tone as existing entries
165
+ - Follow Keep a Changelog format if present
166
+ - Consistent formatting (blockquotes for annotations)
167
+
168
+ ## Critical Requirements
169
+
170
+ **Context gathering:**
171
+ - MUST try git diffs first, then commit messages, then PR descriptions
172
+ - MUST use AskUserQuestion if all sources are unclear
173
+ - DON'T fabricate or guess at changes
174
+
175
+ **Annotations:**
176
+ - MUST focus on user-facing impact
177
+ - MUST be concise (1-2 sentences)
178
+ - MUST NOT repeat implementation details already in diff
179
+
180
+ **Structure preservation:**
181
+ - MUST keep all original entries intact
182
+ - MUST preserve commit SHA links
183
+ - MUST maintain version structure and dates
184
+ - MUST use blockquote format (`>`) for annotations
185
+
186
+ **Approval:**
187
+ - MUST show diff before applying changes
188
+ - MUST explain how many entries were annotated
189
+ - DON'T apply changes without user seeing what will change
190
+
191
+ Your goal is to make auto-generated changelogs more useful by adding context about what changed from a user's perspective, while preserving the automated structure and commit traceability.