← Back to Skills

colored-output

majiayu000
Updated 2 days ago
58
9
58
View on GitHub
Metaoutputformattingcolorsansiterminalutilityux

About

This skill provides a centralized ANSI color formatter for terminal output across all Claude skills and agents, enforcing consistent UX. It eliminates duplicate ANSI code definitions by serving as a single source of truth for colored messaging. Developers should use it whenever their skill needs formatted terminal output to maintain DRY principles and visual consistency.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/majiayu000/claude-skill-registry
Git CloneAlternative
git clone https://github.com/majiayu000/claude-skill-registry.git ~/.claude/skills/colored-output

Copy and paste this command in Claude Code to install this skill

Documentation

Colored Output Formatter Skill

Centralized, reusable colored output formatting for ALL skills, agents, and commands!

🎯 Purpose

This skill provides a single source of truth for colored terminal output. Instead of duplicating ANSI codes across every skill/agent, they all call this formatter.

Benefits:

  • βœ… DRY Principle - Define colors once, use everywhere
  • βœ… Consistent UX - All skills/agents look the same
  • βœ… Easy Updates - Change colors in one place
  • βœ… Zero Duplication - No repeated ANSI codes

πŸ”§ BASH COMMAND ATTRIBUTION PATTERN

CRITICAL: Before executing EACH bash command, MUST output:

πŸ”§ [colored-output] Running: <command>

Examples:

πŸ”§ [colored-output] Running: bash .claude/skills/colored-output/color.sh skill-header "skill-name" "Starting..."
πŸ”§ [colored-output] Running: bash .claude/skills/colored-output/color.sh success "" "Complete!"
πŸ”§ [colored-output] Running: bash .claude/skills/colored-output/color.sh error "" "Failed!"

Why: This pattern helps users identify which skill is executing which command, improving transparency and debugging.


🎯 USAGE GUIDELINES (CRITICAL)

⚠️ IMPORTANT: Use colored output SPARINGLY to prevent screen flickering and visual clutter!

βœ… DO Use Colored Output For:

  1. Initial Header (once at start of operation)

    bash .claude/skills/colored-output/color.sh skill-header "skill-name" "Starting operation..."
    
  2. Final Results (success, error, or completion)

    bash .claude/skills/colored-output/color.sh success "" "Operation complete!"
    
  3. Critical Alerts (warnings, errors)

    bash .claude/skills/colored-output/color.sh warning "" "Configuration issue detected"
    bash .claude/skills/colored-output/color.sh error "" "Operation failed"
    
  4. Summary Sections (key metrics, final status)

    bash .claude/skills/colored-output/color.sh info "" "Processed 10 files"
    

❌ DON'T Use Colored Output For:

  1. Progress Updates - Use regular text instead

    • ❌ Bad: bash .claude/skills/colored-output/color.sh progress "" "Step 1 of 5..."
    • βœ… Good: Regular Claude text: "Step 1 of 5: Analyzing files..."
  2. Intermediate Info Messages - Use regular text

    • ❌ Bad: bash .claude/skills/colored-output/color.sh info "" "Found 3 files"
    • βœ… Good: Regular Claude text: "Found 3 files to process..."
  3. Verbose Logging - Use regular text

    • ❌ Bad: Multiple colored calls for each step
    • βœ… Good: Regular text for all intermediate steps

πŸ“ Recommended Pattern

Minimal Colored Output (2-3 calls per operation):

# START: Colored header (1 call)
πŸ”§ [skill-name] Starting operation...

# MIDDLE: Regular Claude text (0 colored calls)
Analyzing 10 files...
Processing configurations...
Updating database...
Generating reports...

# END: Colored result (1-2 calls)
βœ… Operation complete!
πŸ“‹ Summary: 10 files processed, 0 errors

🚫 Anti-Pattern (Causes Flickering)

Excessive Colored Output (10+ calls per operation):

πŸ”§ [skill-name] Starting operation...          ← Colored
β–Ά Step 1: Analyzing files...                   ← Colored (unnecessary)
ℹ️ Found 10 files                              ← Colored (unnecessary)
β–Ά Step 2: Processing...                        ← Colored (unnecessary)
ℹ️ Processing file 1...                        ← Colored (unnecessary)
ℹ️ Processing file 2...                        ← Colored (unnecessary)
... (8 more colored calls) ...
βœ… Operation complete!                          ← Colored

Problem: Each bash call creates a new task in Claude CLI, causing screen flickering and visual noise.

πŸ“Š Target Metrics

  • Maximum: 3-4 colored bash calls per operation
  • Minimum: 2 colored bash calls (header + result)
  • Ideal: Use colored output only for boundaries (start/end) and alerts

🎨 VISUAL OUTPUT FORMATTING

CRITICAL: This skill itself follows the minimal colored output pattern!

Self-Reference Pattern

When this skill responds, use the MINIMAL pattern:

# START: Header only
bash .claude/skills/colored-output/color.sh skill-header "colored-output" "Processing request..."

# MIDDLE: Regular text (no colored calls)
Analyzing color requirements...
Available message types: skill-header, agent-header, success, error, warning, info, progress...

# END: Result only
bash .claude/skills/colored-output/color.sh success "" "Formatting complete!"

DO NOT use excessive colored calls when demonstrating. Follow the 2-3 call guideline!


🎨 Color Scheme

Component Types

  • Skills: πŸ”§ Bold Blue \033[1;34m
  • Agents: πŸ€– Bold Purple \033[1;35m
  • Commands: ⚑ Bold Green \033[1;32m

Status Types

  • Success: βœ… Bold Green \033[1;32m
  • Error: ❌ Bold Red \033[1;31m
  • Warning: ⚠️ Bold Yellow \033[1;33m
  • Info: ℹ️ Bold Cyan \033[1;36m
  • Progress: β–Ά Blue \033[0;34m

πŸ“‹ Usage

Basic Syntax

bash .claude/skills/colored-output/color.sh [type] [component-name] [message]

Examples

Skill Headers

bash .claude/skills/colored-output/color.sh skill-header "time-helper" "Processing time request..."
# Output: πŸ”§ [time-helper] Processing time request...  (in blue)

Agent Headers

bash .claude/skills/colored-output/color.sh agent-header "eslint-fixer" "Analyzing code..."
# Output: πŸ€– [eslint-fixer] Analyzing code...  (in purple)

Command Headers

bash .claude/skills/colored-output/color.sh command-header "/commit" "Creating commit..."
# Output: ⚑ [/commit] Creating commit...  (in green)

Status Messages

bash .claude/skills/colored-output/color.sh success "" "File updated successfully"
# Output: βœ… File updated successfully  (in green)

bash .claude/skills/colored-output/color.sh error "" "Failed to parse file"
# Output: ❌ Failed to parse file  (in red)

bash .claude/skills/colored-output/color.sh warning "" "This may take a while"
# Output: ⚠️ This may take a while  (in yellow)

bash .claude/skills/colored-output/color.sh info "" "Processing 5 files"
# Output: ℹ️ Processing 5 files  (in cyan)

bash .claude/skills/colored-output/color.sh progress "" "Step 1 of 3"
# Output: β–Ά Step 1 of 3  (in blue)

πŸ”§ Integration Guide

How Skills Should Use This

OLD WAY (Don't do this):

Claude outputs: "Processing..."
(No colors, just plain text)

NEW WAY (Do this):

When skill starts:
1. Output colored header using this formatter
2. Output progress messages using this formatter
3. Output final status using this formatter

Example: time-helper Integration

# Start of skill
bash .claude/skills/colored-output/color.sh skill-header "time-helper" "Getting current time for Tokyo..."

# Progress
bash .claude/skills/colored-output/color.sh progress "" "Querying timezone database..."

# Result
bash .claude/skills/colored-output/color.sh info "" "Current time: 2025-10-22 14:30:00 JST"

# Success
bash .claude/skills/colored-output/color.sh success "" "Time retrieved successfully"

Output:

πŸ”§ [time-helper] Getting current time for Tokyo...
β–Ά Querying timezone database...
ℹ️ Current time: 2025-10-22 14:30:00 JST
βœ… Time retrieved successfully

🎯 Standard Workflow Pattern

Every skill/agent should follow this pattern:

1. Header (Start)

bash .claude/skills/colored-output/color.sh skill-header "SKILL-NAME" "Starting task..."

2. Progress (During)

bash .claude/skills/colored-output/color.sh progress "" "Processing step 1..."
bash .claude/skills/colored-output/color.sh progress "" "Processing step 2..."

3. Info (Results)

bash .claude/skills/colored-output/color.sh info "" "Found 10 items"

4. Status (End)

bash .claude/skills/colored-output/color.sh success "" "Task completed successfully"
# OR
bash .claude/skills/colored-output/color.sh error "" "Task failed: reason"

πŸ§ͺ Testing

Test all color types:

cd .claude/skills/colored-output

# Test skill header
bash color.sh skill-header "test-skill" "This is a skill message"

# Test agent header
bash color.sh agent-header "test-agent" "This is an agent message"

# Test command header
bash color.sh command-header "/test" "This is a command message"

# Test statuses
bash color.sh success "" "Success message"
bash color.sh error "" "Error message"
bash color.sh warning "" "Warning message"
bash color.sh info "" "Info message"
bash color.sh progress "" "Progress message"

πŸ“š Available Types

TypeUsageExample
skill-headerSkill startingπŸ”§ [skill-name] Message
agent-headerAgent startingπŸ€– [agent-name] Message
command-headerCommand starting⚑ [/command] Message
successOperation succeededβœ… Message
errorOperation failed❌ Message
warningCaution needed⚠️ Message
infoInformationalℹ️ Message
progressStep indicatorβ–Ά Message

πŸ”„ How Other Skills Call This

In skill.md Instructions

Add this section to every skill/agent:

## 🎨 Colored Output (Required)

**CRITICAL: Use colored-output skill for ALL user-facing messages!**

### Start of Skill
\`\`\`bash
bash .claude/skills/colored-output/color.sh skill-header "SKILL-NAME" "Starting..."
\`\`\`

### Progress Updates
\`\`\`bash
bash .claude/skills/colored-output/color.sh progress "" "Processing..."
\`\`\`

### Final Status
\`\`\`bash
bash .claude/skills/colored-output/color.sh success "" "Complete!"
# OR
bash .claude/skills/colored-output/color.sh error "" "Failed!"
\`\`\`

🎨 Customization

To change colors globally, edit color.sh:

# Change skill color from blue to cyan
SKILL_COLOR='\033[1;36m'    # Was: \033[1;34m

# Change success icon
SUCCESS_ICON='πŸŽ‰'           # Was: βœ…

All skills/agents immediately inherit the changes!


πŸ“¦ Files

.claude/skills/colored-output/
β”œβ”€β”€ skill.md       # This documentation
└── color.sh       # Bash formatter script

πŸš€ Rollout Strategy

Phase 1: Create Formatter (Done)

  • βœ… Created color.sh script
  • βœ… Created skill.md documentation

Phase 2: Test with One Skill

  • πŸ§ͺ Test with time-helper skill
  • βœ… Verify colors render properly
  • βœ… Confirm user experience improvement

Phase 3: Apply to All Skills

  • Update all .claude/skills/* to use formatter
  • Update all framework skills to use formatter
  • Update all framework agents to use formatter

Phase 4: Maintain

  • All new skills MUST use colored-output
  • Updates to colors happen in ONE place

πŸ’‘ Best Practices

DO:

  • βœ… Use skill-header at the start of every skill
  • βœ… Use progress for multi-step operations
  • βœ… Use success/error for final status
  • βœ… Use info for important details

DON'T:

  • ❌ Duplicate ANSI codes in individual skills
  • ❌ Mix colored and uncolored output
  • ❌ Use too many colors (keep it clean)

πŸŽ‰ Benefits Summary

Before colored-output skill:

  • Every skill had duplicate ANSI codes
  • Inconsistent colors across skills
  • Hard to maintain/update
  • Lots of repeated code

After colored-output skill:

  • βœ… Single source of truth
  • βœ… Consistent UX everywhere
  • βœ… Easy to update colors globally
  • βœ… Clean, DRY code

Version History

v1.0.0 (2025-10-22)

  • Initial release
  • Support for skills, agents, commands
  • 8 message types (headers + statuses)
  • Bash script implementation
  • Cross-platform support

GitHub Repository

majiayu000/claude-skill-registry
Path: skills/colored-output

Related Skills

moai-project-batch-questions

Meta

This skill provides standardized AskUserQuestion templates for batching multiple questions together, reducing user interactions by 60%. It offers reusable question patterns for common optimization scenarios while maintaining clarity. Developers should use it when they need to gather multiple related inputs efficiently in a single interaction.

View skill

moai-project-batch-questions

Meta

This skill provides standardized AskUserQuestion templates for batch optimization, reducing user interactions by up to 60%. It offers reusable question groups for common patterns, allowing developers to maintain clarity while minimizing repetitive prompts. Use it when you need to collect multiple related inputs from users in a single, efficient interaction.

View skill

content-collections

Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill

creating-opencode-plugins

Meta

This skill provides the structure and API specifications for creating OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It offers implementation patterns for JavaScript/TypeScript modules that intercept and extend the AI assistant's lifecycle. Use it when you need to build event-driven plugins for monitoring, custom handling, or extending OpenCode's capabilities.

View skill