Skip to content
Skills Library
Programming · Review & audit

pf-import-check

/pf-import-check

Audit PatternFly imports for correctness and bundle-size anti-patterns. Use when imports fail, bundles are bloated, or after upgrading PatternFly versions.

Repository
ai-helpers ↗
Licence
MIT
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
20
Scripts
6
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 6 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: eval/cases/barrel-icon-import/SettingsToolbar.tsx, eval/cases/duplicate-module-import/NotificationBar.tsx, eval/cases/full-css-import/App.tsx, eval/cases/invalid-charts-import/ChartsDashboard.tsx, eval/cases/invalid-chatbot-import/AssistantPanel.tsx, eval/cases/valid-pf6-imports/SettingsPage.tsx

What it does and when to use it

Audit PatternFly imports for correctness and bundle-size anti-patterns. Use when imports fail, bundles are bloated, or after upgrading PatternFly versions.

Original author description

Audit PatternFly imports for correctness and bundle-size anti-patterns. Use when imports fail, bundles are bloated, or after upgrading PatternFly versions.

How it works

  1. PatternFly API documentation
  2. Input
  3. What to check
  4. Validation commands
  5. Correct import examples
  6. Rules
  7. Output format
Original SKILL.md headings · 103 lines, 602 words
SKILL.md preview
---
name: pf-import-check
description: Audit PatternFly imports for correctness and bundle-size anti-patterns. Use when imports fail, bundles are bloated, or after upgrading PatternFly versions.
---

# PF Import Checker

Find and report invalid PatternFly import patterns and bundle-size anti-patterns.

## PatternFly API documentation

If PatternFly documentation tools are available, use them to confirm current package paths and import subpaths before flagging. Without documentation available, rely on the import rules and examples in this skill.

## Input

The user provides a file path, directory, or component to check. Default to scanning the project source directory. Adapt search paths to the project structure (`src/`, `app/`, `packages/*/src/`).

## What to check

### Import correctness

1. Charts imported from `@patternfly/react-charts` root (must use `/victory` subpath).
2. Chatbot imports not using `@patternfly/chatbot/dist/dynamic/*` (barrel imports are acceptable for `@patternfly/chatbot` >= 6.8.0-prerelease.9, which added `exports` and `sideEffects` for tree-shaking; four modules — `CodeModal`, `PreviewAttachment`, `AttachmentEdit`, `tracking` — are excluded from the barrel and always require dynamic subpath imports).
3. Component-group imports not using `@patternfly/react-component-groups/dist/dynamic/*`.
4. Missing package CSS imports for features in use.

### Bundle-size anti-patterns

5. **Barrel imports from `@patternfly/react-icons`** — importing from the package root pulls in the entire icon set (~1.8MB per SSR chunk). Each icon must be imported individually from its deep path.
6. **Full CSS bundle import** — importing `@patternfly/patternfly/patternfly.css` or `@patternfly/patternfly/patternfly-base.css` pulls the entire stylesheet. Import only the CSS modules needed: `base.css` + feature-specific CSS (`patternfly-charts.css`, `patternfly-addons.css`).
7. **Duplicate PF module imports** — the same component imported from different paths (e.g., both `@patternfly/react-core` and `@patternfly/react-core/dist/esm/...`) inflates the bundle with duplicate modules.

## Validation commands

```bash
# Import correctness
rg "@patternfly/react-charts['\"]" <source-dir>
rg "@patternfly/chatbot['\"]" <source-dir>  # only flag if chatbot < 6.8.0-prerelease.9; always flag CodeModal/PreviewAttachment/AttachmentEdit/tracking from barrel
rg "@patternfly/react-component-groups['\"]" <source-dir>

# Bundle-size anti-patterns
rg "from ['\"]@patternfly/react-icons['\"]" <source-dir>
rg "patternfly\.css|patternfly-base\.css" <source-dir>
rg "@patternfly/react-core/dist/" <source-dir>
```

## Correct import examples

```tsx
// Charts — use /victory subpath
import { ChartDonut } from "@patternfly/react-charts/victory";

// Chatbot — barrel import OK for >= 6.8.0-prerelease.9
import { Chatbot } from "@patternfly/chatbot";
// Chatbot — dynamic subpath (required for older versions or barrel-excluded modules)
import { Chatbot } from "@patternfly/chatbot/dist/dynamic/Chatbot";
import CodeModal from "@patternfly/chatbot/dist/dynamic/CodeModal";  // always subpath

// Component groups — use /dist/dynamic/ subpath
import { BulkSelect } from "@patternfly/react-component-groups/dist/dynamic/BulkSelect";
```

### Icon imports

```tsx
// Bad — barrel import pulls entire icon set (~1.8MB)
import { CogIcon, BellIcon } from "@patternfly/react-icons";

// Good — deep imports, tree-shakeable
import CogIcon from "@patternfly/react-icons/dist/dynamic/icons/cog-icon";
import BellIcon from "@patternfly/react-icons/dist/dynamic/icons/bell-icon";
```

### CSS imports

```tsx
// Bad — pulls entire PF stylesheet
import "@patternfly/patternfly/patternfly.css";

// Good — base + only what you need
import "@patternfly/react-core/dist/styles/base.css";
import "@patternfly/patternfly/patternfly-charts.css";      // only if using charts
import "@patternfly/chatbot/dist/css/main.css";              // only if using chatbot
import "@patternfly/react-component-groups/dist/css/main.css"; // only if using component groups
```

## Rules

- Report barrel icon imports as high severity — they are the single largest contributor to PF bundle bloat
- Report full CSS imports as medium severity — wasteful but less impactful than icon barrels
- Report duplicate module imports as low severity — often accidental, usually fixable by updating one import path
- When a file has both correctness and bundle issues, report correctness first
- Do not flag `@patternfly/react-core` barrel imports — this package is designed for tree-shaking and barrel imports are the correct pattern
- Do not flag `@patternfly/react-table` barrel imports — same as react-core, tree-shakeable by design

## Output format

For each finding, provide:

- **Severity**: high | medium | low
- **File path** and line number
- **Current import** — the offending line
- **Suggested fix** — the corrected import
- **Impact** — estimated bundle size reduction or explanation of why this matters

Group findings by severity (high first). End with a summary count: `Found N import issues: X high, Y medium, Z low.`
Files in this package (20)
  • SKILL.md 5 KB
  • eval/eval.yaml 5 KB
  • eval/cases/barrel-icon-import/SettingsToolbar.tsx 1 KB
  • eval/cases/barrel-icon-import/annotations.yaml 1 KB
  • eval/cases/barrel-icon-import/input.yaml 1 KB
  • eval/cases/duplicate-module-import/NotificationBar.tsx 1 KB
  • eval/cases/duplicate-module-import/annotations.yaml 1 KB
  • eval/cases/duplicate-module-import/input.yaml 1 KB
  • eval/cases/full-css-import/App.tsx 1 KB
  • eval/cases/full-css-import/annotations.yaml 1 KB
  • eval/cases/full-css-import/input.yaml 1 KB
  • eval/cases/invalid-charts-import/ChartsDashboard.tsx 1 KB
  • eval/cases/invalid-charts-import/annotations.yaml 1 KB
  • eval/cases/invalid-charts-import/input.yaml 1 KB
  • eval/cases/invalid-chatbot-import/AssistantPanel.tsx 1 KB
  • eval/cases/invalid-chatbot-import/annotations.yaml 1 KB
  • eval/cases/invalid-chatbot-import/input.yaml 1 KB
  • eval/cases/valid-pf6-imports/SettingsPage.tsx 1 KB
  • eval/cases/valid-pf6-imports/annotations.yaml 1 KB
  • eval/cases/valid-pf6-imports/input.yaml 1 KB

Versions

The database has no other skills named pf-import-check.

Database snapshot: 13.11.2026 · package version 9fbef9a6bedd (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100pf-chatbot-bundle-audit
    Audit PatternFly ChatBot imports for tree-shaking opportunities. Use when optimizing ChatBot bundle size or after upgrading @patternfly/chatbot.
  • 100pf-react-migration-scan
    Scan code for @patternfly/react-* API breaking changes and produce a markdown report. Use when upgrading PatternFly React versions, auditing component API usage, or checking for removed props, renamed components, or import path changes.
  • 100pf-org-version-update
    Update patternfly-org for a new PatternFly release — resolve versions, update package.json and versions.json, and provide build steps. Use when cutting a PF release or release candidate.
  • 100bundle-size
    Attributes a frontend project's JavaScript bundle size to the imports that caused it, then renders a light-theme analytics website. Bundles the app with esbuild, reads the metafile, and reports how many minified KB each npm package and source module added. Use when the user runs…
  • 95django-import-enforcer
    Automatically validate and fix Django import patterns to use absolute modular imports with aliases. Use when writing imports, creating new Python files, modifying existing files, or seeing import statements in code.
  • 100pf-component-check
    Audit PatternFly React component nesting, wrapper hierarchies, and layout structure. Use when scanning for hierarchy violations or debugging spacing caused by missing wrapper components.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.