---
name: New Command
slug: new-command
category: Automation
description: New Command scaffolds a new Cortex TMS CLI command following the existing command, type, and test patterns. Use it when adding a command and its tests, docs, and CLI registration.
github: "https://github.com/cortex-tms/cortex-tms/tree/main/.claude/skills/new-command"
language: MDX
stars: 181
forks: 7
install: "npx degit https://github.com/cortex-tms/cortex-tms/tree/main/.claude/skills/new-command ~/.claude/skills/new-command"
installs_to: ~/.claude/skills/new-command
source_path: .claude/skills/new-command/SKILL.md
collection_size: 6
category_size: 2109
collection_url: "https://dirskills.com/collections/cortex-tms/cortex-tms"
added: 2026-09-07T05:20:17.587Z
last_synced: 2026-09-07T05:20:17.587Z
canonical_url: "https://dirskills.com/skills/new-command"
---

# New Command

New Command scaffolds a new Cortex TMS CLI command following the existing command, type, and test patterns. Use it when adding a command and its tests, docs, and CLI registration.

**Install:**

```bash
npx degit https://github.com/cortex-tms/cortex-tms/tree/main/.claude/skills/new-command ~/.claude/skills/new-command
```

## README

# New Command

Scaffold a new CLI command for Cortex TMS.

## Before Writing Code

1. **Read existing patterns** — look at src/commands/archive.ts and src/commands/status.ts as reference implementations
2. **Read types** — check src/types/cli.ts for existing interfaces
3. **Read tests** — check src/__tests__/archive.test.ts for the test pattern
4. **Propose the command** — describe what it does, its subcommands/options, and which files will be created/modified. Follow Propose/Justify/Recommend. Wait for approval.

## Implementation Checklist

After the user approves the plan:

- [ ] Create `src/commands/<name>.ts` — export `createXCommand()` and `xCommand`
- [ ] Add types to `src/types/cli.ts` if needed
- [ ] Register in `src/cli.ts` — import and `program.addCommand()`
- [ ] Create `src/__tests__/<name>.test.ts` — follow existing test patterns
- [ ] Add section to `README.md` under CLI Commands
- [ ] Update `NEXT-TASKS.md` — check off the task

## Rules

- Match the exact patterns in existing commands (Commander.js, chalk, ora)
- Follow existing test patterns (vitest, createTempDir, runCommand)
- If the user asks a question, STOP and answer before continuing
- Show git diff before committing. Wait for approval.

## Arguments

$ARGUMENTS — the name and purpose of the new command
