agent-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 pattern applies to any CLI framework (argparse, Thor, Picocli, Commander, etc.). Provides the --agent-help convention: structured, token-minimal help output that LLM agents can parse efficiently. Use when adding help text, designing CLI command structure, creating a new command-line tool, adding subcommands, implementing --help, or making CLI tools usable by AI agents.
What this skill does
# --agent-help Convention
When building or modifying a CLI tool, always implement the `--agent-help` flag following this convention. This is not optional guidance -- it is the standard for making CLIs usable by LLM agents.
## When to Use
- Building a new CLI tool in any language
- Adding or modifying help output for an existing CLI
- Designing command structure for a CLI application
- Adding subcommands, flags, or arguments to a CLI
## When NOT to Use
- GUI applications or web APIs with no CLI component
- Simple one-shot scripts with no flags or subcommands
## Why
`--help` is designed for humans: prose descriptions, grouped sections, multiple examples, flag aliases. Agents waste tokens parsing it and still get invocations wrong. `--agent-help` returns the minimum an agent needs to construct a correct call.
## The Flag
Every CLI implementing this convention adds a single global flag: `--agent-help`
When called with no subcommand, returns tier 1 (index). When called with a command path, returns tier 2 (command detail).
## Tier 1: Index
`tool --agent-help` returns a complete command index. Target: <300 tokens.
Format:
```
tool: one-line purpose
commands:
cmd1 <required> [optional] one-line
cmd2 <required> one-line
group cmd3 --flag TYPE one-line
```
Rules:
- One line per command, including inline required args
- Subcommands shown as `group cmd` not nested
- No flag details (tier 2)
- No aliases, no version, no author
- Sort by likely usage frequency if possible
Example:
```
ctx: persistent memory for LLM agents
commands:
add --type TYPE --tag K:V... <text> store a node
query <search> [--type TYPE] [--limit N] search nodes
show <id> display one node
rm <id> delete a node
hook session-start [--project NAME] session init
hook session-end session teardown
init create database
version print version
```
## Tier 2: Command Detail
`tool --agent-help <command>` returns everything needed to invoke that one command. Target: <150 tokens.
Format:
```
tool command <required-arg> [optional-arg] [flags]
flags:
--name TYPE purpose [default: X]
--name TYPE purpose [required]
--name TYPE purpose [conflicts: --other]
--name TYPE purpose [requires: --dep]
example:
tool command --name value arg
```
Rules:
- TYPE is one of: `string`, `int`, `bool`, `path`, `enum(a|b|c)`
- Defaults only when non-obvious (omit `[default: ""]`, `[default: false]`)
- One example showing the common invocation
- Constraints inline: `[required]`, `[conflicts: --X]`, `[requires: --X]`
- No long descriptions, no flag aliases (-v/--verbose), no environment variable docs
- Positional args in signature with `<required>` and `[optional]`
Example:
```
ctx add <text> [flags]
flags:
--type enum(decision|fact|pattern|observation) node type [required]
--tag string key:value tag, repeatable
--ttl string auto-expire duration (e.g. 24h, 7d)
--agent string agent identity
example:
ctx add --type fact --tag project:myapp --tag tier:pinned "the database uses postgres 15"
```
## Tier 3: Error Hints
When a command fails, the error message should include enough for an agent to self-correct without another help call.
Format:
```
error: what went wrong
hint: correct usage or value constraint
```
Rules:
- `error:` states what was wrong with the input
- `hint:` shows the fix or valid values, NOT "run --help"
- For enum violations, list valid values
- For missing flags, show the flag with its type
Examples:
```
error: --type is required
hint: --type enum(decision|fact|pattern|observation)
```
```
error: unknown command "ad"
hint: did you mean "add"? commands: add, query, show, rm, hook, init, version
```
## Bootstrap: The --help Breadcrumb
Agents that don't know about `--agent-help` will call `--help` first. Add one line at the bottom of your `--help` output so they discover it:
```
LLM agent? Use --agent-help for token-optimized usage.
```
This is the bridge. An agent sees it, switches to `--agent-help`, and gets the compact format from then on.
## Implementation Guidance
Adapt the examples below to the user's target language and framework. The convention is language-agnostic -- if the user's framework isn't listed below, apply the same pattern: intercept a global `--agent-help` flag before dispatch, emit the compact format from the tier spec above.
$ARGUMENTS
### Go (Cobra)
Add a persistent flag on root and a `PersistentPreRun` that intercepts it:
```go
var agentHelp bool
func init() {
rootCmd.PersistentFlags().BoolVar(&agentHelp, "agent-help", false, "Token-optimized help for LLM agents")
}
func agentHelpPreRun(cmd *cobra.Command, args []string) {
if !agentHelp {
return
}
if cmd == rootCmd {
printAgentIndex()
} else {
printAgentCommand(cmd)
}
os.Exit(0)
}
```
For `printAgentCommand`, walk `cmd.Flags()` and emit the compact format. Don't reuse cobra's built-in help templates.
### Python (Click)
```python
@click.group()
@click.option('--agent-help', is_flag=True, hidden=True, help='Token-optimized help for LLM agents')
@click.pass_context
def cli(ctx, agent_help):
if agent_help:
if ctx.invoked_subcommand:
print_agent_command(ctx.invoked_subcommand)
else:
print_agent_index()
ctx.exit()
```
### Rust (Clap)
```rust
#[derive(Parser)]
struct Cli {
#[arg(long, global = true, hide = true)]
agent_help: bool,
}
```
Intercept in main before dispatch. Walk `Command::get_subcommands()` and `get_arguments()` for the compact format.
### Node (Commander)
```js
program.option('--agent-help', 'Token-optimized help for LLM agents');
program.hook('preAction', (thisCommand) => {
if (program.opts().agentHelp) {
printAgentHelp(thisCommand);
process.exit(0);
}
});
```
### Adding the --help Breadcrumb
Append to your help template/epilog:
- **Cobra**: `rootCmd.SetHelpTemplate(cobra.CommandHelpTemplate + "\nLLM agent? Use --agent-help for token-optimized usage.\n")`
- **Click**: `@click.group(epilog="LLM agent? Use --agent-help for token-optimized usage.")`
- **Clap**: `#[command(after_help = "LLM agent? Use --agent-help for token-optimized usage.")]`
## Token Budget Reference
| Tier | Scope | Target | Max |
|------|-------|--------|-----|
| 1 | Whole CLI | <300 | 500 |
| 2 | One command | <150 | 250 |
| 3 | Error hint | <50 | 80 |
Worst case (unknown CLI, need one command): tier 1 + tier 2 = 2 calls, ~450 tokens.
Best case (know the command): tier 2 = 1 call, ~150 tokens.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.