agentleFS
AWSKnown publisherawslabs/generative-ai-cdk-constructs/AGENTS.md

generative-ai-cdk-constructs

AGENTS.md544 starsChanged 5 months agoApache-2.0View on GitHub

This file provides context for AI coding assistants (Kiro, Cursor, GitHub Copilot, Claude Code, etc.) working with the Generative AI CDK Constructs repository. You are a AWS Cloud Development Kit constructs TypeScript developer expert. This is a monorepo using Projen. To get started and understand the developer flow, follow the DEVELOPER_GUIDE You can get the list of all commands to run by running projen --help. The following tables summarizes the commands:

  • 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 repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    When building new constructs or updating existing ones, understand how the service resources are available through CloudFormation using the …

    line 154
  2. Very specific:

    Follow the DESIGN_GUIDELINES

    line 158
  3. Distinctive:

    When implementing constructs logic:

    line 159
  4. Distinctive:

    Use shared utilities to avoid code duplication

    line 160
  5. Distinctive:

    No documentation needed for internal-only changes

    line 189
  6. Distinctive:

    When uncertain about expected artifacts, ask for clarification.

    line 200
  7. Distinctive:

    NEVER modify directly a file which contains the string "Generated by projen".

    line 204
  8. Very specific:

    NEVER add new dependencies without asking first, and without adding them to the .projenrc.ts file.

    line 205
  9. Distinctive:

    ALWAYS run a full build when done with a task, this is to ensure all required files are generated before commit.

    line 206
  10. Distinctive:

    ALWAYS Ask first: Before modifying existing files in a major way.

    line 207

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

AGENTS.md

This file provides context for AI coding assistants (Kiro, Cursor, GitHub Copilot, Claude Code, etc.) working with the Generative AI CDK Constructs repository.

Your role

You are a AWS Cloud Development Kit constructs TypeScript developer expert.

Project knowledge

This is a monorepo using Projen.

  • Tech Stack:
    • Node >= v22.0.0
    • AWS CDK >= 2.261.0
    • Python >=3.9
    • Projen >= 0.99.53
    • Yarn >= 1.22.19
    • GitHub workflows for CI/CD
    • JSII >= 5.9.0 Constructs are built using TypeScript and are vended to multiple languages using the JSII toolchain

To get started and understand the developer flow, follow the DEVELOPER_GUIDE

  • Repository structure:
|--projenrc/ (Contains additional projen configuration)
|--docs/ (Contains architecture diagrams for the constructs)
|--lambda/ (Contains lambdas implementation used by constructs, typically custom resources)
|--layer/ (Lambda layers used by some constructs)
|--resources (If you need additional resources packaged with your library)
|--rosetta
    |--default-<module-name>.ts-fixture (template files that provide the necessary imports and boilerplate code for examples in readme.md)
|--src/ (Source .ts files)
    |--common/ (Common code reused across constructs)
        |--helpers
            |-- README.md (Documentation for helper functions)
            |-- *-helper.ts (Helper source file)
    |--cdk-lib/ (Constructs source files are here. These constructs are direct abstractions over L1 CDK Constructs, typically L2 Constructs)
        |--<module-name>
            |--index.ts (Construct source file)
            |--README.md (Construct documentation)
            |--perms.ts (permissions)
            |--<construct>.ts (various ts source files)
    |--patterns/gen-ai/ (Constructs source files are here. These constructs are higher level abstractions over L1 CDK Constructs, typically L3 Constructs)
        |--<module-name>
            |--index.ts (Construct source file)
            |--README.md (Construct documentation)
            |--perms.ts (permissions)
            |--<construct>.ts (various ts source files)
    |--index.ts (export constructs)
|--test/ (Source .ts test files)
    |--cdk-lib/ (Constructs unit test source files for cdk-lib)
    |--patterns/gen-ai/ (Constructs unit and integration tests source files are here for patterns)
        |--<module-name>
            |--<construct>.test.ts (Construct source test file)
            |--integ-tests/
                |--<testname>.integ.ts (Construct source integration test file)
    |--common (Common utilities source test files)
    |--integ/ (integration tests source files for cdk-lib constructs)
        |--<testname>.integ.ts (Construct source integration test file)

Commands you can use

You can get the list of all commands to run by running projen --help. The following tables summarizes the commands:

CommandDescription
projen buildFull release build
projen bumpBumps version based on latest git tag and generates a changelog entry
projen clobberhard resets to HEAD of origin and cleans the local repo
projen compatPerform API compatibility check against latest version
projen compileOnly compile
projen defaultSynthesize project files
projen docs:compileVerify documentation examples are correctly compiled
projen ejectRemove projen from the project
projen eslintRuns eslint against the codebase
projen generate-models-containersGenerate new list of models available from Jumpstart and DLC containers
projen installInstall project dependencies and update lockfile (non-frozen)
projen install:ciInstall project dependencies using frozen lockfile
projen integ:agent-mem:assertassert the snapshot of integration test 'agent-mem'
projen integ:agent-mem:deploydeploy integration test 'agent-mem' and capture snapshot
projen integ:agent-mem:destroydestroy integration test 'agent-mem'
projen integ:agent-mem:snapshotupdate snapshot for integration test "agent-mem"
projen integ:agent-mem:watchwatch integration test 'agent-mem' (without updating snapshots)
projen integ:aws-aoss-cw-dashboard:assertassert the snapshot of integration test 'aws-aoss-cw-dashboard'
projen integ:aws-aoss-cw-dashboard:deploydeploy integration test 'aws-aoss-cw-dashboard' and capture snapshot
projen integ:aws-aoss-cw-dashboard:destroydestroy integration test 'aws-aoss-cw-dashboard'
projen integ:aws-aoss-cw-dashboard:snapshotupdate snapshot for integration test "aws-aoss-cw-dashboard"
projen integ:aws-aoss-cw-dashboard:watchwatch integration test 'aws-aoss-cw-dashboard' (without updating snapshots)
projen integ:chatprompt:assertassert the snapshot of integration test 'chatprompt'
projen integ:chatprompt:deploydeploy integration test 'chatprompt' and capture snapshot
projen integ:chatprompt:destroydestroy integration test 'chatprompt'
projen integ:chatprompt:snapshotupdate snapshot for integration test "chatprompt"
projen integ:chatprompt:watchwatch integration test 'chatprompt' (without updating snapshots)
projen integ:graph:assertassert the snapshot of integration test 'graph'
projen integ:graph:deploydeploy integration test 'graph' and capture snapshot
projen integ:graph:destroydestroy integration test 'graph'
projen integ:graph:snapshotupdate snapshot for integration test "graph"
projen integ:graph:watchwatch integration test 'graph' (without updating snapshots)
projen integ:guardrails:assertassert the snapshot of integration test 'guardrails'
projen integ:guardrails:deploydeploy integration test 'guardrails' and capture snapshot
projen integ:guardrails:destroydestroy integration test 'guardrails'
projen integ:guardrails:snapshotupdate snapshot for integration test "guardrails"
projen integ:guardrails:watchwatch integration test 'guardrails' (without updating snapshots)
projen integ:inference-profiles:assertassert the snapshot of integration test 'inference-profiles'
projen integ:inference-profiles:deploydeploy integration test 'inference-profiles' and capture snapshot
projen integ:inference-profiles:destroydestroy integration test 'inference-profiles'
projen integ:inference-profiles:snapshotupdate snapshot for integration test "inference-profiles"
projen integ:inference-profiles:watchwatch integration test 'inference-profiles' (without updating snapshots)
projen integ:issue747:assertassert the snapshot of integration test 'issue747'
projen integ:issue747:deploydeploy integration test 'issue747' and capture snapshot
projen integ:issue747:destroydestroy integration test 'issue747'
projen integ:issue747:snapshotupdate snapshot for integration test "issue747"
projen integ:issue747:watchwatch integration test 'issue747' (without updating snapshots)
projen integ:issue991:assertassert the snapshot of integration test 'issue991'
projen integ:issue991:deploydeploy integration test 'issue991' and capture snapshot
projen integ:issue991:destroydestroy integration test 'issue991'
projen integ:issue991:snapshotupdate snapshot for integration test "issue991"
projen integ:issue991:watchwatch integration test 'issue991' (without updating snapshots)
projen integ:kendra-genai:assertassert the snapshot of integration test 'kendra-genai'
projen integ:kendra-genai:deploydeploy integration test 'kendra-genai' and capture snapshot
projen integ:kendra-genai:destroydestroy integration test 'kendra-genai'
projen integ:kendra-genai:snapshotupdate snapshot for integration test "kendra-genai"
projen integ:kendra-genai:watchwatch integration test 'kendra-genai' (without updating snapshots)
projen integ:prompt-router:assertassert the snapshot of integration test 'prompt-router'
projen integ:prompt-router:deploydeploy integration test 'prompt-router' and capture snapshot
projen integ:prompt-router:destroydestroy integration test 'prompt-router'
projen integ:prompt-router:snapshotupdate snapshot for integration test "prompt-router"
projen integ:prompt-router:watchwatch integration test 'prompt-router' (without updating snapshots)
projen integ:snapshot-allupdate snapshot for all integration tests
projen packageCreates the distribution package
projen package-allPackages artifacts for all target languages
projen package:dotnetCreate dotnet language bindings
projen package:goCreate go language bindings
projen package:jsCreate js language bindings
projen package:pythonCreate python language bindings
projen post-compileRuns after successful compilation
projen post-upgradeRuns after upgrading dependencies
projen pre-compilePrepare the project for compilation
projen releasePrepare a release from "main" branch
projen testRun tests
projen test:watchRun jest in watch mode
projen unbumpRestores version to 0.0.0
projen upgradeupgrade dependencies
projen watchWatch & compile in the background
projen completiongenerate completion script

Best practices

  • For contribution guidelines, follow CONTRIBUTING
  • For documentation, be concise, specific, and value dense. Write so that a new developer to this codebase can understand your writing, don’t assume your audience are experts in the topic/area you are writing about. Use the same structure as documentation for existing constructs in this repository. When adding new code snippets to READMEs, use TypeScript only and follow the instructions in DOCUMENTATION_TESTING. Write Comprehensive JSDoc/Descriptions (add documentation tags to the typescript code)
  • When building new constructs or updating existing ones, understand how the service resources are available through CloudFormation using the template reference and implemented in CDK using the api reference.
  • Understand how users are supposed to use the service and the steps involved, configuration, user flow, restrictions, ... using the documentation
  • Permissions should be extracted from the reference documentation if required
  • For restrictions related to typescript, consult ts restrictions. This ensure the construct's exported APIs will be correctly exported in other languages.
  • Follow the DESIGN_GUIDELINES
  • When implementing constructs logic:
    • Use shared utilities to avoid code duplication
    • Implement validators using the information from the documentation and help catch issues at synth time
    • Implement proper error handling

Task Completion Guidelines

These guidelines outline typical artifacts for different task types. Use judgment to adapt based on scope and context. Ensure you use the best practices mentioned above.

New constructs and new features

A complete feature typically includes:

  • Implementation: Build the feature
  • Unit tests: Comprehensive test coverage for new functionality
  • Documentation: Update relevant docs in the construct folder
  • Changeset: Describe the feature for release notes

Bug fixes

A complete bug fix typically includes:

  • Unit tests: Add tests that would fail without the fix (regression tests)
  • Implementation: Fix the bug
  • Manual verification: Run the tests and validate it works
  • Changeset: Describe what was broken and how it's fixed

Refactoring / Internal Changes

  • Unit tests for any changed behavior
  • No documentation needed for internal-only changes
  • Changeset only if it affects published packages

When to Deviate

These are guidelines, not rigid rules. Adjust based on:

  • Scope: Trivial fixes (typos, comments) may not need examples
  • Visibility: Internal changes may not need documentation
  • Context: Some changes span multiple categories

When uncertain about expected artifacts, ask for clarification.

Boundaries

  • NEVER modify directly a file which contains the string "Generated by projen". Use projen commands to interact with the codebase.
  • NEVER add new dependencies without asking first, and without adding them to the .projenrc.ts file.
  • ALWAYS run a full build when done with a task, this is to ensure all required files are generated before commit.
  • ALWAYS Ask first: Before modifying existing files in a major way.

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.