Skip to content

Breaking change analyzer for PF Core #3

Description

@srambach

Agent Name

find-breaking-change

Problem It Solves

Analyzes PatternFly pull requests for breaking changes to HTML and CSS (excluding React code). This agent helps PR reviewers and maintainers systematically identify changes that could break downstream consumers by examining:

  • CSS class name changes (.pf-v6-c-*, .pf-v6-l-*, .pf-v6-u-*)
  • CSS variable changes (--pf-v6-*, --pf-t--*)
  • HTML structure modifications in .hbs files
  • ARIA attribute changes
  • Selector specificity changes

The agent categorizes findings by severity (High/Medium/Low) and provides migration recommendations.

Agent Markdown

---
description: Analyze a pull request for breaking changes to HTML and CSS
args:
  pr_number:
    description: The pull request number to analyze
    required: true
---

Analyze pull request #{{ pr_number }} for breaking changes to HTML and CSS following the PatternFly Breaking Changes Analyzer agent specification.

Focus on:
1. CSS class name changes (`.pf-v6-c-*`, `.pf-v6-l-*`, `.pf-v6-u-*`)
2. CSS variable changes (`--pf-v6-*`, `--pf-t--*`)
3. HTML structure changes in `.hbs` files
4. ARIA attribute changes
5. Selector specificity changes

**Analysis Workflow:**

### Step 1: Identify Changed Files
- Get list of changed `.scss` and `.hbs` files in the PR
- Focus on `src/patternfly/components/**`, `src/patternfly/layouts/**`, `src/patternfly/utilities/**`

### Step 2: Analyze SCSS Changes
For each changed `.scss` file:
1. Scan for removed/renamed classes matching `.pf-v6-[clu]-*`
2. Scan for removed/renamed CSS variables (`--pf-v6-*`, `--pf-t--*`)
3. Check variable default value changes (>20% is potentially breaking)
4. Identify selector structure changes

### Step 3: Analyze HBS Changes
For each changed `.hbs` file:
1. Check for removed elements
2. Check for changed element types (e.g., `<div>``<span>`)
3. Check for ARIA attribute changes
4. Check for required attribute changes

### Step 4: Categorize by Severity

**High Severity:**
- Renamed/removed CSS classes
- Removed CSS variables
- Changed element types
- Removed required elements

**Medium Severity:**
- Modifier class changes
- CSS variable value changes (>20%)
- ARIA attribute changes
- New required classes

**Low Severity:**
- Unit conversions (px → rem)
- Minor value adjustments (<20%)
- New optional classes/elements

### Step 5: Generate Report

Provide a detailed report with:
- Summary of changes
- Breaking changes categorized by severity
- Impact analysis
- Migration recommendations
- Files reviewed

Use the agent specification at `.claude/agents/find-breaking-change.md` for complete detection rules and PatternFly context.

Testing

How to Test

  1. Clone the PatternFly repository
  2. Place agent file at .claude/agents/find-breaking-change.md
  3. Place command file at .claude/commands/find-breaking-change.md
  4. Restart Claude Code
  5. Run: /find-breaking-change pr_number=7985

Tested On

  • Repository: patternfly/patternfly
  • PR #7985: "fix(compass): restructure navigation to include home and search"

Test Results

Successfully identified:

  • 2 Medium Severity changes (new HTML structure, CSS variable refactoring from shorthand to longhand)
  • Multiple low-severity additions (new classes, icons)
  • Provided migration recommendations
  • Assessed backward compatibility
  • Generated comprehensive markdown report

Observations

What worked:

  • Systematically identified CSS variable refactoring (shorthand --Padding → longhand --PaddingBlockStart, etc.)
  • Detected new HTML structure requirements
  • Distinguished between breaking changes and backward-compatible additions
  • Provided actionable migration guidance
  • Correctly categorized severity levels
  • Generated well-structured markdown report

What needs improvement:

  • Could benefit from automated CSS variable value comparison (calculating % changes)
  • Could integrate with semantic-release to suggest proper commit message format
  • May need refinement for edge cases in different component types

Additional notes:

  • Agent understands PatternFly's BEM naming conventions
  • Recognizes PatternFly's two-layer CSS variable system (component vars + design tokens)
  • Particularly useful for reviewing PRs before release to catch undocumented breaking changes
  • Recommended to use as part of PR review process alongside manual review

Generated with Claude ;-D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions