application-tracker / lambda-api
CLAUDE.md1 starsChanged 9 months agoMITView on GitHub
- Reads credentials
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Single-table design: All items share the lambda_api_applications table.
- Very specific: line 18
.envblocked by sandbox: Use .env.example as template. - Very specific: line 37
HttpApi: use aws-cdk-lib/aws-apigatewayv2 and aws-cdk-lib/aws-apigatewayv2-integrations — no alpha packages needed
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.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
Lambda + DynamoDB API Patterns
- Stack: TypeScript + Hono + AWS Lambda + DynamoDB; lambda-api port 5090, DB
lambda_api_applications(DynamoDB, NOT PostgreSQL) - Local dev approach: Same Hono app runs as local server (
server.tsvia@hono/node-server) and as Lambda handler (handler.tsviahono/aws-lambda) — no LocalStack needed - DynamoDB Local:
amazon/dynamodb-localDocker container on port 8000 (configurable viaDYNAMODB_PORTenv var in docker-compose.yml); start withdocker compose up -d dynamodb-local. Uses a bind mount (./data/dynamodb:/data) withuser: rootto avoid SQLite permission issues that occur with named Docker volumes. Thedata/directory is gitignored. - Table setup:
npm run migrate:lambda-apirunslambda-api/scripts/setup-dynamodb.ts(idempotent — skips if table exists). Data persists across container restarts via the bind mount. dotenv+ ESM module init order:tsxinjects.envAFTER module-level code runs.dynamodb.client.tscreates theDynamoDBClientat module load time, so it mustimport 'dotenv/config'as its first line — otherwiseDYNAMODB_ENDPOINTis unset and the client silently targets real AWS. Do not rely ondotenv.config()inserver.tsto cover this.GlobalSecondaryIndexhas noBillingModefield:BillingModeis a top-levelCreateTableCommandproperty only — do not set it on individual GSI definitions or TypeScript will reject the call.- Removing a stopped Docker container before deleting its volume:
docker volume rmfails with "volume is in use" even for stopped containers — rundocker rm <container>first, thendocker volume rm. - Single-table design: All items share the
lambda_api_applicationstable; item types distinguished by SK prefix (APP#,STAGE#,HIST#) - GSI1:
GSI1PK=STATUS#<status>#ARCHIVED#<0|1>/GSI1SK=UPDATED#<timestamp>#<id>— filter by status + archived, sort by updatedAt - GSI2:
GSI2PK=ACTIVE/GSI2SK=UPDATED#<timestamp>#<id>— all non-archived apps, sorted by updatedAt - Pagination: API contract uses offset-based pagination (
page/limit); DynamoDB scan + in-memory slice (appropriate at job-tracker scale). Cursor mode is opt-in: passcursorquery param ('start'or a base64-encoded{"page":N}token); response shape changes to{ items, limit, nextCursor, hasMore }(nototal). In the Zustand store, compute a synthetic total so pagination UI stays consistent:hasMore ? page * limit + 1 : (page - 1) * limit + items.length— never useitems.lengthalone or the total will reflect only the current page. - Cascade delete: Querying
PK=APP#<id>returns all related items (stages + history);DeleteCommandeach one - History sequence: Stored as atomic counter on the application item (
historySequence); incremented viaUpdateCommand ADD historySequence :incbefore writing HIST# items - Unit tests: Vitest; pure function tests (no Docker needed):
npm testin lambda-api/. API integration tests require DynamoDB Local running:npm run test:api:lambda-api hono/aws-lambdaimport: Built into the mainhonopackage (not a separate npm package); useimport { handle } from 'hono/aws-lambda'.envblocked by sandbox: Use.env.exampleas template; create.envmanually or rely on command-line env vars for CItsxIPC in sandbox:npx tsxrequires a Unix socket for hot-reload IPC which is blocked in sandbox; usedangerouslyDisableSandbox: trueornode --import tsx/esmas alternativedocs/types/lambda-api/api.mermaidis hand-maintained:ts-to-mermaidcannot resolvezod(runtime import, not a type-level dependency) — thedocs:types:lambda-apiscript was removed. Update the mermaid file manually whenapi.tstypes change.- Mermaid erDiagram syntax gotchas:
PK/FK/UKare reserved attribute key constraint tokens — usePartitionKey/SortKeyfor DynamoDB keys (lowercasepk/skalso fail; multi-letter names likeGSI1PKare fine). Avoid|inside quoted annotations (write0or1).nullable().optional()→type|null?;.optional()only →type?. classDiagram enum values with spaces need quotes ("given offer"); hyphenated values work unquoted. void asyncFn()in React event handlers:voiddiscards the promise, so rejections become unhandled. InonClick/onConfirmhandlers, use.catch()to surface errors (e.g.,asyncFn().catch(err => setError(...))) or wrap in an async IIFE with try/catch. When the handler has cleanup that must run regardless of outcome (e.g., closing a dialog), usetry/finallyso cleanup always executes. This applies to all lambda-react-ui async actions: API calls, store dispatches, CSV export/import.- Zustand load-by-ID stale state: When a store action loads a resource by ID (e.g.,
loadSelectedApplication), clear the previous value in the sameset()call that setsloading: true— otherwise the stale resource stays visible if the new fetch fails or if navigation happens faster than the previous load.
AWS CDK Patterns (cdk/)
- Stack: AWS CDK v2 (
aws-cdk-lib) +NodejsFunction(esbuild) +TableV2(DynamoDB) +HttpApi(API Gateway v2); CDK package lives atlambda-api/cdk/with its own isolatedpackage.json - CDK tsconfig must use
module: CommonJS: ts-node (used to run CDK apps) requires CJS — intentionally different from the parentlambda-api/tsconfig.jsonwhich uses ESM. UsemoduleResolution: "node"(not"bundler") esbuildmust be an explicit devDependency inlambda-api/cdk/package.json:NodejsFunctionrequires it at synth time. In a monorepo, don't rely on it being resolved from the parent'snode_modules— that's fragile if the parent ever removes itNodejsFunction.entrymust sit underprojectRoot(aws-cdk-lib ≥ 2.254) —projectRootdefaults to the nearest dir withpackage.json/lockfile (lambda-api/cdk/), so anentryof../../src/handler.tsfails synth/tests withPathNotUnderRoot. PassprojectRoot: path.join(__dirname, '../..')anddepsLockFilePath: path.join(__dirname, '../../package-lock.json')explicitly.aws-cdk-localv3 stripsAWS_*env vars: v3 (unlike v2) strips allAWS_*env vars before invokingcdk, then sets its own endpoint. Scripts likebootstrap:localshould just becdklocal bootstrap— don't setAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYinline, they'll be silently droppedTableV2→AWS::DynamoDB::GlobalTable: CDK'sTableV2synthesizes toAWS::DynamoDB::GlobalTable, notAWS::DynamoDB::Table. Use the correct type name in CDK assertions teststableNameis a CloudFormation token, not a literal:this.table.tableNameresolves to{ Ref: "ApplicationsTableXXXXXXXX" }at synth time. Assertions that expect a literal string (e.g.'lambda_api_applications') will fail — useMatch.anyValue()plus afindResourcescheck that the Ref contains'ApplicationsTable'- CDK subpackage needs its own
vitest.config.ts: the parentlambda-api/vitest.config.tshasinclude: ['src/**/*.test.ts']which missescdk/test/. Add avitest.config.tsinlambda-api/cdk/withinclude: ['test/**/*.test.ts'] cdk.out/must be gitignored: CDK writes synthesized CloudFormation templates tocdk.out/at synth/test time — add it to.gitignoreaws-cdkCLI version vsaws-cdk-libversion: these are on separate version tracks within the 2.x major; a mismatch in minor/patch is normal and not a problemHttpApi: useaws-cdk-lib/aws-apigatewayv2andaws-cdk-lib/aws-apigatewayv2-integrations— no alpha packages neededbrace-expansionDoS (GHSA-jxxr-4gwj-5jf2) is allowlisted incdk/.auditconfig.json:aws-cdk-libbundlesbrace-expansion@5.0.5(vulnerable; needs ≥ 5.0.6). npmoverridescannot reach bundled deps (see root CLAUDE.md), and noaws-cdk-librelease through 2.256.1 ships the patched version — so the parent-bump escape hatch is unavailable. Re-check on everyaws-cdk-libupgrade and remove the allowlist entry once a release bundlesbrace-expansion@5.0.6+.
In this repository28 other files it gives its agents.
- angular-spring-ui/CLAUDE.mdCLAUDE.md
- angular-ui/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- fastapi/CLAUDE.mdCLAUDE.md
- go-api/CLAUDE.mdCLAUDE.md
- hono-api/CLAUDE.mdCLAUDE.md
- nest-api/CLAUDE.mdCLAUDE.md
- nest-history-api/CLAUDE.mdCLAUDE.md
- nuxt-api/CLAUDE.mdCLAUDE.md
- rails-api/CLAUDE.mdCLAUDE.md
- spring-api/CLAUDE.mdCLAUDE.md
- svelte-ui/CLAUDE.mdCLAUDE.md
- tanstack-ui/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- vue-ui/CLAUDE.mdCLAUDE.md
- .github/agents/copilot-instructions.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- add-react-componentSkill
- add-react-hookSkill
- add-react-testSkill
- debugSkill
- document-featureSkill
- e2e-testSkill
- fix-buildSkill
- perf-auditSkill
- refactorSkill
- run-e2eSkill
- update-depsSkill
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.

