"feat(commit_handler): Update commit handler to generate commit message based on diff changes."

This commit is contained in:
Triston Armstrong 2025-01-12 13:10:43 -05:00
parent 3bff96acab
commit 28afb4942d
Signed by: tristonarmstrong
GPG Key ID: A23B48AE45EB6EFE

View File

@ -4,7 +4,17 @@ pub struct CommitHandler {}
impl CommitHandler {
pub fn new() -> Option<(String, String)> {
let dirs = String::from("create a short commit message from this diff, with format Task(<branch_name>): <commit_message>. only respond with the commit message");
Some((dirs, GitGrabber::get_diff()))
let dirs = String::from(format!("
<Variables>
change_type: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
<Commit Instructions>
create a short commit message from this entire diff, with format <change_type>(<scope>): <commit_message>.
the commit message should vaguely describe the changes present unless a small change is made that can be
precisely described withtin a short commit message
<Response Constraints>
Only respond with the commit message.
"));
let prompt = GitGrabber::get_diff();
Some((dirs, prompt))
}
}