diff --git a/optional-skills/creative/theme-factory/SKILL.md b/optional-skills/creative/theme-factory/SKILL.md new file mode 100644 index 00000000000..925075b7c02 --- /dev/null +++ b/optional-skills/creative/theme-factory/SKILL.md @@ -0,0 +1,80 @@ +--- +name: theme-factory +description: Professional font and color themes for HTML artifacts. +version: 0.1.0 +author: Anthropic (anthropics), Hermes Agent +license: Apache-2.0 +platforms: [linux, macos, windows] +metadata: + hermes: + tags: [Themes, Design, HTML, Styling] + related_skills: [claude-design, sketch] +--- + +# Theme Factory + +Ported from Anthropic's Agent Skills repo (github.com/anthropics/skills, `skills/theme-factory`, Apache-2.0 — full license text in `references/LICENSE.txt`). A curated collection of 10 professional themes — cohesive color palettes plus header/body font pairings — for styling any HTML/web artifact Hermes generates: slide decks, docs, reports, landing pages, dashboards. Also supports generating brand-new themes on the fly when none of the presets fit. + +## When to Use + +- The user asks for a slide deck, report, landing page, or other HTML artifact and wants it to look polished/professional rather than default-browser plain. +- An existing HTML artifact needs a consistent visual identity (colors + fonts) applied throughout. +- The user asks for "a theme", names one of the gallery themes below, or describes a vibe ("something warm and autumnal") that maps to one. +- For full bespoke page design (layout, components, interactions), prefer the `claude-design` skill; for quick throwaway mockup variants, `sketch`; for infra diagrams, `architecture-diagram`. This skill is specifically the **styling layer**: pick/apply a font+palette theme. + +## Theme Gallery + +| # | Theme | Vibe | Fonts (header / body) | Palette | +|---|-------|------|-----------------------|---------| +| 1 | Ocean Depths | Professional, calming maritime | DejaVu Sans Bold / DejaVu Sans | `#1a2332` `#2d8b8b` `#a8dadc` `#f1faee` | +| 2 | Sunset Boulevard | Warm, vibrant sunset energy | DejaVu Serif Bold / DejaVu Sans | `#e76f51` `#f4a261` `#e9c46a` `#264653` | +| 3 | Forest Canopy | Natural, grounded earth tones | FreeSerif Bold / FreeSans | `#2d4a2b` `#7d8471` `#a4ac86` `#faf9f6` | +| 4 | Modern Minimalist | Clean contemporary grayscale | DejaVu Sans Bold / DejaVu Sans | `#36454f` `#708090` `#d3d3d3` `#ffffff` | +| 5 | Golden Hour | Rich, warm autumnal | FreeSans Bold / FreeSans | `#f4a900` `#c1666b` `#d4b896` `#4a403a` | +| 6 | Arctic Frost | Cool, crisp winter clarity | DejaVu Sans Bold / DejaVu Sans | `#d4e4f7` `#4a6fa5` `#c0c0c0` `#fafafa` | +| 7 | Desert Rose | Soft, sophisticated dusty tones | FreeSans Bold / FreeSans | `#d4a5a5` `#b87d6d` `#e8d5c4` `#5d2e46` | +| 8 | Tech Innovation | Bold, high-contrast modern tech | DejaVu Sans Bold / DejaVu Sans | `#0066ff` `#00ffff` `#1e1e1e` `#ffffff` | +| 9 | Botanical Garden | Fresh, organic garden colors | DejaVu Serif Bold / DejaVu Sans | `#4a7c59` `#f9a620` `#b7472a` `#f5f3ed` | +| 10 | Midnight Galaxy | Dramatic, cosmic deep tones | FreeSans Bold / FreeSans | `#2b1e3e` `#4a4e8f` `#a490c2` `#e6e6fa` | + +Full per-theme specs (color role assignments, best-used-for guidance) live in `references/themes/.md` — one file per theme, e.g. `references/themes/ocean-depths.md`. Read the theme's file before applying it; the role notes (which hex is background vs. accent vs. text) matter for contrast. + +## Procedure + +1. **Offer choices.** Show the user the gallery table above (or the shortlist matching their described vibe) and ask which theme to apply. Wait for explicit confirmation before styling. +2. **Read the spec.** `read_file` the chosen theme's `references/themes/.md` to get each color's role (background / accent / highlight / text) and the exact font pairing. +3. **Generate the artifact.** Use `write_file` to create the HTML. Encode the theme as CSS custom properties so it applies consistently: + ```css + :root { + --bg: #1a2332; --accent: #2d8b8b; + --accent-2: #a8dadc; --text: #f1faee; + --font-head: "DejaVu Sans", "Helvetica Neue", Arial, sans-serif; + --font-body: "DejaVu Sans", "Helvetica Neue", Arial, sans-serif; + } + ``` + Apply roles as specified in the theme file — don't shuffle background and text colors arbitrarily. +4. **Restyle existing artifacts** by `read_file`-ing the current HTML, then `write_file`-ing it back with the theme's `:root` variables and font stacks swapped in (never sed/cat). +5. **Preview.** `browser_navigate` to `file:///absolute/path/to/artifact.html`, then `browser_vision` to visually verify colors render as intended, headings use the header font, and contrast is readable. + +## Generating New Themes + +When none of the 10 presets fit, create a custom theme in the same format: + +1. From the user's description ("earthy but modern", brand colors, industry), pick 4 cohesive colors (dark anchor, primary accent, secondary/highlight, light neutral) and a header/body font pairing. +2. Give it an evocative two-word name in the gallery's style (e.g. "Copper Foundry"). +3. Present the palette + fonts to the user for review **before** applying — optionally as a small HTML swatch card via `write_file` + browser preview. +4. Once approved, apply via the Procedure above. If it will be reused, save it as `references/themes/.md` mirroring the existing files' structure. + +## Pitfalls + +- **Contrast**: light themes (Arctic Frost, Desert Rose) put light hexes as backgrounds and the darkest hex as text; dark themes (Ocean Depths, Midnight Galaxy, Tech Innovation) invert that. Read the role annotations — swapping roles produces unreadable output. +- **Fonts**: DejaVu/FreeSans/FreeSerif ship on most Linux systems but not macOS/Windows — always include fallback stacks (`Arial`, `Helvetica Neue`, `Georgia`, `sans-serif`/`serif`) so artifacts degrade gracefully. +- **Neon accents** (Tech Innovation's `#00ffff`) are for highlights/borders only — never body text on white. +- Don't apply a theme unprompted; the upstream skill's flow is show → ask → confirm → apply. +- Skipping the browser preview: hex codes that look fine in a table can clash on-screen; verify visually. + +## Verification + +- Open the artifact via `browser_navigate` (`file://` URL) and `browser_vision` to confirm: theme colors present, header vs. body font distinction visible, text readable against its background. +- Grep the generated HTML for the theme's hex codes to confirm all four palette colors were used. +- If the user reports a color looks off, re-read the theme spec and check role assignments before tweaking hexes. diff --git a/optional-skills/creative/theme-factory/references/LICENSE.txt b/optional-skills/creative/theme-factory/references/LICENSE.txt new file mode 100644 index 00000000000..4f881c52d1f --- /dev/null +++ b/optional-skills/creative/theme-factory/references/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2026 Anthropic, PBC. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/optional-skills/creative/theme-factory/references/themes/arctic-frost.md b/optional-skills/creative/theme-factory/references/themes/arctic-frost.md new file mode 100644 index 00000000000..e9f1eb0574e --- /dev/null +++ b/optional-skills/creative/theme-factory/references/themes/arctic-frost.md @@ -0,0 +1,19 @@ +# Arctic Frost + +A cool and crisp winter-inspired theme that conveys clarity, precision, and professionalism. + +## Color Palette + +- **Ice Blue**: `#d4e4f7` - Light backgrounds and highlights +- **Steel Blue**: `#4a6fa5` - Primary accent color +- **Silver**: `#c0c0c0` - Metallic accent elements +- **Crisp White**: `#fafafa` - Clean backgrounds and text + +## Typography + +- **Headers**: DejaVu Sans Bold +- **Body Text**: DejaVu Sans + +## Best Used For + +Healthcare presentations, technology solutions, winter sports, clean tech, pharmaceutical content. diff --git a/optional-skills/creative/theme-factory/references/themes/botanical-garden.md b/optional-skills/creative/theme-factory/references/themes/botanical-garden.md new file mode 100644 index 00000000000..0c95bf7349c --- /dev/null +++ b/optional-skills/creative/theme-factory/references/themes/botanical-garden.md @@ -0,0 +1,19 @@ +# Botanical Garden + +A fresh and organic theme featuring vibrant garden-inspired colors for lively presentations. + +## Color Palette + +- **Fern Green**: `#4a7c59` - Rich natural green +- **Marigold**: `#f9a620` - Bright floral accent +- **Terracotta**: `#b7472a` - Earthy warm tone +- **Cream**: `#f5f3ed` - Soft neutral backgrounds + +## Typography + +- **Headers**: DejaVu Serif Bold +- **Body Text**: DejaVu Sans + +## Best Used For + +Garden centers, food presentations, farm-to-table content, botanical brands, natural products. diff --git a/optional-skills/creative/theme-factory/references/themes/desert-rose.md b/optional-skills/creative/theme-factory/references/themes/desert-rose.md new file mode 100644 index 00000000000..ea7c74eb807 --- /dev/null +++ b/optional-skills/creative/theme-factory/references/themes/desert-rose.md @@ -0,0 +1,19 @@ +# Desert Rose + +A soft and sophisticated theme with dusty, muted tones perfect for elegant presentations. + +## Color Palette + +- **Dusty Rose**: `#d4a5a5` - Soft primary color +- **Clay**: `#b87d6d` - Earthy accent +- **Sand**: `#e8d5c4` - Warm neutral backgrounds +- **Deep Burgundy**: `#5d2e46` - Rich dark contrast + +## Typography + +- **Headers**: FreeSans Bold +- **Body Text**: FreeSans + +## Best Used For + +Fashion presentations, beauty brands, wedding planning, interior design, boutique businesses. diff --git a/optional-skills/creative/theme-factory/references/themes/forest-canopy.md b/optional-skills/creative/theme-factory/references/themes/forest-canopy.md new file mode 100644 index 00000000000..90c2b26518d --- /dev/null +++ b/optional-skills/creative/theme-factory/references/themes/forest-canopy.md @@ -0,0 +1,19 @@ +# Forest Canopy + +A natural and grounded theme featuring earth tones inspired by dense forest environments. + +## Color Palette + +- **Forest Green**: `#2d4a2b` - Primary dark green +- **Sage**: `#7d8471` - Muted green accent +- **Olive**: `#a4ac86` - Light accent color +- **Ivory**: `#faf9f6` - Backgrounds and text + +## Typography + +- **Headers**: FreeSerif Bold +- **Body Text**: FreeSans + +## Best Used For + +Environmental presentations, sustainability reports, outdoor brands, wellness content, organic products. diff --git a/optional-skills/creative/theme-factory/references/themes/golden-hour.md b/optional-skills/creative/theme-factory/references/themes/golden-hour.md new file mode 100644 index 00000000000..ed8fc256f4e --- /dev/null +++ b/optional-skills/creative/theme-factory/references/themes/golden-hour.md @@ -0,0 +1,19 @@ +# Golden Hour + +A rich and warm autumnal palette that creates an inviting and sophisticated atmosphere. + +## Color Palette + +- **Mustard Yellow**: `#f4a900` - Bold primary accent +- **Terracotta**: `#c1666b` - Warm secondary color +- **Warm Beige**: `#d4b896` - Neutral backgrounds +- **Chocolate Brown**: `#4a403a` - Dark text and anchors + +## Typography + +- **Headers**: FreeSans Bold +- **Body Text**: FreeSans + +## Best Used For + +Restaurant presentations, hospitality brands, fall campaigns, cozy lifestyle content, artisan products. diff --git a/optional-skills/creative/theme-factory/references/themes/midnight-galaxy.md b/optional-skills/creative/theme-factory/references/themes/midnight-galaxy.md new file mode 100644 index 00000000000..97e1c5f380e --- /dev/null +++ b/optional-skills/creative/theme-factory/references/themes/midnight-galaxy.md @@ -0,0 +1,19 @@ +# Midnight Galaxy + +A dramatic and cosmic theme with deep purples and mystical tones for impactful presentations. + +## Color Palette + +- **Deep Purple**: `#2b1e3e` - Rich dark base +- **Cosmic Blue**: `#4a4e8f` - Mystical mid-tone +- **Lavender**: `#a490c2` - Soft accent color +- **Silver**: `#e6e6fa` - Light highlights and text + +## Typography + +- **Headers**: FreeSans Bold +- **Body Text**: FreeSans + +## Best Used For + +Entertainment industry, gaming presentations, nightlife venues, luxury brands, creative agencies. diff --git a/optional-skills/creative/theme-factory/references/themes/modern-minimalist.md b/optional-skills/creative/theme-factory/references/themes/modern-minimalist.md new file mode 100644 index 00000000000..6bd26a29beb --- /dev/null +++ b/optional-skills/creative/theme-factory/references/themes/modern-minimalist.md @@ -0,0 +1,19 @@ +# Modern Minimalist + +A clean and contemporary theme with a sophisticated grayscale palette for maximum versatility. + +## Color Palette + +- **Charcoal**: `#36454f` - Primary dark color +- **Slate Gray**: `#708090` - Medium gray for accents +- **Light Gray**: `#d3d3d3` - Backgrounds and dividers +- **White**: `#ffffff` - Text and clean backgrounds + +## Typography + +- **Headers**: DejaVu Sans Bold +- **Body Text**: DejaVu Sans + +## Best Used For + +Tech presentations, architecture portfolios, design showcases, modern business proposals, data visualization. diff --git a/optional-skills/creative/theme-factory/references/themes/ocean-depths.md b/optional-skills/creative/theme-factory/references/themes/ocean-depths.md new file mode 100644 index 00000000000..b675126f53c --- /dev/null +++ b/optional-skills/creative/theme-factory/references/themes/ocean-depths.md @@ -0,0 +1,19 @@ +# Ocean Depths + +A professional and calming maritime theme that evokes the serenity of deep ocean waters. + +## Color Palette + +- **Deep Navy**: `#1a2332` - Primary background color +- **Teal**: `#2d8b8b` - Accent color for highlights and emphasis +- **Seafoam**: `#a8dadc` - Secondary accent for lighter elements +- **Cream**: `#f1faee` - Text and light backgrounds + +## Typography + +- **Headers**: DejaVu Sans Bold +- **Body Text**: DejaVu Sans + +## Best Used For + +Corporate presentations, financial reports, professional consulting decks, trust-building content. diff --git a/optional-skills/creative/theme-factory/references/themes/sunset-boulevard.md b/optional-skills/creative/theme-factory/references/themes/sunset-boulevard.md new file mode 100644 index 00000000000..df799a0cc0e --- /dev/null +++ b/optional-skills/creative/theme-factory/references/themes/sunset-boulevard.md @@ -0,0 +1,19 @@ +# Sunset Boulevard + +A warm and vibrant theme inspired by golden hour sunsets, perfect for energetic and creative presentations. + +## Color Palette + +- **Burnt Orange**: `#e76f51` - Primary accent color +- **Coral**: `#f4a261` - Secondary warm accent +- **Warm Sand**: `#e9c46a` - Highlighting and backgrounds +- **Deep Purple**: `#264653` - Dark contrast and text + +## Typography + +- **Headers**: DejaVu Serif Bold +- **Body Text**: DejaVu Sans + +## Best Used For + +Creative pitches, marketing presentations, lifestyle brands, event promotions, inspirational content. diff --git a/optional-skills/creative/theme-factory/references/themes/tech-innovation.md b/optional-skills/creative/theme-factory/references/themes/tech-innovation.md new file mode 100644 index 00000000000..e029a435fb0 --- /dev/null +++ b/optional-skills/creative/theme-factory/references/themes/tech-innovation.md @@ -0,0 +1,19 @@ +# Tech Innovation + +A bold and modern theme with high-contrast colors perfect for cutting-edge technology presentations. + +## Color Palette + +- **Electric Blue**: `#0066ff` - Vibrant primary accent +- **Neon Cyan**: `#00ffff` - Bright highlight color +- **Dark Gray**: `#1e1e1e` - Deep backgrounds +- **White**: `#ffffff` - Clean text and contrast + +## Typography + +- **Headers**: DejaVu Sans Bold +- **Body Text**: DejaVu Sans + +## Best Used For + +Tech startups, software launches, innovation showcases, AI/ML presentations, digital transformation content. diff --git a/tests/skills/test_theme_factory_skill.py b/tests/skills/test_theme_factory_skill.py new file mode 100644 index 00000000000..eba8ee707bf --- /dev/null +++ b/tests/skills/test_theme_factory_skill.py @@ -0,0 +1,143 @@ +"""Tests for the theme-factory Hermes optional skill port.""" +import re +from pathlib import Path + +import pytest +import yaml + +SKILL_DIR = ( + Path(__file__).resolve().parent + / ".." / ".." / "optional-skills" / "creative" / "theme-factory" +).resolve() +SKILL_MD = SKILL_DIR / "SKILL.md" + +EXPECTED_THEMES = [ + "arctic-frost", + "botanical-garden", + "desert-rose", + "forest-canopy", + "golden-hour", + "midnight-galaxy", + "modern-minimalist", + "ocean-depths", + "sunset-boulevard", + "tech-innovation", +] + + +def _split(text: str): + assert text.startswith("---\n"), "SKILL.md must start with YAML frontmatter" + _, fm, body = text.split("---\n", 2) + return yaml.safe_load(fm), body + + +@pytest.fixture(scope="module") +def skill(): + return _split(SKILL_MD.read_text(encoding="utf-8")) + + +def test_skill_md_exists(): + assert SKILL_MD.is_file() + + +def test_frontmatter_valid_yaml(skill): + fm, _ = skill + assert isinstance(fm, dict) + + +def test_frontmatter_fields(skill): + fm, _ = skill + assert fm["name"] == "theme-factory" + assert fm["version"] == "0.1.0" + assert fm["author"] == "Anthropic (anthropics), Hermes Agent" + assert fm["license"] == "Apache-2.0" + assert fm["platforms"] == ["linux", "macos", "windows"] + + +def test_description_constraints(skill): + fm, _ = skill + desc = fm["description"] + assert isinstance(desc, str) + assert len(desc) <= 60, f"description is {len(desc)} chars (max 60)" + assert desc.endswith(".") + + +def test_metadata_hermes(skill): + fm, _ = skill + hermes = fm["metadata"]["hermes"] + assert hermes["tags"] == ["Themes", "Design", "HTML", "Styling"] + assert hermes["related_skills"] == ["claude-design", "sketch"] + + +def test_required_sections(skill): + _, body = skill + for section in [ + "## When to Use", + "## Theme Gallery", + "## Procedure", + "## Generating New Themes", + "## Pitfalls", + "## Verification", + ]: + assert section in body, f"missing section: {section}" + + +def test_upstream_attribution(skill): + _, body = skill + intro = body[:600] + assert "anthropics/skills" in intro + assert "Apache-2.0" in intro + + +def test_theme_reference_files_exist(): + themes_dir = SKILL_DIR / "references" / "themes" + assert themes_dir.is_dir() + found = sorted(p.stem for p in themes_dir.glob("*.md")) + assert found == EXPECTED_THEMES + + +def test_license_file_is_apache(): + lic = SKILL_DIR / "references" / "LICENSE.txt" + assert lic.is_file() + text = lic.read_text(encoding="utf-8") + assert "Apache License" in text and "Version 2.0" in text + + +def test_gallery_table_matches_theme_count(skill): + _, body = skill + gallery = body.split("## Theme Gallery", 1)[1].split("##", 1)[0] + rows = [ + line for line in gallery.splitlines() + if re.match(r"^\|\s*\d+\s*\|", line) + ] + assert len(rows) == len(EXPECTED_THEMES) == 10 + + +def test_gallery_names_match_reference_files(skill): + _, body = skill + gallery = body.split("## Theme Gallery", 1)[1].split("##", 1)[0] + for stem in EXPECTED_THEMES: + display = stem.replace("-", " ").title() + assert display in gallery, f"gallery missing theme: {display}" + + +def test_theme_files_have_palette_and_typography(): + for stem in EXPECTED_THEMES: + text = (SKILL_DIR / "references" / "themes" / f"{stem}.md").read_text( + encoding="utf-8" + ) + assert "## Color Palette" in text + assert "## Typography" in text + assert len(re.findall(r"#[0-9a-fA-F]{6}", text)) >= 4 + + +def test_skill_md_references_theme_dir(skill): + _, body = skill + assert "references/themes/" in body + + +def test_hermes_tool_framing(skill): + _, body = skill + for tool in ["write_file", "read_file", "browser_navigate", "browser_vision"]: + assert f"`{tool}`" in body, f"missing Hermes tool framing: {tool}" + assert "architecture-diagram" in body diff --git a/website/docs/reference/optional-skills-catalog.md b/website/docs/reference/optional-skills-catalog.md index 94416573dc2..c1d9d17b11f 100644 --- a/website/docs/reference/optional-skills-catalog.md +++ b/website/docs/reference/optional-skills-catalog.md @@ -64,6 +64,7 @@ hermes skills uninstall | [**kanban-video-orchestrator**](/docs/user-guide/skills/optional/creative/creative-kanban-video-orchestrator) | Plan, set up, and monitor a multi-agent video production pipeline backed by Hermes Kanban. Use when the user wants to make ANY video — narrative film, product/marketing, music video, explainer, ASCII/terminal art, abstract/generative loo... | | [**meme-generation**](/docs/user-guide/skills/optional/creative/creative-meme-generation) | Generate real meme images by picking a template and overlaying text with Pillow. Produces actual .png meme files. | | [**pixel-art**](/docs/user-guide/skills/optional/creative/creative-pixel-art) | Pixel art w/ era palettes (NES, Game Boy, PICO-8). | +| [**theme-factory**](/docs/user-guide/skills/optional/creative/creative-theme-factory) | Professional font and color themes for HTML artifacts. | ## devops diff --git a/website/docs/user-guide/skills/optional/creative/creative-theme-factory.md b/website/docs/user-guide/skills/optional/creative/creative-theme-factory.md new file mode 100644 index 00000000000..9f2b9452c33 --- /dev/null +++ b/website/docs/user-guide/skills/optional/creative/creative-theme-factory.md @@ -0,0 +1,98 @@ +--- +title: "Theme Factory — Professional font and color themes for HTML artifacts" +sidebar_label: "Theme Factory" +description: "Professional font and color themes for HTML artifacts" +--- + +{/* This page is auto-generated from the skill's SKILL.md by website/scripts/generate-skill-docs.py. Edit the source SKILL.md, not this page. */} + +# Theme Factory + +Professional font and color themes for HTML artifacts. + +## Skill metadata + +| | | +|---|---| +| Source | Optional — install with `hermes skills install official/creative/theme-factory` | +| Path | `optional-skills/creative/theme-factory` | +| Version | `0.1.0` | +| Author | Anthropic (anthropics), Hermes Agent | +| License | Apache-2.0 | +| Platforms | linux, macos, windows | +| Tags | `Themes`, `Design`, `HTML`, `Styling` | +| Related skills | [`claude-design`](/docs/user-guide/skills/bundled/creative/creative-claude-design), [`sketch`](/docs/user-guide/skills/bundled/creative/creative-sketch) | + +## Reference: full SKILL.md + +:::info +The following is the complete skill definition that Hermes loads when this skill is triggered. This is what the agent sees as instructions when the skill is active. +::: + +# Theme Factory + +Ported from Anthropic's Agent Skills repo (github.com/anthropics/skills, `skills/theme-factory`, Apache-2.0 — full license text in `references/LICENSE.txt`). A curated collection of 10 professional themes — cohesive color palettes plus header/body font pairings — for styling any HTML/web artifact Hermes generates: slide decks, docs, reports, landing pages, dashboards. Also supports generating brand-new themes on the fly when none of the presets fit. + +## When to Use + +- The user asks for a slide deck, report, landing page, or other HTML artifact and wants it to look polished/professional rather than default-browser plain. +- An existing HTML artifact needs a consistent visual identity (colors + fonts) applied throughout. +- The user asks for "a theme", names one of the gallery themes below, or describes a vibe ("something warm and autumnal") that maps to one. +- For full bespoke page design (layout, components, interactions), prefer the `claude-design` skill; for quick throwaway mockup variants, `sketch`; for infra diagrams, `architecture-diagram`. This skill is specifically the **styling layer**: pick/apply a font+palette theme. + +## Theme Gallery + +| # | Theme | Vibe | Fonts (header / body) | Palette | +|---|-------|------|-----------------------|---------| +| 1 | Ocean Depths | Professional, calming maritime | DejaVu Sans Bold / DejaVu Sans | `#1a2332` `#2d8b8b` `#a8dadc` `#f1faee` | +| 2 | Sunset Boulevard | Warm, vibrant sunset energy | DejaVu Serif Bold / DejaVu Sans | `#e76f51` `#f4a261` `#e9c46a` `#264653` | +| 3 | Forest Canopy | Natural, grounded earth tones | FreeSerif Bold / FreeSans | `#2d4a2b` `#7d8471` `#a4ac86` `#faf9f6` | +| 4 | Modern Minimalist | Clean contemporary grayscale | DejaVu Sans Bold / DejaVu Sans | `#36454f` `#708090` `#d3d3d3` `#ffffff` | +| 5 | Golden Hour | Rich, warm autumnal | FreeSans Bold / FreeSans | `#f4a900` `#c1666b` `#d4b896` `#4a403a` | +| 6 | Arctic Frost | Cool, crisp winter clarity | DejaVu Sans Bold / DejaVu Sans | `#d4e4f7` `#4a6fa5` `#c0c0c0` `#fafafa` | +| 7 | Desert Rose | Soft, sophisticated dusty tones | FreeSans Bold / FreeSans | `#d4a5a5` `#b87d6d` `#e8d5c4` `#5d2e46` | +| 8 | Tech Innovation | Bold, high-contrast modern tech | DejaVu Sans Bold / DejaVu Sans | `#0066ff` `#00ffff` `#1e1e1e` `#ffffff` | +| 9 | Botanical Garden | Fresh, organic garden colors | DejaVu Serif Bold / DejaVu Sans | `#4a7c59` `#f9a620` `#b7472a` `#f5f3ed` | +| 10 | Midnight Galaxy | Dramatic, cosmic deep tones | FreeSans Bold / FreeSans | `#2b1e3e` `#4a4e8f` `#a490c2` `#e6e6fa` | + +Full per-theme specs (color role assignments, best-used-for guidance) live in `references/themes/.md` — one file per theme, e.g. `references/themes/ocean-depths.md`. Read the theme's file before applying it; the role notes (which hex is background vs. accent vs. text) matter for contrast. + +## Procedure + +1. **Offer choices.** Show the user the gallery table above (or the shortlist matching their described vibe) and ask which theme to apply. Wait for explicit confirmation before styling. +2. **Read the spec.** `read_file` the chosen theme's `references/themes/.md` to get each color's role (background / accent / highlight / text) and the exact font pairing. +3. **Generate the artifact.** Use `write_file` to create the HTML. Encode the theme as CSS custom properties so it applies consistently: + ```css + :root { + --bg: #1a2332; --accent: #2d8b8b; + --accent-2: #a8dadc; --text: #f1faee; + --font-head: "DejaVu Sans", "Helvetica Neue", Arial, sans-serif; + --font-body: "DejaVu Sans", "Helvetica Neue", Arial, sans-serif; + } + ``` + Apply roles as specified in the theme file — don't shuffle background and text colors arbitrarily. +4. **Restyle existing artifacts** by `read_file`-ing the current HTML, then `write_file`-ing it back with the theme's `:root` variables and font stacks swapped in (never sed/cat). +5. **Preview.** `browser_navigate` to `file:///absolute/path/to/artifact.html`, then `browser_vision` to visually verify colors render as intended, headings use the header font, and contrast is readable. + +## Generating New Themes + +When none of the 10 presets fit, create a custom theme in the same format: + +1. From the user's description ("earthy but modern", brand colors, industry), pick 4 cohesive colors (dark anchor, primary accent, secondary/highlight, light neutral) and a header/body font pairing. +2. Give it an evocative two-word name in the gallery's style (e.g. "Copper Foundry"). +3. Present the palette + fonts to the user for review **before** applying — optionally as a small HTML swatch card via `write_file` + browser preview. +4. Once approved, apply via the Procedure above. If it will be reused, save it as `references/themes/.md` mirroring the existing files' structure. + +## Pitfalls + +- **Contrast**: light themes (Arctic Frost, Desert Rose) put light hexes as backgrounds and the darkest hex as text; dark themes (Ocean Depths, Midnight Galaxy, Tech Innovation) invert that. Read the role annotations — swapping roles produces unreadable output. +- **Fonts**: DejaVu/FreeSans/FreeSerif ship on most Linux systems but not macOS/Windows — always include fallback stacks (`Arial`, `Helvetica Neue`, `Georgia`, `sans-serif`/`serif`) so artifacts degrade gracefully. +- **Neon accents** (Tech Innovation's `#00ffff`) are for highlights/borders only — never body text on white. +- Don't apply a theme unprompted; the upstream skill's flow is show → ask → confirm → apply. +- Skipping the browser preview: hex codes that look fine in a table can clash on-screen; verify visually. + +## Verification + +- Open the artifact via `browser_navigate` (`file://` URL) and `browser_vision` to confirm: theme colors present, header vs. body font distinction visible, text readable against its background. +- Grep the generated HTML for the theme's hex codes to confirm all four palette colors were used. +- If the user reports a color looks off, re-read the theme spec and check role assignments before tweaking hexes. diff --git a/website/sidebars.ts b/website/sidebars.ts index 327b2296149..06eb76a9669 100644 --- a/website/sidebars.ts +++ b/website/sidebars.ts @@ -389,6 +389,7 @@ const sidebars: SidebarsConfig = { 'user-guide/skills/optional/creative/creative-kanban-video-orchestrator', 'user-guide/skills/optional/creative/creative-meme-generation', 'user-guide/skills/optional/creative/creative-pixel-art', + 'user-guide/skills/optional/creative/creative-theme-factory', ], }, {