@bonesofspring/ai-rules 0.1.40 → 0.1.42

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 (119) hide show
  1. package/README.md +12 -3
  2. package/bin/cli.js +211 -50
  3. package/package.json +2 -1
  4. package/presets/claude/next/CLAUDE.md +11 -7
  5. package/presets/claude/next/README.md +2 -2
  6. package/presets/claude/next/agents/README.md +50 -1
  7. package/presets/claude/next/agents/accessibility-reviewer.md +65 -0
  8. package/presets/claude/next/agents/api-contract-reviewer.md +69 -0
  9. package/presets/claude/next/agents/build-verifier.md +62 -0
  10. package/presets/claude/next/agents/ci-investigator.md +62 -0
  11. package/presets/claude/next/agents/code-reviewer.md +7 -1
  12. package/presets/claude/next/agents/debugger.md +7 -2
  13. package/presets/claude/next/agents/feature-developer.md +11 -16
  14. package/presets/claude/next/agents/migration-specialist.md +69 -0
  15. package/presets/claude/next/agents/performance-auditor.md +68 -0
  16. package/presets/claude/next/agents/qa-tester.md +4 -2
  17. package/presets/claude/next/agents/security-reviewer.md +64 -0
  18. package/presets/claude/next/agents/task-analyst.md +6 -2
  19. package/presets/claude/next/agents/task-router.md +83 -16
  20. package/presets/claude/next/agents/tech-writer.md +60 -0
  21. package/presets/claude/next/agents/unit-test-generator.md +37 -0
  22. package/presets/claude/next/agents/unit-test-healer.md +38 -0
  23. package/presets/claude/next/agents/unit-test-planner.md +62 -0
  24. package/presets/claude/next/commands/README.md +1 -1
  25. package/presets/claude/next/commands/feature-continue.md +5 -0
  26. package/presets/claude/next/commands/feature-start.md +5 -0
  27. package/presets/claude/next/commands/task-continue.md +8 -2
  28. package/presets/claude/next/commands/task.md +10 -0
  29. package/presets/claude/next/commands/technical-retro.md +6 -1
  30. package/presets/claude/next/hooks/README.md +5 -8
  31. package/presets/claude/next/hooks/chain-team-phases.sh +258 -39
  32. package/presets/claude/next/hooks/guard-shell-command.sh +77 -0
  33. package/presets/claude/next/rules/README.md +20 -44
  34. package/presets/claude/next/rules/architecture/api-public-imports.md +6 -0
  35. package/presets/claude/next/rules/architecture/architecture-boundaries.md +5 -0
  36. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +5 -0
  37. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +5 -0
  38. package/presets/claude/next/rules/architecture/reference-features.md +34 -0
  39. package/presets/claude/next/rules/architecture/types-public-imports.md +6 -0
  40. package/presets/claude/next/rules/stack/arrow-functions.md +5 -0
  41. package/presets/claude/next/rules/stack/navigation-router.md +5 -0
  42. package/presets/claude/next/rules/stack/next-app-router.md +36 -0
  43. package/presets/claude/next/rules/stack/no-type-assertion.md +6 -0
  44. package/presets/claude/next/rules/testing/playwright-agents.md +5 -0
  45. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +32 -8
  46. package/presets/claude/next/rules/ui-and-accessibility/component-styles.md +6 -0
  47. package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +6 -0
  48. package/presets/claude/next/rules/ui-and-accessibility/no-props-spread.md +5 -0
  49. package/presets/claude/next/rules/ui-and-accessibility/react-a11y-coding.md +37 -0
  50. package/presets/claude/next/skills/README.md +11 -1
  51. package/presets/claude/next/skills/ci-investigation/SKILL.md +36 -0
  52. package/presets/claude/next/skills/code-review/SKILL.md +26 -0
  53. package/presets/claude/next/skills/debug-investigation/SKILL.md +28 -0
  54. package/presets/claude/next/skills/feature-delivery/SKILL.md +30 -0
  55. package/presets/claude/next/skills/playwright-e2e/SKILL.md +31 -0
  56. package/presets/claude/next/skills/technical-retro/SKILL.md +40 -0
  57. package/presets/claude/next/skills/unit-testing/SKILL.md +32 -0
  58. package/presets/claude/next/team/README.md +25 -43
  59. package/presets/cursor/next/AGENTS.md +43 -0
  60. package/presets/cursor/next/BUGBOT.md +14 -0
  61. package/presets/cursor/next/agents/README.md +52 -0
  62. package/presets/cursor/next/agents/accessibility-reviewer.md +67 -0
  63. package/presets/cursor/next/agents/api-contract-reviewer.md +71 -0
  64. package/presets/cursor/next/agents/build-verifier.md +64 -0
  65. package/presets/cursor/next/agents/ci-investigator.md +64 -0
  66. package/presets/cursor/next/agents/code-reviewer.md +8 -1
  67. package/presets/cursor/next/agents/debugger.md +7 -2
  68. package/presets/cursor/next/agents/feature-developer.md +10 -8
  69. package/presets/cursor/next/agents/migration-specialist.md +71 -0
  70. package/presets/cursor/next/agents/performance-auditor.md +70 -0
  71. package/presets/cursor/next/agents/playwright-test-generator.md +26 -0
  72. package/presets/cursor/next/agents/playwright-test-healer.md +26 -0
  73. package/presets/cursor/next/agents/playwright-test-planner.md +28 -0
  74. package/presets/cursor/next/agents/qa-tester.md +4 -2
  75. package/presets/cursor/next/agents/security-reviewer.md +66 -0
  76. package/presets/cursor/next/agents/task-analyst.md +3 -2
  77. package/presets/cursor/next/agents/task-router.md +84 -17
  78. package/presets/cursor/next/agents/tech-writer.md +62 -0
  79. package/presets/cursor/next/agents/unit-test-generator.md +39 -0
  80. package/presets/cursor/next/agents/unit-test-healer.md +40 -0
  81. package/presets/cursor/next/agents/unit-test-planner.md +64 -0
  82. package/presets/cursor/next/commands/README.md +17 -1
  83. package/presets/cursor/next/commands/feature-continue.md +5 -0
  84. package/presets/cursor/next/commands/feature-start.md +5 -0
  85. package/presets/cursor/next/commands/task-continue.md +8 -2
  86. package/presets/cursor/next/commands/task.md +10 -0
  87. package/presets/cursor/next/commands/technical-retro.md +6 -1
  88. package/presets/cursor/next/hooks/README.md +8 -0
  89. package/presets/cursor/next/hooks/chain-team-phases.sh +192 -28
  90. package/presets/cursor/next/hooks/guard-shell-command.sh +77 -0
  91. package/presets/cursor/next/hooks.json +7 -1
  92. package/presets/cursor/next/rules/README.md +16 -6
  93. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +32 -8
  94. package/presets/cursor/next/rules/api-public-imports.mdc +2 -1
  95. package/presets/cursor/next/rules/architecture-boundaries.mdc +2 -1
  96. package/presets/cursor/next/rules/arrow-functions.mdc +2 -1
  97. package/presets/cursor/next/rules/code-review-mr.mdc +1 -1
  98. package/presets/cursor/next/rules/css-property-order-stylelint.mdc +4 -1
  99. package/presets/cursor/next/rules/feature-delivery-flow.mdc +1 -1
  100. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +2 -2
  101. package/presets/cursor/next/rules/layer-barrel-exports.mdc +2 -1
  102. package/presets/cursor/next/rules/navigation-router-stack.mdc +2 -1
  103. package/presets/cursor/next/rules/next-app-router.mdc +36 -0
  104. package/presets/cursor/next/rules/no-cross-component-styles-import.mdc +4 -1
  105. package/presets/cursor/next/rules/no-props-spread.mdc +1 -1
  106. package/presets/cursor/next/rules/no-type-assertion-as-import-export.mdc +2 -1
  107. package/presets/cursor/next/rules/playwright-agents.mdc +2 -1
  108. package/presets/cursor/next/rules/react-a11y-coding.mdc +37 -0
  109. package/presets/cursor/next/rules/reference-features.mdc +35 -0
  110. package/presets/cursor/next/rules/types-public-imports.mdc +2 -1
  111. package/presets/cursor/next/skills/README.md +15 -0
  112. package/presets/cursor/next/skills/ci-investigation/SKILL.md +36 -0
  113. package/presets/cursor/next/skills/code-review/SKILL.md +26 -0
  114. package/presets/cursor/next/skills/debug-investigation/SKILL.md +28 -0
  115. package/presets/cursor/next/skills/feature-delivery/SKILL.md +30 -0
  116. package/presets/cursor/next/skills/playwright-e2e/SKILL.md +31 -0
  117. package/presets/cursor/next/skills/technical-retro/SKILL.md +40 -0
  118. package/presets/cursor/next/skills/unit-testing/SKILL.md +32 -0
  119. package/presets/cursor/next/team/README.md +38 -40
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  description: Стили компонентов — колокация, импорты, корневой styled как Root
3
- alwaysApply: true
3
+ globs:
4
+ - app/src/ui/**/*.ts
5
+ - app/src/ui/**/*.tsx
6
+ alwaysApply: false
4
7
  ---
5
8
 
6
9
  # Стили только рядом с компонентом
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  description: Избегать спред-а пропов при передаче в компоненты
3
- alwaysApply: true
4
3
  globs: app/src/**/*.tsx
4
+ alwaysApply: false
5
5
  ---
6
6
 
7
7
  # Не использовать спред пропов при передаче в компоненты
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Избегать приведения типов через as на границах модулей (импорт/экспорт)
3
- alwaysApply: true
3
+ globs: app/src/**/*.ts,app/src/**/*.tsx
4
+ alwaysApply: false
4
5
  ---
5
6
 
6
7
  # Не использовать `as` для приведения типов при экспорте и импорте (кроме необходимых случаев)
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Playwright Agents (planner/generator/healer) configuration for e2e structure in app/__tests__/e2e
3
- alwaysApply: true
3
+ globs: app/__tests__/e2e/**/*
4
+ alwaysApply: false
4
5
  ---
5
6
 
6
7
  # Playwright Agents in this project
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Accessibility при написании React UI — семантика, формы, focus, keyboard
3
+ globs: app/src/ui/**/*.tsx,app/src/ui/**/*.ts
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # A11y при разработке UI
8
+
9
+ Reviewer (`accessibility-reviewer`) проверяет diff; эти правила — **при написании** кода.
10
+
11
+ ## Семантика и ARIA
12
+
13
+ - Предпочитать **нативные элементы** (`button`, `a`, `label`, `input`) вместо `div` с `onClick`.
14
+ - **`role` / `aria-*`** — только когда нативного аналога нет; не дублировать то, что даёт семантика.
15
+ - Заголовки — иераархия `h1`–`h6` без пропусков уровней ради стилей.
16
+
17
+ ## Формы
18
+
19
+ - Каждый input связан с **`label`** (`htmlFor` / `id` или обёртка).
20
+ - Сообщения об ошибках — **`aria-describedby`**, `aria-invalid` при validation errors.
21
+ - Кнопки submit vs button — явный `type`.
22
+
23
+ ## Клавиатура и focus
24
+
25
+ - Все интерактивные элементы **достижимы с Tab** и активируются Enter/Space где ожидается.
26
+ - **Modals/drawers** — focus trap, возврат focus на trigger при закрытии, Esc закрывает (если по UX).
27
+ - Не удалять видимый **focus outline** без замены на доступный custom focus style.
28
+
29
+ ## Контент
30
+
31
+ - Изображения — **`alt`** (пустой `alt` только для декора).
32
+ - Иконки-кнопки — **`aria-label`** или visually hidden text.
33
+ - Динамические обновления — `aria-live` для критичных status/error (умеренно).
34
+
35
+ ## Проверка
36
+
37
+ - При сомнении — devtools a11y tree или `accessibility-reviewer` в pipeline для UI-heavy фич.
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Эталонные фичи репозитория — копировать структуру при реализации новых задач. Заполните пути после init в целевом репо.
3
+ globs: app/src/**/*
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Эталонные фичи (reference features)
8
+
9
+ Перед реализацией найди фичу того же типа и **повтори её структуру**, не изобретая новую организацию файлов.
10
+
11
+ ## Таблица эталонов
12
+
13
+ Замени **TBD** на реальные пути после договорённости в команде (или при `ai-rules init` в целевом репо):
14
+
15
+ | Слой | Эталон | Что копировать |
16
+ |------|--------|----------------|
17
+ | UI page | **TBD** `app/src/ui/pages/<Example>/` | `components/`, `*.data.ts`, `styles.ts`, barrel |
18
+ | Store slice | **TBD** `app/src/store/slices/<example>/` | slice, thunks, selectors, types |
19
+ | API service | **TBD** `app/src/api/services/<example>/` | service, mappers, barrel |
20
+ | Types module | **TBD** `app/src/types/<example>/` | domain types, JSDoc, barrel export |
21
+ | Unit tests | **TBD** рядом с эталонным mapper/service | `*.spec.ts`, describe/it naming |
22
+ | E2E area | **TBD** `app/__tests__/e2e/<Area>/` | `*.cases.md`, page objects, `_shared/` |
23
+
24
+ ## Как использовать
25
+
26
+ 1. Определи затронутые слои из `decomposition.md` или задачи.
27
+ 2. Открой эталон из таблицы (после заполнения путей).
28
+ 3. Зеркаль именование, порядок файлов, паттерны импортов и тестов.
29
+ 4. Если эталона нет — выбери **самую близкую** существующую фичу того же слоя и зафиксируй выбор в handoff.
30
+
31
+ ## Связанные правила
32
+
33
+ - `code-quality-and-refactoring.mdc` — повторять паттерны, не deep-import.
34
+ - `feature-delivery-workflow.mdc` — порядок слоёв.
35
+ - skill `feature-delivery` — end-to-end сценарий.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Импорт доменных типов только через публичный API @/types
3
- alwaysApply: true
3
+ globs: app/src/**/*.ts,app/src/**/*.tsx
4
+ alwaysApply: false
4
5
  ---
5
6
 
6
7
  # Импорты из `@/types`
@@ -0,0 +1,15 @@
1
+ # `.cursor/skills` (preset next)
2
+
3
+ Project skills for Cursor. They keep long workflows out of always-on rules while preserving the same team conventions as the Claude preset.
4
+
5
+ | Skill | When to use |
6
+ |-------|-------------|
7
+ | `feature-delivery` | End-to-end feature work across types, API, store, UI, tests |
8
+ | `code-review` | MR/diff review using project architecture and test standards |
9
+ | `debug-investigation` | Reproducing and fixing bugs with root-cause evidence |
10
+ | `ci-investigation` | Diagnosing and fixing failing CI checks on PRs/branches |
11
+ | `unit-testing` | Planning, generating, or healing unit test coverage |
12
+ | `playwright-e2e` | Planning, generating, or healing Playwright e2e coverage |
13
+ | `technical-retro` | Technical retrospective for a task, sprint, incident, or agent pipeline |
14
+
15
+ Skills are copied to `.cursor/skills/` by `ai-rules init cursor --preset next`.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: ci-investigation
3
+ description: Investigates failing CI checks on PRs and branches — lint, type-check, unit, e2e — with local reproduction and minimal fixes. Use when CI is red or for ci-fix pipeline tasks.
4
+ ---
5
+
6
+ # CI Investigation
7
+
8
+ ## Workflow
9
+
10
+ 1. Identify the **first failing check** (lint, type-check, unit, e2e, build).
11
+ 2. Capture error output — ignore cascading failures until root cause is found.
12
+ 3. Reproduce locally with the same commands CI uses from `app/`:
13
+ - `lint:js`, `lint:css`, `type-check`
14
+ - targeted unit test file or suite
15
+ - affected Playwright spec if e2e failed
16
+ 4. Inspect git diff for changed files related to the failure.
17
+ 5. Apply **minimal fix** — no unrelated refactors.
18
+
19
+ ## Artifact
20
+
21
+ Write `ci-report.md` under the task slug folder:
22
+
23
+ - Failed check name and link/log excerpt
24
+ - Root cause classification
25
+ - Fix applied (or handoff to feature-developer)
26
+ - Validation commands and results
27
+
28
+ ## Handoff Rules
29
+
30
+ - Config-only or one-line fixes → fix in place, re-run check.
31
+ - Missing tests or architecture work → document and route to `feature-developer` or `qa-tester`.
32
+ - Flaky e2e → prefer `playwright-test-healer` after ci-investigator identifies the spec.
33
+
34
+ ## Validation
35
+
36
+ Always re-run the failing command locally before marking complete. If environment blocks execution, state the exact command and blocker.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: code-review
3
+ description: Reviews pull requests, merge requests, git diffs, and branch changes using the preset's architecture, import, UI, API, and testing standards. Use when the user asks for review or when code-reviewer runs in an agent pipeline.
4
+ ---
5
+
6
+ # Code Review
7
+
8
+ ## Inputs
9
+
10
+ Use the local repository as the source of truth: `git status`, `git diff`, task artifacts under `.cursor/team/tasks/<slug>/` when present, and opened files. Do not invent hosting metadata such as labels, CI status, or reviewers.
11
+
12
+ ## Review Order
13
+
14
+ 1. Understand the intent and affected layers.
15
+ 2. Check correctness and regressions first.
16
+ 3. Verify architecture boundaries: UI does not know DTO/transport, store does not depend on UI, API services do not pull UI/store.
17
+ 4. Check public imports through `@/types` and `@/api`, plus barrel updates for new public symbols.
18
+ 5. Review UI consistency, styling conventions, and prop shape.
19
+ 6. Check tests: unit for mapper/domain logic, behavior tests for HTTP client changes, e2e plan/spec updates for user flows.
20
+ 7. Report validation gaps: lint, stylelint, type-check, or relevant tests not run.
21
+
22
+ ## Output
23
+
24
+ Lead with findings ordered by severity. Each finding should include the file, the problem, impact, and a concrete fix direction. If there are no findings, say so and call out remaining test or validation risk.
25
+
26
+ For agent team tasks, write `.cursor/team/tasks/<slug>/review.md` and set `status.json` to `completed` or `changes_requested`.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: debug-investigation
3
+ description: Investigates bugs, failing tests, crashes, and incorrect behavior with runtime evidence before applying minimal fixes. Use for bugfix tasks, debugger agent runs, regressions, and flaky test diagnosis.
4
+ ---
5
+
6
+ # Debug Investigation
7
+
8
+ ## Process
9
+
10
+ 1. Reproduce the issue or collect the closest available evidence: error output, failing test, browser snapshot, logs, or user steps.
11
+ 2. Define expected vs actual behavior in one sentence.
12
+ 3. Trace the failing path through the smallest relevant slice of the codebase.
13
+ 4. Identify the root cause before editing. Avoid broad refactors during bugfixes.
14
+ 5. Apply the smallest fix that preserves existing architecture and public contracts.
15
+ 6. Add or update a regression test when the behavior is user-facing or likely to recur.
16
+ 7. Run the narrow failing check first, then relevant lint/type/test validation.
17
+
18
+ ## Artifacts
19
+
20
+ For agent team tasks, write `.cursor/team/tasks/<slug>/debug-report.md` with:
21
+
22
+ - Reproduction steps or evidence source.
23
+ - Root cause.
24
+ - Fix scope.
25
+ - Regression coverage.
26
+ - Remaining risk.
27
+
28
+ Update `status.json` when complete.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: feature-delivery
3
+ description: Delivers Next.js frontend features end-to-end across domain types, API services, store, UI, mocks, tests, and validation. Use when implementing or extending a feature, especially through /task or feature-developer.
4
+ ---
5
+
6
+ # Feature Delivery
7
+
8
+ ## Workflow
9
+
10
+ 1. Read the task brief, acceptance criteria, and decomposition if present.
11
+ 2. Read **`reference-features.mdc`** and mirror the closest reference feature.
12
+ 3. Work in layer order: types -> API contract/mappers -> services -> store -> UI -> mocks -> **unit tests** -> e2e (if in scope).
13
+ 4. Keep DTOs out of UI/store; expose domain types through `@/types` and API calls through `@/api`.
14
+ 5. Prefer small, reviewable edits; update barrels when adding public symbols.
15
+ 6. Add or update focused tests for changed behavior.
16
+ 7. Run project validation from `app/`: `lint:js`, `lint:css`, and `type-check` when TypeScript changed.
17
+
18
+ ## Rule Map
19
+
20
+ - Core stack and layers: `next-app-core.mdc`, `architecture-boundaries.mdc`.
21
+ - Data/API: `http-client.mdc`, `api-services.mdc`, `store-rtk.mdc`.
22
+ - Public imports: `types-public-imports.mdc`, `api-public-imports.mdc`, `layer-barrel-exports.mdc`.
23
+ - UI: `react-ui.mdc`, `react-a11y-coding.mdc`, `no-props-spread.mdc`, `no-cross-component-styles-import.mdc`.
24
+ - App Router: `next-app-router.mdc`.
25
+ - Tests: `tests-unit.mdc`, `tests-e2e-structure.mdc`, `playwright-agents.mdc`.
26
+ - Finish: `post-change-lint.mdc`, `package-manager.mdc`.
27
+
28
+ ## Handoff
29
+
30
+ Summarize completed work by layer, validation results, and known gaps. If this is part of an agent team task, update `.cursor/team/tasks/<slug>/status.json`.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: playwright-e2e
3
+ description: Plans, generates, and heals Playwright e2e tests using this preset's app/__tests__/e2e layout, *.cases.md plans, page objects, and shared helpers. Use for e2e planning, test generation, or fixing failing browser tests.
4
+ ---
5
+
6
+ # Playwright E2E
7
+
8
+ ## Project Layout
9
+
10
+ - Test root: `app/__tests__/e2e`.
11
+ - Test plans: `*.cases.md` files under the matching feature folder.
12
+ - Executable specs: `*.spec.ts` files in the same folder.
13
+ - Seed/setup reference: `app/__tests__/e2e/seed.spec.ts`.
14
+
15
+ Do not introduce top-level `specs/` or `tests/` folders for real coverage unless the user explicitly asks for a sandbox.
16
+
17
+ ## Planner
18
+
19
+ Create or update the relevant `*.cases.md` file. Each scenario should include title, preconditions, steps, and expected result. Cover happy path, important edge cases, validation, and error states.
20
+
21
+ ## Generator
22
+
23
+ Generate specs from `*.cases.md` into the same folder. Reuse existing page objects and `_shared/` helpers. Keep test names aligned with scenario names.
24
+
25
+ ## Healer
26
+
27
+ Fix selectors, waits, setup, or page-object details without weakening business assertions. Use the matching `*.cases.md` file as the behavior contract.
28
+
29
+ ## Validation
30
+
31
+ Run the affected spec when feasible. If the environment blocks execution, report the command that should be run and the blocker.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: technical-retro
3
+ description: Facilitates technical retrospectives for tasks, sprints, incidents, releases, and agent-team pipelines. Use when the user asks for retro, postmortem, process review, or action items after delivery.
4
+ ---
5
+
6
+ # Technical Retro
7
+
8
+ ## Inputs
9
+
10
+ Ask for missing period, focus, task slug, participants, or format constraints. If a slug is provided, read `.cursor/team/tasks/<slug>/` artifacts and local git status/diff. Do not invent facts not present in artifacts or the user's message.
11
+
12
+ ## Facilitation Principles
13
+
14
+ - Focus on process and system behavior, not blame.
15
+ - Separate facts, interpretations, and proposed actions.
16
+ - Balance what worked with what slowed delivery.
17
+ - Keep action items concrete, owned, and measurable.
18
+
19
+ ## Default Structure
20
+
21
+ 1. Goal and scope.
22
+ 2. Timeline or factual observations.
23
+ 3. What worked.
24
+ 4. What hurt quality, speed, or confidence.
25
+ 5. Root causes for the top one or two issues.
26
+ 6. Experiments and action items.
27
+
28
+ ## Agent Team Block
29
+
30
+ For `/task` pipelines, include router, analyst, developer, **build-verifier**, reviewer, QA/e2e, hooks, and rules.
31
+
32
+ ## Preset feedback loop
33
+
34
+ If the same issue appeared in 2+ tasks, add section **Preset updates**:
35
+
36
+ - Proposed change to `.cursor/rules/`, `.cursor/agents/`, or `.cursor/skills/`
37
+ - One concrete diff or file path to update
38
+ - Whether it belongs in always-on rules vs globs vs skill
39
+
40
+ Do not apply preset changes without user approval.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: unit-testing
3
+ description: Plans, generates, and heals unit tests for mappers, thunks, HTTP client behavior, and React components using colocated *.spec.ts files and tests-unit rules. Use for unit test planning, generation, or fixing failing unit tests.
4
+ ---
5
+
6
+ # Unit Testing
7
+
8
+ ## Project Layout
9
+
10
+ - Specs colocated with source: `*.spec.ts` / `*.spec.tsx` next to the module under test.
11
+ - Legacy `*.test.ts` / `*.test.tsx` — do not rename without a separate task.
12
+ - Runner: Jest or Vitest as configured in the target repo; components use `@testing-library/react`.
13
+
14
+ Follow **`tests-unit.mdc`** (Cursor) or **`rules/testing/tests-unit.md`** (Claude).
15
+
16
+ ## Planner
17
+
18
+ Write or update `.cursor/team/tasks/<slug>/unit-test-plan.md` (or `.claude/team/...`).
19
+
20
+ Each scenario needs a Russian `it()` title (capital letter after each sentence). Cover mappers, thunks, client behavior branches, and component interactions per AC.
21
+
22
+ ## Generator
23
+
24
+ Implement specs from `unit-test-plan.md`. Reuse project test-store, HTTP mocks, and existing test utilities. Do not change production code.
25
+
26
+ ## Healer
27
+
28
+ Fix mocks, async timing, selectors, and setup — preserve business assertions. Use `unit-test-plan.md` and `brief.md` as the behavior contract.
29
+
30
+ ## Validation
31
+
32
+ Run affected unit tests from `app/` when feasible. Report command, pass/fail, and remaining gaps vs plan.
@@ -6,23 +6,27 @@
6
6
 
7
7
  ```
8
8
  .cursor/team/
9
- active-task.json # { "slug": "current-task-slug" }
9
+ active-task.json
10
10
  tasks/
11
11
  <slug>/
12
- pipeline.json # Router: intent, steps, humanGates
13
- status.json # Current step and state machine
14
- brief.md # Analyst: Definition of Ready
15
- decomposition.md # Analyst: task breakdown
16
- debug-report.md # Debugger (bugfix)
17
- architecture.md # Solution architect (spike / complex)
12
+ pipeline.json
13
+ status.json
14
+ brief.md
15
+ decomposition.md
16
+ debug-report.md # fixApplied: true/false
17
+ validation-report.md # build-verifier: PASS | FAIL
18
+ architecture.md
19
+ migration-plan.md
20
+ ci-report.md
21
+ a11y-review.md
22
+ perf-report.md
23
+ security-review.md
24
+ api-contract-review.md
25
+ unit-test-plan.md
26
+ documentation.md
27
+ review.md
18
28
  ```
19
29
 
20
- ## Slug
21
-
22
- - kebab-case, derived from task title
23
- - max 48 characters
24
- - example: `order-history-date-filter`
25
-
26
30
  ## pipeline.json schema
27
31
 
28
32
  ```json
@@ -32,9 +36,10 @@
32
36
  "summary": "Add date filter to Order History",
33
37
  "steps": [
34
38
  { "agent": "task-analyst", "label": "Clarify and decompose" },
35
- { "agent": "feature-developer", "label": "Implement" },
39
+ { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
40
+ { "agent": "build-verifier", "label": "Validation gate" },
36
41
  { "agent": "code-reviewer", "label": "Code review" },
37
- { "agent": "qa-tester", "label": "Tests", "scope": "full" }
42
+ { "agent": "qa-tester", "label": "E2E", "scope": "e2e-only" }
38
43
  ],
39
44
  "humanGates": ["after:task-analyst"],
40
45
  "autoChain": true,
@@ -42,11 +47,17 @@
42
47
  }
43
48
  ```
44
49
 
45
- ### intent values
50
+ ### Step fields
46
51
 
47
- `feature` | `bugfix` | `review-only` | `test-only` | `refactor` | `spike` | `retro`
52
+ | Field | Description |
53
+ |-------|-------------|
54
+ | `agent` | kebab-case name or array when `parallel: true` |
55
+ | `label` | Human-readable step name |
56
+ | `scope` | Passed to agents (e.g. `unit-in-dev`, `e2e-only`) |
57
+ | `skipIf` | `debugger.fixed` \| `ci-investigator.resolved` |
58
+ | `parallel` | Invoke all `agent` values in one parent turn |
48
59
 
49
- ## status.json schema (pipeline mode)
60
+ ## status.json (pipeline mode)
50
61
 
51
62
  ```json
52
63
  {
@@ -57,20 +68,15 @@
57
68
  "phase": "executing",
58
69
  "state": "in_progress",
59
70
  "awaitingHumanGate": false,
71
+ "parallelCompleted": [],
72
+ "retryAfterFix": null,
60
73
  "updatedAt": "2026-05-29T12:00:00.000Z"
61
74
  }
62
75
  ```
63
76
 
64
77
  ### phase
65
78
 
66
- | Value | Description |
67
- |-------|-------------|
68
- | `executing` | Pipeline step in progress (preferred) |
69
- | `analysis` | Legacy: analyst phase |
70
- | `development` | Legacy: developer phase |
71
- | `review` | Legacy: review phase |
72
- | `testing` | Legacy: QA phase |
73
- | `done` | All steps complete |
79
+ Prefer **`executing`** for pipeline mode. Legacy: `analysis`, `development`, `review`, `testing`, `done`.
74
80
 
75
81
  ### state
76
82
 
@@ -80,27 +86,19 @@
80
86
  | `completed` | Current step finished |
81
87
  | `awaiting_approval` | Human gate; use `/task-continue` |
82
88
  | `changes_requested` | Reviewer requires fixes |
83
- | `approved` | Legacy: approved via continue |
84
-
85
- ## Git
86
-
87
- Commit task artifacts if you want them to survive `ai-rules clean cursor`. Alternatively copy finished tasks to `docs/agent-workflow/tasks/<slug>/`.
89
+ | `validation_failed` | build-verifier failed |
90
+ | `approved` | Legacy continue |
88
91
 
89
92
  ## Workflow entry
90
93
 
91
94
  ```bash
92
95
  /task <описание задачи>
93
- # при human gate после analyst:
94
96
  /task-continue <slug>
95
- # или
96
- /feature-continue <slug>
97
- # после пайплайна:
98
97
  /technical-retro <slug>
99
98
  ```
100
99
 
101
- Legacy:
100
+ Legacy: `/feature-start`, `/feature-continue`.
102
101
 
103
- ```bash
104
- /feature-start <описание>
105
- /feature-continue <slug>
106
- ```
102
+ ## Git
103
+
104
+ Commit task artifacts if you want them to survive `ai-rules clean cursor`. Or copy finished tasks to `docs/agent-workflow/tasks/<slug>/`.