Skip to content

Add commit message skill support - #58754

Open
ask4fusora wants to merge 22 commits into
zed-industries:mainfrom
ask4fusora:git-commit-message-skill
Open

Add commit message skill support#58754
ask4fusora wants to merge 22 commits into
zed-industries:mainfrom
ask4fusora:git-commit-message-skill

Conversation

@ask4fusora

@ask4fusora ask4fusora commented Jun 6, 2026

Copy link
Copy Markdown

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Related to #58345.

Release Notes:

  • Added commit message skill support via git_commit_message_skill_name.

Description

This PR introduces git_commit_message_skill_name setting, which can be defined in both project-level and user-level settings.json files. It dictates which agent skill to load when git::GenerateCommitMessage is triggered.

Motivation and context

In Zed v1.4.2, the previous rules library handling the Commit Message rule was removed and replaced for agent skills support. Currently, the primary workaround to provide custom commit message instructions is to place them in AGENTS.md. However, this approach pollutes the context window when interacting generally with the Zed Agent.

While PR #58188 attempted to address related concerns, it does not represent the ideal final architecture for this feature.

Additionally, Zed now operates as a multi-workspace editor, we need a solution that scales cleanly across multiple projects.

Proposed solution

When git::GenerateCommitMessage is triggered for workspace project-a, the system follows this resolution path to find the appropriate skill:

  1. It first checks the current project's .zed/settings.json for git_commit_message_skill_name.
    • If set, it looks for the skill in project-a/.agents/skills.
  2. If the setting is not found in the project configuration, it falls back to the user's global settings.json.
    • If set globally, it looks for the skill in ~/.agents/skills.
  3. Validate and execute:
    • If the skill is found and contains content, it loads the skill for commit message generation.
    • If the skill file is found but is blank, it throws an error notifying the user that the skill at <position> is blank.
    • If the configured skill is not found in the corresponding .agents/skills directory, it throws an error notifying the user that the skill at <position> could not be found.
  4. If the setting is omitted from both project and user settings, or git_commit_message_skill_name is blank, the generation omits the specific skill block and falls back to default behavior.

Logic Diagram

For clarity, here is the resolution flow represented as a Mermaid diagram:

---
config:
  theme: redux
  layout: elk
---
flowchart LR
    A@{ label: "Generate commit message triggered in `project-a`" } --> B@{ label: "`project-a/.zed/settings.json` has skill name set?" }
    B -- true --> C@{ label: "`project-a/.agents/skills` has set skill?" }
    C -- true --> E{"Skill content is not blank?"}
    E -- true --> F["Load the skill for git commit message generation"]
    E -- false --> G["Notify error that the skill at \<position\> is blank"]
    C -- false --> D["Notify error that the skill in \<position\> is not found."]
    B -- false --> H@{ label: "Skill name is set in user `settings.json`?" }
    H -- true --> I@{ label: "Skill is declared in `~/.agents/skills`?" }
    I -- true --> E
    H -- false --> J["Omit the skill block for commit message"]
    I -- false --> D

    A@{ shape: rect}
    B@{ shape: diamond}
    C@{ shape: diamond}
    H@{ shape: diamond}
    I@{ shape: diamond}
Loading

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 6, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jun 6, 2026
@ask4fusora

ask4fusora commented Jun 6, 2026

Copy link
Copy Markdown
Author

Warning

Hi, I am new to Rust and the Zed codebase. Please review extra carefully, especially on implementation design, code organization, performance, and tests.
While I comply to Zed's contribution rules, I am not confident that I know enough to execute it fully.

@ask4fusora

This comment was marked as outdated.

@ask4fusora

This comment was marked as resolved.

@ask4fusora
ask4fusora force-pushed the git-commit-message-skill branch from f9fd529 to 3449d38 Compare June 13, 2026 10:04
@cla-bot

cla-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: ask4fusora.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot cla-bot Bot removed the cla-signed The user has signed the Contributor License Agreement label Jun 26, 2026
@ask4fusora
ask4fusora marked this pull request as ready for review June 26, 2026 20:41
@cla-bot

cla-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: ask4fusora.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@ask4fusora

This comment was marked as outdated.

@ask4fusora

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot

cla-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: ask4fusora.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot

cla-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@ask4fusora
ask4fusora force-pushed the git-commit-message-skill branch from 7325292 to 17b802c Compare June 26, 2026 21:12
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 26, 2026
@smitbarmase smitbarmase added the area:integrations/git Git integration feedback label Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:integrations/git Git integration feedback cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants