ワンクリックで
add-oclif-command
Add a new OCLIF command to a CLI package with proper base class, flags, args, and post-creation steps
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Add a new OCLIF command to a CLI package with proper base class, flags, args, and post-creation steps
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Create changesets for pending changes by analyzing git diff and commit history
Audit workspace dependencies for version mismatches, unused packages, and sync issues across all packages
Fix all repository policy violations
Run Nx affected commands for the current changes
Reference for Nx task architecture, orchestration patterns, and how to add or modify build tasks
Reference for OCLIF command patterns, base classes, and conventions used in CLI packages
| name | add-oclif-command |
| description | Add a new OCLIF command to a CLI package with proper base class, flags, args, and post-creation steps |
| disable-model-invocation | true |
Guided workflow to add a command to an existing CLI package.
Ask the user for:
status or git/status (slash = topic nesting)CommandWithConfig (default) or GitCommand (for git operations) — both from @tylerbu/cli-apiCreate packages/<pkg>/src/commands/<name>.ts:
import { Args, Flags } from "@oclif/core";
import { CommandWithConfig } from "@tylerbu/cli-api";
export default class CommandName extends CommandWithConfig<typeof CommandName> {
public static override readonly description = "Description here";
public static override readonly flags = {
// Add flags here
...CommandWithConfig.flags,
};
public static override readonly args = {
// Add args here
};
public override async run(): Promise<void> {
const { args, flags } = this;
// Implementation
}
}
For git commands, use GitCommand instead — it provides this.git (simple-git instance).
# Compile
pnpm nx run <pkg>:build:compile
# Test with dev binary
./packages/<pkg>/bin/dev.js <command> --help
# Regenerate manifest
pnpm nx run <pkg>:build:manifest
# Regenerate README
pnpm nx run <pkg>:build:readme
# Regenerate command snapshots
./packages/<pkg>/bin/dev.js snapshot:generate --filepath test/commands/__snapshots__/commands.json
# Verify snapshots match
./packages/<pkg>/bin/dev.js snapshot:compare --filepath test/commands/__snapshots__/commands.json
# Full build to ensure everything links
pnpm nx run <pkg>:build
# Run tests
pnpm nx run <pkg>:test
# Policy check
./packages/repopo/bin/dev.js check
this.log() for stdout, this.warn() for warnings, this.error() for fatal errors (exits)...BaseClass.flags to inherit base flags