docs(agent-bases): render one lean AGENTS.md into all templates - #929
Open
patrikbraborec wants to merge 1 commit into
Open
docs(agent-bases): render one lean AGENTS.md into all templates#929patrikbraborec wants to merge 1 commit into
patrikbraborec wants to merge 1 commit into
Conversation
Replace the three hand-synced agent-bases/{js,ts,python}.AGENTS.md files
with a single agent-bases/AGENTS.md whose language-specific values come
from agent-bases/languages.json. The copy script renders it per template
prefix and formats the result with Prettier.
The rendered file shrinks from 669 to 77 lines. Inlined schema
specifications, logging level lists, README section lists, the project
tree and the Playwright MCP config are replaced by links to the Apify
docs and a pointer to the apify-actor-development skill, which is now
the single place for the full workflow and schema rules.
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
Every template's
AGENTS.mdis now rendered from one source instead of three hand-synced copies, and it shrinks from 669 lines to 77.How it renders
flowchart LR S["agent-bases/AGENTS.md"] --> R["copy-agents-md-to-templates.mts<br/>(runs in pnpm run build)"] L["agent-bases/languages.json"] --> R R -->|"fill {{entry}}, {{logger}}, ..."| F["prettier.format(markdown)"] F --> T1["templates/js-*/AGENTS.md"] F --> T2["templates/ts-*/AGENTS.md"] F --> T3["templates/python-*/AGENTS.md"] T1 & T2 & T3 -.->|"@AGENTS.md"| C["CLAUDE.md"]The script throws on a placeholder that
languages.jsondoes not define, and formats the rendered output so table alignment survives values of different lengths.Why
AGENTS.mdis loaded into the agent's context on every turn. Current guidance (Claude Code docs, agents.md, Red Hat) keeps it to always-true guidance under ~150 lines and pushes task-specific procedures into skills or links. The ETH Zurich evaluation of AGENTS.md found that verbose context files lower task success and raise cost by over 20%.The old file also duplicated, and had drifted from, the
apify-actor-developmentskill in apify/agent-skills. After agent-skills#87 the two disagreed on dataset schema rules (fields: {}vs. a full superset withnullable), ondefaultvs.prefillfor example URLs, and on README section order.What the new file keeps
Two corrections landed on the way: the JS/TS logger rule now matches what templates import (
import { log } from 'apify', notapify/log), and example URLs go inprefill, notdefault.What it drops
Inlined input / output / dataset / key-value store specifications, the logging level list, the README section list, the project tree, the Playwright MCP JSON, the Do/Don't lists, and the two Crawlee gotchas (
requestHandlerTimeoutMillis,additionalHttpHeaders) that agent-skills#87 flagged as unverifiable.Verification
pnpm run lintpasses.pnpm run format:checkpasses for all tracked files.pnpm run test-without-templatespasses (17 tests).{{placeholders in any template.Follow-up (in apify/agent-skills)
inputSchema/outputSchemainactor-json.mdandoutput-schemas.mdto match what the templates ship.actor-readme.mdwith the docs page this file now links to.