feat: Added skill to check if user is creating a similar existing component#138
feat: Added skill to check if user is creating a similar existing component#138dlabaj wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughAdds the ChangesComponent reuse skill
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Warning Review ran into problems🔥 ProblemsLinked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
plugins/react/skills/pf-component-reuse-check/SKILL.md (1)
70-76: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winNit: keep the matching workflow tool-agnostic.
Naming
searchPatternFlyDocsandusePatternFlyDocsas 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
📒 Files selected for processing (8)
CONTRIBUTING-SKILLS.mdPLUGINS.mdREADME.mdplugins/code-review/agents/pf-assist.mdplugins/pf-workshop/README.mdplugins/react/README.mdplugins/react/skills/pf-component-reuse-check/SKILL.mdplugins/react/skills/pf-component-reuse-check/references/role-aliases.md
| --- | ||
| 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. |
There was a problem hiding this comment.
🔒 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
| | **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 | |
There was a problem hiding this comment.
🎯 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.
…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>
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
Documentation