evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a command-line tool that provides an interactive interface for creating standardized Git commit messages following the Conventional Commits specification.
Your tool should:
Prompt for commit type: Present the user with standard commit types (feat, fix, docs, style, refactor, test, chore) and allow them to select one interactively.
Prompt for scope: Allow the user to optionally enter a scope for the commit (e.g., "api", "ui", "core"). The scope should be optional and can be skipped.
Prompt for subject: Request a short, descriptive subject line for the commit. The subject should have a maximum length of 72 characters and display real-time character count feedback.
Prompt for body: Allow the user to optionally enter a longer commit message body with support for multiple lines. This should be skippable.
Generate formatted message: Combine all inputs into a properly formatted commit message following this structure:
<type>(<scope>): <subject>
[body]Display preview: Show the complete formatted commit message to the user before finalizing.
The tool should validate inputs and provide clear feedback during the interaction process.
Given the user selects type "feat", scope "auth", and subject "add login functionality", the tool generates a message: "feat(auth): add login functionality" @test
Given the user selects type "fix", no scope, and subject "resolve memory leak", the tool generates a message: "fix: resolve memory leak" @test
Given the user enters a subject exceeding 72 characters, the tool provides validation feedback indicating the limit @test
Given the user selects type "docs", scope "readme", subject "update installation steps", and body "Added Docker installation instructions", the tool generates a properly formatted multi-line message @test
/**
* Main function to start the interactive commit message builder
* Returns a promise that resolves to the formatted commit message
*/
export function buildCommitMessage(): Promise<string>;
/**
* Configuration options for customizing the commit message builder
*/
export interface CommitMessageConfig {
types?: Array<{ value: string; name: string }>;
maxSubjectLength?: number;
scopes?: string[];
}
/**
* Start the interactive builder with custom configuration
*/
export function buildCommitMessageWithConfig(
config: CommitMessageConfig
): Promise<string>;Provides interactive commit message generation capabilities.