@bonesofspring/ai-rules 0.1.42 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/package.json +1 -1
  3. package/presets/claude/next/CLAUDE.md +1 -1
  4. package/presets/claude/next/agents/README.md +61 -0
  5. package/presets/claude/next/agents/api-contract-reviewer.md +1 -1
  6. package/presets/claude/next/agents/build-verifier.md +2 -0
  7. package/presets/claude/next/agents/feature-developer.md +8 -21
  8. package/presets/claude/next/agents/task-router.md +24 -126
  9. package/presets/claude/next/commands/task.md +1 -1
  10. package/presets/claude/next/rules/README.md +3 -3
  11. package/presets/claude/next/rules/api-and-data/api-services.md +3 -3
  12. package/presets/claude/next/rules/api-and-data/http-client.md +2 -2
  13. package/presets/claude/next/rules/api-and-data/store-rtk.md +2 -2
  14. package/presets/claude/next/rules/architecture/README.md +8 -11
  15. package/presets/claude/next/rules/architecture/api-public-imports.md +3 -26
  16. package/presets/claude/next/rules/architecture/architecture-boundaries.md +6 -6
  17. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +44 -69
  18. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +5 -5
  19. package/presets/claude/next/rules/architecture/public-imports.md +46 -0
  20. package/presets/claude/next/rules/architecture/reference-features.md +4 -1
  21. package/presets/claude/next/rules/architecture/types-public-imports.md +3 -29
  22. package/presets/claude/next/rules/stack/next-app-core.md +20 -70
  23. package/presets/claude/next/rules/stack/no-type-assertion.md +3 -2
  24. package/presets/claude/next/rules/stack/types-jsdoc.md +1 -1
  25. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +6 -0
  26. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +14 -1
  27. package/presets/claude/next/rules/tooling-and-review/code-quality.md +3 -11
  28. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +2 -2
  29. package/presets/claude/next/rules/tooling-and-review/package-manager.md +6 -15
  30. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +14 -24
  31. package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +6 -18
  32. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +1 -1
  33. package/presets/claude/next/skills/feature-delivery/SKILL.md +5 -20
  34. package/presets/cursor/next/AGENTS.md +1 -1
  35. package/presets/cursor/next/agents/README.md +81 -0
  36. package/presets/cursor/next/agents/api-contract-reviewer.md +1 -1
  37. package/presets/cursor/next/agents/build-verifier.md +2 -0
  38. package/presets/cursor/next/agents/code-reviewer.md +1 -1
  39. package/presets/cursor/next/agents/feature-developer.md +9 -30
  40. package/presets/cursor/next/agents/task-router.md +23 -125
  41. package/presets/cursor/next/commands/task.md +1 -1
  42. package/presets/cursor/next/rules/README.md +6 -7
  43. package/presets/cursor/next/rules/agent-team-intake.mdc +2 -2
  44. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +14 -1
  45. package/presets/cursor/next/rules/api-public-imports.mdc +3 -24
  46. package/presets/cursor/next/rules/api-services.mdc +3 -3
  47. package/presets/cursor/next/rules/architecture-boundaries.mdc +6 -6
  48. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +3 -11
  49. package/presets/cursor/next/rules/code-review-mr.mdc +2 -2
  50. package/presets/cursor/next/rules/css-property-order-stylelint.mdc +6 -18
  51. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +45 -22
  52. package/presets/cursor/next/rules/http-client.mdc +2 -2
  53. package/presets/cursor/next/rules/layer-barrel-exports.mdc +5 -5
  54. package/presets/cursor/next/rules/next-app-core.mdc +18 -71
  55. package/presets/cursor/next/rules/no-type-assertion-as-import-export.mdc +4 -1
  56. package/presets/cursor/next/rules/package-manager.mdc +6 -15
  57. package/presets/cursor/next/rules/post-change-lint.mdc +14 -24
  58. package/presets/cursor/next/rules/public-imports.mdc +48 -0
  59. package/presets/cursor/next/rules/react-ui.mdc +1 -1
  60. package/presets/cursor/next/rules/reference-features.mdc +5 -1
  61. package/presets/cursor/next/rules/store-rtk.mdc +2 -2
  62. package/presets/cursor/next/rules/types-jsdoc.mdc +1 -1
  63. package/presets/cursor/next/rules/types-public-imports.mdc +3 -26
  64. package/presets/cursor/next/skills/feature-delivery/SKILL.md +5 -20
  65. package/presets/cursor/next/rules/feature-delivery-flow.mdc +0 -74
@@ -1,26 +1,14 @@
1
1
  ---
2
2
  paths:
3
- - app/src/**/*.{css,ts,tsx}
3
+ - app/src/ui/**/*.styles.ts
4
+ - app/src/ui/**/*.styles.tsx
5
+ - app/src/ui/**/styles.ts
6
+ - app/src/ui/**/styles.tsx
4
7
  - app/**/*.css
5
8
  ---
6
9
 
7
10
  # Порядок CSS-свойств (как в Stylelint)
8
11
 
9
- Действует для **любого** CSS в репозитории: `.css`, стилевые блоки в `styles.ts` / `styles.tsx`, `styled` / Linaria и другой CSS-in-JS в `.ts` / `.tsx`, если этот код попадает под `lint:css`.
12
+ Порядок свойств как в **`app/.stylelintrc`** (`stylelint-config-idiomatic-order`). Не дублировать список вручную.
10
13
 
11
- Источник: `app/.stylelintrc` `@sh/stylelint-config-react` пакет **`stylelint-config-idiomatic-order`** (правило `order/properties-order`). Свойства, не попавшие в список, идут **в конце блока в алфавитном порядке** (`unspecified: bottomAlphabetical`).
12
-
13
- Пиши объявления в **одном** блоке в такой последовательности групп:
14
-
15
- 1. **`composes`** — только для CSS Modules (если есть).
16
- 2. **`all`**
17
- 3. **Позиционирование:** `position`, `z-index`, затем `top`, `right`, `bottom`, `left`.
18
- 4. **Отображение и раскладка:** `display`, `overflow`.
19
- 5. **Размеры:** `width`, `min-width`, `max-width`, `height`, `min-height`, `max-height`, `box-sizing`.
20
- 6. **Flex:** `flex`, `flex-basis`, `flex-direction`, `flex-flow`, `flex-grow`, `flex-shrink`, `flex-wrap`, `align-content`, `align-items`, `align-self`, `justify-content`, `order`.
21
- 7. **Внутренние отступы:** `padding-top`, `padding-right`, `padding-bottom`, `padding-left`.
22
- 8. **Рамка:** общие `border`, `border-width`, `border-style`, `border-color`, `border-radius`; затем для сторон **сверху по часовой** — `border-top` и его `-width`, `-style`, `-color`, `-radius`, то же для `right`, `bottom`, `left`.
23
- 9. **Внешние отступы:** `margin-top`, `margin-right`, `margin-bottom`, `margin-left`.
24
- 10. **Остальные свойства** — после перечисленных, **по алфавиту** (типографика, фон, анимации, `cursor`, и т.д.).
25
-
26
- Автоисправление из каталога `app`: `lint:css --fix` (проверяет `**/*.{css,ts}`; менеджер пакетов — `tooling-and-review/package-manager.md`).
14
+ Автоисправление из `app/`: **`lint:css --fix`**. Полный прогон **`tooling-and-review/post-change-lint.md`**.
@@ -72,7 +72,7 @@ paths:
72
72
  - **Не передавать пропы в компоненты через spread** (`<Foo {...x} />`). Только явные атрибуты; подробности — `ui-and-accessibility/no-props-spread.md` (в `app/src/ui` это дополнительно ловит ESLint).
73
73
  - Описывать пропсы через `type Props = { ... }` или `interface Props { ... }`.
74
74
  - Не использовать `any`; при необходимости — обобщения (`<T>`), `unknown`, type guards.
75
- - Для доменных сущностей использовать типы из `@/types` (и enum из `@/types/enums`), а не описывать их заново (`architecture/types-public-imports.md`).
75
+ - Для доменных сущностей использовать типы из `@/types` (и enum из `@/types/enums`), а не описывать их заново (`architecture/public-imports.md`).
76
76
 
77
77
  # Логика и side effects
78
78
 
@@ -5,26 +5,11 @@ description: Delivers Next.js frontend features end-to-end across domain types,
5
5
 
6
6
  # Feature Delivery
7
7
 
8
- ## Workflow
9
-
10
- 1. Read the task brief, acceptance criteria, and decomposition if present.
11
- 2. Read **`architecture/reference-features.md`** and mirror the closest reference feature.
12
- 3. Work in layer order: types -> API -> store -> UI -> **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: `rules/stack/next-app-core.md`, `rules/architecture/architecture-boundaries.md`.
21
- - Data/API: `rules/api-and-data/http-client.md`, `rules/api-and-data/api-services.md`, `rules/api-and-data/store-rtk.md`.
22
- - Public imports: `rules/architecture/types-public-imports.md`, `rules/architecture/api-public-imports.md`, `rules/architecture/layer-barrel-exports.md`.
23
- - UI: `rules/ui-and-accessibility/react-ui.md`, `react-a11y-coding.md`, `no-props-spread.md`, `component-styles.md`.
24
- - App Router: `rules/stack/next-app-router.md`.
25
- - Tests: `rules/testing/tests-unit.md`, `rules/testing/tests-e2e-structure.md`, `rules/testing/playwright-agents.md`.
26
- - Finish: `rules/tooling-and-review/post-change-lint.md`, `rules/tooling-and-review/package-manager.md`.
8
+ 1. Read task brief, acceptance criteria, and decomposition if present.
9
+ 2. Read **`rules/architecture/feature-delivery-workflow.md`** and **`rules/architecture/reference-features.md`** — follow layer order and mirror closest reference feature.
10
+ 3. Add or update focused tests for changed behavior.
11
+ 4. Validation from `app/`: see **`rules/tooling-and-review/post-change-lint.md`** (pipeline: scoped lint OK if next step is `build-verifier`).
27
12
 
28
13
  ## Handoff
29
14
 
30
- Summarize completed work by layer, validation results, and known gaps. If this is part of an agent team task, update `.claude/team/tasks/<slug>/status.json`.
15
+ Summarize by layer, validation results, and known gaps. Agent team: update `.claude/team/tasks/<slug>/status.json`.
@@ -8,7 +8,7 @@ See `.cursor/rules/README.md` for the full catalog and loading strategy.
8
8
 
9
9
  | Задача | Куда смотреть |
10
10
  |--------|----------------|
11
- | Любая новая work-задача | `/task` → `commands/task.md` + `agent-team-orchestrator.mdc` |
11
+ | Любая новая work-задача | `/task` → `commands/task.md` + `agent-team-orchestrator.mdc` (+ `agent-team-intake.mdc` on-demand) |
12
12
  | Новая фича end-to-end | skill `feature-delivery` + `feature-delivery-workflow.mdc` |
13
13
  | Стек и слои | `next-app-core.mdc` |
14
14
  | Эталонные фичи | `reference-features.mdc` (заполнить пути в репо) |
@@ -75,3 +75,84 @@
75
75
  | `docs-only` | analyst → tech-writer |
76
76
 
77
77
  Опциональные шаги (router добавляет по контексту): `api-contract-reviewer`, `accessibility-reviewer`, `security-reviewer`, `performance-auditor`, `tech-writer`.
78
+
79
+ ## pipeline.json reference
80
+
81
+ ### Step fields
82
+
83
+ | Field | Required | Description |
84
+ |-------|----------|-------------|
85
+ | `agent` | yes | Subagent name (kebab-case) or array for `parallel: true` |
86
+ | `label` | yes | Short human-readable step name |
87
+ | `scope` | no | e.g. `unit-in-dev`, `e2e-only`, `regression`, `full` |
88
+ | `skipIf` | no | `debugger.fixed` \| `ci-investigator.resolved` |
89
+ | `parallel` | no | When `true` and `agent` is array — invoke all in one turn |
90
+
91
+ ### Minimal template
92
+
93
+ ```json
94
+ {
95
+ "slug": "<slug>",
96
+ "intent": "feature",
97
+ "summary": "One-line task summary",
98
+ "steps": [
99
+ { "agent": "task-analyst", "label": "Clarify and decompose" },
100
+ { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
101
+ { "agent": "build-verifier", "label": "Lint, type-check, unit smoke" },
102
+ { "agent": "code-reviewer", "label": "Code review" }
103
+ ],
104
+ "humanGates": ["after:task-analyst"],
105
+ "autoChain": true,
106
+ "skipped": []
107
+ }
108
+ ```
109
+
110
+ ### Example: parallel reviewers
111
+
112
+ ```json
113
+ {
114
+ "intent": "feature",
115
+ "steps": [
116
+ { "agent": "task-analyst", "label": "Clarify" },
117
+ { "agent": "feature-developer", "label": "Implement", "scope": "unit-in-dev" },
118
+ { "agent": "build-verifier", "label": "Validation gate" },
119
+ {
120
+ "agent": ["accessibility-reviewer", "security-reviewer"],
121
+ "parallel": true,
122
+ "label": "A11y and security"
123
+ },
124
+ { "agent": "code-reviewer", "label": "Review" }
125
+ ],
126
+ "humanGates": ["after:task-analyst"]
127
+ }
128
+ ```
129
+
130
+ ### Example: bugfix skipIf
131
+
132
+ ```json
133
+ {
134
+ "intent": "bugfix",
135
+ "steps": [
136
+ { "agent": "debugger", "label": "Root cause" },
137
+ { "agent": "feature-developer", "label": "Fix if needed", "skipIf": "debugger.fixed" },
138
+ { "agent": "build-verifier", "label": "Validation" },
139
+ { "agent": "code-reviewer", "label": "Review" }
140
+ ],
141
+ "humanGates": []
142
+ }
143
+ ```
144
+
145
+ ### Initial status.json
146
+
147
+ ```json
148
+ {
149
+ "slug": "<slug>",
150
+ "intent": "<intent>",
151
+ "pipelineIndex": 0,
152
+ "currentAgent": "<steps[0].agent>",
153
+ "phase": "executing",
154
+ "state": "in_progress",
155
+ "awaitingHumanGate": false,
156
+ "updatedAt": "<ISO8601>"
157
+ }
158
+ ```
@@ -13,7 +13,7 @@ You are an API contract reviewer for a layered Next.js frontend (`@/types`, `@/a
13
13
  2. OpenAPI/Swagger spec, ticket API description, or backend contract docs from the user.
14
14
  3. Changed files in `app/src/types/**`, `app/src/api/**`, mocks, store thunks.
15
15
 
16
- Apply **`types-public-imports.mdc`**, **`api-public-imports.mdc`**, **`api-services.mdc`**, **`http-client.mdc`**.
16
+ Apply **`public-imports.mdc`**, **`api-services.mdc`**, **`http-client.mdc`**.
17
17
 
18
18
  ## Review scope
19
19
 
@@ -7,6 +7,8 @@ model: fast
7
7
 
8
8
  You are a build verification specialist. You **validate** implementation quality before code review — you do not edit production code or tests.
9
9
 
10
+ **SSOT for full validation in pipeline:** run complete **`lint:js`**, **`lint:css`**, and **`type-check`** from `app/` even if feature-developer ran scoped checks.
11
+
10
12
  ## Inputs
11
13
 
12
14
  1. `.cursor/team/tasks/<slug>/brief.md` and `decomposition.md`.
@@ -13,7 +13,7 @@ You are a senior code reviewer. You may write only review artifacts under `.curs
13
13
  2. `.cursor/team/tasks/<slug>/decomposition.md` — check coverage of planned tasks.
14
14
  3. Git diff for changed files (`git diff`, `git status`).
15
15
 
16
- Apply the **`code-review` skill** and checklist from **`code-review-mr.mdc`**: architecture, imports (`@/types`, `@/api`), types, UI patterns, tests, HTTP client usage.
16
+ Apply the **`code-review` skill** and **`code-review-mr.mdc`** checklist.
17
17
 
18
18
  ## Tests gate
19
19
 
@@ -8,41 +8,20 @@ You are a senior frontend developer working in a Next.js monorepo with strict la
8
8
 
9
9
  ## Before coding
10
10
 
11
- 1. Read `.cursor/team/tasks/<slug>/brief.md` and `decomposition.md`.
12
- 2. Read `architecture.md`, `migration-plan.md`, `api-contract-review.md`, `debug-report.md`, `validation-report.md`, and `review.md` if present.
13
- 3. Read `status.json` proceed if `state` is `in_progress`, `approved`, or continuing after `/task-continue` / fix loop (`retryAfterFix`).
14
- 4. Read `pipeline.json` if present for step context and scope.
15
- 5. Read **`reference-features.mdc`** and mirror the closest reference feature structure.
16
- 6. Use the **`feature-delivery` skill** and **`feature-delivery-workflow.mdc`** for layer order.
11
+ 1. Read `.cursor/team/tasks/<slug>/brief.md`, `decomposition.md`, and prior artifacts if present (`architecture.md`, `debug-report.md`, `validation-report.md`, `review.md`, …).
12
+ 2. Read `status.json` proceed if `in_progress`, `approved`, or `retryAfterFix`.
13
+ 3. Read `pipeline.json` for step context and scope.
14
+ 4. Follow the **`feature-delivery` skill** (layer order, reference features, validation handoff).
17
15
 
18
16
  ## Task execution rules
19
17
 
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
- - **Unit tests are mandatory before handoff** for mappers, store logic, and non-trivial pure functions (`tests-unit.mdc`). E2E is usually a later pipeline step.
23
- - Mark completed tasks in `decomposition.md` with `[x]` or a **Done** column update.
24
- - After all code changes run **`post-change-lint.mdc`**: `lint:js`, `lint:css`, `type-check` from `app/`.
18
+ - Do **not** start blocked tasks or tasks with incomplete dependencies.
19
+ - **Unit tests mandatory before handoff** for mappers, store logic, and non-trivial pure functions.
20
+ - Mark completed tasks in `decomposition.md`.
21
+ - Validation: **`post-change-lint.mdc`**. If pipeline next step is **`build-verifier`**, scoped lint/type-check on **changed files** is enough; full project lint is build-verifier's job.
25
22
 
26
23
  ## On completion
27
24
 
28
- Update `status.json`:
29
-
30
- ```json
31
- {
32
- "slug": "<slug>",
33
- "currentAgent": "feature-developer",
34
- "phase": "executing",
35
- "state": "completed",
36
- "updatedAt": "<ISO8601>"
37
- }
38
- ```
39
-
40
- Provide a short handoff summary:
41
-
42
- - Tasks completed vs remaining
43
- - Files changed (by layer)
44
- - Unit specs added/updated
45
- - Lint/type-check result
46
- - Known gaps for build-verifier or reviewer
25
+ Update `status.json` (`currentAgent`: `feature-developer`, `state`: `completed`). Handoff: tasks done, files by layer, unit specs, validation result, gaps for build-verifier/reviewer.
47
26
 
48
27
  Do not perform formal code review — that is the code-reviewer subagent's job.
@@ -11,6 +11,7 @@ You are a task router for a Next.js frontend agent team. You **do not** implemen
11
11
 
12
12
  - User task description (from `/task` or orchestrator).
13
13
  - Optional: existing files under `.cursor/team/tasks/<slug>/`.
14
+ - Pipeline JSON schema, examples, step fields — **`agents/README.md`**.
14
15
 
15
16
  ## Intent detection
16
17
 
@@ -24,150 +25,47 @@ You are a task router for a Next.js frontend agent team. You **do not** implemen
24
25
  | `a11y` | «a11y», «доступность», «accessibility», «WCAG», «screen reader», «клавиатура» | task-analyst → feature-developer → build-verifier → accessibility-reviewer → code-reviewer |
25
26
  | `review-only` | «ревью», «review MR», «проверь diff», «code review» | code-reviewer |
26
27
  | `test-only` | «покрой тестами», «напиши тесты» (mixed unit+e2e, no impl) | task-analyst → qa-tester |
27
- | `unit-only` | «unit», «юнит», «mapper tests», «покрой маппер», «почини unit» | unit-test-planner → unit-test-generator, or unit-test-healer for failing unit tests |
28
- | `e2e-only` | «e2e», «playwright», «browser test», «сценарии e2e», «почини e2e» | playwright-test-planner → playwright-test-generator, or playwright-test-healer for failing tests |
28
+ | `unit-only` | «unit», «юнит», «mapper tests», «покрой маппер», «почини unit» | unit-test-planner → unit-test-generator, or unit-test-healer |
29
+ | `e2e-only` | «e2e», «playwright», «browser test», «сценарии e2e», «почини e2e» | playwright-test-planner → playwright-test-generator, or playwright-test-healer |
29
30
  | `docs-only` | «документация», «README», «changelog», «ADR», «migration guide» | task-analyst → tech-writer |
30
31
  | `refactor` | «рефакторинг», «без изменения поведения», «почисти» | task-analyst → feature-developer → build-verifier → code-reviewer |
31
32
  | `spike` | «исследуй», «оцени», «можно ли», «spike», proof of concept | task-analyst → solution-architect |
32
33
  | `retro` | «ретро», «разбор», «postmortem» | (no pipeline — orchestrator runs `/technical-retro`) |
33
34
 
34
- Adjust steps when context is clear:
35
+ ## Adjust steps (when context is clear)
35
36
 
36
- - **Skip task-analyst** if AC and scope are fully specified (document in `skipped`).
37
- - **Add solution-architect** for cross-layer features (API + store + UI), new public APIs, or architecture uncertainty insert after analyst, before developer.
38
- - **Add api-contract-reviewer** when new/changed backend endpoints, OpenAPI/Swagger, or DTO contract sync insert after architect (or after analyst if no architect), before developer.
39
- - **Add accessibility-reviewer** for UI-heavy `feature` tasks — after build-verifier, **parallel with security-reviewer** when both apply (see parallel step example).
40
- - **Add security-reviewer** for auth, tokens, forms, sensitive data — after build-verifier, parallel with accessibility-reviewer when both apply; before code-reviewer.
41
- - **Add performance-auditor** for perf-sensitive features insert after developer or as optional post-review audit step.
42
- - **Add tech-writer** when docs/changelog/README explicitly requested — append as final step for `feature`, `migration`, `docs-only`.
43
- - **Use unit-test trio** instead of `qa-tester` when request is explicitly unit-only.
44
- - **Use Playwright specialists** for e2e-heavy features instead of `qa-tester` (scope e2e-only on qa when both unit and e2e needed).
45
- - **Always insert build-verifier** after feature-developer (or ci-investigator/debugger when they changed code) for `feature`, `bugfix`, `refactor`, `migration`, `a11y`.
46
- - **Skip qa-tester** for review-only, spike (no code), ci-fix (unless regression scope needed), perf-audit, docs-only, unit-only/e2e-only handled by specialists, or trivial one-line fixes (document risk).
47
- - **Skip feature-developer** for review-only, test-only (tests only), retro, perf-audit, docs-only (after analyst), ci-fix when investigator fixes in place.
48
- - **ci-fix:** skip feature-developer with `skipIf: ci-investigator.resolved` when investigator fixes in place.
49
- - **bugfix:** use `skipIf: debugger.fixed` on feature-developer when debugger applied the fix.
50
- - **Model:** use `model: inherit` (not fast) when pipeline has 4+ steps or cross-layer uncertainty (API + store + UI).
37
+ - Skip **task-analyst** if AC/scope fully specified document in `skipped`.
38
+ - Add **solution-architect** for cross-layer / new public APIs — after analyst, before developer.
39
+ - Add **api-contract-reviewer** for new/changed backend contracts — before developer.
40
+ - Add **accessibility-reviewer** / **security-reviewer** after build-verifier (parallel when both apply).
41
+ - Add **tech-writer** when docs/changelog requested.
42
+ - **Always build-verifier** after developer (or after ci-investigator/debugger if they changed code) for `feature`, `bugfix`, `refactor`, `migration`, `a11y`.
43
+ - **skipIf:** `debugger.fixed` on developer (bugfix); `ci-investigator.resolved` (ci-fix).
44
+ - **Model:** `inherit` when 4+ steps or cross-layer uncertainty.
51
45
 
52
- ## Output: pipeline.json
53
-
54
- Write to `.cursor/team/tasks/<slug>/pipeline.json`:
55
-
56
- ```json
57
- {
58
- "slug": "<slug>",
59
- "intent": "feature",
60
- "summary": "One-line task summary",
61
- "steps": [
62
- { "agent": "task-analyst", "label": "Clarify and decompose" },
63
- { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
64
- { "agent": "build-verifier", "label": "Lint, type-check, unit smoke" },
65
- { "agent": "code-reviewer", "label": "Code review" },
66
- { "agent": "qa-tester", "label": "E2E tests", "scope": "e2e-only" }
67
- ],
68
- "humanGates": ["after:task-analyst"],
69
- "autoChain": true,
70
- "skipped": []
71
- }
72
- ```
73
-
74
- ### Example: feature with optional reviewers
75
-
76
- ```json
77
- {
78
- "intent": "feature",
79
- "steps": [
80
- { "agent": "task-analyst", "label": "Clarify and decompose" },
81
- { "agent": "api-contract-reviewer", "label": "Validate API contract" },
82
- { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
83
- { "agent": "build-verifier", "label": "Validation gate" },
84
- {
85
- "agent": ["accessibility-reviewer", "security-reviewer"],
86
- "parallel": true,
87
- "label": "A11y and security review"
88
- },
89
- { "agent": "code-reviewer", "label": "Code review" },
90
- { "agent": "playwright-test-planner", "label": "E2E plan", "scope": "changed-flows-only" },
91
- { "agent": "playwright-test-generator", "label": "E2E specs" },
92
- { "agent": "tech-writer", "label": "Documentation" }
93
- ],
94
- "humanGates": ["after:task-analyst"]
95
- }
96
- ```
97
-
98
- ### Example: bugfix with skip
99
-
100
- ```json
101
- {
102
- "intent": "bugfix",
103
- "steps": [
104
- { "agent": "debugger", "label": "Root cause" },
105
- { "agent": "feature-developer", "label": "Fix if needed", "skipIf": "debugger.fixed" },
106
- { "agent": "build-verifier", "label": "Validation" },
107
- { "agent": "code-reviewer", "label": "Review" }
108
- ],
109
- "humanGates": []
110
- }
111
- ```
112
-
113
- ### Step fields
114
-
115
- | Field | Required | Description |
116
- |-------|----------|-------------|
117
- | `agent` | yes | Subagent name (kebab-case) or array for `parallel: true` |
118
- | `label` | yes | Short human-readable step name |
119
- | `scope` | no | e.g. `unit-in-dev`, `e2e-only`, `regression`, `full` — passed to agents |
120
- | `skipIf` | no | `debugger.fixed` \| `ci-investigator.resolved` — skip step when artifact says fix already applied |
121
- | `parallel` | no | When `true` and `agent` is array — orchestrator invokes all agents in one turn |
122
-
123
- ### humanGates
124
-
125
- Values: `after:<agent-name>` — orchestrator stops after that agent; user runs `/task-continue <slug>` or `/feature-continue <slug>`.
46
+ ## humanGates (defaults)
126
47
 
127
48
  | Intent | Default humanGates |
128
49
  |--------|-------------------|
129
50
  | `feature`, `refactor`, `test-only`, `a11y` | `["after:task-analyst"]` |
130
51
  | `migration` | `["after:migration-specialist"]` |
131
52
  | `docs-only` | `["after:task-analyst"]` |
132
- | `unit-only` | `["after:unit-test-planner"]` when new plan before generation; `[]` for pure healer |
133
- | `e2e-only` | `["after:playwright-test-planner"]` when new plan; `[]` for pure healer |
134
- | `bugfix`, `review-only`, `ci-fix` | `[]` (unless analyst added) |
53
+ | `unit-only` | `["after:unit-test-planner"]` when new plan; `[]` for healer |
54
+ | `e2e-only` | `["after:playwright-test-planner"]` when new plan; `[]` for healer |
55
+ | `bugfix`, `review-only`, `ci-fix` | `[]` |
135
56
  | `spike` | `["after:solution-architect"]` |
136
57
  | `perf-audit` | `[]` |
137
58
 
138
- ### skipped (optional)
139
-
140
- ```json
141
- "skipped": [{ "agent": "task-analyst", "reason": "AC provided in ticket" }]
142
- ```
143
-
144
- ## Initial status.json
59
+ ## Output
145
60
 
146
- After writing pipeline.json, write:
147
-
148
- ```json
149
- {
150
- "slug": "<slug>",
151
- "intent": "<intent>",
152
- "pipelineIndex": 0,
153
- "currentAgent": "<steps[0].agent>",
154
- "phase": "executing",
155
- "state": "in_progress",
156
- "awaitingHumanGate": false,
157
- "updatedAt": "<ISO8601>"
158
- }
159
- ```
160
-
161
- Also write `.cursor/team/active-task.json` → `{ "slug": "<slug>" }`.
61
+ Write `.cursor/team/tasks/<slug>/pipeline.json` and initial `status.json`; set `.cursor/team/active-task.json` → `{ "slug": "<slug>" }`. Minimal template — см. **`agents/README.md`**.
162
62
 
163
63
  ## Handoff to orchestrator
164
64
 
165
- Respond with:
166
-
167
- 1. **Intent** and one-line summary.
168
- 2. **Planned steps** (table: #, agent, label).
169
- 3. **Skipped roles** and why.
170
- 4. **Human gates** (if any).
171
- 5. Tell orchestrator to invoke `steps[0].agent` now (unless intent is `retro` — then run `/technical-retro`).
65
+ 1. Intent + one-line summary.
66
+ 2. Planned steps (table: #, agent, label).
67
+ 3. Skipped roles and why.
68
+ 4. Human gates (if any).
69
+ 5. Invoke `steps[0].agent` now (unless `retro` → `/technical-retro`).
172
70
 
173
71
  Do not invoke implementation agents yourself.
@@ -5,7 +5,7 @@ description: Route a natural-language task through the agent-team pipeline: task
5
5
 
6
6
  # Task — единая точка входа (router + pipeline)
7
7
 
8
- Главная команда для постановки задачи. Родительский агент = оркестратор (`agent-team-orchestrator.mdc`).
8
+ Главная команда для постановки задачи. Родительский агент = оркестратор (`agent-team-orchestrator.mdc`). Intake для work-запросов без `/task` — `agent-team-intake.mdc`.
9
9
 
10
10
  ## Аргументы
11
11
 
@@ -20,8 +20,8 @@
20
20
  ### Loading strategy
21
21
 
22
22
  - **`alwaysApply: true`** (Cursor) / **без `paths:`** (Claude) — только базовые инварианты:
23
- - `next-app-core`, `post-change-lint`, `package-manager`, `agent-team-intake`, `code-quality-and-refactoring`
24
- - **Globs / `paths:`** architecture, imports, UI, tests, feature-delivery-workflow, reference-features, next-app-router, react-a11y-coding
23
+ - `next-app-core`, `post-change-lint`, `package-manager`, `code-quality-and-refactoring`
24
+ - **On-demand** — `agent-team-intake` (через orchestrator/commands), `agent-team-orchestrator`, architecture, imports, UI, tests, feature-delivery-workflow, reference-features, next-app-router, react-a11y-coding
25
25
  - **Skills** — длинные процедуры (`feature-delivery`, `code-review`, …)
26
26
 
27
27
  ### Эталонные фичи
@@ -36,17 +36,16 @@
36
36
  | `next-app-router.mdc` | App Router, RSC, loading/error |
37
37
  | `react-a11y-coding.mdc` | A11y при написании UI |
38
38
  | `feature-delivery-workflow.mdc` | Сквозной чеклист (on-demand, не always-on) |
39
- | `agent-team-intake.mdc` | Автоподсказка `/task` при постановке задачи (alwaysApply) |
39
+ | `agent-team-intake.mdc` | Подсказка `/task` при work-запросе (on-demand, через orchestrator) |
40
40
  | `package-manager.mdc` | Перед `install` / `run` в терминале определить менеджер пакетов репо (lockfile, `packageManager`) и использовать только его |
41
41
  | `agent-team-orchestrator.mdc` | `/task`, router, `pipeline.json`, build-verifier, parallel steps |
42
- | `next-app-core.mdc` | Стек, слои, порты‑адаптеры (alwaysApply) |
42
+ | `next-app-core.mdc` | Стек, слои, карта каталогов (alwaysApply) |
43
43
  | `post-change-lint.mdc` | **Обязательный** прогон ESLint + Stylelint после любых изменений кода |
44
44
  | `architecture-boundaries.mdc` | Границы UI / store / API, импорты (`@/types`, `@/api`), порты‑адаптеры, фича как срез |
45
45
  | `http-client.mdc` | Один HTTP‑стек, контракты из `@/types`, без разбросанного низкоуровневого API |
46
46
  | `api-services.mdc` | Сервисы, мапперы, вызовы через прикладные API‑клиенты |
47
47
  | `store-rtk.mdc` | Redux Toolkit, thunk’и, типизация ошибок/ответов как в коде репо |
48
- | `types-public-imports.mdc` | Импорты только через barrel `@/types` |
49
- | `api-public-imports.mdc` | Импорты только через barrel `@/api` (вне `app/src/api/**`) |
48
+ | `public-imports.mdc` | Импорты `@/types`, `@/types/enums`, `@/api` (вне `app/src/api/**`); stubs: `types-public-imports.mdc`, `api-public-imports.mdc` |
50
49
  | `layer-barrel-exports.mdc` | Двухуровневые barrel для слоёв с public API (`@/api`, `@/types`, `@/core`, …) |
51
50
  | `types-jsdoc.mdc` | JSDoc для типов в `app/src/types` (русский текст, `[computed]`, без `@param`/`@returns`) |
52
51
  | `no-type-assertion-as-import-export.mdc` | Ограничение `as`, в т.ч. `instanceof` для ошибок транспорта в `catch` |
@@ -55,6 +54,6 @@
55
54
  | `playwright-agents.mdc`, `tests-e2e-structure.mdc` | E2E |
56
55
  | `react-ui.mdc` | React/Next UI: структура компонентов, соседние `ComponentName.data.ts` / `.utils.ts`, стили, пропсы |
57
56
 
58
- **Коллизии формулировок:** если в разных `.mdc` расходятся детали **импорта типов**, источник правды **`types-public-imports.mdc`** (`@/types`, `@/types/enums`); по **импорту из API‑слоя** (store, UI, прочий код вне `app/src/api/**`) — **`api-public-imports.mdc`** (`@/api`), в том же смысле что правило ESLint `no-restricted-imports` в `app/eslint.config.mjs`.
57
+ **Коллизии формулировок:** импорт типов и API источник правды **`public-imports.mdc`**; дублирует ESLint `no-restricted-imports` в `app/eslint.config.mjs`.
59
58
 
60
59
  Задачи на **сеть, замену HTTP‑библиотеки, новые эндпоинты**: опираться на **`http-client.mdc`** + **`api-services.mdc`** + **`store-rtk.mdc`**.
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: When the user describes a new task, feature, bug, or implementation request (not a pure question), suggest or use /task to run the agent team router. Lightweight intake hint only.
3
- alwaysApply: true
2
+ description: Use when user posts a work request without /task suggest or use /task to run the agent team router. Lightweight intake hint only.
3
+ alwaysApply: false
4
4
  ---
5
5
 
6
6
  # Agent team intake
@@ -7,6 +7,8 @@ alwaysApply: false
7
7
 
8
8
  Parent agent = **manager**. Router plans; specialists execute. Artifacts: `.cursor/team/tasks/<slug>/`.
9
9
 
10
+ Work request без `/task` — см. **`agent-team-intake.mdc`** (когда предлагать router вместо прямого кодинга).
11
+
10
12
  ## Entry points
11
13
 
12
14
  | Command | When |
@@ -121,6 +123,17 @@ After each agent completes, ensure `status.json` has `state: completed` (or `awa
121
123
 
122
124
  If `pipeline.json` is missing (old `/feature-start` tasks), fall back to fixed phases: analysis → development → review → testing. Hook supports both.
123
125
 
126
+ ## Skip pipeline when
127
+
128
+ Do **not** run `/task` + router for:
129
+
130
+ - Pure questions («как работает X», «объясни»).
131
+ - Typo / one-file fix / trivial config with no architecture risk.
132
+ - User explicitly says «без pipeline», «просто сделай», or continues an active slug.
133
+ - Single-line `docs-only` with no code impact.
134
+
135
+ Borderline work requests — см. **`agent-team-intake.mdc`**.
136
+
124
137
  ## Auto-detection (optional)
125
138
 
126
- When user describes a **task** (not a question "how does X work"), suggest `/task <their message>` or run router proactively if they agree.
139
+ When user describes a **non-trivial task** (not a question), suggest `/task <message>` or run router if they agree.
@@ -1,29 +1,8 @@
1
1
  ---
2
- description: Импорт из API-слоя только через публичный barrel @/api
3
- globs: app/src/**/*.ts,app/src/**/*.tsx
2
+ description: Moved to public-imports.mdc read that file instead
4
3
  alwaysApply: false
5
4
  ---
6
5
 
7
- # Импорты из `@/api`
6
+ # Deprecated
8
7
 
9
- - **Публичный API слоя API** — barrel `app/src/api/index.ts`. Для файлов **вне** `app/src/api/**` импортировать сервисы, клиенты, эндпоинты и публичные типы API **только** как `import … from '@/api'` (или `from '@/api/index'` при необходимости явного пути).
10
- - **Запрещено** для таких потребителей обходить barrel: любой импорт вида `@/api/<что‑угодно>`, кроме `@/api/index`. Это дублирует правило ESLint `no-restricted-imports` в `app/eslint.config.mjs` (паттерн `@/api/*` с исключением `@/api/index`).
11
- - При **добавлении** публичного символа в регламентированный слой — реэкспорт в корневой barrel по **`layer-barrel-exports.mdc`**.
12
-
13
- ## Внутри слоя `app/src/api/**`
14
-
15
- - При реализации сервисов, клиентов и barrel допустимы **относительные** импорты и пути вида `@/api/services/**`, `@/api/clients/**` между файлами этого слоя. Это не относится к потребителям снаружи `app/src/api/**`.
16
-
17
- ## Примеры
18
-
19
- ```typescript
20
- // ✅ Допустимо в store, UI, lib вне app/src/api — только barrel
21
- import { MedcardApiService, MarketplaceApiService } from '@/api'
22
- import type { TReferenceRequest } from '@/api'
23
-
24
- // ❌ Запрещено снаружи app/src/api (сработает ESLint)
25
- import { MedcardApiService } from '@/api/services/MedcardApiService/MedcardApiService'
26
- import { MedcardApiClient } from '@/api/clients/MedcardApiClient'
27
- ```
28
-
29
- При ревью и правках кода **не добавлять** новые импорты из `@/api/...` кроме `@/api` / `@/api/index` в файлах вне `app/src/api/**`.
8
+ Содержимое перенесено в **`public-imports.mdc`** (раздел `@/api`).
@@ -12,7 +12,7 @@ alwaysApply: false
12
12
  - заголовками и кодами ответов,
13
13
  - DTO backend.
14
14
  - Предоставлять UI и store **стабильный доменный интерфейс**:
15
- - функции, работающие с доменными типами из `@/types` (`types-public-imports.mdc`).
15
+ - функции, работающие с доменными типами из `@/types` (`public-imports.mdc`).
16
16
  - мапперы между DTO и доменными типами.
17
17
 
18
18
  # Структура модулей
@@ -23,7 +23,7 @@ alwaysApply: false
23
23
  - файлы с вызовами API (`index.ts` или `*.service.ts`);
24
24
  - файлы мапперов (`*responseMappers.ts`);
25
25
  - специфичные типы запросов/ответов (если не вынесены в `app/src/types/**` с экспортом через barrel `@/types`).
26
- - при необходимости — локальные `index.ts` / barrel внутри модуля для структуры **внутри** `app/src/api/**`; **снаружи** этого слоя UI, store и остальной код импортируют только из корневого barrel `app/src/api/index.ts` (`import … from '@/api'`, **`api-public-imports.mdc`**).
26
+ - при необходимости — локальные `index.ts` / barrel внутри модуля для структуры **внутри** `app/src/api/**`; **снаружи** этого слоя UI, store и остальной код импортируют только из корневого barrel `app/src/api/index.ts` (`import … from '@/api'`, **`public-imports.mdc`**).
27
27
 
28
28
  # Мапперы и типы
29
29
 
@@ -54,5 +54,5 @@ alwaysApply: false
54
54
  - Не смешивать слой API и UI/store:
55
55
  - компоненты не должны зависеть от DTO;
56
56
  - store не должен сам собирать URL/коды эндпоинтов и не обходить сервисы; **транспортный тип ответа** и **контракт ошибки** из `@/types` (как у прикладного клиента) допустимы во thunk при разборе `catch`/payload, если так выстроен сервис (см. `store-rtk.mdc`, `http-client.mdc`).
57
- - При использовании API‑сервисов в UI, store и утилитах **вне** `app/src/api/**` импортировать **только** из `@/api` (корневой barrel), см. **`api-public-imports.mdc`**; внутри слоя API — по относительным путям или `@/api/services/**` / `@/api/clients/**`, не дублируя публичный контракт мимо корневого barrel для внешних потребителей.
57
+ - При использовании API‑сервисов в UI, store и утилитах **вне** `app/src/api/**` импортировать **только** из `@/api` (корневой barrel), см. **`public-imports.mdc`**; внутри слоя API — по относительным путям или `@/api/services/**` / `@/api/clients/**`, не дублируя публичный контракт мимо корневого barrel для внешних потребителей.
58
58