Skip to content

Add AGENTS.md and copilot-instructions.md for AI agent onboarding#133

Merged
francisfuzz merged 4 commits into
mainfrom
agent-instructions-132
Jun 17, 2026
Merged

Add AGENTS.md and copilot-instructions.md for AI agent onboarding#133
francisfuzz merged 4 commits into
mainfrom
agent-instructions-132

Conversation

@francisfuzz

@francisfuzz francisfuzz commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #132

This repo doesn't have any instruction files for AI coding agents, so every agent that shows up here has to re-discover the build commands, testing patterns, project structure, etc. from scratch each time. This PR adds two files to fix that:

  • AGENTS.md at the repo root. This is the open standard that works across Copilot, Codex, Cursor, and other agents. It's got the full picture: project layout, build/test commands, how commands are structured, the mock/testing patterns, error handling with the typed exit codes, key interfaces, and some of the non-obvious stuff like the stack file locking and the defer restore() gotcha.

  • .github/copilot-instructions.md is a shorter version (~2K chars) that Copilot Chat, code review, and completions pick up. Kept it well under the 4K char limit for code review. It points to AGENTS.md for the full details.

I wrote these after going through the codebase and pulling out the things that would've saved me the most time on first contact. The mock patterns especially (git.SetOps, MockClient, the config hooks) aren't obvious without reading a few test files first.

For reviewers

  • Does the level of detail in AGENTS.md feel right, or is it too much? Happy to trim if it's noisy.
  • Any conventions or gotchas I missed that you'd want an agent to know about?
  • The copilot-instructions.md is intentionally minimal. Should it cover anything else, or is the "essentials + link to AGENTS.md" approach good?

GitHub Advanced Security started work on behalf of francisfuzz June 17, 2026 02:36 View session
GitHub Advanced Security finished work on behalf of francisfuzz June 17, 2026 02:38
@francisfuzz francisfuzz self-assigned this Jun 17, 2026
@francisfuzz francisfuzz changed the title Add AGENTS.md and copilot-instructions.md for AI agent onboarding Add AGENTS.md and copilot-instructions.md for AI agent onboarding Jun 17, 2026
Add two complementary instruction files so AI coding agents can work
effectively in this repository without re-discovering conventions:

- AGENTS.md (7K chars): agent-agnostic open standard with full project
  structure, build/test commands, coding patterns, testing conventions,
  error handling, key interfaces, and non-obvious gotchas.

- .github/copilot-instructions.md (2K chars): concise Copilot-specific
  instructions under the 4K code review limit, covering the essentials
  and referencing AGENTS.md for full details.

Closes #132

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@francisfuzz francisfuzz force-pushed the agent-instructions-132 branch from 5626eef to 8178580 Compare June 17, 2026 02:47
GitHub Advanced Security started work on behalf of francisfuzz June 17, 2026 02:47 View session
GitHub Advanced Security finished work on behalf of francisfuzz June 17, 2026 02:48

@skarim skarim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for putting this together! One small correction on the build command, rest looks great ✨

Comment thread .github/copilot-instructions.md Outdated
Comment thread AGENTS.md Outdated
francisfuzz and others added 2 commits June 17, 2026 11:13
Co-authored-by: Sameen Karim <skarim@github.com>
Co-authored-by: Sameen Karim <skarim@github.com>
GitHub Advanced Security started work on behalf of francisfuzz June 17, 2026 18:13 View session
@francisfuzz francisfuzz marked this pull request as ready for review June 17, 2026 18:14
Copilot AI review requested due to automatic review settings June 17, 2026 18:14
GitHub Advanced Security started work on behalf of francisfuzz June 17, 2026 18:14 View session
@francisfuzz francisfuzz requested a review from skarim June 17, 2026 18:14
GitHub Advanced Security finished work on behalf of francisfuzz June 17, 2026 18:15
GitHub Advanced Security finished work on behalf of francisfuzz June 17, 2026 18:15

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.

Pull request overview

This PR adds two AI agent onboarding files to the repository, closing #132. The files provide build commands, project structure, testing patterns, error handling conventions, and key interfaces so that AI coding agents don't have to rediscover this context from scratch each time.

Changes:

  • Adds AGENTS.md at the repo root — a comprehensive agent-agnostic instruction file covering project layout, build/test/validate commands, command structure patterns, error codes, testing mock patterns, key interfaces, stack file internals, CI workflows, and non-obvious codebase gotchas.
  • Adds .github/copilot-instructions.md — a shorter Copilot-specific version with essentials and a link to AGENTS.md for full details.
Show a summary per file
File Description
AGENTS.md Comprehensive agent instruction file covering the full project architecture, conventions, and patterns
.github/copilot-instructions.md Concise Copilot-specific instructions (~2K chars) with essentials and link to AGENTS.md

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread AGENTS.md Outdated
Comment thread .github/copilot-instructions.md Outdated
- go build ./... compiles but does not produce a binary. Changed to
  go build -o gh-stack . which actually outputs the executable.
- errors.As(err, &ExitError{}) panics at runtime because the value
  type ExitError does not satisfy the error interface (only *ExitError
  does). Updated to the correct two-line pattern matching cmd/root.go.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
GitHub Advanced Security started work on behalf of francisfuzz June 17, 2026 18:21 View session
GitHub Advanced Security finished work on behalf of francisfuzz June 17, 2026 18:23
@francisfuzz francisfuzz merged commit 4759126 into main Jun 17, 2026
7 checks passed
@francisfuzz francisfuzz deleted the agent-instructions-132 branch June 17, 2026 21:00
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.

Add AGENTS.md and .github/copilot-instructions.md for AI agent onboarding

3 participants