Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .claude/commands/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
description: Maintains CHANGELOG.md in the project root using git commit history. Use when the user invokes /changelog, asks to "update the changelog", "generate a changelog", or wants to record what changed before merging a branch. Creates the file from scratch if it doesn't exist (all commits grouped by date); otherwise appends only commits newer than the last recorded date.
---

# Changelog Skill

## Workflow

1. Run the script from the project root:

```bash
python3 .claude/commands/scripts/changelog.py
```

2. The script handles both cases automatically:
- **No CHANGELOG.md**: reads full git history, writes the file with all dates
- **CHANGELOG.md exists**: finds the newest `## YYYY-MM-DD` heading, fetches commits after that date, prepends new sections

3. Review the output, edit bullet wording if needed, then commit `CHANGELOG.md` as part of the merge commit.

## Format

```markdown
# Changelog

## 2026-06-17

- Add responsive design to layout and CSS
- Add Vitest test suite for components and routes

## 2026-04-13

- Initial project scaffold
```

- One `# Changelog` title at the top
- Date headings as `## YYYY-MM-DD`, newest first
- Each commit is one bullet; wording may be cleaned up manually after generation

## Notes

- Run from the **project root** (same directory as `.git/`)
- Commit subjects come directly from `git log`; clean them up manually if needed
- The script is idempotent: re-running when nothing is new prints a message and exits without modifying the file
78 changes: 78 additions & 0 deletions .claude/commands/scripts/changelog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env python3
"""Maintain CHANGELOG.md from git commit history."""

import subprocess
import sys
from collections import defaultdict
from datetime import datetime
from pathlib import Path


def git_log(since_date=None):
"""Return commits as {date: [subject, ...]} ordered newest-first."""
cmd = ["git", "log", "--format=%ad|%s", "--date=short"]
if since_date:
cmd.append(f"--after={since_date}")
result = subprocess.run(cmd, capture_output=True, text=True, check=True)
by_date = defaultdict(list)
for line in result.stdout.strip().splitlines():
if "|" in line:
date, subject = line.split("|", 1)
by_date[date.strip()].append(subject.strip())
return by_date


def last_date_in_changelog(path):
"""Return the first ## YYYY-MM-DD heading found, or None."""
for line in path.read_text().splitlines():
if line.startswith("## "):
candidate = line[3:].strip()
try:
datetime.strptime(candidate, "%Y-%m-%d")
return candidate
except ValueError:
continue
return None


def render_sections(by_date):
lines = []
for date in sorted(by_date, reverse=True):
lines.append(f"\n## {date}\n")
for subject in by_date[date]:
lines.append(f"- {subject}\n")
return lines


def main():
changelog = Path("CHANGELOG.md")

if not changelog.exists():
by_date = git_log()
if not by_date:
print("No commits found — nothing to write.")
sys.exit(0)
content = ["# Changelog\n"] + render_sections(by_date)
changelog.write_text("".join(content))
total = sum(len(v) for v in by_date.values())
print(f"Created CHANGELOG.md with {total} entries across {len(by_date)} date(s).")
else:
last = last_date_in_changelog(changelog)
by_date = git_log(since_date=last)
# --after is exclusive, but drop last date if present to be safe
by_date.pop(last, None)
if not by_date:
print("No new commits since last entry — CHANGELOG.md is up to date.")
sys.exit(0)
existing = changelog.read_text()
lines = existing.splitlines(keepends=True)
# Insert new sections after the title line
insert_at = 1 if lines and lines[0].startswith("# ") else 0
updated = "".join(lines[:insert_at] + render_sections(by_date) + lines[insert_at:])
changelog.write_text(updated)
total = sum(len(v) for v in by_date.values())
print(f"Added {total} new entries to CHANGELOG.md.")


if __name__ == "__main__":
main()
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Changelog

## 2026-06-17
- Combine phases 2-5 into single phase 2 in roadmap
- Add root-level /changelog skill and initial CHANGELOG.md
- Merge Replanning-Branch into main
- Add /changelog skill and initial CHANGELOG.md
- Require responsive design across specs and CSS
- Add vitest and new test cases
- Merge phase-2-base-layout into main
- Phase 2: base layout with Header, Main, Footer subcomponents
- implementing phase 2 hono app
- AgentClinic SDD deeplearning course

## 2026-06-01
- Enhance README with DeepLearning.AI resource links
- Update course title in README

## 2026-04-20
- Rename Lesson_NN folders to VideoNN_Title and update README
- Add README to Lesson_04 mirroring Lesson_05

## 2026-04-16
- Add prompts to all lessons

## 2026-04-14
- Unpack changelog.skill into changelog/ folder in Lessons 09-13
- Populate Lesson_11-13 and add generic feature-spec skill
- Add Git to prerequisites and link to WebStorm download
- Add .gitignore for .DS_Store and local script file

## 2026-04-13
- Rename lesson folders with zero-padded numbers for correct sort order
- Add course lesson folders, skills, example specs, and README
44 changes: 44 additions & 0 deletions Video09_Project_Replanning/.claude/commands/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
description: Maintains CHANGELOG.md in the project root using git commit history. Use when the user invokes /changelog, asks to "update the changelog", "generate a changelog", or wants to record what changed before merging a branch. Creates the file from scratch if it doesn't exist (all commits grouped by date); otherwise appends only commits newer than the last recorded date.
---

# Changelog Skill

## Workflow

1. Run the script from the project root:

```bash
python3 .claude/commands/scripts/changelog.py
```

2. The script handles both cases automatically:
- **No CHANGELOG.md**: reads full git history, writes the file with all dates
- **CHANGELOG.md exists**: finds the newest `## YYYY-MM-DD` heading, fetches commits after that date, prepends new sections

3. Review the output, edit bullet wording if needed, then commit `CHANGELOG.md` as part of the merge commit.

## Format

```markdown
# Changelog

## 2026-03-31

- Add responsive design to layout and CSS
- Add Vitest test suite for components and routes

## 2026-03-30

- Initial project scaffold
```

- One `# Changelog` title at the top
- Date headings as `## YYYY-MM-DD`, newest first
- Each commit is one bullet; wording may be cleaned up manually after generation

## Notes

- Run from the **project root** (same directory as `.git/`)
- Commit subjects come directly from `git log`; clean them up manually if needed
- The script is idempotent: re-running when nothing is new prints a message and exits without modifying the file
78 changes: 78 additions & 0 deletions Video09_Project_Replanning/.claude/commands/scripts/changelog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env python3
"""Maintain CHANGELOG.md from git commit history."""

import subprocess
import sys
from collections import defaultdict
from datetime import datetime
from pathlib import Path


def git_log(since_date=None):
"""Return commits as {date: [subject, ...]} ordered newest-first."""
cmd = ["git", "log", "--format=%ad|%s", "--date=short"]
if since_date:
cmd.append(f"--after={since_date}")
result = subprocess.run(cmd, capture_output=True, text=True, check=True)
by_date = defaultdict(list)
for line in result.stdout.strip().splitlines():
if "|" in line:
date, subject = line.split("|", 1)
by_date[date.strip()].append(subject.strip())
return by_date


def last_date_in_changelog(path):
"""Return the first ## YYYY-MM-DD heading found, or None."""
for line in path.read_text().splitlines():
if line.startswith("## "):
candidate = line[3:].strip()
try:
datetime.strptime(candidate, "%Y-%m-%d")
return candidate
except ValueError:
continue
return None


def render_sections(by_date):
lines = []
for date in sorted(by_date, reverse=True):
lines.append(f"\n## {date}\n")
for subject in by_date[date]:
lines.append(f"- {subject}\n")
return lines


def main():
changelog = Path("CHANGELOG.md")

if not changelog.exists():
by_date = git_log()
if not by_date:
print("No commits found — nothing to write.")
sys.exit(0)
content = ["# Changelog\n"] + render_sections(by_date)
changelog.write_text("".join(content))
total = sum(len(v) for v in by_date.values())
print(f"Created CHANGELOG.md with {total} entries across {len(by_date)} date(s).")
else:
last = last_date_in_changelog(changelog)
by_date = git_log(since_date=last)
# --after is exclusive, but drop last date if present to be safe
by_date.pop(last, None)
if not by_date:
print("No new commits since last entry — CHANGELOG.md is up to date.")
sys.exit(0)
existing = changelog.read_text()
lines = existing.splitlines(keepends=True)
# Insert new sections after the title line
insert_at = 1 if lines and lines[0].startswith("# ") else 0
updated = "".join(lines[:insert_at] + render_sections(by_date) + lines[insert_at:])
changelog.write_text(updated)
total = sum(len(v) for v in by_date.values())
print(f"Added {total} new entries to CHANGELOG.md.")


if __name__ == "__main__":
main()
30 changes: 30 additions & 0 deletions Video09_Project_Replanning/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Changelog

## 2026-06-17
- Require responsive design across specs and CSS
- Add vitest and new test cases
- Merge phase-2-base-layout into main
- Phase 2: base layout with Header, Main, Footer subcomponents
- implementing phase 2 hono app
- AgentClinic SDD deeplearning course

## 2026-06-01
- Enhance README with DeepLearning.AI resource links
- Update course title in README

## 2026-04-20
- Rename Lesson_NN folders to VideoNN_Title and update README
- Add README to Lesson_04 mirroring Lesson_05

## 2026-04-16
- Add prompts to all lessons

## 2026-04-14
- Unpack changelog.skill into changelog/ folder in Lessons 09-13
- Populate Lesson_11-13 and add generic feature-spec skill
- Add Git to prerequisites and link to WebStorm download
- Add .gitignore for .DS_Store and local script file

## 2026-04-13
- Rename lesson folders with zero-padded numbers for correct sort order
- Add course lesson folders, skills, example specs, and README
Loading