AgentSkillsCN

Tool Development

工具开发

SKILL.md

Tool Development Skill

Overview

This skill teaches how to build production-ready CLI tools, automation scripts, and Python utilities.

Principles

  • User Experience First: Intuitive CLI with clear help messages
  • Robust Error Handling: Graceful failure with helpful error messages
  • Comprehensive Logging: Structured logging for debugging
  • Configuration Management: Flexible config via files and environment variables
  • Testing: Unit and integration tests for reliability
  • Documentation: Clear README and inline documentation

Key Capabilities

1. CLI Frameworks

  • argparse (standard library)
  • click (decorator-based)
  • typer (type-hint based)

2. Configuration

  • Multiple config sources (files, env vars, CLI args)
  • Standard config formats (YAML, TOML, JSON)
  • Validation and defaults

3. Packaging

  • setup.py and pyproject.toml
  • Entry points
  • Distribution to PyPI

When to Use This Skill

Load this skill when:

  • Building CLI tools
  • Creating automation scripts
  • Packaging Python utilities
  • Designing CLI interfaces
  • Adding configuration management

Sections

  • cli-patterns.md: argparse, click, typer patterns
  • packaging.md: setup.py, pyproject.toml, distribution
  • configuration.md: Config files, environment variables
  • logging.md: Structured logging, log levels