Skip to content

Commit fa430f7

Browse files
committed
update structure to match updates to repo
1 parent ac6131d commit fa430f7

13 files changed

Lines changed: 180 additions & 1805 deletions

File tree

AGENTS.md

Lines changed: 0 additions & 84 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: pf6-conventions
3+
description: Always-on PatternFly 6 React conventions for imports, styling, and accessibility. Use when writing, reviewing, or refactoring PatternFly React code.
4+
---
5+
6+
# PatternFly 6 Conventions
7+
8+
Apply these rules by default for PatternFly React work.
9+
10+
## Core rules
11+
12+
- Use PatternFly v6 classes only (`pf-v6-*`).
13+
- Prefer semantic tokens (`--pf-t--*`) over hardcoded values.
14+
- Use PatternFly components for layout and typography before utility classes.
15+
- Keep accessibility baseline: labels for interactive controls, keyboard support, and semantic heading structure.
16+
- For API/source-of-truth checks, query the PatternFly MCP server first to get the latest component docs and examples.
17+
18+
## Import rules
19+
20+
- Charts must import from `@patternfly/react-charts/victory`.
21+
- Chatbot components must import from `@patternfly/chatbot/dist/dynamic/*`.
22+
- Component groups must import from `@patternfly/react-component-groups/dist/dynamic/*`.
23+
24+
## CSS rules
25+
26+
Always include:
27+
28+
```tsx
29+
import "@patternfly/react-core/dist/styles/base.css";
30+
```
31+
32+
Include package CSS only when used:
33+
34+
```tsx
35+
import "@patternfly/patternfly/patternfly-charts.css";
36+
import "@patternfly/chatbot/dist/css/main.css";
37+
import "@patternfly/react-component-groups/dist/css/main.css";
38+
```
39+
40+
## Common anti-patterns
41+
42+
- Do not import charts from `@patternfly/react-charts` root.
43+
- Do not use `pf-v5-*`, `pf-c-*`, or unversioned `pf-*` class prefixes.
44+
- Do not rely on inline hardcoded spacing/color when a token exists.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: pf-class-migration-scanner
3+
description: Scans for legacy PatternFly class usage and recommends PF6-safe replacements. Use when modernizing older PatternFly codebases.
4+
---
5+
6+
# PF Class Migration Scanner
7+
8+
Locate legacy PatternFly class names and migration risks.
9+
10+
When migration recommendations are ambiguous, query the PatternFly MCP server first to verify the latest supported component patterns and tokens.
11+
12+
## Migration scope
13+
14+
- Legacy versioned classes (`pf-v5-*`, `pf-v4-*`)
15+
- Unversioned legacy classes (`pf-c-*`, `pf-u-*`, `pf-l-*`, `pf-m-*`)
16+
- Old token usage where semantic token equivalents exist
17+
18+
## Scan commands
19+
20+
```bash
21+
rg "pf-v5-|pf-v4-|pf-c-|pf-u-|pf-l-|pf-m-" src
22+
rg "--pf-v6-|--pf-global-" src
23+
```
24+
25+
## Replacement guidance
26+
27+
- Prefer PatternFly React component props and composition first.
28+
- If a utility class is still needed, use `pf-v6-u-*` variants.
29+
- Prefer semantic tokens (`--pf-t--*`) over hardcoded values and legacy token names.
30+
31+
## Output format
32+
33+
For each finding include:
34+
35+
- file path
36+
- current class/token
37+
- recommended PF6 replacement
38+
- confidence (`high`, `medium`, `low`)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: pf-import-checker
3+
description: Audits and fixes PatternFly import paths, with emphasis on charts, chatbot, and component-groups. Use when imports fail or PatternFly modules are unresolved.
4+
---
5+
6+
# PF Import Checker
7+
8+
Find and fix invalid PatternFly import patterns.
9+
10+
Before proposing import fixes, use the PatternFly MCP server to confirm current package paths and examples from the latest docs.
11+
12+
## What to check
13+
14+
1. Charts imported from `@patternfly/react-charts` root (invalid for Victory components).
15+
2. Chatbot imports not using `@patternfly/chatbot/dist/dynamic/*`.
16+
3. Component-group imports not using `@patternfly/react-component-groups/dist/dynamic/*`.
17+
4. Missing package CSS imports for features in use.
18+
19+
## Validation commands
20+
21+
```bash
22+
rg "@patternfly/react-charts['\"]" src
23+
rg "@patternfly/chatbot['\"]" src
24+
rg "@patternfly/react-component-groups['\"]" src
25+
```
26+
27+
## Correct import examples
28+
29+
```tsx
30+
import { ChartDonut } from "@patternfly/react-charts/victory";
31+
import { Chatbot } from "@patternfly/chatbot/dist/dynamic/Chatbot";
32+
import { BulkSelect } from "@patternfly/react-component-groups/dist/dynamic/BulkSelect";
33+
```
34+
35+
## Output format
36+
37+
Provide:
38+
39+
- offending file paths
40+
- exact import lines to replace
41+
- corrected import lines
42+
- any CSS import additions needed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: pf-project-scaffolder
3+
description: Scaffolds PatternFly React projects with PF6-safe dependencies, imports, and starter layout. Use when creating a new PatternFly app or bootstrapping a migration sandbox.
4+
---
5+
6+
# PF Project Scaffolder
7+
8+
Create a clean PatternFly React starting point with current conventions.
9+
10+
Use the PatternFly MCP server as the primary source for up-to-date component APIs, usage examples, and migration-safe setup guidance.
11+
12+
## Recommended starting point
13+
14+
Use the official PatternFly React seed repository first when possible.
15+
16+
```bash
17+
git clone https://github.com/patternfly/patternfly-react-seed
18+
cd patternfly-react-seed
19+
npm install
20+
npm run start:dev
21+
```
22+
23+
## Required dependencies
24+
25+
```bash
26+
npm install @patternfly/react-core @patternfly/react-icons @patternfly/react-table
27+
```
28+
29+
Feature-based dependencies:
30+
31+
```bash
32+
npm install @patternfly/react-charts victory
33+
npm install @patternfly/chatbot
34+
npm install @patternfly/react-component-groups
35+
```
36+
37+
## Baseline app requirements
38+
39+
```tsx
40+
import "@patternfly/react-core/dist/styles/base.css";
41+
```
42+
43+
Add feature CSS only when relevant:
44+
45+
```tsx
46+
import "@patternfly/patternfly/patternfly-charts.css";
47+
import "@patternfly/chatbot/dist/css/main.css";
48+
import "@patternfly/react-component-groups/dist/css/main.css";
49+
```
50+
51+
## Initial quality checklist
52+
53+
- Uses PatternFly v6 classes and semantic tokens.
54+
- Uses PatternFly components for layout (`PageSection`, `Stack`, `Grid`) before utility classes.
55+
- Handles loading, error, and empty states for data views.
56+
- Includes accessible names/labels for interactive controls.

0 commit comments

Comments
 (0)