Skip to content

Comments

Chroe/prompt optimize#23

Merged
mingcheng merged 12 commits intodevelopfrom
chroe/prompt-optimize
Sep 26, 2025
Merged

Chroe/prompt optimize#23
mingcheng merged 12 commits intodevelopfrom
chroe/prompt-optimize

Conversation

@mingcheng
Copy link
Owner

@mingcheng mingcheng commented Sep 26, 2025

Summary by Sourcery

Optimize the system prompt template and refresh project dependencies

Enhancements:

  • Refine and improve the system prompt in templates/system.txt

Build:

  • Update Cargo.lock to include the latest dependency versions

mingcheng and others added 11 commits September 26, 2025 14:46
- Add signoff option to CLI arguments in `cli.rs`
- Implement author name and email retrieval in `git.rs`
- Append signoff to commit message in `main.rs` if enabled
- Add tests for author name and email functions in `git.rs`

Signed-off-by: mingcheng <mingcheng@apache.org>
- Implement detection of GIT_AUTO_SIGNOFF environment variable
- Enable signoff if environment variable is set to true or 1
- Update logic to combine CLI signoff option with environment variable check

Signed-off-by: mingcheng <mingcheng@apache.org>
- Replace static string formatting with variable interpolation in log messages
- Apply consistent formatting for trace logs across `git.rs` and `openai.rs`

Signed-off-by: mingcheng <mingcheng@apache.org>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Update `AIGITCOMMIT_SIGNOFF` to `GIT_AUTO_SIGNOFF` in README for consistency
- Reflect the correct variable used in the code for auto signoff feature

Signed-off-by: mingcheng <mingcheng@apache.org>
- Replace static string formatting with variable interpolation in log messages
- Apply consistent formatting for trace logs across `git.rs` and `openai.rs`

Signed-off-by: mingcheng <mingcheng@apache.org>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Update `AIGITCOMMIT_SIGNOFF` to `GIT_AUTO_SIGNOFF` in README for consistency
- Reflect the correct variable used in the code for auto signoff feature

Signed-off-by: mingcheng <mingcheng@apache.org>
- Adjust last modified timestamps in `main.rs` and `openai.rs` for accuracy
- Resolve merge conflict timestamp in `main.rs` to reflect latest update

Signed-off-by: mingcheng <mingcheng@apache.org>
- Bump version from 1.3.2 to 1.3.3 in Cargo.toml
- Add "grok" to keywords list in package metadata
- Introduce --check flag in CLI to verify API key and model
- Implement check_model function to list and validate available models
- Integrate check logic in main.rs with error handling
- Comment out unused dependencies in Cargo.toml
- Update package categories in Cargo.toml
- Update error message formatting in main.rs to use direct variable interpolation
- Simplify debug and error messages in openai.rs with consistent string formatting
- Remove redundant string concatenation for cleaner code readability

Signed-off-by: mingcheng <mingcheng@apache.org>
- Add support for signed-off-by line in commit messages with configurable option
- Refactor commit function to accept signoff parameter in git.rs
- Retrieve author name and email from repository config for signoff
- Remove redundant signoff logic from main.rs and centralize in git.rs
- Update commit call in main.rs to pass signoff requirement

Signed-off-by: mingcheng <mingcheng@apache.org>
@coderabbitai
Copy link

coderabbitai bot commented Sep 26, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chroe/prompt-optimize

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai
Copy link

sourcery-ai bot commented Sep 26, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The pull request refactors the system prompt template for clarity and conciseness, and refreshes the Cargo.lock file to bring dependencies up to date.

File-Level Changes

Change Details Files
Optimize system prompt template
  • Rewrote prompt segments for clearer instructions
  • Removed redundant phrases to streamline content
  • Adjusted formatting for consistent style
templates/system.txt
Refresh dependency lockfile
  • Updated Cargo.lock with latest dependency versions
  • Regenerated lockfile entries to resolve version mismatches
Cargo.lock

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@mingcheng mingcheng marked this pull request as ready for review September 26, 2025 07:26
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `templates/system.txt:51` </location>
<code_context>

 - Symbolically represent commit type
-- Enhance readability
+- Only for enhance readability
 - Not mandatory

</code_context>

<issue_to_address>
**suggestion (typo):** Correct grammar: 'Only for enhance readability'.

Change to 'Only to enhance readability' for correct grammar.

```suggestion
- Only to enhance readability
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@mingcheng mingcheng requested a review from Copilot September 26, 2025 07:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the system prompt template used for generating git commit messages by refining formatting rules and improving clarity of instructions.

  • Enhanced formatting principles with more specific guidance on capitalization and line limits
  • Added clearer instructions to avoid duplicate descriptions and personal pronouns
  • Improved example formatting to match the updated guidelines

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mingcheng mingcheng force-pushed the chroe/prompt-optimize branch from 64a5020 to 88c37f6 Compare September 26, 2025 07:30
@mingcheng mingcheng requested a review from Copilot September 26, 2025 07:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- align indentation with recent project standards
- fix timestamp formatting inconsistencies
- remove redundant comments in template sections
- simplify conditional phrasing for clarity
- normalize line endings across file

Signed-off-by: mingcheng <mingcheng@apache.org>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mingcheng mingcheng force-pushed the chroe/prompt-optimize branch from 9b82769 to a71eb8d Compare September 26, 2025 07:36
@mingcheng mingcheng requested a review from Copilot September 26, 2025 07:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mingcheng mingcheng merged commit 0f66fa6 into develop Sep 26, 2025
11 of 12 checks passed
@mingcheng mingcheng deleted the chroe/prompt-optimize branch September 26, 2025 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant