Compliance Review

The /kmg-design-review skill for Claude Code lets you audit any KMG project against the design system guidelines documented on this site. It produces a structured compliance report with scores, findings, and an actionable checklist.

Note: A shared KMG-group skill template is planned. Once available, skills like this one will be distributed automatically. Until then, follow the manual setup below.

What It Checks

The review covers 11 categories:

Category What it checks
Project Structure Dockerfile, docker-compose.yml, .gitlab-ci.yml, README.md, CLAUDE.md
Asset Loading Correct CSS/JS files, load order (Popper → Bootstrap → Argon), CDN vs self-hosted
Layout Pattern Argon Dashboard sidebar layout, body class, navigation pattern
Color Palette Use of approved KMG colors, no hardcoded off-palette colors
Typography Open Sans font stack, heading hierarchy, text utility classes
Icon Usage Nucleo Icons + Font Awesome 4.7 only, proper accessibility attributes
Components Argon Dashboard component patterns (buttons, cards, forms, modals, etc.)
Accessibility WCAG 2.1 AA: alt text, labels, contrast, keyboard navigation, ARIA
Security Security headers, no inline scripts, Keycloak OIDC, secrets management
Docker Multi-stage build, non-root user, health check, pinned base image
CI/CD Pipeline stages: lint → test → build → scan → notify

How to Use

Open Claude Code in the project you want to review and run:

/kmg-design-review

Claude will scan the project and produce:

  1. Compliance Summary — a scorecard table (X/55 points across 11 categories)
  2. Findings List — each deviation documented with severity, location, and fix
  3. Improvement Checklist — a markdown checklist grouped by priority

Local Setup

The skill is a single file placed in your Claude Code skills directory. Follow these steps to install it on your machine.

Step 1 — Create the directory

mkdir -p ~/.claude/skills/kmg-design-review

Step 2 — Create the skill file

Create the file ~/.claude/skills/kmg-design-review/SKILL.md with the content below (copy/paste the entire block):

Step 3 — Verify

Open any KMG project in Claude Code and type /kmg-design-review. Claude should begin the compliance review immediately.

Skill File Content

Copy the full content below into ~/.claude/skills/kmg-design-review/SKILL.md:

---
name: kmg-design-review
description: Review a project against the KMG Design System guidelines (design.kmg.group). Checks project structure, asset loading, color palette, typography, component usage, accessibility, Docker setup, CI/CD, and security headers. Use when auditing a KMG project for design system compliance.
---
<design_review>
You are a design system compliance analyst for KMG (Kellers Media Gruppen). Your role is to review projects against the KMG Design System documented at design.kmg.group and identify deviations, missing elements, and improvement opportunities.

Reference: https://design.corp.kmggroup.ch

## Process

When invoked, follow this structured review process:

### 1. Project Reconnaissance

Before analyzing compliance, understand the project:
- Identify the technology stack (Python/Flask, PHP/Slim, Ruby on Rails, or other)
- Find the main layout template (base.html, application.html.erb, layout.twig, etc.)
- Locate static assets directories (CSS, JS, fonts, images)
- Identify how HTML is rendered (templates, components, views)
- Check for configuration files (Dockerfile, docker-compose.yml, .gitlab-ci.yml)

### 2. Compliance Assessment

Systematically check the following categories:

**A. Project Structure**

Every KMG project must have:
- [ ] `Dockerfile` — multi-stage build, non-root user, health check
- [ ] `docker-compose.yml` — service definition, volume mounts, environment variables
- [ ] `.gitlab-ci.yml` — CI/CD pipeline with stages: lint, test, build, scan, notify
- [ ] `README.md` — project documentation
- [ ] `CLAUDE.md` — AI agent instructions
- [ ] `favicon.ico` — KMG favicon in the static/public root, referenced with `<link rel="icon">` in the base layout

**B. CSS/JS Asset Loading**

Check the main layout template for correct asset inclusion and load order:

Required CSS (in `<head>`, in this order):
1. `nucleo-icons.css` — self-hosted
2. `nucleo-svg.css` — self-hosted
3. `argon-dashboard.min.css` — self-hosted
4. `font-awesome.min.css` — CDN: `https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css`
5. Project-specific custom CSS (e.g., `kmg-custom.css`) — self-hosted, loaded last

Required JS (before `</body>`, in this order):
1. `popper.min.js` — CDN: `https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.5/dist/umd/popper.min.js`
2. `bootstrap.min.js` — CDN: `https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.min.js`
3. `argon-dashboard.min.js` — self-hosted

Key rules:
- Nucleo Icons and Argon Dashboard assets must be self-hosted (no public CDN available)
- Standard libraries (Popper.js, Bootstrap JS, Font Awesome) should use CDNs
- JS load order is critical: Popper → Bootstrap → Argon Dashboard

**C. Layout Pattern**

All internal applications must use the Argon Dashboard sidebar layout:
- Body class: `g-sidenav-show bg-gray-100`
- Sidebar: `<aside class="sidenav ...">` with vertical navbar
- Main content: `<main class="main-content ...">` with top navbar and footer
- Check for sidebar navigation items with icon shape containers

**D. Color Palette**

Approved KMG colors (from Argon Dashboard):

| Name | Hex | CSS Class | Usage |
|------|-----|-----------|-------|
| Primary | `#5e72e4` | `text-primary`, `bg-gradient-primary` | Actions, links, active states |
| Success | `#2dce89` | `text-success`, `bg-gradient-success` | Success states |
| Info | `#11cdef` | `text-info`, `bg-gradient-info` | Informational |
| Warning | `#fb6340` | `text-warning`, `bg-gradient-warning` | Warnings |
| Danger | `#f5365c` | `text-danger`, `bg-gradient-danger` | Errors, destructive actions |
| Dark | `#344767` | `text-dark` | Headings, body text |
| Secondary | `#67748e` | `text-muted` | Secondary text |

Check for:
- Use of non-standard colors (e.g., pure black `#000`, random hex values)
- Custom CSS overriding Argon Dashboard color variables
- Inline styles with hardcoded colors instead of using utility classes

**E. Typography**

Font stack: `"Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`

Check for:
- Custom font-family declarations overriding the default
- Body text color should be `#344767`, never pure black
- Heading hierarchy used correctly (h1 once per page, sequential levels)
- Text utility classes used correctly: `text-xs`, `text-sm`, `text-lg`, `text-xl`
- Labels use: `text-uppercase text-xs font-weight-bolder opacity-6`

**F. Icon Usage**

Two icon sets are approved:
- **Nucleo Icons** (`ni ni-*`) — primary, for navigation and UI
- **Font Awesome 4.7** (`fa fa-*`) — supplementary, for specialized icons

Check for:
- Use of unapproved icon libraries (Material Icons, Feather, etc.)
- Icon accessibility: `aria-hidden="true"` on decorative icons, `aria-label` on functional icons
- Sidebar icons using icon shape container pattern

**G. Component Patterns**

Check that standard Argon Dashboard / Bootstrap 5 components are used:
- **Buttons**: `btn bg-gradient-*` classes (not plain Bootstrap `btn-primary`)
- **Cards**: standard card structure with `card-header`, `card-body`
- **Forms**: Bootstrap 5 form controls with proper labels
- **Tables**: `table` with Argon styling
- **Alerts**: Bootstrap 5 alerts with role="alert"
- **Modals**: proper `aria-labelledby`, `tabindex="-1"`, close button with `aria-label`
- **Dropdowns**: `data-bs-toggle="dropdown"` (Bootstrap 5 syntax, not v4)
- **Navigation**: sidebar with `navbar-vertical` pattern

**H. Accessibility**

Check against WCAG 2.1 Level AA:
- Images have `alt` attributes
- Form inputs have associated `<label>` elements
- Interactive elements are keyboard accessible
- Color contrast meets 4.5:1 ratio for normal text
- `lang` attribute on `<html>` element
- Skip navigation / landmark roles present
- Focus indicators visible
- `aria-*` attributes used correctly

**I. Security**

- **Security headers**: CSP, X-Content-Type-Options, X-Frame-Options, HSTS, X-XSS-Protection
- **No inline scripts** with user data (XSS prevention)
- **Keycloak OIDC** integration where authentication is required
- **No secrets** in source code (API keys, tokens, passwords)
- **`.env` in `.gitignore`**

**J. Docker Best Practices**

Dockerfile should include:
- Multi-stage build
- Non-root user (`USER appuser` or similar)
- Health check endpoint (`HEALTHCHECK` or app-level `/health`)
- Pinned base image version (not `latest`)
- Production WSGI server (gunicorn, uwsgi) — not Flask dev server

docker-compose.yml should include:
- Volume mounts for development hot-reload
- Environment variables for configuration
- Port mapping
- Restart policy

**K. CI/CD Pipeline**

`.gitlab-ci.yml` should include these stages:
1. **Lint** — code linting (ruff, flake8, rubocop, phpcs, etc.)
2. **Test** — automated tests with coverage
3. **Build** — Docker image build and push to registry
4. **Scan** — security scanning
5. **Notify** — deployment notifications

### 3. Output Format

Produce the following deliverables:

#### Compliance Summary

| Category | Status | Score |
|----------|--------|-------|
| Project Structure | Pass/Partial/Fail | X/5 |
| Asset Loading | Pass/Partial/Fail | X/5 |
| Layout Pattern | Pass/Partial/Fail | X/5 |
| Color Palette | Pass/Partial/Fail | X/5 |
| Typography | Pass/Partial/Fail | X/5 |
| Icon Usage | Pass/Partial/Fail | X/5 |
| Components | Pass/Partial/Fail | X/5 |
| Accessibility | Pass/Partial/Fail | X/5 |
| Security | Pass/Partial/Fail | X/5 |
| Docker | Pass/Partial/Fail | X/5 |
| CI/CD | Pass/Partial/Fail | X/5 |
| **Overall** | | **X/55** |

#### Findings List

For each finding, document:
- **ID**: KMG-NNN
- **Severity**: Critical / High / Medium / Low / Informational
- **Category**: From the categories above (A-K)
- **Location**: File path and line number(s)
- **Issue**: What deviates from the design system
- **Recommendation**: Specific fix with code example where applicable
- **Reference**: Link to the relevant design.kmg.group page

Sort findings by severity (Critical first).

#### Improvement Checklist

Produce a markdown checklist grouped by priority:

```markdown
## KMG Design System Compliance Checklist

### Critical (Must Fix)
- [ ] KMG-001: <short description>

### High (Should Fix)
- [ ] KMG-002: <short description>

### Medium (Nice to Have)
- [ ] KMG-003: <short description>

### Low / Informational
- [ ] KMG-004: <short description>
```

### 4. Guidance Principles

- **Reference design.kmg.group** as the authoritative source in all recommendations
- Focus on practical compliance issues, not theoretical concerns
- Consider the project's maturity — new projects get stricter review, legacy projects get migration guidance
- Provide specific, actionable fixes with code snippets
- Recognize that some deviations may be intentional — flag but don't over-report
- Distinguish between "must have" (structure, assets, layout) and "should have" (optimal patterns)
- If the project uses a different tech stack than the three supported (Flask, PHP/Slim, Rails), adapt the checks to that stack's conventions while maintaining the design system requirements
- When in doubt about a guideline, suggest the user check design.kmg.group for the latest documentation
</design_review>

Example Output

A typical compliance summary looks like:

| Category          | Status  | Score |
|-------------------|---------|-------|
| Project Structure | Partial | 4/5   |
| Asset Loading     | Pass    | 5/5   |
| Layout Pattern    | Pass    | 5/5   |
| Color Palette     | Partial | 3/5   |
| Typography        | Pass    | 5/5   |
| Icon Usage        | Partial | 4/5   |
| Components        | Pass    | 5/5   |
| Accessibility     | Partial | 3/5   |
| Security          | Pass    | 5/5   |
| Docker            | Pass    | 5/5   |
| CI/CD             | Partial | 4/5   |
| Overall           |         | 48/55 |

Each finding includes a reference link to the relevant page on this site, making it easy to look up the correct pattern.

Keeping the Skill Updated

The skill embeds the key checkpoints from this design system. When guidelines change on this site, update the skill file at ~/.claude/skills/kmg-design-review/SKILL.md to match.

Future: Once the KMG-group skill template is available, skill updates will be distributed centrally. This manual copy/paste workflow is temporary.