Skip to content
Back to skills

Tooling Dev

ASecurity

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'.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 21, 2026
ai-agentsshellbashtestinggitapibackenddevopsdocumentation

Works with

  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned November 21, 2026

npx -y skills add juninmd/skills --skill tooling-dev --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tooling Dev?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tooling Dev
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/juninmd-tooling-dev/badge)](https://www.skillsdirectory.com/skills/juninmd-tooling-dev)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tooling-dev
description: |
  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'.
---


# Tooling Development

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

## Preflight
```bash
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.

| Stream | Carries | Rule |
|---|---|---|
| stdout | the result — the thing a pipe consumes | machine-readable when not a TTY |
| stderr | progress, warnings, diagnostic output | never part of the result |
| exit code | success or the class of failure | 0 only when the work actually happened |

| Code | Means |
|---|---|
| 0 | success |
| 1 | generic runtime failure |
| 2 | usage error — bad flag, missing argument |
| 3–63 | tool-specific, documented in `--help` |
| 64–78 | borrow `sysexits.h` meanings when they fit: 64 usage, 65 data error, 66 missing input, 69 unavailable, 70 internal error, 78 bad config |
| 130 | interrupted (`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](references/argument-and-exit-conventions.md).

## Adapt to the Terminal, Then Get Out of the Way

```js
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

| Event | Correct behavior |
|---|---|
| `SIGINT` / `SIGTERM` | stop, **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 TTY | never prompt; require an explicit `--yes` |
| Output file already exists | preview, back up, or demand `--force` |
| Config found in several places | documented 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](references/argument-and-exit-conventions.md) for the diagnostic technique when precedence itself is the bug.

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

See [Reference Map](references/TOPIC_MAP.md) 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.

Files in this skill

  • SKILL.md6.8 KB
  • references/TOPIC_MAP.md1 KB
  • references/argument-and-exit-conventions.md4.4 KB
  • references/packaging-and-compatibility.md5.9 KB
  • references/real-world-cases.md1.8 KB
  • references/tooling-best-practices.md1.9 KB
  • references/tooling-examples.md1.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.