@bonesofspring/ai-rules 0.1.37 → 0.1.40
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 +7 -3
- package/bin/cli.js +56 -31
- package/package.json +3 -3
- package/presets/claude/next/CLAUDE.md +25 -5
- package/presets/claude/next/README.md +10 -0
- package/presets/claude/next/agents/README.md +15 -0
- package/presets/claude/next/agents/code-reviewer.md +56 -0
- package/presets/claude/next/agents/debugger.md +58 -0
- package/presets/claude/next/agents/feature-developer.md +45 -0
- package/presets/claude/next/agents/qa-tester.md +54 -0
- package/presets/claude/next/agents/solution-architect.md +70 -0
- package/presets/claude/next/agents/task-analyst.md +105 -0
- package/presets/claude/next/agents/task-router.md +105 -0
- package/presets/claude/next/commands/README.md +10 -2
- package/presets/claude/next/commands/feature-continue.md +46 -0
- package/presets/claude/next/commands/feature-start.md +25 -0
- package/presets/claude/next/commands/task-continue.md +43 -0
- package/presets/claude/next/commands/task.md +40 -0
- package/presets/claude/next/commands/technical-retro.md +53 -0
- package/presets/claude/next/hooks/README.md +6 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +123 -0
- package/presets/claude/next/rules/README.md +49 -11
- package/presets/claude/next/rules/api-and-data/README.md +7 -1
- package/presets/claude/next/rules/api-and-data/api-services.md +57 -0
- package/presets/claude/next/rules/api-and-data/http-client.md +40 -0
- package/presets/claude/next/rules/api-and-data/store-rtk.md +65 -0
- package/presets/claude/next/rules/architecture/README.md +11 -1
- package/presets/claude/next/rules/architecture/api-public-imports.md +25 -0
- package/presets/claude/next/rules/architecture/architecture-boundaries.md +67 -0
- package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +99 -0
- package/presets/claude/next/rules/architecture/layer-barrel-exports.md +53 -0
- package/presets/claude/next/rules/architecture/types-public-imports.md +28 -0
- package/presets/claude/next/rules/stack/README.md +9 -1
- package/presets/claude/next/rules/stack/arrow-functions.md +40 -0
- package/presets/claude/next/rules/stack/navigation-router.md +56 -0
- package/presets/claude/next/rules/stack/next-app-core.md +83 -0
- package/presets/claude/next/rules/stack/no-type-assertion.md +52 -0
- package/presets/claude/next/rules/stack/types-jsdoc.md +37 -0
- package/presets/claude/next/rules/testing/README.md +9 -1
- package/presets/claude/next/rules/testing/playwright-agents.md +69 -0
- package/presets/claude/next/rules/testing/tests-e2e-structure.md +52 -0
- package/presets/claude/next/rules/testing/tests-unit.md +66 -0
- package/presets/claude/next/rules/tooling-and-review/README.md +14 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +9 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +97 -0
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +50 -0
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +67 -0
- package/presets/claude/next/rules/tooling-and-review/package-manager.md +20 -0
- package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +43 -0
- package/presets/claude/next/rules/ui-and-accessibility/README.md +8 -1
- package/presets/claude/next/rules/ui-and-accessibility/component-styles.md +50 -0
- package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +20 -0
- package/presets/claude/next/rules/ui-and-accessibility/no-props-spread.md +52 -0
- package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +90 -0
- package/presets/claude/next/team/README.md +64 -0
- package/presets/claude/next/team/tasks/.gitkeep +1 -0
- package/presets/cursor/next/agents/README.md +25 -0
- package/presets/cursor/next/agents/code-reviewer.md +57 -0
- package/presets/cursor/next/agents/debugger.md +59 -0
- package/presets/cursor/next/agents/feature-developer.md +46 -0
- package/presets/cursor/next/agents/qa-tester.md +55 -0
- package/presets/cursor/next/agents/solution-architect.md +71 -0
- package/presets/cursor/next/agents/task-analyst.md +111 -0
- package/presets/cursor/next/agents/task-router.md +106 -0
- package/presets/cursor/next/commands/README.md +33 -1
- package/presets/cursor/next/commands/feature-continue.md +14 -0
- package/presets/cursor/next/commands/feature-start.md +28 -0
- package/presets/cursor/next/commands/task-continue.md +43 -0
- package/presets/cursor/next/commands/task.md +40 -0
- package/presets/cursor/next/commands/technical-retro.md +76 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +216 -0
- package/presets/cursor/next/hooks.json +11 -0
- package/presets/cursor/next/rules/README.md +10 -3
- package/presets/cursor/next/rules/agent-team-intake.mdc +14 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +102 -0
- package/presets/cursor/next/rules/api-public-imports.mdc +1 -0
- package/presets/cursor/next/rules/api-services.mdc +1 -0
- package/presets/cursor/next/rules/architecture-boundaries.mdc +1 -1
- package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +5 -2
- package/presets/cursor/next/rules/code-review-mr.mdc +6 -7
- package/presets/cursor/next/rules/feature-delivery-workflow.mdc +5 -5
- package/presets/cursor/next/rules/layer-barrel-exports.mdc +58 -0
- package/presets/cursor/next/rules/next-app-core.mdc +1 -1
- package/presets/cursor/next/rules/package-manager.mdc +25 -0
- package/presets/cursor/next/rules/post-change-lint.mdc +48 -0
- package/presets/cursor/next/rules/react-ui.mdc +10 -0
- package/presets/cursor/next/rules/technical-retro.mdc +5 -51
- package/presets/cursor/next/rules/types-public-imports.mdc +1 -0
- package/presets/cursor/next/team/README.md +106 -0
- package/presets/cursor/next/team/tasks/.gitkeep +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Стили только рядом с компонентом
|
|
2
|
+
|
|
3
|
+
## Имя корневого styled-элемента: `Root`
|
|
4
|
+
|
|
5
|
+
- **Корневой** styled-элемент — **`Root`**.
|
|
6
|
+
- В разметке: `<s.Root>...</s.Root>` при `import * as s from './styles'`.
|
|
7
|
+
- Вложенные — `Title`, `List`, `Item` и т.д.
|
|
8
|
+
- Единственная внешняя styled-обёртка всего JSX — **`Root`**, не `Container` / `Wrapper`.
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
// ✅ Хорошо
|
|
12
|
+
export const Root = styled.div` ... `
|
|
13
|
+
// в компоненте: <s.Root>...</s.Root>
|
|
14
|
+
|
|
15
|
+
// ❌ Плохо для единственной обёртки
|
|
16
|
+
export const Service = styled.div` ... `
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Правило
|
|
20
|
+
|
|
21
|
+
**Запрещено** импортировать модули стилей **другого** UI-компонента или блока.
|
|
22
|
+
|
|
23
|
+
Под «модулями стилей»:
|
|
24
|
+
|
|
25
|
+
- `styles.ts` / `styles.tsx` рядом с компонентом;
|
|
26
|
+
- `*.module.css`, `*.module.scss`;
|
|
27
|
+
- файлы, экспортирующие styled-примитивы одного компонента.
|
|
28
|
+
|
|
29
|
+
## Разрешено
|
|
30
|
+
|
|
31
|
+
- `import * as s from './styles'` — в той же папке.
|
|
32
|
+
- Общие примитивы дизайн-системы, токены, `@/ui/components/...`.
|
|
33
|
+
- Повторное использование визуала через **сам компонент**, не через его `styles`.
|
|
34
|
+
|
|
35
|
+
## Примеры
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
// ✅ Хорошо
|
|
39
|
+
import * as s from './styles'
|
|
40
|
+
|
|
41
|
+
// ❌ Плохо
|
|
42
|
+
import * as s from '../../styles'
|
|
43
|
+
import * as s from '../RequestForAnalysisServices/styles'
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Почему
|
|
47
|
+
|
|
48
|
+
- **`Root`** — быстрая ориентация в разметке.
|
|
49
|
+
- Стили и компонент меняются вместе.
|
|
50
|
+
- Проще рефакторинг.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Порядок CSS-свойств (как в Stylelint)
|
|
2
|
+
|
|
3
|
+
Действует для **любого** CSS в репозитории: `.css`, стилевые блоки в `styles.ts` / `styles.tsx`, `styled` / Linaria и другой CSS-in-JS в `.ts` / `.tsx`, если этот код попадает под `lint:css`.
|
|
4
|
+
|
|
5
|
+
Источник: `app/.stylelintrc` → `@sh/stylelint-config-react` → пакет **`stylelint-config-idiomatic-order`** (правило `order/properties-order`). Свойства, не попавшие в список, идут **в конце блока в алфавитном порядке** (`unspecified: bottomAlphabetical`).
|
|
6
|
+
|
|
7
|
+
Пиши объявления в **одном** блоке в такой последовательности групп:
|
|
8
|
+
|
|
9
|
+
1. **`composes`** — только для CSS Modules (если есть).
|
|
10
|
+
2. **`all`**
|
|
11
|
+
3. **Позиционирование:** `position`, `z-index`, затем `top`, `right`, `bottom`, `left`.
|
|
12
|
+
4. **Отображение и раскладка:** `display`, `overflow`.
|
|
13
|
+
5. **Размеры:** `width`, `min-width`, `max-width`, `height`, `min-height`, `max-height`, `box-sizing`.
|
|
14
|
+
6. **Flex:** `flex`, `flex-basis`, `flex-direction`, `flex-flow`, `flex-grow`, `flex-shrink`, `flex-wrap`, `align-content`, `align-items`, `align-self`, `justify-content`, `order`.
|
|
15
|
+
7. **Внутренние отступы:** `padding-top`, `padding-right`, `padding-bottom`, `padding-left`.
|
|
16
|
+
8. **Рамка:** общие `border`, `border-width`, `border-style`, `border-color`, `border-radius`; затем для сторон **сверху по часовой** — `border-top` и его `-width`, `-style`, `-color`, `-radius`, то же для `right`, `bottom`, `left`.
|
|
17
|
+
9. **Внешние отступы:** `margin-top`, `margin-right`, `margin-bottom`, `margin-left`.
|
|
18
|
+
10. **Остальные свойства** — после перечисленных, **по алфавиту** (типографика, фон, анимации, `cursor`, и т.д.).
|
|
19
|
+
|
|
20
|
+
Автоисправление из каталога `app`: `lint:css --fix` (проверяет `**/*.{css,ts}`; менеджер пакетов — `tooling-and-review/package-manager.md`).
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Не использовать спред пропов при передаче в компоненты
|
|
2
|
+
|
|
3
|
+
При вызове **пользовательских** React-компонентов (имя с заглавной буквы) **передавать пропы явно**, а не через spread (`{...props}`, `{...obj}`).
|
|
4
|
+
|
|
5
|
+
**Агентам и при ревью:** не «упрощать» JSX через объект с spread. Длинное ветвление — два явных JSX-блока или отдельные компоненты.
|
|
6
|
+
|
|
7
|
+
## Почему
|
|
8
|
+
|
|
9
|
+
- Явная передача делает зависимости очевидными.
|
|
10
|
+
- Упрощает рефакторинг и поиск использований.
|
|
11
|
+
- Снижает риск лишних пропов.
|
|
12
|
+
|
|
13
|
+
## Проверка в репозитории
|
|
14
|
+
|
|
15
|
+
- Для `app/src/ui/**/*.tsx` — ESLint `react/jsx-props-no-spreading` (`app/eslint.config.mjs`).
|
|
16
|
+
- Исключение — `eslint-disable-next-line` с комментарием «почему».
|
|
17
|
+
|
|
18
|
+
## Примеры
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
// ❌ Плохо
|
|
22
|
+
const commonProps = { a, b, c }
|
|
23
|
+
return <Child {...commonProps} />
|
|
24
|
+
|
|
25
|
+
// ❌ Плохо
|
|
26
|
+
return <Child {...props} />
|
|
27
|
+
|
|
28
|
+
// ✅ Хорошо
|
|
29
|
+
return (
|
|
30
|
+
<Child
|
|
31
|
+
a={a}
|
|
32
|
+
b={b}
|
|
33
|
+
c={c}
|
|
34
|
+
/>
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
// ✅ Хорошо — явные пропсы по веткам
|
|
38
|
+
return cond ? (
|
|
39
|
+
<IconBox name={name} size="m" variant="warning" />
|
|
40
|
+
) : (
|
|
41
|
+
<IconBox
|
|
42
|
+
customColors={styles.IconBoxAccent.customColors}
|
|
43
|
+
name={name}
|
|
44
|
+
size="m"
|
|
45
|
+
/>
|
|
46
|
+
)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Исключения
|
|
50
|
+
|
|
51
|
+
- **Нативный** DOM (`<div {...rest} />`) — если `rest` только HTML-атрибуты.
|
|
52
|
+
- Обёртки — если явно документировано; при необходимости ESLint-disable.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths:
|
|
3
|
+
- app/src/ui/**/*.tsx
|
|
4
|
+
- app/src/ui/**/*.ts
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Общие правила компонентов
|
|
8
|
+
|
|
9
|
+
- Использовать **функциональные компоненты** с хуками, без классов.
|
|
10
|
+
- Компонент должен:
|
|
11
|
+
- быть максимально «тонким» по бизнес‑логике;
|
|
12
|
+
- делегировать состояние в store/хуки, если оно нужно в нескольких местах;
|
|
13
|
+
- опираться на **общие UI‑примитивы дизайна проекта** (пакеты или локальная библиотека компонентов), если они есть.
|
|
14
|
+
- Перед новым кастомным контролом — поискать готовый или близкий компонент в репозитории / пакетах UI проекта и переиспользовать или расширить его.
|
|
15
|
+
- Для повторяемой логики создавать `useSomething`‑хуки рядом или в `src/ui/hooks/**`.
|
|
16
|
+
- При обращении к store, API, общим хелперам и утилитам компоненты и хуки должны использовать только их **public API** (например, `@/store`, `@/store/slices/Foo`, `@/lib/utils`), а не импортировать внутренние файлы реализации других модулей.
|
|
17
|
+
|
|
18
|
+
# Структура файлов
|
|
19
|
+
|
|
20
|
+
Для страницы/крупного блока:
|
|
21
|
+
|
|
22
|
+
- `FeatureBlock.tsx` — JSX и композиция.
|
|
23
|
+
- `styles.ts` или соседний модуль стилей — по конвенции репозитория (CSS Modules, CSS-in-JS, и т.д.).
|
|
24
|
+
- `index.ts` — реэкспорт (если нужно наружу).
|
|
25
|
+
|
|
26
|
+
## Дочерние компоненты (`./components`)
|
|
27
|
+
|
|
28
|
+
- Локальные подкомпоненты, используемые только этим блоком, выносятся в **`./components/<ComponentName>/`** относительно папки родительского компонента (не оставлять крупные куски JSX и «внутренние» компоненты в том же файле, что и родитель).
|
|
29
|
+
- У каждого такого подкомпонента — **своя** папка с тем же именем, что и публичное имя компонента:
|
|
30
|
+
- `ComponentName.tsx` — разметка и композиция;
|
|
31
|
+
- `styles.ts` — только стили этого подкомпонента (см. `ui-and-accessibility/component-styles.md`: не тянуть `styles` соседних компонентов);
|
|
32
|
+
- при необходимости — `ComponentName.data.ts`, `ComponentName.utils.ts`, `ComponentName.hooks.ts` по тем же правилам префикса, что и у родителя;
|
|
33
|
+
- опционально `index.ts` с реэкспортом.
|
|
34
|
+
- Родитель импортирует подкомпонент из `./components/...`, а не держит его реализацию inline.
|
|
35
|
+
|
|
36
|
+
Для переиспользуемого компонента:
|
|
37
|
+
|
|
38
|
+
- Папка с именем компонента:
|
|
39
|
+
- `ComponentName.tsx`
|
|
40
|
+
- файлы стилей по принятой схеме;
|
|
41
|
+
- опционально: `types.ts`, `ComponentName.hooks.ts` (см. ниже про префикс).
|
|
42
|
+
|
|
43
|
+
## Вспомогательные модули рядом с компонентом (именование)
|
|
44
|
+
|
|
45
|
+
**Префикс имени файла = публичное имя компонента** (как у `ComponentName.tsx` в этой папке), в **PascalCase**. Не вводить отдельные «говорящие» имена файлов по смыслу содержимого (`analysisPreparationIconMap.ts`, `buildAnalysisIdToNameMap.ts` и т.п.) — так теряется связь с компонентом и плодятся одноразовые названия.
|
|
46
|
+
|
|
47
|
+
**Суффикс по роли:**
|
|
48
|
+
|
|
49
|
+
| Суффикс | Назначение | Примеры содержимого |
|
|
50
|
+
|--------|------------|---------------------|
|
|
51
|
+
| `ComponentName.data.ts` | Статические данные и конфигурация для UI | мапы `id → иконка/лейбл`, константы списков, таблицы соответствий для отображения |
|
|
52
|
+
| `ComponentName.utils.ts` | Чистые функции без React | форматирование, предобработка пропсов/данных для рендера, `build…`/`map…`‑хелперы |
|
|
53
|
+
| `ComponentName.hooks.ts` | Хуки, используемые только этим блоком | локальные `use…` (если не вынесены в `src/ui/hooks/**`) |
|
|
54
|
+
|
|
55
|
+
- Несколько констант/мапов или несколько функций — **по-прежнему один** `.data.ts` и один `.utils.ts`, не дробить по «темам» отдельными файлами без веской причины (размер, разные зоны ответственности на уровне подкомпонентов).
|
|
56
|
+
- Если логика принадлежит **подкомпоненту** в подпапке (`components/Child/Child.tsx`), те же правила применяются к **`Child.data.ts`**, **`Child.utils.ts`** относительно этого подкомпонента.
|
|
57
|
+
- Тесты для утилит и данных — рядом в `__tests__/` или с суффиксом `.test.ts`, согласно `testing/tests-unit.md`, с тем же префиксом (`RequestForAnalysisRecommendations.utils.test.ts` и т.д.).
|
|
58
|
+
|
|
59
|
+
# Стили и дизайн‑токены
|
|
60
|
+
|
|
61
|
+
- **Корневой** styled-элемент компонента в соседнем `styles` — **`Root`** (`<s.Root>`). Подробнее: `ui-and-accessibility/component-styles.md`.
|
|
62
|
+
- Порядок объявлений в CSS / `styled` — как требует Stylelint: см. `ui-and-accessibility/css-property-order.md`.
|
|
63
|
+
- Для визуала использовать **тот стек стилей и токенов, который уже в проекте** (переменные, тема, общие классы, дизайн‑пакет).
|
|
64
|
+
- Избегать:
|
|
65
|
+
- inline‑стилей, кроме простых случаев;
|
|
66
|
+
- дублирования оформления, уже закрытого общими примитивами;
|
|
67
|
+
- «магических» литералов (`#xxxxxx`, произвольные `17px` / `23px`), если в проекте есть токены или масштаб.
|
|
68
|
+
- Если подходящего токена нет — локальный примитив **в одном месте** с последующим выравниванием под систему дизайна при возможности.
|
|
69
|
+
|
|
70
|
+
# Пропсы и типизация
|
|
71
|
+
|
|
72
|
+
- **Не передавать пропы в компоненты через spread** (`<Foo {...x} />`). Только явные атрибуты; подробности — `ui-and-accessibility/no-props-spread.md` (в `app/src/ui` это дополнительно ловит ESLint).
|
|
73
|
+
- Описывать пропсы через `type Props = { ... }` или `interface Props { ... }`.
|
|
74
|
+
- Не использовать `any`; при необходимости — обобщения (`<T>`), `unknown`, type guards.
|
|
75
|
+
- Для доменных сущностей использовать типы из `@/types` (и enum из `@/types/enums`), а не описывать их заново (`architecture/types-public-imports.md`).
|
|
76
|
+
|
|
77
|
+
# Логика и side effects
|
|
78
|
+
|
|
79
|
+
- Side effects и асинхронщина — по возможности в store (thunk’и, middleware) или в отдельные хуки.
|
|
80
|
+
- Компоненты не должны:
|
|
81
|
+
- напрямую знать детали API (URL, структура DTO);
|
|
82
|
+
- заниматься маппингом «сырых» DTO — только доменные типы;
|
|
83
|
+
- содержать нетривиальные вычисления и преобразования данных (булевы флаги, сложная склейка строк, агрегаты и т.п.). Данные для отображения должны быть подготовлены на этапах маппинга/подготовки (API → доменная модель → store).
|
|
84
|
+
|
|
85
|
+
# Тестирование UI
|
|
86
|
+
|
|
87
|
+
- Для нетривиальных компонентов добавлять тесты:
|
|
88
|
+
- **Testing Library** для React, как принято в проекте;
|
|
89
|
+
- проверять поведение и бизнес‑правила, а не конкретные CSS‑классы.
|
|
90
|
+
- В тестах ориентироваться на текст, роли и aria‑атрибуты.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Agent team artifacts
|
|
2
|
+
|
|
3
|
+
Каталог артефактов пайплайна «команда агентов» Claude Code.
|
|
4
|
+
|
|
5
|
+
## Layout
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
.claude/team/
|
|
9
|
+
active-task.json # { "slug": "current-task-slug" }
|
|
10
|
+
tasks/
|
|
11
|
+
<slug>/
|
|
12
|
+
pipeline.json # dynamic pipeline from task-router
|
|
13
|
+
brief.md # Definition of Ready
|
|
14
|
+
decomposition.md # Task breakdown
|
|
15
|
+
architecture.md # optional architect output
|
|
16
|
+
debug-report.md # optional debugger output
|
|
17
|
+
review.md # optional code review output
|
|
18
|
+
status.json # Phase and state machine
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Slug
|
|
22
|
+
|
|
23
|
+
- kebab-case, derived from task title
|
|
24
|
+
- max 48 characters
|
|
25
|
+
- example: `order-history-date-filter`
|
|
26
|
+
|
|
27
|
+
## status.json schema
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"slug": "order-history-date-filter",
|
|
32
|
+
"intent": "feature",
|
|
33
|
+
"pipelineIndex": 0,
|
|
34
|
+
"currentAgent": "task-analyst",
|
|
35
|
+
"phase": "executing",
|
|
36
|
+
"state": "in_progress",
|
|
37
|
+
"awaitingHumanGate": false,
|
|
38
|
+
"updatedAt": "2026-05-29T12:00:00.000Z"
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### state
|
|
43
|
+
|
|
44
|
+
| Value | Description |
|
|
45
|
+
|-------|-------------|
|
|
46
|
+
| `awaiting_approval` | Brief/design ready; human gate |
|
|
47
|
+
| `approved` | User approved via `/task-continue` or `/feature-continue` |
|
|
48
|
+
| `in_progress` | Active subagent working |
|
|
49
|
+
| `completed` | Current phase/step finished |
|
|
50
|
+
| `changes_requested` | Review found required fixes |
|
|
51
|
+
|
|
52
|
+
## Git
|
|
53
|
+
|
|
54
|
+
Commit task artifacts if you want them to survive `ai-rules clean claude`. Alternatively copy finished tasks to `docs/agent-workflow/tasks/<slug>/`.
|
|
55
|
+
|
|
56
|
+
## Workflow entry
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
/task <task description>
|
|
60
|
+
# review gate artifacts if requested, then:
|
|
61
|
+
/task-continue <slug>
|
|
62
|
+
# after pipeline:
|
|
63
|
+
/technical-retro <slug>
|
|
64
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Keep the task artifact directory in the published preset.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# `.cursor/agents` (preset next)
|
|
2
|
+
|
|
3
|
+
Ролевые subagents для командного пайплайна Cursor.
|
|
4
|
+
|
|
5
|
+
| Agent | Файл | Production-код |
|
|
6
|
+
|-------|------|----------------|
|
|
7
|
+
| Router | `task-router.md` | no |
|
|
8
|
+
| Аналитик | `task-analyst.md` | no |
|
|
9
|
+
| Архитектор | `solution-architect.md` | no |
|
|
10
|
+
| Debugger | `debugger.md` | minimal fix only |
|
|
11
|
+
| Разработчик | `feature-developer.md` | yes |
|
|
12
|
+
| Ревьюер | `code-reviewer.md` | no |
|
|
13
|
+
| QA | `qa-tester.md` | tests only |
|
|
14
|
+
|
|
15
|
+
Копируется в `.cursor/agents/` при `ai-rules init cursor --preset next`.
|
|
16
|
+
|
|
17
|
+
## Оркестрация
|
|
18
|
+
|
|
19
|
+
| Command | Назначение |
|
|
20
|
+
|---------|------------|
|
|
21
|
+
| `/task <desc>` | Router → dynamic pipeline → первый agent |
|
|
22
|
+
| `/task-continue <slug>` | После human gate |
|
|
23
|
+
| `/feature-start`, `/feature-continue` | Legacy (совместимость) |
|
|
24
|
+
|
|
25
|
+
Правило: `agent-team-orchestrator.mdc`. План: `pipeline.json` в `.cursor/team/tasks/<slug>/`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-reviewer
|
|
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
|
+
model: inherit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
## Inputs
|
|
10
|
+
|
|
11
|
+
1. `.cursor/team/tasks/<slug>/brief.md` — verify implementation matches acceptance criteria.
|
|
12
|
+
2. `.cursor/team/tasks/<slug>/decomposition.md` — check coverage of planned tasks.
|
|
13
|
+
3. Git diff for changed files (`git diff`, `git status`).
|
|
14
|
+
|
|
15
|
+
Apply the checklist from **`code-review-mr.mdc`**: architecture, imports (`@/types`, `@/api`), types, UI patterns, tests, HTTP client usage.
|
|
16
|
+
|
|
17
|
+
## Review artifact
|
|
18
|
+
|
|
19
|
+
Write `.cursor/team/tasks/<slug>/review.md` with this format:
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
# Code review: <slug>
|
|
23
|
+
|
|
24
|
+
## Verdict
|
|
25
|
+
APPROVE | APPROVE_WITH_NOTES | REQUEST_CHANGES
|
|
26
|
+
|
|
27
|
+
## Critical (must fix)
|
|
28
|
+
- ...
|
|
29
|
+
|
|
30
|
+
## Warnings (should fix)
|
|
31
|
+
- ...
|
|
32
|
+
|
|
33
|
+
## Suggestions (nice to have)
|
|
34
|
+
- ...
|
|
35
|
+
|
|
36
|
+
## AC coverage
|
|
37
|
+
| Criterion | Status | Notes |
|
|
38
|
+
|-----------|--------|-------|
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## On completion
|
|
42
|
+
|
|
43
|
+
Update `status.json`:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"slug": "<slug>",
|
|
48
|
+
"currentAgent": "code-reviewer",
|
|
49
|
+
"phase": "executing",
|
|
50
|
+
"state": "completed",
|
|
51
|
+
"updatedAt": "<ISO8601>"
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If **REQUEST_CHANGES**, set `"state": "changes_requested"` (hook will re-invoke feature-developer).
|
|
56
|
+
|
|
57
|
+
Do not mix this output with retrospective facilitation — keep review and retro separate.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debugger
|
|
3
|
+
description: Debugging specialist for errors, test failures, and unexpected behavior. Use for bugfix intent before feature-developer, or when the user reports crashes, failing tests, or incorrect behavior.
|
|
4
|
+
readonly: false
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are an expert debugger for a Next.js TypeScript frontend.
|
|
9
|
+
|
|
10
|
+
## Inputs
|
|
11
|
+
|
|
12
|
+
1. `.cursor/team/tasks/<slug>/brief.md` if present; else the user task description.
|
|
13
|
+
2. `.cursor/team/tasks/<slug>/pipeline.json` for context.
|
|
14
|
+
3. Error messages, stack traces, failing test output, or reproduction steps from the user.
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
|
|
18
|
+
1. Capture error message, stack trace, and reproduction steps.
|
|
19
|
+
2. Inspect relevant code (Read, Grep) — do not guess.
|
|
20
|
+
3. Form hypothesis; verify with minimal checks.
|
|
21
|
+
4. Document root cause in `.cursor/team/tasks/<slug>/debug-report.md`:
|
|
22
|
+
|
|
23
|
+
```markdown
|
|
24
|
+
# Debug report: <slug>
|
|
25
|
+
|
|
26
|
+
## Symptoms
|
|
27
|
+
...
|
|
28
|
+
|
|
29
|
+
## Root cause
|
|
30
|
+
...
|
|
31
|
+
|
|
32
|
+
## Evidence
|
|
33
|
+
...
|
|
34
|
+
|
|
35
|
+
## Recommended fix
|
|
36
|
+
...
|
|
37
|
+
|
|
38
|
+
## Files to change
|
|
39
|
+
- path/to/file.ts — ...
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
5. If fix is trivial and clearly scoped, you **may** apply the minimal fix. Otherwise leave implementation to **feature-developer** with a clear fix plan.
|
|
43
|
+
|
|
44
|
+
## On completion
|
|
45
|
+
|
|
46
|
+
Update `status.json`:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"slug": "<slug>",
|
|
51
|
+
"currentAgent": "debugger",
|
|
52
|
+
"state": "completed",
|
|
53
|
+
"updatedAt": "<ISO8601>"
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Handoff summary: root cause, recommended fix, files touched (if any).
|
|
58
|
+
|
|
59
|
+
Do not perform formal code review or write e2e plans — those are separate agents.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-developer
|
|
3
|
+
description: Feature implementation specialist for Next.js stack. Implements tasks from decomposition.md following feature-delivery-workflow. Use after brief approval via /feature-continue or when explicitly asked to implement an approved task slug.
|
|
4
|
+
model: inherit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a senior frontend developer working in a Next.js monorepo with strict layer boundaries.
|
|
8
|
+
|
|
9
|
+
## Before coding
|
|
10
|
+
|
|
11
|
+
1. Read `.cursor/team/tasks/<slug>/brief.md` and `decomposition.md`.
|
|
12
|
+
2. Read `architecture.md` and `debug-report.md` if present.
|
|
13
|
+
3. Read `status.json` — proceed only if `state` is `approved`, `in_progress`, or continuing after `/task-continue`.
|
|
14
|
+
4. Read `pipeline.json` if present for step context.
|
|
15
|
+
5. Find a reference feature of similar complexity in the same layer and mirror its structure.
|
|
16
|
+
6. Follow **`feature-delivery-workflow.mdc`** for layer order and the matrix «zone → rule file».
|
|
17
|
+
|
|
18
|
+
## Task execution rules
|
|
19
|
+
|
|
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
|
+
- Mark completed tasks in `decomposition.md` with `[x]` or a **Done** column update.
|
|
23
|
+
- After all code changes run **`post-change-lint.mdc`**: `lint:js`, `lint:css`, `type-check` from `app/`.
|
|
24
|
+
|
|
25
|
+
## On completion
|
|
26
|
+
|
|
27
|
+
Update `status.json`:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"slug": "<slug>",
|
|
32
|
+
"currentAgent": "feature-developer",
|
|
33
|
+
"phase": "executing",
|
|
34
|
+
"state": "completed",
|
|
35
|
+
"updatedAt": "<ISO8601>"
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Provide a short handoff summary:
|
|
40
|
+
|
|
41
|
+
- Tasks completed vs remaining
|
|
42
|
+
- Files changed (by layer)
|
|
43
|
+
- Lint/type-check result
|
|
44
|
+
- Known gaps or follow-ups for reviewer
|
|
45
|
+
|
|
46
|
+
Do not perform formal code review — that is the code-reviewer subagent's job.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qa-tester
|
|
3
|
+
description: QA and test specialist. Adds or updates unit and e2e tests per decomposition and playwright-agents rules. Use after code review completes for a team task slug.
|
|
4
|
+
model: inherit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a QA engineer for a Next.js frontend with Jest unit tests and Playwright e2e.
|
|
8
|
+
|
|
9
|
+
## Inputs
|
|
10
|
+
|
|
11
|
+
1. `.cursor/team/tasks/<slug>/brief.md` — acceptance criteria drive test scenarios.
|
|
12
|
+
2. `.cursor/team/tasks/<slug>/decomposition.md` — test-related tasks (unit, e2e).
|
|
13
|
+
3. Reviewer notes if `changes_requested` was resolved.
|
|
14
|
+
|
|
15
|
+
## Test strategy
|
|
16
|
+
|
|
17
|
+
### Unit tests
|
|
18
|
+
|
|
19
|
+
Follow **`tests-unit.mdc`**. Cover mappers, non-trivial logic, and behavior tests for HTTP client when relevant.
|
|
20
|
+
|
|
21
|
+
### E2E tests
|
|
22
|
+
|
|
23
|
+
Follow **`playwright-agents.mdc`** and **`tests-e2e-structure.mdc`**:
|
|
24
|
+
|
|
25
|
+
- Plans: `app/__tests__/e2e/<Area>/*.cases.md`
|
|
26
|
+
- Specs: `*.spec.ts` in the same folder
|
|
27
|
+
- Use existing page objects and `_shared/` helpers
|
|
28
|
+
|
|
29
|
+
When planning e2e, act as **Planner**; when generating specs, act as **Generator**.
|
|
30
|
+
|
|
31
|
+
## Execution
|
|
32
|
+
|
|
33
|
+
- Run relevant unit tests for changed modules.
|
|
34
|
+
- Run affected e2e specs if feasible; report failures clearly.
|
|
35
|
+
|
|
36
|
+
## On completion
|
|
37
|
+
|
|
38
|
+
Update `status.json`:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"slug": "<slug>",
|
|
43
|
+
"currentAgent": "qa-tester",
|
|
44
|
+
"phase": "executing",
|
|
45
|
+
"state": "completed",
|
|
46
|
+
"updatedAt": "<ISO8601>"
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Provide summary:
|
|
51
|
+
|
|
52
|
+
- Tests added/updated (paths)
|
|
53
|
+
- Test run results
|
|
54
|
+
- Gaps vs acceptance criteria
|
|
55
|
+
- Suggest `/technical-retro` with the slug when done
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: solution-architect
|
|
3
|
+
description: Solution architect for cross-layer features, API boundaries, and technical design before implementation. Use for spike intent or when router adds architect step for complex features. Readonly — produces design docs, not production code.
|
|
4
|
+
readonly: true
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a solution architect for a Next.js frontend with strict layer boundaries (types, api, store, ui).
|
|
9
|
+
|
|
10
|
+
## Inputs
|
|
11
|
+
|
|
12
|
+
1. `.cursor/team/tasks/<slug>/brief.md` and `decomposition.md` (from analyst).
|
|
13
|
+
2. `.cursor/team/tasks/<slug>/pipeline.json`.
|
|
14
|
+
3. Existing patterns in the repo (`architecture-boundaries.mdc`, `feature-delivery-workflow.mdc`).
|
|
15
|
+
|
|
16
|
+
## Deliverable
|
|
17
|
+
|
|
18
|
+
Write `.cursor/team/tasks/<slug>/architecture.md`:
|
|
19
|
+
|
|
20
|
+
```markdown
|
|
21
|
+
# Architecture: <slug>
|
|
22
|
+
|
|
23
|
+
## Context
|
|
24
|
+
...
|
|
25
|
+
|
|
26
|
+
## Proposed design
|
|
27
|
+
### Types (@/types)
|
|
28
|
+
...
|
|
29
|
+
|
|
30
|
+
### API layer (@/api)
|
|
31
|
+
...
|
|
32
|
+
|
|
33
|
+
### Store (RTK)
|
|
34
|
+
...
|
|
35
|
+
|
|
36
|
+
### UI
|
|
37
|
+
...
|
|
38
|
+
|
|
39
|
+
## Data flow
|
|
40
|
+
(mermaid or bullet flow)
|
|
41
|
+
|
|
42
|
+
## Risks and alternatives
|
|
43
|
+
...
|
|
44
|
+
|
|
45
|
+
## Open decisions
|
|
46
|
+
- ...
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Rules
|
|
50
|
+
|
|
51
|
+
- Align with existing layer boundaries — no DTO in UI, no HTTP from components.
|
|
52
|
+
- Reference concrete paths in the repo (similar features as templates).
|
|
53
|
+
- Flag when decomposition should change — list suggested updates for analyst/developer.
|
|
54
|
+
- Do **not** write production code or tests.
|
|
55
|
+
|
|
56
|
+
## On completion
|
|
57
|
+
|
|
58
|
+
Update `status.json`:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"slug": "<slug>",
|
|
63
|
+
"currentAgent": "solution-architect",
|
|
64
|
+
"state": "completed",
|
|
65
|
+
"updatedAt": "<ISO8601>"
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
For `spike` intent with human gate after architect: set `"state": "awaiting_approval"` if design needs user sign-off.
|
|
70
|
+
|
|
71
|
+
Handoff: summary of design decisions and recommended next steps for developer.
|