2 nextjs rules available
Both Kiro Next.js rules assume AWS hosting: a full-stack serverless rule and an App Router rule with Amplify. Kiro steering files with inclusion: fileMatch load only when matching files are in context, so this file stays out of CDK or Lambda work.
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/nextjs.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: ["app/**/*.ts", "app/**/*.tsx", "src/app/**/*.ts", "src/app/**/*.tsx"] --- # Next.js instructions for Kiro ## Focus for this project - Read environment variables only on the server and document each new one in the project's env example file. - Do not rely on a local filesystem for persistent data; use the configured AWS service (for example S3 or DynamoDB). - When a spec task adds a route, include its loading and error states in the same task. ## Next.js conventions - Check package.json for the Next.js major version and whether the project uses app/ (App Router) or pages/ (Pages Router); follow the router that already exists instead of mixing them. - Files under app/ are Server Components by default. Add "use client" only at the smallest component that needs state, effects, event handlers or browser APIs. - From Next.js 15, params, cookies() and headers() are asynchronous, and so is searchParams in page files: await them in pages, layouts, route handlers and generateMetadata. - Put API endpoints in route.ts files that export named HTTP-method functions (GET, POST, ...), and validate request bodies before using them. ## Before you finish - Run the project's lint script and next build (type errors and invalid route exports fail the build) 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 Next.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 build a Next.js app deployed with AWS Amplify Hosting and want server code that works in that environment.
Implement the spec task: add an uploads page that stores files in the existing S3 bucket.
A Server Component page, a Server Action or route handler that uploads via the AWS SDK client already configured, no secrets in client code, error states, and the build/test result.
Content reviewed 2026-11-05. Confirm instruction activation in your installed client before relying on it.
Kiro steering for Next.js App Router on AWS: Server Components, async params, validated Server Functions, and Amplify Hosting support limits to check before deploying.