Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.
Python aianthropicautomationclaude-codeclaude-skillscloudflaredevtoolsproductivityreactskillstailwindvite
#!/usr/bin/env npx tsx
/**
* {Tool Name} - {Brief description}
*
* Usage:
* npx tsx scripts/{tool-name}.ts <args>
* npx tsx scripts/{tool-name}.ts --help
*
* Examples:
* npx tsx scripts/{tool-name}.ts {example}
*/
import * as fs from 'fs';
import * as path from 'path';
// ============================================================================
// Configuration
// ============================================================================
interface Config {
// Add config options
}
function loadConfig(): Config {
// Load from env, config file, etc.
return {};
}
// ============================================================================
// Argument Parsing
// ============================================================================
interface Args {
// Define expected arguments
input?: string;
output?: string;
format: 'json' | 'csv' | 'table';
verbose: boolean;
help: boolean;
}
function parseArgs(): Args {
const args = process.argv.slice(2);
const parsed: Args = {
format: 'json',
verbose: false,
help: false,
};
for (let i = 0; i < args.length; i++) {
switch (args[i]) {
case '--input':
parsed.input = args[++i];
break;
case '--output':
parsed.output = args[++i];
break;
case '--format':
parsed.format = args[++i] as Args['format'];
break;
case '--verbose':
parsed.verbose = true;
break;
case '--help':
case '-h':
parsed.help = true;
break;
}
}
return parsed;
}
function showHelp(): void {
console.log(`
{Tool Name} - {Description}
Usage:
npx tsx scripts/{tool-name}.ts [options] <args>
Options:
--input <file> Read input from file
--output <file> Write output to file
--format <type> Output format: json, csv, table (default: json)
--verbose Show debug information
--help, -h Show this help
Examples:
npx tsx scripts/{tool-name}.ts example-arg
npx tsx scripts/{tool-name}.ts --input data.csv --output results.json
`);
}
// ============================================================================
// Core Logic
// ============================================================================
interface Result {
success: boolean;
data?: unknown;
error?: string;
}
async function execute(/* params */): Promise<Result> {
// Implement core logic here
// This could also import from a shared module
return { success: true, data: {} };
}
// ============================================================================
// Output Formatting
// ============================================================================
function formatOutput(result: Result, format: Args['format']): string {
switch (format) {
case 'json':
return JSON.stringify(result, null, 2);
case 'csv':
// Implement CSV formatting
return '';
case 'table':
// Implement table formatting
return '';
}
}
// ============================================================================
// Main
// ============================================================================
async function main(): Promise<void> {
const args = parseArgs();
if (args.help) {
showHelp();
process.exit(0);
}
try {
const result = await execute(/* pass args */);
const output = formatOutput(result, args.format);
if (args.output) {
fs.writeFileSync(args.output, output);
if (args.verbose) {
console.error(`Written to ${args.output}`);
}
} else {
console.log(output);
}
process.exit(result.success ? 0 : 1);
} catch (error: any) {
console.error(JSON.stringify({ success: false, error: error.message }));
process.exit(1);
}
}
main();