Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate table formatters for structured CLI output with column alignment, borders, and responsive sizing.
.claude/skills/a5c-ai-cli-table-formatter/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 34% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 41% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 61% | 0% |
Generate table formatters for structured CLI output.
Invoke this skill when you need to:
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | language | string | Yes | Target language | | style | string | No | Border style (simple, unicode, markdown) | | features | array | No | Required features |
typescriptimport chalk from 'chalk'; export interface TableColumn { key: string; header: string; width?: number; align?: 'left' | 'center' | 'right'; format?: (value: any) => string; } export interface TableOptions { columns: TableColumn[]; borderStyle?: 'simple' | 'unicode' | 'none' | 'markdown'; headerColor?: (text: string) => string; maxWidth?: number; } const borders = { simple: { top: '-', bottom: '-', left: '|', right: '|', topLeft: '+', topRight: '+', bottomLeft: '+', bottomRight: '+', horizontal: '-', vertical: '|', cross: '+', }, unicode: { top: '─', bottom: '─', left: '│', right: '│', topLeft: '┌', topRight: '┐', bottomLeft: '└', bottomRight: '┘', horizontal: '─', vertical: '│', cross: '┼', midLeft: '├', midRight: '┤', topMid: '┬', bottomMid: '┴', }, none: { top: '', bottom: '', left: '', right: '', topLeft: '', topRight: '', bottomLeft: '', bottomRight: '', horizontal: '', vertical: ' ', cross: '', }, }; export class TableFormatter { private columns: TableColumn[]; private options: TableOptions; private border: typeof borders.unicode; constructor(options: TableOptions) { this.options = options; this.columns = options.columns; this.border = borders[options.borderStyle || 'unicode']; } private calculateWidths(data: Record<string, any>[]): number[] { return this.columns.map(col => { const headerWidth = col.header.length; const maxDataWidth = Math.max( ...data.map(row => String(row[col.key] ?? '').length) ); return col.width || Math.max(headerWidth, maxDataWidth); }); } private padCell(text: string, width: number, align: 'left' | 'center' | 'right' = 'left'): string { const padding = width - text.length; if (align === 'center') { const left = Math.floor(padding / 2); const right = padding - left; return ' '.repeat(left) + text + ' '.repeat(right); } if (align === 'right') { return ' '.repeat(padding) + text; } return text + ' '.repeat(padding); } format(data: Record<string, any>[]): string { const widths = this.calculateWidths(data); const lines: string[] = []; const b = this.border; // Top border if (b.top) { lines.push( b.topLeft + widths.map(w => b.top.repeat(w + 2)).join(b.topMid || b.cross) + b.topRight ); } // Header const headerCells = this.columns.map((col, i) => ' ' + this.padCell(col.header, widths[i], col.align) + ' ' ); const headerColor = this.options.headerColor || chalk.bold; lines.push( b.left + headerCells.map(c => headerColor(c)).join(b.vertical) + b.right ); // Header separator if (b.horizontal) { lines.push( (b.midLeft || b.left) + widths.map(w => b.horizontal.repeat(w + 2)).join(b.cross) + (b.midRight || b.right) ); } // Data rows for (const row of data) { const cells = this.columns.map((col, i) => { const value = row[col.key] ?? ''; const formatted = col.format ? col.format(value) : String(value); return ' ' + this.padCell(formatted, widths[i], col.align) + ' '; }); lines.push(b.left + cells.join(b.vertical) + b.right); } // Bottom border if (b.bottom) { lines.push( b.bottomLeft + widths.map(w => b.bottom.repeat(w + 2)).join(b.bottomMid || b.cross) + b.bottomRight ); } return lines.join('\n'); } } // Quick table function export function table( data: Record<string, any>[], columns?: (string | TableColumn)[] ): string { const cols: TableColumn[] = columns ? columns.map(c => typeof c === 'string' ? { key: c, header: c } : c) : Object.keys(data[0] || {}).map(key => ({ key, header: key })); return new TableFormatter({ columns: cols }).format(data); }
typescript// Simple table console.log(table([ { name: 'Alice', age: 30, role: 'Admin' }, { name: 'Bob', age: 25, role: 'User' }, ])); // Custom columns const formatter = new TableFormatter({ columns: [ { key: 'id', header: 'ID', width: 6, align: 'right' }, { key: 'name', header: 'Name', width: 20 }, { key: 'status', header: 'Status', format: (v) => v === 'active' ? chalk.green(v) : chalk.red(v) }, ], borderStyle: 'unicode', headerColor: chalk.cyan.bold, }); console.log(formatter.format(data));
json{ "dependencies": { "chalk": "^5.0.0" } }
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 20,485 | 15,554 | -24% | 1 | 1 | 0% | 4,760 | 5,684 | +19% | 0 | 0 | — |
case-02 | fail→pass | 18,882 | 13,882 | -26% | 1 | 1 | 0% | 4,123 | 5,185 | +26% | 0 | 0 | — |
case-03 | fail→fail | 20,996 | 17,197 | -18% | 1 | 1 | 0% | 3,682 | 4,667 | +27% | 0 | 0 | — |
case-04 | fail→fail | 10,754 | 15,161 | +41% | 1 | 1 | 0% | 2,151 | 4,843 | +125% | 0 | 0 | — |
case-05 | fail→fail | 13,607 | 13,154 | -3% | 1 | 1 | 0% | 3,102 | 4,555 | +47% | 0 | 0 | — |
case-06 | fail→fail | 15,721 | 14,781 | -6% | 1 | 1 | 0% | 3,063 | 4,568 | +49% | 0 | 0 | — |
case-07 | fail→pass | 13,208 | 5,890 | -55% | 1 | 1 | 0% | 2,249 | 2,929 | +30% | 0 | 0 | — |
case-08 | fail→pass | 10,190 | 7,275 | -29% | 1 | 1 | 0% | 2,419 | 3,231 | +34% | 0 | 0 | — |
case-09 | fail→fail | 11,362 | 8,850 | -22% | 1 | 1 | 0% | 2,163 | 3,776 | +75% | 0 | 0 | — |
case-10 | fail→fail | 15,448 | 12,418 | -20% | 1 | 1 | 0% | 3,793 | 4,763 | +26% | 0 | 0 | — |
case-11 | fail→pass | 13,584 | 8,437 | -38% | 1 | 1 | 0% | 2,519 | 3,542 | +41% | 0 | 0 | — |
case-12 | pass→pass | 6,148 | 1,649 | -73% | 1 | 1 | 0% | 1,018 | 1,913 | +88% | 0 | 0 | — |
case-13 | fail→fail | 13,555 | 7,137 | -47% | 1 | 1 | 0% | 2,657 | 3,104 | +17% | 0 | 0 | — |
case-14 | fail→fail | 15,887 | 13,454 | -15% | 1 | 1 | 0% | 2,942 | 4,209 | +43% | 0 | 0 | — |
case-15 | fail→pass | 12,358 | 11,791 | -5% | 1 | 1 | 0% | 2,438 | 3,928 | +61% | 0 | 0 | — |
case-16 | fail→fail | 11,218 | 7,464 | -33% | 1 | 1 | 0% | 2,300 | 3,074 | +34% | 0 | 0 | — |
case-17 | fail→fail | 9,522 | 8,399 | -12% | 1 | 1 | 0% | 1,773 | 3,260 | +84% | 0 | 0 | — |
case-18 | fail→fail | 6,032 | 1,602 | -73% | 1 | 1 | 0% | 1,176 | 1,959 | +67% | 0 | 0 | — |
case-19 | fail→fail | 9,521 | 3,565 | -63% | 1 | 1 | 0% | 1,672 | 2,227 | +33% | 0 | 0 | — |
case-20 | fail→pass | 9,533 | 5,925 | -38% | 1 | 1 | 0% | 1,683 | 2,686 | +60% | 0 | 0 | — |
case-21 | fail→pass | 13,765 | 8,097 | -41% | 1 | 1 | 0% | 2,751 | 3,277 | +19% | 0 | 0 | — |
case-22 | fail→fail | 15,572 | 7,945 | -49% | 1 | 1 | 0% | 2,388 | 3,336 | +40% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 22 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.