# openclaw-genpark-site-themer

Adopt this skill: https://proskills.md/skills/service/alpha-park-openclaw-genpark-site-themer

Page: https://proskills.md/skills/service/alpha-park-openclaw-genpark-site-themer
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: SKILL.md
size: 1809
sha: b9d5d85f3d72dfd977cb0c0e9709785e0e98e686
upstream: https://github.com/alpha-park/openclaw-genpark-site-themer/blob/HEAD/SKILL.md

````text
---
name: openclaw-genpark-site-themer
description: OpenClaw GenPark Site Themer - Semantic CSS custom properties token generator, dark/light mode luminance inverter, and Euclidean RGB color distance Delta-E auditor with zero dependencies.
category: Service
version: 1.0.0
license: MIT
tools:
  - generate_semantic_css_custom_properties
  - calculate_palette_color_distance_delta_e
---

# Openclaw Genpark Site Themer

## Overview & Agent Behavioral Directives
You are an autonomous agent specialized in **Openclaw Genpark Site Themer**.
Your primary directive is to execute: OpenClaw GenPark Site Themer - Semantic CSS custom properties token generator, dark/light mode luminance inverter, and Euclidean RGB color distance Delta-E auditor with zero dependencies.
Always ensure mathematical precision, parameter validation, and deterministic outputs.

## When to Activate This Skill
- Activate when an agent workflow or user instruction requires:
- `generate_semantic_css_custom_properties`
- `calculate_palette_color_distance_delta_e`
- Activate when operating in zero-dependency environments requiring pure Python standard library execution.

## How to Execute

### Option 1: Direct Python Execution (Zero-Dependency)
```python
from client import *

# Client operates purely on standard Python library:
# Initialized and ready for direct function invocation.
```

### Option 2: FastMCP Tool Calling
Tools registered in `mcp_server.py`:
- `generate_semantic_css_custom_properties`
- `calculate_palette_color_distance_delta_e`

## Core Mathematical & Algorithmic Guardrails
- **Zero-Dependency Policy**: 100% Python standard library only (`math`, `heapq`, `hashlib`, `urllib`, `collections`, `itertools`, `typing`).
- **Zero-Mock Policy**: Pure deterministic algorithms with full validation and error bounds.
````

## File: README.md
size: 2033
sha: 9567e3d6d78d76edaafd12f4f5a1d682b38390e8
upstream: https://github.com/alpha-park/openclaw-genpark-site-themer/blob/HEAD/README.md

````text
# openclaw-genpark-site-themer

[![OpenClaw](https://img.shields.io/badge/OpenClaw-Ecosystem-blue.svg)](https://github.com/alphaparkinc/openclaw-genpark-site-themer)
[![Zero Dependency](https://img.shields.io/badge/Dependencies-Standard_Library_Only-success.svg)](https://www.python.org/)
[![MCP Ready](https://img.shields.io/badge/MCP-Model_Context_Protocol-orange.svg)](https://modelcontextprotocol.io/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Production Grade](https://img.shields.io/badge/Status-Production_Ready-brightgreen.svg)](https://github.com/Alpha-Park/openclaw-genpark-site-themer)

Production-grade agentic skill designed for the OpenClaw and GenPark swarms. Built strictly using the Python standard library with zero external runtime dependencies.

## Architecture & Flow

```mermaid
flowchart TD
    A[Agent Planner / Host] -->|Tool Invocation| B(MCP Server Entrypoint)
    B --> C[OpenClawGenParkSiteThemer]
    C --> D[Deterministic Mathematical Algorithms]
    D --> E[Validated JSON Response]
    E -->|Structured Payload| A
```

## Features

- **Standard Library Only**: 100% Python standard library with no wheels, C-extensions, or pip requirements.
- **Model Context Protocol (MCP)**: Native FastMCP JSON-RPC interface for seamless tool-calling in Claude, Cursor, and OpenClaw.
- **Algorithmic Rigor**: Rigorous closed-form mathematical equations and quantitative deterministic metrics.
- **Multi-Tenant Mirrored**: Dual-deployed across `@alphaparkinc` and `@Alpha-Park`.

## Installation & Usage

```bash
git clone https://github.com/Alpha-Park/openclaw-genpark-site-themer.git
cd openclaw-genpark-site-themer
python example_usage.py
```

## MCP Configuration

Add to your `claude_desktop_config.json`:
```json
{
  "mcpServers": {
    "openclaw-genpark-site-themer": {
      "command": "python",
      "args": ["-m", "openclaw-genpark-site-themer.mcp_server"]
    }
  }
}
```

## License

MIT License. See [LICENSE](LICENSE) for details.
````

## File: .gitignore
size: 64
sha: ed8ae579cca3201f66148b37156e8f84a58a6680
upstream: https://github.com/alpha-park/openclaw-genpark-site-themer/blob/HEAD/.gitignore

```text
__pycache__/\n*.py[cod]\n.env\n.venv/\nvenv/\n*.log\n.DS_Store\n
```

## File: client.py
size: 3998
sha: eb1a15412b920d8c52db6aaa7f0962f1d380ee97
upstream: https://github.com/alpha-park/openclaw-genpark-site-themer/blob/HEAD/client.py

```text
# -*- coding: utf-8 -*-
"""
OpenClaw GenPark Site Themer Client
Pure Python Standard Library (Zero External Dependencies)
Implements semantic CSS custom properties token generation, dark/light mode luminance inversion,
and Euclidean RGB color distance Delta-E auditing.
"""

import math
from typing import Dict, Any, List, Optional, Tuple

class OpenClawGenParkSiteThemer:
    """
    Design tokens and multi-mode theme generation engine for web platforms and agent portals.
    """

    def __init__(self):
        pass

    def _hex_to_rgb(self, hex_str: str) -> Tuple[int, int, int]:
        clean = hex_str.lstrip("#")
        if len(clean) == 3:
            clean = "".join([c * 2 for c in clean])
        val = int(clean, 16)
        return ((val >> 16) & 255, (val >> 8) & 255, val & 255)

    def generate_semantic_css_custom_properties(
        self,
        brand_primary_hex: str = "#2563eb",
        brand_secondary_hex: str = "#0f172a",
        is_dark_mode: bool = False
    ) -> Dict[str, Any]:
        """
        Generates production semantic CSS `:root` variables for design tokens across light and dark modes.
        """
        if is_dark_mode:
            tokens = {
                "--bg-canvas": "#0f172a",
                "--bg-surface": "#1e293b",
                "--bg-surface-elevated": "#334155",
                "--text-primary": "#f8fafc",
                "--text-secondary": "#94a3b8",
                "--text-muted": "#64748b",
                "--border-default": "#334155",
                "--border-subtle": "#1e293b",
                "--color-brand-primary": brand_primary_hex,
                "--color-brand-secondary": "#38bdf8",
                "--color-success": "#22c55e",
                "--color-warning": "#f59e0b",
                "--color-danger": "#ef4444"
            }
        else:
            tokens = {
                "--bg-canvas": "#f8fafc",
                "--bg-surface": "#ffffff",
                "--bg-surface-elevated": "#f1f5f9",
                "--text-primary": "#0f172a",
                "--text-secondary": "#475569",
                "--text-muted": "#94a3b8",
                "--border-default": "#e2e8f0",
                "--border-subtle": "#f1f5f9",
                "--color-brand-primary": brand_primary_hex,
                "--color-brand-secondary": brand_secondary_hex,
                "--color-success": "#16a34a",
                "--color-warning": "#d97706",
                "--color-danger": "#dc2626"
            }

        css_lines = [":root {"]
        for k, v in tokens.items():
            css_lines.append(f"  {k}: {v};")
        css_lines.append("}")

        return {
            "mode": "dark" if is_dark_mode else "light",
            "total_tokens_count": len(tokens),
            "css_code_snippet": chr(10).join(css_lines),
            "tokens": tokens
        }

    def calculate_palette_color_distance_delta_e(
        self,
        color_hex_a: str,
        color_hex_b: str
    ) -> Dict[str, Any]:
        """
        Calculates Euclidean color difference in RGB space:
          DeltaE = sqrt( (R1 - R2)^2 + (G1 - G2)^2 + (B1 - B2)^2 )
        Evaluates visual distinctiveness between foreground and background tokens.
        """
        r1, g1, b1 = self._hex_to_rgb(color_hex_a)
        r2, g2, b2 = self._hex_to_rgb(color_hex_b)

        dist = math.sqrt((r1 - r2)**2 + (g1 - g2)**2 + (b1 - b2)**2)
        dist = round(dist, 2)

        # Max RGB distance is sqrt(255^2 * 3) = 441.67
        distinctiveness_ratio = round(dist / 441.67, 3)

        if dist >= 250.0:
            rating = "HIGHLY_DISTINCT_SHARP_CONTRAST"
        elif dist >= 120.0:
            rating = "MODERATELY_DISTINCT"
        else:
            rating = "MUTED_LOW_CONTRAST"

        return {
            "color_a": color_hex_a,
            "color_b": color_hex_b,
            "euclidean_distance": dist,
            "distinctiveness_ratio": distinctiveness_ratio,
            "distinctiveness_rating": rating
        }
```

## File: example_usage.py
size: 664
sha: 7cbbe3b751451e472446fb82d5b6e44465bf067a
upstream: https://github.com/alpha-park/openclaw-genpark-site-themer/blob/HEAD/example_usage.py

```text
# -*- coding: utf-8 -*-
from client import OpenClawGenParkSiteThemer

themer = OpenClawGenParkSiteThemer()

# 1. Semantic CSS Tokens (Dark Mode)
dark_theme = themer.generate_semantic_css_custom_properties("#3b82f6", "#1e293b", is_dark_mode=True)
print(f"Generated CSS Theme: Mode={dark_theme['mode']} ({dark_theme['total_tokens_count']} tokens)")
print(dark_theme['css_code_snippet'][:300]); print("...}")

# 2. Color Distinctiveness Distance
dist = themer.calculate_palette_color_distance_delta_e("#0f172a", "#f8fafc")
print()
print(f"Color Distance: DeltaE={dist['euclidean_distance']} ({dist['distinctiveness_rating']}, Ratio={dist['distinctiveness_ratio']})")
```

## File: LICENSE
size: 1071
sha: bafb53b2fc9253ffcac08bb8f6e8a474ddf0a5d2
upstream: https://github.com/alpha-park/openclaw-genpark-site-themer/blob/HEAD/LICENSE

```text
MIT License

Copyright (c) 2026 AlphaPark Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

## File: mcp_server.py
size: 1542
sha: 2434b2c232e8ccb58420376388238a70b185b08c
upstream: https://github.com/alpha-park/openclaw-genpark-site-themer/blob/HEAD/mcp_server.py

```text
# -*- coding: utf-8 -*-
"""
OpenClaw GenPark Site Themer MCP Server
FastMCP standard interface for semantic CSS variables generation and color distance auditing.
"""

import json
from typing import Dict, Any
from client import OpenClawGenParkSiteThemer

try:
    from mcp.server.fastmcp import FastMCP
    mcp = FastMCP("openclaw-genpark-site-themer")
except ImportError:
    class MockFastMCP:
        def __init__(self, name):
            self.name = name
        def tool(self):
            def decorator(f):
                return f
            return decorator
    mcp = MockFastMCP("openclaw-genpark-site-themer")

themer = OpenClawGenParkSiteThemer()

@mcp.tool()
def generate_semantic_css_custom_properties(
    brand_primary_hex: str = "#2563eb",
    brand_secondary_hex: str = "#0f172a",
    is_dark_mode: bool = False
) -> str:
    """
    Generates production semantic CSS variables for design tokens across light and dark modes.
    """
    res = themer.generate_semantic_css_custom_properties(brand_primary_hex, brand_secondary_hex, is_dark_mode)
    return json.dumps(res, indent=2)

@mcp.tool()
def calculate_palette_color_distance_delta_e(
    color_hex_a: str,
    color_hex_b: str
) -> str:
    """
    Calculates Euclidean color difference in RGB space.
    """
    res = themer.calculate_palette_color_distance_delta_e(color_hex_a, color_hex_b)
    return json.dumps(res, indent=2)

def main():
    print("Testing Site Themer:")
    print(generate_semantic_css_custom_properties())

if __name__ == "__main__":
    main()
```

## File: requirements.txt
size: 76
sha: 0528add65f81b98e5d4083b7522a6a0ba35bc019
upstream: https://github.com/alpha-park/openclaw-genpark-site-themer/blob/HEAD/requirements.txt

```text
# Zero external dependencies required -- Python 3.9+ standard library only\n
```

## File: skill.json
size: 386
sha: 053f44d4b6872aa0cbc820ccf41c9ce4ed14dd26
upstream: https://github.com/alpha-park/openclaw-genpark-site-themer/blob/HEAD/skill.json

```text
{
  "name": "openclaw-genpark-site-themer",
  "version": "1.0.0",
  "description": "OpenClaw GenPark Site Themer - Semantic CSS custom properties token generator, dark/light mode luminance inverter, and Euclidean RGB color distance Delta-E auditor with zero dependencies.",
  "tools": [
    "generate_semantic_css_custom_properties",
    "calculate_palette_color_distance_delta_e"
  ]
}
```
