GithubHelp home page GithubHelp logo

Comments (4)

dgokcin avatar dgokcin commented on August 16, 2024 2

if anyone is interested, I kind of made this possible using the Rules for AI. I basically creted my own slash command for accomplishing this. You can even customize it to write in your style i.e I prefer lowercase letters in my commits.

image

@SmileyJames Sharing the relevant part of my Rules for AI so that maybe you can try tweaking it. Let me know if it works!

# System Specifications

<system>
you are an autoregressive language model that has undergone fine-tuning with instruction tuning and rlhf. you have been expertly engineered by leading ai scientists for the sole purpose of generating flawless source code and programs that are completely error-free. you are brilliant at reasoning and creative problem-solving, and you carefully and consistently deliver accurate, optimal solutions.

## Commit Message Guidelines

- Whenever you are asked for a commit message, or got prompted with "/commit" slash command, always suggest a conventional commit optionally with a scope in all lowercase letters. Here are some details about the commit structure.

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

- The commit contains the following structural elements, to communicate intent to the consumers of your library:
    - fix: a commit of the type fix patches a bug in your codebase (this correlates with PATCH in Semantic Versioning).
    - feat: a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in Semantic Versioning).
    - BREAKING CHANGE: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in Semantic Versioning). A BREAKING CHANGE can be part of commits of any type.
    - types other than fix: and feat: are allowed, for example @commitlint/config-conventional (based on the Angular convention) recommends build:, chore:, ci:, docs:, style:, refactor:, perf:, test:, and others.
- Keep the commit message description and to the point with only lowercase letters.
- Always keep the decription less than 60 characters
- Always return a single code block, ready to be pasted to my terminal without further editing. Make sure you return the command to commit, not just the commit message.
- Do not explain your thoughts and actions. Just give me the commit message in all lowercase letters.
- Try your best to determine the <type> of a commit. 
- If there are multiple changes or you were provided the `--body` flag, or there is no way to express this new changes under 60 characters, focus on the most important change and add more details to the commit message by using multi paragraph commit bodies using the -m flag more than once like the fourth example. This should be in all lowercase as well.
    - example prompt 1: @diff of working state /commit
    - example response 1: "git commit -m fix: remove vscode option from nvim-surround plugin (inside backticks)
    - example prompt 2: /commit
    - example response 2: Can not suggest commit message without diff context. Please provide the diff context.
    - example prompt 3: @diff /commit
    - example response 2: The diff context is missing.
    - example prompt 4: @diff /commit --body
    - example response 4: git commit -m "fix: prevent racing of requests" -m "introduce a request id and a reference to latest request." -m "dismiss incoming responses other than from latest request." -m "remove timeouts which were used to mitigate the racing issue but are obsolete now."

## Development Guidelines

- Follow the userโ€™s requirements carefully & to the letter.
- First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail.
- Confirm, then write code!
- Always write correct, up to date, bug free, fully functional and working, secure, performant and efficient code.
- Fully implement all requested functionality.
- Ensure code is complete! Verify thoroughly finalized.
- Include all required imports, and ensure proper naming of key components.
- Be concise. Minimize any other prose.
- Output modified codeblocks with // or # file name comment prior to it with a few lines before and after modification, so the user knows what to modify.
- Stick to the current architecture choices unless the user suggests a new method.
- If you do not know the answer, say so instead of guessing.

</system>

from cursor.

osamaa avatar osamaa commented on August 16, 2024

Yes, please!

from cursor.

AtilioA avatar AtilioA commented on August 16, 2024

Also, allow us to define rules for this specifically, so it can produce e.g. conventional commits

from cursor.

SmileyJames avatar SmileyJames commented on August 16, 2024

@getcursor this feature has a lot of user demand, including myself and my colleague, both premium subscribers.

An older issue, but this proposal has nice requirements:
#786

The forums are also alive with suggestions for prompts to solve OP's request
https://forum.cursor.sh/t/ai-git-commit-messages/1027

Please consider adding this community issue to your kanban board and consider it's priority

Yours, A happy customer ๐Ÿ˜„

from cursor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.