diff --git a/.cursor/mcp.json b/.cursor/mcp.json new file mode 100644 index 0000000..d9d709b --- /dev/null +++ b/.cursor/mcp.json @@ -0,0 +1,14 @@ +{ + "mcpServers": { + "codegraph": { + "type": "stdio", + "command": "codegraph", + "args": [ + "serve", + "--mcp", + "--path", + "C:\\Users\\shats\\Dev\\cloudflare-domain-manager" + ] + } + } +} diff --git a/.cursor/rules/ai-coding-assistant.mdc b/.cursor/rules/ai-coding-assistant.mdc new file mode 100644 index 0000000..edfa468 --- /dev/null +++ b/.cursor/rules/ai-coding-assistant.mdc @@ -0,0 +1,56 @@ +--- +description: Concise AI assistant — clean code, token efficiency, codebase alignment +alwaysApply: true +--- + +# AI Coding Assistant + +You work inside a real codebase. Be precise, concise, and aligned with existing patterns. + +## Clean Code + +- Minimal, readable, maintainable code; simple over clever +- Meaningful names; DRY; small single-responsibility functions +- Follow existing project style and patterns + +## Token Efficiency + +- Do not explain obvious things +- No step-by-step reasoning unless explicitly asked +- Output only what is necessary: code, brief comments when needed +- No long prose, summaries, or repetition +- If unsure — ask a short clarifying question instead of guessing + +## Work With Existing Codebase + +- Analyze surrounding code before generating new code +- Reuse existing utilities, helpers, and patterns +- Do not reinvent functionality already in the project +- Respect project architecture + +## Documentation Awareness + +- Check project docs, README, comments, and types before implementing +- If behavior is unclear: infer from types/tests/examples, or ask +- Prefer documented approaches over assumptions + +## Output Format + +- Default: only code +- If explanation is required — keep it under 3–5 lines +- Highlight only important decisions + +## Refactoring + +- Preserve behavior unless told otherwise +- Improve readability and structure; reduce complexity and duplication + +## Debugging + +- Identify root cause, not symptoms +- Suggest minimal fix; avoid rewriting large parts unless necessary + +## Missing Context + +- Ask concise, targeted questions +- Do not hallucinate APIs or project structure diff --git a/.cursor/rules/backend-api-ui.mdc b/.cursor/rules/backend-api-ui.mdc new file mode 100644 index 0000000..0f91e77 --- /dev/null +++ b/.cursor/rules/backend-api-ui.mdc @@ -0,0 +1,37 @@ +--- +description: Backend API — при изменениях, затрагивающих UI, строго следовать shadcn Components/Blocks +globs: apps/api/**/*,packages/shared/**/* +alwaysApply: false +--- + +# Backend API + shadcn/ui + +Fastify backend: `apps/api/`. Контракты — `@cfdm/shared` (Zod). Frontend — TanStack Query. + +## Обязательный порядок + +1. **Backend** — route, service, Vitest (`app.inject()`) +2. **Схемы** — `@cfdm/shared` (не дублировать в `apps/web/src/lib/schemas.ts`) +3. **UI** — shadcn MCP ([`shadcn-mcp.mdc`](shadcn-mcp.mdc)) + +## Запрещено на frontend при доработке API + +- Новые raw `