or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-6/

Git Commit Footer Generator

Build a utility that generates standardized Git commit footers with issue tracking references. The utility should support multiple issue tracking systems and allow customization of how issue references are formatted.

Capabilities

Issue prefix customization

  • When given prefix "closes" and issue "#123", generates "closes #123" @test
  • When given prefix "refs" and issue "JIRA-456", generates "refs JIRA-456" @test

Custom issue prefix support

  • When custom prefix "implements" is provided with issue "#789" and custom prefixes are allowed, generates "implements #789" @test

Multiple issue references

  • When given prefix "closes" and issues ["#100", "#101", "#102"], generates "closes #100, #101, #102" @test

Empty prefix handling

  • When no prefix is specified and issue "#555" is given, generates "#555" @test

Implementation

@generates

API

/**
 * Configuration for issue prefix options
 * @typedef {Object} IssuePrefixOption
 * @property {string} value - The prefix value (e.g., "closes", "refs")
 * @property {string} name - Display name for the prefix
 */

/**
 * Configuration options for the footer generator
 * @typedef {Object} FooterConfig
 * @property {IssuePrefixOption[]} issuePrefixes - List of available issue prefixes
 * @property {boolean} allowCustomIssuePrefix - Whether to allow custom prefixes
 * @property {boolean} allowEmptyIssuePrefix - Whether to allow no prefix
 */

/**
 * Generates a formatted commit footer with issue references
 * @param {string} prefix - The issue prefix to use (e.g., "closes", "refs", or empty string)
 * @param {string|string[]} issues - Single issue or array of issues (e.g., "#123" or ["#100", "#101"])
 * @param {FooterConfig} config - Configuration options
 * @returns {string} Formatted footer string
 */
function generateFooter(prefix, issues, config) {
  // IMPLEMENTATION HERE
}

/**
 * Validates if a prefix is allowed based on configuration
 * @param {string} prefix - The prefix to validate
 * @param {FooterConfig} config - Configuration options
 * @returns {boolean} Whether the prefix is valid
 */
function isValidPrefix(prefix, config) {
  // IMPLEMENTATION HERE
}

module.exports = {
  generateFooter,
  isValidPrefix,
};

Dependencies { .dependencies }

cz-git { .dependency }

Provides issue tracking integration capabilities for Git commit workflows.

@satisfied-by