Get the FREE Ultimate OpenClaw Setup Guide →

ascii-table-renderer

npx machina-cli add skill partme-ai/full-stack-skills/ascii-table-renderer --openclaw
Files (1)
SKILL.md
2.0 KB

When to use this skill

CRITICAL TRIGGER RULE

  • Use this skill ONLY when the user explicitly mentions the exact skill name: ascii-table-renderer.

Trigger phrases include:

  • "ascii-table-renderer"
  • "use ascii-table-renderer"
  • "用 ascii-table-renderer 把列表打印成表格"
  • "使用 ascii-table-renderer 生成 ASCII 表格(对齐/列宽)"

Boundary

  • Do not fetch data (DB/API). Only render and format output.
  • Default borders are ASCII-only: + - |.
  • Out of scope: merged cells, multi-row headers, complex spanning layouts.

How to use this skill

Inputs

  • headers (required)
  • rows (required)
  • maxWidth (default 80)
  • maxColWidth (default 20)
  • borderStyle (light | minimal, default light)
  • overflow (ellipsis | wrap, default ellipsis)
  • align (left | right | center, default left)

Outputs (required)

  • tableCompact (log-friendly)
  • tableReadable (interactive-friendly)
  • rules (width/truncation/null/alignment rules)

Steps

  1. Compute per-column widths: min(maxColWidth, max(contentWidth))
  2. Handle overflow:
    • ellipsis: use ... consistently
    • wrap: wrap within column width while keeping row alignment
  3. Output two variants:
    • compact: minimal or fewer separators
    • readable: clearer borders

Script

  • scripts/render_table.py: render tables from JSON stdin (compact/readable)

Examples

  • examples/basic.md

Quality checklist

  1. Columns align consistently; each line does not exceed maxWidth
  2. Null values are rendered as -
  3. Copy/paste safe (no trailing spaces)

Keywords

English: ascii-table-renderer, ascii table, align, columns, rows, truncate, wrap, terminal, log 中文: ascii-table-renderer, ASCII 表格, 对齐, 列宽, 截断, 换行, 终端, 日志, 工单

Source

git clone https://github.com/partme-ai/full-stack-skills/blob/main/skills/ascii-table-renderer/SKILL.mdView on GitHub

Overview

ascii-table-renderer formats structured data into clean ASCII tables. It enforces per-column width rules, supports truncation or wrapping, and offers border styles for terminal, log, or email views. It outputs two variants: compact for logs and readable for interactive contexts.

How This Skill Works

Provide headers and rows along with optional settings (maxWidth, maxColWidth, borderStyle, overflow, align). The renderer computes per-column widths, applies truncation or wrapping, and renders both compact and readable table variants using ASCII borders. The associated script renders from JSON stdin and emits the two formats for easy copy/paste.

When to Use It

  • Display tabular data in a terminal log with compact borders and a strict width limit.
  • Generate an email-ready table that remains readable when copy-pasted into email clients.
  • Show CLI results where long cells must wrap or truncate without breaking alignment.
  • Prepare a chatbot or Slack/Discord message snippet using monospaced fonts with consistent alignment.
  • Render structured data like CSV/JSON headers and rows to console output for quick inspection.

Quick Start

  1. Step 1: Provide headers and rows as JSON input to the renderer.
  2. Step 2: Run scripts/render_table.py to produce tableCompact and tableReadable.
  3. Step 3: Use the outputs in your terminal logs or emails as needed.

Best Practices

  • Always set maxWidth and maxColWidth to keep lines under the target width.
  • Choose borderStyle (light vs. minimal) to balance readability and whitespace.
  • Decide overflow behavior (ellipsis vs. wrap) based on whether you want concise or complete cell content.
  • Render and verify alignment for all columns, including null values shown as '-'.
  • Test both tableCompact and tableReadable outputs in your target environments (terminal, log viewer, email).

Example Use Cases

  • System health check table printed in terminal logs with status icons.
  • CI test summary included in a console log or email with a compact table.
  • Inventory or asset list displayed in a chat tool using a monospace font.
  • API response schema or data sample shown in a README with an ASCII table.
  • User activity report generated for stakeholders and pasted into an email.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers