Repository navigation
docs(agent-bases): render one lean AGENTS.md into all templates - #929
Merged
Merged
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.
- Render the HTTP crawler, dataset info call, and aborting handler per
language, so Python templates stop naming JS-only CheerioCrawler and
Dataset.getInfo()
- Say what apify validate-schema checks: input, dataset, and key-value
store schemas, but not an outputSchema (CLI 1.10 reads only `output`)
- Make it the output-schema done-condition and mark the template's
`fields: {}` as a placeholder
- Add apify run --purge, and fix the plural logger sentence for Python
l2ysho
approved these changes
Sep 23, 2026
l2ysho
left a comment
Contributor
There was a problem hiding this comment.
This is really too big to carefully check, I guess lets LGTM (lets gamble this merge) and lets watch how agents like it. We can revert anytime.
Contributor
Author
|
@l2ysho yes, but before merge I want to run some evals :) |
…conditions In an end-to-end eval the aborting handler was implemented in 1/5 Actors while it lived only in Rules; workflow done-conditions were followed every time. Move it into step 1 and keep the why in Rules. Also tell the user the Standby URL on deploy, which no run did.
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 79.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
Corrections that landed on the way:
import { log } from 'apify', notapify/log).prefill, notdefault.BeautifulSoupCrawler/ParselCrawler), dataset call (dataset.get_info()), andabortinghandler (Actor.on(Event.ABORTING, ...)) instead of the JS ones;languages.jsoncarries them.apify validate-schemacomment says what it checks. CLI 1.10 validates the input, dataset, and key-value store schemas but skips anoutputSchema, because it reads only the deprecatedoutputkey. Passing it is the output-schema done-condition, and the template's"fields": {}is marked as a placeholder.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
Use, done in agent-skills#87 together with the logger, Python entry point, and standby fixes.inputSchema/outputSchemainactor-json.mdandoutput-schemas.mdactor-readme.mdwith the docs page this file now links to.