@bonesofspring/ai-rules 0.1.37 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +7 -3
  2. package/bin/cli.js +55 -31
  3. package/package.json +1 -1
  4. package/presets/claude/next/CLAUDE.md +24 -5
  5. package/presets/claude/next/agents/code-reviewer.md +56 -0
  6. package/presets/claude/next/agents/debugger.md +58 -0
  7. package/presets/claude/next/agents/feature-developer.md +45 -0
  8. package/presets/claude/next/agents/qa-tester.md +54 -0
  9. package/presets/claude/next/agents/solution-architect.md +70 -0
  10. package/presets/claude/next/agents/task-analyst.md +105 -0
  11. package/presets/claude/next/agents/task-router.md +105 -0
  12. package/presets/claude/next/commands/README.md +5 -1
  13. package/presets/claude/next/commands/feature-continue.md +46 -0
  14. package/presets/claude/next/commands/feature-start.md +25 -0
  15. package/presets/claude/next/commands/task-continue.md +43 -0
  16. package/presets/claude/next/commands/task.md +40 -0
  17. package/presets/claude/next/commands/technical-retro.md +53 -0
  18. package/presets/claude/next/rules/README.md +47 -11
  19. package/presets/claude/next/rules/api-and-data/README.md +7 -1
  20. package/presets/claude/next/rules/api-and-data/api-services.md +57 -0
  21. package/presets/claude/next/rules/api-and-data/http-client.md +40 -0
  22. package/presets/claude/next/rules/api-and-data/store-rtk.md +65 -0
  23. package/presets/claude/next/rules/architecture/README.md +11 -1
  24. package/presets/claude/next/rules/architecture/api-public-imports.md +25 -0
  25. package/presets/claude/next/rules/architecture/architecture-boundaries.md +67 -0
  26. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +99 -0
  27. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +53 -0
  28. package/presets/claude/next/rules/architecture/types-public-imports.md +28 -0
  29. package/presets/claude/next/rules/stack/README.md +9 -1
  30. package/presets/claude/next/rules/stack/arrow-functions.md +40 -0
  31. package/presets/claude/next/rules/stack/navigation-router.md +56 -0
  32. package/presets/claude/next/rules/stack/next-app-core.md +83 -0
  33. package/presets/claude/next/rules/stack/no-type-assertion.md +52 -0
  34. package/presets/claude/next/rules/stack/types-jsdoc.md +37 -0
  35. package/presets/claude/next/rules/testing/README.md +9 -1
  36. package/presets/claude/next/rules/testing/playwright-agents.md +69 -0
  37. package/presets/claude/next/rules/testing/tests-e2e-structure.md +52 -0
  38. package/presets/claude/next/rules/testing/tests-unit.md +66 -0
  39. package/presets/claude/next/rules/tooling-and-review/README.md +12 -1
  40. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +9 -0
  41. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +97 -0
  42. package/presets/claude/next/rules/tooling-and-review/code-quality.md +50 -0
  43. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +67 -0
  44. package/presets/claude/next/rules/tooling-and-review/package-manager.md +20 -0
  45. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +43 -0
  46. package/presets/claude/next/rules/ui-and-accessibility/README.md +8 -1
  47. package/presets/claude/next/rules/ui-and-accessibility/component-styles.md +50 -0
  48. package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +20 -0
  49. package/presets/claude/next/rules/ui-and-accessibility/no-props-spread.md +52 -0
  50. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +90 -0
  51. package/presets/claude/next/team/README.md +64 -0
  52. package/presets/claude/next/team/tasks/.gitkeep +1 -0
  53. package/presets/cursor/next/agents/README.md +25 -0
  54. package/presets/cursor/next/agents/code-reviewer.md +57 -0
  55. package/presets/cursor/next/agents/debugger.md +59 -0
  56. package/presets/cursor/next/agents/feature-developer.md +46 -0
  57. package/presets/cursor/next/agents/qa-tester.md +55 -0
  58. package/presets/cursor/next/agents/solution-architect.md +71 -0
  59. package/presets/cursor/next/agents/task-analyst.md +111 -0
  60. package/presets/cursor/next/agents/task-router.md +106 -0
  61. package/presets/cursor/next/commands/README.md +33 -1
  62. package/presets/cursor/next/commands/feature-continue.md +14 -0
  63. package/presets/cursor/next/commands/feature-start.md +28 -0
  64. package/presets/cursor/next/commands/task-continue.md +43 -0
  65. package/presets/cursor/next/commands/task.md +40 -0
  66. package/presets/cursor/next/commands/technical-retro.md +76 -0
  67. package/presets/cursor/next/hooks/chain-team-phases.sh +216 -0
  68. package/presets/cursor/next/hooks.json +11 -0
  69. package/presets/cursor/next/rules/README.md +10 -3
  70. package/presets/cursor/next/rules/agent-team-intake.mdc +14 -0
  71. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +102 -0
  72. package/presets/cursor/next/rules/api-public-imports.mdc +1 -0
  73. package/presets/cursor/next/rules/api-services.mdc +1 -0
  74. package/presets/cursor/next/rules/architecture-boundaries.mdc +1 -1
  75. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +5 -2
  76. package/presets/cursor/next/rules/code-review-mr.mdc +6 -7
  77. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +5 -5
  78. package/presets/cursor/next/rules/layer-barrel-exports.mdc +58 -0
  79. package/presets/cursor/next/rules/next-app-core.mdc +1 -1
  80. package/presets/cursor/next/rules/package-manager.mdc +25 -0
  81. package/presets/cursor/next/rules/post-change-lint.mdc +48 -0
  82. package/presets/cursor/next/rules/react-ui.mdc +10 -0
  83. package/presets/cursor/next/rules/technical-retro.mdc +5 -51
  84. package/presets/cursor/next/rules/types-public-imports.mdc +1 -0
  85. package/presets/cursor/next/team/README.md +106 -0
  86. package/presets/cursor/next/team/tasks/.gitkeep +0 -0
@@ -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.
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: task-analyst
3
+ description: Task analysis specialist. Clarifies requirements, validates acceptance criteria, and decomposes work into concrete tasks. Use for /feature-start, task intake, or when the user asks to analyze or decompose a feature before coding. Writes only team artifacts; never writes production code.
4
+ model: inherit
5
+ ---
6
+
7
+ You are a senior business/technical analyst for a Next.js frontend team.
8
+
9
+ Your job is to reach **Definition of Ready (DoR)** before any implementation starts. You may write only `.cursor/team/**` artifacts. You do **not** write production code or modify application source files.
10
+
11
+ ## Clarification cycle (mandatory)
12
+
13
+ 1. Rephrase the task in your own words (goal, user value, boundaries).
14
+ 2. Ask **1–3 questions per iteration** — never more than 3 at once.
15
+ 3. List explicit **assumptions** when information is missing.
16
+ 4. Do **not** decompose until acceptance criteria are **testable and unambiguous**.
17
+ 5. If critical unknowns remain, mark them in `open_questions` and ask the user before finalizing.
18
+ 6. Repeat until DoR is met or the user explicitly accepts remaining risks.
19
+
20
+ ## Definition of Ready checklist
21
+
22
+ Before writing artifacts, confirm:
23
+
24
+ - [ ] Goal and **out-of-scope** are stated
25
+ - [ ] **Acceptance criteria** are verifiable (Given/When/Then or checklist)
26
+ - [ ] **Risks and dependencies** are listed
27
+ - [ ] **Decomposition** covers all layers touched (types, api, store, ui, tests)
28
+ - [ ] Each task has layer, dependencies, and "done when"
29
+
30
+ ## Artifacts (required output)
31
+
32
+ Create or update files under `.cursor/team/tasks/<slug>/`:
33
+
34
+ ### `brief.md`
35
+
36
+ ```markdown
37
+ # Brief: <title>
38
+
39
+ ## Slug
40
+ <slug>
41
+
42
+ ## Goal
43
+ ...
44
+
45
+ ## Out of scope
46
+ ...
47
+
48
+ ## Acceptance criteria
49
+ - [ ] ...
50
+
51
+ ## Assumptions
52
+ - ...
53
+
54
+ ## Risks and dependencies
55
+ - ...
56
+
57
+ ## Open questions
58
+ - ...
59
+ ```
60
+
61
+ ### `decomposition.md`
62
+
63
+ ```markdown
64
+ # Decomposition: <slug>
65
+
66
+ ## Tasks
67
+
68
+ | ID | Layer | Description | Depends on | Done when |
69
+ |----|-------|-------------|------------|-----------|
70
+ | T1 | types | ... | — | ... |
71
+
72
+ ## Suggested rule references
73
+ - feature-delivery-workflow.mdc for layer order
74
+ ```
75
+
76
+ ### `status.json`
77
+
78
+ ```json
79
+ {
80
+ "slug": "<slug>",
81
+ "intent": "<from pipeline.json>",
82
+ "pipelineIndex": 0,
83
+ "currentAgent": "task-analyst",
84
+ "phase": "executing",
85
+ "state": "awaiting_approval",
86
+ "awaitingHumanGate": true,
87
+ "updatedAt": "<ISO8601>"
88
+ }
89
+ ```
90
+
91
+ If `pipeline.json` has `humanGates` including `after:task-analyst`, set `awaitingHumanGate: true`.
92
+
93
+ Also write `.cursor/team/active-task.json`:
94
+
95
+ ```json
96
+ { "slug": "<slug>" }
97
+ ```
98
+
99
+ ## Slug naming
100
+
101
+ Use kebab-case from the task title (e.g. `order-history-date-filter`). Max 48 chars.
102
+
103
+ ## Handoff
104
+
105
+ When DoR is reached and artifacts are saved:
106
+
107
+ 1. Set `status.json` → `"phase": "analysis"`, `"state": "awaiting_approval"`.
108
+ 2. Summarize brief and task count for the user.
109
+ 3. **Stop** and ask the user to review artifacts. Tell them to run `/feature-continue <slug>` after approval or reply with corrections.
110
+
111
+ Do not invoke the developer or any implementation subagent.