Skip to content

skills: teach git notes for debugging context on fix commits - #3940

Closed
RandyMcMillan wants to merge 2 commits into
github:mainfrom
RandyMcMillan:git-notes-context-skill
Closed

RandyMcMillan wants to merge 2 commits into
github:mainfrom
RandyMcMillan:git-notes-context-skill

Conversation

@RandyMcMillan

Copy link
Copy Markdown

What

Adds a "Recording the why with git notes" section to the repository-content-changes bundled skill.

Closes #3939.

Why

Agents landing fix commits through this server produce a commit message but lose the debugging story — root cause, evidence (workflow run ids), why this fix. Git notes are the right home for that (git log --notes tells the whole story), but agents systematically mishandle them: notes live on refs/notes/commits, which is neither pushed nor fetched by default, and no MCP tool here can write them.

The guidance

  • Attach root cause + evidence (run ids) to fix commits via notes
  • add: git notes add -m "<context>" <sha>; push explicitly with git push origin refs/notes/commits; fetch on fresh clones with git fetch origin refs/notes/commits:refs/notes/commits (or one-time fetch refspec config)
  • Since the API can't write notes, the agent hands the user the local commands instead of dropping the context
  • Never force-push refs/notes/commits casually — shared ref, treat like the default branch

Docs-only change to one SKILL.md; no frontmatter, toolset instruction, or snapshot changes. TestToolsetInstructionsAreCoveredBySkills unaffected (instructions untouched).

The repository-content-changes skill lands commits but says nothing about
preserving the debugging story behind a fix. Add a section explaining why
git notes are the right place for root cause and evidence (run ids), and
how: the MCP tools cannot write refs/notes/commits, so the agent hands the
user the add/push/fetch commands, and treats the notes ref as shared
history that is never force-pushed casually.
@RandyMcMillan
RandyMcMillan requested a review from a team as a code owner November 24, 2026 16:18
Copilot AI adaptive review requested due to automatic review settings November 24, 2026 16:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The documented sequence may fail because it creates the fix commit remotely without fetching it locally before running git notes add, causing an unknown-object error on a stale clone.

1 open issue
What changed in this PR

Updates the repository-content-changes bundled skill to preserve debugging context for remotely created fix commits using Git notes.

Changes:

  • Documents recording root causes and workflow evidence with Git notes.
  • Provides commands for adding, pushing, and fetching notes under refs/notes/commits.
  • Explains that MCP tools cannot write notes directly and warns against casually force-pushing the shared notes ref.
File Description
pkg/​skills/​catalog/​skills/​repository-content-changes/​SKILL.md Adds Git notes workflow guidance for recording, publishing, and retrieving debugging context on fix commits.

Review effort: Lite (adaptive)

Comment on lines +86 to +88
- add: `git notes add -m "<context>" <sha>`
- push: `git push origin refs/notes/commits`
- fetch on a fresh clone: `git fetch origin refs/notes/commits:refs/notes/commits`,
The fork's main predates the skills catalog, so this file reads as an
add/add conflict against upstream. Removing it lets the update-branch
merge apply cleanly; the change is re-applied on top afterwards.
@RandyMcMillan

Copy link
Copy Markdown
Author

Superseded by #3941 — this branch was based on a stale fork main that predates the skills catalog, so the file showed as an add/add conflict. Identical change rebased onto current main there.

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.

Skill guidance: agents should use git notes to preserve debugging context on fix commits

2 participants