Communitygithub.com

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

What is skills?

skills is a Claude Code agent skill that commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/cli-tools

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

CLI Tools

Rules

  • Commander.js for argument parsing — .command(), .option(), .argument() with descriptions
  • Interactive prompts: @clack/prompts (modern, beautiful) or inquirer — for user input when args aren't provided
  • Spinners: ora for long-running operations — start, update message, succeed/fail
  • Colors: chalk for styled output — use sparingly: red for errors, green for success, yellow for warnings, dim for secondary info
  • Config files: cosmiconfig — searches .toolrc, .toolrc.json, tool.config.js, package.json key automatically
  • Exit codes: 0 for success, 1 for general error, 2 for usage error — always process.exit(code)
  • --help and --version flags: Commander adds these automatically — write clear descriptions for every option
  • Error handling: catch errors at the top level, print user-friendly message to stderr, exit with code 1
  • Publish: bin field in package.json, #!/usr/bin/env node shebang, "type": "module" for ESM

Patterns

#!/usr/bin/env node
import { Command } from "commander";
import * as p from "@clack/prompts";
import ora from "ora";
import chalk from "chalk";

const program = new Command()
  .name("my-tool")
  .description("A CLI that does useful things")
  .version("1.0.0");

program
  .command("init")
  .description("Initialize a new project")
  .option("-t, --template <name>", "template to use", "default")
  .action(async (options) => {
    p.intro(chalk.bold("Project Setup"));

    const name = await p.text({ message: "Project name?", placeholder: "my-app" });
    if (p.isCancel(name)) { p.cancel("Cancelled."); process.exit(0); }

    const spinner = ora("Creating project...").start();
    await createProject(name, options.template);
    spinner.succeed(chalk.green("Project created!"));

    p.outro(`Run ${chalk.cyan(`cd ${name} && npm install`)}`);
  });

program.parse();

// package.json: { "bin": { "my-tool": "./dist/index.js" } }

Avoid

  • Printing errors to stdout — use console.error() or process.stderr.write() for errors
  • Exiting without a code on failure — always process.exit(1) so scripts and CI detect the failure
  • Walls of unformatted text — use chalk colors, sections, and whitespace for readability
  • Requiring interactive input with no flag alternative — always support --flag overrides for CI/scripting
  • Forgetting the shebang #!/usr/bin/env node — without it, npx and global installs won't work

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Tenant isolation (row-level vs schema), subdomain routing, per-tenant config, and data partitioning.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

Related Skills