feat(server): infer commit and PR title style from repo history#1112
feat(server): infer commit and PR title style from repo history#1112binbandit wants to merge 11 commits intopingdotgg:mainfrom
Conversation
- add recent commit subject and PR title discovery for repo style guidance - default generated commit and PR titles to conventional commits when history is unavailable - cover the new prompt guidance and git/github lookups with tests
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
UtkarshUsername
left a comment
There was a problem hiding this comment.
I think it should be fork-aware, and check the titles of PRs made to the original repo
I agree, but there is a different PR for that. Ill do it as part of that |
|
on this, it might be worth checking if the user has already had other prs / commtits and hand the agent that to write on the same style? as an example i often like to write my prs without the cringy summary ask template and just say what i changed and stuff. would love to know what other people think |
@maria-rcks |
|
Would love to see this feature go in. It's really relevant specially if the repos have commit styling validations |
|
This is something I am very interested in, I am unfamiliar with the codebase so I might have just missed it, but I would love to be able to customize this prompt, some of my projects use commmitlint and some use conform for my PR titles, so being able to point it at a file to reference the valid scopes would be a huge help. |
…r-style-guidance # Conflicts: # apps/server/src/git/Layers/CodexTextGeneration.test.ts # apps/server/src/git/Layers/CodexTextGeneration.ts # apps/server/src/git/Layers/GitCore.test.ts # apps/server/src/git/Layers/GitCore.ts # apps/server/src/git/Layers/GitManager.test.ts # apps/server/src/git/Services/GitCore.ts # apps/server/src/serverLayers.ts
ApprovabilityVerdict: Needs human review This PR introduces a new feature that changes how AI generates commit messages and PR content by inferring style from repository history. It adds new git operations, a new StyleGuidance module, and propagates style guidance through multiple service layers. As a new capability affecting core product behavior, it warrants human review. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 34f62eb. Configure here.
# Conflicts: # apps/server/src/git/Layers/GitCore.ts # apps/server/src/git/Layers/GitHubCli.ts

Summary
Testing
Note
Infer commit and PR title style from repo history when generating AI content
StyleGuidancemodule (StyleGuidance.ts) that builds style guidance strings from recent commit subjects and PR title/body examples, preferring author-scoped history over repo-wide history.GitCore.readRecentCommitSubjectsto fetch recent commit subjects viagit log, optionally filtered by author or scoped to all refs (GitCore.ts).GitHubCli.listRecentPullRequestExamplesto fetch recent PR titles and bodies viagh pr list, optionally filtered by author (GitHubCli.ts).GitManagernow assembles style guidance before each commit or PR generation call and passes it through to the text generation layer (GitManager.ts).Macroscope summarized 08f7edd.
Note
Medium Risk
Moderate risk because it changes how commit messages/PR bodies are generated (new prompt inputs and conditional templates) and adds new git/gh CLI calls with timeouts/fallback paths that may behave differently across repos/remotes.
Overview
Adds style discovery for AI-generated commit messages and PR content by sampling recent commit subjects from
git logand recent PR title/body examples viagh pr list, preferring author-scoped history with repo-wide fallback.Threads this guidance through
GitManagerinto theTextGenerationcontract and bothCodexTextGeneration/ClaudeTextGeneration, and updates prompt builders to embed guidance plus optionally disable the default## Summary/## TestingPR template when real PR examples exist. Includes newStyleGuidancebuilder utilities and expanded tests covering history resolution, author filtering, prompt contents, and the new GitHub CLI query.Reviewed by Cursor Bugbot for commit 08f7edd. Bugbot is set up for automated code reviews on this repo. Configure here.