@bonesofspring/ai-rules 0.1.42 → 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.
- package/CHANGELOG.md +22 -0
- package/package.json +1 -1
- package/presets/claude/next/CLAUDE.md +1 -1
- package/presets/claude/next/agents/README.md +61 -0
- package/presets/claude/next/agents/api-contract-reviewer.md +1 -1
- package/presets/claude/next/agents/build-verifier.md +2 -0
- package/presets/claude/next/agents/feature-developer.md +8 -21
- package/presets/claude/next/agents/task-router.md +24 -126
- package/presets/claude/next/commands/task.md +1 -1
- package/presets/claude/next/rules/README.md +3 -3
- package/presets/claude/next/rules/api-and-data/api-services.md +3 -3
- package/presets/claude/next/rules/api-and-data/http-client.md +2 -2
- package/presets/claude/next/rules/api-and-data/store-rtk.md +2 -2
- package/presets/claude/next/rules/architecture/README.md +8 -11
- package/presets/claude/next/rules/architecture/api-public-imports.md +3 -26
- package/presets/claude/next/rules/architecture/architecture-boundaries.md +6 -6
- package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +44 -69
- package/presets/claude/next/rules/architecture/layer-barrel-exports.md +5 -5
- package/presets/claude/next/rules/architecture/public-imports.md +46 -0
- package/presets/claude/next/rules/architecture/reference-features.md +4 -1
- package/presets/claude/next/rules/architecture/types-public-imports.md +3 -29
- package/presets/claude/next/rules/stack/next-app-core.md +20 -70
- package/presets/claude/next/rules/stack/no-type-assertion.md +3 -2
- package/presets/claude/next/rules/stack/types-jsdoc.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +6 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +14 -1
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +3 -11
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +2 -2
- package/presets/claude/next/rules/tooling-and-review/package-manager.md +6 -15
- package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +14 -24
- package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +6 -18
- package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +1 -1
- package/presets/claude/next/skills/feature-delivery/SKILL.md +5 -20
- package/presets/cursor/next/AGENTS.md +1 -1
- package/presets/cursor/next/agents/README.md +81 -0
- package/presets/cursor/next/agents/api-contract-reviewer.md +1 -1
- package/presets/cursor/next/agents/build-verifier.md +2 -0
- package/presets/cursor/next/agents/code-reviewer.md +1 -1
- package/presets/cursor/next/agents/feature-developer.md +9 -30
- package/presets/cursor/next/agents/task-router.md +23 -125
- package/presets/cursor/next/commands/task.md +1 -1
- package/presets/cursor/next/rules/README.md +6 -7
- package/presets/cursor/next/rules/agent-team-intake.mdc +2 -2
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +14 -1
- package/presets/cursor/next/rules/api-public-imports.mdc +3 -24
- package/presets/cursor/next/rules/api-services.mdc +3 -3
- package/presets/cursor/next/rules/architecture-boundaries.mdc +6 -6
- package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +3 -11
- package/presets/cursor/next/rules/code-review-mr.mdc +2 -2
- package/presets/cursor/next/rules/css-property-order-stylelint.mdc +6 -18
- package/presets/cursor/next/rules/feature-delivery-workflow.mdc +45 -22
- package/presets/cursor/next/rules/http-client.mdc +2 -2
- package/presets/cursor/next/rules/layer-barrel-exports.mdc +5 -5
- package/presets/cursor/next/rules/next-app-core.mdc +18 -71
- package/presets/cursor/next/rules/no-type-assertion-as-import-export.mdc +4 -1
- package/presets/cursor/next/rules/package-manager.mdc +6 -15
- package/presets/cursor/next/rules/post-change-lint.mdc +14 -24
- package/presets/cursor/next/rules/public-imports.mdc +48 -0
- package/presets/cursor/next/rules/react-ui.mdc +1 -1
- package/presets/cursor/next/rules/reference-features.mdc +5 -1
- package/presets/cursor/next/rules/store-rtk.mdc +2 -2
- package/presets/cursor/next/rules/types-jsdoc.mdc +1 -1
- package/presets/cursor/next/rules/types-public-imports.mdc +3 -26
- package/presets/cursor/next/skills/feature-delivery/SKILL.md +5 -20
- package/presets/cursor/next/rules/feature-delivery-flow.mdc +0 -74
|
@@ -39,4 +39,4 @@ alwaysApply: false
|
|
|
39
39
|
- Правя файл, где уже есть такие комментарии, **поддерживать тот же стиль**, а не смешивать с англоязычными или «теговыми» блоками.
|
|
40
40
|
- Не раздувать комментарии: одна-две фразы на тип, одна строка на поле — норма; исключение — действительно сложная доменная оговорка.
|
|
41
41
|
|
|
42
|
-
См. также импорты и barrel: `
|
|
42
|
+
См. также импорты и barrel: `public-imports.mdc`.
|
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
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
|
-
#
|
|
6
|
+
# Deprecated
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
- **Запрещено** для потребителей слоя обходить barrel: любой импорт вида `@/types/<что‑угодно>`, кроме перечисленного ниже исключения для enum.
|
|
11
|
-
- Отдельно **нельзя** импортировать из вложенных файлов `*.types.ts` по путям `@/types/**/…*.types.ts` (типичный deep‑импорт).
|
|
12
|
-
- **Исключение — enum**: перечисления можно импортировать только из `@/types/enums` / `@/types/enums.ts` (не из других файлов под `@/types`).
|
|
13
|
-
|
|
14
|
-
## Внутри слоя `app/src/types/**`
|
|
15
|
-
|
|
16
|
-
- При реализации и поддержке barrel‑файла допустимы **относительные** импорты между файлами внутри `app/src/types` (например `from './User.types'`). Это не относится к потребителям слоя.
|
|
17
|
-
|
|
18
|
-
## Примеры
|
|
19
|
-
|
|
20
|
-
```typescript
|
|
21
|
-
// ✅ Допустимо — доменные и транспортные сущности с теми именами, что экспортирует barrel
|
|
22
|
-
import type { TUserProfile } from '@/types'
|
|
23
|
-
import { SomeEnum } from '@/types/enums'
|
|
24
|
-
|
|
25
|
-
// ❌ Запрещено (обход публичного API)
|
|
26
|
-
import type { TUserProfile } from '@/types/User.types'
|
|
27
|
-
import { TransportError } from '@/types/TransportError'
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
При ревью и правках кода **не добавлять** новые импорты типов из `@/types/...` кроме `@/types` и `@/types/enums`.
|
|
31
|
-
- Новые публичные типы — реэкспорт в `app/src/types/index.ts` по **`layer-barrel-exports.mdc`**.
|
|
8
|
+
Содержимое перенесено в **`public-imports.mdc`** (раздел `@/types`).
|
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
3. Work in layer order: types -> API contract/mappers -> services -> store -> UI -> mocks -> **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: `next-app-core.mdc`, `architecture-boundaries.mdc`.
|
|
21
|
-
- Data/API: `http-client.mdc`, `api-services.mdc`, `store-rtk.mdc`.
|
|
22
|
-
- Public imports: `types-public-imports.mdc`, `api-public-imports.mdc`, `layer-barrel-exports.mdc`.
|
|
23
|
-
- UI: `react-ui.mdc`, `react-a11y-coding.mdc`, `no-props-spread.mdc`, `no-cross-component-styles-import.mdc`.
|
|
24
|
-
- App Router: `next-app-router.mdc`.
|
|
25
|
-
- Tests: `tests-unit.mdc`, `tests-e2e-structure.mdc`, `playwright-agents.mdc`.
|
|
26
|
-
- Finish: `post-change-lint.mdc`, `package-manager.mdc`.
|
|
8
|
+
1. Read task brief, acceptance criteria, and decomposition if present.
|
|
9
|
+
2. Read **`feature-delivery-workflow.mdc`** and **`reference-features.mdc`** — follow layer order and mirror closest reference feature.
|
|
10
|
+
3. Add or update focused tests for changed behavior.
|
|
11
|
+
4. Validation from `app/`: see **`post-change-lint.mdc`** (pipeline: scoped lint OK if next step is `build-verifier`).
|
|
27
12
|
|
|
28
13
|
## Handoff
|
|
29
14
|
|
|
30
|
-
Summarize
|
|
15
|
+
Summarize by layer, validation results, and known gaps. Agent team: update `.cursor/team/tasks/<slug>/status.json`.
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Сквозной flow фичи (типы, API, моки, store, UI, тесты) и точки регистрации в репозитории
|
|
3
|
-
alwaysApply: false
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Поставка фичи: порядок слоёв и регистрация
|
|
7
|
-
|
|
8
|
-
Плейсхолдеры: `<FeatureName>`, `<ServiceRoot>`, `<Area>` — нейтральные имена; реальные имена брать из соседних фич того же типа.
|
|
9
|
-
|
|
10
|
-
## Инварианты перед кодом
|
|
11
|
-
|
|
12
|
-
- Найти в том же слое фичу сопоставимой сложности и **повторить структуру каталогов и паттерн именования**.
|
|
13
|
-
- Не добавлять `any`; при необходимости — `unknown` и сужение типа.
|
|
14
|
-
- После правок выполнить проверки из **`package.json` каталога `app/`** (типизация, ESLint и связанные скрипты), не оставлять новых ошибок без причины.
|
|
15
|
-
|
|
16
|
-
## Полный flow (слой за слоем)
|
|
17
|
-
|
|
18
|
-
```mermaid
|
|
19
|
-
flowchart LR
|
|
20
|
-
typesNode["types_domain"]
|
|
21
|
-
apiNode["api_services_mappers"]
|
|
22
|
-
mocksNode["mocks_msw"]
|
|
23
|
-
storeNode["store_slice_thunks"]
|
|
24
|
-
mwNode["middleware_optional"]
|
|
25
|
-
uiNode["ui_pages_components"]
|
|
26
|
-
unitNode["unit_tests"]
|
|
27
|
-
e2eNode["e2e_plans_specs"]
|
|
28
|
-
|
|
29
|
-
typesNode --> apiNode
|
|
30
|
-
apiNode --> mocksNode
|
|
31
|
-
apiNode --> storeNode
|
|
32
|
-
storeNode --> mwNode
|
|
33
|
-
storeNode --> uiNode
|
|
34
|
-
apiNode --> unitNode
|
|
35
|
-
storeNode --> unitNode
|
|
36
|
-
uiNode --> unitNode
|
|
37
|
-
uiNode --> e2eNode
|
|
38
|
-
mocksNode --> e2eNode
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Чеклист по слоям (куда класть и что зарегистрировать)
|
|
42
|
-
|
|
43
|
-
1. **Типы** — `app/src/types/**` (или согласованное имя вроде `<FeatureName>.types.ts`). Доменная модель — источник правды для UI и store.
|
|
44
|
-
|
|
45
|
-
2. **API** — `app/src/api/services/<ServiceRoot>/<Segment>/`: вызовы HTTP, DTO ответов, `*responseMappers.ts`. Новые публичные экспорты (фасады сервисов, типы, **константы путей** для моков) добавить в **`app/src/api/index.ts`** (`@/api`).
|
|
46
|
-
|
|
47
|
-
3. **Моки (MSW)** — `app/src/mocks/data/<feature>/`: `data.ts`, `handlers.ts`; собрать хендлеры в **`app/src/mocks/handlers.ts`**. В хендлерах использовать **те же константы путей**, что и в API (импорт из `@/api`), **не дублировать сырые строки URL**. В репозитории могут быть **два контура** (браузерный worker и Node `setupServer` для тестов): общий список хендлеров должен оставаться согласованным — при добавлении проверять существующие входные точки в `app/src/mocks/**`, чтобы моки были доступны там, где ожидается.
|
|
48
|
-
|
|
49
|
-
4. **Store** — `app/src/store/slices/<FeatureName>/`: slice, thunk’и вызывают методы из **`@/api`**, не HTTP‑клиент. Подключить редюсер в **`app/src/store/reducers.ts`**. Новый **middleware**: реализация в `app/src/store/middleware/**`, регистрация в **`app/src/store/index.ts`** в цепочке `configureStore` (порядок `prepend`/`concat` — как у соседних middleware в этом файле).
|
|
50
|
-
|
|
51
|
-
5. **UI** — `app/src/ui/pages/<FeatureName>Page/**` и/или `app/src/ui/components/**`; стили — как в проекте (см. `package.json` и соседние компоненты). Данные и побочные эффекты загрузки — через store/hooks, без DTO и без прямого HTTP‑клиента.
|
|
52
|
-
|
|
53
|
-
6. **Unit‑тесты** — `*.spec.ts` / `*.spec.tsx` (см. `tests-unit.mdc`); мапперы и нетривиальная логика — обязательно покрыть; e2e Jest не запускает (см. `jest.config.js`).
|
|
54
|
-
|
|
55
|
-
7. **E2E** — план: `app/__tests__/e2e/<Area>/<plan>.cases.md`; реализация: `*.spec.ts` рядом; детали — `tests-e2e-structure.mdc`.
|
|
56
|
-
|
|
57
|
-
## Частичные сценарии (вход с середины)
|
|
58
|
-
|
|
59
|
-
| Задача | Минимум действий |
|
|
60
|
-
|--------|------------------|
|
|
61
|
-
| Только API + типы | Типы в `app/src/types/**`, сервис и мапперы, реэкспорт в `app/src/api/index.ts`; unit на маппер. |
|
|
62
|
-
| Только моки | Константа пути уже в `@/api`; `handlers.ts` + данные; регистрация в `app/src/mocks/handlers.ts`; при необходимости убедиться, что хендлеры подхватываются и в браузерном, и в Node‑контуре MSW, если в проекте используются оба. |
|
|
63
|
-
| Только store | Thunk на существующий метод `@/api`; slice + `app/src/store/reducers.ts`. |
|
|
64
|
-
| Только UI | Читать готовое состояние из store; не добавлять HTTP/DTO; `data-testid` при необходимости для e2e. |
|
|
65
|
-
| Только e2e | Синхронизировать `*.cases.md` и спеки; page object и `_shared`. |
|
|
66
|
-
|
|
67
|
-
## Антипаттерны
|
|
68
|
-
|
|
69
|
-
- DTO и структуры ответа бэкенда в UI или в нетипизированных кусках store.
|
|
70
|
-
- Прямой вызов HTTP‑клиента из компонента или thunk’а в обход сервисного слоя.
|
|
71
|
-
- Deep‑импорты в `app/src/api/services/**/…` из UI/store там, где принят импорт из `@/api`.
|
|
72
|
-
- Проброс пропсов в компоненты через `{...props}` — см. `no-props-spread.mdc`.
|
|
73
|
-
|
|
74
|
-
Подробные границы слоёв: `architecture-boundaries.mdc`, `store-rtk.mdc`, `api-services.mdc`, `react-ui.mdc`.
|