Skip to content

Add an AGENTS.md file to help with AI-assisted debugging/development#907

Draft
dscho wants to merge 3 commits intovfs-2.54.0from
add-an-AGENTS.md
Draft

Add an AGENTS.md file to help with AI-assisted debugging/development#907
dscho wants to merge 3 commits intovfs-2.54.0from
add-an-AGENTS.md

Conversation

@dscho
Copy link
Copy Markdown
Member

@dscho dscho commented Apr 30, 2026

This PR is the Microsoft Git counterpart to git-for-windows#6198, which added an AGENTS.md file at the top of the Git for Windows tree to give AI coding assistants enough project-specific context to be useful contributors there. The argument from that PR applies to this fork too, only more so. Quoting:

AI-assisted contributions are a reality of open source in 2025 and beyond. Contributors will use AI tools, and that includes the maintainers themselves. Over recent months, I have found AI increasingly useful for the kind of menial, tedious work that does not require much creativity but is highly boring when done by hand: resolving merge conflicts during merging-rebases, chasing down CI failures across platforms, adapting downstream patches to upstream API changes.

The Microsoft Git fork sits one rung further down the stack, on top of Git for Windows on top of upstream Git, and it carries a substantial body of fork-specific code that no LLM will have been trained on: the GVFS protocol implementation in gvfs-helper*.c, the virtualfilesystem.c hooks, the early Scalar history that was later upstreamed in heavily-evolved form, status serialization, and the per-release tentative/vfs-X.Y.Z rebases onto new upstream and Git for Windows versions. Without targeted context, even capable models tend to miss conventions, "fix" code that is intentionally
fork-specific, or propose patches that conflict with how the next merging-rebase will need to look.

This PR is part of the same wave of AGENTS.md additions as git-for-windows#6198, git-for-windows/MINGW-packages#194, git-for-windows/git-for-windows.github.io#88, and git-for-windows/msys2-runtime#124. It starts from the file added by the first of those PRs and then adapts it for the Microsoft Git fork: documenting the fork hierarchy and the VFSforGit / Scalar history, the GVFS-specific source layout and configuration options, the integration points where GVFS hooks into Git's object lookup machinery, the high-risk areas to watch during release rebases, when to skip a patch, conflict resolution patterns, and the tentative/vfs-X.Y.Z branch workflow.

The series is intentionally split into small reviewable chunks: an initial commit that brings in the upstream AGENTS.md unchanged, a second commit that adapts it for the Microsoft Git fork, and a fixup! commit on top with further refinements. The fixup! is deliberately not autosquashed, so reviewers can read each adjustment in isolation. The next merging-rebase to a newer Git for Windows version is when the whole group will collapse into a single commit for easier maintenance going forward.

Opened as a draft on purpose: the file lives at the top of the tree and benefits from real-world feedback before being declared "done". Suggestions, especially from anyone actively using an AI assistant against this repository, are very welcome.

@dscho dscho force-pushed the add-an-AGENTS.md branch from 019ce1d to f838177 Compare April 30, 2026 12:08
dscho added 2 commits April 30, 2026 14:10
The Microsoft Git fork is a downstream fork of Git for Windows. Its
reason to exist is quite a bit different from Git for Windows. For
example, it targets not only Windows, it also supports Linux and macOS
builds. Historically, its main goal has been to support VFSforGit. In
the meantime, also Scalar targeting Azure Repos has been a major focus
of this repository. These aspects need to be reflected in the agents. So
that LLM assistance can be more effective.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the add-an-AGENTS.md branch from f838177 to eb2771f Compare April 30, 2026 12:11
…opment

AGENTS.md: document the iterative, human-in-the-loop working style

Derrick Stolee, who routinely drives LLM-assisted work on this
codebase, described his approach: rather than relying on elaborate
custom prompts, he gets good results by keeping the agent on a short
leash through a disciplined workflow. Specifically he:

  - Starts every task by asking the agent to explore the relevant
    code (where are the important methods, how does control flow,
    where are the existing tests).
  - Asks for an explicit, commit-by-commit plan and reviews it
    carefully, with particular attention to any code snippets
    proposed.
  - Has the agent implement one commit at a time, pausing for review
    between commits.
  - Drives the incremental rebase himself and prompts the agent to
    make follow-up edits on top of the rewritten history.

These are general LLM-assisted Git development practices, not
fork-specific, so the new "Working Style" section is added near the
top of AGENTS.md (right after "Overview", before any of the more
technical structural and architectural material) where it sets the
tone for the rest of the document. The placement is identical in the
base file and in the Microsoft Git adaptation, since neither commit
that touches AGENTS.md modifies the section boundary between
"Overview" and "Repository Structure".

Helped-by: Derrick Stolee <stolee@gmail.com>Assisted-by: Claude Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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.

1 participant