Skip to content

Add AGENTS.md for AI coding agents - #24

Merged
benrfairless merged 3 commits into
mainfrom
doc/add-agents-md
Aug 18, 2026
Merged

benrfairless merged 3 commits into
mainfrom
doc/add-agents-md

Conversation

@benrfairless

@benrfairless benrfairless commented Aug 18, 2026

Copy link
Copy Markdown
Member

Description

Adds AGENTS.md to this repository, with CLAUDE.md and .github/copilot-instructions.md as one-line pointers to it. The guidance then lives in one place and applies whichever AI tool someone is using, rather than being duplicated per tool or existing only for Claude.

The content is limited to repo-specific knowledge that isn't obvious from reading the code, and it doesn't restate the README or the org contributing guide. The things most likely to save someone: ~/.morph holds a live API key, so it must never be echoed or used in a fixture; the upload includes every file not under a dot directory, so .git is skipped but a stray data.sqlite is not; the server streams newline-delimited JSON with a stream and text per line rather than plain text; and create_tar deliberately returns an open, rewound tempfile.

On the tooling side it records that bare bundle exec rake fails here with "Don't know how to build task 'default'" because the Rakefile is only require "bundler/gem_tasks", that SimpleCov enforces minimum_coverage 90 so the suite can fail with every example passing, that .rubocop_todo.yml is an accepted backlog rather than something to regenerate, and that scraper.rb in the root is a leftover sample scraper kept for exercising the CLI by hand rather than gem code.

The branch is doc/add-agents-md rather than the issue-numbered form in the org guide, because there's no tracking issue for this work.

Motivation and Context

Part of standardising how AI coding agents are briefed across OAF repositories: AGENTS.md is canonical, CLAUDE.md and .github/copilot-instructions.md point at it. This repository had no agent instructions, and a couple of the items above (the API key in ~/.morph, what the tar includes) are ones where an agent guessing wrong has consequences beyond a failed test.

How Has This Been Tested?

  • Checked affected area manually on my own / staging system
  • Ran automated tests on my own system
  • Confirmed it passed the GitHub actions tests

Every command and file path named in AGENTS.md was checked against this repository before writing it, rather than assumed. I ran the documented commands locally on Ruby 3.2.2 and confirmed each behaves as described.

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

This change is documentation, and it does not duplicate the README or the org contributing guide, so nothing else needed updating alongside it.

Note on packaging

All three gemspecs set spec.files from git ls-files, so these three files will be included in the next published gem. That seemed better than special-casing the gemspec, but flagging it so it is a decision rather than a surprise.

AI disclosure

I used Claude Code (claude-opus-5) to explore the repository and draft these files, and reviewed the result myself before opening this pull request. Each commit carries an Assisted-by: Claude Code:claude-opus-5 trailer.

Records the things about this gem that are easy to get wrong: that
~/.morph holds a live API key and must never end up in output or a
fixture, that the upload includes every file not under a dot directory,
that the server streams newline-delimited JSON rather than plain text,
and that create_tar deliberately hands back an open rewound tempfile.

Also notes that bare rake fails here because the Rakefile has no default
task, that SimpleCov enforces a 90% floor so the suite can fail with
every example passing, that .rubocop_todo.yml is an accepted backlog
rather than something to regenerate, and that scraper.rb in the root is
a leftover sample scraper rather than gem code.

CLAUDE.md and .github/copilot-instructions.md are pointers, so the
guidance lives in one place regardless of which tool reads it. Org-wide
workflow and disclosure rules are referenced rather than restated, with
the gh commands to fetch them.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Ben Fairless <ben@oaf.org.au>
@benrfairless benrfairless self-assigned this Aug 18, 2026
@benrfairless
benrfairless marked this pull request as ready for review August 18, 2026 01:02
@benrfairless
benrfairless requested a review from a team as a code owner August 18, 2026 01:02
The org-level guidance section told agents to fetch CONTRIBUTING.md and
AGENTS.md with "gh api", which only works where the GitHub CLI happens
to be present. A Copilot session, a fresh container or an outside
contributor may have neither it nor an authenticated token, and the
guidance is public, so it doesn't need one.

Links to both files plus their raw URLs instead, so any HTTP client will
do.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Ben Fairless <ben@oaf.org.au>
all_paths prunes directories whose name starts with a dot, but a
dot-file isn't a directory, so it gets packed. Verified by calling
all_paths against a temporary tree: a top-level .env comes back in the
list, while a file inside .hidden_dir does not.

The previous wording was true but easy to read as "hidden files are
skipped", which is the wrong way round on the one case that has
consequences.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Ben Fairless <ben@oaf.org.au>

@ianheggie-oaf ianheggie-oaf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved - lgtm when reading through the files

@benrfairless
benrfairless merged commit 2ab4660 into main Aug 18, 2026
9 checks passed
@benrfairless
benrfairless deleted the doc/add-agents-md branch August 18, 2026 02:29
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.

2 participants