Skip to content

docs: split README and AGENTS.md into topic and package docs - #1384

Merged
edenreich merged 14 commits into
mainfrom
fix/issue-1379
Sep 28, 2026
Merged

edenreich merged 14 commits into
mainfrom
fix/issue-1379

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #1379

Summary

Splits the 1548-line README so it becomes a short landing page (130 lines) and every detail has exactly one home: user docs in docs/, contributor docs in internal/<context>/README.md, and agent rules in AGENTS.md.

Changes

  • README: landing page only. It has the pitch, the recommended install plus a link to the rest, the quick start, a one-line-per-feature index linking to docs/, and links to contributing and the license.
  • New docs/ pages for the topics that only lived in the README: installation, cost-tracking, tool-approval, computer-use, vision, memory, hooks, examples. Each opens with what / why / how and links to existing pages instead of repeating them.
  • docs/commands-reference.md gains the README-only commands (skills, plugins, avatars, export, insights, reset) and the Global Flags.
  • docs/tools-reference.md gains a Tool Overview. It is the single home for per-tool approval defaults, checked against the manifests, and includes the browser and media tools.
  • Package READMEs for each bounded context and capability. Each covers what it is, why it exists, and how it plugs in (ports and integration pattern). No file inventories.
  • AGENTS.md: the architecture section now points at the package READMEs. Root keeps the repo-wide invariants and security gotchas. internal/tools/AGENTS.md and internal/presentation/AGENTS.md hold package-only rules.

Corrections carried over from the old README

  • Cost tracking: the picker tabs are Pay-as-you-go / Subscription, prices come from the gateway's /models listing plus custom_prices, and the status bar shows a bare amount.
  • Approval: RecordStart asks by default, tools.bash.require_approval has no effect, and per-tool overrides exist only where a tool has a config section.
  • Dropped facts re-homed:
    • container TZ for scheduled jobs
    • Shift-drag text selection
    • inline history auto-completion
    • the auth.yaml link
  • Fixed links: agents-configuration.md pointed at a deleted README section, and two anchors were wrong.

Notes

  • infer injects only the root AGENTS.md. Loading nested files is tracked in [FEATURE] Load nested AGENTS.md files #1385, and until then the root points agents at internal/tools/AGENTS.md.
  • CI skips **/*.md, so task lint (markdownlint) and a relative-link/anchor check were run locally: clean.
  • The docs site (inference-gateway/docs) is out of scope and syncs separately.

Move installation, cost tracking, tool approval, computer use, vision annotation, persistent memory, reminders/hooks and examples out of the root README into their own docs pages, each opening with what/why/how.

Merge the README command and tool summaries into the existing commands and tools references so every topic has exactly one home.
README is now 138 lines: pitch, badges, recommended install plus a link to docs/installation.md, quick start, a one-line-per-feature index linking into docs/, an examples pointer, contributing and license.

The removed sections now live in their docs pages or CONTRIBUTING.md, so no content is duplicated.
Every bounded context and capability named in AGENTS.md now has an internal/<context>/README.md with what it owns, why it is separate and how it plugs in, each linking to its user-facing docs page instead of repeating configuration.

The root AGENTS.md shrinks to 6.5k chars (was 8.1k, over infer's 8000-char injection cap): it keeps the stack, commands, repo-wide rules and security gotchas, points at the package READMEs for architecture, and says packages with agent-specific rules ship their own AGENTS.md.

Add internal/tools/AGENTS.md (manifests and registry rules) and internal/presentation/AGENTS.md (Bubble Tea v2, Bubbles v2 and styling rules) as the first nested agent briefs.
The Tool Overview in tools-reference.md is now the only default-approval
table. It lists the browser and media tools it was missing and matches the
code: RecordStart asks by default, the other computer-use tools follow
computer_use.approval. tool-approval.md keeps the mechanism and links out
for defaults and approval_behaviour. It drops the bash require_approval
example, which the allow-list ignores.
The picker tabs are Pay-as-you-go and Subscription, and the label is
subscription. Prices come from the gateway's /models listing plus
custom_prices, not a built-in table. The status bar shows a bare amount and
hides it at zero. memory.md no longer points at a reminder section that
stayed behind in the old README.
The new topic pages restated their own What/Why/How opener and copied
content that already has a home: binary verification, the web terminal,
config-set examples, vision and reminder settings, the computer-use
actions, and the skills, plugins and avatars command examples. Each now
keeps what only it owns and links to the rest. commands-reference.md
gains a What/Why/How opener, the missing plugins subcommands, and skills
search.
agents-configuration.md linked a deleted README section, and
database-migrations.md was reachable only from a package README. The
container TZ note returns to scheduling.md, and text selection and inline
history auto-completion move to the chat command section. The README now
links auth.yaml to its reference section. Its contributing block links
CONTRIBUTING.md instead of copying the task list.
The file inventories and "Why it is separate" sections repeated the
opener and carried most of the errors: wrong file roles, a WhatsApp adapter
and Linux/Windows accessibility providers that do not exist, an MCP SDK the
CLI does not use, A2A streaming, an agent loop independent of the gateway
SDK. Each README now keeps the What/Why/How opener, how the context plugs
in (ports and integration pattern), and links. Depguard rules stay in the
root AGENTS.md. channels and audio are described as capabilities.
Rebuild the root AGENTS.md from main plus the new architecture section, so
the punctuation and line-wrap churn drops out of the diff. Restore the two
rules the split lost: project custom tools always need approval outside auto
mode, and tool contracts live in the agentdomain shared kernel. Drop the
"Today:" list of nested files. internal/tools/AGENTS.md keeps only its rules,
with the full registration steps. The package README and the root own the
rest. internal/presentation/AGENTS.md now states its rules for new code:
tui/app/chat.go does not route only, and internal/tools/formatter.go already
styles output. go-telegram confinement stays in the root depguard rule.
Comment thread docs/installation.md Resolved
Comment thread docs/installation.md Resolved
Comment thread docs/installation.md Resolved
@edenreich
edenreich merged commit a38cce4 into main Sep 28, 2026
1 check passed
@edenreich
edenreich deleted the fix/issue-1379 branch September 28, 2026 21:29
edenreich added a commit that referenced this pull request Sep 28, 2026
Follow-up to #1384

## Summary

A post-merge review of #1384 checked every concrete claim in its 32
files against the code. The structure holds up, but about 25 claims did
not match the code. This PR corrects them, and where a claim was
duplicated it swaps the copy for a link to the page that owns it.

## Changes

- **Approval (security-relevant)**:
- The Tool Overview said a tool is exempt "only where its manifest
exempts it". In fact the order is:
    1. Computer-use tools decide per call.
    2. Bash follows its allow-list.
3. The tool's config section applies next. Its defaults exempt `read`,
`grep`, `tree` and `web_fetch`.
    4. Then the tool's manifest.
    5. Then the global switch.
- `tool-approval.md` now uses the full key
`tools.safety.approval_behaviour` and says the behaviour is global.
- `channels.md` had its own approval table. It had drifted (it set
`tools.bash.require_approval`, which does nothing), so it is now a link.
- Fixed when `GetLatestFrame`, `RecordStart`/`RecordStop`,
`CreateAvatar` and `ImageDecode` are enabled.
- **Package READMEs**:
  - `--format ag-ui`, not `--output agui`.
- `infer init` seeds `~/.infer/channels.yaml`. The same wrong path was
in the `infer daemon` help text, which is fixed too.
  - Chat registers MCP tools as server status updates arrive.
- A2A artifacts download automatically only when
`artifacts_auto_download` is on.
  - `agent_event_driven.go` routes events, not `agent_state_machine.go`.
  - The screen lock does nothing on Windows.
  - Plugin hooks also need `hooks.enabled`.
- The `/install-opentask` shortcut hands its install prompt to the chat
agent, while `infer workflow install` runs the install directly.
  - Removed config lines whose home is `docs/`.
- **User docs**:
  - The `memory.max_chars` default is 2000.
- Fixed the cost-tracking status-bar example, and unpriced models show
under Free.
  - `infer insights` uses a 32000-token floor.
  - Restored the `conversations list` flags that the split dropped.
  - Documented `computer_use.approval` and `rate_limit`.
- Reworded claims such as "every subcommand" and "every file" that were
false.
- **`AGENTS.md`**:
  - Restored the list of contexts and capabilities.
  - Names both nested `AGENTS.md` files.
- Says `infer` reads the `AGENTS.md` in its working directory. It stays
under the 8000-char injection cap at 7017 chars.
- Added `internal/binaries/README.md`. It has `domain/` and
`infrastructure/`, so it is a bounded context by the repo's own rules.

## Not in this PR

- The Windows screen lock is a no-op
(`internal/computer/screen_lock_windows.go`). This PR only corrects the
doc.
- `isModelFree` counts unpriced models as free
(`model_selection_view.go`). The doc now describes this behaviour, but
it may be a bug.
- `audio` and `computer` construct `binariesinfra.NewStore` themselves
instead of getting it from the container.

## Verification

- `task precommit:run`: clean, including markdownlint.
- A relative-link and anchor check over `README.md`, `docs/`,
`internal/**/README.md` and the `AGENTS.md` files: no broken links.
- Checked the help output of the built binary for `headless --format`,
the `daemon` channels text and the `conversations list` flags.
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.218.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Refactor documentation - breakdown into sub docs for each package

1 participant