agentleFS
YauhenBichelYauhenBichel/engineering-skills/skills/write-cli/SKILL.md

write-cli

Skill0 starsChanged 52 days agoApache-2.0View on GitHub

Builds a command-line tool that is pleasant for people and scripts. Use when creating a CLI.

  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create main.py (or main.go/main.rs).

    line 7
  2. Very specific:

    Write tests in tests/test_main.py.

    line 13

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Steps

  1. Create main.py (or main.go/main.rs). Import argparse, click, or cobra.
  2. Define arguments and flags. Ensure --help prints a clear explanation for every option.
  3. Prompt only when sys.stdin.isatty() is true; otherwise require the value as a flag and fail with a usage error.
  4. Execute core logic. Catch exceptions. Write errors to stderr with a concrete fix hint.
  5. Format output. Default to human-readable text. Enable --json for machine-readable output.
  6. Set exit codes: 0 for success, 1 for failure, 2 for usage errors.
  7. Write tests in tests/test_main.py. Call main() directly with explicit argument lists.
  8. Register the command as an entry point ([project.scripts] in pyproject.toml, or go install).

Checklist

  • --help lists every flag with a one-line explanation.
  • Exit codes match: 0 ok, 1 failure, 2 usage.
  • --json flag outputs valid JSON. Default output is plain text.
  • All errors go to stderr. Each error includes a concrete fix hint.
  • No interactive prompt when stdin is not a terminal.
  • Tests call main() with explicit arguments. No subprocess calls in tests.
  • Entry point uses if __name__ == "__main__": guard.

Output

  • The complete source file with argument parsing and exit code handling.
  • A test file that invokes main() directly with sample arguments.
  • A one-line usage example showing the --json flag and expected output.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.