For AI agents: the complete documentation index is available at https://mfeflow.github.io/mfeflow/llms.txt, the full documentation bundle is available at https://mfeflow.github.io/mfeflow/llms-full.txt, and this page is available as Markdown at https://mfeflow.github.io/mfeflow/features/commit-prompt.md.

commit-prompt

This page shows how to write commit messages in the Conventional Commits format by answering questions instead of remembering the rules. It suits teams where not everyone has the format memorised.

What you get

A pnpm commit command that asks for the type, scope and description, then runs the commit for you. It is off by default.

Add it

pnpm mfeflow add commit-prompt

What changed:

cz.config.js   # prompt settings, at the project root
package.json   # gains a commit script that runs czg
               # and czg 1.14.0 as a dev dependency

Use it

Stage your changes, then run the prompt instead of git commit:

git add -p
pnpm commit

It asks for the type, the scope, a short description, a longer one, and any breaking change or issue it closes. Then it commits with a message like this:

feat(cart): add the coupon field

Configure it

Everything is in cz.config.js, and the only edit most projects need is the scope list:

cz.config.js
export default {
  useEmoji: false,
  upperCaseSubject: false,
  allowCustomScopes: true,
  allowEmptyScopes: true,
  allowBreakingChanges: ['feat', 'fix'],
  maxHeaderLength: 100,
  scopes: ['deps', 'ci'],
  skipQuestions: ['footerPrefix'],
  // types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
};
SettingDefaultWhat it does
scopesdeps, ciThe list offered; add your remotes and areas
allowCustomScopestrueLets you type a scope that is not in the list
maxHeaderLength100Longest first line the prompt accepts
upperCaseSubjectfalseKeeps the subject lowercase, as commitlint expects
allowBreakingChangesfeat, fixTypes that offer a breaking-change question

How it works

The prompt tool reads cz.config.js, builds the message from your answers and passes it to git commit. The types are the eleven that commitlint's conventional config accepts.

The header limit and lowercase subject match its rules. A message from the prompt passes the check in git-hooks when that is installed.

The prompt does not install a hook of its own. Plain git commit still opens your editor as before, and a hand-written message goes through the same commitlint check.

Gotchas

  • The prompt needs a terminal. In CI or a script, use git commit -m "feat(cart): ..." directly.
  • Emoji is switched off. Set useEmoji to true if your team wants it, but check that your commitlint rules allow it.

Reference