Communitygithub.com

YepAPI/skills

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

skills 是什么?

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

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/cli-tools

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

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

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

YepAPI/skills

Tool-use patterns, multi-step reasoning, agent orchestration, and structured outputs.

YepAPI/skills

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

YepAPI/skills

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

YepAPI/skills

Web analytics integration — event tracking, custom dashboards, privacy-first.

YepAPI/skills

Framer Motion — transitions, scroll animations, layout animations.

YepAPI/skills

OpenAPI 3.1 from Zod schemas, interactive docs with Swagger/Scalar, versioning, and example requests for every endpoint.

YepAPI/skills

Authentication security — bcrypt/argon2 hashing, brute force protection, secure password resets.

YepAPI/skills

Session auth, social providers, CSRF protection, and secure cookie patterns.

YepAPI/skills

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

YepAPI/skills

Link building research and backlink audit using YepAPI.

YepAPI/skills

MDX blog setup, RSS feed generation, sitemap.xml, structured data/JSON-LD, and related posts.

YepAPI/skills

Redis caching, CDN cache headers, stale-while-revalidate, cache invalidation, React Query.

YepAPI/skills

Recharts/Chart.js data visualization — bar, line, area, pie charts.

YepAPI/skills

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

YepAPI/skills

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

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Blog engine setup, CMS integration, SEO-optimized content workflows, and editorial calendars.

YepAPI/skills

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

相关技能