Kartomat Copilot Rules — Free CoPilot Rules Template
    Neura Market
    Neura Market
    /CoPilot
    Marketplace
    Directories
    Resources
    CoPilot
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeekCoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityPluginsTrending
    CoPilotRulesKartomat Copilot Rules
    Back to Rules

    Kartomat Copilot Rules

    almyy April 16, 2026
    0 copies 0 downloads
    Rule Content
    # Copilot Instructions - Kartomat
    
    ## Project Overview
    
    Kartomat is a client-side classroom seating solver using Constraint Satisfaction Problem (CSP) algorithms. It's a React 19 + TypeScript app built with Vite 7, using Zustand for state management and i18next for internationalization.
    
    ## Build, Test, and Lint Commands
    
    ### Package Manager
    
    This project **requires pnpm** (enforced via preinstall script). Using npm or yarn will fail.
    
    ```bash
    # Install dependencies
    pnpm install
    
    # Development
    pnpm run dev              # Start dev server on localhost:5173
    
    # Build
    pnpm run build            # Production build
    pnpm run preview          # Preview production build
    
    # Linting
    pnpm run lint             # Run ESLint
    
    # Type checking
    pnpm run tsc              # Run TypeScript compiler
    
    # Testing
    pnpm test:unit            # Run Vitest in watch mode
    pnpm test:unit:run        # Run Vitest once
    pnpm test:unit:ui         # Open Vitest UI
    
    pnpm test                 # Run Playwright E2E tests
    pnpm test:ui              # Run Playwright with UI mode
    pnpm test:headed          # Run Playwright in headed mode
    ```
    
    ### Running Single Tests
    
    - **Vitest**: `pnpm test:unit -- <filename>` or use `.only` in test files
    - **Playwright**: `pnpm test -- <spec-file>` or `pnpm test -- --grep "test name"`
    
    ## Architecture
    
    ### State Management - Zustand Slices Pattern
    
    State is organized into domain slices (`src/store/`):
    
    - `studentsSlice.ts` - Student roster management
    - `classroomSlice.ts` - Grid dimensions and layout
    - `constraintsSlice.ts` - Seating constraints
    - `solverSlice.ts` - Solution state and error messages
    
    **Slices are combined** in `src/store/index.ts` using Zustand middleware:
    
    - `persist` middleware for localStorage persistence
    - Only specific fields are persisted (see `partialize` config)
    - localStorage key: `kartomat-storage`
    
    ### Feature-Based Organization
    
    Features are co-located in `src/features/` with their components and logic:
    
    ```
    features/
      ├── students/        # Student management UI
      ├── classroom/       # Grid configuration UI
      ├── constraints/     # Constraint creation/editing UI
      ├── seating/         # Solution visualization
      └── solver/          # Solve button and solver invocation
    ```
    
    Each feature exports through `index.ts` for clean imports.
    
    ### CSP Solver Architecture
    
    The constraint solver (`src/cspSolver.ts`) implements:
    
    - **Backtracking algorithm** with Most Constrained Variable (MCV) heuristic
    - **Constraint types** defined as const object (`CONSTRAINT_TYPES`)
    - **Smart placement order**: Absolute constraints → most constrained students → least constrained
    - **Constraint validation**: All constraints checked after each placement
    
    The solver is **pure** - no side effects, only returns `SeatingResult` object.
    
    ### Internationalization
    
    i18next setup in `src/i18n/`:
    
    - Translation files in `locales/` (JSON format)
    - Language switching persisted to localStorage
    - Use `useTranslation()` hook in components, `t()` function for keys
    
    ## Key Conventions
    
    ### TypeScript Usage
    
    - **Strict mode enabled** in tsconfig.json
    - Use explicit types for constraint interfaces (see `cspSolver.ts`)
    - TypeScript-first: all new files should be `.ts` or `.tsx`
    
    ### Component Patterns
    
    - Functional components only (React 19)
    - Use Zustand selectors: `useStore((state) => state.fieldName)`
    - Keep components focused on presentation; business logic in solver or slices
    
    ### Constraint Type System
    
    When adding/modifying constraints:
    
    1. Add type to `CONSTRAINT_TYPES` const object
    2. Create corresponding TypeScript interface extending `BaseConstraint`
    3. Add to discriminated union: `export type Constraint = ...`
    4. Update solver's constraint checking logic
    5. Update UI constraint manager
    
    ### Testing Structure
    
    - **Unit tests** (`*.test.ts` in `src/`): Test CSP solver logic, constraints, algorithms
    - **E2E tests** (`tests/*.spec.ts`): Test user workflows per feature/constraint type
    - Playwright runs against dev server (auto-started via `webServer` config)
    - Two browser configs: `chrome-desktop` (1280x720) and `chrome-mobile` (Pixel 5)
    
    ### Styling
    
    - **Tailwind CSS 4** via PostCSS
    - Responsive-first: mobile → tablet → desktop breakpoints
    - Utility classes in JSX, minimal custom CSS
    
    ### ESLint Configuration
    
    - Flat config format (`eslint.config.js`)
    - Separate rule sets for `.js/.jsx` and `.ts/.tsx` files
    - `varsIgnorePattern: '^[A-Z_]'` - allows unused constants/types starting with uppercase or underscore
    
    ### Security
    
    - 1-week package release cooldown (`minimumReleaseAge: 2880` in pnpm-workspace.yaml)
    - Protects against supply chain attacks on newly published packages
    
    ## MCP Servers
    
    This project is configured with MCP servers (`.mcp.json`) for enhanced tooling:
    
    - **playwright** - Browser automation, test debugging, trace analysis
    - **react** - Component inspection, hooks debugging, React DevTools integration
    - **axe** - Accessibility testing with axe-core for WCAG compliance
    - **tailwindcss** - Utility class suggestions and design token reference
    
    MCP servers run on-demand via `npx -y` to avoid adding dependencies to package.json.
    

    Comments

    More Rules

    View all

    QPrisma Copilot Rules

    A
    alexandergg

    Site Casanova Limaemedeiros Copilot Rules

    V
    victormedeeeiros-design

    Mosl Custom Chart Copilot Rules

    R
    riviangeralt

    InOut App Copilot Rules

    J
    jeanvq

    Fastfood Express Copilot Rules

    J
    jersonjjcr

    Pds Pre View Copilot Rules

    E
    eiriksgata

    Stay up to date

    Get the latest CoPilot prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for CoPilot and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Games
    • Blog
    • Videos
    • Guides
    • Courses
    • Community
    • Plugins

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this CoPilot resource

    • Automated Execution Cleanup System with n8n API and Custom Retention Rulesn8n · $9.99 · Related topic
    • Receive and Analyze Emails with Rules in Sublime Securityn8n · $9.99 · Related topic
    • Create an IPL Cricket Rules Q&A Chatbot with Google Gemini APIn8n · $14.99 · Related topic
    • Automate Bing Copilot Searches and Summarize Results with AIn8n · $14.99 · Related topic
    Browse all workflows