agentleFS
juninmdjuninmd/skills/.agents/skills/tooling-dev/SKILL.md

tooling-dev

Skill2 starsChanged 5 days agoMITView on GitHub

Build and maintain command-line tools, developer automation, and code generators. Use for CLI arguments, exit codes, non-interactive execution, config discovery, signals, structured output, packaging, and integration tests. Trigger on 'build a CLI', 'write a script to automate this', 'scaffold a generator', 'wrong exit code'.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write the invocation examples first — including the one inside a CI job and the one inside a pipe.

    line 18
  2. Distinctive:

    Write the invocation examples first — including the one inside a CI job and the one inside a pipe.

    line 21
  3. Distinctive:

    Test invalid flags, missing config, partial files, interruption, and cross-platform paths — not just the happy invocation.

    line 25
  4. Distinctive:

    Only the source entry point was smoked.

    line 84
  5. Distinctive:

    Never prompt in CI. Provide explicit flags for confirmation and for quiet mode.

    line 89
  6. Distinctive:

    Avoid regex parsing when a structured parser exists — the regex works until the first quoted comma.

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Tooling Development

Not this skill: a user-facing service or endpoint (backend-systems), or CI pipeline steps (cloud-devops).

Preflight

cat package.json | jq '{bin, files, engines}'   # what actually ships
command -v <tool> && <tool> --help | head -20   # the current contract, if it exists

Write the invocation examples first — including the one inside a CI job and the one inside a pipe. They define the contract more honestly than a design document.

Workflow

  1. Write the invocation examples first — including the one inside a CI job and the one inside a pipe. They define the contract more honestly than any design doc.
  2. Inspect the repository's runtime, packaging, config, logging, and distribution conventions before adding a fourth way to do any of them.
  3. Separate command parsing from domain logic. The core must be callable without a terminal, or it can never be tested or reused.
  4. Support --help, non-interactive execution, machine-readable output, and bounded cancellation.
  5. Test invalid flags, missing config, partial files, interruption, and cross-platform paths — not just the happy invocation.
  6. Smoke the installed or packaged command, never only the source entry point. Packaging is where tools break.

The Stream Contract

This split is the entire reason a tool composes.

StreamCarriesRule
stdoutthe result — the thing a pipe consumesmachine-readable when not a TTY
stderrprogress, warnings, diagnostic outputnever part of the result
exit codesuccess or the class of failure0 only when the work actually happened
CodeMeans
0success
1generic runtime failure
2usage error — bad flag, missing argument
3–63tool-specific, documented in --help
64–78borrow sysexits.h meanings when they fit: 64 usage, 65 data error, 66 missing input, 69 unavailable, 70 internal error, 78 bad config
130interrupted (SIGINT, 128+2)

A single exit code 1 for everything makes automation impossible: the caller cannot tell "you typed it wrong" from "the network died". Argument parsing has its own edge cases (--, negative numbers, repeated flags, clustering) and exit codes need a versioning and deprecation story of their own — see argument and exit conventions.

Adapt to the Terminal, Then Get Out of the Way

const isTTY = process.stdout.isTTY;
const color = isTTY && !process.env.NO_COLOR && !argv.noColor;
// JSON when piped, human table when interactive
isTTY ? renderTable(rows) : process.stdout.write(JSON.stringify(rows) + '\n');

Honor NO_COLOR and an explicit --no-color regardless of TTY detection. Never emit a spinner or a progress bar into a redirected stream — it becomes megabytes of escape codes in a CI log.

Failure Paths People Skip

EventCorrect behavior
SIGINT / SIGTERMstop, delete the partial output file, exit non-zero
Downstream pipe closes (head)catch EPIPE, exit quietly — never a stack trace
Running in CI with no TTYnever prompt; require an explicit --yes
Output file already existspreview, back up, or demand --force
Config found in several placesdocumented precedence, and --print-config to show what won

Config precedence, highest first: command flag → environment variable → project file → user file → built-in default. Print the resolved source on request; "why is it using that value" is the most common support question a tool generates — see argument and exit conventions for the diagnostic technique when precedence itself is the bug.

Reference Routing

  • Practical tooling cases: real-world-cases.md
  • CLI behavior and operational standards: tooling-best-practices.md
  • Implementation patterns: tooling-examples.md
  • Argument parsing, exit codes, and config precedence diagnosis: argument-and-exit-conventions.md
  • Signals, atomic writes, TTY/piping, packaging, and flag deprecation: packaging-and-compatibility.md
  • Reference docs generated from code or schemas: use the documentation skill.

See Reference Map for specialized references and sub-domain guides.

Stop

  • The tool would prompt in a non-TTY context. Never prompt in CI; require an explicit flag.
  • A partial output file would survive an interruption. Write to a temp path and rename atomically instead.
  • Only the source entry point was smoked. Test the packaged command — packaging is where tools break.

Rules

  • Hand off deployment pipelines to cloud-devops, testing to test-engineering, and agent tools to agent-engineering.
  • A truncated artifact that looks complete is worse than no artifact. Write to a temp path and rename atomically on success.
  • Never prompt in CI. Provide explicit flags for confirmation and for quiet mode.
  • Avoid regex parsing when a structured parser exists — the regex works until the first quoted comma.
  • Version the output format. A tool whose JSON shape drifts silently breaks every script built on it; --format-version or a schema field costs nothing now and everything later.
  • --help is the primary documentation. If a behavior is not in it, the behavior does not exist for most users.
  • Deprecate a flag by keeping it working, warning on stderr with the replacement, and removing it only after a documented version window — never a silent break; Hunt & Thomas's The Pragmatic Programmer frames this as treating your own CLI contract with the same reversibility discipline as an external API.
  • Name commands and flags for what they do, not how they are implemented — Robert C. Martin's Clean Code naming rules apply as much to a --flag as to a function.
  • Shell scripts and one-off command safety belong to cloud-devops; publishing and versioning the tool to git-workflow.

Checklist

  • Invocation examples written first, including the CI and piped cases.
  • Core logic callable without a terminal.
  • stdout carries only the result; diagnostic output on stderr; exit codes distinguish usage from runtime failure.
  • TTY detection, NO_COLOR, signals, and EPIPE all handled.
  • Config precedence documented and inspectable.
  • Partial output never left behind; the packaged command smoke-tested.

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.