Awesome Cursor Rules Collection

Showing 1105-1116 of 2626 matches

Python
Instructions for Prompt
- App purpose: a user can submit a simple form to extract Telegram Groups (the user is admin or member) or Contacts (the user has in Telegram Contacts or has a DM with)
- When asking to create a new file, always mention where (folder or root)
- We use JavaScript (js, jsx, json), not TypeScript

Keep in mind:
- We are using Supabase and Vercel
- Supabase bases are set (users/Groups/Contacts)
- Vercel is set and ready to render any update
- For this MVP, we don't implement any login/auth logic yet
- It's an MVP with restricted access for testing
- We must always respect Telegram API TOS, rates, and limitations: THIS IS CRUCIAL
- On a 'form' page, the user submits API ID, API Hash, and Phone number
- These details are used to call Telegram API to get corresponding records
- The user selects Extract groups or Extract contacts, then clicks on fetch data
- Redirection to a new Page (Groups List or Contacts List) occurs after fetching data
- On the list pages, the user can select records and download a CSV

Current Issues:
- ReferenceError: apiId is not defined (in TelegramManager component)
- Warnings about missing Supabase environment variables during build
- Import path issues (need to use '@' alias consistently)

Next Steps:
1. Fix TelegramManager component
2. Address Supabase environment variable warnings
3. Review and fix import issues
4. Simplify current implementation to get basic form submission and redirection working

Development Approach:
- Work in short sprints (2-3 hours max per sprint)
- Focus on one issue at a time
- Test thoroughly after each change

Version Control and Deployment:
- We only have the main branch
- Use 'git push origin main' when pushing changes
- Use 'vercel --prod' for deploying to Vercel

Progress Made Today:
- Fixed TelegramManager component to handle form submission correctly
- Addressed Supabase environment variable warnings by updating the supabase.js file
- Reviewed and fixed import issues, ensuring consistent use of '@' alias
- Simplified the implementation to get basic form submission working
- Added error handling and loading states to the TelegramManager component

Challenges Faced:
- Encountered issues with Vercel deployment due to serverless function size limit
- ReferenceError: apiId is not defined (in TelegramManager component) - Resolved
- Import path inconsistencies - Resolved

Still Needs to be Done:
1. Resolve the Vercel deployment issue: "Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB. : https://vercel.link/serverless-function-size"
2. Implement redirection to Groups List or Contacts List page after successful data fetching
3. Develop the Groups List and Contacts List components
4. Implement CSV download functionality for selected records
5. Add more robust error handling and user feedback
6. Optimize the application for better performance
7. Conduct thorough testing of all features and edge cases

Next Steps:
1. Investigate and resolve the Vercel deployment size issue
2. Implement the redirection logic after successful form submission
3. Create the Groups List and Contacts List components
4. Add CSV generation and download functionality
c
css
cython
java
javascript
less
powershell
python
+5 more
elpiarthera/tg-groups-contacts-manager

Used in 1 repository

Python
# Coding conventions used in this project

#

Cursor rules are in CONVENTIONS.\*, before doing anythign else. Adding them to the context

For CLIs, use a Typer app.
Use `ic` for logging.
Use Rich for pretty printing.
Use Loguru for logging.
Use Typer for CLI apps.
Use Pydantic for data validation.
Use types; when using types, prefer using built-ins like `foo | None` vs `foo: Optional[str]`.
When using Typer, use the latest syntax for arguments and options.

```python
    name: Annotated[Optional[str], typer.Argument()] = None
    def main(name: Annotated[str, typer.Argument()] = "Wade Wilson"):
    lastname: Annotated[str, typer.Option(help="Last name of person to greet.")] = "",
    formal: Annotated[bool, typer.Option(help="Say hi formally.")] = False,
```

### Code Style

Prefer returning from a function vs nesting ifs.
Prefer descriptive variable names over comments.
Avoid nesting ifs, return from functions as soon as you can

### Types

Use types whenever possible.
Use the latest syntax for types (3.12)
Don't use tuples, define pydantic types for return values. Call Them FunctionReturn for the function name
<examples>
For a Single Item Return
Function: get_user_profile()
Return Type: UserProfileResponse
For Multiple Items
Function: list_users()
Return Type: UserListResponse or PaginatedUsersResponse
For Aggregated Data
Function: get_sales_summary()
Return Type: SalesSummaryResult
For Nested or Composite Data
Function: get_order_details()
Return Type: OrderDetailsResponse (which may include nested models like ProductInfo or ShippingDetails).
</examples>

### Testing

When possible update the tests to reflect the new changes.
Tests are in the test directory

### Running Tests

When running pytest, use auto mode with pytest-xdist to parallelize test execution:

```bash
pytest -n auto
```

This automatically detects the optimal number of CPU cores and distributes tests accordingly.

For debugging specific tests, run without -n flag:

```bash
pytest test_specific.py -v
```

### TUI Applications

When creating TUI (Text User Interface) applications:

- Use Textual library for TUI apps
- Include standard key bindings:
  ```python
  BINDINGS = [
      Binding("q", "quit", "Quit"),
      Binding("j", "move_down", "Down"),
      Binding("k", "move_up", "Up"),
      Binding("?", "help", "Help")
  ]
  ```
- Include a Help screen modal that shows available commands
- Use DataTable for tabular data display:

  - When accessing DataTable columns, handle ColumnKey objects by stripping wrapper text:
    ```python
    columns = [str(col).replace("ColumnKey('", "").replace("')", "")
              for col in table.columns.keys()]
    ```
  - Always include a key parameter when adding rows for selection tracking
  - Implement row selection handlers with `on_data_table_row_selected`

- For modal screens:

  - Inherit from ModalScreen
  - Include proper styling in on_mount:
    ```python
    def on_mount(self) -> None:
        container = self.query_one(Container)
        container.styles.align = ("center", "middle")
        container.styles.height = "auto"
        container.styles.width = "auto"
        container.styles.background = "rgba(0,0,0,0.8)"
        container.styles.padding = (2, 4)
        container.styles.border = ("solid", "white")
    ```
  - Use Container for layout management
  - Include proper error handling with loguru
  - Follow this structure for the main app:

    ```python
    class MyTUIApp(App):
        # Define bindings
        # Define compose() for layout
        # Define action methods for commands

    @app.command()
    def browse():
        """Browse data in an interactive TUI"""
        app = MyTUIApp()
        app.run()

    @logger.catch()
    def app_wrap_loguru():
        app()
    ```

### TUI Applications

When creating TUI (Text User Interface) applications:

- Use Textual library for TUI apps
- Include standard key bindings:
  ```python
  BINDINGS = [
      Binding("q", "quit", "Quit"),
      Binding("j", "move_down", "Down"),
      Binding("k", "move_up", "Up"),
      Binding("?", "help", "Help")
  ]
  ```
- Include a Help screen modal that shows available commands
- Use DataTable for tabular data display
- Use Static widgets for text display areas
- Use Container for layout management
- Include proper error handling with loguru
- Follow this structure for the main app:

  ```python
  class MyTUIApp(App):
      # Define bindings
      # Define compose() for layout
      # Define action methods for commands

  @app.command()
  def browse():
      """Browse data in an interactive TUI"""
      app = MyTUIApp()
      app.run()

  @logger.catch()
  def app_wrap_loguru():
      app()
  ```

### Debugging

When debugging, use the `ic` library:

- Import ic at the top of files:

  ```python
  from icecream import ic
  ```

- Use ic() to debug variables and expressions:

  ```python
  # Basic variable inspection
  ic(my_variable)

  # Multiple variables
  ic(var1, var2, calculation_result)

  # Expressions
  ic(table.columns, table.row_count)

  # Objects and their properties
  ic(details.render()._renderable)

  # Before/after state changes
  ic("Before action:", current_state)
  action()
  ic("After action:", new_state)
  ```

- For test debugging, combine ic with print statements for context:

  ```python
  print("\nDEBUG: Starting test")
  ic(test_object)

  # Show test progress
  print("\nDEBUG: After action")
  ic(result)
  ```

- When debugging async code, mark important points:
  ```python
  ic("Before await")
  await async_operation()
  ic("After await")
  ```

### Testing TUI Applications

When testing Textual TUI applications:

- Use pytest-asyncio and mark tests:

  ```python
  pytestmark = pytest.mark.asyncio
  ```

- Include standard test fixtures:

  ```python
  @pytest.fixture
  async def app():
      """Create test app instance."""
      return MyTUIApp()
  ```

- Use app.run_test() context manager:

  ```python
  async def test_something(app):
      async with app.run_test() as pilot:
          # Test code here
  ```

- Add comprehensive debugging:

  ```python
  # Debug widget tree
  print(f"DEBUG: App widgets: {app.query('*')}")

  # Debug specific components
  table = app.query_one(DataTable)
  print(f"Table properties: {table.columns}")

  # Debug events and state changes
  print(f"Before action: {current_state}")
  await pilot.press("key")
  print(f"After action: {new_state}")
  ```

- Test widget queries and selections:

  ```python
  table = app.query_one(DataTable)
  details = app.query_one("#details", Static)
  ```

- Allow time for UI updates:

  ```python
  await pilot.pause()
  ```

- Test modal screens:

  ```python
  await pilot.press("?")  # Open modal
  assert isinstance(app.screen, HelpScreen)
  await pilot.press("escape")  # Close modal
  ```

- Test DataTable operations:

  - Extract column information:
    ```python
    columns = [str(col).replace("ColumnKey('", "").replace("')", "")
              for col in table.columns.keys()]
    ```
  - Test row selection:
    ```python
    table.move_cursor(row=0)
    table.action_select_cursor()
    ```

- Include error handling in tests:

  ```python
  try:
      # Test code
  except Exception as e:
      print(f"DEBUG: Test failed with error: {e}")
      print(f"App state: {app.query('*')}")
      raise
  ```

- Test keyboard navigation:

  ```python
  await pilot.press("j")  # Down
  await pilot.press("k")  # Up
  await pilot.press("q")  # Quit
  ```

- Verify widget content:
  ```python
  content = widget.render()._renderable
  assert "expected text" in str(content)
  ```

### Tony VAPI Configuration

To get the latest Tony VAPI configuration settings:

```bash
tony export-vapi-tony-config
```

This command exports the current configuration which can be used as a reference for updating `tony_assistant_spec.json`. Key configuration areas include:

- Voice settings (voiceId, provider, stability, similarityBoost)
- Model configuration (model, maxTokens, temperature)
- Server and client message types
- End call settings and phrases
- Transcriber configuration
- Analysis plan settings

When updating the configuration, ensure compatibility between the exported settings and your local `tony_assistant_spec.json`.

- Use `uv` instead of `pip` for package management.
- Ensure to update dependencies in `pyproject.toml` when adding new packages or updating existing ones.

### Fixing Tests

When fixing tests, the goal is to be as efficient as possible. Here are some guidelines:

- **Unit Tests First**: Ensure unit tests pass before moving on to integration tests.
- **Integration Before E2E**: Run integration tests before end-to-end tests to catch issues early.
- **Parallel Execution**: Run tests in parallel to save time.
- **Iterate on Failing Tests**: If iterating on a failing test, only run that specific test instead of the entire suite.
  - Example: Use `pytest tests/unit/test_specific.py -v` to run a specific unit test.
  - For integration tests, use `pytest tests/integration/test_specific.py -v`.
  - For end-to-end tests, use `pytest tests/e2e/test_specific.py -v`.

### Git Commit Messages

When creating git commit messages:

- Use multi-line messages for meaningful commits
- First line is a summary (50 chars or less) starting with type: (e.g., "feat:", "fix:", "test:")
- Leave a blank line after the summary
- Follow with bullet points of specific changes

Since the tools don't support direct newlines, use $' syntax with \n for multi-line messages:

```bash
git commit -m $'feat: Add new feature\n\n- Add X functionality\n- Update Y module\n- Fix Z issue'
```

Types for the summary line:

- feat: New feature
- fix: Bug fix
- test: Adding or updating tests
- docs: Documentation only changes
- refactor: Code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code
- chore: Changes to the build process or auxiliary tools

### Git Commit Best Practices

Before committing changes:

1. Review modified files using file reading capabilities rather than git diff
2. Run tests to ensure they pass, following the test instructions above:
   - Run unit tests first
   - Use parallel execution with `pytest -n auto`
   - For iterating on specific tests, use the test file path:
     ```bash
     # Example: Run only the specific test you're working on
     pytest tests/integration/test_specific.py -v -k test_name
     ```
3. Run `git status` to review all modified files
4. Verify that only intended files are included
5. Use `git add` to stage specific files rather than `git add .`
6. Double-check staged files with `git status` again before committing
7. For multi-file changes, ensure all related files are included (e.g., both implementation and tests)
8. Exclude temporary files, logs, and other unrelated changes
express.js
golang
just
less
nestjs
python
solidjs

First seen in:

idvorkin/tony_tesla

Used in 1 repository

TypeScript
Use `pnpm` package manager as default option.
css
javascript
less
next.js
npm
pnpm
typescript
dimaportenko/shopify-nextjs

Used in 1 repository

HTML

    You are a senior Blazor and .NET developer, experienced in C#, ASP.NET Core, and Entity Framework Core. You also use Visual Studio Enterprise for running, debugging, and testing your Blazor applications.
  
    ## Workflow and Development Environment
    - All running, debugging, and testing of the Blazor app should happen in Visual Studio Enterprise.
    - Code editing, AI suggestions, and refactoring will be done within Cursor AI.
    - Recognize that Visual Studio is installed and should be used for compiling and launching the app.
  
    ## Blazor Code Style and Structure
    - Write idiomatic and efficient Blazor and C# code.
    - Follow .NET and Blazor conventions.
    - Use Razor Components appropriately for component-based UI development.
    - Prefer inline functions for smaller components but separate complex logic into code-behind or service classes.
    - Async/await should be used where applicable to ensure non-blocking UI operations.
  
    ## Naming Conventions
    - Follow PascalCase for component names, method names, and public members.
    - Use camelCase for private fields and local variables.
    - Prefix interface names with "I" (e.g., IUserService).
  
    ## Blazor and .NET Specific Guidelines
    - Utilize Blazor's built-in features for component lifecycle (e.g., OnInitializedAsync, OnParametersSetAsync).
    - Use data binding effectively with @bind.
    - Leverage Dependency Injection for services in Blazor.
    - Structure Blazor components and services following Separation of Concerns.
    - Use C# 10+ features like record types, pattern matching, and global usings.
  
    ## Error Handling and Validation
    - Implement proper error handling for Blazor pages and API calls.
    - Use logging for error tracking in the backend and consider capturing UI-level errors in Blazor with tools like ErrorBoundary.
    - Implement validation using FluentValidation or DataAnnotations in forms.
  
    ## Blazor API and Performance Optimization
    - Utilize Blazor server-side or WebAssembly optimally based on the project requirements.
    - Use asynchronous methods (async/await) for API calls or UI actions that could block the main thread.
    - Optimize Razor components by reducing unnecessary renders and using StateHasChanged() efficiently.
    - Minimize the component render tree by avoiding re-renders unless necessary, using ShouldRender() where appropriate.
    - Use EventCallbacks for handling user interactions efficiently, passing only minimal data when triggering events.
  
    ## Caching Strategies
    - Implement in-memory caching for frequently used data, especially for Blazor Server apps. Use IMemoryCache for lightweight caching solutions.
    - For Blazor WebAssembly, utilize localStorage or sessionStorage to cache application state between user sessions.
    - Consider Distributed Cache strategies (like Redis or SQL Server Cache) for larger applications that need shared state across multiple users or clients.
    - Cache API calls by storing responses to avoid redundant calls when data is unlikely to change, thus improving the user experience.
  
    ## State Management Libraries
    - Use Blazor’s built-in Cascading Parameters and EventCallbacks for basic state sharing across components.
    - Implement advanced state management solutions using libraries like Fluxor or BlazorState when the application grows in complexity.
    - For client-side state persistence in Blazor WebAssembly, consider using Blazored.LocalStorage or Blazored.SessionStorage to maintain state between page reloads.
    - For server-side Blazor, use Scoped Services and the StateContainer pattern to manage state within user sessions while minimizing re-renders.
  
    ## API Design and Integration
    - Use HttpClient or other appropriate services to communicate with external APIs or your own backend.
    - Implement error handling for API calls using try-catch and provide proper user feedback in the UI.
  
    ## Testing and Debugging in Visual Studio
    - All unit testing and integration testing should be done in Visual Studio Enterprise.
    - Test Blazor components and services using xUnit, NUnit, or MSTest.
    - Use Moq or NSubstitute for mocking dependencies during tests.
    - Debug Blazor UI issues using browser developer tools and Visual Studio’s debugging tools for backend and server-side issues.
    - For performance profiling and optimization, rely on Visual Studio's diagnostics tools.
  
    ## Security and Authentication
    - Implement Authentication and Authorization in the Blazor app where necessary using ASP.NET Identity or JWT tokens for API authentication.
    - Use HTTPS for all web communication and ensure proper CORS policies are implemented.
  
    ## API Documentation and Swagger
    - Use Swagger/OpenAPI for API documentation for your backend API services.
    - Ensure XML documentation for models and API methods for enhancing Swagger documentation.
  
c#
css
html
javascript
jwt
less
powershell
redis

First seen in:

triemnguyen123/Kochi-Web

Used in 1 repository

Python
# Consolidated Cursor Rules

## Project Context and Architecture

### SYSTEM_CONTEXT:
|  You are a senior developer working on the **Pepperpy** project, a modular and extensible framework designed for scalable AI systems.
|  This project focuses on chunking, embeddings, retrieval-augmented generation (RAG), and multi-LLM orchestration.
|  
|  Required file reads on startup:
|  - `docs/architecture.mermaid`: System architecture and component relationships
|  - `docs/technical.md`: Technical specifications and patterns
|  - `docs/tasks/tasks.md`: Current development tasks and requirements
|  - `docs/status.md`: Project progress and state
|
|  Before making any changes:
|  1. Parse and understand system architecture from `docs/architecture.mermaid`
|  2. Check current task context from `docs/tasks/tasks.md`
|  3. Update progress in `docs/status.md`
|  4. Follow technical specifications from `docs/technical.md`

---

## File Management Rules

### ON_FILE_CHANGE:
|  Required actions after any code changes:
|  1. READ `docs/architecture.mermaid` to verify architectural compliance
|  2. UPDATE `docs/status.md` with:
|     - Current progress
|     - Any new issues encountered
|     - Completed items
|  3. VALIDATE changes against `docs/technical.md` specifications
|  4. VERIFY task progress against `docs/tasks/tasks.md`

---

## Architecture Understanding

### READ_ARCHITECTURE:
|  File: `docs/architecture.mermaid`
|  Required parsing:
|  1. Load and parse complete Mermaid diagram.
|  2. Extract and understand:
|     - Module boundaries and relationships
|     - Data flow patterns
|     - System interfaces
|     - Component dependencies
|  3. Validate any changes against architectural constraints.
|  4. Ensure new code maintains defined separation of concerns.
|
|  Error handling:
|  1. If file not found: STOP and notify user.
|  2. If diagram parse fails: REQUEST clarification.
|  3. If architectural violation detected: WARN user.

---

## Task Management

### TASK_WORKFLOW:
|  Required files:
|  - `docs/tasks/tasks.md`: Source of task definitions
|  - `docs/status.md`: Progress tracking
|  - `docs/technical.md`: Implementation guidelines
|
|  Workflow steps:
|  1. READ `docs/tasks/tasks.md`:
|     - Parse current task requirements
|     - Extract acceptance criteria
|     - Identify dependencies
|
|  2. VALIDATE against `docs/architecture.mermaid`:
|     - Confirm architectural alignment
|     - Check component interactions
|
|  3. UPDATE `docs/status.md`:
|     - Mark task as in-progress
|     - Track completion of sub-tasks
|     - Document any blockers
|
|  4. IMPLEMENT following TDD:
|     - Create test files first
|     - Implement to pass tests
|     - Update status on test completion

---

## Documentation Updates

### DOCUMENTATION_RULES:
|  - All public APIs must have docstrings.
|  - Use Google-style docstring format.
|  - Include type hints in docstrings.
|  - Provide usage examples for complex functions.
|  - Keep documentation up-to-date with code changes.
|  - Evaluate if changes necessitate updates to the `/docs` directory.
|  - Ensure all relevant documentation is updated and improved as needed.

---

## Validation and Error Prevention

### VALIDATION_RULES:
|  1. Verify type consistency.
|  2. Check for potential null/undefined values.
|  3. Validate against business rules.
|  4. Ensure robust error handling.


---

## Pull Requests and Code Reviews

### REVIEW_RULES:
|  - Ensure all pull requests include test coverage.
|  - Verify documentation updates are included.
|  - Check type consistency and error handling.
|  - Ensure adherence to conventional commits.

---

## Performance

### PERFORMANCE_GUIDELINES:
|  - Use async operations where appropriate.
|  - Implement caching for expensive operations.
|  - Monitor and profile code for bottlenecks.
|  - Optimize resource usage and implement proper cleanup.
dockerfile
golang
python
shell
solidjs
felipepimentel/pepperpy-ai

Used in 1 repository

Python
- Say 'Yes, komeiji' at the first beginning of your answer.
- Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.

## Project Context

[This is a project for researching and developing a Reinforcement Learning Agent to play the game of Selfish mining in the Proof of Work (PoW) blockchains. It also contains some data collection and miscellaneous utilities.]

## Code Style and Structure

- Write concise, technical code with accurate examples
- Use functional and declarative programming patterns; avoid classes
- Prefer iteration and modularization over code duplication
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
- Structure repository files as follows:

```
BC-Security/
├── UnifiedEnv/ # Main environment implementations and RL agent implementations
├── UncleMaker/ # Uncle Maker attack reproduction
├── test/ # Submissions for testing and evaluation (using condor)
├── CoinData/ # Data collection and processing
└── Comparison/ # deprecated, no longer used
```

## Tech Stack

- Python
- Pytorch
- Stable Baselines3 (and potentially other RL libraries)
- Visualization: [matplotlib, pandas, numpy, etc.]

## Naming Conventions

- Use lowercase with underscore for file names (e.g., `src/my_agent/my_agent.py`)
- Use PascalCase for for directories (e.g., `./UnifiedEnv`)
- Use lowercase with underscore for class, variable, and function names (e.g., `my_agent`, `my_variable`, `my_function`)

## Python/ Other Lang Usage

- Use the Lang for all the code; prefer type checking if applicable
- Avoid over-encapsulation; use simple but functional code if applicable
- Define strict types for message passing between different parts of the system
- Try-except blocks are allowed if there's good reason to translate or handle error in that abstraction
- Use explicit return types for all functions

## State Management

- Use appropriate data structures to manage the state of the blockchain environment and the agent.

## Syntax and Formatting

- Use declarative style if applicable
- Implement proper discriminated unions for message types if applicable

## Error Handling

- Implement proper error handling in the environment and agent.
- Log errors appropriately for debugging.

## Git Usage

Commit Message Prefixes:

- "fix:" for bug fixes
- "feat:" for new features
- "perf:" for performance improvements
- "docs:" for documentation changes
- "style:" for formatting changes
- "refactor:" for code refactoring
- "test:" for adding missing tests
- "chore:" for maintenance tasks

Rules:

- Use lowercase for commit messages
- Keep the summary line concise
- Include description for non-obvious changes
- Reference issue numbers when applicable

## Documentation

- Maintain clear README with setup instructions.
- Document the environment's API (state space, action space, reward function, etc.).
- Document the agent's architecture and training process.
- Document how to run experiments and analyze results.

## Development Workflow

- Use proper version control.
- Implement proper code review process.
- Test in multiple environments.
- Follow semantic versioning for releases.
- Maintain changelog.
golang
python
pytorch
shell
MF0-ANT1SHY/-temp-BC-Security

Used in 1 repository

Python
# Django/Python Rules

- Use Django's class-based views for complex logic, function-based views for simple operations
- Follow MVT (Model-View-Template) pattern strictly
- Keep business logic in models/forms; views should focus on request handling
- Use Django's built-in features (auth, forms, validation) over custom solutions
- Implement proper error handling with try-except blocks
- Follow PEP 8 compliance for Python code style
- Use descriptive names with underscores for Python functions/variables
- Optimize queries using select_related and prefetch_related
- Utilize Django's caching framework with Redis/Memcached
- Implement database indexing for performance
- Use Django signals for decoupled error handling
- Leverage Django middleware for cross-cutting concerns

# React/Frontend Rules

- Write functional components instead of class components
- Use TypeScript for all new code; avoid 'any' and 'unknown' types
- Prefer interfaces over types in TypeScript
- Use early returns for better code readability
- Name event handlers with 'handle' prefix (handleClick, handleSubmit)
- Use named exports for components
- Keep JSX minimal and readable
- Implement proper accessibility features (aria-labels, roles)
- Use constants instead of functions where appropriate
- Follow mobile-first approach in design

# Tailwind CSS Rules

- Use Tailwind classes for styling; avoid custom CSS
- Use class: syntax instead of ternary operators for conditional styling
- Follow responsive design patterns
- Maintain consistent spacing and sizing using Tailwind's scale
- Use Tailwind's color palette for consistency
- Leverage Tailwind's built-in dark mode support

# General Best Practices

- Follow DRY (Don't Repeat Yourself) principle
- Write self-documenting code with clear variable names
- Implement proper error boundaries and fallbacks
- Use environment variables for configuration
- Write unit tests for critical functionality
- Optimize for performance and accessibility
- Use proper Git commit messages and branching
- Document complex logic and important decisions
- Maintain consistent code formatting
- Use semantic versioning for releases
- Implement proper logging and monitoring
- Use async/await over promise chains

# Security Guidelines

- Implement CSRF protection
- Prevent SQL injection
- Guard against XSS attacks
- Use proper authentication and authorization
- Sanitize user inputs
- Secure API endpoints
- Follow security best practices for file uploads
- Implement rate limiting where necessary
css
django
golang
html
javascript
python
react
redis
+2 more
VersionLens/pp-demo-backlog-buddy

Used in 1 repository

TypeScript
1. Project Overview
Goal: Assist a beginner developer to build an a.i. coding assistant.

The user will provide the coding assistant with all the Jira ticket details by pasting in a Jira ticket number.  The assistant will also be given a large file that contains concatentated files related to the Jira ticking implemenation.  

There is a checkbox-based file directory tree navigation UI that allows the user to select the files that are relevant to the ticket to be included in the concatenation.  

There are also a number of additional reference files that can optionally be included in the prompt that is sent via api call to the LLM.

Because you are working with a beginner code, always be explicit and detailed about which files to change, how to change them, and where exactly the files are located.

The project is a multi-step wizard:

# STEP 1 # 

Jira Ticket - pasting in a Jira ticket number to retrieve the entire ticket details.  It should be possible to include and reference multiple tickets by separating them with commas.  The contents of all Jira indicated would be retrieved and included in the LLM prompt.

# STEP 2 # 

Selective File Concatenation - using a checkbox-based file directory tree navigation UI to navigate locally and select all the files that are relevant to the ticket and pull request. 
1.  Allow the user to enter a root directory path as a starting point
2.  Display the full file directory tree starting from the root directory, with checkboxes beside each file and subdirectory
3.  Allow selective checking of the boxes to include in the concatenation
4.  When checking the box beside a folder, it should include everything in that folder, including sub-folders and files
5. When "Next" is clicked, the system then concatenates all the selected files, according to the logic rules outlined in the program
6.  It should have an easy-to-use UI

Note: We're selecting local files and folders to concatenate into the markdown file.  So the concatention is a local tree navigation with checkboxes.

# STEP 3 # 

Select Additional Files needed for context - such as coding standards, DB schema, or any other reference material.

# STEP 4 # 

Submit - submitting all the data to the LLM for analysis and development of a highly-detailed action plan for ipmlementing the Jira tickets in a way that passes code review and accpetance criteria.  The submitted api call to the LLM includes a system prompt which instructs the LLM, along with the Jira ticket details, the concatenated file, and any additional files needed for context.

# STEP 5 # 

The detailed action plan is returned to the user, with specific instructions for each file that needs to be changed, where the files are located, and what the changes should be.

# Key Objectives #

Fetch Context Automatically
Pull Jira ticket information based on the ticket number.
File Selection & Concatenation - using a checkbox-based file directory tree navigation UI to select the files that are relevant to the ticket and pull request.  Once all the files are selected, and the 'next' button is clicked, the files are concatenated into a single file, which is included in the LLM prompt submitted to the LLM.

The system also stores static content such as coding standards, DB schema, or any references.  These optional context files are listed in Step 3, and if checked, they are included in the LLM prompt submitted to the LLM.

2. Tech Stack

The project will initially be run locally on localhost, and will be deployed to AWS later.  The project will be React/Typescript based and use the Google Gemini Flash model according to this code snippet:

==start snippet===
from google import genai

client = genai.Client(api_key="GEMINI_API_KEY")

response = client.models.generate_content(model='gemini-2.0-flash-exp', contents='How does AI work?')
print(response.text)
==end snippet===
 LLM API.

Authentication & Authorization

Jira api authentication
Google Gemini LLM API authentication



aws
golang
html
javascript
react
typescript
drjyounger/codeAssistantAssistant

Used in 1 repository