cat:render-box
Render boxes and tables with proper emoji-aware alignment using box-drawing characters
What this skill does
# Render Box
## Purpose
Render boxes, tables, and bordered displays with proper emoji-aware alignment. LLMs cannot reliably
calculate character-level padding for Unicode text (see M142), so this skill delegates width
calculation to bash scripts that use Python's `unicodedata` module.
## When to Use
**MANDATORY** when rendering any bordered output containing emojis:
- Status boxes with emoji indicators (โ
, โ , ๐)
- Tables with emoji columns
- Checkpoint displays
- Progress displays with emoji prefixes
**Not needed** for:
- Plain markdown tables without emojis
- Unbordered lists with emojis
- Simple text output
## Prerequisites
The box rendering library is located in the plugin:
- `${CLAUDE_PLUGIN_ROOT}/scripts/lib/box.sh` - Core rendering functions
- `${CLAUDE_PLUGIN_ROOT}/scripts/pad-box-lines.sh` - Line padding with emoji widths
- `${CLAUDE_PLUGIN_ROOT}/emoji-widths.json` - Terminal-specific emoji width data
## Box Types
### 1. Simple Box
For status displays, checkpoints, and messages.
```bash
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/box.sh"
box_init 72 # Set box width (default 74)
box_top "โ
CHECKPOINT: Task Complete"
box_empty
box_line " Task: fix-subagent-token-measurement"
box_line " Status: Complete"
box_empty
box_divider
box_line " Tokens: 45,000 (22% of context)"
box_empty
box_bottom
```
**Output:**
```
โญโโโ โ
CHECKPOINT: Task Complete โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ Task: fix-subagent-token-measurement โ
โ Status: Complete โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Tokens: 45,000 (22% of context) โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
```
### 2. Table with Headers
For data with multiple columns. Build rows as TSV, then render with column alignment.
Use rounded corners for consistency with box displays.
```bash
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/box.sh"
# Define column widths (adjust based on content)
COL1_W=17 # Type
COL2_W=32 # Description
COL3_W=8 # Tokens
COL4_W=15 # Context
COL5_W=10 # Duration
# Helper to pad cell content
pad_cell() {
local content="$1"
local width="$2"
local display_w=$(display_width "$content")
local padding=$((width - display_w))
printf '%s%*s' "$content" "$padding" ""
}
# Render header (rounded top corners)
echo "โญ$(dashes $COL1_W)โฌ$(dashes $COL2_W)โฌ$(dashes $COL3_W)โฌ$(dashes $COL4_W)โฌ$(dashes $COL5_W)โฎ"
echo "โ$(pad_cell " Type" $COL1_W)โ$(pad_cell " Description" $COL2_W)โ$(pad_cell " Tokens" $COL3_W)โ$(pad_cell " Context" $COL4_W)โ$(pad_cell " Duration" $COL5_W)โ"
echo "โ$(dashes $COL1_W)โผ$(dashes $COL2_W)โผ$(dashes $COL3_W)โผ$(dashes $COL4_W)โผ$(dashes $COL5_W)โค"
# Render data rows
echo "โ$(pad_cell " Explore" $COL1_W)โ$(pad_cell " Explore codebase" $COL2_W)โ$(pad_cell " 68.4k" $COL3_W)โ$(pad_cell " 34% โ OK" $COL4_W)โ$(pad_cell " 1m 7s" $COL5_W)โ"
echo "โ$(pad_cell " general-purpose" $COL1_W)โ$(pad_cell " Implement refactor" $COL2_W)โ$(pad_cell " 170.0k" $COL3_W)โ$(pad_cell " 85% โ EXCEEDED" $COL4_W)โ$(pad_cell " 3m 12s" $COL5_W)โ"
# Render footer (rounded bottom corners)
echo "โฐ$(dashes $COL1_W)โด$(dashes $COL2_W)โด$(dashes $COL3_W)โด$(dashes $COL4_W)โด$(dashes $COL5_W)โฏ"
```
**Output:**
```
โญโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโโโโโโโฌโโโโโโโโโโโฎ
โ Type โ Description โ Tokens โ Context โ Duration โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโค
โ Explore โ Explore codebase โ 68.4k โ 34% โ OK โ 1m 7s โ
โ general-purpose โ Implement refactor โ 170.0k โ 85% โ EXCEEDEDโ 3m 12s โ
โฐโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโฏ
```
### 3. Nested Box
For hierarchical displays like project status.
```bash
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/box.sh"
box_init 72
box_top "๐บ๏ธ PROJECT STATUS"
box_empty
# Use inner_* functions for nested boxes
inner_top "๐ฆ v1.0: Initial Release"
inner_line "โ๏ธ v1.1: Core features (5/5)"
inner_line "๐ **v1.2: Current** (3/5)"
inner_line " ๐ณ pending-task-1"
inner_line " ๐ณ pending-task-2"
inner_bottom
box_empty
box_bottom
```
## Key Functions
| Function | Purpose |
|----------|---------|
| `box_init WIDTH` | Initialize box width (default 74) |
| `box_top "TITLE"` | Top border with optional title |
| `box_bottom` | Bottom border |
| `box_line "CONTENT"` | Content line with borders |
| `box_empty` | Empty line with borders |
| `box_divider` | Horizontal divider |
| `display_width "TEXT"` | Calculate emoji-aware display width |
| `pad "TEXT" WIDTH` | Pad text to exact display width |
| `dashes COUNT` | Generate COUNT dash characters |
| `inner_top "TITLE"` | Nested box top border |
| `inner_line "CONTENT"` | Nested box content line |
| `inner_bottom` | Nested box bottom border |
| `progress_bar PCT [WIDTH]` | Generate progress bar string |
## Box-Drawing Characters
| Character | Name | Usage |
|-----------|------|-------|
| `โ` | Horizontal | Borders, dividers |
| `โ` | Vertical | Side borders, column separators |
| `โญ` `โฎ` | Rounded top | Top corners (ALL boxes and tables) |
| `โฐ` `โฏ` | Rounded bottom | Bottom corners (ALL boxes and tables) |
| `โ` `โค` | T-junction | Row dividers |
| `โฌ` `โด` | T-junction | Column headers/footers |
| `โผ` | Cross | Grid intersections |
| `โ` `โ` | Block | Progress bars |
**Note:** Use rounded corners (`โญโฎโฐโฏ`) for all boxes and tables for visual consistency.
Square corners (`โโโโ`) are deprecated.
## Anti-Patterns
### Never calculate padding manually
```bash
# โ WRONG - LLMs cannot reliably calculate emoji widths
printf "โ %-20s โ\n" "โ
Task complete"
# โ
CORRECT - Use display_width function
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/box.sh"
box_line " โ
Task complete"
```
### Never use markdown tables with emojis
```markdown
<!-- โ WRONG - Emojis break column alignment -->
| Status | Task |
|--------|------|
| โ
| Complete |
| โ | Warning |
```
Use box-drawing tables instead (see Table with Headers above).
### Never hardcode emoji widths
```bash
# โ WRONG - Emoji widths vary by terminal
EMOJI_WIDTH=2
# โ
CORRECT - Use display_width function
WIDTH=$(display_width "โ
")
```
## Related Skills
- `cat:token-report` - Uses render-box for subagent token tables
- `cat:status` - Uses render-box for project status display
- `cat:shrink-doc` - Uses render-box for validation tables
## Related References
- `display-standards.md` - Visual formatting guidelines
- `M142` - Learning about LLM padding calculation limitations
Related in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.