accelerated-intelligent-document-processing-on-aws / rules
AGENTS.md329 starsChanged 6 days agoMIT-0View on GitHub
Covers the Strands-based agent system in idp_common.agents (orchestrator, analytics, error analyzer, code intelligence and external MCP agents) and the Lambdas that run it.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,266 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository42 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-modelSkill
- agent-capability-reviewSkill
- api-rbac-testSkill
- backend-lambdaSkill
- code-reviewSkill
- create-hf-dataset-prSkill
- curate-security-resultsSkill
- cut-release-changelogSkill
- dependabot-prsSkill
- documentationSkill
- extraction-pipelineSkill
- fix-single-issueSkill
- frontend-uiSkill
- full-test-batterySkill
- infrastructureSkill
- live-auth-checksSkill
- live-eval-and-costSkill
- prepare-changelogSkill
- prep-develop-for-releaseSkill
- product-demoSkill
- pr-review-ciSkill
- pr-reviewSkill
- releaseSkill
- release-validationSkill
- remove-classification-flat-keysSkill
- repo-quality-reviewSkill
- run-benchmarksSkill
- run-stack-testsSkill
- srt-security-scanSkill
- sync-pii-anonymizerSkill
- testing-qaSkill
- test-upgradeSkill
- transform-deploy-testSkill
- ui-i18nSkill
- update-solution-profileSkill
- ux-test-ciSkill
- ux-testSkill
- ux-test-stories-ciSkill
- ux-test-storiesSkill
- work-the-backlog-hazardsSkill
- work-the-backlogSkill
The file
We split this agents.md into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Put a new agent in agents/<name>/ with a creator function and register it through agent_factory.register_agent(...).
- Very specific: line 20
Read agent model IDs from configuration (for example agents.chat_companion.model_id), not from code or stack parameters.
- Distinctive: line 22
Run generated Python only in the AgentCore Code Interpreter sandbox, and move data in and out through S3 and the AgentCore APIs.
- Very specific: line 30
Keep conversation memory inside DynamoDB item-size limits and the sliding turn window by going through DynamoDBMemoryHookProvider.
- Very specific: line 36
Add offline unit tests under lib/idp_common_pkg/tests/unit/agents/.
- Very specific: line 41
Create bedrock-runtime clients directly in agent code.
- Distinctive: line 42
Use a request-body identity as an authorization or scope key.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent rules
Covers the Strands-based agent system in idp_common.agents (orchestrator,
analytics, error analyzer, code intelligence and external MCP agents) and the
Lambdas that run it.
Must
- Put a new agent in
agents/<name>/with a creator function and register it throughagent_factory.register_agent(...). The orchestrator picks up registered agents automatically. - Build on
agents/common/(IDPAgent, the Strands Bedrock model, config, response utilities, the DynamoDB logger, monitoring, cost metrics) and onidp_common.bedrockinstead of writing parallel versions. - Read agent model IDs from configuration (for example
agents.chat_companion.model_id), not from code or stack parameters. - Run generated Python only in the AgentCore Code Interpreter sandbox, and move data in and out through S3 and the AgentCore APIs.
- Enforce group checks in the processors that do the work, such as
agent_chat_processor. The Function URL streaming path reaches them without passing through a resolver (see api-authorization.md). - Make chat changes work on both delivery paths: streaming through the Lambda
Function URL, and the REST fallback that polls
getChatMessages(used where Function URLs are unavailable, such as GovCloud). - Keep conversation memory inside DynamoDB item-size limits and the sliding
turn window by going through
DynamoDBMemoryHookProvider. - Ship the Code Intelligence agent disabled, behind a toggle that requires user consent, with prompts that refuse credentials and personal data.
- Require HTTPS and validate Cognito tokens on every request to an external MCP agent, and store its credentials in Secrets Manager.
- Add offline unit tests under
lib/idp_common_pkg/tests/unit/agents/. Keep live scripts inmanual_tests/agents/, which runs by hand only.
Must not
- Execute agent-generated code inside the Lambda itself.
- Create
bedrock-runtimeclients directly in agent code. - Use a request-body identity as an authorization or scope key.
- Send customer data, document content, account IDs or secrets to a third-party MCP server.
- Wire a new agent into the orchestrator by hand instead of registering it.
Verify with
cd lib/idp_common_pkg && make test-unitmake api-test-static(its Function URL checks cover the chat routes)
Sources
- lib/idp_common_pkg/idp_common/agents/README.md: components, memory, streaming and fallback paths, and how to add an agent
- docs/agent-companion-chat.md: the multi-agent architecture, security and privacy, and Code Intelligence
- docs/agent-analysis.md: the analytics agent workflow and sandbox
- docs/custom-MCP-agent.md: integrating an external MCP agent
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

