generate_commit_message
Creates structured prompts to generate Conventional Commit messages from staged git changes. Analyzes diffs, validates repository status, and incorporates user-defined commit types and scopes for precise formatting.
Instructions
Prepare a structured analysis and instruction block for generating a Conventional Commit message from staged git changes only.
Behavior: - Validates the repository path and operates on the provided repo or CWD. - Collects staged diff, porcelain status, and a name-status summary. - Incorporates optional user preferences for commit_type and scope. - Returns a single formatted string that includes context plus strict output instructions for an LLM to produce a Conventional Commit.
Args: repo_path: Optional path to the target git repository. If not provided, uses the current working directory. commit_type: Optional commit type (feat, fix, docs, style, refactor, perf, build, ci, test, chore, revert) scope: Optional scope of the change
Returns: A formatted prompt containing git change context and clear output rules for generating a Conventional Commit message
Input Schema
Name | Required | Description | Default |
---|---|---|---|
commit_type | No | ||
repo_path | No | ||
scope | No |