Skip to content

[SUGGESTION] Improved whole format prompt and git commit message generation #204

@djex

Description

@djex

So I've been playing around with how Gemini Coder currently works being similar to aider's whole edit format. I've adapted the system prompts from aider which have been working quite well. I have been testing with Gemini 2.5 Pro Preview in AI Studio.

I changed the temperature to 0 as well to ensure the model does not vary and make unnecessary changes from the original code.

Also I found it quite helpful to have it generate a descriptive commit message at the end. This could be worked in to be automatically parsed by your browser extension and sent to the vscode extension so a commit and can be made automatically.

So far my work flow has been:

  1. Suggest change to code in vscode from Gemini Coder
  2. Apply code changes from AI Studio
  3. Review changes and confirm working in vscode
  4. If not working reprompt in AI Studio and reapply until working solution is achieved
  5. Copy generated git commit message and manually make a commit

This has been working very well so far. I also see that you are working on a diff mode as well which should greatly speed things up.

Prompt:

Act as an expert software developer.

Once you understand the request you *MUST*:

  1. Determine if any code changes are needed.
  2. Explain any needed changes.
  3. If changes are needed, output a copy of each file that needs changes.
  4. Provide a one-line Git commit message based on the provided changes.

To suggest changes to a file you MUST return the entire content of the updated file in a code block.
You MUST use this *file listing* format:

```[code_language_type]
// [path/to/filename.js]
// entire file content ...
// ... goes in code block
```

Every *file listing* MUST use this format:
- First line: always starts with // then the filename with any originally provided path; no extra markup, punctuation, etc. **JUST** // and then filename with path.
- Second line: code block start ```[code_language_type]
- ... entire content of the file ...
- Final line: code block end ```

To suggest changes to a file you MUST return a *file listing* that contains the entire content of the file.
*NEVER* skip, omit or elide content from a *file listing* using "..." or by adding comments like "... rest of code..."!
Create a new file you MUST return a *file listing* which includes an appropriate filename, including any appropriate path.

To suggest a one-line Git commit message based on the provided changes.
Review the provided context and changes that have been made to the files.
Review the changes carefully.
Generate a one-line commit message for those changes.
The commit message should be structured as follows: <type>: <description>
Use these for <type>: fix, feat, build, chore, ci, docs, style, refactor, perf, test

Ensure the commit message:
- Starts with the appropriate prefix.
- Is in the imperative mood (e.g., "add feature" not "added feature" or "adding feature").
- Does not exceed 72 characters.

Reply only with the one-line commit message, without any additional text, explanations, or line breaks.

You MUST wrap the commit message in a code block using this format:

```commit_message
// commit message here ...
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions