add-command
/add-command
Add a subcommand to this Java CLI with its picocli class, errors, output and tests. Use when the user asks for a new command, subcommand, option or argument that does work.
- Author
- steamfield ↗
- Repository
- stacks ↗
- Licence
- Apache-2.0
- Last repository change
- 08.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 08.11.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
Add a subcommand to this Java CLI with its picocli class, errors, output and tests. Use when the user asks for a new command, subcommand, option or argument that does work.
Original author description
Add a subcommand to this Java CLI with its picocli class, errors, output and tests. Use when the user asks for a new command, subcommand, option or argument that does work.
How it works
SKILL.md has no level-two headings · 12 lines, 294 words
SKILL.md preview
--- name: add-command description: Add a subcommand to this Java CLI with its picocli class, errors, output and tests. Use when the user asks for a new command, subcommand, option or argument that does work. --- # Add a command `config show` is the worked example: `app.cli.ConfigCommand` (a group), `app.cli.ConfigShowCommand` (an `Action`), its cases in `AppTest` and `JarIT`. Follow the same path. 1. **Parse.** Create `src/main/java/app/cli/<Name>Command.java` annotated `@Command(name = "...", description = "...")` and add it to the parent's `subcommands` (`RootCommand`, or a group such as `ConfigCommand`). Options are `@Option` fields and arguments `@Parameters` fields; give each a `description`, initialize what has a default, and mark a field that can stay unset `@Nullable`. A flag every command needs goes on `RootCommand` with `scope = ScopeType.INHERIT` and into `Flags`. A group that only holds subcommands doesn't implement `Action`; running it bare is a usage error. 2. **Handle.** Implement `Action.run(Config config, Output output)`. Write the result once with `output.result(value, human)`: `value` is a record or map scripts rely on under `--json`, `human` the text a person reads. Log through SLF4J (`LOG.atDebug().addKeyValue(...)`), never `System.out`. `App` already loads config and starts logging before it calls `run`. 3. **Fail.** Throw `CliException` with an `ErrorCode`. A failure the table lacks is a new `ErrorCode` constant (exit status: 2 for a mistake in the invocation, 3 for configuration, 1 otherwise; a suggestion ending in a period), a case in `ErrorCodeTest` and a row in `docs/ARCHITECTURE.md`'s exit-status table. Never rename a code. 4. **Settings.** A new setting is a component of `Config` with its default in `DEFAULTS`, a rule in `validate` if it can be wrong, a `Layer` component and its environment line in `ConfigLoader`, a precedence case in `ConfigLoaderTest` and a row in `docs/configuration.md`. 5. **Test.** In `AppTest`, a success case in text and `--json`, and one case per failure, each asserting the exit status and both streams. In `JarIT`, one case per new exit path through the packaged jar. 6. Run `make fmt compile coverage test-integration`.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · steamfield/stacks | 96 | Apache-2.0 |
| todoist/todoist-cli | 100 | MIT |
| proteanhq/protean | 100 | Apache-2.0 |
| doist/todoist-cli | 100 | MIT |
| coralogix/cx-cli | 100 | Apache-2.0 |
| GO-VIRTUAL-bv/tile38.go | 100 | MPL-2.0 |
| steamfield/stacks | 96 | Apache-2.0 |
| ldayton/dippy | 95 | MIT |
| steamfield/stacks | 86 | Apache-2.0 |
Database snapshot: 13.11.2026 · package version a7f2a3fbf1f8 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100add-cli-command
Use when a ticket adds or changes a command-line interface — a new subcommand, flag, or output format for the repo's CLI tool — and it must follow the CLI's existing conventions for arguments, exit codes, JSON output, help text, and tests. Invoke for "add a `foo bar` command",… - 100n8nac-reference
Authoritative reference for every `n8nac` CLI command, subcommand, and flag (n8nac 2.7.0). Use this BEFORE running `--help` interactively, BEFORE guessing flags, and BEFORE inventing a subcommand. If a command does not appear in this file, it does not exist — research stops, do… - 100add-cli-option
Add a new Remotion CLI or config option by creating an AnyRemotionOption, registering CLI parsing, wiring config setters, and updating documentation. Use when adding or converting command-line flags or Remotion options. - 96add-export
Add a function, class, type or option to this TypeScript library's public API end to end, with its error codes, tests, README entry and consumer check. Use when asked for a new export, a new option or a change to an exported signature. - 95build-feature
Builds a new command, flag or behaviour in thin test-first slices, after settling the open decisions with the owner. Use when asked to "add", "build", "implement", "support" or "create" something, such as a new command, subcommand or flag. - 100agent-cli
This skill should be used when building, creating, or modifying any CLI tool or command-line application in any language or framework. The convention is language-agnostic. Reference implementations for Go (Cobra), Python (Click), Rust (Clap), Node (Commander) included but the…