Skip to content

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

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

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

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.
Supersedes #3940 (that branch was based on a stale fork main predating the skills catalog; this is the identical change rebased onto current main).

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:31
Copilot AI adaptive review requested due to automatic review settings November 24, 2026 16:31

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

A critical finding remains active because the new SKILL.md command-line guidance violates the catalog’s existing tool-only routing test and contract.

1 open issue
What changed in this PR

Adds guidance to the repository-content-changes bundled skill for preserving debugging context with Git notes on fix commits created through the MCP server.

Changes:

  • Documents attaching root cause and workflow evidence to commits with Git notes.
  • Provides commands for adding, pushing, and fetching the shared notes ref.
  • Warns against casually force-pushing refs/notes/commits.
File Description
pkg/​skills/​catalog/​skills/​repository-content-changes/​SKILL.md Adds Git notes workflow and safety guidance for preserving debugging context on remotely created fix commits.

Review effort: Lite (adaptive)

Comment on lines +81 to +87
No tool in this workflow can write notes: they live on `refs/notes/commits`, which the
API commits here never touch, and which a plain `git push` does not send either. When a
fix commit lands through `push_files` or `create_or_update_file`, hand the user the
commands to run locally rather than letting the context drop:

- add: `git notes add -m "<context>" <sha>`
- push: `git push origin refs/notes/commits`
TestSkillsRouteOnlyThroughTools rejects references to host execution
surfaces in bundled skills — the catalog must read the same to a host with
no execution surface at all. Reword the notes section in tool-neutral
terms: the refs/notes/commits ref, the fact that no tool here writes it,
and the instruction to hand the context to the user rather than routing
the host to local commands.

@RandyMcMillan RandyMcMillan left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Please consider this - it is extremely useful.

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