# Dokan Kits Agent Guidelines

## Build/Lint/Test Commands

- **Build**: `yarn build` | **Dev**: `yarn start`
- **PHP Lint**: `composer run phpcs` | **JS Lint**: `yarn lint`
- **PHP Tests**: `composer run test` | **Single PHP Test**: `phpunit --filter TestClass::testMethod`
- **JS Tests**: `yarn test` | **Type Check**: `yarn build`

## Code Style Guidelines

- **PHP**: WordPress standards, PSR-4 (`Dokan_Kits\` namespace), tabs, Yoda conditions, snake_case methods/variables, CamelCase classes, PHPDoc with @since tags
- **JS/TS**: 2 spaces, camelCase variables/functions, PascalCase components, TypeScript interfaces, React hooks, WordPress i18n
- **CSS**: Tailwind CSS utilities, BEM naming for custom classes, SCSS variables
- **Imports**: Group by builtin/external/internal/parent/sibling, alphabetize within groups
- **Error Handling**: Sanitize inputs, escape outputs, meaningful error messages, proper try/catch
- **Templates**: Use `wc_get_template*` functions, avoid custom template classes

## Copilot Rules

Follow .github/copilot-instructions.md: SOLID principles, interface-based design, dependency injection, WordPress hooks, security best practices, conventional commits, accessibility (WCAG 2.1 AA), comprehensive testing, Freemius integration for premium features.
