chalk-styling-system
Create consistent chalk-based color and styling system for CLI output with themes, semantic colors, and formatting utilities.
What this skill does
# Chalk Styling System
Create consistent chalk-based styling for CLI output.
## Capabilities
- Create color theme systems
- Define semantic color utilities
- Set up text formatting helpers
- Implement conditional styling
- Create box and border utilities
- Generate styling documentation
## Usage
Invoke this skill when you need to:
- Create consistent CLI color schemes
- Define semantic output styling
- Build formatting utilities
- Support multiple themes
## Inputs
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| language | string | Yes | Target language |
| theme | object | No | Custom color theme |
| utilities | array | No | Formatting utilities needed |
## Generated Patterns
### TypeScript Styling System
```typescript
import chalk, { ChalkInstance } from 'chalk';
// Theme definition
export interface Theme {
primary: string;
secondary: string;
success: string;
warning: string;
error: string;
info: string;
muted: string;
}
const defaultTheme: Theme = {
primary: '#3498db',
secondary: '#9b59b6',
success: '#2ecc71',
warning: '#f39c12',
error: '#e74c3c',
info: '#00bcd4',
muted: '#95a5a6',
};
// Create themed chalk instance
export function createTheme(theme: Partial<Theme> = {}): {
primary: ChalkInstance;
secondary: ChalkInstance;
success: ChalkInstance;
warning: ChalkInstance;
error: ChalkInstance;
info: ChalkInstance;
muted: ChalkInstance;
} {
const t = { ...defaultTheme, ...theme };
return {
primary: chalk.hex(t.primary),
secondary: chalk.hex(t.secondary),
success: chalk.hex(t.success),
warning: chalk.hex(t.warning),
error: chalk.hex(t.error),
info: chalk.hex(t.info),
muted: chalk.hex(t.muted),
};
}
// Default styled outputs
export const style = createTheme();
// Semantic helpers
export const log = {
success: (msg: string) => console.log(style.success('✓ ') + msg),
error: (msg: string) => console.error(style.error('✗ ') + msg),
warning: (msg: string) => console.log(style.warning('⚠ ') + msg),
info: (msg: string) => console.log(style.info('ℹ ') + msg),
debug: (msg: string) => console.log(style.muted('⋯ ') + msg),
};
// Text formatting
export const format = {
bold: chalk.bold,
dim: chalk.dim,
italic: chalk.italic,
underline: chalk.underline,
strikethrough: chalk.strikethrough,
code: (text: string) => chalk.bgGray.white(` ${text} `),
link: (text: string, url: string) => chalk.blue.underline(text) + ` (${chalk.dim(url)})`,
};
// Box drawing
export function box(content: string, options?: {
title?: string;
padding?: number;
borderColor?: string;
}): string {
const lines = content.split('\n');
const maxWidth = Math.max(...lines.map(l => l.length), options?.title?.length || 0);
const padding = options?.padding || 1;
const borderColor = options?.borderColor || '#888';
const border = chalk.hex(borderColor);
const horizontalBorder = border('─'.repeat(maxWidth + padding * 2 + 2));
const emptyLine = border('│') + ' '.repeat(maxWidth + padding * 2) + border('│');
const result: string[] = [];
// Top border with optional title
if (options?.title) {
const titlePadding = Math.floor((maxWidth + padding * 2 - options.title.length) / 2);
result.push(
border('┌') +
border('─'.repeat(titlePadding)) +
` ${options.title} ` +
border('─'.repeat(maxWidth + padding * 2 - titlePadding - options.title.length - 2)) +
border('┐')
);
} else {
result.push(border('┌') + horizontalBorder.slice(1, -1) + border('┐'));
}
// Padding top
for (let i = 0; i < padding; i++) {
result.push(emptyLine);
}
// Content
for (const line of lines) {
result.push(
border('│') +
' '.repeat(padding) +
line.padEnd(maxWidth) +
' '.repeat(padding) +
border('│')
);
}
// Padding bottom
for (let i = 0; i < padding; i++) {
result.push(emptyLine);
}
// Bottom border
result.push(border('└') + horizontalBorder.slice(1, -1) + border('┘'));
return result.join('\n');
}
// Table formatting
export function table(
headers: string[],
rows: string[][],
options?: { headerColor?: string }
): string {
const headerColor = chalk.hex(options?.headerColor || '#3498db').bold;
const colWidths = headers.map((h, i) =>
Math.max(h.length, ...rows.map(r => (r[i] || '').length))
);
const headerRow = headers
.map((h, i) => headerColor(h.padEnd(colWidths[i])))
.join(' ');
const separator = colWidths.map(w => '─'.repeat(w)).join('──');
const dataRows = rows.map(row =>
row.map((cell, i) => (cell || '').padEnd(colWidths[i])).join(' ')
);
return [headerRow, separator, ...dataRows].join('\n');
}
```
## Dependencies
```json
{
"dependencies": {
"chalk": "^5.0.0"
}
}
```
## Target Processes
- cli-output-formatting
- error-handling-user-feedback
- cli-application-bootstrap
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.