Prompt templates

Tailor your commit messages to perfectly match your team's style through our customizable prompt templates.

System prompt

The system prompt acts as a concise directive to the AI, establishing its role as a focused commit message generator.

system: |
  You are a commit message assistant.
  Generate only the commit message with no additional text or explanations.

Context prompt

The context prompt provides the AI with the necessary information to generate a commit message. You can use template variables to insert information into the commit message. It should provide the AI with the necessary information on how to format the commit message.

context: |
  Files changed:
  {status_short}

  Detailed changes:
  {diff_staged}

  Requirements for the commit message:
    - Commit message MUST be a single line
    - Commit message MUST be under 72 characters
    - Commit message MUST be in present tense
    - Commit message MUST NOT have a trailing period
    - Commit message MUST complete: "If applied, this commit will ..."
    - Commit message MUST be prefixed with a TYPE and REQUIRE terminal colon and space.

  Possible types:
    - feat (new feature for the user, not a new feature for build script)
    - fix (bug fix for the user, not a fix to a build script)
    - docs (changes to the documentation)
    - style (formatting, missing semi colons, etc; no production code change)
    - refactor (refactoring production code, eg. renaming a variable)
    - test (adding missing tests, refactoring tests; no production code change)
    - chore (updating grunt tasks etc; no production code change)

  Here are some examples of correct commit messages:
    - feat: add Polish language
    - feat: allow provided config object to extend other configs
    - feat: send an email to the customer when a product is shipped
    - docs: correct spelling of CHANGELOG
    - chore: drop support for Node 6

Template variables

These are the template variables that you can use in the context prompt. For example, if you include the issue number in the branch name, you can use the branch_name variable to insert the issue number into the commit message.

  • Name
    branch_name
    Description

    The name of the branch that is being committed.

  • Name
    status_short
    Description

    The short status of the commit.

  • Name
    diffs
    Description

    The diffs of the commit.

Was this page helpful?