Agent skill · Audited from source
Adding A Command
skill · caliber-ai-org/ai-setupMIT licenceAudited 10 Oct 2026 · source b38062d63a05
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit b38062d63a05 and found no filesystem, network or shell access and no hard-coded secrets. What it does: Creates a new CLI command following the Commander.js pattern in src/commands/. Handles command registration in src/cli.ts, telemetry tracking via tracked() wrapper, and option parsing. Use when user says add command,…
Cite
Cite this page
ModelsAtlas. “Adding A Command (caliber-ai-org/ai-setup)”. Retrieved 10 Oct 2026. https://modelsatlas.com/skills/caliber-ai-org/adding-a-command
Trust audit
Audit 0.4.1 · source read 10 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha b38062d63a05 · 10 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publishercaliber-ai-org GitHub organizationOwner of the repository this skill is read from
- Source foldercaliber-ai-org/ai-setup/.agents/skills/adding-a-commandThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdictb38062d63a05A new audit runs when the source changes
- Repository statusNot archivedLast push 16 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Creates a new CLI command following the Commander.js pattern in src/commands/. Handles command registration in src/cli.ts, telemetry tracking via tracked() wrapper, and option parsing. Use when user says add command,…
---
name: adding-a-command
description: Creates a new CLI command following the Commander.js pattern in src/commands/. Handles command registration in src/cli.ts, telemetry tracking via tracked() wrapper, and option parsing. Use when user says add command, new CLI command, create subcommand, or adds files to src/commands/. Do NOT use for modifying existing commands or fixing bugs in existing commands.
---
# Adding a Command
## Critical
- **Export pattern**: Command must export a named async function: `export async function myCommand(options?: OptionType)`. Never use default exports.
- **Registration in cli.ts**: Every command must be imported and registered with `.command()` chain in `src/cli.ts`, wrapped with `tracked()` for telemetry.
- **Error signaling**: Use `throw new Error('__exit__')` to exit gracefully without printing the error message. Use chalk for user-facing messages.
- **Options typing**: Commands receiving options must define a TypeScript interface for those options. Pass options as a destructured object parameter.
## Instructions
1. **Create the command file** at `src/commands/{commandName}.ts` with named async export.
- Signature: `export async function {commandName}Command(options?: { optionName?: optionType }) { ... }`
- Import only what you need (avoid kitchen-sink imports).
- Return void (handle all output via console.log or chalk).
- Verify the file follows the naming convention: camelCase function + "Command" suffix.
2. **Handle errors consistently**: Wrap error-prone operations in try/catch. Distinguish between user errors and system errors:
- User error (bad input): `console.error(chalk.red('message')); throw new Error('__exit__');`
- System error (missing dependency): `throw new Error('Detailed error message');` — this will print and exit with code 1.
- Parse-like errors: Use ora spinner with `.fail()` before throwing.
- This step prevents double error printing in bin.ts.
3. **Import and register in src/cli.ts** in the correct location:
- Add import at the top: `import { {commandName}Command } from './commands/{commandName}.js';`
- Register the command in the appropriate section (main commands, or nested under a group like `sources`).
- For main commands: `.command('{kebab-name}').description('...').option(...).action(tracked('{kebab-name}', {commandName}Command))`
- For subcommands (like `sources add`): `sources.command('add').description(...).action(tracked('sources:add', sourcesAddCommand))`
- Key: Wrap handler with `tracked('{command-name}', handler)` for automatic telemetry.
- Verify the command name in tracked() uses kebab-case for main commands and colon-separated for subcommands.
4. **Define options (if needed)**:
- Add `.option()` chains before `.action()`: `.option('--flag', 'Description')` or `.option('--opt <value>', 'Description')`
- For parsed options (like comma-separated agents), add a parse function: `.option('--opt <value>', 'Description', parseFunction)`
- Pass options to handler: `.action(tracked('name', (opts) => command(opts)))`
- Define TypeScript interface for the options object.
- Verify option names use camelCase (Commander converts kebab-case flags to camelCase).
5. **Verify before proceeding**:
- Function exports correctly and is imported in cli.ts.
- Command is registered with tracked() wrapper.
- Output uses chalk for colors, not plain console.log.
- Error paths throw `new Error('__exit__')` for user errors.
## Examples
### Example 1: Simple command (status)
User says: "Add a command to show config status"
**Actions taken**:
1. Create src/commands/status.ts with statusCommand() export
2. Import and register in src/cli.ts with tracked() wrapper
**Result**: `caliber status` displays config status; `caliber status --json` outputs JSON.
Code example:
```typescript
import chalk from 'chalk';
import { loadConfig } from '../llm/config.js';
export async function statusCommand(options?: { json?: boolean }) {
const config = loadConfig();
if (options?.json) {
console.log(JSON.stringify({ configured: !!config }, null, 2));
return;
}
console.log(chalk.bold('Status'));
console.log(` LLM: ${chalk.green(config?.provider || 'Not configured')}`);
}
```
Registration in src/cli.ts:
```typescript
import { statusCommand } from './commands/status.js';
program
.command('status')
.description('Show config status')
.option('--json', 'Output as JSON')
.action(tracked('status', statusCommand));
```
---
### Example 2: Subcommand with arguments
User says: "Add a sources add subcommand"
**Actions taken**:
1. Create src/commands/sources.ts with sourcesAddCommand() export
2. Register under sources group with tracked('sources:add', ...)
**Result**: `caliber sources add ../lib` adds a source.
Code example:
```typescript
export async function sourcesAddCommand(sourcePath: string) {
if (!fs.existsSync(sourcePath)) {
console.log(chalk.red(`Path not found: ${sourcePath}`));
throw new Error('__exit__');
}
const existing = loadSourcesConfig(process.cwd());
existing.push({ type: 'repo', path: sourcePath });
writeSourcesConfig(process.cwd(), existing);
console.log(chalk.green(`Added ${sourcePath}`));
}
```
Registration:
```typescript
const sources = program.command('sources');
sources
.command('add')
.argument('<path>', 'Path to add')
.action(tracked('sources:add', sourcesAddCommand));
```
---
### Example 3: Command with option parsing
User says: "Add init with --agent flag supporting comma-separated values"
**Actions taken**:
1. Create parseAgentOption() parser in src/cli.ts
2. Create src/commands/init.ts with initCommand(options)
3. Register with custom parser
**Result**: `caliber init --agent claude,cursor` passes parsed array to handler.
Parser code:
```typescript
function parseAgentOption(value: string) {
const agents = value.split(',').map(s => s.trim().toLowerCase());
if (agents.length === 0) {
console.erExcerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit b38062d
git clone https://github.com/caliber-ai-org/ai-setup git -C ai-setup checkout b38062d63a05
The author documents no install command, so this uses the repository directly. Our verdict covers commit b38062d63a05 only.
Works in which agents?
What its own text says, not a test
| Agent | Status | More |
|---|---|---|
| Cursor | Mentioned in its text, not tested | Skills for Cursor · About Cursor |
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
b38062d63a05
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/caliber-ai-org/adding-a-command/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
caliber-ai-org/ai-setup
Writes Vitest tests following project patterns: __tests__/ directories, vi.mock() for module mocking with vi.hoisted() for test-time factories, global LLM mock from src/test/setup.ts, environment variable save/restore…
caliber-ai-org/ai-setup
Discovers and installs community skills from the public registry. Use when the user mentions a technology, framework, or task that could benefit from specialized skills not yet installed, asks 'how do I do X', 'find a…
caliber-ai-org/ai-setup
Adds a new LLM provider implementing LLMProvider interface with call() and stream() methods. Integrates with provider factory in src/llm/index.ts, config detection in src/llm/config.ts, and error handling via tracking…
caliber-ai-org/ai-setup
Saves user instructions as persistent learnings for future sessions. Use when the user says 'remember this', 'always do X', 'from now on', 'never do Y', or gives any instruction they want persisted across sessions.…
caliber-ai-org/ai-setup
Add a new deterministic scoring check in src/scoring/checks/ that evaluates config quality. Follows the Check[] return pattern, uses point constants from src/scoring/constants.ts, and integrates via…
caliber-ai-org/ai-setup
Sets up Caliber for automatic AI agent context sync. Installs pre-commit hooks so CLAUDE.md, Cursor rules, and Copilot instructions update automatically on every commit. Use when Caliber hooks are not yet installed or…
Add this badge to your README
[](https://modelsatlas.com/skills/caliber-ai-org/adding-a-command/)
<a href="https://modelsatlas.com/skills/caliber-ai-org/adding-a-command/"><img src="https://modelsatlas.com/skills/caliber-ai-org/adding-a-command/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Adding A Command
What does the Adding A Command skill do?
Is Adding A Command safe to install?
What can Adding A Command access on my machine?
Which assistants does Adding A Command work with?
How current is this page?
Sources
- github.com/caliber-ai-org/ai-setup/tree/master/.agents/skills/ad — the audited source at commit b38062d63a05 and every finding aboveObserved · 10 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Adding A Command skill do?
- Is Adding A Command safe to install?
- What can Adding A Command access on my machine?