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"
- "Use ascii-table-renderer to print a list as a table"
- "Use ascii-table-renderer to generate ASCII tables (alignment/column width)"
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
- Compute per-column widths:
min(maxColWidth, max(contentWidth)) - Handle overflow:
- ellipsis: use
...consistently - wrap: wrap within column width while keeping row alignment
- ellipsis: use
- 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
- Columns align consistently; each line does not exceed maxWidth
- Null values are rendered as
- - Copy/paste safe (no trailing spaces)
Keywords
English: ascii-table-renderer, ascii table, align, columns, rows, truncate, wrap, terminal, log Chinese: ascii-table-renderer, ASCII table, alignment, column width, truncation, line wrapping, terminal, logging, ticket
Common Pitfalls (Gotchas)
- Version compatibility: Pay attention to the compatibility between framework versions and dependency libraries; APIs may differ across versions
- Configuration file format: Configuration file format errors are the most common issue; it is recommended to use your editor's syntax checking
- Environment variables: Ensure all necessary environment variables are set correctly, and do not hard-code sensitive information
- Dependency conflicts: When multiple versions coexist, watch out for dependency conflicts and use a lock file to pin versions
- Performance pitfalls: Pay attention to performance optimization in large-data scenarios, and avoid common problems such as N+1 queries
Usage workflow
Step 1: Environment preparation
Ensure the necessary dependencies and tools are installed in the development environment.
Step 2: Configuration initialization
Perform basic configuration according to project requirements.
Step 3: Core feature usage
Implement the core functionality according to the example code.
Step 4: Test verification
Run tests to ensure the functionality works properly.
Step 5: Deployment and release
After development is complete, proceed with deployment and monitoring.