@docyrus/docyrus 0.0.62 → 0.0.64

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.
@@ -1,461 +0,0 @@
1
- ---
2
- name: changelog-generator
3
- description: >
4
- Parse git history and produce or update a CHANGELOG.md following the Keep a Changelog convention. Supports Conventional Commits, basic prefix conventions, and unstructured commit messages. Intelligently categorizes changes, detects breaking changes, links to PRs/issues, and handles both initial generation and incremental updates.
5
-
6
- **Triggers — use this skill when:**
7
- - User asks to "generate", "create", "update", or "write" a changelog
8
- - User mentions "CHANGELOG", "changelog", "release notes"
9
- - User says "document changes", "what changed since last release"
10
- - User wants to "prepare a release" and needs a changelog entry
11
- - User asks to "clean up" or "reformat" an existing changelog
12
- - User runs `docyrus release new-version` and needs changelog content
13
-
14
- **Covers:** Any git-based project.
15
-
16
- Handles Conventional Commits (feat/fix/chore), Angular convention, basic prefixes (Add/Fix/Remove), and freeform commit messages. Outputs Keep a Changelog format with optional Common Changelog enhancements.
17
- ---
18
-
19
- # Changelog Generator
20
-
21
- Parse a project's git history and produce a high-quality CHANGELOG.md following the [Keep a Changelog](https://keepachangelog.com/) convention.
22
-
23
- ## Philosophy
24
-
25
- A changelog is for **humans**, not machines.
26
-
27
- It answers: "What meaningful changes happened between version X and version Y?"
28
-
29
- Raw commit logs fail at this because they contain noise — typo fixes, merge commits, CI tweaks, and refactors that don't affect users. This skill filters signal from noise and writes entries that a user or contributor can actually understand.
30
-
31
- ---
32
-
33
- ## Workflow
34
-
35
- ### Phase 1 — Repository Analysis
36
-
37
- Before generating anything, understand the project's commit and versioning patterns.
38
-
39
- ```bash
40
- # 1. Check if we're in a git repo
41
- git rev-parse --is-inside-work-tree 2>/dev/null
42
-
43
- # 2. Get all tags (versions) sorted by date
44
- git tag --sort=-creatordate | head -30
45
-
46
- # 3. Detect versioning scheme
47
- # SemVer: v1.2.3 or 1.2.3
48
- # CalVer: 2025.01, 2025-01-15
49
- # Other: named releases, build numbers
50
- git tag --sort=-creatordate | head -10
51
-
52
- # 4. Detect commit convention
53
- # Sample recent commits to identify the pattern
54
- git log --oneline -30
55
-
56
- # 5. Check for existing changelog
57
- cat CHANGELOG.md 2>/dev/null
58
- cat HISTORY.md 2>/dev/null
59
- cat CHANGES.md 2>/dev/null
60
-
61
- # 6. Check for existing config that hints at convention
62
- cat .commitlintrc* commitlint.config.* 2>/dev/null # Commitlint
63
- cat .czrc .cz.toml 2>/dev/null # Commitizen
64
- cat cliff.toml 2>/dev/null # git-cliff
65
- cat .versionrc* 2>/dev/null # standard-version
66
-
67
- # 7. Get remote URL for PR/issue links
68
- git remote get-url origin 2>/dev/null
69
-
70
- # 8. Package manifest for current version
71
- cat package.json 2>/dev/null | grep '"version"'
72
- cat pyproject.toml 2>/dev/null | grep 'version'
73
- cat Cargo.toml 2>/dev/null | grep '^version'
74
- ```
75
-
76
- **Extract from the analysis:**
77
-
78
- | Fact | How to determine |
79
- |------|-----------------|
80
- | Commit convention | Pattern match on recent commits (see detection rules below) |
81
- | Versioning scheme | Tag format analysis |
82
- | Latest version/tag | Most recent tag |
83
- | Remote URL | `git remote get-url origin` — needed for PR/issue links |
84
- | Existing changelog | Check for CHANGELOG.md or variants |
85
- | Unreleased commits | Commits since the latest tag |
86
-
87
- ### Phase 2 — Commit Convention Detection
88
-
89
- Analyze the last 30–50 commits to detect which convention is in use.
90
-
91
- Apply these rules in order:
92
-
93
- **Conventional Commits / Angular**
94
-
95
- ```
96
- Pattern: ^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?:
97
- Example: feat(auth): add OAuth2 support
98
- Example: fix!: resolve race condition in queue
99
- ```
100
-
101
- → If >50% of commits match this pattern, use Conventional Commits parsing.
102
-
103
- **Basic Prefix**
104
-
105
- ```
106
- Pattern: ^(Add|Fix|Remove|Update|Change|Deprecate|Security)[: ]
107
- Example: Add user export feature
108
- Example: Fix login redirect loop
109
- ```
110
-
111
- → If >50% of commits match this pattern, use basic prefix parsing.
112
-
113
- **Freeform / No Convention**
114
-
115
- → If neither pattern dominates, use AI-assisted categorization (see Phase 3).
116
-
117
- Report the detected convention to the user before proceeding.
118
-
119
- ### Phase 3 — Commit Extraction & Categorization
120
-
121
- Extract commits for the target range and categorize them.
122
-
123
- ```bash
124
- # All commits since last tag (for Unreleased section)
125
- git log $(git describe --tags --abbrev=0 2>/dev/null)..HEAD \
126
- --pretty=format:"%H|%s|%b|%an|%ae|%aI" 2>/dev/null
127
-
128
- # Commits between two tags (for a specific version)
129
- git log v1.1.0..v1.2.0 \
130
- --pretty=format:"%H|%s|%b|%an|%ae|%aI"
131
-
132
- # If no tags exist, get all commits
133
- git log --pretty=format:"%H|%s|%b|%an|%ae|%aI"
134
-
135
- # Get PR/merge info if available
136
- git log --merges --oneline -20
137
- ```
138
-
139
- #### Category Mapping
140
-
141
- Map commits to Keep a Changelog categories:
142
-
143
- | Keep a Changelog Category | Conventional Commits types | Basic prefixes | Description |
144
- |---------------------------|---------------------------|----------------|-------------|
145
- | **Added** | `feat` | Add, Create, Implement | New features |
146
- | **Changed** | `refactor`, `perf`, `style` | Change, Update, Refactor, Improve | Changes to existing functionality |
147
- | **Deprecated** | — (detect from message) | Deprecate | Soon-to-be removed features |
148
- | **Removed** | — (detect from message) | Remove, Delete, Drop | Removed features |
149
- | **Fixed** | `fix` | Fix, Resolve, Correct | Bug fixes |
150
- | **Security** | — (detect from message) | Security | Vulnerability fixes |
151
-
152
- #### Entries to SKIP (noise filtering)
153
-
154
- Do NOT include these in the changelog unless they have user-facing impact:
155
-
156
- - Merge commits (`Merge branch...`, `Merge pull request...`) — extract the PR title instead
157
- - CI/CD changes (`ci:`, `build:`, changes only to `.github/workflows/`)
158
- - Chore commits (`chore:`, dependency bumps without breaking changes)
159
- - Typo fixes in code comments
160
- - Formatting/linting-only changes (`style:` that don't affect behavior)
161
- - Version bump commits (`chore: bump version to...`)
162
- - Commits that only touch test files (unless adding test coverage is noteworthy)
163
-
164
- #### Freeform Commit Categorization
165
-
166
- When commits don't follow a convention, categorize by analyzing the message content:
167
-
168
- - Contains "add", "new", "create", "implement", "introduce" → **Added**
169
- - Contains "fix", "resolve", "correct", "patch", "bug" → **Fixed**
170
- - Contains "remove", "delete", "drop" → **Removed**
171
- - Contains "deprecate" → **Deprecated**
172
- - Contains "security", "vulnerability", "CVE" → **Security**
173
- - Contains "update", "change", "refactor", "improve", "optimize" → **Changed**
174
- - If unclear, use the diff to determine: new files = Added, deleted files = Removed, modified = Changed
175
-
176
- #### Breaking Change Detection
177
-
178
- Flag breaking changes regardless of convention:
179
-
180
- - Conventional: `!` after type/scope, or `BREAKING CHANGE:` in footer
181
- - Message content: "breaking", "incompatible", "migration required"
182
- - SemVer major bump between tags
183
- - Removal of public API functions/endpoints
184
-
185
- Mark breaking entries with **BREAKING:** prefix in the changelog.
186
-
187
- ### Phase 3b — Docyrus Backend Modifications
188
-
189
- In addition to code changes, scan for Docyrus platform modifications made through the CLI or API. These should be included alongside code changes in the changelog.
190
-
191
- **Detection methods:**
192
-
193
- 1. Search git diff for changes to `docyrus/` directory files (data-sources.plan.json, knowledge files, project-plan changes)
194
- 2. Look for commit messages containing: `docyrus studio`, `data source`, `field`, `enum`, `app`
195
- 3. Check for `docyrus/project-plan/` changes that reference architecture tasks
196
- 4. Look for `.docyrus/` configuration changes
197
-
198
- **Map to changelog categories:**
199
-
200
- - **Added** — New data sources created, new fields added, new enum options, new apps provisioned
201
- - **Changed** — Field type changes, enum updates, data source configuration changes, knowledge graph updates
202
- - **Removed** — Deleted data sources, removed fields, removed enum options
203
-
204
- **Entry format for backend changes:**
205
-
206
- ```markdown
207
- - Add "Contacts" data source with 12 fields (name, email, phone, ...)
208
- - Add "Priority" enum to Opportunity data source (Low, Medium, High, Critical)
209
- - Update "Account" data source: add "industry" and "revenue" fields
210
- - Remove deprecated "legacy_status" field from Tasks data source
211
- ```
212
-
213
- When both code changes and Docyrus platform changes exist, include platform changes under a **Docyrus Platform** heading within the version section:
214
-
215
- ```markdown
216
- ### Docyrus Platform
217
-
218
- - Add "Contacts" data source with name, email, phone fields
219
- - Update "Opportunity" enum: add Critical priority level
220
- ```
221
-
222
- ### Phase 4 — Entry Writing
223
-
224
- Transform raw commit data into human-readable changelog entries.
225
-
226
- #### Writing Rules
227
-
228
- 1. **Write for the user, not the developer.**
229
- "Add dark mode support" not "feat(ui): implement dark-mode toggle via CSS custom properties in ThemeProvider"
230
- 2. **Use imperative mood.**
231
- "Add", "Fix", "Remove" — not "Added", "Fixed", "Removed"
232
- 3. **One entry per meaningful change.**
233
- Squash related commits into a single entry
234
- 4. **Include references.**
235
- Link to PR numbers and issues: `(#123)`, `([#123](url))`
236
- 5. **Credit authors for external contributions.**
237
- `(@username)` for non-core contributors
238
- 6. **Lead with impact.**
239
- Put the most important changes first within each category
240
- 7. **Be specific.**
241
- "Fix crash when uploading files larger than 10MB" not "Fix upload bug"
242
- 8. **Keep entries to one line.**
243
- If you need more, the change probably needs multiple entries or a migration guide
244
-
245
- #### Entry Format
246
-
247
- ```markdown
248
- - Add dark mode support with automatic system preference detection (#142)
249
- - **BREAKING:** Remove deprecated `v1/users` endpoint; use `v2/users` instead (#138)
250
- - Fix memory leak in WebSocket connection handler (#145)
251
- ```
252
-
253
- ### Phase 5 — Assemble the Changelog
254
-
255
- #### File Format (Keep a Changelog)
256
-
257
- ```markdown
258
- # Changelog
259
-
260
- All notable changes to this project will be documented in this file.
261
-
262
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
263
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
264
-
265
- ## [Unreleased]
266
-
267
- ### Added
268
- - Description of new feature (#PR)
269
-
270
- ### Fixed
271
- - Description of bug fix (#PR)
272
-
273
- ## [1.2.0] - 2025-09-15
274
-
275
- ### Added
276
- - Add OAuth2 authentication support (#89)
277
- - Add CSV export for user data (#92)
278
-
279
- ### Changed
280
- - Improve query performance for large datasets (#91)
281
-
282
- ### Fixed
283
- - Fix timezone handling in scheduled reports (#88)
284
- - Fix incorrect pagination count on filtered results (#90)
285
-
286
- ### Removed
287
- - **BREAKING:** Remove legacy XML API endpoint (#87)
288
-
289
- ## [1.1.0] - 2025-06-01
290
-
291
- ### Added
292
- - ...
293
-
294
- [Unreleased]: https://github.com/user/repo/compare/v1.2.0...HEAD
295
- [1.2.0]: https://github.com/user/repo/compare/v1.1.0...v1.2.0
296
- [1.1.0]: https://github.com/user/repo/compare/v1.0.0...v1.1.0
297
- ```
298
-
299
- #### Critical Format Rules
300
-
301
- 1. **H1 for title.** `# Changelog` — only one H1
302
- 2. **H2 for versions.** `## [1.2.0] - 2025-09-15` — square brackets around version, ISO date
303
- 3. **H3 for categories.** `### Added`, `### Changed`, etc. — only use categories that have entries
304
- 4. **Comparison links at the bottom.** Every version heading must have a corresponding comparison link
305
- 5. **Unreleased section at top.** Always present, even if empty (remove if the project prefers not to have it)
306
- 6. **Newest version first.** Reverse chronological order
307
- 7. **ISO 8601 dates.** `YYYY-MM-DD` — no exceptions
308
- 8. **Empty categories.** Do NOT include a category heading if there are no entries under it
309
-
310
- ---
311
-
312
- ## Operating Modes
313
-
314
- ### Mode A: Generate from Scratch
315
-
316
- No existing changelog. Generate the full history.
317
-
318
- 1. Get all tags sorted chronologically
319
- 2. For each tag pair (oldest to newest), extract and categorize commits
320
- 3. Assemble full changelog
321
- 4. If there are many tags (>10), ask the user if they want all history or just recent versions
322
-
323
- ```bash
324
- # Get tags in chronological order
325
- git tag --sort=creatordate
326
-
327
- # Get date of a tag
328
- git log -1 --format=%aI v1.0.0
329
- ```
330
-
331
- ### Mode B: Update Existing Changelog
332
-
333
- A CHANGELOG.md already exists. Add new entries.
334
-
335
- 1. Parse the existing changelog to find the latest documented version
336
- 2. Determine the commit range: latest documented version → HEAD (or → new tag)
337
- 3. Generate entries only for the new range
338
- 4. Insert the new version section after `## [Unreleased]` (or at the top if no Unreleased)
339
- 5. Update comparison links at the bottom
340
- 6. Preserve all existing content exactly as-is
341
-
342
- **Never modify existing entries** unless the user explicitly asks for a reformat.
343
-
344
- ### Mode C: Reformat / Clean Up
345
-
346
- User has a messy or inconsistent changelog. Rewrite to match the standard.
347
-
348
- 1. Parse all existing entries
349
- 2. Re-categorize under Keep a Changelog headings
350
- 3. Fix date formats to ISO 8601
351
- 4. Add missing comparison links
352
- 5. Fix heading hierarchy
353
- 6. Show a diff/summary of changes to the user before writing
354
-
355
- ### Mode D: Prepare Release
356
-
357
- User wants to create a changelog entry for an upcoming release.
358
-
359
- 1. Extract commits since the last tag
360
- 2. Categorize and write entries
361
- 3. Ask the user for the new version number (or suggest one based on changes: major if breaking, minor if features, patch if only fixes)
362
- 4. Move entries from `## [Unreleased]` to the new version section
363
- 5. Update comparison links
364
- 6. Optionally suggest a SemVer bump
365
-
366
- ---
367
-
368
- ## Handling Edge Cases
369
-
370
- ### No Tags
371
-
372
- If the project has no tags, treat all commits as unreleased.
373
-
374
- Ask the user if they want to:
375
-
376
- - Generate a single `## [Unreleased]` section
377
- - Create a `## [0.1.0]` retroactively from the initial commit
378
-
379
- ### Monorepo
380
-
381
- If the project is a monorepo with multiple packages:
382
-
383
- - Ask which package to generate for
384
- - Filter commits by path: `git log -- packages/package-name/`
385
- - Consider separate changelogs per package
386
-
387
- ### Squash Merges
388
-
389
- If the project uses squash merges, the PR title becomes the commit message. These are often well-written and can be used directly as changelog entries.
390
-
391
- ### Very Large History
392
-
393
- If there are >500 commits to process:
394
-
395
- - Process in batches by tag range
396
- - Ask the user if they want full history or just the last N versions
397
- - For initial generation, suggest starting from the latest 3-5 versions
398
-
399
- ### Pre-1.0 Projects
400
-
401
- For projects that haven't reached 1.0:
402
-
403
- - Minor bumps may contain breaking changes (per SemVer spec)
404
- - Still flag breaking changes but note the pre-1.0 context
405
-
406
- ---
407
-
408
- ## Quality Checklist
409
-
410
- After generating, verify:
411
-
412
- ### Format
413
-
414
- - [ ] Single H1 (`# Changelog`)
415
- - [ ] Each version is H2 with brackets and ISO date: `## [X.Y.Z] - YYYY-MM-DD`
416
- - [ ] Categories are H3: `### Added`, `### Changed`, etc.
417
- - [ ] No empty categories (remove heading if no entries)
418
- - [ ] Comparison links at bottom for every version
419
- - [ ] Newest version first (reverse chronological)
420
- - [ ] Unreleased section present at top
421
-
422
- ### Content
423
-
424
- - [ ] Every entry starts with imperative verb
425
- - [ ] PR/issue references included where available
426
- - [ ] Breaking changes clearly marked with **BREAKING:**
427
- - [ ] No noise commits (merge commits, version bumps, CI-only changes)
428
- - [ ] Entries are specific and user-facing
429
- - [ ] Related commits are squashed into single entries
430
-
431
- ### Accuracy
432
-
433
- - [ ] Version numbers match actual git tags
434
- - [ ] Dates match tag creation dates
435
- - [ ] Comparison links use correct tag names
436
- - [ ] No commits are attributed to the wrong version
437
-
438
- ---
439
-
440
- ## Anti-Patterns to Avoid
441
-
442
- 1. **Dump of commit messages** — A changelog is not `git log --oneline`. Curate and rewrite.
443
- 2. **"Bug fixes and improvements"** — This tells the user nothing. Be specific.
444
- 3. **Including every single commit** — Filter noise. Only user-facing changes matter.
445
- 4. **Inconsistent tense** — Always imperative mood: "Add", "Fix", "Remove"
446
- 5. **Missing links** — Always include comparison links at the bottom
447
- 6. **Invented version numbers** — Only use versions that correspond to actual tags
448
- 7. **Reformatting existing entries** — When updating, never touch historical entries unless asked
449
- 8. **Skipping the preamble** — Always include the "format is based on" reference lines
450
-
451
- ---
452
-
453
- ## Output
454
-
455
- The final output should be:
456
-
457
- 1. **Convention report**: What commit convention was detected, how many commits processed
458
- 2. **The CHANGELOG.md file**: Written to the project root, ready to commit
459
- 3. **Summary**: Number of versions documented, total entries, any commits that were ambiguous or skipped
460
-
461
- Always write the changelog as a file so the user can review and commit it directly.