@bonesofspring/ai-rules 0.1.42 → 0.2.1

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 (103) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/CONTRIBUTING.md +102 -0
  3. package/README.md +2 -0
  4. package/bin/cli.js +4 -2
  5. package/fragments/BUGBOT.md +23 -0
  6. package/package.json +10 -2
  7. package/presets/claude/next/BUGBOT.md +16 -0
  8. package/presets/claude/next/CLAUDE.md +6 -2
  9. package/presets/claude/next/agents/README.md +77 -15
  10. package/presets/claude/next/agents/api-contract-reviewer.md +1 -1
  11. package/presets/claude/next/agents/build-verifier.md +2 -0
  12. package/presets/claude/next/agents/code-reviewer.md +1 -1
  13. package/presets/claude/next/agents/feature-developer.md +8 -21
  14. package/presets/claude/next/agents/playwright-test-generator.md +16 -65
  15. package/presets/claude/next/agents/playwright-test-healer.md +16 -51
  16. package/presets/claude/next/agents/playwright-test-planner.md +15 -55
  17. package/presets/claude/next/agents/task-analyst.md +1 -1
  18. package/presets/claude/next/agents/task-router.md +50 -128
  19. package/presets/claude/next/agents/tech-writer.md +1 -1
  20. package/presets/claude/next/commands/task.md +1 -1
  21. package/presets/claude/next/hooks.json +17 -0
  22. package/presets/claude/next/rules/README.md +7 -3
  23. package/presets/claude/next/rules/api-and-data/api-services.md +3 -3
  24. package/presets/claude/next/rules/api-and-data/http-client.md +2 -2
  25. package/presets/claude/next/rules/api-and-data/store-rtk.md +2 -2
  26. package/presets/claude/next/rules/architecture/README.md +9 -11
  27. package/presets/claude/next/rules/architecture/api-public-imports.md +3 -26
  28. package/presets/claude/next/rules/architecture/architecture-boundaries-ui.md +15 -0
  29. package/presets/claude/next/rules/architecture/architecture-boundaries.md +10 -7
  30. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +44 -69
  31. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +6 -6
  32. package/presets/claude/next/rules/architecture/public-imports.md +46 -0
  33. package/presets/claude/next/rules/architecture/reference-features.md +4 -1
  34. package/presets/claude/next/rules/architecture/types-public-imports.md +3 -29
  35. package/presets/claude/next/rules/stack/README.md +2 -1
  36. package/presets/claude/next/rules/stack/navigation-router-ui.md +15 -0
  37. package/presets/claude/next/rules/stack/navigation-router.md +2 -1
  38. package/presets/claude/next/rules/stack/next-app-core.md +20 -70
  39. package/presets/claude/next/rules/stack/no-type-assertion.md +3 -2
  40. package/presets/claude/next/rules/stack/types-jsdoc.md +1 -1
  41. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +6 -0
  42. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +20 -1
  43. package/presets/claude/next/rules/tooling-and-review/code-quality.md +3 -11
  44. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +22 -59
  45. package/presets/claude/next/rules/tooling-and-review/package-manager.md +6 -15
  46. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +14 -24
  47. package/presets/claude/next/rules/ui-and-accessibility/README.md +1 -2
  48. package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +6 -18
  49. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +5 -4
  50. package/presets/claude/next/skills/feature-delivery/SKILL.md +5 -20
  51. package/presets/claude/next/team/README.md +1 -0
  52. package/presets/claude/next/team/fixtures/bugfix-standard.json +15 -0
  53. package/presets/claude/next/team/fixtures/feature-full.json +16 -0
  54. package/presets/claude/next/team/fixtures/feature-light.json +17 -0
  55. package/presets/cursor/next/AGENTS.md +3 -10
  56. package/presets/cursor/next/BUGBOT.md +2 -0
  57. package/presets/cursor/next/agents/README.md +97 -15
  58. package/presets/cursor/next/agents/api-contract-reviewer.md +1 -1
  59. package/presets/cursor/next/agents/build-verifier.md +2 -0
  60. package/presets/cursor/next/agents/code-reviewer.md +2 -2
  61. package/presets/cursor/next/agents/feature-developer.md +9 -30
  62. package/presets/cursor/next/agents/task-analyst.md +1 -1
  63. package/presets/cursor/next/agents/task-router.md +49 -127
  64. package/presets/cursor/next/agents/tech-writer.md +1 -1
  65. package/presets/cursor/next/commands/task.md +1 -1
  66. package/presets/cursor/next/rules/README.md +27 -8
  67. package/presets/cursor/next/rules/agent-team-intake.mdc +2 -2
  68. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +14 -1
  69. package/presets/cursor/next/rules/api-public-imports.mdc +3 -24
  70. package/presets/cursor/next/rules/api-services.mdc +3 -3
  71. package/presets/cursor/next/rules/architecture-boundaries-ui.mdc +15 -0
  72. package/presets/cursor/next/rules/architecture-boundaries.mdc +7 -7
  73. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +3 -11
  74. package/presets/cursor/next/rules/code-review-mr.mdc +20 -46
  75. package/presets/cursor/next/rules/css-property-order-stylelint.mdc +6 -18
  76. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +45 -22
  77. package/presets/cursor/next/rules/http-client.mdc +2 -2
  78. package/presets/cursor/next/rules/layer-barrel-exports.mdc +6 -6
  79. package/presets/cursor/next/rules/navigation-router-stack.mdc +1 -1
  80. package/presets/cursor/next/rules/navigation-router-ui.mdc +16 -0
  81. package/presets/cursor/next/rules/next-app-core.mdc +18 -71
  82. package/presets/cursor/next/rules/no-cross-component-styles-import.mdc +3 -53
  83. package/presets/cursor/next/rules/no-type-assertion-as-import-export.mdc +4 -1
  84. package/presets/cursor/next/rules/package-manager.mdc +6 -15
  85. package/presets/cursor/next/rules/post-change-lint.mdc +14 -24
  86. package/presets/cursor/next/rules/public-imports.mdc +48 -0
  87. package/presets/cursor/next/rules/react-ui.mdc +5 -4
  88. package/presets/cursor/next/rules/reference-features.mdc +5 -1
  89. package/presets/cursor/next/rules/store-rtk.mdc +2 -2
  90. package/presets/cursor/next/rules/types-jsdoc.mdc +1 -1
  91. package/presets/cursor/next/rules/types-public-imports.mdc +3 -26
  92. package/presets/cursor/next/skills/feature-delivery/SKILL.md +5 -20
  93. package/presets/cursor/next/team/README.md +1 -0
  94. package/presets/cursor/next/team/fixtures/bugfix-standard.json +15 -0
  95. package/presets/cursor/next/team/fixtures/feature-full.json +16 -0
  96. package/presets/cursor/next/team/fixtures/feature-light.json +17 -0
  97. package/scripts/README.md +84 -0
  98. package/scripts/golden-prompts.json +276 -0
  99. package/scripts/preset-manifest.json +72 -0
  100. package/scripts/regression-results/.gitkeep +0 -0
  101. package/scripts/validate-preset.sh +484 -0
  102. package/presets/claude/next/rules/ui-and-accessibility/component-styles.md +0 -56
  103. package/presets/cursor/next/rules/feature-delivery-flow.mdc +0 -74
@@ -1,67 +1,30 @@
1
- # Code review merge requests
2
-
3
- ## Когда применять
4
-
5
- - Пользователь просит: «проведи ревью», «оценить MR/ветку/дифф», «посмотри изменения».
6
- - Опираться на локальный репозиторий: текущую ветку, `git diff` и открытые файлы, а не на данные внешнего API хостинга.
7
-
8
- ## Что обязан проверить агент
9
-
10
- ### Архитектура и слои
11
-
12
- Соблюдение `architecture/architecture-boundaries.md`, `stack/next-app-core.md` и при сетевых изменениях — `api-and-data/http-client.md`:
13
-
14
- - UI (`app/src/ui/**`) не ходит напрямую в HTTP‑клиент и не знает DTO.
15
- - Store (`app/src/store/**`) не зависит от UI; границы транспортных типов и ошибок — `api-and-data/store-rtk.md` / `api-and-data/http-client.md`.
16
- - API (`app/src/api/**`) не тянет UI/store, использует мапперы; без прямого `fetch` в сервисах (кроме оговорённых исключений).
17
-
18
- ### Импорты и организация кода
1
+ ---
2
+ paths:
3
+ - .claude/agents/code-reviewer.md
4
+ - .claude/commands/**/*
5
+ - .claude/team/**/*
6
+ ---
19
7
 
20
- - Использование алиаса `@/...` вместо относительных импортов выше по дереву.
21
- - Отсутствие deep‑импортов во внешние фичи; только public API; в файлах вне `app/src/api/**` импорты из API — только `from '@/api'` (`architecture/api-public-imports.md`, дублирует ESLint).
22
- - При новых/изменённых модулях в регламентированных слоях — реэкспорт публичных символов в корневой barrel по **`architecture/layer-barrel-exports.md`**.
23
- - Размещение новых файлов в корректных слоях и директориях фич.
24
-
25
- ### Типы и TS‑строгость
26
-
27
- - Не допускать новых `any`; предпочитать доменные типы из `@/types` (barrel, см. `architecture/types-public-imports.md`).
28
- - Проверять корректность пропсов/возвращаемых типов, особенно в UI и API‑слое.
29
-
30
- ### UI и стили
31
-
32
- Для компонентов и стилей сверяться с `ui-and-accessibility/react-ui.md` и `stack/next-app-core.md`:
33
-
34
- - Соблюдать принятый способ стилей и общие UI‑примитивы/токены, а не «магические» значения.
35
- - Сохранять консистентность с существующими компонентами и паттернами.
36
-
37
- ### Тесты
38
-
39
- - Для нетривиальных изменений:
40
- - либо обновлены/добавлены unit‑тесты (`testing/tests-unit.md`),
41
- - либо e2e‑сценарии/спеки отражают новую логику (`testing/playwright-agents.md`, `testing/tests-e2e-structure.md`).
42
- - При правках **общего HTTP‑клиента** — наличие/актуальность **behavior‑тестов клиента** (`api-and-data/http-client.md`, `testing/tests-unit.md`).
43
- - **Указывать, какие именно тесты** стоит добавить или поправить.
8
+ # Code review merge requests
44
9
 
45
- ### Линтеры (обязательно)
10
+ On-demand rule for review flows. **Procedure and output format:** skill `code-review`.
46
11
 
47
- **`tooling-and-review/post-change-lint.md`**:
12
+ ## Checklist references
48
13
 
49
- - Перед финализацией отчёта по ревью и после любых правок по итогам ревью: полный прогон **`lint:js`** и **`lint:css`** из `app/`.
50
- - В отчёт включить **все сообщения ESLint и Stylelint (errors и warnings)** по файлам из диффа MR/ветки; запуск — по всему проекту, **фильтрация вывода — к путям из `git diff`**.
51
- - Не считать ревью/правки завершёнными, пока линтеры не проходят или не зафиксирован блокер в ответе.
52
- - Полная валидация как в CI: **`lint`** (= `lint:js` + `lint:css` + `type-check`) — уместна перед итогом крупного MR.
14
+ - Architecture layers: `architecture/architecture-boundaries.md`, `stack/next-app-core.md`; network: `api-and-data/http-client.md`
15
+ - Imports: `architecture/public-imports.md`, `architecture/layer-barrel-exports.md`
16
+ - UI: `ui-and-accessibility/react-ui.md`
17
+ - Tests: `testing/tests-unit.md`, `testing/playwright-agents.md`, `testing/tests-e2e-structure.md`
18
+ - Lint gate before final report: `tooling-and-review/post-change-lint.md`
53
19
 
54
- ## Глубина и формат ревью
20
+ ## When to load
55
21
 
56
- - Фокус на **изменениях MR** (дифф относительно целевой ветки), а не на всём проекте.
57
- - Сначала **высокоуровневый обзор** (что делает MR, риски, архитектурные замечания), затем список конкретных комментариев.
58
- - Каждый комментарий:
59
- - **конкретный** (файл/участок и проблема),
60
- - **практичный** (вариант исправления по существующим паттернам),
61
- - без «больших рефакторингов» в духе `tooling-and-review/code-quality.md`, если задача локальная.
22
+ - User asks for review/MR/diff
23
+ - Pipeline step `code-reviewer`
24
+ - BUGBOT automated review
62
25
 
63
- ## Ограничения для агента
26
+ ## Constraints
64
27
 
65
- - Не придумывать несуществующие метаданные из хостинга (лейблы MR, авторов, статусы CI), если их нет в локальных данных.
66
- - Не менять общую архитектуру фичи без прямого запроса пользователя.
67
- - Следовать принципу «boy scout rule»: предлагать улучшения, которые реально можно внести в рамках MR.
28
+ - Focus on MR diff, not the whole repo.
29
+ - Use local `git diff` do not invent hosting metadata.
30
+ - Boy scout rule: suggest fixes feasible within the MR scope.
@@ -1,20 +1,11 @@
1
1
  # Менеджер пакетов (терминал)
2
2
 
3
- Перед **`npm install` / `yarn` / `pnpm` / `bun`** и любыми **`… run …`** (lint, test, dev, build) **сначала определи**, какой менеджер закреплён в этом репозитории, и **используй только его**.
3
+ Перед **`npm install` / `yarn` / `pnpm` / `bun`** и **`… run …`** определи менеджер репозитория и **используй только его**.
4
4
 
5
- ## Как определить (по убыванию надёжности)
5
+ ## Как определить
6
6
 
7
- 1. Поле **`packageManager`** в `package.json` (корень монорепо или `app/package.json`) — `yarn@…`, `pnpm@…`, `npm@…`, `bun@…`.
8
- 2. **Lockfile** рядом с тем `package.json`:
9
- - `yarn.lock` **yarn**
10
- - `pnpm-lock.yaml` → **pnpm**
11
- - `package-lock.json` → **npm**
12
- - `bun.lock` / `bun.lockb` → **bun**
13
- 3. Если неоднозначно — где лежат **`node_modules`** и какой lockfile обновляют в CI.
7
+ 1. **`packageManager`** в `package.json` (корень или `app/package.json`).
8
+ 2. **Lockfile** рядом: `yarn.lock` yarn; `pnpm-lock.yaml` → pnpm; `package-lock.json` → npm; `bun.lock(b)` → bun.
9
+ 3. Если неоднозначно — где `node_modules` и какой lockfile в CI.
14
10
 
15
- ## Как запускать
16
-
17
- - Рабочий каталог — там, где **`package.json`** с нужными **scripts** (в этом репозитории — **`app/`**).
18
- - Примеры: `yarn lint`, `pnpm run test` — **в соответствии с обнаруженным менеджером**.
19
-
20
- Если менеджер неочевиден — **посмотри файлы** инструментами чтения, **не угадывай**.
11
+ Рабочий каталог для scripts — **`app/`**. Примеры: `yarn lint`, `pnpm run test`. Не угадывай — проверь файлы.
@@ -2,42 +2,32 @@
2
2
 
3
3
  ## Когда применять
4
4
 
5
- После **любого** изменения исходников в репозитории: правка, создание или удаление файлов в `app/**` (TS/TSX/JS/MJS, CSS, styled/Linaria в `.ts`/`.tsx`, markdown с ESLint и т.д.).
5
+ После **любого** изменения исходников в `app/**` (TS/TSX/JS/MJS, CSS, styled/Linaria в `.ts`/`.tsx`).
6
6
 
7
- Исключения без прогона линтеров: только правки **документации вне `app/`**, конфигов CI, `.claude/rules/**`, если **не** менялся исполняемый код приложения.
7
+ Исключения: правки документации вне `app/`, конфигов CI, `.claude/rules/**`, если исполняемый код приложения не менялся.
8
+
9
+ **Pipeline exception:** если задача идёт через agent team и следующий шаг — `build-verifier`, developer может ограничиться lint/type-check **изменённых файлов**; полный прогон — обязанность `build-verifier`. В single-agent режиме (без pipeline) — всегда полный прогон.
8
10
 
9
11
  ## Обязательные команды
10
12
 
11
- Рабочий каталог — **`app/`** (там `package.json` со скриптами). Менеджер пакетов — **`tooling-and-review/package-manager.md`**.
13
+ Рабочий каталог — **`app/`**. Менеджер пакетов — **`tooling-and-review/package-manager.md`**.
12
14
 
13
- 1. **`lint:js`** — полный ESLint по проекту (`eslint .` с расширениями из скрипта).
15
+ 1. **`lint:js`** — полный ESLint по проекту.
14
16
  2. **`lint:css`** — полный Stylelint (`**/*.{css,ts}`).
15
17
 
16
- **Всегда запускать обе команды**, даже если задача не касалась стилей: Stylelint проверяет и CSS-in-JS в `.ts`.
17
-
18
- Точечный ESLint/Stylelint только на один файл **не заменяет** полный прогон перед завершением задачи.
18
+ Точечный lint на один файл **не заменяет** полный прогон перед завершением задачи (кроме pipeline exception выше).
19
19
 
20
- ## Алгоритм для агента
20
+ ## Алгоритм
21
21
 
22
22
  1. Завершить правки кода.
23
- 2. Запустить **`lint:js`** и **`lint:css`** из `app/` (через терминал, не «на глаз»).
24
- 3. **Проанализировать весь вывод**: errors и warnings.
25
- 4. **Исправить** все срабатывания в **изменённых файлах** и связанных с задачей; для Stylelint сначала пробовать **`lint:css --fix`**, если правило автоисправимо.
26
- 5. При ненулевом exit code повторить шаги 2–4 до успешного прогона или явного блокера.
27
- 6. **Не считать задачу выполненной**, пока оба линтера не завершились с кодом 0 **или** в ответе пользователю не зафиксирован блокер (например, легаси вне скоупа) с перечислением оставшихся замечаний.
23
+ 2. Запустить **`lint:js`** и **`lint:css`** из `app/`.
24
+ 3. Проанализировать весь вывод; исправить errors/warnings в изменённых файлах; для Stylelint — **`lint:css --fix`** если автоисправимо.
25
+ 4. Повторить до exit code 0 или зафиксировать блокер в ответе пользователю.
26
+ 5. **`type-check`** при изменениях TypeScript. CI-уровень: **`lint`** (= `lint:js` + `lint:css` + `type-check`).
28
27
 
29
28
  ## Что исправлять
30
29
 
31
30
  - **Errors** — обязательно.
32
- - **Warnings** — обязательно в файлах из текущей задачи; вне скоупа — не чинить «заодно», но **упомянуть** в ответе, если мешают нулевому exit code.
33
- - **`eslint-disable`** — только точечно, с кратким комментарием «зачем» (`tooling-and-review/code-quality.md`).
34
-
35
- ## Связанные проверки
36
-
37
- - **`type-check`** — обязателен при изменениях TypeScript (`stack/next-app-core.md`); не подменяет ESLint/Stylelint.
38
- - Полная валидация как в CI: **`lint`** (= `lint:js` + `lint:css` + `type-check`) — уместна перед крупным MR.
39
-
40
- ## Конфиги
31
+ - **Warnings** — обязательно в файлах задачи; вне скоупа — упомянуть, если мешают нулевому exit code.
41
32
 
42
- - ESLint: `app/eslint.config.mjs`
43
- - Stylelint: `app/.stylelintrc` (порядок свойств — `ui-and-accessibility/css-property-order.md`)
33
+ Конфиги: `app/eslint.config.mjs`, `app/.stylelintrc` (порядок CSS — `ui-and-accessibility/css-property-order.md`).
@@ -5,6 +5,5 @@
5
5
  | Файл | Содержание | Загрузка |
6
6
  |------|------------|----------|
7
7
  | `no-props-spread.md` | Явные пропсы, без `{...props}` | session start |
8
- | `component-styles.md` | Колокация стилей, `Root` | session start |
9
- | `css-property-order.md` | Порядок CSS (Stylelint idiomatic-order) | session start |
8
+ | `css-property-order.md` | Порядок CSS (Stylelint idiomatic-order) | `paths: styles.ts`, `.css` |
10
9
  | `react-ui.md` | Структура компонентов, `.data.ts`, хуки | `paths: app/src/ui/**` |
@@ -1,26 +1,14 @@
1
1
  ---
2
2
  paths:
3
- - app/src/**/*.{css,ts,tsx}
3
+ - app/src/ui/**/*.styles.ts
4
+ - app/src/ui/**/*.styles.tsx
5
+ - app/src/ui/**/styles.ts
6
+ - app/src/ui/**/styles.tsx
4
7
  - app/**/*.css
5
8
  ---
6
9
 
7
10
  # Порядок CSS-свойств (как в Stylelint)
8
11
 
9
- Действует для **любого** CSS в репозитории: `.css`, стилевые блоки в `styles.ts` / `styles.tsx`, `styled` / Linaria и другой CSS-in-JS в `.ts` / `.tsx`, если этот код попадает под `lint:css`.
12
+ Порядок свойств как в **`app/.stylelintrc`** (`stylelint-config-idiomatic-order`). Не дублировать список вручную.
10
13
 
11
- Источник: `app/.stylelintrc` `@sh/stylelint-config-react` пакет **`stylelint-config-idiomatic-order`** (правило `order/properties-order`). Свойства, не попавшие в список, идут **в конце блока в алфавитном порядке** (`unspecified: bottomAlphabetical`).
12
-
13
- Пиши объявления в **одном** блоке в такой последовательности групп:
14
-
15
- 1. **`composes`** — только для CSS Modules (если есть).
16
- 2. **`all`**
17
- 3. **Позиционирование:** `position`, `z-index`, затем `top`, `right`, `bottom`, `left`.
18
- 4. **Отображение и раскладка:** `display`, `overflow`.
19
- 5. **Размеры:** `width`, `min-width`, `max-width`, `height`, `min-height`, `max-height`, `box-sizing`.
20
- 6. **Flex:** `flex`, `flex-basis`, `flex-direction`, `flex-flow`, `flex-grow`, `flex-shrink`, `flex-wrap`, `align-content`, `align-items`, `align-self`, `justify-content`, `order`.
21
- 7. **Внутренние отступы:** `padding-top`, `padding-right`, `padding-bottom`, `padding-left`.
22
- 8. **Рамка:** общие `border`, `border-width`, `border-style`, `border-color`, `border-radius`; затем для сторон **сверху по часовой** — `border-top` и его `-width`, `-style`, `-color`, `-radius`, то же для `right`, `bottom`, `left`.
23
- 9. **Внешние отступы:** `margin-top`, `margin-right`, `margin-bottom`, `margin-left`.
24
- 10. **Остальные свойства** — после перечисленных, **по алфавиту** (типографика, фон, анимации, `cursor`, и т.д.).
25
-
26
- Автоисправление из каталога `app`: `lint:css --fix` (проверяет `**/*.{css,ts}`; менеджер пакетов — `tooling-and-review/package-manager.md`).
14
+ Автоисправление из `app/`: **`lint:css --fix`**. Полный прогон **`tooling-and-review/post-change-lint.md`**.
@@ -28,7 +28,7 @@ paths:
28
28
  - Локальные подкомпоненты, используемые только этим блоком, выносятся в **`./components/<ComponentName>/`** относительно папки родительского компонента (не оставлять крупные куски JSX и «внутренние» компоненты в том же файле, что и родитель).
29
29
  - У каждого такого подкомпонента — **своя** папка с тем же именем, что и публичное имя компонента:
30
30
  - `ComponentName.tsx` — разметка и композиция;
31
- - `styles.ts` — только стили этого подкомпонента (см. `ui-and-accessibility/component-styles.md`: не тянуть `styles` соседних компонентов);
31
+ - `styles.ts` — только стили этого подкомпонента (не тянуть `styles` соседних компонентов — см. § Стили ниже);
32
32
  - при необходимости — `ComponentName.data.ts`, `ComponentName.utils.ts`, `ComponentName.hooks.ts` по тем же правилам префикса, что и у родителя;
33
33
  - опционально `index.ts` с реэкспортом.
34
34
  - Родитель импортирует подкомпонент из `./components/...`, а не держит его реализацию inline.
@@ -58,8 +58,9 @@ paths:
58
58
 
59
59
  # Стили и дизайн‑токены
60
60
 
61
- - **Корневой** styled-элемент компонента в соседнем `styles` — **`Root`** (`<s.Root>`). Подробнее: `ui-and-accessibility/component-styles.md`.
62
- - Порядок объявлений в CSS / `styled` как требует Stylelint: см. `ui-and-accessibility/css-property-order.md`.
61
+ - **Корневой** styled в соседнем `styles` — экспорт **`Root`**; в JSX: `<s.Root>` при `import * as s from './styles'`. Вложенные — `Title`, `List` и т.д. Не `Container`/`Wrapper` для единственной обёртки.
62
+ - **Запрещено** импортировать `styles` другого компонента (`../Other/styles`, `../../styles`). Разрешено: `./styles`, общие примитивы из `@/ui/components/...` или пакетов дизайн-системы.
63
+ - Порядок CSS / `styled` — Stylelint idiomatic-order: `ui-and-accessibility/css-property-order.md` (грузится на `styles.ts` / `.css`).
63
64
  - Для визуала использовать **тот стек стилей и токенов, который уже в проекте** (переменные, тема, общие классы, дизайн‑пакет).
64
65
  - Избегать:
65
66
  - inline‑стилей, кроме простых случаев;
@@ -72,7 +73,7 @@ paths:
72
73
  - **Не передавать пропы в компоненты через spread** (`<Foo {...x} />`). Только явные атрибуты; подробности — `ui-and-accessibility/no-props-spread.md` (в `app/src/ui` это дополнительно ловит ESLint).
73
74
  - Описывать пропсы через `type Props = { ... }` или `interface Props { ... }`.
74
75
  - Не использовать `any`; при необходимости — обобщения (`<T>`), `unknown`, type guards.
75
- - Для доменных сущностей использовать типы из `@/types` (и enum из `@/types/enums`), а не описывать их заново (`architecture/types-public-imports.md`).
76
+ - Для доменных сущностей использовать типы из `@/types` (и enum из `@/types/enums`), а не описывать их заново (`architecture/public-imports.md`).
76
77
 
77
78
  # Логика и side effects
78
79
 
@@ -5,26 +5,11 @@ description: Delivers Next.js frontend features end-to-end across domain types,
5
5
 
6
6
  # Feature Delivery
7
7
 
8
- ## Workflow
9
-
10
- 1. Read the task brief, acceptance criteria, and decomposition if present.
11
- 2. Read **`architecture/reference-features.md`** and mirror the closest reference feature.
12
- 3. Work in layer order: types -> API -> store -> UI -> **unit tests** -> e2e (if in scope).
13
- 4. Keep DTOs out of UI/store; expose domain types through `@/types` and API calls through `@/api`.
14
- 5. Prefer small, reviewable edits; update barrels when adding public symbols.
15
- 6. Add or update focused tests for changed behavior.
16
- 7. Run project validation from `app/`: `lint:js`, `lint:css`, and `type-check` when TypeScript changed.
17
-
18
- ## Rule Map
19
-
20
- - Core stack and layers: `rules/stack/next-app-core.md`, `rules/architecture/architecture-boundaries.md`.
21
- - Data/API: `rules/api-and-data/http-client.md`, `rules/api-and-data/api-services.md`, `rules/api-and-data/store-rtk.md`.
22
- - Public imports: `rules/architecture/types-public-imports.md`, `rules/architecture/api-public-imports.md`, `rules/architecture/layer-barrel-exports.md`.
23
- - UI: `rules/ui-and-accessibility/react-ui.md`, `react-a11y-coding.md`, `no-props-spread.md`, `component-styles.md`.
24
- - App Router: `rules/stack/next-app-router.md`.
25
- - Tests: `rules/testing/tests-unit.md`, `rules/testing/tests-e2e-structure.md`, `rules/testing/playwright-agents.md`.
26
- - Finish: `rules/tooling-and-review/post-change-lint.md`, `rules/tooling-and-review/package-manager.md`.
8
+ 1. Read task brief, acceptance criteria, and decomposition if present.
9
+ 2. Read **`rules/architecture/feature-delivery-workflow.md`** and **`rules/architecture/reference-features.md`** — follow layer order and mirror closest reference feature.
10
+ 3. Add or update focused tests for changed behavior.
11
+ 4. Validation from `app/`: see **`rules/tooling-and-review/post-change-lint.md`** (pipeline: scoped lint OK if next step is `build-verifier`).
27
12
 
28
13
  ## Handoff
29
14
 
30
- Summarize completed work by layer, validation results, and known gaps. If this is part of an agent team task, update `.claude/team/tasks/<slug>/status.json`.
15
+ Summarize by layer, validation results, and known gaps. Agent team: update `.claude/team/tasks/<slug>/status.json`.
@@ -7,6 +7,7 @@
7
7
  ```
8
8
  .claude/team/
9
9
  active-task.json
10
+ fixtures/ # pipeline profile examples (feature-full, feature-light, bugfix-standard)
10
11
  tasks/
11
12
  <slug>/
12
13
  pipeline.json
@@ -0,0 +1,15 @@
1
+ {
2
+ "slug": "example-bugfix-standard",
3
+ "intent": "bugfix",
4
+ "profile": "standard",
5
+ "summary": "Regression fix with review",
6
+ "steps": [
7
+ { "agent": "debugger", "label": "Root cause" },
8
+ { "agent": "feature-developer", "label": "Fix if needed", "skipIf": "debugger.fixed" },
9
+ { "agent": "build-verifier", "label": "Validation gate" },
10
+ { "agent": "code-reviewer", "label": "Code review" }
11
+ ],
12
+ "humanGates": [],
13
+ "autoChain": true,
14
+ "skipped": []
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "slug": "example-feature-full",
3
+ "intent": "feature",
4
+ "profile": "full",
5
+ "summary": "Multi-layer feature with e2e coverage",
6
+ "steps": [
7
+ { "agent": "task-analyst", "label": "Clarify and decompose" },
8
+ { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
9
+ { "agent": "build-verifier", "label": "Validation gate" },
10
+ { "agent": "code-reviewer", "label": "Code review" },
11
+ { "agent": "qa-tester", "label": "E2E", "scope": "e2e-only" }
12
+ ],
13
+ "humanGates": ["after:task-analyst"],
14
+ "autoChain": true,
15
+ "skipped": []
16
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "slug": "example-feature-light",
3
+ "intent": "feature",
4
+ "profile": "light",
5
+ "summary": "Trivial single-file change with explicit AC",
6
+ "steps": [
7
+ { "agent": "feature-developer", "label": "Implement" },
8
+ { "agent": "build-verifier", "label": "Validation gate" }
9
+ ],
10
+ "humanGates": [],
11
+ "autoChain": true,
12
+ "skipped": [
13
+ { "agent": "task-analyst", "reason": "Explicit AC and single-file scope" },
14
+ { "agent": "code-reviewer", "reason": "Light profile — non-trivial app changes should use standard" },
15
+ { "agent": "qa-tester", "reason": "No e2e AC" }
16
+ ]
17
+ }
@@ -8,7 +8,7 @@ See `.cursor/rules/README.md` for the full catalog and loading strategy.
8
8
 
9
9
  | Задача | Куда смотреть |
10
10
  |--------|----------------|
11
- | Любая новая work-задача | `/task` → `commands/task.md` + `agent-team-orchestrator.mdc` |
11
+ | Любая новая work-задача | `/task` → `commands/task.md` + `agent-team-orchestrator.mdc` (+ `agent-team-intake.mdc` on-demand) |
12
12
  | Новая фича end-to-end | skill `feature-delivery` + `feature-delivery-workflow.mdc` |
13
13
  | Стек и слои | `next-app-core.mdc` |
14
14
  | Эталонные фичи | `reference-features.mdc` (заполнить пути в репо) |
@@ -23,16 +23,9 @@ See `.cursor/rules/README.md` for the full catalog and loading strategy.
23
23
  - Простой one-liner без архитектурного риска — можно без pipeline, если пользователь явно просит.
24
24
  - Вопросы «как работает X» — ответ без `/task`.
25
25
 
26
- ## Intent → pipeline (кратко)
26
+ ## Pipeline routing
27
27
 
28
- | intent | Типичный pipeline |
29
- |--------|-------------------|
30
- | `feature` | analyst → developer (+ unit) → build-verifier → reviewer → e2e/QA |
31
- | `bugfix` | debugger → developer (skip if fixed) → build-verifier → reviewer |
32
- | `ci-fix` | ci-investigator → developer (skip if resolved) → build-verifier |
33
- | `migration` | analyst → migration-specialist → developer → build-verifier → reviewer → QA |
34
-
35
- Полная таблица — `agents/README.md`, router — `agents/task-router.md`.
28
+ Intent detection, profiles (`full` / `standard` / `light`), and default steps — **only** in `agents/task-router.md`. Schema and examples — `agents/README.md`.
36
29
 
37
30
  ## Install
38
31
 
@@ -12,3 +12,5 @@ Follow the **`code-review` skill** and **`code-review-mr.mdc`** for the full che
12
12
  ## Review style
13
13
 
14
14
  Lead with concrete findings: file, impact, fix direction. Skip style-only nits unless they violate lint rules or project conventions.
15
+
16
+ **Source of truth:** `packages/ai-rules/fragments/BUGBOT.md` — sync manually when updating.
@@ -60,18 +60,100 @@
60
60
 
61
61
  Правило: `agent-team-orchestrator.mdc`. План: `pipeline.json` в `.cursor/team/tasks/<slug>/`.
62
62
 
63
- ## Intent → pipeline (кратко)
64
-
65
- | intent | Типичный pipeline |
66
- |--------|-------------------|
67
- | `feature` | analyst → developer (+ unit) → build-verifier → reviewer → e2e/QA |
68
- | `bugfix` | debugger → developer (skipIf fixed) → build-verifier → reviewer |
69
- | `ci-fix` | ci-investigator → developer (skipIf resolved) → build-verifier |
70
- | `migration` | analyst → migration-specialist → developer → reviewer → QA |
71
- | `perf-audit` | performance-auditor |
72
- | `a11y` | analyst → developer → a11y-reviewer → code-reviewer |
73
- | `unit-only` | unit-planner unit-generator (или healer) |
74
- | `e2e-only` | playwright planner generator (или healer) |
75
- | `docs-only` | analyst tech-writer |
76
-
77
- Опциональные шаги (router добавляет по контексту): `api-contract-reviewer`, `accessibility-reviewer`, `security-reviewer`, `performance-auditor`, `tech-writer`.
63
+ ## Pipeline routing
64
+
65
+ **Source of truth:** intent table, profiles (`full` / `standard` / `light`), and default steps — **`task-router.md`** only. Do not duplicate intent→pipeline tables in entry docs.
66
+
67
+ ## pipeline.json reference
68
+
69
+ ### Top-level fields
70
+
71
+ | Field | Required | Description |
72
+ |-------|----------|-------------|
73
+ | `slug` | yes | Task identifier |
74
+ | `intent` | yes | From router intent detection |
75
+ | `profile` | no | `full` \| `standard` \| `light` — see `task-router.md` § Pipeline profiles |
76
+ | `summary` | yes | One-line task summary |
77
+ | `steps` | yes | Ordered agent steps |
78
+ | `humanGates` | no | e.g. `["after:task-analyst"]` |
79
+ | `autoChain` | no | Default `true` |
80
+ | `skipped` | no | Roles skipped with reason |
81
+
82
+ ### Step fields
83
+
84
+ | Field | Required | Description |
85
+ |-------|----------|-------------|
86
+ | `agent` | yes | Subagent name (kebab-case) or array for `parallel: true` |
87
+ | `label` | yes | Short human-readable step name |
88
+ | `scope` | no | e.g. `unit-in-dev`, `e2e-only`, `regression`, `full` |
89
+ | `skipIf` | no | `debugger.fixed` \| `ci-investigator.resolved` |
90
+ | `parallel` | no | When `true` and `agent` is array — invoke all in one turn |
91
+
92
+ ### Minimal template
93
+
94
+ ```json
95
+ {
96
+ "slug": "<slug>",
97
+ "intent": "feature",
98
+ "summary": "One-line task summary",
99
+ "steps": [
100
+ { "agent": "task-analyst", "label": "Clarify and decompose" },
101
+ { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
102
+ { "agent": "build-verifier", "label": "Lint, type-check, unit smoke" },
103
+ { "agent": "code-reviewer", "label": "Code review" }
104
+ ],
105
+ "humanGates": ["after:task-analyst"],
106
+ "autoChain": true,
107
+ "skipped": []
108
+ }
109
+ ```
110
+
111
+ ### Example: parallel reviewers
112
+
113
+ ```json
114
+ {
115
+ "intent": "feature",
116
+ "steps": [
117
+ { "agent": "task-analyst", "label": "Clarify" },
118
+ { "agent": "feature-developer", "label": "Implement", "scope": "unit-in-dev" },
119
+ { "agent": "build-verifier", "label": "Validation gate" },
120
+ {
121
+ "agent": ["accessibility-reviewer", "security-reviewer"],
122
+ "parallel": true,
123
+ "label": "A11y and security"
124
+ },
125
+ { "agent": "code-reviewer", "label": "Review" }
126
+ ],
127
+ "humanGates": ["after:task-analyst"]
128
+ }
129
+ ```
130
+
131
+ ### Example: bugfix skipIf
132
+
133
+ ```json
134
+ {
135
+ "intent": "bugfix",
136
+ "steps": [
137
+ { "agent": "debugger", "label": "Root cause" },
138
+ { "agent": "feature-developer", "label": "Fix if needed", "skipIf": "debugger.fixed" },
139
+ { "agent": "build-verifier", "label": "Validation" },
140
+ { "agent": "code-reviewer", "label": "Review" }
141
+ ],
142
+ "humanGates": []
143
+ }
144
+ ```
145
+
146
+ ### Initial status.json
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
+ ```
@@ -13,7 +13,7 @@ You are an API contract reviewer for a layered Next.js frontend (`@/types`, `@/a
13
13
  2. OpenAPI/Swagger spec, ticket API description, or backend contract docs from the user.
14
14
  3. Changed files in `app/src/types/**`, `app/src/api/**`, mocks, store thunks.
15
15
 
16
- Apply **`types-public-imports.mdc`**, **`api-public-imports.mdc`**, **`api-services.mdc`**, **`http-client.mdc`**.
16
+ Apply **`public-imports.mdc`**, **`api-services.mdc`**, **`http-client.mdc`**.
17
17
 
18
18
  ## Review scope
19
19
 
@@ -7,6 +7,8 @@ model: fast
7
7
 
8
8
  You are a build verification specialist. You **validate** implementation quality before code review — you do not edit production code or tests.
9
9
 
10
+ **SSOT for full validation in pipeline:** run complete **`lint:js`**, **`lint:css`**, and **`type-check`** from `app/` even if feature-developer ran scoped checks.
11
+
10
12
  ## Inputs
11
13
 
12
14
  1. `.cursor/team/tasks/<slug>/brief.md` and `decomposition.md`.
@@ -2,7 +2,7 @@
2
2
  name: code-reviewer
3
3
  description: Expert code review specialist. Reviews after feature development using code-review-mr checklist. Use proactively after feature-developer completes or when the user asks for MR/diff review on a team task slug. Writes only review artifacts/status; never edits production code.
4
4
  readonly: true
5
- model: inherit
5
+ model: fast
6
6
  ---
7
7
 
8
8
  You are a senior code reviewer. You may write only review artifacts under `.cursor/team/**` and update task `status.json`; do not modify production code.
@@ -13,7 +13,7 @@ You are a senior code reviewer. You may write only review artifacts under `.curs
13
13
  2. `.cursor/team/tasks/<slug>/decomposition.md` — check coverage of planned tasks.
14
14
  3. Git diff for changed files (`git diff`, `git status`).
15
15
 
16
- Apply the **`code-review` skill** and checklist from **`code-review-mr.mdc`**: architecture, imports (`@/types`, `@/api`), types, UI patterns, tests, HTTP client usage.
16
+ Apply the **`code-review` skill** and **`code-review-mr.mdc`** checklist.
17
17
 
18
18
  ## Tests gate
19
19
 
@@ -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.
@@ -2,7 +2,7 @@
2
2
  name: task-analyst
3
3
  description: Task analysis specialist. Clarifies requirements, validates acceptance criteria, and decomposes work into concrete tasks. Use for /feature-start, task intake, or when the user asks to analyze or decompose a feature before coding. Writes only team artifacts; never writes production code.
4
4
  readonly: true
5
- model: inherit
5
+ model: fast
6
6
  ---
7
7
 
8
8
  You are a senior business/technical analyst for a Next.js frontend team.