nextjs-typescript-tailwind-cursorrules-prompt-file — Cursor rule
A Cursor rule that hands the agent the conventions of a Next.js, TypeScript and Tailwind CSS project. Useful when new code has to match what is already there.
.cursor/rules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdcWhat nextjs-typescript-tailwind-cursorrules-prompt-file does
The file maps out Astral, a block explorer for the Autonomys network written in Next.js and TypeScript. It names the parts of the codebase: reusable components, the App directory for routing, custom hooks for state. The agent reads that map before writing anything.
Development guidelines come next. TypeScript for type safety, the ESLint config as the coding standard, responsive and accessible components, Tailwind CSS for styling against a defined palette. A separate section covers how the AI should behave: favour TypeScript and React practice, keep new components reusable and shaped like the existing ones, skip generated comments in favour of clear names, validate input and handle errors. A glossary of network terms and links to the Next.js, TypeScript, Tailwind and React docs round it out.
The rule targets globs: **/* with alwaysApply: false, so nothing happens until you attach it yourself. Much of the text is tied to one project — the Astral and Autonomys names, their URLs, their vocabulary. On your own repo those sections need rewriting, or the agent will carry someone else's names into your code.
What it helps with
- explain a Next.js folder layout to the agent
- keep generated components typed with TypeScript
- hold styling inside Tailwind CSS
- get reusable components instead of one-off ones
- add input validation and error handling to new code
Example prompts for the agent
- Create a transaction card component in the Components folder, style it with Tailwind
- Add a custom hook that fetches data and type its return value
- Rewrite this component so it is responsive and accessible
How to install nextjs-typescript-tailwind-cursorrules-prompt-file
Manually: put the files in place
.cursor/rules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/nextjs-typescript-tailwind-cursorrules-prompt-file.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdManually: put the files in place
.clinerules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about nextjs-typescript-tailwind-cursorrules-prompt-file
How do I install nextjs-typescript-tailwind-cursorrules-prompt-file in Cursor?
Create the file .cursor/rules/nextjs-typescript-tailwind-cursorrules-prompt-file.mdc and paste the rule contents into it.
What does this rule do?
It gives the Cursor agent context about a Next.js and TypeScript project: folder structure, typing requirements, Tailwind CSS styling and code generation guidelines.
Why doesn't the rule apply on its own?
It sets alwaysApply: false, so you have to enable it manually for the files or prompts you want it to cover.
Source text
nextjs-typescript-tailwind-cursorrules-prompt-file.mdc · CC0-1.0
--- description: "Cursor rules for Next.js development with TypeScript and Tailwind CSS integration." globs: **/* alwaysApply: false --- # Project Overview This project, named Astral, the Block Explorer of Autonomys network, is built using Next.js and TypeScript. It integrates various libraries for state management, UI components, and data fetching. # Key URLs - Astral Block Explorer: https://explorer.autonomys.xyz/ - GitHub Repository: https://github.com/autonomys/astral - Autonomys: https://autonomys.xyz/ - Academy: https://academy.autonomys.xyz/ - Documentation: https://docs.autonomys.xyz/ # Project Structure - **Components**: Contains reusable UI components. - **App**: Next.js app for routing. - **Hooks**: Custom React hooks for state management. # Development Guidelines - Use TypeScript for type safety. - Follow the coding standards defined in the ESLint configuration. - Ensure all components are responsive and accessible. - Use Tailwind CSS for styling, adhering to the defined color palette. # Important Scripts - `dev`: Starts the development server. - `build`: Builds the application for production. # AI Interaction Guidelines - When generating code, prioritize TypeScript and React best practices. - Ensure that any new components are reusable and follow the existing design patterns. - Minimize the use of AI generated comments, instead use clearly named variables and functions. - Always validate user inputs and handle errors gracefully. - Use the existing components and pages as a reference for the new components and pages. # Lexicon of Terms and Concepts - **H+AI (Human + Artificial Intelligence)**: The collaboration between humans and AI to enhance capabilities and ensure a harmonious coexistence. - **Autonomys Network**: A decentralized network designed to provide infrastructure for AI-powered decentralized applications (dApps). - **deAI Ecosystem**: A stack of components that includes distributed storage, compute, and a dApp/agent layer for building and deploying AI applications. - **Distributed Storage**: A system ensuring data integrity and availability for AI-related data. - **Distributed Compute**: Scalable computational resources for AI training and inference. - **dApp (Decentralized Application)**: Applications that run on a decentralized network, providing enhanced security and transparency. # Additional Resources - [Next.js Documentation](https://nextjs.org/docs) - [TypeScript Handbook](https://www.typescriptlang.org/docs/) - [Tailwind CSS Documentation](https://tailwindcss.com/docs) - [React Documentation](https://reactjs.org/docs/getting-started.html) - [Autonomys Overview](https://autonomys.xyz/)
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules