Generate upgrade notes

From shopsys/shopsys · View interactive version

Generate upgrade notes is an AI agent skill from the GitHub repository shopsys/shopsys. Generates structured upgrade notes for a pull request based on diff analysis. Use when the user asks to generate or write upgrade notes for a PR or the current branch, or invokes /generate-upgrade-notes.

How to use this skill

Skill file

Generate Upgrade Notes

Generates upgrade notes for Shopsys Platform features when creating pull requests. Analyzes code changes and creates structured upgrade note files following project conventions.

Initial Setup

Never ask the user for the pull request or the scope — resolve both automatically before doing anything else:

  1. Pull request — in this order, stop at the first hit:
  1. Scope — take it from the command arguments when given, otherwise infer it from the changed paths:

Ask the user only when neither source yields an answer (for example outside a git repository).

Command Arguments

Workflow

Step 1: Resolve Inputs

Resolve the PR identifier and scope as described in Initial Setup — from the command arguments first, then automatically. Do not stop to ask.

Step 2: Fetch PR Data (Using Subagent)

Launch the pr-diff-fetcher subagent:

Launch a general-purpose subagent:

Description: "Fetch PR diff and metadata"

Prompt: "You are the PR Diff Fetcher subagent. Read the specification at .agents/skills/pull-request-diff-fetcher/SKILL.md and follow it exactly.

Input: {PR_URL or PR_NUMBER or 'current-branch'}

Your task: Fetch complete PR data (diff, metadata, commits) using the best available method (gh CLI → WebFetch → local git) as specified in the helper documentation.

Return structured results following the output format in the specification."

Wait for subagent results.

If the subagent asks for the base branch, answer with the PR's baseRefName or the repository default branch resolved in Initial Setup — do not relay the question to the user.

Step 3: Analyze Changes (Using Subagent)

Launch the upgrade-notes-analyzer subagent:

Launch a general-purpose subagent:

Description: "Analyze BC breaks and movements"

Prompt: "You are the Upgrade Notes Analyzer subagent. Read the specification at .agents/skills/upgrade-notes-analyzer/SKILL.md and follow it exactly.

Input:
- Complete diff content: {from pr-diff-fetcher}
- Commit messages: {from pr-diff-fetcher}
- PR metadata: {from pr-diff-fetcher}
- User-specified scope: {user input or 'infer'}

Your task: Analyze the diff following the critical three-step process:
1. Detect movements FIRST
2. Identify true deletions (not movements)
3. Find modifications and BC breaks

Return structured analysis following the output format in the specification, including ready-to-use upgrade note content."

Wait for subagent results.

Step 4: Generate Upgrade Note Content

Based on analyzer output, prepare the upgrade note file content:

File naming:

Content structure:

#### {PR Title} ([#{PR_NUMBER}](https://github.com/shopsys/shopsys/pull/{PR_NUMBER}))

{Content from analyzer subagent - already formatted}

Decision tree for content:

  1. BC breaks found → Use detailed content from analyzer
  2. No BC breaks BUT project-base changed → Minimal note: title + "see #project-base-diff"
  3. No BC breaks AND no project-base changes → Minimal note: title only

Files to create:

Step 5: Present to User for Review

Show comprehensive summary:

## Analysis Summary

**PR:** #{PR_NUMBER} - {title}
**Base branch:** {branch}
**Method used:** {gh|webfetch|local-git}

### Changes Detected
- **Files changed:** {count}
- **Feature movements:** {count} (project-base → packages)
- **Breaking changes:** {count}
- **Project-base changes:** {yes/no}

### Movements Found
{list movements if any}

### Breaking Changes Found
{list BC breaks if any, or "No breaking changes detected"}

### Scope
**Determined scope:** {backend|storefront|both}
{reasoning if inferred}

---

## Generated Upgrade Notes

### File: upgrade-notes/{scope}_YYYYMMDD_HHmmss.md

{show complete file content}


{if both scope, show second file}

---

Would you like me to:
1. Save this as-is
2. Make edits (please specify changes)
3. Cancel

Step 6: Handle User Response

If user requests edits:

If user approves:

If user cancels:

Step 7: Save the Files

After user confirms:

  1. Create file(s) using Write tool in upgrade-notes/ directory
  2. Confirm successful creation

Final message:

✓ Created upgrade notes:
  - upgrade-notes/{scope}_YYYYMMDD_HHmmss.md
  {- upgrade-notes/{scope2}_YYYYMMDD_HHmmss.md if both}

Ready for inclusion in your PR. These will be combined into UPGRADE-{version}.md during release.

Subagent Architecture

This command uses two specialized subagents (via general-purpose agent with detailed prompts):

1. PR Diff Fetcher (`.agents/skills/pull-request-diff-fetcher/SKILL.md`)

Responsibilities:

2. Upgrade Notes Analyzer (`.agents/skills/upgrade-notes-analyzer/SKILL.md`)

Responsibilities:

Error Handling

If pr-diff-fetcher fails:

If upgrade-notes-analyzer finds issues:

General errors:

Architecture Awareness

Package-first development:

Key file locations:

Quality Checks

1. package-level BC breaks (signatures, removals, renames) — invisible in the project-base diff

2. manual actions invisible in ANY diff (index recreation, exports, cache clears) — phrase them as "after applying the project changes, do X"

3. conditional decisions the developer must make

Example Real-World Patterns

The analyzer subagent has comprehensive examples of upgrade note patterns. Key patterns include:

  1. Simple project-base only (no BC breaks)
  2. Method/property removal with replacement
  3. Constructor/method signature changes
  4. Feature movements from project-base to packages
  5. Conditional instructions ("if you have X")
  6. Database/infrastructure manual actions
  7. GraphQL schema changes
  8. Storefront changes (components, hooks, types)
  9. Configuration changes
  10. Multiple related changes

See .agents/skills/upgrade-notes-analyzer/SKILL.md for detailed examples.

Example Usage Scenarios

With PR link and scope:

User: /generate-upgrade-notes https://github.com/shopsys/shopsys/pull/4183 backend

With just PR number:

User: /generate-upgrade-notes 4169

Current branch analysis:

User: /generate-upgrade-notes

Both scopes:

User: /generate-upgrade-notes 4135 both
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.