@bonesofspring/ai-rules 0.2.1 → 0.2.2
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/README.md +10 -20
- package/bin/cli.js +73 -260
- package/package.json +4 -13
- package/presets/claude/ios-swift/CLAUDE.md +27 -0
- package/presets/claude/ios-swift/README.md +29 -0
- package/presets/claude/ios-swift/commands/README.md +3 -0
- package/presets/claude/ios-swift/rules/README.md +44 -0
- package/presets/claude/ios-swift/rules/api-and-data/README.md +9 -0
- package/presets/claude/ios-swift/rules/api-and-data/networking.md +49 -0
- package/presets/claude/ios-swift/rules/architecture/README.md +10 -0
- package/presets/claude/ios-swift/rules/architecture/boundaries.md +33 -0
- package/presets/claude/ios-swift/rules/architecture/feature-delivery.md +60 -0
- package/presets/claude/ios-swift/rules/stack/README.md +10 -0
- package/presets/claude/ios-swift/rules/stack/ios-app-core.md +42 -0
- package/presets/claude/ios-swift/rules/stack/swift-conventions.md +51 -0
- package/presets/claude/ios-swift/rules/testing/README.md +10 -0
- package/presets/claude/ios-swift/rules/testing/ui.md +41 -0
- package/presets/claude/ios-swift/rules/testing/unit.md +41 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/README.md +11 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +38 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +41 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/post-change-build.md +31 -0
- package/presets/claude/ios-swift/rules/ui-and-accessibility/README.md +10 -0
- package/presets/claude/ios-swift/rules/ui-and-accessibility/swiftui.md +61 -0
- package/presets/claude/ios-swift/rules/ui-and-accessibility/viewmodels.md +43 -0
- package/presets/claude/next/CLAUDE.md +5 -33
- package/presets/claude/next/README.md +0 -10
- package/presets/claude/next/agents/README.md +0 -126
- package/presets/claude/next/agents/playwright-test-generator.md +65 -16
- package/presets/claude/next/agents/playwright-test-healer.md +51 -16
- package/presets/claude/next/agents/playwright-test-planner.md +55 -15
- package/presets/claude/next/commands/README.md +2 -10
- package/presets/claude/next/hooks/README.md +2 -5
- package/presets/claude/next/rules/README.md +11 -29
- package/presets/claude/next/rules/api-and-data/README.md +1 -7
- package/presets/claude/next/rules/architecture/README.md +2 -10
- package/presets/claude/next/rules/stack/README.md +1 -10
- package/presets/claude/next/rules/testing/README.md +1 -9
- package/presets/claude/next/rules/tooling-and-review/README.md +1 -14
- package/presets/claude/next/rules/ui-and-accessibility/README.md +1 -7
- package/presets/claude/next/skills/README.md +1 -11
- package/presets/cursor/ios-swift/README.md +17 -0
- package/presets/cursor/ios-swift/commands/README.md +3 -0
- package/presets/cursor/ios-swift/rules/README.md +33 -0
- package/presets/cursor/ios-swift/rules/architecture-boundaries.mdc +34 -0
- package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +39 -0
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +42 -0
- package/presets/cursor/ios-swift/rules/feature-delivery-workflow.mdc +61 -0
- package/presets/cursor/ios-swift/rules/ios-app-core.mdc +43 -0
- package/presets/cursor/ios-swift/rules/networking-services.mdc +49 -0
- package/presets/cursor/ios-swift/rules/post-change-build.mdc +32 -0
- package/presets/cursor/ios-swift/rules/state-and-viewmodels.mdc +43 -0
- package/presets/cursor/ios-swift/rules/swift-conventions.mdc +51 -0
- package/presets/cursor/ios-swift/rules/swiftui-ui.mdc +61 -0
- package/presets/cursor/ios-swift/rules/tests-ui.mdc +41 -0
- package/presets/cursor/ios-swift/rules/tests-unit.mdc +41 -0
- package/presets/cursor/next/commands/README.md +1 -49
- package/presets/cursor/next/rules/README.md +0 -67
- package/presets/cursor/next/rules/api-services.mdc +10 -12
- package/presets/cursor/next/rules/architecture-boundaries.mdc +12 -31
- package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +4 -5
- package/presets/cursor/next/rules/code-review-mr.mdc +40 -21
- package/presets/cursor/next/rules/next-app-core.mdc +61 -18
- package/presets/cursor/next/rules/no-props-spread.mdc +4 -27
- package/presets/cursor/next/rules/playwright-agents.mdc +1 -2
- package/presets/cursor/next/rules/react-ui.mdc +3 -33
- package/presets/cursor/next/rules/store-rtk.mdc +6 -13
- package/presets/cursor/next/rules/tests-unit.mdc +10 -30
- package/CHANGELOG.md +0 -22
- package/CONTRIBUTING.md +0 -102
- package/fragments/BUGBOT.md +0 -23
- package/presets/claude/next/BUGBOT.md +0 -16
- package/presets/claude/next/agents/accessibility-reviewer.md +0 -65
- package/presets/claude/next/agents/api-contract-reviewer.md +0 -69
- package/presets/claude/next/agents/build-verifier.md +0 -64
- package/presets/claude/next/agents/ci-investigator.md +0 -62
- package/presets/claude/next/agents/code-reviewer.md +0 -62
- package/presets/claude/next/agents/debugger.md +0 -63
- package/presets/claude/next/agents/feature-developer.md +0 -27
- package/presets/claude/next/agents/migration-specialist.md +0 -69
- package/presets/claude/next/agents/performance-auditor.md +0 -68
- package/presets/claude/next/agents/qa-tester.md +0 -56
- package/presets/claude/next/agents/security-reviewer.md +0 -64
- package/presets/claude/next/agents/solution-architect.md +0 -70
- package/presets/claude/next/agents/task-analyst.md +0 -109
- package/presets/claude/next/agents/task-router.md +0 -94
- package/presets/claude/next/agents/tech-writer.md +0 -60
- package/presets/claude/next/agents/unit-test-generator.md +0 -37
- package/presets/claude/next/agents/unit-test-healer.md +0 -38
- package/presets/claude/next/agents/unit-test-planner.md +0 -62
- package/presets/claude/next/commands/feature-continue.md +0 -51
- package/presets/claude/next/commands/feature-start.md +0 -30
- package/presets/claude/next/commands/task-continue.md +0 -49
- package/presets/claude/next/commands/task.md +0 -50
- package/presets/claude/next/commands/technical-retro.md +0 -58
- package/presets/claude/next/hooks/chain-team-phases.sh +0 -342
- package/presets/claude/next/hooks/guard-shell-command.sh +0 -77
- package/presets/claude/next/hooks.json +0 -17
- package/presets/claude/next/rules/api-and-data/api-services.md +0 -57
- package/presets/claude/next/rules/api-and-data/http-client.md +0 -40
- package/presets/claude/next/rules/api-and-data/store-rtk.md +0 -65
- package/presets/claude/next/rules/architecture/api-public-imports.md +0 -8
- package/presets/claude/next/rules/architecture/architecture-boundaries-ui.md +0 -15
- package/presets/claude/next/rules/architecture/architecture-boundaries.md +0 -75
- package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +0 -79
- package/presets/claude/next/rules/architecture/layer-barrel-exports.md +0 -58
- package/presets/claude/next/rules/architecture/public-imports.md +0 -46
- package/presets/claude/next/rules/architecture/reference-features.md +0 -37
- package/presets/claude/next/rules/architecture/types-public-imports.md +0 -8
- package/presets/claude/next/rules/stack/arrow-functions.md +0 -45
- package/presets/claude/next/rules/stack/navigation-router-ui.md +0 -15
- package/presets/claude/next/rules/stack/navigation-router.md +0 -62
- package/presets/claude/next/rules/stack/next-app-core.md +0 -33
- package/presets/claude/next/rules/stack/next-app-router.md +0 -36
- package/presets/claude/next/rules/stack/no-type-assertion.md +0 -59
- package/presets/claude/next/rules/stack/types-jsdoc.md +0 -37
- package/presets/claude/next/rules/testing/playwright-agents.md +0 -74
- package/presets/claude/next/rules/testing/tests-e2e-structure.md +0 -52
- package/presets/claude/next/rules/testing/tests-unit.md +0 -66
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +0 -15
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +0 -140
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +0 -42
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +0 -30
- package/presets/claude/next/rules/tooling-and-review/package-manager.md +0 -11
- package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +0 -33
- package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +0 -14
- package/presets/claude/next/rules/ui-and-accessibility/no-props-spread.md +0 -57
- package/presets/claude/next/rules/ui-and-accessibility/react-a11y-coding.md +0 -37
- package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +0 -91
- package/presets/claude/next/skills/ci-investigation/SKILL.md +0 -36
- package/presets/claude/next/skills/code-review/SKILL.md +0 -26
- package/presets/claude/next/skills/debug-investigation/SKILL.md +0 -28
- package/presets/claude/next/skills/feature-delivery/SKILL.md +0 -15
- package/presets/claude/next/skills/playwright-e2e/SKILL.md +0 -31
- package/presets/claude/next/skills/technical-retro/SKILL.md +0 -40
- package/presets/claude/next/skills/unit-testing/SKILL.md +0 -32
- package/presets/claude/next/team/README.md +0 -47
- package/presets/claude/next/team/fixtures/bugfix-standard.json +0 -15
- package/presets/claude/next/team/fixtures/feature-full.json +0 -16
- package/presets/claude/next/team/fixtures/feature-light.json +0 -17
- package/presets/claude/next/team/tasks/.gitkeep +0 -1
- package/presets/cursor/next/AGENTS.md +0 -36
- package/presets/cursor/next/BUGBOT.md +0 -16
- package/presets/cursor/next/agents/README.md +0 -159
- package/presets/cursor/next/agents/accessibility-reviewer.md +0 -67
- package/presets/cursor/next/agents/api-contract-reviewer.md +0 -71
- package/presets/cursor/next/agents/build-verifier.md +0 -66
- package/presets/cursor/next/agents/ci-investigator.md +0 -64
- package/presets/cursor/next/agents/code-reviewer.md +0 -64
- package/presets/cursor/next/agents/debugger.md +0 -64
- package/presets/cursor/next/agents/feature-developer.md +0 -27
- package/presets/cursor/next/agents/migration-specialist.md +0 -71
- package/presets/cursor/next/agents/performance-auditor.md +0 -70
- package/presets/cursor/next/agents/playwright-test-generator.md +0 -26
- package/presets/cursor/next/agents/playwright-test-healer.md +0 -26
- package/presets/cursor/next/agents/playwright-test-planner.md +0 -28
- package/presets/cursor/next/agents/qa-tester.md +0 -57
- package/presets/cursor/next/agents/security-reviewer.md +0 -66
- package/presets/cursor/next/agents/solution-architect.md +0 -71
- package/presets/cursor/next/agents/task-analyst.md +0 -112
- package/presets/cursor/next/agents/task-router.md +0 -95
- package/presets/cursor/next/agents/tech-writer.md +0 -62
- package/presets/cursor/next/agents/unit-test-generator.md +0 -39
- package/presets/cursor/next/agents/unit-test-healer.md +0 -40
- package/presets/cursor/next/agents/unit-test-planner.md +0 -64
- package/presets/cursor/next/commands/feature-continue.md +0 -19
- package/presets/cursor/next/commands/feature-start.md +0 -33
- package/presets/cursor/next/commands/task-continue.md +0 -49
- package/presets/cursor/next/commands/task.md +0 -50
- package/presets/cursor/next/commands/technical-retro.md +0 -81
- package/presets/cursor/next/hooks/README.md +0 -8
- package/presets/cursor/next/hooks/chain-team-phases.sh +0 -380
- package/presets/cursor/next/hooks/guard-shell-command.sh +0 -77
- package/presets/cursor/next/hooks.json +0 -17
- package/presets/cursor/next/rules/agent-team-intake.mdc +0 -14
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +0 -139
- package/presets/cursor/next/rules/api-public-imports.mdc +0 -8
- package/presets/cursor/next/rules/architecture-boundaries-ui.mdc +0 -15
- package/presets/cursor/next/rules/arrow-functions.mdc +0 -46
- package/presets/cursor/next/rules/css-property-order-stylelint.mdc +0 -16
- package/presets/cursor/next/rules/feature-delivery-workflow.mdc +0 -76
- package/presets/cursor/next/rules/http-client.mdc +0 -42
- package/presets/cursor/next/rules/layer-barrel-exports.mdc +0 -59
- package/presets/cursor/next/rules/navigation-router-stack.mdc +0 -62
- package/presets/cursor/next/rules/navigation-router-ui.mdc +0 -16
- package/presets/cursor/next/rules/next-app-router.mdc +0 -36
- package/presets/cursor/next/rules/no-cross-component-styles-import.mdc +0 -8
- package/presets/cursor/next/rules/no-type-assertion-as-import-export.mdc +0 -60
- package/presets/cursor/next/rules/package-manager.mdc +0 -16
- package/presets/cursor/next/rules/post-change-lint.mdc +0 -38
- package/presets/cursor/next/rules/public-imports.mdc +0 -48
- package/presets/cursor/next/rules/react-a11y-coding.mdc +0 -37
- package/presets/cursor/next/rules/reference-features.mdc +0 -39
- package/presets/cursor/next/rules/technical-retro.mdc +0 -12
- package/presets/cursor/next/rules/types-jsdoc.mdc +0 -42
- package/presets/cursor/next/rules/types-public-imports.mdc +0 -8
- package/presets/cursor/next/skills/README.md +0 -15
- package/presets/cursor/next/skills/ci-investigation/SKILL.md +0 -36
- package/presets/cursor/next/skills/code-review/SKILL.md +0 -26
- package/presets/cursor/next/skills/debug-investigation/SKILL.md +0 -28
- package/presets/cursor/next/skills/feature-delivery/SKILL.md +0 -15
- package/presets/cursor/next/skills/playwright-e2e/SKILL.md +0 -31
- package/presets/cursor/next/skills/technical-retro/SKILL.md +0 -40
- package/presets/cursor/next/skills/unit-testing/SKILL.md +0 -32
- package/presets/cursor/next/team/README.md +0 -105
- package/presets/cursor/next/team/fixtures/bugfix-standard.json +0 -15
- package/presets/cursor/next/team/fixtures/feature-full.json +0 -16
- package/presets/cursor/next/team/fixtures/feature-light.json +0 -17
- package/presets/cursor/next/team/tasks/.gitkeep +0 -0
- package/scripts/README.md +0 -84
- package/scripts/golden-prompts.json +0 -276
- package/scripts/preset-manifest.json +0 -72
- package/scripts/regression-results/.gitkeep +0 -0
- package/scripts/validate-preset.sh +0 -484
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Паттерны React/Next UI и стилей (preset)
|
|
3
|
-
globs:
|
|
3
|
+
globs: src/ui/**/*.tsx
|
|
4
4
|
alwaysApply: false
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -22,43 +22,14 @@ alwaysApply: false
|
|
|
22
22
|
- `styles.ts` или соседний модуль стилей — по конвенции репозитория (CSS Modules, CSS-in-JS, и т.д.).
|
|
23
23
|
- `index.ts` — реэкспорт (если нужно наружу).
|
|
24
24
|
|
|
25
|
-
## Дочерние компоненты (`./components`)
|
|
26
|
-
|
|
27
|
-
- Локальные подкомпоненты, используемые только этим блоком, выносятся в **`./components/<ComponentName>/`** относительно папки родительского компонента (не оставлять крупные куски JSX и «внутренние» компоненты в том же файле, что и родитель).
|
|
28
|
-
- У каждого такого подкомпонента — **своя** папка с тем же именем, что и публичное имя компонента:
|
|
29
|
-
- `ComponentName.tsx` — разметка и композиция;
|
|
30
|
-
- `styles.ts` — только стили этого подкомпонента (не тянуть `styles` соседних компонентов — см. § Стили ниже);
|
|
31
|
-
- при необходимости — `ComponentName.data.ts`, `ComponentName.utils.ts`, `ComponentName.hooks.ts` по тем же правилам префикса, что и у родителя;
|
|
32
|
-
- опционально `index.ts` с реэкспортом.
|
|
33
|
-
- Родитель импортирует подкомпонент из `./components/...`, а не держит его реализацию inline.
|
|
34
|
-
|
|
35
25
|
Для переиспользуемого компонента:
|
|
36
26
|
- Папка с именем компонента:
|
|
37
27
|
- `ComponentName.tsx`
|
|
38
28
|
- файлы стилей по принятой схеме;
|
|
39
|
-
- опционально: `types.ts`, `
|
|
40
|
-
|
|
41
|
-
## Вспомогательные модули рядом с компонентом (именование)
|
|
42
|
-
|
|
43
|
-
**Префикс имени файла = публичное имя компонента** (как у `ComponentName.tsx` в этой папке), в **PascalCase**. Не вводить отдельные «говорящие» имена файлов по смыслу содержимого (`analysisPreparationIconMap.ts`, `buildAnalysisIdToNameMap.ts` и т.п.) — так теряется связь с компонентом и плодятся одноразовые названия.
|
|
44
|
-
|
|
45
|
-
**Суффикс по роли:**
|
|
46
|
-
|
|
47
|
-
| Суффикс | Назначение | Примеры содержимого |
|
|
48
|
-
|--------|------------|---------------------|
|
|
49
|
-
| `ComponentName.data.ts` | Статические данные и конфигурация для UI | мапы `id → иконка/лейбл`, константы списков, таблицы соответствий для отображения |
|
|
50
|
-
| `ComponentName.utils.ts` | Чистые функции без React | форматирование, предобработка пропсов/данных для рендера, `build…`/`map…`‑хелперы |
|
|
51
|
-
| `ComponentName.hooks.ts` | Хуки, используемые только этим блоком | локальные `use…` (если не вынесены в `src/ui/hooks/**`) |
|
|
52
|
-
|
|
53
|
-
- Несколько констант/мапов или несколько функций — **по-прежнему один** `.data.ts` и один `.utils.ts`, не дробить по «темам» отдельными файлами без веской причины (размер, разные зоны ответственности на уровне подкомпонентов).
|
|
54
|
-
- Если логика принадлежит **подкомпоненту** в подпапке (`components/Child/Child.tsx`), те же правила применяются к **`Child.data.ts`**, **`Child.utils.ts`** относительно этого подкомпонента.
|
|
55
|
-
- Тесты для утилит и данных — рядом в `__tests__/` или с суффиксом `.test.ts`, согласно `tests-unit.mdc`, с тем же префиксом (`RequestForAnalysisRecommendations.utils.test.ts` и т.д.).
|
|
29
|
+
- опционально: `types.ts`, `hooks.ts`.
|
|
56
30
|
|
|
57
31
|
# Стили и дизайн‑токены
|
|
58
32
|
|
|
59
|
-
- **Корневой** styled в соседнем `styles` — экспорт **`Root`**; в JSX: `<s.Root>` при `import * as s from './styles'`. Вложенные — `Title`, `List` и т.д. Не `Container`/`Wrapper` для единственной обёртки.
|
|
60
|
-
- **Запрещено** импортировать `styles` другого компонента (`../Other/styles`, `../../styles`). Разрешено: `./styles`, общие примитивы из `@/ui/components/...` или пакетов дизайн-системы.
|
|
61
|
-
- Порядок CSS / `styled` — Stylelint idiomatic-order: `css-property-order-stylelint.mdc` (грузится на `styles.ts` / `.css`).
|
|
62
33
|
- Для визуала использовать **тот стек стилей и токенов, который уже в проекте** (переменные, тема, общие классы, дизайн‑пакет).
|
|
63
34
|
- Избегать:
|
|
64
35
|
- inline‑стилей, кроме простых случаев;
|
|
@@ -68,11 +39,10 @@ alwaysApply: false
|
|
|
68
39
|
|
|
69
40
|
# Пропсы и типизация
|
|
70
41
|
|
|
71
|
-
- **Не передавать пропы в компоненты через spread** (`<Foo {...x} />`). Только явные атрибуты; подробности и исключения — `no-props-spread.mdc` (в `app/src/ui` это дополнительно ловит ESLint).
|
|
72
42
|
- Описывать пропсы через `type Props = { ... }` или `interface Props { ... }`.
|
|
73
43
|
- Не использовать `any`; при необходимости:
|
|
74
44
|
- обобщения (`<T>`), `unknown`, тип‑предикаты и user‑defined type guards.
|
|
75
|
-
- Для доменных сущностей использовать типы из `@/types
|
|
45
|
+
- Для доменных сущностей использовать типы из `@/types/**`, а не описывать их заново.
|
|
76
46
|
|
|
77
47
|
# Логика и side effects
|
|
78
48
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Redux Toolkit и состояние приложения
|
|
3
|
-
globs:
|
|
3
|
+
globs: src/store/**/*.ts
|
|
4
4
|
alwaysApply: false
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ alwaysApply: false
|
|
|
16
16
|
|
|
17
17
|
# Структура слайсов
|
|
18
18
|
|
|
19
|
-
- Каждый доменный модуль — свой слайс в `
|
|
19
|
+
- Каждый доменный модуль — свой слайс в `src/store/slices/**`.
|
|
20
20
|
- Слайс экспортирует:
|
|
21
21
|
- `reducer` по умолчанию;
|
|
22
22
|
- `actions` именованным экспортом;
|
|
@@ -30,23 +30,17 @@ alwaysApply: false
|
|
|
30
30
|
- Асинхронные запросы:
|
|
31
31
|
- через `createAsyncThunk` или RTK Query.
|
|
32
32
|
- внутри thunk:
|
|
33
|
-
- вызывать API через
|
|
34
|
-
- не вызывать HTTP‑клиент напрямую — только через
|
|
33
|
+
- вызывать API через сервисы из `@/api/services/**`;
|
|
34
|
+
- не вызывать HTTP‑клиент напрямую — только через сервисы `@/api/services/**`.
|
|
35
35
|
- Сайд‑эффекты (логирование, аналитика, работа с файлами):
|
|
36
|
-
- выносить в middleware (`
|
|
36
|
+
- выносить в middleware (`src/store/middleware/**`) или специализированные слайсы.
|
|
37
37
|
|
|
38
38
|
# Типизация
|
|
39
39
|
|
|
40
40
|
- Использовать `RootState`, `AppDispatch` и типизированные хуки `useAppDispatch`, `useAppSelector` (если есть).
|
|
41
|
-
- **HTTP и ошибки API**:
|
|
42
|
-
- не импортировать типы **сторонних HTTP‑библиотек**, которых нет в актуальных зависимостях и существующих слайсах (ориентир — **`package.json`** и соседние файлы);
|
|
43
|
-
- когда сервис возвращает **обёртку ответа** прикладного клиента — использовать **соответствующий тип из `@/types`** (как в barrel и в аналогичных thunk’ах);
|
|
44
|
-
- при ошибках после вызова сервиса — опираться на **тот же класс/контракт ошибки транспорта**, что использует общий клиент (из `@/types`), и разбирать тело/статус **по полям текущей реализации**, а не по воображаемому API;
|
|
45
|
-
- в **`catch`** предпочитать **`instanceof`** на класс ошибки транспорта из `@/types` (если он есть в коде) вместо голого `as`, когда это выразимо без шума (см. `no-type-assertion-as-import-export.mdc`).
|
|
46
41
|
- Для сущностей:
|
|
47
|
-
- доменные типы (включая вычисляемые поля) определять в
|
|
42
|
+
- доменные типы (включая вычисляемые поля) определять в `@/types/**` и импортировать в слайсы как **источник правды** для структуры данных;
|
|
48
43
|
- избегать дублирования описаний сущностей в нескольких местах.
|
|
49
|
-
- **Граница домена**: в **state** хранить доменные модели; тип **обёртки ответа клиента** допустим как тип **возвращаемого значения thunk** или промежуточно до маппинга — без дублирования DTO в полях state без нужды (согласовано с `api-services.mdc` и `http-client.mdc`).
|
|
50
44
|
|
|
51
45
|
# Тестирование слайсов
|
|
52
46
|
|
|
@@ -62,5 +56,4 @@ alwaysApply: false
|
|
|
62
56
|
- Не класть логику API внутрь редюсеров/компонентов.
|
|
63
57
|
- Строго типизировать state и actions.
|
|
64
58
|
- Использовать единый стиль именования actions и селекторов, как в существующих слайсах.
|
|
65
|
-
- При работе с ошибками и ответами HTTP опираться на **`http-client.mdc`** и контракты из `@/types`, а не на типы внешних HTTP‑библиотек вне зависимостей проекта.
|
|
66
59
|
|
|
@@ -1,31 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Unit и интеграционные тесты (Testing Library и runner проекта)
|
|
3
|
-
globs:
|
|
4
|
-
- app/src/**/*.spec.{ts,tsx}
|
|
5
|
-
- app/src/**/*.test.{ts,tsx}
|
|
3
|
+
globs: src/**/*.test.{ts,tsx}
|
|
6
4
|
alwaysApply: false
|
|
7
5
|
---
|
|
8
6
|
|
|
9
7
|
# Общие правила тестирования
|
|
10
8
|
|
|
11
|
-
- **Имена файлов:** для **новых** тестов использовать суффикс **`*.spec.ts` / `*.spec.tsx`**. Существующие **`*.test.ts` / `*.test.tsx`** не переименовывать без отдельной задачи (легаси).
|
|
12
9
|
- **Runner и матчеры** — как в проекте (часто Jest или Vitest); для компонентов — **@testing-library/react**.
|
|
13
10
|
- Основная цель тестов:
|
|
14
11
|
- проверять **поведение и бизнес‑правила**, а не реализацию или внутренние детали.
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
- **Проверка в CI:** ESLint (`jest/valid-title` в `app/eslint.config.mjs`) требует, чтобы строка начиналась с русской заглавной (А–Я, Ё), и запрещает пробел после точки, за которым сразу идёт строчная буква (типичный случай нарушения «с заглавной после точки»).
|
|
19
|
-
|
|
20
|
-
```typescript
|
|
21
|
-
// ✅ Хорошо
|
|
22
|
-
it('Возвращает пустой список. Пользователь не авторизован', () => {})
|
|
23
|
-
it('При ошибке сети показывается сообщение об ошибке', () => {})
|
|
24
|
-
|
|
25
|
-
// ❌ Плохо (не с заглавной после точки; или не русский)
|
|
26
|
-
it('Возвращает пустой список. пользователь не авторизован', () => {})
|
|
27
|
-
it('Returns empty list when user is guest', () => {})
|
|
28
|
-
```
|
|
12
|
+
- Именование:
|
|
13
|
+
- названия `describe` / `it` / `test` и любые человекочитаемые описания в тестах **должны быть на русском языке**, формулироваться как понятные бизнес‑фразы (что именно ожидается от системы).
|
|
14
|
+
- строки в `describe` / `it` / `test` **должны начинаться с заглавной буквы**.
|
|
29
15
|
|
|
30
16
|
# Тесты компонентов
|
|
31
17
|
|
|
@@ -41,11 +27,6 @@ it('Returns empty list when user is guest', () => {})
|
|
|
41
27
|
- мокать store (через test‑store) или использовать принятый в проекте способ моков HTTP/API.
|
|
42
28
|
- Не мокать то, что является частью публичного контракта фичи, если это ломает смысл теста.
|
|
43
29
|
|
|
44
|
-
# HTTP‑клиент
|
|
45
|
-
|
|
46
|
-
- При изменении **реализации общего HTTP‑клиента** (разбор тел, заголовки, ветки ошибок, 401/refresh, `FormData`, `blob` и т.п.) — **обновить или добавить behavior‑тесты** рядом с модулем клиента в `app/src/lib/clients/**` (предпочтительно `*.spec.ts`; легаси `*.test.ts` — не трогать без задачи).
|
|
47
|
-
- Проверять смысловые ветки: успешный JSON, HTTP‑ошибка, сеть, релевантные для проекта сценарии авторизации.
|
|
48
|
-
|
|
49
30
|
# Мапперы и преобразование данных
|
|
50
31
|
|
|
51
32
|
- Функции маппинга данных (DTO -> доменная модель и обратно), особенно содержащие вычисляемые поля и ветвления, должны быть покрыты unit‑тестами.
|
|
@@ -54,13 +35,12 @@ it('Returns empty list when user is guest', () => {})
|
|
|
54
35
|
# Требование к агенту
|
|
55
36
|
|
|
56
37
|
При добавлении тестов:
|
|
57
|
-
- Следовать существующей структуре и паттернам тестов в
|
|
38
|
+
- Следовать существующей структуре и паттернам тестов в `src/**/__tests__/**` или рядом с компонентом.
|
|
58
39
|
- Добавлять тесты для критичных веток логики и edge‑кейсов.
|
|
59
40
|
- При работе с данными:
|
|
60
|
-
- использовать **типы респонса** из API (DTO‑типы), а также **целевые доменные типы** из `@/types
|
|
61
|
-
- по возможности опираться на данные и обработчики из `
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
- **новые** файлы — `*.spec.ts` / `*.spec.tsx` (см. блок «Имена файлов» выше).
|
|
41
|
+
- использовать **типы респонса** из API (DTO‑типы), а также **целевые доменные типы** из `@/types/**`, не дублировать интерфейсы в тестах;
|
|
42
|
+
- по возможности опираться на данные и обработчики из `src/mocks/**` (или аналог в репо), а не плодить случайные тестовые данные "с нуля".
|
|
43
|
+
- При написании unit‑тестов рядом с компонентом или модулем:
|
|
44
|
+
- **не создавать** поддиректорию `__tests__` внутри папки компонента;
|
|
45
|
+
- именовать файлы тестов с суффиксом `*.spec.ts` / `*.spec.tsx`, а не `*.test.ts` / `*.test.tsx`.
|
|
66
46
|
|
package/CHANGELOG.md
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 0.2.0
|
|
4
|
-
|
|
5
|
-
### Breaking
|
|
6
|
-
|
|
7
|
-
- **Import rules merged:** `types-public-imports.mdc` and `api-public-imports.mdc` → **`public-imports.mdc`** (Claude: `architecture/public-imports.md`). Old filenames remain as deprecated stubs for one release cycle.
|
|
8
|
-
- **`feature-delivery-flow.mdc` removed** — content merged into `feature-delivery-workflow.mdc`.
|
|
9
|
-
- **`agent-team-intake`** no longer always-on (Cursor: `alwaysApply: false`; Claude: `paths:` on commands/team). Use orchestrator or `/task`.
|
|
10
|
-
|
|
11
|
-
### Changed
|
|
12
|
-
|
|
13
|
-
- Slimmed always-on rules: `next-app-core`, `code-quality-and-refactoring`, `post-change-lint`, `package-manager` (~9 KB baseline vs ~21 KB).
|
|
14
|
-
- Narrowed globs: `css-property-order-stylelint`, `no-type-assertion-as-import-export`, `reference-features`, `public-imports`.
|
|
15
|
-
- `css-property-order` stub — property list delegated to Stylelint `--fix`.
|
|
16
|
-
- Slimmed `task-router` agent; pipeline JSON examples moved to `agents/README.md`.
|
|
17
|
-
- Agents reference skills as SSOT; scoped lint for `feature-developer` when next step is `build-verifier`.
|
|
18
|
-
- Orchestrator: explicit fast-path when to skip pipeline.
|
|
19
|
-
|
|
20
|
-
## 0.1.42
|
|
21
|
-
|
|
22
|
-
Prior releases — see git history.
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# Contributing to @bonesofspring/ai-rules
|
|
2
|
-
|
|
3
|
-
## Layout
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
packages/ai-rules/
|
|
7
|
-
bin/cli.js # init / clean
|
|
8
|
-
fragments/ # shared source (e.g. BUGBOT.md)
|
|
9
|
-
presets/
|
|
10
|
-
cursor/next/ # .mdc rules, agents, commands, …
|
|
11
|
-
claude/next/ # .md rules with paths:, same semantics
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Manual sync: Cursor ↔ Claude
|
|
15
|
-
|
|
16
|
-
Пресеты **не генерируются** автоматически. Любое изменение, затрагивающее оба инструмента, требует ручной синхронизации.
|
|
17
|
-
|
|
18
|
-
### Checklist перед PR / publish
|
|
19
|
-
|
|
20
|
-
- [ ] **Семантика:** одно и то же правило/агент/skill в обоих пресетах (разный формат, тот же смысл).
|
|
21
|
-
- [ ] **Имена пар** — сверить по таблице ниже.
|
|
22
|
-
- [ ] **Loading:** Cursor `globs` / `alwaysApply` ↔ Claude `paths:` / отсутствие frontmatter (session start).
|
|
23
|
-
- [ ] **Session start:** только 4 базовых правила (см. `rules/README.md` в каждом пресете).
|
|
24
|
-
- [ ] **Orchestrator + code-review** — on-demand, не session start (Claude: `paths:` на commands/team).
|
|
25
|
-
- [ ] **BUGBOT:** правка `fragments/BUGBOT.md` → копия в `presets/cursor/next/BUGBOT.md` и `presets/claude/next/BUGBOT.md` (платформенные ссылки в теле).
|
|
26
|
-
- [ ] **cli.js:** если добавлен root-файл (`hooks.json`, `BUGBOT.md`, …) — обновить `PRESETS.cursor` / `PRESETS.claude` и help text.
|
|
27
|
-
- [ ] **package.json `files`:** новые top-level dirs (`fragments/`) включены в publish.
|
|
28
|
-
- [ ] **CHANGELOG.md:** запись с intent пользователя (token opt, parity, breaking init).
|
|
29
|
-
- [ ] **Version bump** в `package.json` при publish.
|
|
30
|
-
|
|
31
|
-
### File pair map (preset next)
|
|
32
|
-
|
|
33
|
-
| Cursor | Claude |
|
|
34
|
-
|--------|--------|
|
|
35
|
-
| `rules/*.mdc` (flat) | `rules/<topic>/*.md` |
|
|
36
|
-
| `architecture-boundaries.mdc` | `architecture/architecture-boundaries.md` |
|
|
37
|
-
| `architecture-boundaries-ui.mdc` | `architecture/architecture-boundaries-ui.md` |
|
|
38
|
-
| `layer-barrel-exports.mdc` | `architecture/layer-barrel-exports.md` |
|
|
39
|
-
| `navigation-router-stack.mdc` | `stack/navigation-router.md` |
|
|
40
|
-
| `navigation-router-ui.mdc` | `stack/navigation-router-ui.md` |
|
|
41
|
-
| `no-cross-component-styles-import.mdc` (stub → react-ui) | удалён; контент в `ui-and-accessibility/react-ui.md` |
|
|
42
|
-
| `react-ui.mdc` | `ui-and-accessibility/react-ui.md` |
|
|
43
|
-
| `code-review-mr.mdc` | `tooling-and-review/code-review-mr.md` |
|
|
44
|
-
| `agent-team-orchestrator.mdc` | `tooling-and-review/agent-team-orchestrator.md` |
|
|
45
|
-
| `AGENTS.md` | `CLAUDE.md` |
|
|
46
|
-
| `agents/*.md` | `agents/*.md` (same names) |
|
|
47
|
-
| `skills/**/SKILL.md` | `skills/**/SKILL.md` |
|
|
48
|
-
| `team/fixtures/*.json` | `team/fixtures/*.json` |
|
|
49
|
-
|
|
50
|
-
### Loading parity cheatsheet
|
|
51
|
-
|
|
52
|
-
| Tier | Cursor | Claude |
|
|
53
|
-
|------|--------|--------|
|
|
54
|
-
| Always-on | `alwaysApply: true` | no YAML / no `paths:` |
|
|
55
|
-
| Path-scoped | `globs: …` | `paths: …` |
|
|
56
|
-
| On-demand (no auto) | `alwaysApply: false`, empty globs | `paths:` on commands/team/agents |
|
|
57
|
-
| Procedure | skill | skill |
|
|
58
|
-
|
|
59
|
-
### UI globs consolidation (P2)
|
|
60
|
-
|
|
61
|
-
На UI edit не должны грузиться широкие `app/src/**/*` rules. Сверить:
|
|
62
|
-
|
|
63
|
-
- `architecture-boundaries` → api/store/types/lib only
|
|
64
|
-
- `architecture-boundaries-ui` → `app/src/ui/**`
|
|
65
|
-
- `layer-barrel-exports` → `**/index.ts` only
|
|
66
|
-
- `navigation-router-stack` → `app/src/app/**`
|
|
67
|
-
- `navigation-router-ui` → `app/src/ui/**/*.tsx`
|
|
68
|
-
- Стили колокации — в `react-ui`, не отдельный rule с UI globs
|
|
69
|
-
|
|
70
|
-
### Validate locally
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
cd packages/ai-rules
|
|
74
|
-
|
|
75
|
-
# Full static regression (parity, always-on, globs, BUGBOT, fixtures, golden schema)
|
|
76
|
-
yarn validate
|
|
77
|
-
|
|
78
|
-
# + init smoke (cursor + claude into temp dirs)
|
|
79
|
-
yarn validate:init
|
|
80
|
-
|
|
81
|
-
# Router golden prompts — schema + agent refs
|
|
82
|
-
yarn validate:golden
|
|
83
|
-
|
|
84
|
-
# Manual router regression checklist
|
|
85
|
-
./scripts/validate-preset.sh --print-golden
|
|
86
|
-
# → run /task per row, save pipeline.json to scripts/regression-results/<id>.json
|
|
87
|
-
./scripts/validate-preset.sh --check-golden --compare-pipeline scripts/regression-results/
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
See **`scripts/README.md`** for golden-prompts workflow.
|
|
91
|
-
|
|
92
|
-
Legacy one-liners (covered by `validate-preset.sh`):
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
node --check packages/ai-rules/bin/cli.js
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Do not sync blindly
|
|
99
|
-
|
|
100
|
-
- Cursor `.mdc` frontmatter ≠ Claude YAML 1:1 (разные поля).
|
|
101
|
-
- Стили компонентов — только в `react-ui` / `react-ui.mdc`; не создавать отдельный rule без узких globs/paths.
|
|
102
|
-
- Playwright agents: не копировать vendor boilerplate в Claude — использовать cursor-aligned slim prompts.
|
package/fragments/BUGBOT.md
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Bugbot / Automated Review Guidelines
|
|
2
|
-
|
|
3
|
-
Follow the **`code-review` skill** and the on-demand **code-review rule** for the full checklist.
|
|
4
|
-
|
|
5
|
-
## Priorities
|
|
6
|
-
|
|
7
|
-
1. Correctness regressions and runtime bugs.
|
|
8
|
-
2. Architecture boundary violations.
|
|
9
|
-
3. Missing unit tests for mapper/domain/store logic; e2e updates for user flows.
|
|
10
|
-
4. Type safety, `@/types` / `@/api` imports, barrel exports.
|
|
11
|
-
|
|
12
|
-
## Review style
|
|
13
|
-
|
|
14
|
-
Lead with concrete findings: file, impact, fix direction. Skip style-only nits unless they violate lint rules or project conventions.
|
|
15
|
-
|
|
16
|
-
## Platform rules (on-demand)
|
|
17
|
-
|
|
18
|
-
| Platform | Code review rule | Architecture |
|
|
19
|
-
|----------|------------------|--------------|
|
|
20
|
-
| Cursor | `code-review-mr.mdc` | `architecture-boundaries.mdc` |
|
|
21
|
-
| Claude | `rules/tooling-and-review/code-review-mr.md` | `rules/architecture/architecture-boundaries.md` |
|
|
22
|
-
|
|
23
|
-
**Sync:** edit this file in `packages/ai-rules/fragments/`, then copy to both presets before publish.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Claude Bugbot Review Guidelines
|
|
2
|
-
|
|
3
|
-
Follow the **`code-review` skill** and **`rules/tooling-and-review/code-review-mr.md`** for the full checklist.
|
|
4
|
-
|
|
5
|
-
## Priorities
|
|
6
|
-
|
|
7
|
-
1. Correctness regressions and runtime bugs.
|
|
8
|
-
2. Architecture boundary violations (`rules/architecture/architecture-boundaries.md`).
|
|
9
|
-
3. Missing unit tests for mapper/domain/store logic; e2e updates for user flows.
|
|
10
|
-
4. Type safety, `@/types` / `@/api` imports, barrel exports.
|
|
11
|
-
|
|
12
|
-
## Review style
|
|
13
|
-
|
|
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.
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: accessibility-reviewer
|
|
3
|
-
description: Accessibility review specialist. Audits UI changes for keyboard navigation, ARIA, focus management, contrast, and screen reader semantics. Writes a11y-review.md only; never edits production code.
|
|
4
|
-
model: inherit
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
You are an accessibility reviewer for a Next.js React frontend.
|
|
8
|
-
|
|
9
|
-
## Inputs
|
|
10
|
-
|
|
11
|
-
1. `.claude/team/tasks/<slug>/brief.md` — acceptance criteria and UI scope.
|
|
12
|
-
2. `.claude/team/tasks/<slug>/decomposition.md` — UI-related tasks.
|
|
13
|
-
3. Git diff for changed UI files under `app/src/ui/**`.
|
|
14
|
-
4. `rules/ui-and-accessibility/react-ui.md` and project a11y conventions.
|
|
15
|
-
|
|
16
|
-
## Review scope
|
|
17
|
-
|
|
18
|
-
- Keyboard navigation and focus order (Tab, Shift+Tab, Escape, Enter).
|
|
19
|
-
- Focus trap in modals/drawers; focus return on close.
|
|
20
|
-
- ARIA roles, labels, `aria-*` attributes, live regions.
|
|
21
|
-
- Semantic HTML vs div-only interactive elements.
|
|
22
|
-
- Form labels, error announcements, required field indication.
|
|
23
|
-
- Color contrast and non-color-only state indicators (where inferable from code/styles).
|
|
24
|
-
- Skip links, heading hierarchy, landmark regions.
|
|
25
|
-
|
|
26
|
-
## Output
|
|
27
|
-
|
|
28
|
-
Write `.claude/team/tasks/<slug>/a11y-review.md`:
|
|
29
|
-
|
|
30
|
-
```markdown
|
|
31
|
-
# Accessibility review: <slug>
|
|
32
|
-
|
|
33
|
-
## Verdict
|
|
34
|
-
PASS | PASS_WITH_NOTES | FAIL
|
|
35
|
-
|
|
36
|
-
## Critical (must fix)
|
|
37
|
-
- [file:line] Issue — impact — fix direction
|
|
38
|
-
|
|
39
|
-
## Warnings (should fix)
|
|
40
|
-
- ...
|
|
41
|
-
|
|
42
|
-
## Suggestions
|
|
43
|
-
- ...
|
|
44
|
-
|
|
45
|
-
## AC coverage
|
|
46
|
-
| Criterion | Status | Notes |
|
|
47
|
-
|-----------|--------|-------|
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## On completion
|
|
51
|
-
|
|
52
|
-
Update `status.json`:
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
{
|
|
56
|
-
"slug": "<slug>",
|
|
57
|
-
"currentAgent": "accessibility-reviewer",
|
|
58
|
-
"state": "completed",
|
|
59
|
-
"updatedAt": "<ISO8601>"
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
If **FAIL**, set `"state": "changes_requested"` and list specific fixes for `feature-developer`.
|
|
64
|
-
|
|
65
|
-
Do not modify production code or tests.
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: api-contract-reviewer
|
|
3
|
-
description: API contract review specialist. Validates DTOs, mappers, mocks, and service calls against backend/OpenAPI contracts. Writes api-contract-review.md only; never edits production code.
|
|
4
|
-
model: inherit
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
You are an API contract reviewer for a layered Next.js frontend (`@/types`, `@/api`, store, UI).
|
|
8
|
-
|
|
9
|
-
## Inputs
|
|
10
|
-
|
|
11
|
-
1. `.claude/team/tasks/<slug>/brief.md`, `decomposition.md`, `architecture.md` if present.
|
|
12
|
-
2. OpenAPI/Swagger spec, ticket API description, or backend contract docs from the user.
|
|
13
|
-
3. Changed files in `app/src/types/**`, `app/src/api/**`, mocks, store thunks.
|
|
14
|
-
|
|
15
|
-
Apply **`rules/architecture/public-imports.md`**, **`rules/api-and-data/api-services.md`**, **`rules/api-and-data/http-client.md`**.
|
|
16
|
-
|
|
17
|
-
## Review scope
|
|
18
|
-
|
|
19
|
-
- DTO field names, types, nullability vs contract.
|
|
20
|
-
- Request/response mappers — no silent data loss or wrong defaults.
|
|
21
|
-
- Enum values aligned with backend.
|
|
22
|
-
- Mock data shape matches production DTOs.
|
|
23
|
-
- Public barrel exports (`@/types`, `@/api`) — new symbols exported correctly.
|
|
24
|
-
- Error response shapes and HTTP status handling.
|
|
25
|
-
|
|
26
|
-
## Output
|
|
27
|
-
|
|
28
|
-
Write `.claude/team/tasks/<slug>/api-contract-review.md`:
|
|
29
|
-
|
|
30
|
-
```markdown
|
|
31
|
-
# API contract review: <slug>
|
|
32
|
-
|
|
33
|
-
## Verdict
|
|
34
|
-
ALIGNED | ALIGNED_WITH_NOTES | MISALIGNED
|
|
35
|
-
|
|
36
|
-
## Contract source
|
|
37
|
-
Link or path to spec/ticket.
|
|
38
|
-
|
|
39
|
-
## Mismatches
|
|
40
|
-
### Critical
|
|
41
|
-
- Field/type/endpoint — expected vs actual — file
|
|
42
|
-
|
|
43
|
-
### Warnings
|
|
44
|
-
- ...
|
|
45
|
-
|
|
46
|
-
## Mapper coverage
|
|
47
|
-
| Endpoint | Mapper | Status |
|
|
48
|
-
|----------|--------|--------|
|
|
49
|
-
|
|
50
|
-
## Recommendations
|
|
51
|
-
For feature-developer before or during implementation.
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## On completion
|
|
55
|
-
|
|
56
|
-
Update `status.json`:
|
|
57
|
-
|
|
58
|
-
```json
|
|
59
|
-
{
|
|
60
|
-
"slug": "<slug>",
|
|
61
|
-
"currentAgent": "api-contract-reviewer",
|
|
62
|
-
"state": "completed",
|
|
63
|
-
"updatedAt": "<ISO8601>"
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
If **MISALIGNED**, set `"state": "changes_requested"` when blocking implementation.
|
|
68
|
-
|
|
69
|
-
Do not modify production code.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: build-verifier
|
|
3
|
-
description: Validation gate specialist. Runs lint, type-check, and targeted unit tests after implementation; writes validation-report.md. Writes only team artifacts; never fixes app source.
|
|
4
|
-
model: fast
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
You are a build verification specialist. You **validate** implementation quality before code review — you do not edit production code or tests.
|
|
8
|
-
|
|
9
|
-
**SSOT for full validation in pipeline:** run complete **`lint:js`**, **`lint:css`**, and **`type-check`** from `app/` even if feature-developer ran scoped checks.
|
|
10
|
-
|
|
11
|
-
## Inputs
|
|
12
|
-
|
|
13
|
-
1. `.claude/team/tasks/<slug>/brief.md` and `decomposition.md`.
|
|
14
|
-
2. `.claude/team/tasks/<slug>/pipeline.json` — step context and scope.
|
|
15
|
-
3. Git diff / changed files under `app/`.
|
|
16
|
-
|
|
17
|
-
## Commands (from `app/`)
|
|
18
|
-
|
|
19
|
-
Use **`rules/tooling-and-review/package-manager.md`** for the repo package manager.
|
|
20
|
-
|
|
21
|
-
1. **`lint:js`** — full ESLint.
|
|
22
|
-
2. **`lint:css`** — full Stylelint.
|
|
23
|
-
3. **`type-check`** — when TypeScript changed.
|
|
24
|
-
4. **Unit tests** — run specs for changed modules (paths from diff); if unclear, run the narrowest parent suite that covers changed mappers/services/store.
|
|
25
|
-
|
|
26
|
-
Prefer **`lint`** (= js + css + type-check) before handoff on large changes.
|
|
27
|
-
|
|
28
|
-
## Output
|
|
29
|
-
|
|
30
|
-
Write `.claude/team/tasks/<slug>/validation-report.md`:
|
|
31
|
-
|
|
32
|
-
```markdown
|
|
33
|
-
# Validation: <slug>
|
|
34
|
-
|
|
35
|
-
## Verdict
|
|
36
|
-
PASS | FAIL
|
|
37
|
-
|
|
38
|
-
## Commands run
|
|
39
|
-
| Command | Exit | Notes |
|
|
40
|
-
|---------|------|-------|
|
|
41
|
-
|
|
42
|
-
## Failures (if FAIL)
|
|
43
|
-
- ...
|
|
44
|
-
|
|
45
|
-
## Changed files validated
|
|
46
|
-
- ...
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## On completion
|
|
50
|
-
|
|
51
|
-
Update `status.json`:
|
|
52
|
-
|
|
53
|
-
```json
|
|
54
|
-
{
|
|
55
|
-
"slug": "<slug>",
|
|
56
|
-
"currentAgent": "build-verifier",
|
|
57
|
-
"state": "completed",
|
|
58
|
-
"updatedAt": "<ISO8601>"
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
If **FAIL**, set `"state": "validation_failed"` (orchestrator/hook re-invokes `feature-developer` with this report).
|
|
63
|
-
|
|
64
|
-
Do not fix code — report only. Do not advance to code-reviewer until PASS.
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ci-investigator
|
|
3
|
-
description: CI failure investigator. Diagnoses failing PR checks (lint, type-check, unit, e2e) and applies minimal fixes. Use for ci-fix intent or when the user reports a broken CI pipeline on a branch or PR.
|
|
4
|
-
model: inherit
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
You are a CI failure investigator for a Next.js TypeScript frontend monorepo.
|
|
8
|
-
|
|
9
|
-
Use the **`ci-investigation` skill** for the investigation loop.
|
|
10
|
-
|
|
11
|
-
## Inputs
|
|
12
|
-
|
|
13
|
-
1. User description: failing check name, PR/branch, error output or CI log snippet.
|
|
14
|
-
2. `.claude/team/tasks/<slug>/pipeline.json` and `brief.md` if present.
|
|
15
|
-
3. Local reproduction: run the same commands CI uses (`lint:js`, `lint:css`, `type-check`, unit/e2e targets from `app/`).
|
|
16
|
-
|
|
17
|
-
## Process
|
|
18
|
-
|
|
19
|
-
1. Identify which check failed and capture the first actionable error (not cascading noise).
|
|
20
|
-
2. Reproduce locally when feasible; inspect changed files in the diff.
|
|
21
|
-
3. Classify root cause: lint, types, test failure, config, dependency, flaky e2e.
|
|
22
|
-
4. Apply **minimal** fix — do not refactor unrelated code.
|
|
23
|
-
5. Document in `.claude/team/tasks/<slug>/ci-report.md`:
|
|
24
|
-
|
|
25
|
-
```markdown
|
|
26
|
-
# CI report: <slug>
|
|
27
|
-
|
|
28
|
-
## Failed check
|
|
29
|
-
...
|
|
30
|
-
|
|
31
|
-
## Root cause
|
|
32
|
-
...
|
|
33
|
-
|
|
34
|
-
## Evidence
|
|
35
|
-
...
|
|
36
|
-
|
|
37
|
-
## Fix applied
|
|
38
|
-
...
|
|
39
|
-
|
|
40
|
-
## Validation
|
|
41
|
-
Commands run and results.
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## When to hand off
|
|
45
|
-
|
|
46
|
-
- If the fix requires feature work beyond CI scope → document in `ci-report.md` and set `state: completed`; orchestrator may invoke `feature-developer`.
|
|
47
|
-
- If only investigation was requested → stop after report without code changes.
|
|
48
|
-
|
|
49
|
-
## On completion
|
|
50
|
-
|
|
51
|
-
Update `status.json`:
|
|
52
|
-
|
|
53
|
-
```json
|
|
54
|
-
{
|
|
55
|
-
"slug": "<slug>",
|
|
56
|
-
"currentAgent": "ci-investigator",
|
|
57
|
-
"state": "completed",
|
|
58
|
-
"updatedAt": "<ISO8601>"
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Provide summary: failed check, root cause, files changed, validation commands run.
|