4 nodejs rules available
Kiro's Node.js rules are AWS service patterns: a long full-stack CDK/Lambda rule plus short SQS, S3 and DynamoDB rules. The steering file below covers Node.js Lambda handler code, scoped by fileMatchPattern.
Kiro, built and operated by AWS, uses steering files: Markdown documents in .kiro/steering/ that give the agent persistent project knowledge. Front matter controls when each file is included: always, when matching files are in context, manually by #name, or automatically by description. Kiro also includes AGENTS.md files.
.kiro/steering/nodejs.mdStarting point, not a tested configuration for your repository. Included when files matching fileMatchPattern are in context. Review the instructions, adapt the file paths and run your project's existing checks.
--- inclusion: fileMatch fileMatchPattern: ["**/*.js", "**/*.mjs", "**/*.cjs", "**/*.ts"] --- # Node.js instructions for Kiro ## Focus for this project - Use AWS SDK for JavaScript v3 modular clients and create them outside the handler so they are reused across invocations. - For SQS-triggered handlers, return batchItemFailures for failed messages instead of throwing for the whole batch, when the event source mapping enables ReportBatchItemFailures. - Make handlers idempotent: processing the same message twice must not duplicate side effects. ## Node.js conventions - Check "type" in package.json and the engines field: write ESM import syntax in "type": "module" packages and CommonJS otherwise, and only use APIs available in the declared Node.js version. - Import built-ins with the node: prefix (node:fs/promises, node:path) and never use synchronous fs calls on a request path. - Validate every request body, query string and environment variable at the boundary and fail fast on missing configuration. - Await or explicitly handle every promise; no floating promises and no unhandled rejections. ## Before you finish - Run the project's test script (node --test if no framework is configured), lint and type check and report the actual output. If you cannot run them, say so and list the exact commands instead of saying they pass. - Summarize which of the rules above affected the change. - When working from a spec, reference the task you are completing and do not mark it done until the checks above have run.
Create your own Kiro rules for Node.js and share with the community.
Ask for a small change to one matching file. Check the tool's loaded context or instruction view, inspect the diff for the requested convention, and run the relevant build or test. A well-formatted file does not guarantee the model follows every instruction.
Front matter must be at the very beginning of a steering file to be recognized. Kiro supports AGENTS.md. According to the steering docs, AGENTS.md files do not support inclusion modes and are always included, so keep scoped guidance in .kiro/steering/ files instead.
Documentation checked 2026-11-05: Kiro docs: SteeringKiro home page
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
You use Kiro to write a Lambda handler that consumes SQS messages and want partial batch failure handling and AWS SDK v3 clients.
Implement a handler that reads order messages from SQS and writes them to DynamoDB.
A typed handler with the DynamoDB client created at module scope, per-record try/catch collecting batchItemFailures, a conditional write for idempotency, and unit tests with mocked clients.
Content reviewed 2026-11-05. Confirm instruction activation in your installed client before relying on it.
Kiro steering for AWS-native apps with CDK: supported Lambda runtimes, NodejsFunction bundling, least-privilege grants, DynamoDB access patterns and safe Lambda handlers.