home / skills / phrazzld / claude-config / changelog-setup

changelog-setup skill

/skills/changelog-setup

This skill helps you set up a complete changelog and release workflow with semantic-release, commitlint, Lefthook, GitHub Actions, and LLM synthesis.

npx playbooks add skill phrazzld/claude-config --skill changelog-setup

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
5.3 KB
---
name: changelog-setup
description: |
  Full changelog infrastructure from scratch. Greenfield workflow.
  Installs semantic-release, commitlint, GitHub Actions, LLM synthesis, public page.
effort: medium
---

# Changelog Setup

Complete changelog and release notes infrastructure for a project that doesn't have one.

## When to Use

Project has no release infrastructure. Starting fresh.

## Workflow

This workflow installs components in sequence:

### 1. Assess (confirm greenfield)

Run `changelog-assess` to confirm this is actually greenfield. If partial infrastructure exists, consider audit/reconcile instead.

### 2. Install Dependencies

```bash
pnpm add -D semantic-release \
  @semantic-release/changelog \
  @semantic-release/git \
  @semantic-release/github \
  @commitlint/cli \
  @commitlint/config-conventional
```

### 3. Configure semantic-release

Create `.releaserc.js`:

```javascript
// See references/semantic-release-config.md for full config
module.exports = {
  branches: ['main', 'master'],
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',
    ['@semantic-release/changelog', {
      changelogFile: 'CHANGELOG.md',
    }],
    '@semantic-release/npm', // or remove if not publishing to npm
    ['@semantic-release/git', {
      assets: ['CHANGELOG.md', 'package.json'],
      message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
    }],
    '@semantic-release/github',
  ],
};
```

### 4. Configure commitlint

Create `commitlint.config.js`:

```javascript
module.exports = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'type-enum': [2, 'always', [
      'feat', 'fix', 'docs', 'style', 'refactor',
      'perf', 'test', 'build', 'ci', 'chore', 'revert'
    ]],
    'subject-case': [2, 'always', 'lower-case'],
    'header-max-length': [2, 'always', 100],
  },
};
```

### 5. Add Lefthook Hook

Update `lefthook.yml` (create if doesn't exist):

```yaml
commit-msg:
  commands:
    commitlint:
      run: pnpm commitlint --edit {1}
```

Run `pnpm lefthook install` to activate.

### 6. Create GitHub Actions Workflow

Create `.github/workflows/release.yml`:

```yaml
# See references/github-actions-release.md for full workflow
name: Release

on:
  push:
    branches: [main, master]

permissions:
  contents: write
  issues: write
  pull-requests: write

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          persist-credentials: false

      - uses: pnpm/action-setup@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: 'pnpm'

      - run: pnpm install --frozen-lockfile
      - run: pnpm build

      - name: Release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        run: pnpm semantic-release

  synthesize-notes:
    needs: release
    if: needs.release.outputs.new_release_published == 'true'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Synthesize Release Notes
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
        run: |
          # See references/llm-synthesis.md for script
          node scripts/synthesize-release-notes.mjs
```

### 7. Configure LLM Synthesis

Create `.release-notes-config.yml`:

```yaml
# App-specific configuration for release notes synthesis
app_name: "Your App Name"
personality: "professional, friendly, confident"
audience: "non-technical users"

tone_examples:
  - "We made it faster to find what you need"
  - "Your dashboard now shows more detail"

avoid:
  - Technical jargon (API, SDK, webhook, etc.)
  - Git commit references
  - Internal code names
  - Version numbers in descriptions

categories:
  feat: "New Features"
  fix: "Improvements"
  perf: "Performance"
  chore: "Behind the Scenes"
  refactor: "Behind the Scenes"
  docs: "Documentation"
  test: "Quality"
```

Create `scripts/synthesize-release-notes.mjs`:
(See `references/llm-synthesis-script.md` for full implementation)

### 8. Scaffold Public Changelog Page

Run `changelog-page` to scaffold:
- `/app/changelog/page.tsx` - Main page component
- `/app/changelog.xml/route.ts` - RSS feed
- `/lib/github-releases.ts` - GitHub API client

### 9. Set Up Secrets

Required GitHub secrets:
- `GITHUB_TOKEN` - Automatically provided
- `GEMINI_API_KEY` - Get from Google AI Studio
- `NPM_TOKEN` - Only if publishing to npm

```bash
# Add Gemini API key to GitHub secrets
gh secret set GEMINI_API_KEY --body "your-api-key"
```

### 10. Verify

Run `changelog-verify` to confirm everything works:
- Commit with conventional format succeeds
- commitlint rejects bad commits
- Push to main triggers release workflow
- GitHub Release created
- LLM synthesis runs
- Public page displays notes

## Quality Gate

Do not consider setup complete until `changelog-verify` passes.

## Handoff

When complete, the project should have:
- semantic-release configured
- commitlint enforcing conventional commits
- Lefthook running commitlint on commit-msg
- GitHub Actions workflow for releases
- LLM synthesis for user-friendly notes
- Public changelog page at `/changelog`
- RSS feed at `/changelog.xml`

Developer workflow:
1. Write code
2. Commit with `feat:`, `fix:`, etc.
3. Push/merge to main
4. Everything else is automatic

Overview

This skill installs a full changelog and release-notes infrastructure for a greenfield repository. It wires up semantic-release, commitlint, Lefthook, GitHub Actions, LLM synthesis, and a public changelog page so releases and user-facing notes are automatic. The goal is a repeatable, verified pipeline that converts conventional commits into published releases and readable release notes.

How this skill works

The skill runs an assessment to confirm the repo is truly greenfield, then installs and configures semantic-release and commitlint, sets up pre-commit hooks with Lefthook, and creates a GitHub Actions release workflow. After releases, an LLM synthesizes user-friendly notes according to project configuration, and a scaffolded public changelog page (plus RSS) is published. Verification steps validate commit linting, CI release execution, LLM synthesis, and the public page.

When to use it

  • Starting a repository with no existing release or changelog infrastructure
  • You want automated releases based on conventional commits
  • You need user-friendly release notes synthesized from commits and PRs
  • You want a public changelog page and RSS feed for users
  • You want CI-driven, repeatable release automation with verification

Best practices

  • Confirm greenfield with the assess step; if partial config exists, choose an audit path
  • Enforce conventional commit types to ensure semantic-release calculates versions correctly
  • Keep the LLM synthesis config focused on audience and tone; avoid internal jargon
  • Store GEMINI_API_KEY and NPM_TOKEN as GitHub secrets before enabling workflows
  • Run changelog-verify after setup to close the quality gate

Example use cases

  • New product repo where releases should be automatic and changelogs public
  • Open-source library that needs semantic versioning and consistent release notes
  • Internal app where product teams want user-friendly, non-technical release summaries
  • Monorepo package that will publish to npm and needs changelog files per package
  • Project that requires an RSS feed of releases for downstream consumers

FAQ

What does changelog-verify check?

It confirms commitlint enforces conventional commits, the release workflow runs on push, a GitHub Release is created, the LLM synthesis step executes, and the public changelog page displays the notes.

Do I need npm publishing?

No. The setup includes @semantic-release/npm as optional — remove it if you do not publish to npm.