# Repository Guidelines
## Project Structure & Module Organization
- `src/index.ts` is the MCP server entrypoint and tool registration.
- `src/services/` contains MDN, context analysis, and CSS suggestion logic.
- `src/services/css/features/` holds modular feature definitions grouped by category.
- `src/scripts/` contains maintenance scripts (feature discovery/update).
- `dist/` is the bundled CLI output generated by `npm run build` (do not edit by hand).
- Root config includes `eslint.config.mjs`, `tsconfig.json`, `render.yaml`, and `smithery.yaml`.
## Build, Test, and Development Commands
- `npm run build`: bundles `src/index.ts` with `@vercel/ncc` and creates `dist/cli.js`.
- `npm run dev`: runs `tsc --watch` for incremental TypeScript builds.
- `npm run start`: executes the built CLI from `dist/cli.js` (build first).
- `npm run typecheck`: strict TypeScript check without emitting.
- `npm run lint` / `npm run lint:fix`: run ESLint across the repo.
- `npm run update-features`: refreshes MDN feature data via the update script.
- `npm run discover-features`: runs the feature discovery workflow.
## Coding Style & Naming Conventions
- TypeScript with strict mode enabled (`tsconfig.json`).
- Indentation is 2 spaces; prefer double quotes as in existing files.
- Use `camelCase` for variables/functions, `PascalCase` for types/classes, and lowercase directory names.
- Follow ESLint rules in `eslint.config.mjs` (unused args prefixed with `_`).
## Testing Guidelines
- No automated test runner is configured in `package.json`.
- If you add tests, align on a runner and update `tsconfig.json` (it currently excludes `src/**/*.test.ts`).
- For now, rely on `npm run typecheck` and targeted manual runs of the CLI.
## Commit & Pull Request Guidelines
- Commit history follows a Conventional Commits style (e.g., `feat:`, `chore:`, `docs:`, `refactor:`, `improve:`).
- Keep commit messages short and scoped to a single change.
- PRs should include: a clear description, linked issues (if any), commands run (build/lint/typecheck), and any relevant behavior notes.
## Configuration & Release Notes
- Runtime target is Node.js 18+.
- The `version` script rebuilds and stages `dist/`; keep generated output in sync for releases.