rust-cli-builder
Что он делает
Этот скилл помогает вашему агенту создавать утилиты командной строки на Rust. Он нужен разработчикам, которые создают новую CLI-утилиту или дополняют существующую подкомандами, файлами конфигурации и понятным выводом.
Когда использовать
- ✓Когда вы хотите создать новую утилиту командной строки на Rust с нуля.
- ✓Когда нужно добавить подкоманды в существующую CLI на Rust.
- ✓Когда вам нужны файл конфигурации или цветной вывод в утилите на Rust.
Ссылка на скилл
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/rust-cli-builder/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Собери CLI на Rust, который конвертирует CSV-файлы в JSON, с конфигом для параметров по умолчанию.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Агент сначала изучает существующий проект, затем задает вопросы о командах, форматах входных и выходных данных и о том, как инструмент будет распространяться. После этого он пишет код с clap, обработкой ошибок и поддержкой конфигурации.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Rust CLI Tool Builder
When to use
Use this skill when you need to:
- Scaffold a new Rust CLI tool from scratch with clap
- Add subcommands to an existing CLI application
- Implement config file loading (TOML/JSON/YAML)
- Set up proper error handling with anyhow/thiserror
- Add colored and formatted terminal output
- Structure a CLI project for distribution via cargo install or GitHub releases
Phase 1: Explore (Plan Mode)
Enter plan mode. Before writing any code, explore the existing project:
If extending an existing project
- Find
Cargo.tomland check current dependencies (clap version, serde, tokio, etc.) - Locate the CLI entry point (
src/main.rsorsrc/cli.rs) - Check if clap is using derive macros or builder pattern
- Identify existing subcommand structure
- Look for existing error types, config structs, and output formatting
- Check if there's a
src/lib.rsseparating library logic from CLI
If starting from scratch
- Check the workspace for any existing Rust projects or workspace
Cargo.toml - Look for a
.cargo/config.tomlwith custom settings - Check for
rust-toolchain.tomlto know the target Rust edition
Phase 2: Interview (AskUserQuestion)
Use AskUserQuestion to clarify requirements. Ask in rounds.
Round 1: Tool purpose and commands
Question: "What kind of CLI tool are you building?"
Header: "Tool type"
Options:
- "Single command (like ripgrep, curl)" — One main action with flags and arguments
- "Multi-command (like git, cargo)" — Multiple subcommands under one binary
- "Interactive REPL (like psql)" — Persistent session with a prompt loop
- "Pipeline tool (like jq, sed)" — Reads stdin, transforms, writes stdout
Question: "What will the tool operate on?"
Header: "Input"
Options:
- "Files/directories" — Read, process, or generate files
- "Network/API" — HTTP requests, TCP connections, API calls
- "System resources" — Processes, hardware info, OS config
- "Data streams (stdin/stdout)" — Pipe-friendly text/binary processing
Round 2: Subcommands (if multi-command)
Question: "Describe the subcommands you need (e.g., 'init', 'build', 'deploy')"
Header: "Commands"
Options:
- "2-3 subcommands (I'll describe them)" — Small focused tool
- "4-8 subcommands with groups" — Medium tool, may need command groups
- "I have a rough list, help me design the API" — Collaborative command design
Round 3: Configuration and output
Question: "How should the tool be configured?"
Header: "Config"
Options:
- "CLI flags only (Recommended)" — All config via command-line arguments
- "Config file (TOML)" — Load defaults from ~/.config/toolname/config.toml
- "Config file + CLI overrides" — Config file for defaults, flags override specific values
- "Environment variables + flags" — Env vars for secrets, flags for everything else
Question: "What output format does the tool need?"
Header: "Output"
Options:
- "Human-readable (colored text)" — Pretty terminal output with colors and formatting
- "Machine-readable (JSON)" — Structured output for piping to other tools
- "Both (--format flag)" — Default human, --json or --format=json for machines
- "Minimal (exit codes only)" — Success/failure via exit code, errors to stderr
Round 4: Async and error handling
Question: "Does the tool need async operations?"
Header: "Async"
Options:
- "No — synchronous is fine (Recommended)" — File I/O, computation, simple operations
- "Yes — tokio (network I/O)" — HTTP requests, concurrent connections, async file I/O
- "Yes — tokio multi-threaded" — Heavy parallelism, multiple concurrent tasks
Question: "How should errors be presented to users?"
Header: "Errors"
Options:
- "Simple messages (anyhow) (Recommended)" — Human-readable error chains, good for most CLIs
- "Typed errors (thiserror)" — Custom error enum with specific variants for each failure
- "Both (thiserror for lib, anyhow for bin)" — Library code is typed, CLI wraps with anyhow
Phase 3: Plan (ExitPlanMode)
Write a concrete implementation plan covering:
- Project structure —
Cargo.tomldependencies,src/file layout - CLI definition — clap derive structs for all commands, args, and flags
- Config loading — config file format and merge strategy with CLI args
- Core logic — main functions for each subcommand, separated from CLI layer
- Error types — error enum or anyhow usage, user-facing error messages
- Output formatting —
Частые вопросы
Задает ли он вопросы перед написанием кода?
Да, скилл сначала составляет план вместе с вами, включая команды, форматы и распространение.
Какую библиотеку он использует для аргументов?
Для разбора аргументов командной строки используется clap.
Как можно поделиться утилитой?
Скилл рассказывает о распространении через cargo install или релизы на GitHub.
Подробности
Оригинальное описание автора
Plan and build production-ready Rust CLI tools using clap for argument parsing, with subcommands, config file support, colored output, and proper error handling. Uses interview-driven planning to clarify commands, input/output formats, and distribution strategy before writing any code.
Популярность
- Звёзды на GitHub
- 33k
- Место в рейтинге
- #8795
- Лицензия
- MIT
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
owasp-security
33kУчит агента рекомендациям OWASP по безопасности для веб-приложений, API, мобильных приложений, контейнеров и ИИ-агентов: поиск слабостей и исправления.
agent-management
33kПозволяет агенту создавать, перечислять, усыплять, будить, переименовывать и удалять ИИ-агентов через AI Maestro, управляя жизненным циклом каждого.
agent-messaging
33kПозволяет агенту отправлять, получать и отвечать на подписанные сообщения между ИИ-агентами по протоколу Agent Messaging Protocol, в основном на вашем компьютере.
docs-search
33kПозволяет агенту искать по сгенерированной документации кода: сигнатуры функций, классы и комментарии, чтобы проверить реальный API до изменения кода.
Похожие скиллы
diffs
394kПозволяет агенту создать настоящее сравнение правок в виде ссылки или файла изображения, которым можно поделиться, вместо ручной сводки.
coding-agent
394kПомогает агенту передать большую задачу по коду в Codex, Claude Code или OpenCode как фоновому исполнителю, а затем проверять ее ход.
gh-issues
394kПомогает агенту находить задачи GitHub, выбирать, над какими работать, и открывать запросы на слияние с исправлениями, включая ответы на комментарии рецензентов.