Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate interactive command-line prompts using Inquirer.js with validation, conditional logic, and custom renderers. Creates user-friendly input collection flows for CLI applications.
.claude/skills/a5c-ai-inquirer-prompt-generator/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 69% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 106% | 0% |
Generate interactive CLI prompts using Inquirer.js with comprehensive validation, conditional flows, and custom formatting.
Invoke this skill when you need to:
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | flowName | string | Yes | Name of the prompt flow | | prompts | array | Yes | List of prompt definitions | | typescript | boolean | No | Generate TypeScript types (default: true) | | validation | boolean | No | Include validation helpers (default: true) |
json{ "prompts": [ { "type": "input", "name": "projectName", "message": "What is your project name?", "default": "my-project", "validate": { "required": true, "pattern": "^[a-z][a-z0-9-]*$", "message": "Project name must be lowercase with hyphens" } }, { "type": "list", "name": "template", "message": "Select a template:", "choices": [ { "name": "React + TypeScript", "value": "react-ts" }, { "name": "Vue + TypeScript", "value": "vue-ts" }, { "name": "Node.js + Express", "value": "node-express" } ] }, { "type": "checkbox", "name": "features", "message": "Select features to include:", "choices": ["ESLint", "Prettier", "Husky", "Jest", "Docker"], "when": "answers.template !== 'node-express'" }, { "type": "confirm", "name": "installDeps", "message": "Install dependencies now?", "default": true } ] }
prompts/
├── <flowName>/
│ ├── index.ts # Main prompt flow
│ ├── types.ts # TypeScript interfaces
│ ├── validators.ts # Validation functions
│ ├── formatters.ts # Custom formatters
│ └── README.md # Usage documentationtypescriptimport { input, select, checkbox, confirm } from '@inquirer/prompts'; import { validateProjectName, validatePort } from './validators'; import type { ProjectConfig } from './types'; export async function createProjectPrompt(): Promise<ProjectConfig> { // Project name const projectName = await input({ message: 'What is your project name?', default: 'my-project', validate: validateProjectName, }); // Template selection const template = await select({ message: 'Select a template:', choices: [ { name: 'React + TypeScript', value: 'react-ts' }, { name: 'Vue + TypeScript', value: 'vue-ts' }, { name: 'Node.js + Express', value: 'node-express' }, ], }); // Conditional features (not shown for node-express) let features: string[] = []; if (template !== 'node-express') { features = await checkbox({ message: 'Select features to include:', choices: [ { name: 'ESLint', value: 'eslint', checked: true }, { name: 'Prettier', value: 'prettier', checked: true }, { name: 'Husky', value: 'husky' }, { name: 'Jest', value: 'jest' }, { name: 'Docker', value: 'docker' }, ], }); } // Confirmation const installDeps = await confirm({ message: 'Install dependencies now?', default: true, }); return { projectName, template, features, installDeps, }; }
typescript/** * Configuration collected from create-project prompts */ export interface ProjectConfig { /** Project name (lowercase, hyphens allowed) */ projectName: string; /** Selected project template */ template: 'react-ts' | 'vue-ts' | 'node-express'; /** Selected optional features */ features: Array<'eslint' | 'prettier' | 'husky' | 'jest' | 'docker'>; /** Whether to install dependencies */ installDeps: boolean; } /** * Template metadata for display */ export interface TemplateChoice { name: string; value: ProjectConfig['template']; description?: string; }
typescript/** * Validate project name format * - Must start with lowercase letter * - Only lowercase letters, numbers, and hyphens * - Max 50 characters */ export function validateProjectName(value: string): string | true { if (!value.trim()) { return 'Project name is required'; } if (!/^[a-z][a-z0-9-]*$/.test(value)) { return 'Project name must start with a letter and contain only lowercase letters, numbers, and hyphens'; } if (value.length > 50) { return 'Project name must be 50 characters or less'; } return true; } /** * Validate port number */ export function validatePort(value: string): string | true { const port = parseInt(value, 10); if (isNaN(port)) { return 'Port must be a number'; } if (port < 1024 || port > 65535) { return 'Port must be between 1024 and 65535'; } return true; } /** * Validate URL format */ export function validateUrl(value: string): string | true { try { new URL(value); return true; } catch { return 'Please enter a valid URL'; } } /** * Create async validator that checks for conflicts */ export function createConflictValidator( checkFn: (value: string) => Promise<boolean> ): (value: string) => Promise<string | true> { return async (value: string) => { const exists = await checkFn(value); if (exists) { return `"${value}" already exists`; } return true; }; }
typescriptimport chalk from 'chalk'; /** * Format project name for display */ export function formatProjectName(value: string): string { return chalk.cyan(value); } /** * Format feature list for summary */ export function formatFeatures(features: string[]): string { if (features.length === 0) { return chalk.dim('None selected'); } return features.map(f => chalk.green(`+ ${f}`)).join('\n'); } /** * Format configuration summary */ export function formatSummary(config: ProjectConfig): string { return ` ${chalk.bold('Project Configuration:')} ${chalk.dim('Name:')} ${formatProjectName(config.projectName)} ${chalk.dim('Template:')} ${config.template} ${chalk.dim('Features:')} ${formatFeatures(config.features).split('\n').map(l => ' ' + l).join('\n')} ${chalk.dim('Install:')} ${config.installDeps ? chalk.green('Yes') : chalk.yellow('No')} `; }
| Type | Description | Use Case | |------|-------------|----------| | input | Single-line text | Names, values | | password | Hidden input | Secrets, tokens | | number | Numeric input | Ports, counts | | confirm | Yes/No | Confirmations | | select | Single choice list | Options | | checkbox | Multiple choice | Features | | expand | Abbreviated choices | Quick actions | | editor | Multi-line editor | Long text | | search | Searchable list | Large lists | | rawlist | Numbered list | Indexed options |
typescriptvalidate: (value) => value.trim() ? true : 'This field is required'
typescriptvalidate: (value) => /^[a-z-]+$/.test(value) || 'Invalid format'
typescriptvalidate: async (value) => { const exists = await checkExists(value); return exists ? 'Already exists' : true; }
typescriptvalidate: (value, answers) => { if (answers.type === 'advanced' && !value) { return 'Required for advanced mode'; } return true; }
typescript{ type: 'input', name: 'apiKey', message: 'Enter API key:', when: (answers) => answers.useExternalApi }
typescriptconst prompts = basePrompts.filter(p => { if (p.name === 'advanced' && !options.showAdvanced) { return false; } return true; });
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 21,466 | 19,156 | -11% | 1 | 1 | 0% | 4,953 | 6,189 | +25% | 0 | 0 | — |
case-02 | fail→pass | 19,298 | 14,032 | -27% | 1 | 1 | 0% | 4,473 | 5,812 | +30% | 0 | 0 | — |
case-03 | pass→pass | 11,312 | 19,531 | +73% | 1 | 1 | 0% | 2,350 | 6,701 | +185% | 0 | 0 | — |
case-04 | pass→pass | 8,863 | 9,193 | +4% | 1 | 1 | 0% | 1,719 | 4,316 | +151% | 0 | 0 | — |
case-05 | pass→pass | 11,201 | 11,507 | +3% | 1 | 1 | 0% | 2,261 | 4,982 | +120% | 0 | 0 | — |
case-06 | pass→pass | 7,368 | 7,762 | +5% | 1 | 1 | 0% | 1,438 | 4,085 | +184% | 0 | 0 | — |
case-07 | pass→pass | 9,623 | 6,231 | -35% | 1 | 1 | 0% | 1,891 | 3,745 | +98% | 0 | 0 | — |
case-08 | fail→pass | 20,395 | 14,794 | -27% | 1 | 1 | 0% | 4,254 | 5,560 | +31% | 0 | 0 | — |
case-09 | pass→pass | 8,492 | 7,012 | -17% | 1 | 1 | 0% | 1,674 | 3,945 | +136% | 0 | 0 | — |
case-10 | fail→pass | 10,239 | 4,970 | -51% | 1 | 1 | 0% | 2,032 | 3,442 | +69% | 0 | 0 | — |
case-11 | fail→pass | 7,967 | 5,167 | -35% | 1 | 1 | 0% | 1,711 | 3,531 | +106% | 0 | 0 | — |
case-12 | pass→pass | 6,157 | 4,881 | -21% | 1 | 1 | 0% | 1,269 | 3,577 | +182% | 0 | 0 | — |
case-13 | pass→pass | 8,904 | 5,457 | -39% | 1 | 1 | 0% | 1,593 | 3,520 | +121% | 0 | 0 | — |
case-14 | pass→pass | 8,070 | 5,548 | -31% | 1 | 1 | 0% | 1,739 | 3,567 | +105% | 0 | 0 | — |
case-15 | pass→pass | 10,863 | 8,549 | -21% | 1 | 1 | 0% | 2,162 | 4,340 | +101% | 0 | 0 | — |
case-16 | pass→pass | 10,997 | 7,425 | -32% | 1 | 1 | 0% | 2,373 | 3,932 | +66% | 0 | 0 | — |
case-17 | fail→pass | 11,370 | 10,552 | -7% | 1 | 1 | 0% | 2,253 | 4,796 | +113% | 0 | 0 | — |
case-18 | fail→pass | 12,852 | 7,660 | -40% | 1 | 1 | 0% | 2,383 | 3,852 | +62% | 0 | 0 | — |
case-19 | pass→pass | 10,902 | 9,655 | -11% | 1 | 1 | 0% | 2,053 | 4,266 | +108% | 0 | 0 | — |
case-20 | pass→pass | 6,258 | 4,158 | -34% | 1 | 1 | 0% | 1,175 | 3,285 | +180% | 0 | 0 | — |
case-21 | pass→pass | 8,580 | 9,003 | +5% | 1 | 1 | 0% | 1,951 | 4,390 | +125% | 0 | 0 | — |
case-22 | pass→pass | 11,044 | 15,849 | +44% | 1 | 1 | 0% | 2,191 | 5,238 | +139% | 0 | 0 | — |
case-23 | pass→pass | 12,629 | 10,967 | -13% | 1 | 1 | 0% | 2,673 | 4,942 | +85% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +30 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.