From 042abea725c26bd606a409afb893f99f8c18e750 Mon Sep 17 00:00:00 2001 From: pedrokpp Date: Fri, 17 Apr 2026 10:16:28 -0300 Subject: [PATCH 1/2] feat(git): enforce Conventional Commits in commit message prompt Replaces the loose subject rule with explicit Conventional Commits format (type(scope): description), consistent with the existing gitflow branch naming enforced by sanitizeFeatureBranchName. --- apps/server/src/textGeneration/TextGenerationPrompts.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/server/src/textGeneration/TextGenerationPrompts.ts b/apps/server/src/textGeneration/TextGenerationPrompts.ts index 6015e83b5d4..febfc1f85ab 100644 --- a/apps/server/src/textGeneration/TextGenerationPrompts.ts +++ b/apps/server/src/textGeneration/TextGenerationPrompts.ts @@ -38,7 +38,9 @@ export function buildCommitMessagePrompt(input: CommitMessagePromptInput) { ? "Return a JSON object with keys: subject, body, branch." : "Return a JSON object with keys: subject, body.", "Rules:", - "- subject must be imperative, <= 72 chars, and no trailing period", + "- subject must follow Conventional Commits format: type(scope): description", + "- type must be one of: feat, fix, docs, style, refactor, test, chore", + "- scope is optional; description is imperative, <= 72 chars total, no trailing period", "- body can be empty string or short bullet points", ...(wantsBranch ? ["- branch must be a short semantic git branch fragment for this change"] From 1dc45bede96caf6e95118b7a4406187ba978766b Mon Sep 17 00:00:00 2001 From: pedrokpp Date: Fri, 17 Apr 2026 10:33:30 -0300 Subject: [PATCH 2/2] fix(git): clarify 72-char limit applies to full subject line --- apps/server/src/textGeneration/TextGenerationPrompts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/server/src/textGeneration/TextGenerationPrompts.ts b/apps/server/src/textGeneration/TextGenerationPrompts.ts index febfc1f85ab..17277c04894 100644 --- a/apps/server/src/textGeneration/TextGenerationPrompts.ts +++ b/apps/server/src/textGeneration/TextGenerationPrompts.ts @@ -40,7 +40,8 @@ export function buildCommitMessagePrompt(input: CommitMessagePromptInput) { "Rules:", "- subject must follow Conventional Commits format: type(scope): description", "- type must be one of: feat, fix, docs, style, refactor, test, chore", - "- scope is optional; description is imperative, <= 72 chars total, no trailing period", + "- scope is optional; description is imperative, no trailing period", + "- full subject line must be <= 72 chars", "- body can be empty string or short bullet points", ...(wantsBranch ? ["- branch must be a short semantic git branch fragment for this change"]