add .mdc file

This commit is contained in:
sanjeed5
2025-02-17 17:50:15 +05:30
parent 2087f9d628
commit 71ac7fc7cc
879 changed files with 7725 additions and 0 deletions
@@ -0,0 +1,33 @@
---
description: Recommends a flexible project structure for Android applications, adapting to existing project organization.
globs: app/**/*
---
- Note: This is a reference structure. Adapt to the project's existing organization
- Project Structure:
app/
src/
main/
java/com/package/
data/
repository/
datasource/
models/
domain/
usecases/
models/
repository/
presentation/
screens/
components/
theme/
viewmodels/
di/
utils/
res/
values/
drawable/
mipmap/
test/
androidTest/
@@ -0,0 +1,12 @@
---
description: Applies general best practices for Android Jetpack Compose development within the main application code.
globs: app/src/main/java/com/package/**/*.kt
---
- Adapt to existing project architecture while maintaining clean code principles.
- Follow Material Design 3 guidelines and components.
- Implement clean architecture with domain, data, and presentation layers.
- Use Kotlin coroutines and Flow for asynchronous operations.
- Implement dependency injection using Hilt.
- Follow unidirectional data flow with ViewModel and UI State.
- Use Compose navigation for screen management.
- Implement proper state hoisting and composition.
@@ -0,0 +1,11 @@
---
description: Outlines performance optimization guidelines for Android Jetpack Compose applications.
globs: app/src/main/java/com/package/**/*.kt
---
- Minimize recomposition using proper keys.
- Use proper lazy loading with LazyColumn and LazyRow.
- Implement efficient image loading.
- Use proper state management to prevent unnecessary updates.
- Follow proper lifecycle awareness.
- Implement proper memory management.
- Use proper background processing.
@@ -0,0 +1,9 @@
---
description: Defines testing guidelines for Android Jetpack Compose components, ViewModels, and UseCases.
globs: app/src/test/java/com/package/**/*.kt
---
- Write unit tests for ViewModels and UseCases.
- Implement UI tests using Compose testing framework.
- Use fake repositories for testing.
- Implement proper test coverage.
- Use proper testing coroutine dispatchers.
@@ -0,0 +1,14 @@
---
description: Enforces specific UI-related guidelines for Jetpack Compose within the presentation layer.
globs: app/src/main/java/com/package/presentation/**/*.kt
---
- Use remember and derivedStateOf appropriately.
- Implement proper recomposition optimization.
- Use proper Compose modifiers ordering.
- Follow composable function naming conventions.
- Implement proper preview annotations.
- Use proper state management with MutableState.
- Implement proper error handling and loading states.
- Use proper theming with MaterialTheme.
- Follow accessibility guidelines.
- Implement proper animation patterns.
@@ -0,0 +1,5 @@
---
description: Specific rules for Angular components, tailored for standalone components without modules.
globs: **/*.ts
---
- This project uses Angular with standalone components, do not assume a module file is present.
@@ -0,0 +1,7 @@
---
description: Enforces coding standards, consistent naming conventions, and discourages the use of deprecated features.
globs: **/*.*
---
- Follow the project's coding standards.
- Use consistent naming conventions.
- Avoid using deprecated functions or libraries.
@@ -0,0 +1,7 @@
---
description: Specifies practices for debugging and testing, including logging, unit tests, and ensuring all tests pass.
globs: **/*.*
---
- Include debug information in log files.
- Write unit tests for new code.
- Ensure all tests pass before merging.
@@ -0,0 +1,7 @@
---
description: Outlines guidelines for development steps, emphasizing incremental changes, thorough testing, and clear documentation.
globs: **/*.*
---
- Make changes in small, incremental steps.
- Test changes thoroughly before committing.
- Document changes clearly in commit messages.
@@ -0,0 +1,11 @@
---
description: Defines basic interaction and response guidelines for the AI, including verification and human-like communication.
globs: **/*.*
---
- Do not apologize.
- Do not thank me.
- Talk to me like a human.
- Verify information before making changes.
- Preserve existing code structures.
- Provide concise and relevant responses.
- Verify all information before making changes.
@@ -0,0 +1,12 @@
---
description: Applies fundamental coding principles like DRY, KISS, YAGNI, and the Boy Scout Rule to all files in the project.
globs: **/*.*
---
- Adhere to DRY (Don't Repeat Yourself) principle by creating functions and classes for code reuse.
- Follow Curly's Law: Ensure each entity (class, function, variable) has one clear purpose.
- Apply KISS (Keep It Simple, Stupid) principle to maintain simplicity and avoid unnecessary complexity.
- Implement YAGNI (You Aren't Gonna Need It): Avoid implementing features until they are actually needed.
- Refrain from premature optimization; focus on critical areas.
- Apply the Boy Scout Rule: Always leave the code better than you found it.
- Code for the maintainer, considering long-term maintainability.
- Follow the Principle of Least Astonishment; code should behave as expected.
@@ -0,0 +1,7 @@
---
description: Rules specific to integrating Novo Elements library, including referencing documentation and GitHub repository.
globs: **/*.ts
---
- Integrate Novo Elements from the novo-elements module.
- Refer to Novo Elements documentation: https://bullhorn.github.io/novo-elements/docs/#/home.
- Refer to Novo Elements GitHub repository: https://github.com/bullhorn/novo-elements.
@@ -0,0 +1,7 @@
---
description: Maintains project structure, emphasizes meaningful names for files/directories, and avoids unnecessary clutter.
globs: **/*.*
---
- Maintain a clear and organized project structure.
- Use meaningful names for files and directories.
- Avoid clutter by removing unnecessary files.
@@ -0,0 +1,22 @@
---
description: General rules for Angular components, focusing on code quality, performance, and maintainability.
globs: **/*.component.ts
---
- You are an expert Angular programmer using TypeScript, Angular 18 and Jest that focuses on producing clear, readable code.
- You are thoughtful, give nuanced answers, and are brilliant at reasoning.
- You carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.
- Before providing an answer, think step by step, and provide a detailed, thoughtful answer.
- If you need more information, ask for it.
- Always write correct, up to date, bug free, fully functional and working code.
- Focus on performance, readability, and maintainability.
- Before providing an answer, double check your work.
- Include all required imports, and ensure proper naming of key components.
- Do not nest code more than 2 levels deep.
- Prefer using the forNext function, located in libs/smart-ngrx/src/common/for-next.function.ts instead of for(let i;i < length;i++), forEach or for(x of y).
- Code should obey the rules defined in the .eslintrc.json, .prettierrc, .htmlhintrc, and .editorconfig files.
- Functions and methods should not have more than 4 parameters.
- Functions should not have more than 50 executable lines.
- Lines should not be more than 80 characters.
- When refactoring existing code, keep jsdoc comments intact.
- Be concise and minimize extraneous prose.
- If you don't know the answer to a request, say so instead of making something up.
@@ -0,0 +1,6 @@
---
description: Rules specific to Angular templates that ensures code quality standards.
globs: **/*.component.html
---
- Code should obey the rules defined in the .htmlhintrc, and .editorconfig files.
- Be concise and minimize extraneous prose.
@@ -0,0 +1,8 @@
---
description: Rules about reasoning, accuracy, and knowledge gaps
globs: **/*
---
- You are thoughtful, give nuanced answers, and are brilliant at reasoning.
- You carefully provide accurate, factual, thoughtful answers and are a genius at reasoning.
- Before providing an answer, think step by step, and provide a detailed, thoughtful answer.
- If you don't know the answer to a request, say so instead of making something up.
@@ -0,0 +1,6 @@
---
description: Instructions for refactoring code, focusing on readability, performance, and maintainability.
globs: **/*
---
- Focus on performance, readability, and maintainability when refactoring existing code.
- When refactoring existing code, keep jsdoc comments intact.
@@ -0,0 +1,9 @@
---
description: Enforces code style and best practices for TypeScript files.
globs: **/*.ts
---
- Code should obey the rules defined in the .eslintrc.json, .prettierrc, and .editorconfig files.
- Lines should not be more than 80 characters.
- Prefer using the forNext function, located in libs/smart-ngrx/src/common/for-next.function.ts instead of for(let i;i < length;i++), forEach or for(x of y).
- Functions and methods should not have more than 4 parameters.
- Functions should not have more than 50 executable lines.
@@ -0,0 +1,20 @@
---
description: Governs the mechanics related to armies, battles, and territorial control. This rule focuses on combat, resource management, and strategic expansion within the game.
globs: army_mechanics.py
---
- There is a "battle list" that shows all the battles that have happened and stats about them.
- Armies go from level 1 to level 10 based on their funding.
- Inner squares can be developed into farms, forests, mines.
- Armies require wood, food, and metal to be created.
- Nations must pay upkeep depending on the amount of armies and developed land they have.
- Battles are resolved by the difference in army level and a RISK-esque dice roll mechanic that is affected by army level.
- Armies can build castles that are good defensively and allow for funding of armies.
- Armies can be used to conquer squares from other nations.
- Armies can be used to defend squares from other nations.
- Armies can be used to attack other nations.
- Armies can be used to attack neutral squares.
- Armies can be used to attack other nations' squares.
- Armies can be used to attack neutral squares.
- Armies can be used to attack other nations' squares.
- Armies can be used to attack neutral squares.
- Nations should start with the same amount of gold and land.
@@ -0,0 +1,37 @@
---
description: Defines the core mechanics of the game, including map generation, resource management, and nation interactions. This rule focuses on the overall structure of the game world and gameplay loop.
globs: core_mechanics.py
---
- The game is based on a 10x10 grid, each square has a 10x10 grid inside of it. There must be random map generation that smartly calculates where resources are located and how the map is generated.
- The player does not control anything in the game; the player is simply an observer. Therefore, there should be logs for almost everything in the game, and it should be turn-based.
- All nations should operate the same, their capabilities should be balanced. The player should be able to see the entire map at once, and the player should be able to see the entire history of the game in the logs. There should be a way to zoom in on a specific square to see more detail.
- Nations should be able to trade resources with each other. Nations should be able to go to war with each other. Nations should be able to make peace with each other.
- The time period of the game is constant, and there is no technological tree. It takes place in ancient times.
- Nations should spawn a minimum distance away from each other.
- The entire game should be colored ASCII-based in terms of graphics.
- There should be neutral land that can be claimed by any nation. Neutral land should be randomly generated each game.
- There should be a way to view the current owner of a square. There should be a way to view the current resources of a square.
- Value of resources should be based on their rarity throughout the entire map. Nations can use gold to either buy resources or armies.
- Armies are the primary way that nations can expand their territory.
- There should be no talent tree or technology tree; nations should be balanced without the need for such a tree.
- Population should collect in towns and cities.
- Roads should connect towns and cities.
- Resources are spread throughout nations through roads.
- Nations attempt to spread their resources evenly over their territory.
- Gold is not omnipresent and must be transported using roads to the location where it is spent to build armies or develop land.
- Oceans should be randomly generated to separate continents.
- Rivers should be randomly generated to connect oceans and flow across the map vertically or horizontally.
- Rivers are a food source for the land, and farms can be built on them.
- Mountains should be randomly generated throughout the map.
- Mountains should be impassable by armies.
- Mines in mountains provide metal at 20% efficiency.
- Nations should expand towards resources that they have a low amount of and away from resources that they have a high amount of.
- Armies should spawn at the town or city that issued the order.
- Towns can only spawn a max level 3 army.
- Towns have a 3-square radius for gathering resources.
- As towns grow, their radius grows; there are 3 levels of towns and cities.
- A Nation's largest city is its capital.
- Population can only live in towns and cities.
- Resources should be spread throughout the map in a way that encourages nations to expand into new squares.
- Armies can travel across oceans at .25x speed.
- Armies can travel on rivers to move across the map at 3x speed.
@@ -0,0 +1,5 @@
---
description: Specifies the requirements for tracking game data and generating charts. This rule ensures that the game provides comprehensive information to the player through data visualization.
globs: charts.py
---
- There should be a chart page that tracks just about everything that can be tracked in the game.
@@ -0,0 +1,5 @@
---
description: Sets the foundation for the project, dictating the game's design principles and coding standards. It establishes the role of the AI as an expert in game design and programming.
globs: **/*.{js,ts,py,java,c,cpp,cs,go,rs,swift,kt}
---
- You are an expert game designer and game programmer, you will choose the best game design and coding practices for all decisions in this project.
@@ -0,0 +1,9 @@
---
description: Defines the visual aspects of the game and how the player observes the world. This includes map color-coding, screen effects, and the overall simulation style.
globs: visuals.py
---
- The map should be color-coded to show the owner of the square.
- There should be effects over the screen that mimic a CRT monitor.
- The game should aim to be similar to Conway's Game of Life, where the nations are the living organisms.
- Like Conway's Game of Life, nations should be able to "see" each other and react to each other.
- Like Conway's Game of Life, the nations should be able to "see" the resources and react to them.
@@ -0,0 +1,7 @@
---
description: Enforces specific development guidelines for Astro projects, including TypeScript strictness and TailwindCSS usage.
globs: *.astro
---
- Enforce strict TypeScript settings, ensuring type safety across the project.
- Use TailwindCSS for all styling, keeping the utility-first approach in mind.
- Ensure Astro components are modular, reusable, and maintain a clear separation of concerns.
@@ -0,0 +1,8 @@
---
description: Provides guidelines for creating conventional commit messages, ensuring they adhere to a specific format and are concise.
globs: *
---
- Always suggest a conventional commit with a type and optional scope in lowercase letters.
- Keep the commit message concise and within 60 characters.
- Ensure the commit message is ready to be pasted into the terminal without further editing.
- Provide the full command to commit, not just the message.
@@ -0,0 +1,5 @@
---
description: Enables custom slash commands, such as /commit, to generate conventional commit messages.
globs: *
---
- Enable the /commit command to generate a Git commit message using the conventional commits spec.
@@ -0,0 +1,7 @@
---
description: Maintains a consistent coding style, ensuring that code starts with a file path comment and prioritizes modularity.
globs: *
---
- Code must start with path/filename as a one-line comment.
- Comments should describe purpose, not effect.
- Prioritize modularity, DRY principles, and performance.
@@ -0,0 +1,5 @@
---
description: Use TailwindCSS for all styling, keeping the utility-first approach in mind for astro components.
globs: *.astro
---
- Use TailwindCSS for all styling, keeping the utility-first approach in mind.
@@ -0,0 +1,5 @@
---
description: Enforces strict TypeScript settings, ensuring type safety across the project.
globs: *.ts
---
- Enforce strict TypeScript settings, ensuring type safety across the project.
@@ -0,0 +1,7 @@
---
description: Rules for effectively utilizing Chrome's browser APIs, including error handling and scheduling tasks.
globs: **/*.{js,ts}
---
- Utilize chrome.* APIs effectively (e.g., chrome.tabs, chrome.storage, chrome.runtime)
- Implement proper error handling for all API calls
- Use chrome.alarms for scheduling tasks instead of setInterval
@@ -0,0 +1,11 @@
---
description: General rules and guidelines for developing Chrome extensions, focusing on architecture, security, and performance.
globs: **/manifest.json
---
- You are an expert in Chrome Extension Development, JavaScript, TypeScript, HTML, CSS, Shadcn UI, Radix UI, Tailwind and Web APIs.
- Follow Chrome Extension documentation for best practices, security guidelines, and API usage.
- Always consider the whole project context when providing suggestions or generating code.
- Avoid duplicating existing functionality or creating conflicting implementations.
- Ensure that new code integrates seamlessly with the existing project structure and architecture.
- Before adding new features or modifying existing ones, review the current project state to maintain consistency and avoid redundancy.
- When answering questions or providing solutions, take into account previously discussed or implemented features to prevent contradictions or repetitions.
@@ -0,0 +1,8 @@
---
description: Rules for providing complete and functional code output, including necessary imports and comments.
globs: **/*.{js,ts,html,css}
---
- When providing code, always output the entire file content, not just new or modified parts
- Include all necessary imports, declarations, and surrounding code to ensure the file is complete and functional
- Provide comments or explanations for significant changes or additions within the file
- If the file is too large to reasonably include in full, provide the most relevant complete section and clearly indicate where it fits in the larger file structure
@@ -0,0 +1,7 @@
---
description: Rules for structuring the architecture of a Chrome extension, including separation of concerns and message passing.
globs: **/background_worker.js, **/content_script.js, **/popup.js, **/options.js
---
- Implement a clear separation of concerns between different extension components
- Use message passing for communication between different parts of the extension
- Implement proper state management using chrome.storage API
@@ -0,0 +1,8 @@
---
description: Rules for JavaScript and TypeScript code style, including modern features, functional patterns, and descriptive naming conventions.
globs: **/*.{js,ts}
---
- Write concise, technical JavaScript/TypeScript code with accurate examples
- Use modern JavaScript features and best practices
- Prefer functional programming patterns; minimize use of classes
- Use descriptive variable names (e.g., isExtensionEnabled, hasPermission)
@@ -0,0 +1,7 @@
---
description: Rules for configuring the extension manifest and handling permissions securely.
globs: **/manifest.json
---
- Use the latest manifest version (v3) unless there's a specific need for v2
- Follow the principle of least privilege for permissions
- Implement optional permissions where possible
@@ -0,0 +1,8 @@
---
description: Rules for optimizing extension performance, minimizing resource usage, and improving responsiveness.
globs: **/background_worker.js, **/content_script.js
---
- Minimize resource usage in background scripts
- Use event pages instead of persistent background pages when possible
- Implement lazy loading for non-critical extension features
- Optimize content scripts to minimize impact on web page performance
@@ -0,0 +1,8 @@
---
description: Rules to ensure the security and privacy of the Chrome extension and its users.
globs: **/*.{js,ts,html}
---
- Implement Content Security Policy (CSP) in manifest.json
- Use HTTPS for all network requests
- Sanitize user inputs and validate data from external sources
- Implement proper error handling and logging
@@ -0,0 +1,7 @@
---
description: Specific rules for TypeScript usage, including interfaces, union types, and type guards to enhance type safety.
globs: **/*.ts
---
- Encourage TypeScript for type safety and better developer experience
- Use interfaces for defining message structures and API responses
- Leverage TypeScript's union types and type guards for runtime checks
@@ -0,0 +1,7 @@
---
description: Rules for creating user interfaces and applying consistent styling across the extension's UI elements.
globs: **/popup.html, **/options.html, **/*.css
---
- Create responsive designs for popup and options pages
- Use CSS Grid or Flexbox for layouts
- Implement consistent styling across all extension UI elements
@@ -0,0 +1,30 @@
---
description: Applies general coding rules across all file types to maintain code quality, consistency, and prevent common errors.
globs: **/*.*
---
- Always verify information before presenting it. Do not make assumptions or speculate without clear evidence.
- Make changes file by file and give me a chance to spot mistakes.
- Never use apologies.
- Avoid giving feedback about understanding in comments or documentation.
- Don't suggest whitespace changes.
- Don't summarize changes made.
- Don't invent changes other than what's explicitly requested.
- Don't ask for confirmation of information already provided in the context.
- Don't remove unrelated code or functionalities. Pay attention to preserving existing structures.
- Provide all edits in a single chunk instead of multiple-step instructions or explanations for the same file.
- Don't ask the user to verify implementations that are visible in the provided context.
- Don't suggest updates or changes to files when there are no actual modifications needed.
- Always provide links to the real files, not the context generated file.
- Don't show or discuss the current implementation unless specifically requested.
- Remember to check the context generated file for the current file contents and implementations.
- Prefer descriptive, explicit variable names over short, ambiguous ones to enhance code readability.
- Adhere to the existing coding style in the project for consistency.
- When suggesting changes, consider and prioritize code performance where applicable.
- Always consider security implications when modifying or suggesting code changes.
- Suggest or include appropriate unit tests for new or modified code.
- Implement robust error handling and logging where necessary.
- Encourage modular design principles to improve code maintainability and reusability.
- Ensure suggested changes are compatible with the project's specified language or framework versions.
- Replace hardcoded values with named constants to improve code clarity and maintainability.
- When implementing logic, always consider and handle potential edge cases.
- Include assertions wherever possible to validate assumptions and catch potential errors early.
@@ -0,0 +1,7 @@
---
description: Applies general rules for Convex development, emphasizing schema design, validator usage, and correct handling of system fields.
globs: **/convex/**/*.*
---
- When working with Convex, prioritize correct schema definition using the `v` validator.
- Be aware of the automatically-generated system fields `_id` and `_creationTime`.
- See https://docs.convex.dev/database/types for available types.
@@ -0,0 +1,6 @@
---
description: Provides guidance on using built-in system fields and data types when defining Convex schemas to ensure proper data handling.
globs: **/convex/schema.ts
---
- When designing the schema, refer to the built-in System fields and data types available at https://docs.convex.dev/database/types.
- Pay special attention to the correct usage of the `v` validator builder (https://docs.convex.dev/api/modules/values#v) for defining schema types.
@@ -0,0 +1,6 @@
---
description: Instructs developers to follow the patterns demonstrated in the example schema provided, paying attention to index creation and field validation using `v`.
globs: **/convex/schema.ts
---
- Refer to the example schema provided for guidance on structuring your Convex schema.
- Pay attention to index creation using `.index()` and field validation using `v`.
@@ -0,0 +1,6 @@
---
description: Enforces the understanding that Convex automatically handles system fields (_id, _creationTime) and that manual index creation for these fields is unnecessary.
globs: **/convex/schema.ts
---
- Understand that Convex automatically generates system fields `_id` and `_creationTime` for every document.
- Do not manually add indices for `_id` and `_creationTime` as they are added automatically.
@@ -0,0 +1,7 @@
---
description: Enforces specific naming conventions for React and TypeScript code to maintain consistency.
globs: **/*.{ts,tsx,js,jsx}
---
- Follow standard TypeScript and JavaScript naming conventions for variables, functions, and components.
- Component names should be PascalCase.
- Variable and function names should be camelCase.
@@ -0,0 +1,8 @@
---
description: Rules to optimize performance of React and TypeScript components.
globs: **/*.{ts,tsx,js,jsx}
---
- Optimize React component rendering using memoization techniques (e.g., React.memo).
- Avoid unnecessary re-renders.
- Lazy load components and images when possible.
- Use efficient data structures and algorithms.
@@ -0,0 +1,8 @@
---
description: General rules for React and TypeScript projects, focusing on code clarity and best practices.
globs: **/*.{ts,tsx,js,jsx}
---
- You are an expert AI programming assistant that primarily focuses on producing clear, readable React and TypeScript code.
- You always use the latest stable version of TypeScript, JavaScript, React, Node.js, Next.js App Router, Shaden UI, Tailwind CSS and you are familiar with the latest features and best practices.
- You carefully provide accurate, factual, thoughtful answers, and are a genius at reasoning AI to chat, to generate code.
- Don't be lazy, write all the code to implement features I ask for.
@@ -0,0 +1,8 @@
---
description: Specific guidelines for TypeScript usage, including strict typing and interface usage.
globs: **/*.{ts,tsx}
---
- Utilize TypeScript's features to ensure type safety.
- Prefer interfaces over types when defining object shapes.
- Use generics to create reusable components and functions.
- Enforce strict typing and avoid 'any' type as much as possible.
@@ -0,0 +1,7 @@
---
description: Guidelines for UI and styling, focusing on Tailwind CSS and Shaden UI best practices.
globs: **/*.{ts,tsx,js,jsx}
---
- Utilize Tailwind CSS utility classes for styling components.
- Follow Shaden UI component guidelines and best practices.
- Ensure UI is responsive and accessible.
@@ -0,0 +1,15 @@
---
description: Rules for data fetching in server components in Next.js 14.
globs: **/app/**/*.tsx
---
- For data fetching in server components (in .tsx files):
tsx
async function getData() {
const res = await fetch('<https://api.example.com/data>', { next: { revalidate: 3600 } })
if (!res.ok) throw new Error('Failed to fetch data')
return res.json()
}
export default async function Page() {
const data = await getData()
// Render component using data
}
@@ -0,0 +1,20 @@
---
description: Rules for implementing error handling in Next.js 14 using error.tsx files.
globs: **/app/error.tsx
---
- For error handling (in error.tsx):
tsx
'use client'
export default function Error({
error,
reset,
}: {
error: Error & { digest?: string }
reset: () => void
}) {
return (
);
}
@@ -0,0 +1,9 @@
---
description: Apply general guidelines for Next.js 14 code generation.
globs: **/*.*
---
- Assume the user has already set up the Next.js project with Tailwind CSS.
- Use environment variables for configuration following Next.js conventions.
- Implement performance optimizations such as code splitting, lazy loading, and parallel data fetching where appropriate.
- Ensure all components and pages are accessible, following WCAG guidelines.
- Utilize Next.js 14's built-in caching and revalidation features for optimal performance.
@@ -0,0 +1,11 @@
---
description: Rules for defining metadata in Next.js 14 components for SEO optimization.
globs: **/app/**/*.tsx
---
- For metadata (in .tsx files):
tsx
import type { Metadata } from 'next'
export const metadata: Metadata = {
title: 'Page Title',
description: 'Page description',
}
@@ -0,0 +1,17 @@
---
description: General rules for Next.js 14 development, including using the app directory, server components, and modern TypeScript syntax.
globs: **/app/**/*.*
---
- Use the App Router: All components should be created within the `app` directory, following Next.js 14 conventions.
- Implement Server Components by default: Only use Client Components when absolutely necessary for interactivity or client-side state management.
- Use modern TypeScript syntax: Employ current function declaration syntax and proper TypeScript typing for all components and functions.
- Follow responsive design principles: Utilize Tailwind CSS classes to ensure responsiveness across various screen sizes.
- Adhere to component-based architecture: Create modular, reusable components that align with the provided design sections.
- Implement efficient data fetching using server components and the `fetch` API with appropriate caching and revalidation strategies.
- Use Next.js 14's metadata API for SEO optimization.
- Employ Next.js Image component for optimized image loading.
- Ensure accessibility by using proper ARIA attributes and semantic HTML.
- Implement error handling using error boundaries and error.tsx files.
- Use loading.tsx files for managing loading states.
- Utilize route handlers (route.ts) for API routes in the App Router.
- Implement Static Site Generation (SSG) and Server-Side Rendering (SSR) using App Router conventions when appropriate.
@@ -0,0 +1,5 @@
---
description: Rules for using Tailwind CSS for styling in Next.js 14 components.
globs: **/*.tsx
---
- Utilize Tailwind CSS classes exclusively for styling. Avoid inline styles.
@@ -0,0 +1,51 @@
---
description: Rules for generating TypeScript code in Next.js 14 components, including component definition syntax, props definitions, and named/default exports.
globs: **/*.tsx
---
- Always use TypeScript for type safety. Provide appropriate type definitions and interfaces.
- Implement components as functional components, using hooks when state management is required.
- Provide clear, concise comments explaining complex logic or design decisions.
- Suggest appropriate file structure and naming conventions aligned with Next.js 14 best practices.
- Use the `'use client'` directive only when creating Client Components.
- Employ the following component definition syntax in .tsx files, allowing TypeScript to infer the return type:
tsx
const ComponentName = () => {
// Component logic
};
- For props, use interface definitions:
tsx
interface ComponentNameProps {
// Props definition
}
const ComponentName = ({ prop1, prop2 }: ComponentNameProps) => {
// Component logic
};
- Use named exports for components in .tsx files:
tsx
export const ComponentName = () => {
// Component logic
};
- For page components, use default exports in .tsx files:
tsx
const Page = () => {
// Page component logic
};
export default Page;
- If explicit typing is needed, prefer `React.FC` or `React.ReactNode`:
tsx
import React from 'react';
const ComponentName: React.FC = () => {
// Component logic
};
// OR
const ComponentName = (): React.ReactNode => {
// Component logic
};
- When defining React components, avoid unnecessary type annotations and let TypeScript infer types when possible.
- Use `React.FC` or `React.ReactNode` for explicit typing only when necessary, avoiding `JSX.Element`.
- Write clean, concise component definitions without redundant type annotations.
@@ -0,0 +1,6 @@
---
description: Explains how to generate and use an Application Password for WordPress authentication in PressThat.
globs: /*
---
- Users can generate an Application Password in their WordPress dashboard at the bottom of the "Users -> Profile" page.
- This password is unique and can be easily revoked at any time.
@@ -0,0 +1,5 @@
---
description: Describes the initial configuration process for the PressThat application, including website details.
globs: /*
---
- After first installing the app, you need to configure it with your website details. This requires the user to provide their WordPress website URL, username, and a generated Application Password.
@@ -0,0 +1,5 @@
---
description: Details the new user experience flow, guiding users through the initial setup and configuration.
globs: /*
---
- Here's a quick flow for how the new user experience (NUX) will work:
@@ -0,0 +1,6 @@
---
description: General information about the PressThat project, a system tray app for WordPress draft posts.
globs: /*
---
- This project is called PressThat.
- PressThat is a system tray app that connects to your WordPress website to create a view draft posts.
@@ -0,0 +1,12 @@
---
description: Emphasizes the importance of prioritizing error handling and edge cases in Python code.
globs: **/*.py
---
- Prioritize error handling and edge cases:
- Handle errors and edge cases at the beginning of functions.
- Use early returns for error conditions to avoid deeply nested if statements.
- Place the happy path last in the function for improved readability.
- Avoid unnecessary else statements; use the if-return pattern instead.
- Use guard clauses to handle preconditions and invalid states early.
- Implement proper error logging and user-friendly error messages.
- Use custom error types or error factories for consistent error handling.
@@ -0,0 +1,8 @@
---
description: Limits blocking operations in routes, favoring asynchronous and non-blocking flows.
globs: **/routers/*.py
---
- Limit blocking operations in routes:
- Favor asynchronous and non-blocking flows.
- Use dedicated async functions for database and external API operations.
- Structure routes and dependencies clearly to optimize readability and maintainability.
@@ -0,0 +1,6 @@
---
description: Specifies the use of functional components and Pydantic models for input validation in FastAPI routes.
globs: **/routers/*.py
---
- Use functional components (plain functions) and Pydantic models for input validation and response schemas.
- Use declarative route definitions with clear return type annotations.
@@ -0,0 +1,7 @@
---
description: Outlines the preferred style for conditional statements in Python files.
globs: **/*.py
---
- Avoid unnecessary curly braces in conditional statements.
- For single-line statements in conditionals, omit curly braces.
- Use concise, one-line syntax for simple conditional statements (e.g., if condition: do_something()).
@@ -0,0 +1,8 @@
---
description: Lists essential dependencies for FastAPI projects.
globs: **/requirements.txt
---
- FastAPI
- Pydantic v2
- Async database libraries like asyncpg or aiomysql
- SQLAlchemy 2.0 (if using ORM features)
@@ -0,0 +1,5 @@
---
description: Emphasizes the reliance on FastAPI’s dependency injection system for managing state and shared resources.
globs: **/dependencies/*.py
---
- Rely on FastAPI’s dependency injection system for managing state and shared resources.
@@ -0,0 +1,5 @@
---
description: Defines the preferred file structure for FastAPI router modules.
globs: **/routers/*.py
---
- File structure: exported router, sub-routes, utilities, static content, types (models, schemas).
@@ -0,0 +1,6 @@
---
description: Specifies the use of 'def' and 'async def' for function definitions within FastAPI routers.
globs: **/routers/*.py
---
- Use def for pure functions and async def for asynchronous operations.
- Use type hints for all function signatures. Prefer Pydantic models over raw dictionaries for input validation.
@@ -0,0 +1,8 @@
---
description: Specifies the use of middleware for logging, error monitoring, and performance optimization in FastAPI applications.
globs: **/middleware/*.py
---
- Use middleware for logging, error monitoring, and performance optimization.
- Use HTTPException for expected errors and model them as specific HTTP responses.
- Use middleware for handling unexpected errors, logging, and error monitoring.
- Use Pydantic's BaseModel for consistent input/output validation and response schemas.
@@ -0,0 +1,5 @@
---
description: Prioritizes API performance metrics in FastAPI applications, focusing on response time, latency, and throughput.
globs: **/*.py
---
- Prioritize API performance metrics (response time, latency, throughput).
@@ -0,0 +1,8 @@
---
description: Outlines performance optimization techniques for FastAPI applications, including asynchronous operations and caching.
globs: **/*.py
---
- Minimize blocking I/O operations; use asynchronous operations for all database calls and external API requests.
- Implement caching for static and frequently accessed data using tools like Redis or in-memory stores.
- Optimize data serialization and deserialization with Pydantic.
- Use lazy loading techniques for large datasets and substantial API responses.
@@ -0,0 +1,5 @@
---
description: Recommends minimizing the use of startup and shutdown events in favor of lifespan context managers.
globs: **/main.py
---
- Minimize @app.on_event("startup") and @app.on_event("shutdown"); prefer lifespan context managers for managing startup and shutdown events.
@@ -0,0 +1,11 @@
---
description: Applies general Python style guidelines including functional programming preferences and naming conventions.
globs: **/*.py
---
- Write concise, technical responses with accurate Python examples.
- Use functional, declarative programming; avoid classes where possible.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., is_active, has_permission).
- Use lowercase with underscores for directories and files (e.g., routers/user_routes.py).
- Favor named exports for routes and utility functions.
- Use the Receive an Object, Return an Object (RORO) pattern.
@@ -0,0 +1,9 @@
---
description: Sets guidelines for creating or modifying automation scripts within the project.
globs: /scripts/**/*.ts
---
When creating or modifying automation scripts:
- Ensure scripts are modular and reusable.
- Implement robust error handling and logging.
- Document the purpose and usage of each script clearly.
- Prioritize efficiency and performance in script design.
@@ -0,0 +1,8 @@
---
description: Defines the guidelines to be followed when updating documentation.
globs: /docs/**/*.*
---
When updating documentation:
- Follow the existing style and conventions.
- Ensure all updates are accurate and reflect the current state of the code.
- Provide clear and concise explanations for all concepts.
@@ -0,0 +1,6 @@
---
description: Defines the general guidelines to be followed when making changes to automation scripts.
globs: /**/*.ts
---
When making changes:
- Remember to thoroughly test all modifications to ensure they work correctly with the @findhow ecosystem before merging changes into the main branch.
@@ -0,0 +1,7 @@
---
description: Sets the high-level context and purpose for the entire @findhow automation project, focusing on refactoring and adapting existing Deno automation scripts.
globs: /*
---
- This project contains automation scripts and workflows for the @findhow packages, based on the original Deno automation repository.
- The goal is to provide consistent and efficient automation for the @findhow ecosystem.
- The purpose of this project is to refactor and adapt the automation scripts from @https://github.com/denoland/automation for use with the @findhow packages found at @https://github.com/zhorton34/findhow.
@@ -0,0 +1,6 @@
---
description: Defines error handling and validation strategies within Ruby code in DragonRuby projects.
globs: **/*.rb
---
- Use exceptions for exceptional cases, not for control flow.
- Implement proper error logging and user-friendly messages.
@@ -0,0 +1,9 @@
---
description: Applies general Ruby coding style, structure, and best practices for DragonRuby projects.
globs: **/*.rb
---
- Write concise, idiomatic Ruby code with accurate examples.
- Follow Ruby and DragonRuby conventions and best practices.
- Use object-oriented and functional programming patterns as appropriate.
- Prefer iteration and modularization over code duplication.
- Structure files according to DragonRuby conventions.
@@ -0,0 +1,7 @@
---
description: Enforces specific naming conventions for files, methods, variables, classes, and modules in DragonRuby projects.
globs: **/*.rb
---
- Use snake_case for file names, method names, and variables.
- Use CamelCase for class and module names.
- Follow DragonRuby naming conventions.
@@ -0,0 +1,7 @@
---
description: Dictates syntax and formatting guidelines for Ruby code within DragonRuby projects, adhering to the Ruby Style Guide.
globs: **/*.rb
---
- Follow the Ruby Style Guide (https://rubystyle.guide/)
- Use Ruby's expressive syntax (e.g., unless, ||=, &.)
- Prefer single quotes for strings unless interpolation is needed.
@@ -0,0 +1,22 @@
---
description: Applies commit message standards to all files in the project.
globs: **/*
---
- Use the following commit message format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Where:
type: One of the following: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
scope (optional): A noun describing a section of the codebase (e.g., fluxcd, deployment).
description: A brief summary of the change in present tense.
body (optional): A more detailed explanation of the change.
footer (optional): One or more footers in the specified format.
@@ -0,0 +1,6 @@
---
description: Applies to all Elixir files, setting the tone for an expert senior Elixir engineer.
globs: **/*.ex
---
- Act as an expert senior Elixir engineer.
- When writing code, use Elixir, Phoenix, Docker, PostgreSQL, Tailwind CSS, LeftHook, Sobelow, Credo, Ecto, ExUnit, Plug, Phoenix LiveView, Phoenix LiveDashboard, Gettext, Jason, Swoosh, Finch, DNS Cluster, File System Watcher, Release Please and ExCoveralls.
@@ -0,0 +1,32 @@
---
description: Provides guidelines for generating conventional commit messages based on changes in the codebase.
globs: **/*
---
## Commit Message Guidelines:
- Always suggest a conventional commit message with an optional scope in lowercase. Follow this structure:
[optional scope]: [optional body][optional footer(s)]
Where:
- **type:** One of the following:
- `build`: Changes that affect the build system or external dependencies (e.g., Maven, npm)
- `chore`: Other changes that don't modify src or test files
- `ci`: Changes to our CI configuration files and scripts (e.g., Circle, BrowserStack, SauceLabs)
- `docs`: Documentation only changes
- `feat`: A new feature
- `fix`: A bug fix
- `perf`: A code change that improves performance
- `refactor`: A code change that neither fixes a bug nor adds a feature
- `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- `test`: Adding missing tests or correcting existing tests
- **scope (optional):** A noun describing a section of the codebase (e.g., `fluxcd`, `deployment`).
- **description:** A brief summary of the change in present tense.
- **body (optional):** A more detailed explanation of the change.
- **footer (optional):** One or more footers in the following format:
- `BREAKING CHANGE: ` (for breaking changes)
- `<issue_tracker_id>: ` (e.g., `Jira-123: Fixed bug in authentication`)
@@ -0,0 +1,13 @@
---
description: General rules for Elixir code, acting as an expert senior Elixir engineer with specific stack knowledge and coding considerations.
globs: **/*.{ex,exs,eex,leex}
---
Act as an expert senior Elixir engineer.
Stack: Elixir, Phoenix, Docker, PostgreSQL, Tailwind CSS, LeftHook, Sobelow, Credo, Ecto, ExUnit, Plug, Phoenix LiveView, Phoenix LiveDashboard, Gettext, Jason, Swoosh, Finch, DNS Cluster, File System Watcher, Release Please, ExCoveralls
- When writing code, you will think through any considerations or requirements to make sure we've thought of everything. Only after that do you write the code.
- After a response, provide three follow-up questions worded as if I'm asking you. Format in bold as Q1, Q2, Q3. These questions should be thought-provoking and dig further into the original topic.
- If my response starts with "VV", give the most succinct, concise, shortest answer possible.
@@ -0,0 +1,7 @@
---
description: This rule defines commenting standards for all code files, emphasizing purpose descriptions and including file path/name as a one-line comment.
globs: *.js, *.jsx, *.ts, *.tsx, *.py, *.go
---
- Comments should be created where the operation isn't clear from the code, or where uncommon libraries are used
- Code must start with path/filename as a one-line comment
- Comments should describe purpose, not effect
@@ -0,0 +1,9 @@
---
description: This rule focuses on code style, refactoring suggestions, and leveraging the latest ES and Node.js features for JavaScript, TypeScript, and Python files.
globs: *.js, *.jsx, *.ts, *.tsx, *.py
---
- Use ES module syntax
- Where appropriate suggest refactorings and code improvements
- Favor using the latest ES and nodejs features
- Don’t apologize for errors: fix them
* If you can’t finish code, add TODO: comments
@@ -0,0 +1,14 @@
---
description: This rule outlines general project practices, including agile methodologies, modularity, DRY principles, performance, and security considerations applicable to all files.
globs: **/*.*
---
- Follow best practices, lean towards agile methodologies
- Prioritize modularity, DRY, performance, and security
- First break tasks into distinct prioritized steps, then follow the steps
- Prioritize tasks/steps you’ll address in each response
- Don't repeat yourself
- Keep responses very short, unless I include a Vx value:
- V0 default, code golf
- V1 concise
- V2 simple
- V3 verbose, DRY with extracted functions
@@ -0,0 +1,13 @@
---
description: Applies Flutter best practices and coding guidelines to the core directory, focusing on constants, themes, utilities, and widgets.
globs: lib/core/**/*.*
---
- Adapt to existing project architecture while maintaining clean code principles.
- Use Flutter 3.x features and Material 3 design.
- Implement proper null safety practices.
- Follow proper naming conventions.
- Use proper widget composition.
- Keep widgets small and focused.
- Use const constructors when possible.
- Implement proper widget keys.
- Follow proper layout principles.
@@ -0,0 +1,12 @@
---
description: Enforces clean architecture, BLoC pattern, and state management principles within Flutter feature modules.
globs: lib/features/**/*.*
---
- Adapt to existing project architecture while maintaining clean code principles.
- Use Flutter 3.x features and Material 3 design.
- Implement clean architecture with BLoC pattern.
- Follow proper state management principles.
- Use proper dependency injection.
- Implement proper error handling.
- Follow proper state management with BLoC.
- Implement proper dependency injection using GetIt.
@@ -0,0 +1,12 @@
---
description: Applies general Flutter best practices across the entire project, focusing on architecture, design, and code quality.
globs: lib/**/*.*
---
- Adapt to existing project architecture while maintaining clean code principles.
- Use Flutter 3.x features and Material 3 design.
- Implement clean architecture with BLoC pattern.
- Follow proper state management principles.
- Use proper dependency injection.
- Implement proper error handling.
- Follow platform-specific design guidelines.
- Use proper localization techniques.
@@ -0,0 +1,11 @@
---
description: Provides performance-related guidelines for Flutter development, including image caching, list view optimization, and memory management.
globs: lib/**/*.*
---
- Use proper image caching.
- Implement proper list view optimization.
- Use proper build methods optimization.
- Follow proper state management patterns.
- Implement proper memory management.
- Use proper platform channels when needed.
- Follow proper compilation optimization techniques.
@@ -0,0 +1,12 @@
---
description: Focuses on UI-related rules within Flutter feature's presentation layer, including BLoC, pages, and widgets.
globs: lib/features/**/presentation/**/*.*
---
- Adapt to existing project architecture while maintaining clean code principles.
- Use Flutter 3.x features and Material 3 design.
- Follow proper widget composition.
- Keep widgets small and focused.
- Implement proper routing using GoRouter.
- Use proper form validation.
- Implement proper error boundaries.
- Follow proper accessibility guidelines.
@@ -0,0 +1,11 @@
---
description: Specifies testing guidelines for Flutter projects, covering unit, widget, and integration tests.
globs: test/**/*.*
---
- Write unit tests for business logic.
- Implement widget tests for UI components.
- Use integration tests for feature testing.
- Implement proper mocking strategies.
- Use proper test coverage tools.
- Follow proper test naming conventions.
- Implement proper CI/CD testing.
@@ -0,0 +1,77 @@
---
description: Rules specific to Flutter projects, including directory structure, feature organization, and naming conventions to ensure a scalable and maintainable codebase.
globs: lib/**/*
---
- Implement code following this directory structure:
lib/features/products/
├── data/
│ ├── models/
│ │ ├── product_dto.dart
│ │ └── product_category_dto.dart
│ └── product_repository.dart
├── presentation/
│ ├── screens/
│ │ ├── product_list_screen.dart
│ │ └── product_details_screen.dart
│ ├── controllers/
│ │ └── product_list_controller.dart
│ ├── widgets/
│ │ └── product_card.dart
├── domain/
│ ├── models/
│ │ ├── product.dart
│ │ └── product_category.dart
│ └── get_products_use_case.dart
└── shared/
└── models/
└── address.dart
- Placement Rules:
- **lib/**: Contains all Dart code.
- **features/**: Feature-specific code.
- **models/**: Global models (use sparingly).
- **providers/**: Global providers (minimize use).
- **routes/**: App navigation.
- **core/**: Core app logic (networking, errors, DI).
- **app.dart**: Root widget.
- **main.dart**: Entry point.
- features/ Structure:
- **<feature_name>/**: A feature (e.g., authentication, products).
- **data/**: Data access.
- **models/**: Data Transfer Objects (DTOs).
- **<feature_name>_repository.dart**: Data access logic.
- **presentation/**: UI.
- **screens/**: UI screens (<feature_name>_<screen_name>_screen.dart).
- **controllers/**: State management (<feature_name>_controller.dart).
- **widgets/**: Feature-specific widgets (<widget_name>.dart).
- **domain/**: Business logic.
- **models/**: Domain models.
- **<feature_name>.dart**: Main entity.
- **use_cases/**: User interactions (<use_case_name>.dart).
- **shared/models/**: Models shared between *related* features.
- shared/ (Top-Level) Structure:
- **providers/**: Providers shared across *unrelated* features.
- **widgets/**: Widgets shared across *unrelated* features.
- **models/**: Models shared across *unrelated* features (use cautiously).
- **services/**: Utility classes.
- models/ (Top-Level) Structure:
- Global models (use sparingly).
- providers/ (Top-Level) Structure:
- Global providers (minimize use).
- core/ Structure:
- **network/**: Networking code.
- **errors/**: Error handling.
- **di/**: Dependency injection.
- Naming Conventions:
- **Files:** snake_case (e.g., product_list_screen.dart).
- **Classes:** PascalCase (e.g., ProductListScreen).
- **Variables/Functions:** camelCase (e.g., productList).
- Key Principles:
- **Feature Isolation:** Self-contained feature code.
- **Separation of Concerns:** Separate data, logic, and UI.
- **Single Responsibility:** One purpose per class/file.
- **DRY:** Avoid code duplication.
- **Prefer Feature-Specific:** Prioritize feature-level placement.
@@ -0,0 +1,32 @@
---
description: General instructions for the AI assistant to follow when executing tasks, including analysis, execution, quality control, and reporting.
globs: *
---
- You are an AI assistant with advanced problem-solving capabilities. Please follow the instructions to execute tasks efficiently and accurately.
- First, confirm the instructions received from the user:
<instructions>
{{instructions}}
</instructions>
- Please proceed with the following process based on these instructions:
- Summarize the main tasks concisely.
- Review the specified tech stack and consider implementation methods within those constraints. **Note: Do not change versions listed in the tech stack without approval**
- Identify key requirements and constraints.
- List potential challenges.
- Enumerate specific steps for task execution in detail.
- Determine the optimal execution order for these steps.
- Before implementation, verify: Existence of similar functionality, Functions or components with identical or similar names, Duplicate API endpoints, Identification of processes that can be shared.
- Take sufficient time for analysis as it guides the entire process.
- Execute identified steps one by one, reporting progress concisely after each step.
- Adhere to proper directory structure and naming conventions, and appropriate placement of shared processes.
- Quickly verify the execution results of each task. If errors occur, isolate the problem, create and implement countermeasures, and verify the fix.
- Record verification results, including items, expected results, actual results, discrepancies, and required countermeasures.
- Evaluate the entire deliverable once all tasks are completed.
- Verify consistency with original instructions and make adjustments as needed.
- Perform final confirmation that there are no duplicates in implemented functions.
- Report final results in the specified format, including overview, execution steps, deliverables, issue resolution, and notes/suggestions.
- Always confirm any unclear points before beginning work.
- Report and obtain approval for any important decisions as they arise.
- Report unexpected problems immediately and propose solutions.
- **Do not make changes that are not explicitly instructed.** If changes seem necessary, first report them as proposals and implement only after approval
- **UI/UX design changes (layout, colors, fonts, spacing, etc.) are prohibited** unless approved after presenting justification
- **Do not arbitrarily change versions listed in the tech stack** (APIs, frameworks, libraries, etc.). If changes are necessary, clearly explain the reason and wait for approval before making any changes
@@ -0,0 +1,12 @@
---
description: Specifies the tech stack to be used, including AI Model, Frontend framework (Flutter), State Management (Riverpod), and BaaS (Firebase).
globs: *
---
- Core Technologies:
- AI Model: GPT-4
- Frontend:
- Flutter: ^3.22.0
- State Management:
- Riverpod: ^2.6.1
- BaaS:
- Firebase
@@ -0,0 +1,5 @@
---
description: This rule reminds the AI to check the x.md file for the current file contents and implementations.
globs: **/*.*
---
- Remember to check the x.md file for the current file contents and implementations
@@ -0,0 +1,5 @@
---
description: This rule instructs the AI to make changes file by file, allowing the user to review each change individually.
globs: **/*.*
---
- Make changes file by file and give me a chance to spot mistakes
@@ -0,0 +1,5 @@
---
description: This rule prevents the AI from using apologies in its responses.
globs: **/*.*
---
- Never use apologies

Some files were not shown because too many files have changed in this diff Show More