@bonesofspring/ai-rules 0.1.41 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +10 -1
  3. package/bin/cli.js +193 -53
  4. package/package.json +1 -1
  5. package/presets/claude/next/CLAUDE.md +1 -1
  6. package/presets/claude/next/agents/README.md +61 -0
  7. package/presets/claude/next/agents/api-contract-reviewer.md +1 -1
  8. package/presets/claude/next/agents/build-verifier.md +2 -0
  9. package/presets/claude/next/agents/feature-developer.md +8 -21
  10. package/presets/claude/next/agents/task-router.md +24 -126
  11. package/presets/claude/next/commands/task.md +1 -1
  12. package/presets/claude/next/rules/README.md +3 -3
  13. package/presets/claude/next/rules/api-and-data/api-services.md +3 -3
  14. package/presets/claude/next/rules/api-and-data/http-client.md +2 -2
  15. package/presets/claude/next/rules/api-and-data/store-rtk.md +2 -2
  16. package/presets/claude/next/rules/architecture/README.md +8 -11
  17. package/presets/claude/next/rules/architecture/api-public-imports.md +3 -26
  18. package/presets/claude/next/rules/architecture/architecture-boundaries.md +6 -6
  19. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +44 -69
  20. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +5 -5
  21. package/presets/claude/next/rules/architecture/public-imports.md +46 -0
  22. package/presets/claude/next/rules/architecture/reference-features.md +4 -1
  23. package/presets/claude/next/rules/architecture/types-public-imports.md +3 -29
  24. package/presets/claude/next/rules/stack/next-app-core.md +20 -70
  25. package/presets/claude/next/rules/stack/no-type-assertion.md +3 -2
  26. package/presets/claude/next/rules/stack/types-jsdoc.md +1 -1
  27. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +6 -0
  28. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +14 -1
  29. package/presets/claude/next/rules/tooling-and-review/code-quality.md +3 -11
  30. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +2 -2
  31. package/presets/claude/next/rules/tooling-and-review/package-manager.md +6 -15
  32. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +14 -24
  33. package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +6 -18
  34. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +1 -1
  35. package/presets/claude/next/skills/feature-delivery/SKILL.md +5 -20
  36. package/presets/cursor/next/AGENTS.md +1 -1
  37. package/presets/cursor/next/agents/README.md +81 -0
  38. package/presets/cursor/next/agents/api-contract-reviewer.md +1 -1
  39. package/presets/cursor/next/agents/build-verifier.md +2 -0
  40. package/presets/cursor/next/agents/code-reviewer.md +1 -1
  41. package/presets/cursor/next/agents/feature-developer.md +9 -30
  42. package/presets/cursor/next/agents/task-router.md +23 -125
  43. package/presets/cursor/next/commands/task.md +1 -1
  44. package/presets/cursor/next/rules/README.md +6 -7
  45. package/presets/cursor/next/rules/agent-team-intake.mdc +2 -2
  46. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +14 -1
  47. package/presets/cursor/next/rules/api-public-imports.mdc +3 -24
  48. package/presets/cursor/next/rules/api-services.mdc +3 -3
  49. package/presets/cursor/next/rules/architecture-boundaries.mdc +6 -6
  50. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +3 -11
  51. package/presets/cursor/next/rules/code-review-mr.mdc +2 -2
  52. package/presets/cursor/next/rules/css-property-order-stylelint.mdc +6 -18
  53. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +45 -22
  54. package/presets/cursor/next/rules/http-client.mdc +2 -2
  55. package/presets/cursor/next/rules/layer-barrel-exports.mdc +5 -5
  56. package/presets/cursor/next/rules/next-app-core.mdc +18 -71
  57. package/presets/cursor/next/rules/no-type-assertion-as-import-export.mdc +4 -1
  58. package/presets/cursor/next/rules/package-manager.mdc +6 -15
  59. package/presets/cursor/next/rules/post-change-lint.mdc +14 -24
  60. package/presets/cursor/next/rules/public-imports.mdc +48 -0
  61. package/presets/cursor/next/rules/react-ui.mdc +1 -1
  62. package/presets/cursor/next/rules/reference-features.mdc +5 -1
  63. package/presets/cursor/next/rules/store-rtk.mdc +2 -2
  64. package/presets/cursor/next/rules/types-jsdoc.mdc +1 -1
  65. package/presets/cursor/next/rules/types-public-imports.mdc +3 -26
  66. package/presets/cursor/next/skills/feature-delivery/SKILL.md +5 -20
  67. package/presets/cursor/next/rules/feature-delivery-flow.mdc +0 -74
@@ -8,41 +8,20 @@ You are a senior frontend developer working in a Next.js monorepo with strict la
8
8
 
9
9
  ## Before coding
10
10
 
11
- 1. Read `.cursor/team/tasks/<slug>/brief.md` and `decomposition.md`.
12
- 2. Read `architecture.md`, `migration-plan.md`, `api-contract-review.md`, `debug-report.md`, `validation-report.md`, and `review.md` if present.
13
- 3. Read `status.json` proceed if `state` is `in_progress`, `approved`, or continuing after `/task-continue` / fix loop (`retryAfterFix`).
14
- 4. Read `pipeline.json` if present for step context and scope.
15
- 5. Read **`reference-features.mdc`** and mirror the closest reference feature structure.
16
- 6. Use the **`feature-delivery` skill** and **`feature-delivery-workflow.mdc`** for layer order.
11
+ 1. Read `.cursor/team/tasks/<slug>/brief.md`, `decomposition.md`, and prior artifacts if present (`architecture.md`, `debug-report.md`, `validation-report.md`, `review.md`, …).
12
+ 2. Read `status.json` proceed if `in_progress`, `approved`, or `retryAfterFix`.
13
+ 3. Read `pipeline.json` for step context and scope.
14
+ 4. Follow the **`feature-delivery` skill** (layer order, reference features, validation handoff).
17
15
 
18
16
  ## Task execution rules
19
17
 
20
- - Do **not** start a task marked blocked or whose dependencies are incomplete.
21
- - Work tasks in dependency order (types api → mocks → store ui **unit** → e2e).
22
- - **Unit tests are mandatory before handoff** for mappers, store logic, and non-trivial pure functions (`tests-unit.mdc`). E2E is usually a later pipeline step.
23
- - Mark completed tasks in `decomposition.md` with `[x]` or a **Done** column update.
24
- - After all code changes run **`post-change-lint.mdc`**: `lint:js`, `lint:css`, `type-check` from `app/`.
18
+ - Do **not** start blocked tasks or tasks with incomplete dependencies.
19
+ - **Unit tests mandatory before handoff** for mappers, store logic, and non-trivial pure functions.
20
+ - Mark completed tasks in `decomposition.md`.
21
+ - Validation: **`post-change-lint.mdc`**. If pipeline next step is **`build-verifier`**, scoped lint/type-check on **changed files** is enough; full project lint is build-verifier's job.
25
22
 
26
23
  ## On completion
27
24
 
28
- Update `status.json`:
29
-
30
- ```json
31
- {
32
- "slug": "<slug>",
33
- "currentAgent": "feature-developer",
34
- "phase": "executing",
35
- "state": "completed",
36
- "updatedAt": "<ISO8601>"
37
- }
38
- ```
39
-
40
- Provide a short handoff summary:
41
-
42
- - Tasks completed vs remaining
43
- - Files changed (by layer)
44
- - Unit specs added/updated
45
- - Lint/type-check result
46
- - Known gaps for build-verifier or reviewer
25
+ Update `status.json` (`currentAgent`: `feature-developer`, `state`: `completed`). Handoff: tasks done, files by layer, unit specs, validation result, gaps for build-verifier/reviewer.
47
26
 
48
27
  Do not perform formal code review — that is the code-reviewer subagent's job.
@@ -11,6 +11,7 @@ You are a task router for a Next.js frontend agent team. You **do not** implemen
11
11
 
12
12
  - User task description (from `/task` or orchestrator).
13
13
  - Optional: existing files under `.cursor/team/tasks/<slug>/`.
14
+ - Pipeline JSON schema, examples, step fields — **`agents/README.md`**.
14
15
 
15
16
  ## Intent detection
16
17
 
@@ -24,150 +25,47 @@ You are a task router for a Next.js frontend agent team. You **do not** implemen
24
25
  | `a11y` | «a11y», «доступность», «accessibility», «WCAG», «screen reader», «клавиатура» | task-analyst → feature-developer → build-verifier → accessibility-reviewer → code-reviewer |
25
26
  | `review-only` | «ревью», «review MR», «проверь diff», «code review» | code-reviewer |
26
27
  | `test-only` | «покрой тестами», «напиши тесты» (mixed unit+e2e, no impl) | task-analyst → qa-tester |
27
- | `unit-only` | «unit», «юнит», «mapper tests», «покрой маппер», «почини unit» | unit-test-planner → unit-test-generator, or unit-test-healer for failing unit tests |
28
- | `e2e-only` | «e2e», «playwright», «browser test», «сценарии e2e», «почини e2e» | playwright-test-planner → playwright-test-generator, or playwright-test-healer for failing tests |
28
+ | `unit-only` | «unit», «юнит», «mapper tests», «покрой маппер», «почини unit» | unit-test-planner → unit-test-generator, or unit-test-healer |
29
+ | `e2e-only` | «e2e», «playwright», «browser test», «сценарии e2e», «почини e2e» | playwright-test-planner → playwright-test-generator, or playwright-test-healer |
29
30
  | `docs-only` | «документация», «README», «changelog», «ADR», «migration guide» | task-analyst → tech-writer |
30
31
  | `refactor` | «рефакторинг», «без изменения поведения», «почисти» | task-analyst → feature-developer → build-verifier → code-reviewer |
31
32
  | `spike` | «исследуй», «оцени», «можно ли», «spike», proof of concept | task-analyst → solution-architect |
32
33
  | `retro` | «ретро», «разбор», «postmortem» | (no pipeline — orchestrator runs `/technical-retro`) |
33
34
 
34
- Adjust steps when context is clear:
35
+ ## Adjust steps (when context is clear)
35
36
 
36
- - **Skip task-analyst** if AC and scope are fully specified (document in `skipped`).
37
- - **Add solution-architect** for cross-layer features (API + store + UI), new public APIs, or architecture uncertainty insert after analyst, before developer.
38
- - **Add api-contract-reviewer** when new/changed backend endpoints, OpenAPI/Swagger, or DTO contract sync insert after architect (or after analyst if no architect), before developer.
39
- - **Add accessibility-reviewer** for UI-heavy `feature` tasks — after build-verifier, **parallel with security-reviewer** when both apply (see parallel step example).
40
- - **Add security-reviewer** for auth, tokens, forms, sensitive data — after build-verifier, parallel with accessibility-reviewer when both apply; before code-reviewer.
41
- - **Add performance-auditor** for perf-sensitive features insert after developer or as optional post-review audit step.
42
- - **Add tech-writer** when docs/changelog/README explicitly requested — append as final step for `feature`, `migration`, `docs-only`.
43
- - **Use unit-test trio** instead of `qa-tester` when request is explicitly unit-only.
44
- - **Use Playwright specialists** for e2e-heavy features instead of `qa-tester` (scope e2e-only on qa when both unit and e2e needed).
45
- - **Always insert build-verifier** after feature-developer (or ci-investigator/debugger when they changed code) for `feature`, `bugfix`, `refactor`, `migration`, `a11y`.
46
- - **Skip qa-tester** for review-only, spike (no code), ci-fix (unless regression scope needed), perf-audit, docs-only, unit-only/e2e-only handled by specialists, or trivial one-line fixes (document risk).
47
- - **Skip feature-developer** for review-only, test-only (tests only), retro, perf-audit, docs-only (after analyst), ci-fix when investigator fixes in place.
48
- - **ci-fix:** skip feature-developer with `skipIf: ci-investigator.resolved` when investigator fixes in place.
49
- - **bugfix:** use `skipIf: debugger.fixed` on feature-developer when debugger applied the fix.
50
- - **Model:** use `model: inherit` (not fast) when pipeline has 4+ steps or cross-layer uncertainty (API + store + UI).
37
+ - Skip **task-analyst** if AC/scope fully specified document in `skipped`.
38
+ - Add **solution-architect** for cross-layer / new public APIs — after analyst, before developer.
39
+ - Add **api-contract-reviewer** for new/changed backend contracts — before developer.
40
+ - Add **accessibility-reviewer** / **security-reviewer** after build-verifier (parallel when both apply).
41
+ - Add **tech-writer** when docs/changelog requested.
42
+ - **Always build-verifier** after developer (or after ci-investigator/debugger if they changed code) for `feature`, `bugfix`, `refactor`, `migration`, `a11y`.
43
+ - **skipIf:** `debugger.fixed` on developer (bugfix); `ci-investigator.resolved` (ci-fix).
44
+ - **Model:** `inherit` when 4+ steps or cross-layer uncertainty.
51
45
 
52
- ## Output: pipeline.json
53
-
54
- Write to `.cursor/team/tasks/<slug>/pipeline.json`:
55
-
56
- ```json
57
- {
58
- "slug": "<slug>",
59
- "intent": "feature",
60
- "summary": "One-line task summary",
61
- "steps": [
62
- { "agent": "task-analyst", "label": "Clarify and decompose" },
63
- { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
64
- { "agent": "build-verifier", "label": "Lint, type-check, unit smoke" },
65
- { "agent": "code-reviewer", "label": "Code review" },
66
- { "agent": "qa-tester", "label": "E2E tests", "scope": "e2e-only" }
67
- ],
68
- "humanGates": ["after:task-analyst"],
69
- "autoChain": true,
70
- "skipped": []
71
- }
72
- ```
73
-
74
- ### Example: feature with optional reviewers
75
-
76
- ```json
77
- {
78
- "intent": "feature",
79
- "steps": [
80
- { "agent": "task-analyst", "label": "Clarify and decompose" },
81
- { "agent": "api-contract-reviewer", "label": "Validate API contract" },
82
- { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
83
- { "agent": "build-verifier", "label": "Validation gate" },
84
- {
85
- "agent": ["accessibility-reviewer", "security-reviewer"],
86
- "parallel": true,
87
- "label": "A11y and security review"
88
- },
89
- { "agent": "code-reviewer", "label": "Code review" },
90
- { "agent": "playwright-test-planner", "label": "E2E plan", "scope": "changed-flows-only" },
91
- { "agent": "playwright-test-generator", "label": "E2E specs" },
92
- { "agent": "tech-writer", "label": "Documentation" }
93
- ],
94
- "humanGates": ["after:task-analyst"]
95
- }
96
- ```
97
-
98
- ### Example: bugfix with skip
99
-
100
- ```json
101
- {
102
- "intent": "bugfix",
103
- "steps": [
104
- { "agent": "debugger", "label": "Root cause" },
105
- { "agent": "feature-developer", "label": "Fix if needed", "skipIf": "debugger.fixed" },
106
- { "agent": "build-verifier", "label": "Validation" },
107
- { "agent": "code-reviewer", "label": "Review" }
108
- ],
109
- "humanGates": []
110
- }
111
- ```
112
-
113
- ### Step fields
114
-
115
- | Field | Required | Description |
116
- |-------|----------|-------------|
117
- | `agent` | yes | Subagent name (kebab-case) or array for `parallel: true` |
118
- | `label` | yes | Short human-readable step name |
119
- | `scope` | no | e.g. `unit-in-dev`, `e2e-only`, `regression`, `full` — passed to agents |
120
- | `skipIf` | no | `debugger.fixed` \| `ci-investigator.resolved` — skip step when artifact says fix already applied |
121
- | `parallel` | no | When `true` and `agent` is array — orchestrator invokes all agents in one turn |
122
-
123
- ### humanGates
124
-
125
- Values: `after:<agent-name>` — orchestrator stops after that agent; user runs `/task-continue <slug>` or `/feature-continue <slug>`.
46
+ ## humanGates (defaults)
126
47
 
127
48
  | Intent | Default humanGates |
128
49
  |--------|-------------------|
129
50
  | `feature`, `refactor`, `test-only`, `a11y` | `["after:task-analyst"]` |
130
51
  | `migration` | `["after:migration-specialist"]` |
131
52
  | `docs-only` | `["after:task-analyst"]` |
132
- | `unit-only` | `["after:unit-test-planner"]` when new plan before generation; `[]` for pure healer |
133
- | `e2e-only` | `["after:playwright-test-planner"]` when new plan; `[]` for pure healer |
134
- | `bugfix`, `review-only`, `ci-fix` | `[]` (unless analyst added) |
53
+ | `unit-only` | `["after:unit-test-planner"]` when new plan; `[]` for healer |
54
+ | `e2e-only` | `["after:playwright-test-planner"]` when new plan; `[]` for healer |
55
+ | `bugfix`, `review-only`, `ci-fix` | `[]` |
135
56
  | `spike` | `["after:solution-architect"]` |
136
57
  | `perf-audit` | `[]` |
137
58
 
138
- ### skipped (optional)
139
-
140
- ```json
141
- "skipped": [{ "agent": "task-analyst", "reason": "AC provided in ticket" }]
142
- ```
143
-
144
- ## Initial status.json
59
+ ## Output
145
60
 
146
- After writing pipeline.json, write:
147
-
148
- ```json
149
- {
150
- "slug": "<slug>",
151
- "intent": "<intent>",
152
- "pipelineIndex": 0,
153
- "currentAgent": "<steps[0].agent>",
154
- "phase": "executing",
155
- "state": "in_progress",
156
- "awaitingHumanGate": false,
157
- "updatedAt": "<ISO8601>"
158
- }
159
- ```
160
-
161
- Also write `.cursor/team/active-task.json` → `{ "slug": "<slug>" }`.
61
+ Write `.cursor/team/tasks/<slug>/pipeline.json` and initial `status.json`; set `.cursor/team/active-task.json` → `{ "slug": "<slug>" }`. Minimal template — см. **`agents/README.md`**.
162
62
 
163
63
  ## Handoff to orchestrator
164
64
 
165
- Respond with:
166
-
167
- 1. **Intent** and one-line summary.
168
- 2. **Planned steps** (table: #, agent, label).
169
- 3. **Skipped roles** and why.
170
- 4. **Human gates** (if any).
171
- 5. Tell orchestrator to invoke `steps[0].agent` now (unless intent is `retro` — then run `/technical-retro`).
65
+ 1. Intent + one-line summary.
66
+ 2. Planned steps (table: #, agent, label).
67
+ 3. Skipped roles and why.
68
+ 4. Human gates (if any).
69
+ 5. Invoke `steps[0].agent` now (unless `retro` → `/technical-retro`).
172
70
 
173
71
  Do not invoke implementation agents yourself.
@@ -5,7 +5,7 @@ description: Route a natural-language task through the agent-team pipeline: task
5
5
 
6
6
  # Task — единая точка входа (router + pipeline)
7
7
 
8
- Главная команда для постановки задачи. Родительский агент = оркестратор (`agent-team-orchestrator.mdc`).
8
+ Главная команда для постановки задачи. Родительский агент = оркестратор (`agent-team-orchestrator.mdc`). Intake для work-запросов без `/task` — `agent-team-intake.mdc`.
9
9
 
10
10
  ## Аргументы
11
11
 
@@ -20,8 +20,8 @@
20
20
  ### Loading strategy
21
21
 
22
22
  - **`alwaysApply: true`** (Cursor) / **без `paths:`** (Claude) — только базовые инварианты:
23
- - `next-app-core`, `post-change-lint`, `package-manager`, `agent-team-intake`, `code-quality-and-refactoring`
24
- - **Globs / `paths:`** architecture, imports, UI, tests, feature-delivery-workflow, reference-features, next-app-router, react-a11y-coding
23
+ - `next-app-core`, `post-change-lint`, `package-manager`, `code-quality-and-refactoring`
24
+ - **On-demand** — `agent-team-intake` (через orchestrator/commands), `agent-team-orchestrator`, architecture, imports, UI, tests, feature-delivery-workflow, reference-features, next-app-router, react-a11y-coding
25
25
  - **Skills** — длинные процедуры (`feature-delivery`, `code-review`, …)
26
26
 
27
27
  ### Эталонные фичи
@@ -36,17 +36,16 @@
36
36
  | `next-app-router.mdc` | App Router, RSC, loading/error |
37
37
  | `react-a11y-coding.mdc` | A11y при написании UI |
38
38
  | `feature-delivery-workflow.mdc` | Сквозной чеклист (on-demand, не always-on) |
39
- | `agent-team-intake.mdc` | Автоподсказка `/task` при постановке задачи (alwaysApply) |
39
+ | `agent-team-intake.mdc` | Подсказка `/task` при work-запросе (on-demand, через orchestrator) |
40
40
  | `package-manager.mdc` | Перед `install` / `run` в терминале определить менеджер пакетов репо (lockfile, `packageManager`) и использовать только его |
41
41
  | `agent-team-orchestrator.mdc` | `/task`, router, `pipeline.json`, build-verifier, parallel steps |
42
- | `next-app-core.mdc` | Стек, слои, порты‑адаптеры (alwaysApply) |
42
+ | `next-app-core.mdc` | Стек, слои, карта каталогов (alwaysApply) |
43
43
  | `post-change-lint.mdc` | **Обязательный** прогон ESLint + Stylelint после любых изменений кода |
44
44
  | `architecture-boundaries.mdc` | Границы UI / store / API, импорты (`@/types`, `@/api`), порты‑адаптеры, фича как срез |
45
45
  | `http-client.mdc` | Один HTTP‑стек, контракты из `@/types`, без разбросанного низкоуровневого API |
46
46
  | `api-services.mdc` | Сервисы, мапперы, вызовы через прикладные API‑клиенты |
47
47
  | `store-rtk.mdc` | Redux Toolkit, thunk’и, типизация ошибок/ответов как в коде репо |
48
- | `types-public-imports.mdc` | Импорты только через barrel `@/types` |
49
- | `api-public-imports.mdc` | Импорты только через barrel `@/api` (вне `app/src/api/**`) |
48
+ | `public-imports.mdc` | Импорты `@/types`, `@/types/enums`, `@/api` (вне `app/src/api/**`); stubs: `types-public-imports.mdc`, `api-public-imports.mdc` |
50
49
  | `layer-barrel-exports.mdc` | Двухуровневые barrel для слоёв с public API (`@/api`, `@/types`, `@/core`, …) |
51
50
  | `types-jsdoc.mdc` | JSDoc для типов в `app/src/types` (русский текст, `[computed]`, без `@param`/`@returns`) |
52
51
  | `no-type-assertion-as-import-export.mdc` | Ограничение `as`, в т.ч. `instanceof` для ошибок транспорта в `catch` |
@@ -55,6 +54,6 @@
55
54
  | `playwright-agents.mdc`, `tests-e2e-structure.mdc` | E2E |
56
55
  | `react-ui.mdc` | React/Next UI: структура компонентов, соседние `ComponentName.data.ts` / `.utils.ts`, стили, пропсы |
57
56
 
58
- **Коллизии формулировок:** если в разных `.mdc` расходятся детали **импорта типов**, источник правды **`types-public-imports.mdc`** (`@/types`, `@/types/enums`); по **импорту из API‑слоя** (store, UI, прочий код вне `app/src/api/**`) — **`api-public-imports.mdc`** (`@/api`), в том же смысле что правило ESLint `no-restricted-imports` в `app/eslint.config.mjs`.
57
+ **Коллизии формулировок:** импорт типов и API источник правды **`public-imports.mdc`**; дублирует ESLint `no-restricted-imports` в `app/eslint.config.mjs`.
59
58
 
60
59
  Задачи на **сеть, замену HTTP‑библиотеки, новые эндпоинты**: опираться на **`http-client.mdc`** + **`api-services.mdc`** + **`store-rtk.mdc`**.
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: When the user describes a new task, feature, bug, or implementation request (not a pure question), suggest or use /task to run the agent team router. Lightweight intake hint only.
3
- alwaysApply: true
2
+ description: Use when user posts a work request without /task suggest or use /task to run the agent team router. Lightweight intake hint only.
3
+ alwaysApply: false
4
4
  ---
5
5
 
6
6
  # Agent team intake
@@ -7,6 +7,8 @@ alwaysApply: false
7
7
 
8
8
  Parent agent = **manager**. Router plans; specialists execute. Artifacts: `.cursor/team/tasks/<slug>/`.
9
9
 
10
+ Work request без `/task` — см. **`agent-team-intake.mdc`** (когда предлагать router вместо прямого кодинга).
11
+
10
12
  ## Entry points
11
13
 
12
14
  | Command | When |
@@ -121,6 +123,17 @@ After each agent completes, ensure `status.json` has `state: completed` (or `awa
121
123
 
122
124
  If `pipeline.json` is missing (old `/feature-start` tasks), fall back to fixed phases: analysis → development → review → testing. Hook supports both.
123
125
 
126
+ ## Skip pipeline when
127
+
128
+ Do **not** run `/task` + router for:
129
+
130
+ - Pure questions («как работает X», «объясни»).
131
+ - Typo / one-file fix / trivial config with no architecture risk.
132
+ - User explicitly says «без pipeline», «просто сделай», or continues an active slug.
133
+ - Single-line `docs-only` with no code impact.
134
+
135
+ Borderline work requests — см. **`agent-team-intake.mdc`**.
136
+
124
137
  ## Auto-detection (optional)
125
138
 
126
- When user describes a **task** (not a question "how does X work"), suggest `/task <their message>` or run router proactively if they agree.
139
+ When user describes a **non-trivial task** (not a question), suggest `/task <message>` or run router if they agree.
@@ -1,29 +1,8 @@
1
1
  ---
2
- description: Импорт из API-слоя только через публичный barrel @/api
3
- globs: app/src/**/*.ts,app/src/**/*.tsx
2
+ description: Moved to public-imports.mdc read that file instead
4
3
  alwaysApply: false
5
4
  ---
6
5
 
7
- # Импорты из `@/api`
6
+ # Deprecated
8
7
 
9
- - **Публичный API слоя API** — barrel `app/src/api/index.ts`. Для файлов **вне** `app/src/api/**` импортировать сервисы, клиенты, эндпоинты и публичные типы API **только** как `import … from '@/api'` (или `from '@/api/index'` при необходимости явного пути).
10
- - **Запрещено** для таких потребителей обходить barrel: любой импорт вида `@/api/<что‑угодно>`, кроме `@/api/index`. Это дублирует правило ESLint `no-restricted-imports` в `app/eslint.config.mjs` (паттерн `@/api/*` с исключением `@/api/index`).
11
- - При **добавлении** публичного символа в регламентированный слой — реэкспорт в корневой barrel по **`layer-barrel-exports.mdc`**.
12
-
13
- ## Внутри слоя `app/src/api/**`
14
-
15
- - При реализации сервисов, клиентов и barrel допустимы **относительные** импорты и пути вида `@/api/services/**`, `@/api/clients/**` между файлами этого слоя. Это не относится к потребителям снаружи `app/src/api/**`.
16
-
17
- ## Примеры
18
-
19
- ```typescript
20
- // ✅ Допустимо в store, UI, lib вне app/src/api — только barrel
21
- import { MedcardApiService, MarketplaceApiService } from '@/api'
22
- import type { TReferenceRequest } from '@/api'
23
-
24
- // ❌ Запрещено снаружи app/src/api (сработает ESLint)
25
- import { MedcardApiService } from '@/api/services/MedcardApiService/MedcardApiService'
26
- import { MedcardApiClient } from '@/api/clients/MedcardApiClient'
27
- ```
28
-
29
- При ревью и правках кода **не добавлять** новые импорты из `@/api/...` кроме `@/api` / `@/api/index` в файлах вне `app/src/api/**`.
8
+ Содержимое перенесено в **`public-imports.mdc`** (раздел `@/api`).
@@ -12,7 +12,7 @@ alwaysApply: false
12
12
  - заголовками и кодами ответов,
13
13
  - DTO backend.
14
14
  - Предоставлять UI и store **стабильный доменный интерфейс**:
15
- - функции, работающие с доменными типами из `@/types` (`types-public-imports.mdc`).
15
+ - функции, работающие с доменными типами из `@/types` (`public-imports.mdc`).
16
16
  - мапперы между DTO и доменными типами.
17
17
 
18
18
  # Структура модулей
@@ -23,7 +23,7 @@ alwaysApply: false
23
23
  - файлы с вызовами API (`index.ts` или `*.service.ts`);
24
24
  - файлы мапперов (`*responseMappers.ts`);
25
25
  - специфичные типы запросов/ответов (если не вынесены в `app/src/types/**` с экспортом через barrel `@/types`).
26
- - при необходимости — локальные `index.ts` / barrel внутри модуля для структуры **внутри** `app/src/api/**`; **снаружи** этого слоя UI, store и остальной код импортируют только из корневого barrel `app/src/api/index.ts` (`import … from '@/api'`, **`api-public-imports.mdc`**).
26
+ - при необходимости — локальные `index.ts` / barrel внутри модуля для структуры **внутри** `app/src/api/**`; **снаружи** этого слоя UI, store и остальной код импортируют только из корневого barrel `app/src/api/index.ts` (`import … from '@/api'`, **`public-imports.mdc`**).
27
27
 
28
28
  # Мапперы и типы
29
29
 
@@ -54,5 +54,5 @@ alwaysApply: false
54
54
  - Не смешивать слой API и UI/store:
55
55
  - компоненты не должны зависеть от DTO;
56
56
  - store не должен сам собирать URL/коды эндпоинтов и не обходить сервисы; **транспортный тип ответа** и **контракт ошибки** из `@/types` (как у прикладного клиента) допустимы во thunk при разборе `catch`/payload, если так выстроен сервис (см. `store-rtk.mdc`, `http-client.mdc`).
57
- - При использовании API‑сервисов в UI, store и утилитах **вне** `app/src/api/**` импортировать **только** из `@/api` (корневой barrel), см. **`api-public-imports.mdc`**; внутри слоя API — по относительным путям или `@/api/services/**` / `@/api/clients/**`, не дублируя публичный контракт мимо корневого barrel для внешних потребителей.
57
+ - При использовании API‑сервисов в UI, store и утилитах **вне** `app/src/api/**` импортировать **только** из `@/api` (корневой barrel), см. **`public-imports.mdc`**; внутри слоя API — по относительным путям или `@/api/services/**` / `@/api/clients/**`, не дублируя публичный контракт мимо корневого barrel для внешних потребителей.
58
58
 
@@ -7,18 +7,18 @@ alwaysApply: false
7
7
  # Границы между слоями
8
8
 
9
9
  - **UI (app/src/ui/**)**:
10
- - Может импортировать: `@/ui/**`, `@/store/**`, типы из `@/types` и enum из `@/types/enums` (**только как в `types-public-imports.mdc`**), контракт к API — **только** `import … from '@/api'` (**`api-public-imports.mdc`**).
10
+ - Может импортировать: `@/ui/**`, `@/store/**`, типы из `@/types` и enum из `@/types/enums` (**только как в `public-imports.mdc`**), контракт к API — **только** `import … from '@/api'` (**`public-imports.mdc`**).
11
11
  - Не должен:
12
12
  - обращаться к HTTP‑клиенту напрямую;
13
13
  - знать детали DTO backend — только доменные типы.
14
14
  - **Store (app/src/store/**)**:
15
- - Может импортировать: `@/store/**`, сервисы и публичные сущности API — **только** из `@/api` (**`api-public-imports.mdc`**), типы из `@/types` и enum из `@/types/enums` (**`types-public-imports.mdc`**).
15
+ - Может импортировать: `@/store/**`, сервисы и публичные сущности API — **только** из `@/api` (**`public-imports.mdc`**), типы из `@/types` и enum из `@/types/enums` (**`public-imports.mdc`**).
16
16
  - Не должен:
17
17
  - зависеть от конкретных UI‑компонентов;
18
18
  - напрямую работать с global/window API.
19
19
  - Вызовы к backend — только через сервисы, импортируемые из `@/api`; **транспортные** типы ответа и ошибки (из `@/types`, в том же виде, что у прикладного HTTP‑клиента) во thunk допустимы, если так выстроен API‑слой (`http-client.mdc`, `store-rtk.mdc`).
20
20
  - **API (`app/src/api/**`)** — реализация в `services/**`, `clients/**`, реэкспорт в `app/src/api/index.ts`:
21
- - Внутри слоя: типы из `@/types` и enum из `@/types/enums` (**`types-public-imports.mdc`**); импорты `@/api/services/**`, `@/api/clients/**`, относительные пути между файлами слоя (`http-client.mdc`, `api-services.mdc`).
21
+ - Внутри слоя: типы из `@/types` и enum из `@/types/enums` (**`public-imports.mdc`**); импорты `@/api/services/**`, `@/api/clients/**`, относительные пути между файлами слоя (`http-client.mdc`, `api-services.mdc`).
22
22
  - Не должен:
23
23
  - тянуть в себя UI или store;
24
24
  - смешивать HTTP‑слой и доменный слой — использовать мапперы.
@@ -33,7 +33,7 @@ alwaysApply: false
33
33
 
34
34
  - **Входящий адаптер**: UI — ввод пользователя, отображение; зависит от store и доменных типов, не от транспорта.
35
35
  - **Оркестрация сценариев**: store (slices, thunk) — вызывает сервисы, кладёт в state **доменные** модели после маппинга.
36
- - **Исходящий порт (контракт к backend)**: публичный API **`@/api`** (barrel `app/src/api/index.ts`; реализация — в `app/src/api/services/**` и т.д., см. `api-public-imports.mdc`).
36
+ - **Исходящий порт (контракт к backend)**: публичный API **`@/api`** (barrel `app/src/api/index.ts`; реализация — в `app/src/api/services/**` и т.д., см. `public-imports.mdc`).
37
37
  - **Исходящий адаптер**: общая реализация HTTP в **`app/src/lib/clients/**`** и экземпляры в **`app/src/api/clients/**`**.
38
38
 
39
39
  ## Фича как срез
@@ -44,7 +44,7 @@ alwaysApply: false
44
44
 
45
45
  - Всегда использовать алиас `@/...` для импортов между слоями.
46
46
  - Внутри одного модуля/фичи можно использовать относительные импорты, но **без подъёма выше корня фичи** (избегать `../../../`).
47
- - При обращении из компонентов, хуков, утилит и других модулей к чужому слою или фиче использовать только **public API** (barrel/index‑файлы и явно экспортируемые сущности), не делать deep‑импорты внутренних файлов других фич; для регламентированных слоёв — **`layer-barrel-exports.mdc`** и `*-public-imports.mdc`; для API‑слоя снаружи `app/src/api/**` — **`api-public-imports.mdc`** (только `@/api`).
47
+ - При обращении из компонентов, хуков, утилит и других модулей к чужому слою или фиче использовать только **public API** (barrel/index‑файлы и явно экспортируемые сущности), не делать deep‑импорты внутренних файлов других фич; для регламентированных слоёв — **`layer-barrel-exports.mdc`** и `public-imports.mdc`; для API‑слоя снаружи `app/src/api/**` — **`public-imports.mdc`** (только `@/api`).
48
48
  - При добавлении нового кода проверять:
49
49
  - если модуль переиспользуемый — он должен зависеть только от более "низких" слоёв (types, utils, api), но не от страниц.
50
50
 
@@ -55,7 +55,7 @@ alwaysApply: false
55
55
  - Локальные компоненты: поддиректории `components/**` внутри страницы.
56
56
  - Связанный store: `app/src/store/slices/OrderCheckout/**`.
57
57
  - API: `app/src/api/services/OrdersApi/OrderCheckout/**` (имя корневого сервиса взять из принятой в проекте схемы).
58
- - Типы: `app/src/types/**` с экспортом через barrel **`app/src/types/index.ts`** (`types-public-imports.mdc`).
58
+ - Типы: `app/src/types/**` с экспортом через barrel **`app/src/types/index.ts`** (`public-imports.mdc`).
59
59
 
60
60
  # Требование к агенту
61
61
 
@@ -35,19 +35,11 @@ alwaysApply: true
35
35
  - сначала локально улучшить архитектуру минимальными шагами;
36
36
  - оставить код в консистентном состоянии.
37
37
 
38
- # ESLint, Stylelint и плагины
38
+ # Линтеры
39
39
 
40
- - Учитывать **все активные правила ESLint** и **подключённые плагины** проекта (конфиг: `app/eslint.config.mjs`, базовые пресеты в т.ч. `@sh/eslint-config-react`, `@sh/eslint-config-boundaries` и локальные overrides).
41
- - Учитывать **Stylelint** для CSS и CSS-in-JS (конфиг: `app/.stylelintrc`; порядок свойств — `css-property-order-stylelint.mdc`).
42
- - Новый или изменённый код не должен нарушать эти правила.
43
- - После **каждого** изменения кода агент **обязан** выполнить **`post-change-lint.mdc`**: полный прогон **`lint:js`** и **`lint:css`**, анализ вывода, исправление срабатываний в зоне задачи.
44
- - Отключение правила (`eslint-disable`) — только **точечно** (строка/небольшой блок) и с **кратким комментарием**, зачем это нужно; отключать «на весь файл» без веской причины не следует.
40
+ Lint/stylelint только **`post-change-lint.mdc`**; ESLint config: `app/eslint.config.mjs`. Отключение правила (`eslint-disable`) только **точечно** (строка/небольшой блок) с кратким комментарием «зачем».
45
41
 
46
42
  # Требование к агенту
47
43
 
48
- При каждом изменении:
49
- - Поддерживать принцип **“boy scout rule”**:
50
- - оставлять модуль в немного лучшем состоянии, чем до изменения (простые, безопасные улучшения).
44
+ - **Boy scout rule:** оставлять модуль немного лучше, чем до изменения (простые, безопасные улучшения).
51
45
  - Не жертвовать архитектурой и слоями ради краткости реализации.
52
- - **Не завершать задачу**, пока не пройдены обязательные линтеры (`post-change-lint.mdc`).
53
-
@@ -17,11 +17,11 @@ alwaysApply: false
17
17
  - API (`app/src/api/**`) не тянет UI/store, использует мапперы; без прямого `fetch` в сервисах (кроме оговорённых исключений).
18
18
  - **Импорты и организация кода**:
19
19
  - Использование алиаса `@/...` вместо относительных импортов выше по дереву.
20
- - Отсутствие deep‑импортов во внешние фичи; использование только public API; в файлах вне `app/src/api/**` импорты из API — только `from '@/api'` (`api-public-imports.mdc`, дублирует ESLint).
20
+ - Отсутствие deep‑импортов во внешние фичи; использование только public API; в файлах вне `app/src/api/**` импорты из API — только `from '@/api'` (`public-imports.mdc`, дублирует ESLint).
21
21
  - При новых/изменённых модулях в регламентированных слоях — реэкспорт публичных символов в корневой barrel по **`layer-barrel-exports.mdc`**.
22
22
  - Размещение новых файлов в корректных слоях и директориях фич.
23
23
  - **Типы и TS‑строгость**:
24
- - Не допускать новых `any`; предпочитать доменные типы из `@/types` (barrel, см. `types-public-imports.mdc`).
24
+ - Не допускать новых `any`; предпочитать доменные типы из `@/types` (barrel, см. `public-imports.mdc`).
25
25
  - Проверять корректность пропсов/возвращаемых типов, особенно в UI и API‑слое.
26
26
  - **UI и стили**:
27
27
  - Для компонентов и стилей сверяться с `react-ui.mdc` и `next-app-core.mdc`:
@@ -1,28 +1,16 @@
1
1
  ---
2
2
  description: Порядок CSS-свойств по Stylelint (idiomatic-order) — для любых стилей в проекте
3
3
  globs:
4
- - app/src/**/*.{css,ts,tsx}
4
+ - app/src/ui/**/*.styles.ts
5
+ - app/src/ui/**/*.styles.tsx
6
+ - app/src/ui/**/styles.ts
7
+ - app/src/ui/**/styles.tsx
5
8
  - app/**/*.css
6
9
  alwaysApply: false
7
10
  ---
8
11
 
9
12
  # Порядок CSS-свойств (как в Stylelint)
10
13
 
11
- Действует для **любого** CSS в репозитории: `.css`, стилевые блоки в `styles.ts` / `styles.tsx`, `styled` / Linaria и другой CSS-in-JS в `.ts` / `.tsx`, если этот код попадает под `yarn lint:css`.
14
+ Для CSS в `.css`, `styles.ts(x)`, `styled` / Linaria порядок свойств как в **`app/.stylelintrc`** (`@sh/stylelint-config-react` `stylelint-config-idiomatic-order`).
12
15
 
13
- Источник: `app/.stylelintrc` `@sh/stylelint-config-react` пакет **`stylelint-config-idiomatic-order`** (правило `order/properties-order`). Свойства, не попавшие в список, идут **в конце блока в алфавитном порядке** (`unspecified: bottomAlphabetical`).
14
-
15
- Пиши объявления в **одном** блоке в такой последовательности групп:
16
-
17
- 1. **`composes`** — только для CSS Modules (если есть).
18
- 2. **`all`**
19
- 3. **Позиционирование:** `position`, `z-index`, затем `top`, `right`, `bottom`, `left`.
20
- 4. **Отображение и раскладка:** `display`, `overflow`.
21
- 5. **Размеры:** `width`, `min-width`, `max-width`, `height`, `min-height`, `max-height`, `box-sizing`.
22
- 6. **Flex:** `flex`, `flex-basis`, `flex-direction`, `flex-flow`, `flex-grow`, `flex-shrink`, `flex-wrap`, `align-content`, `align-items`, `align-self`, `justify-content`, `order`.
23
- 7. **Внутренние отступы:** `padding-top`, `padding-right`, `padding-bottom`, `padding-left`.
24
- 8. **Рамка:** общие `border`, `border-width`, `border-style`, `border-color`, `border-radius`; затем для сторон **сверху по часовой** — `border-top` и его `-width`, `-style`, `-color`, `-radius`, то же для `right`, `bottom`, `left`.
25
- 9. **Внешние отступы:** `margin-top`, `margin-right`, `margin-bottom`, `margin-left`.
26
- 10. **Остальные свойства** — после перечисленных, **по алфавиту** (типографика, фон, анимации, `cursor`, и т.д.).
27
-
28
- Автоисправление из каталога `app`: `yarn lint:css --fix` (проверяет `**/*.{css,ts}`).
16
+ Не дублировать список свойств вручную. Автоисправление из `app/`: **`yarn lint:css --fix`** (или менеджер пакетов репо). Полный прогон **`post-change-lint.mdc`**.