or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-1/

Commit Message Validator

A tool that validates git commit messages against the Conventional Commits specification.

Capabilities

Validates basic commit format

  • Accepts valid commit with type and subject: "feat: add new feature" @test
  • Accepts valid commit with scope: "fix(auth): resolve login issue" @test
  • Rejects commit without type: "add new feature" @test
  • Rejects commit with invalid type: "feature: add new feature" @test

Handles breaking changes

  • Accepts breaking change with !: "feat!: remove old API" @test
  • Accepts breaking change with scope: "fix(api)!: change response format" @test

Implementation

@generates

The validator should be exposed as a function that takes a commit message string and returns a validation result object with valid boolean and optional errors array.

API

/**
 * Validates a commit message against Conventional Commits specification.
 *
 * @param {string} message - The commit message to validate.
 * @returns {{valid: boolean, errors?: string[]}} Validation result with valid flag and optional error messages.
 */
function validateCommitMessage(message) {
  // IMPLEMENTATION HERE
}

module.exports = {
  validateCommitMessage,
};

Dependencies { .dependencies }

czg { .dependency }

Provides interactive commit message generation and Conventional Commits validation utilities.