@bonesofspring/ai-rules 0.1.42 → 0.2.1

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 (103) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/CONTRIBUTING.md +102 -0
  3. package/README.md +2 -0
  4. package/bin/cli.js +4 -2
  5. package/fragments/BUGBOT.md +23 -0
  6. package/package.json +10 -2
  7. package/presets/claude/next/BUGBOT.md +16 -0
  8. package/presets/claude/next/CLAUDE.md +6 -2
  9. package/presets/claude/next/agents/README.md +77 -15
  10. package/presets/claude/next/agents/api-contract-reviewer.md +1 -1
  11. package/presets/claude/next/agents/build-verifier.md +2 -0
  12. package/presets/claude/next/agents/code-reviewer.md +1 -1
  13. package/presets/claude/next/agents/feature-developer.md +8 -21
  14. package/presets/claude/next/agents/playwright-test-generator.md +16 -65
  15. package/presets/claude/next/agents/playwright-test-healer.md +16 -51
  16. package/presets/claude/next/agents/playwright-test-planner.md +15 -55
  17. package/presets/claude/next/agents/task-analyst.md +1 -1
  18. package/presets/claude/next/agents/task-router.md +50 -128
  19. package/presets/claude/next/agents/tech-writer.md +1 -1
  20. package/presets/claude/next/commands/task.md +1 -1
  21. package/presets/claude/next/hooks.json +17 -0
  22. package/presets/claude/next/rules/README.md +7 -3
  23. package/presets/claude/next/rules/api-and-data/api-services.md +3 -3
  24. package/presets/claude/next/rules/api-and-data/http-client.md +2 -2
  25. package/presets/claude/next/rules/api-and-data/store-rtk.md +2 -2
  26. package/presets/claude/next/rules/architecture/README.md +9 -11
  27. package/presets/claude/next/rules/architecture/api-public-imports.md +3 -26
  28. package/presets/claude/next/rules/architecture/architecture-boundaries-ui.md +15 -0
  29. package/presets/claude/next/rules/architecture/architecture-boundaries.md +10 -7
  30. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +44 -69
  31. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +6 -6
  32. package/presets/claude/next/rules/architecture/public-imports.md +46 -0
  33. package/presets/claude/next/rules/architecture/reference-features.md +4 -1
  34. package/presets/claude/next/rules/architecture/types-public-imports.md +3 -29
  35. package/presets/claude/next/rules/stack/README.md +2 -1
  36. package/presets/claude/next/rules/stack/navigation-router-ui.md +15 -0
  37. package/presets/claude/next/rules/stack/navigation-router.md +2 -1
  38. package/presets/claude/next/rules/stack/next-app-core.md +20 -70
  39. package/presets/claude/next/rules/stack/no-type-assertion.md +3 -2
  40. package/presets/claude/next/rules/stack/types-jsdoc.md +1 -1
  41. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +6 -0
  42. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +20 -1
  43. package/presets/claude/next/rules/tooling-and-review/code-quality.md +3 -11
  44. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +22 -59
  45. package/presets/claude/next/rules/tooling-and-review/package-manager.md +6 -15
  46. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +14 -24
  47. package/presets/claude/next/rules/ui-and-accessibility/README.md +1 -2
  48. package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +6 -18
  49. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +5 -4
  50. package/presets/claude/next/skills/feature-delivery/SKILL.md +5 -20
  51. package/presets/claude/next/team/README.md +1 -0
  52. package/presets/claude/next/team/fixtures/bugfix-standard.json +15 -0
  53. package/presets/claude/next/team/fixtures/feature-full.json +16 -0
  54. package/presets/claude/next/team/fixtures/feature-light.json +17 -0
  55. package/presets/cursor/next/AGENTS.md +3 -10
  56. package/presets/cursor/next/BUGBOT.md +2 -0
  57. package/presets/cursor/next/agents/README.md +97 -15
  58. package/presets/cursor/next/agents/api-contract-reviewer.md +1 -1
  59. package/presets/cursor/next/agents/build-verifier.md +2 -0
  60. package/presets/cursor/next/agents/code-reviewer.md +2 -2
  61. package/presets/cursor/next/agents/feature-developer.md +9 -30
  62. package/presets/cursor/next/agents/task-analyst.md +1 -1
  63. package/presets/cursor/next/agents/task-router.md +49 -127
  64. package/presets/cursor/next/agents/tech-writer.md +1 -1
  65. package/presets/cursor/next/commands/task.md +1 -1
  66. package/presets/cursor/next/rules/README.md +27 -8
  67. package/presets/cursor/next/rules/agent-team-intake.mdc +2 -2
  68. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +14 -1
  69. package/presets/cursor/next/rules/api-public-imports.mdc +3 -24
  70. package/presets/cursor/next/rules/api-services.mdc +3 -3
  71. package/presets/cursor/next/rules/architecture-boundaries-ui.mdc +15 -0
  72. package/presets/cursor/next/rules/architecture-boundaries.mdc +7 -7
  73. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +3 -11
  74. package/presets/cursor/next/rules/code-review-mr.mdc +20 -46
  75. package/presets/cursor/next/rules/css-property-order-stylelint.mdc +6 -18
  76. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +45 -22
  77. package/presets/cursor/next/rules/http-client.mdc +2 -2
  78. package/presets/cursor/next/rules/layer-barrel-exports.mdc +6 -6
  79. package/presets/cursor/next/rules/navigation-router-stack.mdc +1 -1
  80. package/presets/cursor/next/rules/navigation-router-ui.mdc +16 -0
  81. package/presets/cursor/next/rules/next-app-core.mdc +18 -71
  82. package/presets/cursor/next/rules/no-cross-component-styles-import.mdc +3 -53
  83. package/presets/cursor/next/rules/no-type-assertion-as-import-export.mdc +4 -1
  84. package/presets/cursor/next/rules/package-manager.mdc +6 -15
  85. package/presets/cursor/next/rules/post-change-lint.mdc +14 -24
  86. package/presets/cursor/next/rules/public-imports.mdc +48 -0
  87. package/presets/cursor/next/rules/react-ui.mdc +5 -4
  88. package/presets/cursor/next/rules/reference-features.mdc +5 -1
  89. package/presets/cursor/next/rules/store-rtk.mdc +2 -2
  90. package/presets/cursor/next/rules/types-jsdoc.mdc +1 -1
  91. package/presets/cursor/next/rules/types-public-imports.mdc +3 -26
  92. package/presets/cursor/next/skills/feature-delivery/SKILL.md +5 -20
  93. package/presets/cursor/next/team/README.md +1 -0
  94. package/presets/cursor/next/team/fixtures/bugfix-standard.json +15 -0
  95. package/presets/cursor/next/team/fixtures/feature-full.json +16 -0
  96. package/presets/cursor/next/team/fixtures/feature-light.json +17 -0
  97. package/scripts/README.md +84 -0
  98. package/scripts/golden-prompts.json +276 -0
  99. package/scripts/preset-manifest.json +72 -0
  100. package/scripts/regression-results/.gitkeep +0 -0
  101. package/scripts/validate-preset.sh +484 -0
  102. package/presets/claude/next/rules/ui-and-accessibility/component-styles.md +0 -56
  103. package/presets/cursor/next/rules/feature-delivery-flow.mdc +0 -74
@@ -1,67 +1,27 @@
1
1
  ---
2
2
  name: playwright-test-planner
3
- description: Use this agent when you need to create comprehensive test plan for a web application or website
4
- tools: Glob, Grep, Read, LS, mcp__playwright-test__browser_click, mcp__playwright-test__browser_close, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_navigate_back, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_run_code, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_take_screenshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_wait_for, mcp__playwright-test__planner_setup_page, mcp__playwright-test__planner_save_plan
5
- model: sonnet
6
- color: green
3
+ description: Playwright e2e planning specialist. Use when the task is to create or update browser test scenarios, *.cases.md plans, or QA coverage for a web flow.
4
+ model: inherit
7
5
  ---
8
6
 
9
- You are an expert web test planner with extensive experience in quality assurance, user experience testing, and test
10
- scenario design. Your expertise includes functional testing, edge case identification, and comprehensive test coverage
11
- planning.
7
+ You are an expert web test planner for a Next.js frontend.
12
8
 
13
- ## Project-specific test structure (Next.js preset)
9
+ ## Project structure
14
10
 
15
- In this project you MUST respect the existing e2e layout:
11
+ Follow **`testing/playwright-agents.md`**, **`testing/tests-e2e-structure.md`**, and the **`playwright-e2e` skill**:
16
12
 
17
13
  - Test root: `app/__tests__/e2e`
18
- - Test plans/specs: `*.cases.md` files under `app/__tests__/e2e/**`
19
- - Executable tests: `*.spec.ts` files under `app/__tests__/e2e/**`
20
- - Seed test: `app/__tests__/e2e/seed.spec.ts`
14
+ - Plans: `*.cases.md` under the relevant feature folder
15
+ - Specs: `*.spec.ts` in the same folder
16
+ - Seed/setup reference: `app/__tests__/e2e/seed.spec.ts`
21
17
 
22
- When you create or update a test plan:
18
+ ## Work
23
19
 
24
- - Use the appropriate `*.cases.md` file under `app/__tests__/e2e/**` (for example,
25
- `app/__tests__/e2e/OrderHistory/order-history.cases.md`) instead of creating files in a separate `specs/` folder.
26
- - Treat these `*.cases.md` files as the canonical, human-readable test plans for the Generator and Healer agents.
20
+ 1. Read the task brief and existing `*.cases.md` files for the affected area.
21
+ 2. Explore the UI only when a running app/browser context is available.
22
+ 3. Add or update scenarios covering happy path, edge cases, validation, and error states.
23
+ 4. Keep scenarios independent and specific enough for a generator or human tester.
27
24
 
28
- You will:
25
+ ## Output
29
26
 
30
- 1. **Navigate and Explore**
31
- - Invoke the `planner_setup_page` tool once to set up page before using any other tools
32
- - Explore the browser snapshot
33
- - Do not take screenshots unless absolutely necessary
34
- - Use `browser_*` tools to navigate and discover interface
35
- - Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality
36
-
37
- 2. **Analyze User Flows**
38
- - Map out the primary user journeys and identify critical paths through the application
39
- - Consider different user types and their typical behaviors
40
-
41
- 3. **Design Comprehensive Scenarios**
42
-
43
- Create detailed test scenarios that cover:
44
- - Happy path scenarios (normal user behavior)
45
- - Edge cases and boundary conditions
46
- - Error handling and validation
47
-
48
- 4. **Structure Test Plans**
49
-
50
- Each scenario must include:
51
- - Clear, descriptive title
52
- - Detailed step-by-step instructions
53
- - Expected outcomes where appropriate
54
- - Assumptions about starting state (always assume blank/fresh state)
55
- - Success criteria and failure conditions
56
-
57
- 5. **Create Documentation**
58
-
59
- Submit your test plan using `planner_save_plan` tool.
60
-
61
- **Quality Standards**:
62
- - Write steps that are specific enough for any tester to follow
63
- - Include negative testing scenarios
64
- - Ensure scenarios are independent and can be run in any order
65
-
66
- **Output Format**: Always save the complete test plan as a markdown file with clear headings, numbered steps, and
67
- professional formatting suitable for sharing with development and QA teams.
27
+ Write or update the relevant `*.cases.md` file. If this is part of an agent team task, summarize changed plans and update `.claude/team/tasks/<slug>/status.json`.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: task-analyst
3
3
  description: Task analysis specialist. Clarifies requirements, validates acceptance criteria, and decomposes work into concrete tasks. Use for /feature-start, task intake, or when the user asks to analyze or decompose a feature before coding. Writes only team artifacts; never writes production code.
4
- model: inherit
4
+ model: fast
5
5
  ---
6
6
 
7
7
  You are a senior business/technical analyst for a Next.js frontend team.
@@ -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,71 @@ 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
-
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.
50
-
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>`.
34
+ ## Pipeline profiles
35
+
36
+ Set optional top-level `"profile": "full" | "standard" | "light"` in `pipeline.json`. Default when omitted: **`standard`** for `feature`/`refactor`/`bugfix`; **`light`** for `review-only`, `perf-audit`; **`full`** when cross-layer or e2e AC required.
37
+
38
+ | Profile | When | Typical `feature` steps |
39
+ |---------|------|------------------------|
40
+ | `full` | Multi-layer, new public API, e2e coverage needed, incomplete AC | analyst → [architect] → developer → build-verifier reviewer qa-tester |
41
+ | `standard` | Single layer, default work | analyst developer build-verifier reviewer |
42
+ | `light` | Trivial: one file/layer, explicit AC, «просто поправь», «typo», user «без pipeline» | developer → build-verifier |
43
+
44
+ **Light signals:** один файл, один слой, явный AC в промпте, нет архитектурного риска. **Never skip `build-verifier`** after developer when `app/**` changed. **Skip `code-reviewer`** in light only for non-prod preset/docs tasks for `app/src` changes prefer standard.
45
+
46
+ **Light by intent:**
47
+
48
+ | intent | light steps |
49
+ |--------|-------------|
50
+ | `feature` | developer build-verifier |
51
+ | `bugfix` | debugger → build-verifier (`skipIf: debugger.fixed` on developer) |
52
+ | `review-only` | code-reviewer |
53
+ | `docs-only` | tech-writer (skip analyst if brief exists) |
54
+ | `ci-fix` | ci-investigator → build-verifier (`skipIf: ci-investigator.resolved`) |
55
+
56
+ Fixtures: `.claude/team/fixtures/` (feature-full, feature-light, bugfix-standard).
57
+
58
+ ## Adjust steps (when context is clear)
59
+
60
+ - Skip **task-analyst** if AC/scope fully specified → document in `skipped`.
61
+ - Add **solution-architect** for cross-layer / new public APIs — after analyst, before developer.
62
+ - Add **api-contract-reviewer** for new/changed backend contracts — before developer.
63
+ - Add **accessibility-reviewer** / **security-reviewer** after build-verifier (parallel when both apply).
64
+ - Add **tech-writer** when docs/changelog requested.
65
+ - **Always build-verifier** after developer for `feature`, `bugfix`, `refactor`, `migration`, `a11y`.
66
+ - **skipIf:** `debugger.fixed` (bugfix); `ci-investigator.resolved` (ci-fix).
67
+ - **Model:** `inherit` when 4+ steps or cross-layer uncertainty.
68
+
69
+ ## humanGates (defaults)
125
70
 
126
71
  | Intent | Default humanGates |
127
72
  |--------|-------------------|
128
73
  | `feature`, `refactor`, `test-only`, `a11y` | `["after:task-analyst"]` |
129
74
  | `migration` | `["after:migration-specialist"]` |
130
75
  | `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) |
76
+ | `unit-only` | `["after:unit-test-planner"]` when new plan; `[]` for healer |
77
+ | `e2e-only` | `["after:playwright-test-planner"]` when new plan; `[]` for healer |
78
+ | `bugfix`, `review-only`, `ci-fix` | `[]` |
134
79
  | `spike` | `["after:solution-architect"]` |
135
80
  | `perf-audit` | `[]` |
136
81
 
137
- ### skipped (optional)
138
-
139
- ```json
140
- "skipped": [{ "agent": "task-analyst", "reason": "AC provided in ticket" }]
141
- ```
142
-
143
- ## Initial status.json
82
+ ## Output
144
83
 
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>" }`.
84
+ 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
85
 
162
86
  ## Handoff to orchestrator
163
87
 
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`).
88
+ 1. Intent + one-line summary.
89
+ 2. Planned steps (table: #, agent, label).
90
+ 3. Skipped roles and why.
91
+ 4. Human gates (if any).
92
+ 5. Invoke `steps[0].agent` now (unless `retro` → `/technical-retro`).
171
93
 
172
94
  Do not invoke implementation agents yourself.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: tech-writer
3
3
  description: Technical documentation specialist. Writes feature READMEs, migration guides, ADR summaries, and changelog entries from completed task artifacts. Docs-only — never edits production application code.
4
- model: inherit
4
+ model: fast
5
5
  ---
6
6
 
7
7
  You are a technical writer for a Next.js frontend team.
@@ -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
 
@@ -0,0 +1,17 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "beforeShellExecution": [
5
+ {
6
+ "command": ".claude/hooks/guard-shell-command.sh",
7
+ "failClosed": true
8
+ }
9
+ ],
10
+ "subagentStop": [
11
+ {
12
+ "command": ".claude/hooks/chain-team-phases.sh",
13
+ "loop_limit": 15
14
+ }
15
+ ]
16
+ }
17
+ }
@@ -4,10 +4,14 @@
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:`):** `stack/next-app-core`, `tooling-and-review/post-change-lint`, `tooling-and-review/package-manager`, `tooling-and-review/code-quality` — **4 files only**
8
+ - **On-demand (`paths:` or via commands):** `agent-team-intake`, `agent-team-orchestrator`, `code-review-mr`, 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
+ ### UI edit bundle (consolidated paths)
12
+
13
+ При правке `app/src/ui/**/*.tsx` — уменьшенный набор paths (см. `ui-and-accessibility/react-ui.md`, `architecture/architecture-boundaries-ui.md`, `stack/navigation-router-ui.md`). Полные правила `architecture-boundaries`, `layer-barrel-exports`, `navigation-router` — только на соответствующих путях (api/store/types/lib, `index.ts`, `app/src/app/**`).
14
+
11
15
  ## С чего начать
12
16
 
13
17
  - **`commands/task.md`** — router → `pipeline.json` → agents
@@ -27,4 +31,4 @@
27
31
 
28
32
  Полный список — см. подпапки `architecture/`, `stack/`, `api-and-data/`, `ui-and-accessibility/`, `testing/`, `tooling-and-review/`.
29
33
 
30
- **Коллизии:** импорт типов `architecture/types-public-imports.md`; API вне `app/src/api/**` `architecture/api-public-imports.md`.
34
+ **Коллизии:** импорт типов и 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,11 @@
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-ui.md` | Slim границы UI при правках компонентов |
8
+ | `architecture-boundaries.md` | Полная карта UI / store / API (api, store, types, lib) |
9
+ | `layer-barrel-exports.md` | Двухуровневые barrel для слоёв с public API |
10
+ | `feature-delivery-workflow.md` | Сквозной чеклист новой фичи |
11
+ | `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`).
@@ -0,0 +1,15 @@
1
+ ---
2
+ paths:
3
+ - app/src/ui/**/*.tsx
4
+ - app/src/ui/**/*.ts
5
+ ---
6
+
7
+ # UI layer boundaries (slim)
8
+
9
+ - **Импорты:** `@/ui/**`, `@/store/**`, типы из `@/types` и enum из `@/types/enums`, API — только `from '@/api'` (`architecture/public-imports.md`).
10
+ - **Запрещено:** прямой HTTP‑клиент; знание DTO — только доменные типы.
11
+ - **Состояние:** сценарии с записью и координация шагов — через store/thunk; узкие прямые вызовы `@/api` для чтения — только как в соседних фичах.
12
+ - **Организация:** алиас `@/`; без deep‑импортов в чужие фичи; только public API.
13
+ - **Barrel:** при новых публичных символах — реэкспорт по `architecture/layer-barrel-exports.md` (правило грузится на `index.ts`).
14
+
15
+ Полная карта слоёв (store, API, порты‑адаптеры): **`architecture/architecture-boundaries.md`** — при правках `app/src/api`, `store`, `types`, `lib`.
@@ -1,20 +1,23 @@
1
1
  ---
2
2
  paths:
3
- - app/src/**/*
3
+ - app/src/api/**/*
4
+ - app/src/store/**/*
5
+ - app/src/types/**/*
6
+ - app/src/lib/**/*
4
7
  ---
5
8
 
6
9
  # Границы между слоями
7
10
 
8
11
  ## UI (`app/src/ui/**`)
9
12
 
10
- - Может импортировать: `@/ui/**`, `@/store/**`, типы из `@/types` и enum из `@/types/enums` (**только как в `architecture/types-public-imports.md`**), контракт к API — **только** `import … from '@/api'` (**`architecture/api-public-imports.md`**).
13
+ - Может импортировать: `@/ui/**`, `@/store/**`, типы из `@/types` и enum из `@/types/enums` (**только как в `architecture/public-imports.md`**), контракт к API — **только** `import … from '@/api'` (**`architecture/public-imports.md`**).
11
14
  - Не должен:
12
15
  - обращаться к HTTP‑клиенту напрямую;
13
16
  - знать детали DTO backend — только доменные типы.
14
17
 
15
18
  ## Store (`app/src/store/**`)
16
19
 
17
- - Может импортировать: `@/store/**`, сервисы и публичные сущности API — **только** из `@/api` (**`architecture/api-public-imports.md`**), типы из `@/types` и enum из `@/types/enums` (**`architecture/types-public-imports.md`**).
20
+ - Может импортировать: `@/store/**`, сервисы и публичные сущности API — **только** из `@/api` (**`architecture/public-imports.md`**), типы из `@/types` и enum из `@/types/enums` (**`architecture/public-imports.md`**).
18
21
  - Не должен:
19
22
  - зависеть от конкретных UI‑компонентов;
20
23
  - напрямую работать с global/window API.
@@ -24,7 +27,7 @@ paths:
24
27
 
25
28
  Реализация в `services/**`, `clients/**`, реэкспорт в `app/src/api/index.ts`:
26
29
 
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`).
30
+ - Внутри слоя: типы из `@/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
31
  - Не должен:
29
32
  - тянуть в себя UI или store;
30
33
  - смешивать HTTP‑слой и доменный слой — использовать мапперы.
@@ -39,7 +42,7 @@ paths:
39
42
 
40
43
  - **Входящий адаптер**: UI — ввод пользователя, отображение; зависит от store и доменных типов, не от транспорта.
41
44
  - **Оркестрация сценариев**: store (slices, thunk) — вызывает сервисы, кладёт в state **доменные** модели после маппинга.
42
- - **Исходящий порт (контракт к backend)**: публичный API **`@/api`** (barrel `app/src/api/index.ts`; реализация — в `app/src/api/services/**` и т.д., см. `architecture/api-public-imports.md`).
45
+ - **Исходящий порт (контракт к backend)**: публичный API **`@/api`** (barrel `app/src/api/index.ts`; реализация — в `app/src/api/services/**` и т.д., см. `architecture/public-imports.md`).
43
46
  - **Исходящий адаптер**: общая реализация HTTP в **`app/src/lib/clients/**`** и экземпляры в **`app/src/api/clients/**`**.
44
47
 
45
48
  ## Фича как срез
@@ -50,7 +53,7 @@ paths:
50
53
 
51
54
  - Всегда использовать алиас `@/...` для импортов между слоями.
52
55
  - Внутри одного модуля/фичи можно использовать относительные импорты, но **без подъёма выше корня фичи** (избегать `../../../`).
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`).
56
+ - При обращении из компонентов, хуков, утилит и других модулей к чужому слою или фиче использовать только **public API** (barrel/index‑файлы и явно экспортируемые сущности), не делать deep‑импорты внутренних файлов других фич; для регламентированных слоёв — **`architecture/layer-barrel-exports.md`** и `architecture/public-imports.md`; для API‑слоя снаружи `app/src/api/**` — **`architecture/public-imports.md`** (только `@/api`).
54
57
  - При добавлении нового кода проверять:
55
58
  - если модуль переиспользуемый — он должен зависеть только от более "низких" слоёв (types, utils, api), но не от страниц.
56
59
 
@@ -61,7 +64,7 @@ paths:
61
64
  - Локальные компоненты: поддиректории `components/**` внутри страницы.
62
65
  - Связанный store: `app/src/store/slices/OrderCheckout/**`.
63
66
  - API: `app/src/api/services/OrdersApi/OrderCheckout/**` (имя корневого сервиса взять из принятой в проекте схемы).
64
- - Типы: `app/src/types/**` с экспортом через barrel **`app/src/types/index.ts`** (`architecture/types-public-imports.md`).
67
+ - Типы: `app/src/types/**` с экспортом через barrel **`app/src/types/index.ts`** (`architecture/public-imports.md`).
65
68
 
66
69
  # Требование к агенту
67
70