Skip to content

feat: Added skill to check if user is creating a similar existing component#138

Open
dlabaj wants to merge 1 commit into
patternfly:mainfrom
dlabaj:issue-85
Open

feat: Added skill to check if user is creating a similar existing component#138
dlabaj wants to merge 1 commit into
patternfly:mainfrom
dlabaj:issue-85

Conversation

@dlabaj

@dlabaj dlabaj commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This skill checks if a user is creating an equivalent PatternFly component. If so it informs the user and assists them with migrating to a patternfly component.

Summary by CodeRabbit

  • New Features

    • Added a React skill to detect custom components that overlap with PatternFly components.
    • Provides suggested PatternFly replacements, approval-based replacement guidance, and build verification.
    • Added reference guidance for matching component roles to PatternFly components.
  • Documentation

    • Updated plugin catalogs, skill descriptions, contribution guidance, and README listings.
    • Refreshed the Skills badge count and plugin name formatting.
    • Expanded code review validation to identify potential component reuse opportunities.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds the pf-component-reuse-check React skill, documenting PatternFly component matching and optional replacement for uncommitted code. Registers the skill in plugin catalogs and code-review validation, and updates related repository documentation.

Changes

Component reuse skill

Layer / File(s) Summary
Reuse audit and replacement workflow
plugins/react/skills/pf-component-reuse-check/...
Defines scoped candidate collection, PatternFly matching, user-confirmed replacement, build verification, guardrails, and role-based search aliases.
Plugin and review-agent integration
CONTRIBUTING-SKILLS.md, PLUGINS.md, plugins/code-review/agents/pf-assist.md, plugins/react/README.md
Lists the new skill and routes code-review validation to it for potentially overlapping uncommitted custom React components.
Catalog and repository documentation updates
PLUGINS.md, plugins/pf-workshop/README.md, README.md
Updates catalog wording, the skills badge count, and available-plugin name encodings.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: jpuzz0, jschuler, github-actions[bot], evwilkin

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is clearly related to the main change: adding a skill that checks for existing PatternFly-equivalent components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch issue-85

Warning

Review ran into problems

🔥 Problems

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped anthropics/claude-plugins-official.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
plugins/react/skills/pf-component-reuse-check/SKILL.md (1)

70-76: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Nit: keep the matching workflow tool-agnostic.

Naming searchPatternFlyDocs and usePatternFlyDocs as mandatory calls makes the skill dependent on one configured MCP integration. Describe the required capability and provide a fallback, or explicitly document and validate MCP as a hard dependency.

As per path instructions, skills must be tool-agnostic and work in both Claude Code and Cursor without tool-specific references.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/react/skills/pf-component-reuse-check/SKILL.md` around lines 70 - 76,
Update the “Match against PatternFly React” workflow to describe documentation
search and API/example verification without requiring specific MCP tools. Add a
fallback for environments without that integration, such as consulting the
available PatternFly documentation and source, while preserving the package
preference guidance and role-alias lookup.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/react/skills/pf-component-reuse-check/SKILL.md`:
- Around line 1-8: Add the disable-model-invocation: true frontmatter field to
the pf-component-reuse-check skill definition, alongside the existing name and
description metadata, so its file modifications, dependency installation, and
build operations cannot be invoked unattended.

In `@README.md`:
- Around line 36-41: Correct the malformed plugin-name encoding in the README
entries for code-review, design-audit, design-guide, and PatternFly MCP by
replacing each literal “#8209;” sequence with a normal hyphen, an actual
non-breaking hyphen, or the complete “&`#8209`;” entity; preserve the existing
names and descriptions.

---

Nitpick comments:
In `@plugins/react/skills/pf-component-reuse-check/SKILL.md`:
- Around line 70-76: Update the “Match against PatternFly React” workflow to
describe documentation search and API/example verification without requiring
specific MCP tools. Add a fallback for environments without that integration,
such as consulting the available PatternFly documentation and source, while
preserving the package preference guidance and role-alias lookup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 595685cc-2fb3-4029-9565-32bcd570c594

📥 Commits

Reviewing files that changed from the base of the PR and between 9105920 and 132189e.

📒 Files selected for processing (8)
  • CONTRIBUTING-SKILLS.md
  • PLUGINS.md
  • README.md
  • plugins/code-review/agents/pf-assist.md
  • plugins/pf-workshop/README.md
  • plugins/react/README.md
  • plugins/react/skills/pf-component-reuse-check/SKILL.md
  • plugins/react/skills/pf-component-reuse-check/references/role-aliases.md

Comment on lines +1 to +8
---
name: pf-component-reuse-check
description: >-
Detects custom React components in newly created or modified (uncommitted)
code that overlap with PatternFly React components, suggests the PatternFly
equivalent, and can replace the custom component then build to verify.
Use when creating UI components, reviewing uncommitted React changes, or when
the user asks to prefer PatternFly instead of a custom component.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🔴 Critical | ⚡ Quick win

Add the side-effect invocation guard.

This skill can modify source files, remove components, install dependencies, and run builds (Lines 109-137). Add disable-model-invocation: true to prevent unattended model invocation of these operations.

As per coding guidelines, side-effecting skills must set disable-model-invocation: true. Based on learnings, PatternFly skills that mutate files or perform external actions require this guard.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/react/skills/pf-component-reuse-check/SKILL.md` around lines 1 - 8,
Add the disable-model-invocation: true frontmatter field to the
pf-component-reuse-check skill definition, alongside the existing name and
description metadata, so its file modifications, dependency installation, and
build operations cannot be invoked unattended.

Sources: Coding guidelines, Learnings

Comment thread README.md
Comment on lines +36 to +41
| **code-#8209;review** | Code review and quality — adversarial review, security patterns |
| **design-#8209;audit** | Design audit — validate existing code and designs against PatternFly standards |
| **design-#8209;guide** | Design guide — component selection, interaction patterns, AI experience patterns, Figma design creation |
| **migration** | PF version migration — breaking change detection, class scanning, upgrade planning |
| **patternfly‑mcp** | PatternFly MCP server — provides component documentation, design token lookup, and accessibility guidance via the Model Context Protocol |
| **pf‑workshop** | PatternFly team tools and skill incubation — issue triage, release management, codebase auditing, new skill development |
| **patternfly-#8209;mcp** | PatternFly MCP server — provides component documentation, design token lookup, and accessibility guidance via the Model Context Protocol |
| **pf-#8209;workshop** | PatternFly team tools and skill incubation — issue triage, release management, codebase auditing, new skill development |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Nit: fix the malformed plugin-name encoding.

#8209; is rendered as literal text rather than a hyphen entity. Use a normal hyphen, an actual non-breaking hyphen, or the complete ‑ entity.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 36 - 41, Correct the malformed plugin-name encoding
in the README entries for code-review, design-audit, design-guide, and
PatternFly MCP by replacing each literal “#8209;” sequence with a normal hyphen,
an actual non-breaking hyphen, or the complete “&`#8209`;” entity; preserve the
existing names and descriptions.

jpuzz0 pushed a commit to rh-uxd/ai-helpers that referenced this pull request Jul 15, 2026
…tion

Migrated from patternfly/ai-helpers#138. Detects custom React components in
uncommitted changes that overlap PatternFly React components, suggests
replacements, and supports approved replacement with build verification.

Includes CodeRabbit review fixes: disable-model-invocation, tool-agnostic
docs matching, and repo-local skill name references.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant