diff --git a/hermes/automation-workflows/.clawhub/origin.json b/hermes/automation-workflows/.clawhub/origin.json new file mode 100644 index 0000000..1e2859a --- /dev/null +++ b/hermes/automation-workflows/.clawhub/origin.json @@ -0,0 +1,7 @@ +{ + "version": 1, + "registry": "https://clawhub.ai", + "slug": "automation-workflows", + "installedVersion": "0.1.0", + "installedAt": 1774706187714 +} diff --git a/hermes/automation-workflows/SKILL.md b/hermes/automation-workflows/SKILL.md new file mode 100644 index 0000000..9d3ab7b --- /dev/null +++ b/hermes/automation-workflows/SKILL.md @@ -0,0 +1,267 @@ +--- +name: automation-workflows +description: Design and implement automation workflows to save time and scale operations as a solopreneur. Use when identifying repetitive tasks to automate, building workflows across tools, setting up triggers and actions, or optimizing existing automations. Covers automation opportunity identification, workflow design, tool selection (Zapier, Make, n8n), testing, and maintenance. Trigger on "automate", "automation", "workflow automation", "save time", "reduce manual work", "automate my business", "no-code automation". +--- + +# Automation Workflows + +## Overview +As a solopreneur, your time is your most valuable asset. Automation lets you scale without hiring. The goal is simple: automate anything you do more than twice a week that doesn't require creative thinking. This playbook shows you how to identify automation opportunities, design workflows, and implement them without writing code. + +--- + +## Step 1: Identify What to Automate + +Not every task should be automated. Start by finding the highest-value opportunities. + +**Automation audit (spend 1 hour on this):** + +1. Track every task you do for a week (use a notebook or simple spreadsheet) +2. For each task, note: + - How long it takes + - How often you do it (daily, weekly, monthly) + - Whether it's repetitive or requires judgment + +3. Calculate time cost per task: + ``` + Time Cost = (Minutes per task × Frequency per month) / 60 + ``` + Example: 15 min task done 20x/month = 5 hours/month + +4. Sort by time cost (highest to lowest) + +**Good candidates for automation:** +- Repetitive (same steps every time) +- Rule-based (no complex judgment calls) +- High-frequency (daily or weekly) +- Time-consuming (takes 10+ minutes) + +**Examples:** +- ✅ Sending weekly reports to clients (same format, same schedule) +- ✅ Creating invoices after payment +- ✅ Adding new leads to CRM from form submissions +- ✅ Posting social media content on a schedule +- ❌ Conducting customer discovery interviews (requires nuance) +- ❌ Writing custom proposals for clients (requires creativity) + +**Low-hanging fruit checklist (start here):** +- [ ] Email notifications for form submissions +- [ ] Auto-save form responses to spreadsheet +- [ ] Schedule social posts in advance +- [ ] Auto-create invoices from payment confirmations +- [ ] Sync data between tools (CRM ↔ email tool ↔ spreadsheet) + +--- + +## Step 2: Choose Your Automation Tool + +Three main options for no-code automation. Pick based on complexity and budget. + +**Tool comparison:** + +| Tool | Best For | Pricing | Learning Curve | Power Level | +|---|---|---|---|---| +| **Zapier** | Simple, 2-3 step workflows | $20-50/month | Easy | Low-Medium | +| **Make (Integromat)** | Visual, multi-step workflows | $9-30/month | Medium | Medium-High | +| **n8n** | Complex, developer-friendly, self-hosted | Free (self-hosted) or $20/month | Medium-Hard | High | + +**Selection guide:** +- Budget < $20/month → Try Zapier free tier or n8n self-hosted +- Need visual workflow builder → Make +- Simple 2-step workflows → Zapier +- Complex workflows with branching logic → Make or n8n +- Want full control and customization → n8n + +**Recommendation for solopreneurs:** Start with Zapier (easiest to learn). Graduate to Make or n8n when you hit Zapier's limits. + +--- + +## Step 3: Design Your Workflow + +Before building, map out the workflow on paper or a whiteboard. + +**Workflow design template:** + +``` +TRIGGER: What event starts the workflow? + Example: "New row added to Google Sheet" + +CONDITIONS (optional): Should this workflow run every time, or only when certain conditions are met? + Example: "Only if Status column = 'Approved'" + +ACTIONS: What should happen as a result? + Step 1: [action] + Step 2: [action] + Step 3: [action] + +ERROR HANDLING: What happens if something fails? + Example: "Send me a Slack message if action fails" +``` + +**Example workflow (lead capture → CRM → email):** +``` +TRIGGER: New form submission on website + +CONDITIONS: Email field is not empty + +ACTIONS: + Step 1: Add lead to CRM (e.g., Airtable or HubSpot) + Step 2: Send welcome email via email tool (e.g., ConvertKit) + Step 3: Create task in project management tool (e.g., Notion) to follow up in 3 days + Step 4: Send me a Slack notification: "New lead: [Name]" + +ERROR HANDLING: If Step 1 fails, send email alert to me +``` + +**Design principles:** +- Keep it simple — start with 2-3 steps, add complexity later +- Test each step individually before chaining them together +- Add delays between actions if needed (some APIs are slow) +- Always include error notifications so you know when things break + +--- + +## Step 4: Build and Test Your Workflow + +Now implement it in your chosen tool. + +**Build workflow (Zapier example):** +1. **Choose trigger app** (e.g., Google Forms, Typeform, website form) +2. **Connect your account** (authenticate via OAuth) +3. **Test trigger** (submit a test form to make sure data comes through) +4. **Add action** (e.g., "Add row to Google Sheets") +5. **Map fields** (match form fields to spreadsheet columns) +6. **Test action** (run test to verify row is added correctly) +7. **Repeat for additional actions** +8. **Turn on workflow** (Zapier calls this "turn on Zap") + +**Testing checklist:** +- [ ] Submit test data through the trigger +- [ ] Verify each action executes correctly +- [ ] Check that data maps to the right fields +- [ ] Test with edge cases (empty fields, special characters, long text) +- [ ] Test error handling (intentionally cause a failure to see if alerts work) + +**Common issues and fixes:** + +| Issue | Cause | Fix | +|---|---|---| +| Workflow doesn't trigger | Trigger conditions too narrow | Check filter settings, broaden criteria | +| Action fails | API rate limit or permissions | Add delay between actions, re-authenticate | +| Data missing or incorrect | Field mapping wrong | Double-check which fields are mapped | +| Workflow runs multiple times | Duplicate triggers | De-duplicate based on unique ID | + +**Rule:** Test with real data before relying on an automation. Don't discover bugs when a real customer is involved. + +--- + +## Step 5: Monitor and Maintain Automations + +Automations aren't set-it-and-forget-it. They break. Tools change. APIs update. You need a maintenance plan. + +**Weekly check (5 min):** +- Scan workflow logs for errors (most tools show a log of runs + failures) +- Address any failures immediately + +**Monthly audit (15 min):** +- Review all active workflows +- Check: Is this still being used? Is it still saving time? +- Disable or delete unused workflows (they clutter your dashboard and can cause confusion) +- Update any workflows that depend on tools you've switched away from + +**Where to store workflow documentation:** +- Create a simple doc (Notion, Google Doc) for each workflow +- Include: What it does, when it runs, what apps it connects, how to troubleshoot +- If you have 10+ workflows, this doc will save you hours when something breaks + +**Error handling setup:** +- Route all error notifications to one place (Slack channel, email inbox, or task manager) +- Set up: "If any workflow fails, send a message to [your error channel]" +- Review errors weekly and fix root causes + +--- + +## Step 6: Advanced Automation Ideas + +Once you've automated the basics, consider these higher-leverage workflows: + +### Client onboarding automation +``` +TRIGGER: New client signs contract (via DocuSign, HelloSign) +ACTIONS: + 1. Create project in project management tool + 2. Add client to CRM with "Active" status + 3. Send onboarding email sequence + 4. Create invoice in accounting software + 5. Schedule kickoff call on calendar + 6. Add client to Slack workspace (if applicable) +``` + +### Content distribution automation +``` +TRIGGER: New blog post published on website (via RSS or webhook) +ACTIONS: + 1. Post link to LinkedIn with auto-generated caption + 2. Post link to Twitter as a thread + 3. Add post to email newsletter draft (in email tool) + 4. Add to content calendar (Notion or Airtable) + 5. Send notification to team (Slack) that post is live +``` + +### Customer health monitoring +``` +TRIGGER: Every Monday at 9am (scheduled trigger) +ACTIONS: + 1. Pull usage data for all customers from database (via API) + 2. Flag customers with <50% of average usage + 3. Add flagged customers to "At Risk" segment in CRM + 4. Send re-engagement email campaign to at-risk customers + 5. Create task for me to personally reach out to top 10 at-risk customers +``` + +### Invoice and payment tracking +``` +TRIGGER: Payment received (Stripe webhook) +ACTIONS: + 1. Mark invoice as paid in accounting software + 2. Send receipt email to customer + 3. Update CRM: customer status = "Paid" + 4. Add revenue to monthly dashboard (Google Sheets or Airtable) + 5. Send me a Slack notification: "Payment received: $X from [Customer]" +``` + +--- + +## Step 7: Calculate Automation ROI + +Not every automation is worth the time investment. Calculate ROI to prioritize. + +**ROI formula:** +``` +Time Saved per Month (hours) = (Minutes per task / 60) × Frequency per month +Cost = (Setup time in hours × $50/hour) + Tool cost per month +Payback Period (months) = Setup cost / Monthly time saved value + +If payback period < 3 months → Worth it +If payback period > 6 months → Probably not worth it (unless it unlocks other value) +``` + +**Example:** +``` +Task: Manually copying form submissions to CRM (15 min, 20x/month = 5 hours/month saved) +Setup time: 1 hour +Tool cost: $20/month (Zapier) +Payback: ($50 setup cost) / ($250/month value saved) = 0.2 months → Absolutely worth it +``` + +**Rule:** Focus on automations with payback < 3 months. Those are your highest-leverage investments. + +--- + +## Automation Mistakes to Avoid +- **Automating before optimizing.** Don't automate a bad process. Fix the process first, then automate it. +- **Over-automating.** Not everything needs to be automated. If a task is rare or requires judgment, do it manually. +- **No error handling.** If an automation breaks and you don't know, it causes silent failures. Always set up error alerts. +- **Not testing thoroughly.** A broken automation is worse than no automation — it creates incorrect data or missed tasks. +- **Building too complex too fast.** Start with simple 2-3 step workflows. Add complexity only when the simple version works perfectly. +- **Not documenting workflows.** Future you will forget how this works. Write it down. diff --git a/hermes/automation-workflows/_meta.json b/hermes/automation-workflows/_meta.json new file mode 100644 index 0000000..cc6258f --- /dev/null +++ b/hermes/automation-workflows/_meta.json @@ -0,0 +1,6 @@ +{ + "ownerId": "kn732qfbv22he1jqm63xbwq6e980kn8s", + "slug": "automation-workflows", + "version": "0.1.0", + "publishedAt": 1770341582349 +} \ No newline at end of file diff --git a/hermes/frontend-design/SKILL.md b/hermes/frontend-design/SKILL.md new file mode 100644 index 0000000..dd7c5dd --- /dev/null +++ b/hermes/frontend-design/SKILL.md @@ -0,0 +1,147 @@ +--- +name: frontend-design +description: Create distinctive, production-grade frontend interfaces with high design quality. Generates creative, polished code that avoids generic AI aesthetics. Use when the user asks to build web components, pages, artifacts, posters, or applications, or when any design skill requires project context. +license: Apache 2.0. Based on Anthropic's frontend-design skill. See NOTICE.md for attribution. +--- + +This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices. + +## Context Gathering Protocol + +Design skills produce generic output without project context. You MUST have confirmed design context before doing any design work. + +**Required context** — every design skill needs at minimum: +- **Target audience**: Who uses this product and in what context? +- **Use cases**: What jobs are they trying to get done? +- **Brand personality/tone**: How should the interface feel? + +Individual skills may require additional context — check the skill's preparation section for specifics. + +**CRITICAL**: You cannot infer this context by reading the codebase. Code tells you what was built, not who it's for or what it should feel like. Only the creator can provide this context. + +**Gathering order:** +1. **Check current instructions (instant)**: If your loaded instructions already contain a **Design Context** section, proceed immediately. +2. **Check .impeccable.md (fast)**: If not in instructions, read `.impeccable.md` from the project root. If it exists and contains the required context, proceed. +3. **Run teach-impeccable (REQUIRED)**: If neither source has context, you MUST run /teach-impeccable NOW before doing anything else. Do NOT skip this step. Do NOT attempt to infer context from the codebase instead. + +--- + +## Design Direction + +Commit to a BOLD aesthetic direction: +- **Purpose**: What problem does this interface solve? Who uses it? +- **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction. +- **Constraints**: Technical requirements (framework, performance, accessibility). +- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember? + +**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work—the key is intentionality, not intensity. + +Then implement working code that is: +- Production-grade and functional +- Visually striking and memorable +- Cohesive with a clear aesthetic point-of-view +- Meticulously refined in every detail + +## Frontend Aesthetics Guidelines + +### Typography +→ *Consult [typography reference](reference/typography.md) for scales, pairing, and loading strategies.* + +Choose fonts that are beautiful, unique, and interesting. Pair a distinctive display font with a refined body font. + +**DO**: Use a modular type scale with fluid sizing (clamp) +**DO**: Vary font weights and sizes to create clear visual hierarchy +**DON'T**: Use overused fonts—Inter, Roboto, Arial, Open Sans, system defaults +**DON'T**: Use monospace typography as lazy shorthand for "technical/developer" vibes +**DON'T**: Put large icons with rounded corners above every heading—they rarely add value and make sites look templated + +### Color & Theme +→ *Consult [color reference](reference/color-and-contrast.md) for OKLCH, palettes, and dark mode.* + +Commit to a cohesive palette. Dominant colors with sharp accents outperform timid, evenly-distributed palettes. + +**DO**: Use modern CSS color functions (oklch, color-mix, light-dark) for perceptually uniform, maintainable palettes +**DO**: Tint your neutrals toward your brand hue—even a subtle hint creates subconscious cohesion +**DON'T**: Use gray text on colored backgrounds—it looks washed out; use a shade of the background color instead +**DON'T**: Use pure black (#000) or pure white (#fff)—always tint; pure black/white never appears in nature +**DON'T**: Use the AI color palette: cyan-on-dark, purple-to-blue gradients, neon accents on dark backgrounds +**DON'T**: Use gradient text for "impact"—especially on metrics or headings; it's decorative rather than meaningful +**DON'T**: Default to dark mode with glowing accents—it looks "cool" without requiring actual design decisions + +### Layout & Space +→ *Consult [spatial reference](reference/spatial-design.md) for grids, rhythm, and container queries.* + +Create visual rhythm through varied spacing—not the same padding everywhere. Embrace asymmetry and unexpected compositions. Break the grid intentionally for emphasis. + +**DO**: Create visual rhythm through varied spacing—tight groupings, generous separations +**DO**: Use fluid spacing with clamp() that breathes on larger screens +**DO**: Use asymmetry and unexpected compositions; break the grid intentionally for emphasis +**DON'T**: Wrap everything in cards—not everything needs a container +**DON'T**: Nest cards inside cards—visual noise, flatten the hierarchy +**DON'T**: Use identical card grids—same-sized cards with icon + heading + text, repeated endlessly +**DON'T**: Use the hero metric layout template—big number, small label, supporting stats, gradient accent +**DON'T**: Center everything—left-aligned text with asymmetric layouts feels more designed +**DON'T**: Use the same spacing everywhere—without rhythm, layouts feel monotonous + +### Visual Details +**DO**: Use intentional, purposeful decorative elements that reinforce brand +**DON'T**: Use glassmorphism everywhere—blur effects, glass cards, glow borders used decoratively rather than purposefully +**DON'T**: Use rounded elements with thick colored border on one side—a lazy accent that almost never looks intentional +**DON'T**: Use sparklines as decoration—tiny charts that look sophisticated but convey nothing meaningful +**DON'T**: Use rounded rectangles with generic drop shadows—safe, forgettable, could be any AI output +**DON'T**: Use modals unless there's truly no better alternative—modals are lazy + +### Motion +→ *Consult [motion reference](reference/motion-design.md) for timing, easing, and reduced motion.* + +Focus on high-impact moments: one well-orchestrated page load with staggered reveals creates more delight than scattered micro-interactions. + +**DO**: Use motion to convey state changes—entrances, exits, feedback +**DO**: Use exponential easing (ease-out-quart/quint/expo) for natural deceleration +**DO**: For height animations, use grid-template-rows transitions instead of animating height directly +**DON'T**: Animate layout properties (width, height, padding, margin)—use transform and opacity only +**DON'T**: Use bounce or elastic easing—they feel dated and tacky; real objects decelerate smoothly + +### Interaction +→ *Consult [interaction reference](reference/interaction-design.md) for forms, focus, and loading patterns.* + +Make interactions feel fast. Use optimistic UI—update immediately, sync later. + +**DO**: Use progressive disclosure—start simple, reveal sophistication through interaction (basic options first, advanced behind expandable sections; hover states that reveal secondary actions) +**DO**: Design empty states that teach the interface, not just say "nothing here" +**DO**: Make every interactive surface feel intentional and responsive +**DON'T**: Repeat the same information—redundant headers, intros that restate the heading +**DON'T**: Make every button primary—use ghost buttons, text links, secondary styles; hierarchy matters + +### Responsive +→ *Consult [responsive reference](reference/responsive-design.md) for mobile-first, fluid design, and container queries.* + +**DO**: Use container queries (@container) for component-level responsiveness +**DO**: Adapt the interface for different contexts—don't just shrink it +**DON'T**: Hide critical functionality on mobile—adapt the interface, don't amputate it + +### UX Writing +→ *Consult [ux-writing reference](reference/ux-writing.md) for labels, errors, and empty states.* + +**DO**: Make every word earn its place +**DON'T**: Repeat information users can already see + +--- + +## The AI Slop Test + +**Critical quality check**: If you showed this interface to someone and said "AI made this," would they believe you immediately? If yes, that's the problem. + +A distinctive interface should make someone ask "how was this made?" not "which AI made this?" + +Review the DON'T guidelines above—they are the fingerprints of AI-generated work from 2024-2025. + +--- + +## Implementation Principles + +Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. + +Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices across generations. + +Remember: the model is capable of extraordinary creative work. Don't hold back—show what can truly be created when thinking outside the box and committing fully to a distinctive vision. \ No newline at end of file diff --git a/hermes/frontend-design/reference/color-and-contrast.md b/hermes/frontend-design/reference/color-and-contrast.md new file mode 100644 index 0000000..77aaf03 --- /dev/null +++ b/hermes/frontend-design/reference/color-and-contrast.md @@ -0,0 +1,132 @@ +# Color & Contrast + +## Color Spaces: Use OKLCH + +**Stop using HSL.** Use OKLCH (or LCH) instead. It's perceptually uniform, meaning equal steps in lightness *look* equal—unlike HSL where 50% lightness in yellow looks bright while 50% in blue looks dark. + +```css +/* OKLCH: lightness (0-100%), chroma (0-0.4+), hue (0-360) */ +--color-primary: oklch(60% 0.15 250); /* Blue */ +--color-primary-light: oklch(85% 0.08 250); /* Same hue, lighter */ +--color-primary-dark: oklch(35% 0.12 250); /* Same hue, darker */ +``` + +**Key insight**: As you move toward white or black, reduce chroma (saturation). High chroma at extreme lightness looks garish. A light blue at 85% lightness needs ~0.08 chroma, not the 0.15 of your base color. + +## Building Functional Palettes + +### The Tinted Neutral Trap + +**Pure gray is dead.** Add a subtle hint of your brand hue to all neutrals: + +```css +/* Dead grays */ +--gray-100: oklch(95% 0 0); /* No personality */ +--gray-900: oklch(15% 0 0); + +/* Warm-tinted grays (add brand warmth) */ +--gray-100: oklch(95% 0.01 60); /* Hint of warmth */ +--gray-900: oklch(15% 0.01 60); + +/* Cool-tinted grays (tech, professional) */ +--gray-100: oklch(95% 0.01 250); /* Hint of blue */ +--gray-900: oklch(15% 0.01 250); +``` + +The chroma is tiny (0.01) but perceptible. It creates subconscious cohesion between your brand color and your UI. + +### Palette Structure + +A complete system needs: + +| Role | Purpose | Example | +|------|---------|---------| +| **Primary** | Brand, CTAs, key actions | 1 color, 3-5 shades | +| **Neutral** | Text, backgrounds, borders | 9-11 shade scale | +| **Semantic** | Success, error, warning, info | 4 colors, 2-3 shades each | +| **Surface** | Cards, modals, overlays | 2-3 elevation levels | + +**Skip secondary/tertiary unless you need them.** Most apps work fine with one accent color. Adding more creates decision fatigue and visual noise. + +### The 60-30-10 Rule (Applied Correctly) + +This rule is about **visual weight**, not pixel count: + +- **60%**: Neutral backgrounds, white space, base surfaces +- **30%**: Secondary colors—text, borders, inactive states +- **10%**: Accent—CTAs, highlights, focus states + +The common mistake: using the accent color everywhere because it's "the brand color." Accent colors work *because* they're rare. Overuse kills their power. + +## Contrast & Accessibility + +### WCAG Requirements + +| Content Type | AA Minimum | AAA Target | +|--------------|------------|------------| +| Body text | 4.5:1 | 7:1 | +| Large text (18px+ or 14px bold) | 3:1 | 4.5:1 | +| UI components, icons | 3:1 | 4.5:1 | +| Non-essential decorations | None | None | + +**The gotcha**: Placeholder text still needs 4.5:1. That light gray placeholder you see everywhere? Usually fails WCAG. + +### Dangerous Color Combinations + +These commonly fail contrast or cause readability issues: + +- Light gray text on white (the #1 accessibility fail) +- **Gray text on any colored background**—gray looks washed out and dead on color. Use a darker shade of the background color, or transparency +- Red text on green background (or vice versa)—8% of men can't distinguish these +- Blue text on red background (vibrates visually) +- Yellow text on white (almost always fails) +- Thin light text on images (unpredictable contrast) + +### Never Use Pure Gray or Pure Black + +Pure gray (`oklch(50% 0 0)`) and pure black (`#000`) don't exist in nature—real shadows and surfaces always have a color cast. Even a chroma of 0.005-0.01 is enough to feel natural without being obviously tinted. (See tinted neutrals example above.) + +### Testing + +Don't trust your eyes. Use tools: + +- [WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/) +- Browser DevTools → Rendering → Emulate vision deficiencies +- [Polypane](https://polypane.app/) for real-time testing + +## Theming: Light & Dark Mode + +### Dark Mode Is Not Inverted Light Mode + +You can't just swap colors. Dark mode requires different design decisions: + +| Light Mode | Dark Mode | +|------------|-----------| +| Shadows for depth | Lighter surfaces for depth (no shadows) | +| Dark text on light | Light text on dark (reduce font weight) | +| Vibrant accents | Desaturate accents slightly | +| White backgrounds | Never pure black—use dark gray (oklch 12-18%) | + +```css +/* Dark mode depth via surface color, not shadow */ +:root[data-theme="dark"] { + --surface-1: oklch(15% 0.01 250); + --surface-2: oklch(20% 0.01 250); /* "Higher" = lighter */ + --surface-3: oklch(25% 0.01 250); + + /* Reduce text weight slightly */ + --body-weight: 350; /* Instead of 400 */ +} +``` + +### Token Hierarchy + +Use two layers: primitive tokens (`--blue-500`) and semantic tokens (`--color-primary: var(--blue-500)`). For dark mode, only redefine the semantic layer—primitives stay the same. + +## Alpha Is A Design Smell + +Heavy use of transparency (rgba, hsla) usually means an incomplete palette. Alpha creates unpredictable contrast, performance overhead, and inconsistency. Define explicit overlay colors for each context instead. Exception: focus rings and interactive states where see-through is needed. + +--- + +**Avoid**: Relying on color alone to convey information. Creating palettes without clear roles for each color. Using pure black (#000) for large areas. Skipping color blindness testing (8% of men affected). diff --git a/hermes/frontend-design/reference/interaction-design.md b/hermes/frontend-design/reference/interaction-design.md new file mode 100644 index 0000000..19d6809 --- /dev/null +++ b/hermes/frontend-design/reference/interaction-design.md @@ -0,0 +1,195 @@ +# Interaction Design + +## The Eight Interactive States + +Every interactive element needs these states designed: + +| State | When | Visual Treatment | +|-------|------|------------------| +| **Default** | At rest | Base styling | +| **Hover** | Pointer over (not touch) | Subtle lift, color shift | +| **Focus** | Keyboard/programmatic focus | Visible ring (see below) | +| **Active** | Being pressed | Pressed in, darker | +| **Disabled** | Not interactive | Reduced opacity, no pointer | +| **Loading** | Processing | Spinner, skeleton | +| **Error** | Invalid state | Red border, icon, message | +| **Success** | Completed | Green check, confirmation | + +**The common miss**: Designing hover without focus, or vice versa. They're different. Keyboard users never see hover states. + +## Focus Rings: Do Them Right + +**Never `outline: none` without replacement.** It's an accessibility violation. Instead, use `:focus-visible` to show focus only for keyboard users: + +```css +/* Hide focus ring for mouse/touch */ +button:focus { + outline: none; +} + +/* Show focus ring for keyboard */ +button:focus-visible { + outline: 2px solid var(--color-accent); + outline-offset: 2px; +} +``` + +**Focus ring design**: +- High contrast (3:1 minimum against adjacent colors) +- 2-3px thick +- Offset from element (not inside it) +- Consistent across all interactive elements + +## Form Design: The Non-Obvious + +**Placeholders aren't labels**—they disappear on input. Always use visible `