agentleFS
aws-solutions-library-samplesaws-solutions-library-samples/accelerated-intelligent-document-processing-on-aws/.claude/rules/agents.md

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.

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
  1. Very specific:

    Put a new agent in agents/<name>/ with a creator function and register it through agent_factory.register_agent(...).

    line 14
  2. Very specific:

    Read agent model IDs from configuration (for example agents.chat_companion.model_id), not from code or stack parameters.

    line 20
  3. Distinctive:

    Run generated Python only in the AgentCore Code Interpreter sandbox, and move data in and out through S3 and the AgentCore APIs.

    line 22
  4. Very specific:

    Keep conversation memory inside DynamoDB item-size limits and the sliding turn window by going through DynamoDBMemoryHookProvider.

    line 30
  5. Very specific:

    Add offline unit tests under lib/idp_common_pkg/tests/unit/agents/.

    line 36
  6. Very specific:

    Create bedrock-runtime clients directly in agent code.

    line 41
  7. Distinctive:

    Use a request-body identity as an authorization or scope key.

    line 42

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
agents.md

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 through agent_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 on idp_common.bedrock instead 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 in manual_tests/agents/, which runs by hand only.

Must not

  • Execute agent-generated code inside the Lambda itself.
  • Create bedrock-runtime clients 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-unit
  • make 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.