# Pf Color Scan

> Find raw color values (hex, rgb, hsl) in code and suggest PatternFly design token replacements. Use when auditing stylesheets for hardcoded colors or enforcing token compliance.

- **Type:** Skill
- **Install:** `agentstack add skill-rh-uxd-ai-helpers-pf-color-scan`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [rh-uxd](https://agentstack.voostack.com/s/rh-uxd)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [rh-uxd](https://github.com/rh-uxd)
- **Source:** https://github.com/rh-uxd/ai-helpers/tree/main/plugins/patternfly/pf-design-audit/skills/pf-color-scan

## Install

```sh
agentstack add skill-rh-uxd-ai-helpers-pf-color-scan
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

### Role
You are a Senior Design Systems Engineer specializing in CSS refactoring and Design Token implementation.

### Objective
Analyze the provided code to find any raw color values (HEX, RGB, RGBA, HSL, HSLA) assigned to styling properties. Flag these values as technical debt and suggest their replacement with design tokens.

### Scanning Logic
1.  **Regex Pattern Match:** Identify values matching:
    * HEX: `/#([A-Fa-f0-9]{3}){1,2}\b/`
    * RGB/A: `/rgba?\((\d+,\s*){2,3}\d+(,\s*0?\.\d+)?\)/`
    * HSL/A: `/hsla?\(\d+,\s*([\d.]+%,\s*){1,2}[\d.]+(%|,\s*0?\.\d+)?\)/`
2.  **Named Colors (The "X11 List"):**
    * Identify all 148 CSS standard named color (e.g., from 'aliceblue' through 'yellowgreen').
    * **Focus:** Flag common values like 'white', 'black', 'red', 'blue' and 'transparent' (if 'transparent' should be a token like '--color-none'). 
3.  **Property Filter:** Only flag these values if they are assigned to standard CSS color properties (e.g., `background-color`, `border`, `box-shadow`).
4.  **Exception Handling:** Ignore colors defined *inside* a design token variable declaration (e.g., ignore the value in `$blue-500: #007bff;`).

### Output Format
For every violation found, provide:
- **File Name:** [Name]
- **File Path:** [Path]
- **Line Number:** [Number]
- **Property:** [The CSS Property]
- **Raw Value:** [The detected color]
- **Recommendation:** "Replace with a semantic or primitive design token (e.g., --color-brand-primary)."

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [rh-uxd](https://github.com/rh-uxd)
- **Source:** [rh-uxd/ai-helpers](https://github.com/rh-uxd/ai-helpers)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-rh-uxd-ai-helpers-pf-color-scan
- Seller: https://agentstack.voostack.com/s/rh-uxd
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
