@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.
- package/CHANGELOG.md +22 -0
- package/CONTRIBUTING.md +102 -0
- package/README.md +2 -0
- package/bin/cli.js +4 -2
- package/fragments/BUGBOT.md +23 -0
- package/package.json +10 -2
- package/presets/claude/next/BUGBOT.md +16 -0
- package/presets/claude/next/CLAUDE.md +6 -2
- package/presets/claude/next/agents/README.md +77 -15
- package/presets/claude/next/agents/api-contract-reviewer.md +1 -1
- package/presets/claude/next/agents/build-verifier.md +2 -0
- package/presets/claude/next/agents/code-reviewer.md +1 -1
- package/presets/claude/next/agents/feature-developer.md +8 -21
- package/presets/claude/next/agents/playwright-test-generator.md +16 -65
- package/presets/claude/next/agents/playwright-test-healer.md +16 -51
- package/presets/claude/next/agents/playwright-test-planner.md +15 -55
- package/presets/claude/next/agents/task-analyst.md +1 -1
- package/presets/claude/next/agents/task-router.md +50 -128
- package/presets/claude/next/agents/tech-writer.md +1 -1
- package/presets/claude/next/commands/task.md +1 -1
- package/presets/claude/next/hooks.json +17 -0
- package/presets/claude/next/rules/README.md +7 -3
- package/presets/claude/next/rules/api-and-data/api-services.md +3 -3
- package/presets/claude/next/rules/api-and-data/http-client.md +2 -2
- package/presets/claude/next/rules/api-and-data/store-rtk.md +2 -2
- package/presets/claude/next/rules/architecture/README.md +9 -11
- package/presets/claude/next/rules/architecture/api-public-imports.md +3 -26
- package/presets/claude/next/rules/architecture/architecture-boundaries-ui.md +15 -0
- package/presets/claude/next/rules/architecture/architecture-boundaries.md +10 -7
- package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +44 -69
- package/presets/claude/next/rules/architecture/layer-barrel-exports.md +6 -6
- package/presets/claude/next/rules/architecture/public-imports.md +46 -0
- package/presets/claude/next/rules/architecture/reference-features.md +4 -1
- package/presets/claude/next/rules/architecture/types-public-imports.md +3 -29
- package/presets/claude/next/rules/stack/README.md +2 -1
- package/presets/claude/next/rules/stack/navigation-router-ui.md +15 -0
- package/presets/claude/next/rules/stack/navigation-router.md +2 -1
- package/presets/claude/next/rules/stack/next-app-core.md +20 -70
- package/presets/claude/next/rules/stack/no-type-assertion.md +3 -2
- package/presets/claude/next/rules/stack/types-jsdoc.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +6 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +20 -1
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +3 -11
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +22 -59
- package/presets/claude/next/rules/tooling-and-review/package-manager.md +6 -15
- package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +14 -24
- package/presets/claude/next/rules/ui-and-accessibility/README.md +1 -2
- package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +6 -18
- package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +5 -4
- package/presets/claude/next/skills/feature-delivery/SKILL.md +5 -20
- package/presets/claude/next/team/README.md +1 -0
- package/presets/claude/next/team/fixtures/bugfix-standard.json +15 -0
- package/presets/claude/next/team/fixtures/feature-full.json +16 -0
- package/presets/claude/next/team/fixtures/feature-light.json +17 -0
- package/presets/cursor/next/AGENTS.md +3 -10
- package/presets/cursor/next/BUGBOT.md +2 -0
- package/presets/cursor/next/agents/README.md +97 -15
- package/presets/cursor/next/agents/api-contract-reviewer.md +1 -1
- package/presets/cursor/next/agents/build-verifier.md +2 -0
- package/presets/cursor/next/agents/code-reviewer.md +2 -2
- package/presets/cursor/next/agents/feature-developer.md +9 -30
- package/presets/cursor/next/agents/task-analyst.md +1 -1
- package/presets/cursor/next/agents/task-router.md +49 -127
- package/presets/cursor/next/agents/tech-writer.md +1 -1
- package/presets/cursor/next/commands/task.md +1 -1
- package/presets/cursor/next/rules/README.md +27 -8
- package/presets/cursor/next/rules/agent-team-intake.mdc +2 -2
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +14 -1
- package/presets/cursor/next/rules/api-public-imports.mdc +3 -24
- package/presets/cursor/next/rules/api-services.mdc +3 -3
- package/presets/cursor/next/rules/architecture-boundaries-ui.mdc +15 -0
- package/presets/cursor/next/rules/architecture-boundaries.mdc +7 -7
- package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +3 -11
- package/presets/cursor/next/rules/code-review-mr.mdc +20 -46
- package/presets/cursor/next/rules/css-property-order-stylelint.mdc +6 -18
- package/presets/cursor/next/rules/feature-delivery-workflow.mdc +45 -22
- package/presets/cursor/next/rules/http-client.mdc +2 -2
- package/presets/cursor/next/rules/layer-barrel-exports.mdc +6 -6
- package/presets/cursor/next/rules/navigation-router-stack.mdc +1 -1
- package/presets/cursor/next/rules/navigation-router-ui.mdc +16 -0
- package/presets/cursor/next/rules/next-app-core.mdc +18 -71
- package/presets/cursor/next/rules/no-cross-component-styles-import.mdc +3 -53
- package/presets/cursor/next/rules/no-type-assertion-as-import-export.mdc +4 -1
- package/presets/cursor/next/rules/package-manager.mdc +6 -15
- package/presets/cursor/next/rules/post-change-lint.mdc +14 -24
- package/presets/cursor/next/rules/public-imports.mdc +48 -0
- package/presets/cursor/next/rules/react-ui.mdc +5 -4
- package/presets/cursor/next/rules/reference-features.mdc +5 -1
- package/presets/cursor/next/rules/store-rtk.mdc +2 -2
- package/presets/cursor/next/rules/types-jsdoc.mdc +1 -1
- package/presets/cursor/next/rules/types-public-imports.mdc +3 -26
- package/presets/cursor/next/skills/feature-delivery/SKILL.md +5 -20
- package/presets/cursor/next/team/README.md +1 -0
- package/presets/cursor/next/team/fixtures/bugfix-standard.json +15 -0
- package/presets/cursor/next/team/fixtures/feature-full.json +16 -0
- package/presets/cursor/next/team/fixtures/feature-light.json +17 -0
- package/scripts/README.md +84 -0
- package/scripts/golden-prompts.json +276 -0
- package/scripts/preset-manifest.json +72 -0
- package/scripts/regression-results/.gitkeep +0 -0
- package/scripts/validate-preset.sh +484 -0
- package/presets/claude/next/rules/ui-and-accessibility/component-styles.md +0 -56
- 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:
|
|
4
|
-
|
|
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
|
|
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
|
|
9
|
+
## Project structure
|
|
14
10
|
|
|
15
|
-
|
|
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
|
-
-
|
|
19
|
-
-
|
|
20
|
-
- Seed
|
|
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
|
-
|
|
18
|
+
## Work
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
25
|
+
## Output
|
|
29
26
|
|
|
30
|
-
|
|
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:
|
|
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:
|
|
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
|
|
27
|
-
| `e2e-only` | «e2e», «playwright», «browser test», «сценарии e2e», «почини e2e» | playwright-test-planner → playwright-test-generator, or playwright-test-healer
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
|
132
|
-
| `e2e-only` | `["after:playwright-test-planner"]` when new plan; `[]` for
|
|
133
|
-
| `bugfix`, `review-only`, `ci-fix` | `[]`
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
```json
|
|
140
|
-
"skipped": [{ "agent": "task-analyst", "reason": "AC provided in ticket" }]
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## Initial status.json
|
|
82
|
+
## Output
|
|
144
83
|
|
|
145
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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:
|
|
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. Родительский агент =
|
|
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`, `
|
|
8
|
-
-
|
|
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
|
-
**Коллизии:** импорт типов
|
|
34
|
+
**Коллизии:** импорт типов и API — **`architecture/public-imports.md`**.
|
|
@@ -11,7 +11,7 @@ paths:
|
|
|
11
11
|
- заголовками и кодами ответов,
|
|
12
12
|
- DTO backend.
|
|
13
13
|
- Предоставлять UI и store **стабильный доменный интерфейс**:
|
|
14
|
-
- функции, работающие с доменными типами из `@/types` (`architecture/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
-
| `
|
|
8
|
-
| `
|
|
9
|
-
| `
|
|
10
|
-
| `
|
|
11
|
-
| `
|
|
12
|
-
|
|
13
|
-
|
|
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
|
|
4
|
-
- app/src/**/*.tsx
|
|
3
|
+
- app/src/api/**/*
|
|
5
4
|
---
|
|
6
5
|
|
|
7
|
-
#
|
|
6
|
+
# Deprecated
|
|
8
7
|
|
|
9
|
-
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
|
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/
|
|
67
|
+
- Типы: `app/src/types/**` с экспортом через barrel **`app/src/types/index.ts`** (`architecture/public-imports.md`).
|
|
65
68
|
|
|
66
69
|
# Требование к агенту
|
|
67
70
|
|