docs: add agent integration guide for AI coding tools#241
Closed
kamran-rapidfireAI wants to merge 8 commits into
Closed
docs: add agent integration guide for AI coding tools#241kamran-rapidfireAI wants to merge 8 commits into
kamran-rapidfireAI wants to merge 8 commits into
Conversation
Adds docs/AGENTS.md, the operational guide AI coding agents (Claude Code, Cursor, Codex, Copilot, Windsurf, Aider, Junie) read before helping a user install or integrate rapidfireai. Surfaces it via a README pointer and a PyPI sidebar URL so agents discover it pre-install. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rrent When a maintainer changes the public API surface (Experiment, automl exports, trainer-type mapping, user-supplied callback signatures), adds/renames CLI subcommands, or shifts the tutorial taxonomy, the agent guide at docs/AGENTS.md needs the matching update in the same PR. README install-step changes do not — those are deferred by design. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previously CLAUDE.md was the canonical maintainer guide and only Claude
Code auto-loaded it. AGENTS.md is the cross-tool convention auto-loaded
by Cursor, OpenAI Codex CLI, GitHub Copilot, Windsurf, Aider, and Junie
- so the canonical content moves there. CLAUDE.md becomes a single-line
@AGENTS.md import so Claude Code inlines the same content.
- /AGENTS.md: canonical maintainer guide
- /CLAUDE.md: one-line @AGENTS.md router
- Same pattern in rapidfireai/fit/{backend,db,dispatcher,ml,utils} and
rapidfireai/frontend (six sub-module pairs)
- README.md: top-of-file admonition routes end-user agents to
docs/AGENTS.md and maintainer agents to root AGENTS.md
- docs/AGENTS.md: contributor-redirect now points at root AGENTS.md
- rapidfireai/frontend/AGENTS.md: Playwright MCP install split into
per-tool subsections (Claude Code / Cursor / Codex CLI / Copilot /
Windsurf / Aider+Junie)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Make the raw URL a link instead of inline text and drop the parenthetical about Claude Code being routed via CLAUDE.md (already implicit from the "all AI coding agents" phrasing). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reduces the human-visible footprint of the top-of-README agent pointer to a single click-to-expand line while keeping full discoverability for agents reading the raw markdown. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…view Combines the top admonition and bottom 'For AI Coding Agents' section into a single collapsible block placed right after the intro paragraph. Agents discover the pointer earlier (more robust to token-budget truncation), and humans see only one collapsed line. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the bland "For AI coding agents" summary with a header that
addresses the agent directly, names the project, includes the install/
integrate task vocabulary, and ends with a directive ("Read first").
The 🤖 emoji acts as a visual marker so humans skip past in one glance.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Jun 25, 2026
Collaborator
Author
|
Closing in favor of four single-purpose PRs, reconstructed cleanly off
#280 + #281 + #282 form a complete, self-contained set. #283 is purely additive — if it's never merged, the other three remain accurate and consistent (no dangling links, no over-promising). Splitting this way keeps each change reviewable on its own and lets the integration guide be accepted or dropped independently. 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make this repo's AI-coding-agent guidance work for every major tool — not just Claude Code — by hoisting the canonical maintainer guide to
AGENTS.mdand adding an end-user-facing integration guide atdocs/AGENTS.mdthat agents discover before they help a user install or integrate the package.This is the original
docs/AGENTS.mdwork (commits 322fa22 and b24f5db) plus a follow-up restructure. The end-user-facing guide hasn't changed scope; what's new is where the maintainer guide lives, how each AI tool finds the right content, and how the two audiences are kept apart with zero cross-pollution risk.What changed
Hoisted maintainer guide to
AGENTS.md:AGENTS.md(new, root) — the full canonical maintainer guide. Holds the architecture, key commands, dev setup, common patterns, README guidelines, and the AGENTS.md sync triggers that previously lived inCLAUDE.md.CLAUDE.md(root) — reduced to a single line:@AGENTS.md. Claude Code's@<path>import (documented at https://code.claude.com/docs/en/memory.md) inlines the canonical content at launch. Same pattern applied to the six sub-module pairs inrapidfireai/fit/{backend,db,dispatcher,ml,utils}andrapidfireai/frontend.Added end-user-facing integration guide (per the original PR scope):
docs/AGENTS.md— the operational guide AI coding agents read before helping a user install or integraterapidfireai. Placed underdocs/(not at root) so it does NOT auto-load for maintainer agents working in this repo.pyproject.toml— adds anAI-Agent-GuideURL so the guide surfaces in the PyPI sidebar.README.md— adds a collapsible<details>disclosure between the intro paragraph and## Overviewwith a self-identifying header (🤖 AI coding agent installing or integrating rapidfireai? Read first). Humans see one line they can click to expand; agents reading the raw markdown see the full body unconditionally.Per-tool MCP install instructions:
rapidfireai/frontend/AGENTS.md— Playwright MCP install split into six tool-specific subsections (Claude Code / Cursor / OpenAI Codex CLI / GitHub Copilot / Windsurf / Aider+Junie). The original section had only theclaude mcp addcommand, which works only for Claude Code.Why each decision
Why hoist the maintainer guide to
AGENTS.md(instead of leaving it inCLAUDE.md)?AGENTS.mdis the cross-tool convention auto-discovered by Cursor, OpenAI Codex CLI, GitHub Copilot, Windsurf, Aider, and Junie.CLAUDE.mdis auto-discovered only by Claude Code. Before this PR, contributors using any non-Claude tool got zero auto-loaded guidance — they were either flying blind or skimming the end-user-oriented README. Hoisting toAGENTS.mdgives every tool the same starting point with one source of truth.Why
CLAUDE.mdas a one-line@AGENTS.mdimport (and not a duplicate)?Two reasons:
CLAUDE.mdwould inevitably drift fromAGENTS.mdover time — someone updates one and forgets the other. A pure import cannot drift; there is only one file to maintain.@<path>import is an officially documented feature, not a hack. The one-line file does exactly what's documented: import the referenced file into the working context at launch.The risk is that a maintainer deletes the
@AGENTS.mdline thinking it's a leftover. Mitigated by the convention being applied uniformly across all seven router files (everyCLAUDE.mdin the repo is just@AGENTS.md), which signals the pattern is intentional.Why is
docs/AGENTS.mdunderdocs/and not at the repo root?This is the load-bearing design decision. If we placed the end-user-integration guide at the root as
AGENTS.md, non-Claude maintainer agents (Cursor / Codex CLI / Copilot / Windsurf) working in this repo would auto-load it and treat its content as project rules — but its content is for agents helping a user use the package, not maintain it. That cross-pollution would actively confuse contributors and is exactly the failure mode we are designing around.Under
docs/, the file is invisible to maintainer auto-loaders. End-user agents (who are NOT inside this repo — they're in the user's own project) still discover it via three independent channels: theREADME.mddisclosure, the PyPI sidebarAI-Agent-GuideURL, and direct web search.Why the
<details>disclosure for the README pointer?A plain blockquote adds visual weight humans don't need on every README read. A
<details>block collapses to a single line — humans skip past unless they choose to expand, while agents reading the raw markdown source see the full body unconditionally (the<details>tag is just markup; the body inside is plain markdown).The summary header
🤖 AI coding agent installing or integrating rapidfireai? Read firstis tuned for three agent-discoverability signals:AI coding agent)installing or integrating rapidfireai— including the project name itself, which is the strongest possible match for an agent given the task "install rapidfireai")Read first— imperative with precedence)For humans, the question form acts as a filter: "I'm not an AI coding agent" → skip past in one glance. The 🤖 emoji is a visual marker that reinforces the skip decision before words are even parsed.
Why split Playwright MCP per tool?
The original section had only
claude mcp add playwright npx @playwright/mcp@latest, which works only for Claude Code. A contributor using Cursor, Codex CLI, Copilot, Windsurf, or any other MCP-capable tool would have to look up the equivalent config themselves. Per-tool subsections give each tool the correct setup (CLI command for Claude Code, JSON config snippets for Cursor / Copilot / Windsurf, TOML for Codex CLI, and a note about MCP-support variance for Aider/Junie).Why decouple volatile install commands from
docs/AGENTS.md?README.mdowns volatile install content (Python version, thepip installline, HF auth syntax, thehf-xetworkaround, port numbers, kill-by-port commands,ssh -Lsyntax). These values change between releases.docs/AGENTS.mdowns the stable layer: workflow taxonomy (RAG vs fine-tuning), API patterns, safety rules, the workflow decision tree.This split means a README install-step change does NOT require an
AGENTS.mdupdate — the agent guide cannot silently drift away from install reality, because it never restated the install steps to begin with. The reverse direction (when stable surfaces change) is covered by## Keeping docs/AGENTS.md in syncinside rootAGENTS.md, which lists specific triggers:Experimentpublic API, AutoML exports, trainer-type taxonomy, user-supplied callback signatures, CLI subcommand structure, and tutorial taxonomy.Discovery matrix (post-PR)
rapidfireaidocs/AGENTS.md; or PyPIAI-Agent-GuideURLCLAUDE.md@AGENTS.mdimport inlines rootAGENTS.mdAGENTS.mdNo matrix cell can pollute another: maintainer auto-loaders can't see
docs/AGENTS.md(wrong directory), and end-user agents can't see the maintainer files (they're not in this repo).Test plan
<details>disclosure between the intro paragraph and## Overview; collapsed by default showing only the🤖 AI coding agent...summary line; expands to show the full pointer, quick-decision shortcut, and contributor-redirect note. No separate "For AI Coding Agents" section elsewhere in the README (deliberately merged into the disclosure).AGENTS.md(root) renders correctly on GitHub — full canonical maintainer guide present; scope guard for end-user audience visible at the top.docs/AGENTS.mdrenders correctly — tables and code blocks intact; contributor-redirect at the top points at rootAGENTS.md.CLAUDE.mdrouters are minimal —git diff -- '*CLAUDE.md'shows each file shrunk to a single@AGENTS.mdline.AGENTS.mdcontent appears in context (not just the one-line@AGENTS.mdtext).AGENTS.mdcontent is treated as project rules.docs/AGENTS.mdas project rules (it should be invisible because it's underdocs/, not at root).rapidfireaifor fine-tuning; verify the agent fetchesdocs/AGENTS.md, validates the environment, picks the correctinitvariant, and walks the user through the §3 setup order. (Partially tested. Because this PR is not merged yet, I provided the AGENTS.md to the Cursor agent myself and it succeeded in integrating rapidfireai into a new notebook).rapidfireai/frontend/AGENTS.md, all six tool subsections under "Installing Playwright MCP" render with their respective config snippets.AI-Agent-Guidelink visible on the PyPI project page after the next TestPyPI deploy.🤖 Generated with Claude Code