@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
package/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0
4
+
5
+ ### Breaking
6
+
7
+ - **Import rules merged:** `types-public-imports.mdc` and `api-public-imports.mdc` → **`public-imports.mdc`** (Claude: `architecture/public-imports.md`). Old filenames remain as deprecated stubs for one release cycle.
8
+ - **`feature-delivery-flow.mdc` removed** — content merged into `feature-delivery-workflow.mdc`.
9
+ - **`agent-team-intake`** no longer always-on (Cursor: `alwaysApply: false`; Claude: `paths:` on commands/team). Use orchestrator or `/task`.
10
+
11
+ ### Changed
12
+
13
+ - Slimmed always-on rules: `next-app-core`, `code-quality-and-refactoring`, `post-change-lint`, `package-manager` (~9 KB baseline vs ~21 KB).
14
+ - Narrowed globs: `css-property-order-stylelint`, `no-type-assertion-as-import-export`, `reference-features`, `public-imports`.
15
+ - `css-property-order` stub — property list delegated to Stylelint `--fix`.
16
+ - Slimmed `task-router` agent; pipeline JSON examples moved to `agents/README.md`.
17
+ - Agents reference skills as SSOT; scoped lint for `feature-developer` when next step is `build-verifier`.
18
+ - Orchestrator: explicit fast-path when to skip pipeline.
19
+
20
+ ## 0.1.42
21
+
22
+ Prior releases — see git history.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.1.42",
3
+ "version": "0.2.0",
4
4
  "description": "Presets of Cursor and Claude rules/commands for Revy Ross personal use",
5
5
  "license": "MIT",
6
6
  "author": "Revy Ross",
@@ -7,7 +7,7 @@ See @rules/README.md for the full catalog and loading strategy.
7
7
  ## Conventions
8
8
 
9
9
  - **Одна тема на файл**; для больших областей — подпапки в `rules/<topic>/`.
10
- - **Session-start rules** — только базовые инварианты (`next-app-core`, lint, package manager, intake, code-quality).
10
+ - **Session-start rules** — только базовые инварианты (`next-app-core`, lint, package manager, code-quality).
11
11
  - **Domain-specific rules** — YAML frontmatter `paths:` (подгружаются при работе с matching-файлами).
12
12
  - Slash-команды — в `commands/`; сценарии — в `skills/`; subagents — в `agents/`.
13
13
 
@@ -67,3 +67,64 @@
67
67
  | `docs-only` | analyst → tech-writer |
68
68
 
69
69
  Опциональные шаги (router добавляет по контексту): `api-contract-reviewer`, `accessibility-reviewer`, `security-reviewer`, `performance-auditor`, `tech-writer`.
70
+
71
+ ## pipeline.json reference
72
+
73
+ ### Step fields
74
+
75
+ | Field | Required | Description |
76
+ |-------|----------|-------------|
77
+ | `agent` | yes | Subagent name (kebab-case) or array for `parallel: true` |
78
+ | `label` | yes | Short human-readable step name |
79
+ | `scope` | no | e.g. `unit-in-dev`, `e2e-only`, `regression`, `full` |
80
+ | `skipIf` | no | `debugger.fixed` \| `ci-investigator.resolved` |
81
+ | `parallel` | no | When `true` and `agent` is array — invoke all in one turn |
82
+
83
+ ### Minimal template
84
+
85
+ ```json
86
+ {
87
+ "slug": "<slug>",
88
+ "intent": "feature",
89
+ "summary": "One-line task summary",
90
+ "steps": [
91
+ { "agent": "task-analyst", "label": "Clarify and decompose" },
92
+ { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
93
+ { "agent": "build-verifier", "label": "Lint, type-check, unit smoke" },
94
+ { "agent": "code-reviewer", "label": "Code review" }
95
+ ],
96
+ "humanGates": ["after:task-analyst"],
97
+ "autoChain": true,
98
+ "skipped": []
99
+ }
100
+ ```
101
+
102
+ ### Example: bugfix skipIf
103
+
104
+ ```json
105
+ {
106
+ "intent": "bugfix",
107
+ "steps": [
108
+ { "agent": "debugger", "label": "Root cause" },
109
+ { "agent": "feature-developer", "label": "Fix if needed", "skipIf": "debugger.fixed" },
110
+ { "agent": "build-verifier", "label": "Validation" },
111
+ { "agent": "code-reviewer", "label": "Review" }
112
+ ],
113
+ "humanGates": []
114
+ }
115
+ ```
116
+
117
+ ### Initial status.json
118
+
119
+ ```json
120
+ {
121
+ "slug": "<slug>",
122
+ "intent": "<intent>",
123
+ "pipelineIndex": 0,
124
+ "currentAgent": "<steps[0].agent>",
125
+ "phase": "executing",
126
+ "state": "in_progress",
127
+ "awaitingHumanGate": false,
128
+ "updatedAt": "<ISO8601>"
129
+ }
130
+ ```
@@ -12,7 +12,7 @@ You are an API contract reviewer for a layered Next.js frontend (`@/types`, `@/a
12
12
  2. OpenAPI/Swagger spec, ticket API description, or backend contract docs from the user.
13
13
  3. Changed files in `app/src/types/**`, `app/src/api/**`, mocks, store thunks.
14
14
 
15
- Apply **`rules/architecture/types-public-imports.md`**, **`rules/architecture/api-public-imports.md`**, **`rules/api-and-data/api-services.md`**, **`rules/api-and-data/http-client.md`**.
15
+ Apply **`rules/architecture/public-imports.md`**, **`rules/api-and-data/api-services.md`**, **`rules/api-and-data/http-client.md`**.
16
16
 
17
17
  ## Review scope
18
18
 
@@ -6,6 +6,8 @@ model: fast
6
6
 
7
7
  You are a build verification specialist. You **validate** implementation quality before code review — you do not edit production code or tests.
8
8
 
9
+ **SSOT for full validation in pipeline:** run complete **`lint:js`**, **`lint:css`**, and **`type-check`** from `app/` even if feature-developer ran scoped checks.
10
+
9
11
  ## Inputs
10
12
 
11
13
  1. `.claude/team/tasks/<slug>/brief.md` and `decomposition.md`.
@@ -8,33 +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 `.claude/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 fix loop (`retryAfterFix`).
14
- 4. Read **`architecture/reference-features.md`** and mirror the closest reference feature structure.
15
- 5. Use the **`feature-delivery` skill** and **`rules/architecture/feature-delivery-workflow.md`**.
11
+ 1. Read `.claude/team/tasks/<slug>/brief.md`, `decomposition.md`, and prior artifacts if present.
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).
16
15
 
17
16
  ## Task execution rules
18
17
 
19
18
  - Work tasks in dependency order (types → api → mocks → store → ui → **unit** → e2e).
20
- - **Unit tests are mandatory before handoff** for mappers, store logic, and non-trivial pure functions (`rules/testing/tests-unit.md`).
21
- - Mark completed tasks in `decomposition.md` with `[x]` or update **Done** column.
22
- - After code changes run **`rules/tooling-and-review/post-change-lint.md`**: `lint:js`, `lint:css`, `type-check` from `app/`.
19
+ - **Unit tests mandatory before handoff** for mappers, store logic, and non-trivial pure functions.
20
+ - Mark completed tasks in `decomposition.md`.
21
+ - Validation: **`rules/tooling-and-review/post-change-lint.md`**. If pipeline next step is **`build-verifier`**, scoped lint/type-check on **changed files** is enough; full project lint is build-verifier's job.
23
22
 
24
23
  ## On completion
25
24
 
26
- Update `status.json`:
27
-
28
- ```json
29
- {
30
- "slug": "<slug>",
31
- "currentAgent": "feature-developer",
32
- "phase": "executing",
33
- "state": "completed",
34
- "updatedAt": "<ISO8601>"
35
- }
36
- ```
37
-
38
- Handoff summary: tasks done, files by layer, unit specs added, lint/type-check result, known gaps.
25
+ Update `status.json` (`currentAgent`: `feature-developer`, `state`: `completed`). Handoff: tasks done, files by layer, unit specs, validation result, gaps for build-verifier/reviewer.
39
26
 
40
27
  Do not perform formal code review — that is the code-reviewer subagent's job.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: task-router
3
3
  description: Task routing specialist. Analyzes user prompt, detects intent, and writes pipeline.json with ordered agent steps. Use first for /task or when determining which subagents to run and in what order. Writes only team artifacts; never writes production code.
4
- model: inherit
4
+ model: fast
5
5
  ---
6
6
 
7
7
  You are a task router for a Next.js frontend agent team. You **do not** implement tasks — you classify intent and plan the agent pipeline.
@@ -10,6 +10,7 @@ You are a task router for a Next.js frontend agent team. You **do not** implemen
10
10
 
11
11
  - User task description (from `/task` or orchestrator).
12
12
  - Optional: existing files under `.claude/team/tasks/<slug>/`.
13
+ - Pipeline JSON schema, examples, step fields — **`agents/README.md`**.
13
14
 
14
15
  ## Intent detection
15
16
 
@@ -23,150 +24,47 @@ You are a task router for a Next.js frontend agent team. You **do not** implemen
23
24
  | `a11y` | «a11y», «доступность», «accessibility», «WCAG», «screen reader», «клавиатура» | task-analyst → feature-developer → build-verifier → accessibility-reviewer → code-reviewer |
24
25
  | `review-only` | «ревью», «review MR», «проверь diff», «code review» | code-reviewer |
25
26
  | `test-only` | «покрой тестами», «напиши тесты» (mixed unit+e2e, no impl) | task-analyst → qa-tester |
26
- | `unit-only` | «unit», «юнит», «mapper tests», «покрой маппер», «почини unit» | unit-test-planner → unit-test-generator, or unit-test-healer for failing unit tests |
27
- | `e2e-only` | «e2e», «playwright», «browser test», «сценарии e2e», «почини e2e» | playwright-test-planner → playwright-test-generator, or playwright-test-healer for failing tests |
27
+ | `unit-only` | «unit», «юнит», «mapper tests», «покрой маппер», «почини unit» | unit-test-planner → unit-test-generator, or unit-test-healer |
28
+ | `e2e-only` | «e2e», «playwright», «browser test», «сценарии e2e», «почини e2e» | playwright-test-planner → playwright-test-generator, or playwright-test-healer |
28
29
  | `docs-only` | «документация», «README», «changelog», «ADR», «migration guide» | task-analyst → tech-writer |
29
30
  | `refactor` | «рефакторинг», «без изменения поведения», «почисти» | task-analyst → feature-developer → build-verifier → code-reviewer |
30
31
  | `spike` | «исследуй», «оцени», «можно ли», «spike», proof of concept | task-analyst → solution-architect |
31
32
  | `retro` | «ретро», «разбор», «postmortem» | no pipeline — orchestrator runs `/technical-retro` |
32
33
 
33
- Adjust steps when context is clear:
34
+ ## Adjust steps (when context is clear)
34
35
 
35
- - **Skip task-analyst** if AC and scope are fully specified (document in `skipped`).
36
- - **Add solution-architect** for cross-layer features (API + store + UI), new public APIs, or architecture uncertainty insert after analyst, before developer.
37
- - **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.
38
- - **Add accessibility-reviewer** for UI-heavy `feature` tasks — after build-verifier, **parallel with security-reviewer** when both apply.
39
- - **Add security-reviewer** for auth, tokens, forms, sensitive data — after build-verifier, parallel with accessibility-reviewer when both apply; before code-reviewer.
40
- - **Add performance-auditor** for perf-sensitive features — insert after developer or as optional post-review audit step.
41
- - **Add tech-writer** when docs/changelog/README explicitly requested — append as final step for `feature`, `migration`, `docs-only`.
42
- - **Use unit-test trio** instead of `qa-tester` when request is explicitly unit-only.
43
- - **Use Playwright specialists** for e2e-heavy features instead of `qa-tester`.
44
- - **Always insert build-verifier** after feature-developer for `feature`, `bugfix`, `refactor`, `migration`, `a11y`.
45
- - **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).
46
- - **Skip feature-developer** for review-only, test-only (tests only), retro, perf-audit, docs-only (after analyst), ci-fix when investigator fixes in place.
47
- - **ci-fix:** skip feature-developer with `skipIf: ci-investigator.resolved` when investigator fixes in place.
48
- - **bugfix:** use `skipIf: debugger.fixed` on feature-developer when debugger applied the fix.
49
- - **Model:** use `model: inherit` when pipeline has 4+ steps or cross-layer uncertainty.
36
+ - Skip **task-analyst** if AC/scope fully specified document in `skipped`.
37
+ - Add **solution-architect** for cross-layer / new public APIs — after analyst, before developer.
38
+ - Add **api-contract-reviewer** for new/changed backend contracts — before developer.
39
+ - Add **accessibility-reviewer** / **security-reviewer** after build-verifier (parallel when both apply).
40
+ - Add **tech-writer** when docs/changelog requested.
41
+ - **Always build-verifier** after developer for `feature`, `bugfix`, `refactor`, `migration`, `a11y`.
42
+ - **skipIf:** `debugger.fixed` (bugfix); `ci-investigator.resolved` (ci-fix).
43
+ - **Model:** `inherit` when 4+ steps or cross-layer uncertainty.
50
44
 
51
- ## Output: pipeline.json
52
-
53
- Write to `.claude/team/tasks/<slug>/pipeline.json`:
54
-
55
- ```json
56
- {
57
- "slug": "<slug>",
58
- "intent": "feature",
59
- "summary": "One-line task summary",
60
- "steps": [
61
- { "agent": "task-analyst", "label": "Clarify and decompose" },
62
- { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
63
- { "agent": "build-verifier", "label": "Lint, type-check, unit smoke" },
64
- { "agent": "code-reviewer", "label": "Code review" },
65
- { "agent": "qa-tester", "label": "E2E tests", "scope": "e2e-only" }
66
- ],
67
- "humanGates": ["after:task-analyst"],
68
- "autoChain": true,
69
- "skipped": []
70
- }
71
- ```
72
-
73
- ### Example: feature with optional reviewers
74
-
75
- ```json
76
- {
77
- "intent": "feature",
78
- "steps": [
79
- { "agent": "task-analyst", "label": "Clarify and decompose" },
80
- { "agent": "api-contract-reviewer", "label": "Validate API contract" },
81
- { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
82
- { "agent": "build-verifier", "label": "Validation gate" },
83
- {
84
- "agent": ["accessibility-reviewer", "security-reviewer"],
85
- "parallel": true,
86
- "label": "A11y and security review"
87
- },
88
- { "agent": "code-reviewer", "label": "Code review" },
89
- { "agent": "playwright-test-planner", "label": "E2E plan" },
90
- { "agent": "playwright-test-generator", "label": "E2E specs" },
91
- { "agent": "tech-writer", "label": "Documentation" }
92
- ],
93
- "humanGates": ["after:task-analyst"]
94
- }
95
- ```
96
-
97
- ### Example: bugfix with skip
98
-
99
- ```json
100
- {
101
- "intent": "bugfix",
102
- "steps": [
103
- { "agent": "debugger", "label": "Root cause" },
104
- { "agent": "feature-developer", "label": "Fix if needed", "skipIf": "debugger.fixed" },
105
- { "agent": "build-verifier", "label": "Validation" },
106
- { "agent": "code-reviewer", "label": "Review" }
107
- ],
108
- "humanGates": []
109
- }
110
- ```
111
-
112
- ### Step fields
113
-
114
- | Field | Required | Description |
115
- |-------|----------|-------------|
116
- | `agent` | yes | Subagent name (kebab-case) or array for `parallel: true` |
117
- | `label` | yes | Short human-readable step name |
118
- | `scope` | no | e.g. `unit-in-dev`, `e2e-only`, `regression`, `full` |
119
- | `skipIf` | no | `debugger.fixed` \| `ci-investigator.resolved` |
120
- | `parallel` | no | When `true` and `agent` is array — invoke all in one turn |
121
-
122
- ### humanGates
123
-
124
- Values: `after:<agent-name>` — orchestrator stops after that agent; user runs `/task-continue <slug>` or `/feature-continue <slug>`.
45
+ ## humanGates (defaults)
125
46
 
126
47
  | Intent | Default humanGates |
127
48
  |--------|-------------------|
128
49
  | `feature`, `refactor`, `test-only`, `a11y` | `["after:task-analyst"]` |
129
50
  | `migration` | `["after:migration-specialist"]` |
130
51
  | `docs-only` | `["after:task-analyst"]` |
131
- | `unit-only` | `["after:unit-test-planner"]` when new plan; `[]` for pure healer |
132
- | `e2e-only` | `["after:playwright-test-planner"]` when new plan; `[]` for pure healer |
133
- | `bugfix`, `review-only`, `ci-fix` | `[]` (unless analyst added) |
52
+ | `unit-only` | `["after:unit-test-planner"]` when new plan; `[]` for healer |
53
+ | `e2e-only` | `["after:playwright-test-planner"]` when new plan; `[]` for healer |
54
+ | `bugfix`, `review-only`, `ci-fix` | `[]` |
134
55
  | `spike` | `["after:solution-architect"]` |
135
56
  | `perf-audit` | `[]` |
136
57
 
137
- ### skipped (optional)
138
-
139
- ```json
140
- "skipped": [{ "agent": "task-analyst", "reason": "AC provided in ticket" }]
141
- ```
142
-
143
- ## Initial status.json
58
+ ## Output
144
59
 
145
- After writing pipeline.json, write:
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
- ```
159
-
160
- Also write `.claude/team/active-task.json` → `{ "slug": "<slug>" }`.
60
+ Write `.claude/team/tasks/<slug>/pipeline.json` and initial `status.json`; set `.claude/team/active-task.json` → `{ "slug": "<slug>" }`. Minimal template — см. **`agents/README.md`**.
161
61
 
162
62
  ## Handoff to orchestrator
163
63
 
164
- Respond with:
165
-
166
- 1. **Intent** and one-line summary.
167
- 2. **Planned steps** (table: #, agent, label).
168
- 3. **Skipped roles** and why.
169
- 4. **Human gates** (if any).
170
- 5. Tell orchestrator to invoke `steps[0].agent` now (unless intent is `retro` — then run `/technical-retro`).
64
+ 1. Intent + one-line summary.
65
+ 2. Planned steps (table: #, agent, label).
66
+ 3. Skipped roles and why.
67
+ 4. Human gates (if any).
68
+ 5. Invoke `steps[0].agent` now (unless `retro` → `/technical-retro`).
171
69
 
172
70
  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 — единая точка входа
7
7
 
8
- Главная команда для постановки задачи в Claude Code. Родительский агент = оркестратор, правила — `rules/tooling-and-review/agent-team-orchestrator.md`.
8
+ Главная команда для постановки задачи в Claude Code. Родительский агент = оркестратор (`rules/tooling-and-review/agent-team-orchestrator.md`). Intake — `rules/tooling-and-review/agent-team-intake.md`.
9
9
 
10
10
  ## Аргументы
11
11
 
@@ -4,8 +4,8 @@
4
4
 
5
5
  ## Loading strategy
6
6
 
7
- - **Session start (no `paths:`):** `next-app-core`, `post-change-lint`, `package-manager`, `agent-team-intake`, `code-quality`, orchestrator
8
- - **`paths:` on-demand:** architecture, imports, UI, tests, feature-delivery-workflow, reference-features, next-app-router, react-a11y-coding
7
+ - **Session start (no `paths:`):** `next-app-core`, `post-change-lint`, `package-manager`, `code-quality`
8
+ - **On-demand (`paths:` or via commands):** `agent-team-intake`, orchestrator, architecture, imports, UI, tests, feature-delivery-workflow, reference-features, next-app-router, react-a11y-coding
9
9
  - **Skills:** long workflows (`feature-delivery`, `code-review`, …)
10
10
 
11
11
  ## С чего начать
@@ -27,4 +27,4 @@
27
27
 
28
28
  Полный список — см. подпапки `architecture/`, `stack/`, `api-and-data/`, `ui-and-accessibility/`, `testing/`, `tooling-and-review/`.
29
29
 
30
- **Коллизии:** импорт типов `architecture/types-public-imports.md`; API вне `app/src/api/**` `architecture/api-public-imports.md`.
30
+ **Коллизии:** импорт типов и API — **`architecture/public-imports.md`**.
@@ -11,7 +11,7 @@ paths:
11
11
  - заголовками и кодами ответов,
12
12
  - DTO backend.
13
13
  - Предоставлять UI и store **стабильный доменный интерфейс**:
14
- - функции, работающие с доменными типами из `@/types` (`architecture/types-public-imports.md`).
14
+ - функции, работающие с доменными типами из `@/types` (`architecture/public-imports.md`).
15
15
  - мапперы между DTO и доменными типами.
16
16
 
17
17
  # Структура модулей
@@ -22,7 +22,7 @@ paths:
22
22
  - файлы с вызовами API (`index.ts` или `*.service.ts`);
23
23
  - файлы мапперов (`*responseMappers.ts`);
24
24
  - специфичные типы запросов/ответов (если не вынесены в `app/src/types/**` с экспортом через barrel `@/types`).
25
- - при необходимости — локальные `index.ts` / barrel внутри модуля для структуры **внутри** `app/src/api/**`; **снаружи** этого слоя UI, store и остальной код импортируют только из корневого barrel `app/src/api/index.ts` (`import … from '@/api'`, **`architecture/api-public-imports.md`**).
25
+ - при необходимости — локальные `index.ts` / barrel внутри модуля для структуры **внутри** `app/src/api/**`; **снаружи** этого слоя UI, store и остальной код импортируют только из корневого barrel `app/src/api/index.ts` (`import … from '@/api'`, **`architecture/public-imports.md`**).
26
26
 
27
27
  # Мапперы и типы
28
28
 
@@ -54,4 +54,4 @@ paths:
54
54
  - Не смешивать слой API и UI/store:
55
55
  - компоненты не должны зависеть от DTO;
56
56
  - store не должен сам собирать URL/коды эндпоинтов и не обходить сервисы; **транспортный тип ответа** и **контракт ошибки** из `@/types` (как у прикладного клиента) допустимы во thunk при разборе `catch`/payload, если так выстроен сервис (см. `api-and-data/store-rtk.md`, `api-and-data/http-client.md`).
57
- - При использовании API‑сервисов в UI, store и утилитах **вне** `app/src/api/**` импортировать **только** из `@/api` (корневой barrel), см. **`architecture/api-public-imports.md`**; внутри слоя API — по относительным путям или `@/api/services/**` / `@/api/clients/**`, не дублируя публичный контракт мимо корневого barrel для внешних потребителей.
57
+ - При использовании API‑сервисов в UI, store и утилитах **вне** `app/src/api/**` импортировать **только** из `@/api` (корневой barrel), см. **`architecture/public-imports.md`**; внутри слоя API — по относительным путям или `@/api/services/**` / `@/api/clients/**`, не дублируя публичный контракт мимо корневого barrel для внешних потребителей.
@@ -12,12 +12,12 @@ paths:
12
12
 
13
13
  - Обычные REST‑вызовы к backend идут через **одну реализацию** в `app/src/lib/clients/**` (модуль общего клиента) и **преднастроенные экземпляры** в `app/src/api/clients/**`, по тому же паттерну, что уже принят в проекте.
14
14
  - Место транспорта в общей картине **порты и адаптеры** — в `architecture/architecture-boundaries.md` (раздел **«Порты и адаптеры»**).
15
- - **Не** вызывать `fetch` напрямую из `app/src/api/services/**`, store и UI (см. `architecture/architecture-boundaries.md`, `api-and-data/api-services.md`); из store/UI — только вызовы через сервисы из `@/api` (`architecture/api-public-imports.md`).
15
+ - **Не** вызывать `fetch` напрямую из `app/src/api/services/**`, store и UI (см. `architecture/architecture-boundaries.md`, `api-and-data/api-services.md`); из store/UI — только вызовы через сервисы из `@/api` (`architecture/public-imports.md`).
16
16
  - **Исключения** (узкие протоколы, отдельный транспорт) — только там, где в репозитории уже есть образец; повторять его, не плодить произвольные обходы общего клиента.
17
17
 
18
18
  ## Типы
19
19
 
20
- - Всё, что относится к **контракту запроса/ответа/ошибки** приложения и реэкспортируется для HTTP‑слоя, импортировать **только** из barrel `@/types`, без deep‑импортов из внутренних файлов `app/src/types/**` (см. `architecture/types-public-imports.md`).
20
+ - Всё, что относится к **контракту запроса/ответа/ошибки** приложения и реэкспортируется для HTTP‑слоя, импортировать **только** из barrel `@/types`, без deep‑импортов из внутренних файлов `app/src/types/**` (см. `architecture/public-imports.md`).
21
21
  - Не поднимать в новом коде **типы и зависимости от внешнего HTTP‑клиента**, от которого проект ушёл; ориентир — **`package.json`** и существующие вызовы.
22
22
 
23
23
  ## Контракт ошибок
@@ -29,7 +29,7 @@ paths:
29
29
  - Асинхронные запросы:
30
30
  - через `createAsyncThunk` или RTK Query.
31
31
  - внутри thunk:
32
- - вызывать API через сервисы, импортированные из `@/api` (**`architecture/api-public-imports.md`**);
32
+ - вызывать API через сервисы, импортированные из `@/api` (**`architecture/public-imports.md`**);
33
33
  - не вызывать HTTP‑клиент напрямую — только через эти сервисы.
34
34
  - Сайд‑эффекты (логирование, аналитика, работа с файлами):
35
35
  - выносить в middleware (`app/src/store/middleware/**`) или специализированные слайсы.
@@ -43,7 +43,7 @@ paths:
43
43
  - при ошибках после вызова сервиса — опираться на **тот же класс/контракт ошибки транспорта**, что использует общий клиент (из `@/types`), и разбирать тело/статус **по полям текущей реализации**, а не по воображаемому API;
44
44
  - в **`catch`** предпочитать **`instanceof`** на класс ошибки транспорта из `@/types` (если он есть в коде) вместо голого `as`, когда это выразимо без шума (см. `stack/no-type-assertion.md`).
45
45
  - Для сущностей:
46
- - доменные типы (включая вычисляемые поля) определять в `app/src/types/**`, экспортировать через barrel и импортировать в слайсы из `@/types` как **источник правды** (`architecture/types-public-imports.md`);
46
+ - доменные типы (включая вычисляемые поля) определять в `app/src/types/**`, экспортировать через barrel и импортировать в слайсы из `@/types` как **источник правды** (`architecture/public-imports.md`);
47
47
  - избегать дублирования описаний сущностей в нескольких местах.
48
48
  - **Граница домена**: в **state** хранить доменные модели; тип **обёртки ответа клиента** допустим как тип **возвращаемого значения thunk** или промежуточно до маппинга — без дублирования DTO в полях state без нужды (согласовано с `api-and-data/api-services.md` и `api-and-data/http-client.md`).
49
49
 
@@ -1,13 +1,10 @@
1
- # Architecture
1
+ # Architecture rules
2
2
 
3
- Границы модулей, слоёв, зависимостей и сквозная доставка фич.
4
-
5
- | Файл | Содержание |
3
+ | Файл | Назначение |
6
4
  |------|------------|
7
- | `architecture-boundaries.md` | UI / store / API, порты и адаптеры, организация фич |
8
- | `layer-barrel-exports.md` | Двухуровневые barrel и чеклист public API |
9
- | `types-public-imports.md` | Импорт типов только через `@/types` |
10
- | `api-public-imports.md` | Импорт API только через `@/api` |
11
- | `feature-delivery-workflow.md` | Чеклист новой фичи, матрица зона → правило |
12
-
13
- Все файлы — **session start** (без `paths:`).
5
+ | `public-imports.md` | Импорты `@/types`, `@/types/enums`, `@/api` (вне `app/src/api/**`) |
6
+ | `types-public-imports.md`, `api-public-imports.md` | Deprecated stubs `public-imports.md` |
7
+ | `architecture-boundaries.md` | Границы UI / store / API, порты‑адаптеры |
8
+ | `layer-barrel-exports.md` | Двухуровневые barrel для слоёв с public API |
9
+ | `feature-delivery-workflow.md` | Сквозной чеклист новой фичи |
10
+ | `reference-features.md` | Эталонные пути UI/store/API/types |
@@ -1,31 +1,8 @@
1
1
  ---
2
2
  paths:
3
- - app/src/**/*.ts
4
- - app/src/**/*.tsx
3
+ - app/src/api/**/*
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 по **`architecture/layer-barrel-exports.md`**.
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/**`.
30
-
31
- **Коллизии формулировок:** по **импорту из API‑слоя** (store, UI, прочий код вне `app/src/api/**`) — источник правды — **этот файл** (`@/api`).
8
+ Содержимое перенесено в **`architecture/public-imports.md`** (раздел `@/api`).
@@ -7,14 +7,14 @@ paths:
7
7
 
8
8
  ## UI (`app/src/ui/**`)
9
9
 
10
- - Может импортировать: `@/ui/**`, `@/store/**`, типы из `@/types` и enum из `@/types/enums` (**только как в `architecture/types-public-imports.md`**), контракт к API — **только** `import … from '@/api'` (**`architecture/api-public-imports.md`**).
10
+ - Может импортировать: `@/ui/**`, `@/store/**`, типы из `@/types` и enum из `@/types/enums` (**только как в `architecture/public-imports.md`**), контракт к API — **только** `import … from '@/api'` (**`architecture/public-imports.md`**).
11
11
  - Не должен:
12
12
  - обращаться к HTTP‑клиенту напрямую;
13
13
  - знать детали DTO backend — только доменные типы.
14
14
 
15
15
  ## Store (`app/src/store/**`)
16
16
 
17
- - Может импортировать: `@/store/**`, сервисы и публичные сущности API — **только** из `@/api` (**`architecture/api-public-imports.md`**), типы из `@/types` и enum из `@/types/enums` (**`architecture/types-public-imports.md`**).
17
+ - Может импортировать: `@/store/**`, сервисы и публичные сущности API — **только** из `@/api` (**`architecture/public-imports.md`**), типы из `@/types` и enum из `@/types/enums` (**`architecture/public-imports.md`**).
18
18
  - Не должен:
19
19
  - зависеть от конкретных UI‑компонентов;
20
20
  - напрямую работать с global/window API.
@@ -24,7 +24,7 @@ paths:
24
24
 
25
25
  Реализация в `services/**`, `clients/**`, реэкспорт в `app/src/api/index.ts`:
26
26
 
27
- - Внутри слоя: типы из `@/types` и enum из `@/types/enums` (**`architecture/types-public-imports.md`**); импорты `@/api/services/**`, `@/api/clients/**`, относительные пути между файлами слоя (`api-and-data/http-client.md`, `api-and-data/api-services.md`).
27
+ - Внутри слоя: типы из `@/types` и enum из `@/types/enums` (**`architecture/public-imports.md`**); импорты `@/api/services/**`, `@/api/clients/**`, относительные пути между файлами слоя (`api-and-data/http-client.md`, `api-and-data/api-services.md`).
28
28
  - Не должен:
29
29
  - тянуть в себя UI или store;
30
30
  - смешивать HTTP‑слой и доменный слой — использовать мапперы.
@@ -39,7 +39,7 @@ paths:
39
39
 
40
40
  - **Входящий адаптер**: UI — ввод пользователя, отображение; зависит от store и доменных типов, не от транспорта.
41
41
  - **Оркестрация сценариев**: store (slices, thunk) — вызывает сервисы, кладёт в state **доменные** модели после маппинга.
42
- - **Исходящий порт (контракт к backend)**: публичный API **`@/api`** (barrel `app/src/api/index.ts`; реализация — в `app/src/api/services/**` и т.д., см. `architecture/api-public-imports.md`).
42
+ - **Исходящий порт (контракт к backend)**: публичный API **`@/api`** (barrel `app/src/api/index.ts`; реализация — в `app/src/api/services/**` и т.д., см. `architecture/public-imports.md`).
43
43
  - **Исходящий адаптер**: общая реализация HTTP в **`app/src/lib/clients/**`** и экземпляры в **`app/src/api/clients/**`**.
44
44
 
45
45
  ## Фича как срез
@@ -50,7 +50,7 @@ paths:
50
50
 
51
51
  - Всегда использовать алиас `@/...` для импортов между слоями.
52
52
  - Внутри одного модуля/фичи можно использовать относительные импорты, но **без подъёма выше корня фичи** (избегать `../../../`).
53
- - При обращении из компонентов, хуков, утилит и других модулей к чужому слою или фиче использовать только **public API** (barrel/index‑файлы и явно экспортируемые сущности), не делать deep‑импорты внутренних файлов других фич; для регламентированных слоёв — **`architecture/layer-barrel-exports.md`** и `architecture/*-public-imports.md`; для API‑слоя снаружи `app/src/api/**` — **`architecture/api-public-imports.md`** (только `@/api`).
53
+ - При обращении из компонентов, хуков, утилит и других модулей к чужому слою или фиче использовать только **public API** (barrel/index‑файлы и явно экспортируемые сущности), не делать deep‑импорты внутренних файлов других фич; для регламентированных слоёв — **`architecture/layer-barrel-exports.md`** и `architecture/public-imports.md`; для API‑слоя снаружи `app/src/api/**` — **`architecture/public-imports.md`** (только `@/api`).
54
54
  - При добавлении нового кода проверять:
55
55
  - если модуль переиспользуемый — он должен зависеть только от более "низких" слоёв (types, utils, api), но не от страниц.
56
56
 
@@ -61,7 +61,7 @@ paths:
61
61
  - Локальные компоненты: поддиректории `components/**` внутри страницы.
62
62
  - Связанный store: `app/src/store/slices/OrderCheckout/**`.
63
63
  - API: `app/src/api/services/OrdersApi/OrderCheckout/**` (имя корневого сервиса взять из принятой в проекте схемы).
64
- - Типы: `app/src/types/**` с экспортом через barrel **`app/src/types/index.ts`** (`architecture/types-public-imports.md`).
64
+ - Типы: `app/src/types/**` с экспортом через barrel **`app/src/types/index.ts`** (`architecture/public-imports.md`).
65
65
 
66
66
  # Требование к агенту
67
67