@bonesofspring/ai-rules 0.2.0 → 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 (62) hide show
  1. package/CONTRIBUTING.md +102 -0
  2. package/README.md +2 -0
  3. package/bin/cli.js +4 -2
  4. package/fragments/BUGBOT.md +23 -0
  5. package/package.json +10 -2
  6. package/presets/claude/next/BUGBOT.md +16 -0
  7. package/presets/claude/next/CLAUDE.md +5 -1
  8. package/presets/claude/next/agents/README.md +16 -15
  9. package/presets/claude/next/agents/code-reviewer.md +1 -1
  10. package/presets/claude/next/agents/playwright-test-generator.md +16 -65
  11. package/presets/claude/next/agents/playwright-test-healer.md +16 -51
  12. package/presets/claude/next/agents/playwright-test-planner.md +15 -55
  13. package/presets/claude/next/agents/task-analyst.md +1 -1
  14. package/presets/claude/next/agents/task-router.md +24 -0
  15. package/presets/claude/next/agents/tech-writer.md +1 -1
  16. package/presets/claude/next/hooks.json +17 -0
  17. package/presets/claude/next/rules/README.md +6 -2
  18. package/presets/claude/next/rules/architecture/README.md +2 -1
  19. package/presets/claude/next/rules/architecture/architecture-boundaries-ui.md +15 -0
  20. package/presets/claude/next/rules/architecture/architecture-boundaries.md +4 -1
  21. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +1 -1
  22. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +1 -1
  23. package/presets/claude/next/rules/stack/README.md +2 -1
  24. package/presets/claude/next/rules/stack/navigation-router-ui.md +15 -0
  25. package/presets/claude/next/rules/stack/navigation-router.md +2 -1
  26. package/presets/claude/next/rules/stack/next-app-core.md +1 -1
  27. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +6 -0
  28. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +22 -59
  29. package/presets/claude/next/rules/ui-and-accessibility/README.md +1 -2
  30. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +4 -3
  31. package/presets/claude/next/team/README.md +1 -0
  32. package/presets/claude/next/team/fixtures/bugfix-standard.json +15 -0
  33. package/presets/claude/next/team/fixtures/feature-full.json +16 -0
  34. package/presets/claude/next/team/fixtures/feature-light.json +17 -0
  35. package/presets/cursor/next/AGENTS.md +2 -9
  36. package/presets/cursor/next/BUGBOT.md +2 -0
  37. package/presets/cursor/next/agents/README.md +16 -15
  38. package/presets/cursor/next/agents/code-reviewer.md +1 -1
  39. package/presets/cursor/next/agents/task-analyst.md +1 -1
  40. package/presets/cursor/next/agents/task-router.md +24 -0
  41. package/presets/cursor/next/agents/tech-writer.md +1 -1
  42. package/presets/cursor/next/rules/README.md +21 -1
  43. package/presets/cursor/next/rules/architecture-boundaries-ui.mdc +15 -0
  44. package/presets/cursor/next/rules/architecture-boundaries.mdc +1 -1
  45. package/presets/cursor/next/rules/code-review-mr.mdc +20 -46
  46. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +1 -1
  47. package/presets/cursor/next/rules/layer-barrel-exports.mdc +1 -1
  48. package/presets/cursor/next/rules/navigation-router-stack.mdc +1 -1
  49. package/presets/cursor/next/rules/navigation-router-ui.mdc +16 -0
  50. package/presets/cursor/next/rules/next-app-core.mdc +1 -1
  51. package/presets/cursor/next/rules/no-cross-component-styles-import.mdc +3 -53
  52. package/presets/cursor/next/rules/react-ui.mdc +4 -3
  53. package/presets/cursor/next/team/README.md +1 -0
  54. package/presets/cursor/next/team/fixtures/bugfix-standard.json +15 -0
  55. package/presets/cursor/next/team/fixtures/feature-full.json +16 -0
  56. package/presets/cursor/next/team/fixtures/feature-light.json +17 -0
  57. package/scripts/README.md +84 -0
  58. package/scripts/golden-prompts.json +276 -0
  59. package/scripts/preset-manifest.json +72 -0
  60. package/scripts/regression-results/.gitkeep +0 -0
  61. package/scripts/validate-preset.sh +484 -0
  62. package/presets/claude/next/rules/ui-and-accessibility/component-styles.md +0 -56
@@ -0,0 +1,102 @@
1
+ # Contributing to @bonesofspring/ai-rules
2
+
3
+ ## Layout
4
+
5
+ ```
6
+ packages/ai-rules/
7
+ bin/cli.js # init / clean
8
+ fragments/ # shared source (e.g. BUGBOT.md)
9
+ presets/
10
+ cursor/next/ # .mdc rules, agents, commands, …
11
+ claude/next/ # .md rules with paths:, same semantics
12
+ ```
13
+
14
+ ## Manual sync: Cursor ↔ Claude
15
+
16
+ Пресеты **не генерируются** автоматически. Любое изменение, затрагивающее оба инструмента, требует ручной синхронизации.
17
+
18
+ ### Checklist перед PR / publish
19
+
20
+ - [ ] **Семантика:** одно и то же правило/агент/skill в обоих пресетах (разный формат, тот же смысл).
21
+ - [ ] **Имена пар** — сверить по таблице ниже.
22
+ - [ ] **Loading:** Cursor `globs` / `alwaysApply` ↔ Claude `paths:` / отсутствие frontmatter (session start).
23
+ - [ ] **Session start:** только 4 базовых правила (см. `rules/README.md` в каждом пресете).
24
+ - [ ] **Orchestrator + code-review** — on-demand, не session start (Claude: `paths:` на commands/team).
25
+ - [ ] **BUGBOT:** правка `fragments/BUGBOT.md` → копия в `presets/cursor/next/BUGBOT.md` и `presets/claude/next/BUGBOT.md` (платформенные ссылки в теле).
26
+ - [ ] **cli.js:** если добавлен root-файл (`hooks.json`, `BUGBOT.md`, …) — обновить `PRESETS.cursor` / `PRESETS.claude` и help text.
27
+ - [ ] **package.json `files`:** новые top-level dirs (`fragments/`) включены в publish.
28
+ - [ ] **CHANGELOG.md:** запись с intent пользователя (token opt, parity, breaking init).
29
+ - [ ] **Version bump** в `package.json` при publish.
30
+
31
+ ### File pair map (preset next)
32
+
33
+ | Cursor | Claude |
34
+ |--------|--------|
35
+ | `rules/*.mdc` (flat) | `rules/<topic>/*.md` |
36
+ | `architecture-boundaries.mdc` | `architecture/architecture-boundaries.md` |
37
+ | `architecture-boundaries-ui.mdc` | `architecture/architecture-boundaries-ui.md` |
38
+ | `layer-barrel-exports.mdc` | `architecture/layer-barrel-exports.md` |
39
+ | `navigation-router-stack.mdc` | `stack/navigation-router.md` |
40
+ | `navigation-router-ui.mdc` | `stack/navigation-router-ui.md` |
41
+ | `no-cross-component-styles-import.mdc` (stub → react-ui) | удалён; контент в `ui-and-accessibility/react-ui.md` |
42
+ | `react-ui.mdc` | `ui-and-accessibility/react-ui.md` |
43
+ | `code-review-mr.mdc` | `tooling-and-review/code-review-mr.md` |
44
+ | `agent-team-orchestrator.mdc` | `tooling-and-review/agent-team-orchestrator.md` |
45
+ | `AGENTS.md` | `CLAUDE.md` |
46
+ | `agents/*.md` | `agents/*.md` (same names) |
47
+ | `skills/**/SKILL.md` | `skills/**/SKILL.md` |
48
+ | `team/fixtures/*.json` | `team/fixtures/*.json` |
49
+
50
+ ### Loading parity cheatsheet
51
+
52
+ | Tier | Cursor | Claude |
53
+ |------|--------|--------|
54
+ | Always-on | `alwaysApply: true` | no YAML / no `paths:` |
55
+ | Path-scoped | `globs: …` | `paths: …` |
56
+ | On-demand (no auto) | `alwaysApply: false`, empty globs | `paths:` on commands/team/agents |
57
+ | Procedure | skill | skill |
58
+
59
+ ### UI globs consolidation (P2)
60
+
61
+ На UI edit не должны грузиться широкие `app/src/**/*` rules. Сверить:
62
+
63
+ - `architecture-boundaries` → api/store/types/lib only
64
+ - `architecture-boundaries-ui` → `app/src/ui/**`
65
+ - `layer-barrel-exports` → `**/index.ts` only
66
+ - `navigation-router-stack` → `app/src/app/**`
67
+ - `navigation-router-ui` → `app/src/ui/**/*.tsx`
68
+ - Стили колокации — в `react-ui`, не отдельный rule с UI globs
69
+
70
+ ### Validate locally
71
+
72
+ ```bash
73
+ cd packages/ai-rules
74
+
75
+ # Full static regression (parity, always-on, globs, BUGBOT, fixtures, golden schema)
76
+ yarn validate
77
+
78
+ # + init smoke (cursor + claude into temp dirs)
79
+ yarn validate:init
80
+
81
+ # Router golden prompts — schema + agent refs
82
+ yarn validate:golden
83
+
84
+ # Manual router regression checklist
85
+ ./scripts/validate-preset.sh --print-golden
86
+ # → run /task per row, save pipeline.json to scripts/regression-results/<id>.json
87
+ ./scripts/validate-preset.sh --check-golden --compare-pipeline scripts/regression-results/
88
+ ```
89
+
90
+ See **`scripts/README.md`** for golden-prompts workflow.
91
+
92
+ Legacy one-liners (covered by `validate-preset.sh`):
93
+
94
+ ```bash
95
+ node --check packages/ai-rules/bin/cli.js
96
+ ```
97
+
98
+ ### Do not sync blindly
99
+
100
+ - Cursor `.mdc` frontmatter ≠ Claude YAML 1:1 (разные поля).
101
+ - Стили компонентов — только в `react-ui` / `react-ui.mdc`; не создавать отдельный rule без узких globs/paths.
102
+ - Playwright agents: не копировать vendor boilerplate в Claude — использовать cursor-aligned slim prompts.
package/README.md CHANGED
@@ -4,6 +4,8 @@ Presets for Cursor and Claude Code: rules, commands, plus optional `agents`, `ho
4
4
 
5
5
  Node 18+.
6
6
 
7
+ Contributing and Cursor↔Claude sync checklist: **[CONTRIBUTING.md](./CONTRIBUTING.md)**.
8
+
7
9
  ```bash
8
10
  # from the project root
9
11
  npx @bonesofspring/ai-rules init cursor --preset next
package/bin/cli.js CHANGED
@@ -25,6 +25,8 @@ const PRESETS = {
25
25
  relBase: ['presets', 'claude'],
26
26
  optionalClaudeDirs: ['skills', 'agents', 'hooks', 'team'],
27
27
  claudeMdSrc: 'CLAUDE.md',
28
+ hooksJsonSrc: 'hooks.json',
29
+ toolRootFiles: ['BUGBOT.md'],
28
30
  },
29
31
  };
30
32
 
@@ -51,7 +53,7 @@ Options:
51
53
  Notes:
52
54
  init merges into the target directory; same-named files are overwritten.
53
55
  Cursor init copies rules, commands, agents, hooks, skills, team, hooks.json, BUGBOT.md, AGENTS.md.
54
- Claude init copies rules, commands, skills, agents, hooks, team, and CLAUDE.md when present.
56
+ Claude init copies rules, commands, skills, agents, hooks, team, hooks.json, BUGBOT.md, and CLAUDE.md when present.
55
57
  Command forms: "init cursor --preset next", "init cursor next", "--preset next init cursor", "cursor init --preset next".
56
58
 
57
59
  Examples:
@@ -344,7 +346,7 @@ function cmdInit(tool, preset, cwdOption) {
344
346
  }
345
347
  }
346
348
 
347
- if (tool === 'cursor' && cfg.hooksJsonSrc) {
349
+ if (cfg.hooksJsonSrc) {
348
350
  const hooksFrom = path.join(base, cfg.hooksJsonSrc);
349
351
  if (fs.existsSync(hooksFrom)) {
350
352
  fs.copyFileSync(hooksFrom, path.join(toolRootAbs, 'hooks.json'));
@@ -0,0 +1,23 @@
1
+ # Bugbot / Automated Review Guidelines
2
+
3
+ Follow the **`code-review` skill** and the on-demand **code-review rule** for the full checklist.
4
+
5
+ ## Priorities
6
+
7
+ 1. Correctness regressions and runtime bugs.
8
+ 2. Architecture boundary violations.
9
+ 3. Missing unit tests for mapper/domain/store logic; e2e updates for user flows.
10
+ 4. Type safety, `@/types` / `@/api` imports, barrel exports.
11
+
12
+ ## Review style
13
+
14
+ Lead with concrete findings: file, impact, fix direction. Skip style-only nits unless they violate lint rules or project conventions.
15
+
16
+ ## Platform rules (on-demand)
17
+
18
+ | Platform | Code review rule | Architecture |
19
+ |----------|------------------|--------------|
20
+ | Cursor | `code-review-mr.mdc` | `architecture-boundaries.mdc` |
21
+ | Claude | `rules/tooling-and-review/code-review-mr.md` | `rules/architecture/architecture-boundaries.md` |
22
+
23
+ **Sync:** edit this file in `packages/ai-rules/fragments/`, then copy to both presets before publish.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Presets of Cursor and Claude rules/commands for Revy Ross personal use",
5
5
  "license": "MIT",
6
6
  "author": "Revy Ross",
@@ -18,11 +18,19 @@
18
18
  "bin": {
19
19
  "ai-rules": "bin/cli.js"
20
20
  },
21
+ "scripts": {
22
+ "validate": "bash scripts/validate-preset.sh",
23
+ "validate:init": "bash scripts/validate-preset.sh --init-smoke",
24
+ "validate:golden": "bash scripts/validate-preset.sh --check-golden"
25
+ },
21
26
  "files": [
22
27
  "README.md",
23
28
  "CHANGELOG.md",
29
+ "CONTRIBUTING.md",
24
30
  "bin",
25
- "presets"
31
+ "fragments",
32
+ "presets",
33
+ "scripts"
26
34
  ],
27
35
  "engines": {
28
36
  "node": ">=18"
@@ -0,0 +1,16 @@
1
+ # Claude Bugbot Review Guidelines
2
+
3
+ Follow the **`code-review` skill** and **`rules/tooling-and-review/code-review-mr.md`** for the full checklist.
4
+
5
+ ## Priorities
6
+
7
+ 1. Correctness regressions and runtime bugs.
8
+ 2. Architecture boundary violations (`rules/architecture/architecture-boundaries.md`).
9
+ 3. Missing unit tests for mapper/domain/store logic; e2e updates for user flows.
10
+ 4. Type safety, `@/types` / `@/api` imports, barrel exports.
11
+
12
+ ## Review style
13
+
14
+ Lead with concrete findings: file, impact, fix direction. Skip style-only nits unless they violate lint rules or project conventions.
15
+
16
+ **Source of truth:** `packages/ai-rules/fragments/BUGBOT.md` — sync manually when updating.
@@ -32,4 +32,8 @@ See @rules/README.md for the full catalog and loading strategy.
32
32
  npx @bonesofspring/ai-rules init claude --preset next
33
33
  ```
34
34
 
35
- Копирует `CLAUDE.md`, `rules/**`, `commands/**`, `agents/**`, `hooks/**`, `team/**` и др. в `.claude/` целевого репозитория.
35
+ Копирует `CLAUDE.md`, `rules/**`, `commands/**`, `agents/**`, `hooks/**`, `team/**`, `hooks.json`, `BUGBOT.md` и др. в `.claude/` целевого репозитория.
36
+
37
+ ## Pipeline routing
38
+
39
+ Intent detection, profiles (`full` / `standard` / `light`), and default steps — **only** in `agents/task-router.md`. Schema and examples — `agents/README.md`.
@@ -52,24 +52,25 @@
52
52
 
53
53
  Оркестрация: `/task`, `/task-continue`, `rules/tooling-and-review/agent-team-orchestrator.md`, артефакты `.claude/team/**`.
54
54
 
55
- ## Intent → pipeline (кратко)
56
-
57
- | intent | Типичный pipeline |
58
- |--------|-------------------|
59
- | `feature` | analyst → developer → reviewer → QA |
60
- | `bugfix` | debugger → developer → reviewer → QA |
61
- | `ci-fix` | ci-investigator → developer → reviewer |
62
- | `migration` | analyst → migration-specialist → developer → reviewer → QA |
63
- | `perf-audit` | performance-auditor |
64
- | `a11y` | analyst → developer → a11y-reviewer → code-reviewer |
65
- | `unit-only` | unit-planner → unit-generator (или healer) |
66
- | `e2e-only` | playwright planner → generator (или healer) |
67
- | `docs-only` | analyst → tech-writer |
68
-
69
- Опциональные шаги (router добавляет по контексту): `api-contract-reviewer`, `accessibility-reviewer`, `security-reviewer`, `performance-auditor`, `tech-writer`.
55
+ ## Pipeline routing
56
+
57
+ **Source of truth:** intent table, profiles (`full` / `standard` / `light`), and default steps — **`task-router.md`** only. Do not duplicate intent→pipeline tables in entry docs.
70
58
 
71
59
  ## pipeline.json reference
72
60
 
61
+ ### Top-level fields
62
+
63
+ | Field | Required | Description |
64
+ |-------|----------|-------------|
65
+ | `slug` | yes | Task identifier |
66
+ | `intent` | yes | From router intent detection |
67
+ | `profile` | no | `full` \| `standard` \| `light` — see `task-router.md` § Pipeline profiles |
68
+ | `summary` | yes | One-line task summary |
69
+ | `steps` | yes | Ordered agent steps |
70
+ | `humanGates` | no | e.g. `["after:task-analyst"]` |
71
+ | `autoChain` | no | Default `true` |
72
+ | `skipped` | no | Roles skipped with reason |
73
+
73
74
  ### Step fields
74
75
 
75
76
  | Field | Required | Description |
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: code-reviewer
3
3
  description: Expert code review specialist. Reviews after feature development using code-review-mr checklist. Use proactively after feature-developer completes or when the user asks for MR/diff review on a team task slug. Writes only review artifacts/status; never edits production code.
4
- model: inherit
4
+ model: fast
5
5
  ---
6
6
 
7
7
  You are a senior code reviewer. You may write only review artifacts under `.claude/team/**` and update task `status.json`; do not modify production code.
@@ -1,75 +1,26 @@
1
1
  ---
2
2
  name: playwright-test-generator
3
- description: 'Use this agent when you need to create automated browser tests using Playwright Examples: <example>Context: User wants to generate a test for the test plan item. <test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite> <test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name> <test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file> <seed-file><!-- Seed file path from test plan --></seed-file> <body><!-- Test case content including steps and expectations --></body></example>'
4
- tools: Glob, Grep, Read, LS, mcp__playwright-test__browser_click, 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_press_key, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_verify_element_visible, mcp__playwright-test__browser_verify_list_visible, mcp__playwright-test__browser_verify_text_visible, mcp__playwright-test__browser_verify_value, mcp__playwright-test__browser_wait_for, mcp__playwright-test__generator_read_log, mcp__playwright-test__generator_setup_page, mcp__playwright-test__generator_write_test
5
- model: sonnet
6
- color: blue
3
+ description: Playwright e2e generation specialist. Use when converting existing *.cases.md scenarios into executable *.spec.ts tests under app/__tests__/e2e.
4
+ model: inherit
7
5
  ---
8
6
 
9
- You are a Playwright Test Generator, an expert in browser automation and end-to-end testing.
10
- Your specialty is creating robust, reliable Playwright tests that accurately simulate user interactions and validate
11
- application behavior.
7
+ You generate Playwright tests from project test plans.
12
8
 
13
- ## Project-specific test structure (Next.js preset)
9
+ ## Inputs
14
10
 
15
- In this project you MUST respect the existing e2e layout:
11
+ - The relevant `app/__tests__/e2e/**/*.cases.md` file.
12
+ - Existing specs, page objects, and `_shared/` helpers in the same e2e area.
13
+ - Task artifacts under `.claude/team/tasks/<slug>/` when present.
16
14
 
17
- - 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`
15
+ ## Rules
21
16
 
22
- When you generate tests:
17
+ 1. Follow **`testing/playwright-agents.md`**, **`testing/tests-e2e-structure.md`**, and the **`playwright-e2e` skill**.
18
+ 2. Write specs under `app/__tests__/e2e/**`, next to the plan.
19
+ 3. Match `test.describe` and `test(...)` names to the plan sections and scenario names.
20
+ 4. Prefer existing page objects and helpers over direct selector-heavy tests.
21
+ 5. **Use `user-playwright` MCP** when available (`browser_navigate`, `browser_snapshot`, generator tools) to verify selectors before finalizing specs.
22
+ 6. Do not weaken or skip assertions from the plan without documenting a blocker.
23
23
 
24
- - Use the corresponding `*.cases.md` file under `app/__tests__/e2e/**` as the source plan (for example,
25
- `app/__tests__/e2e/OrderHistory/order-history.cases.md`).
26
- - Write or update Playwright test files only under `app/__tests__/e2e/**` (for example,
27
- `app/__tests__/e2e/OrderHistory/order-history.spec.ts`) instead of creating files in a separate `tests/` folder.
24
+ ## Completion
28
25
 
29
- # For each test you generate
30
- - Obtain the test plan with all the steps and verification specification
31
- - Run the `generator_setup_page` tool to set up page for the scenario
32
- - For each step and verification in the scenario, do the following:
33
- - Use Playwright tool to manually execute it in real-time.
34
- - Use the step description as the intent for each Playwright tool call.
35
- - Retrieve generator log via `generator_read_log`
36
- - Immediately after reading the test log, invoke `generator_write_test` with the generated source code
37
- - File should contain single test
38
- - File name must be fs-friendly scenario name
39
- - Test must be placed in a describe matching the top-level test plan item
40
- - Test title must match the scenario name
41
- - Includes a comment with the step text before each step execution. Do not duplicate comments if step requires
42
- multiple actions.
43
- - Always use best practices from the log when generating tests.
44
-
45
- <example-generation>
46
- For following plan:
47
-
48
- ```markdown file=specs/plan.md
49
- ### 1. Adding New Todos
50
- **Seed:** `tests/seed.spec.ts`
51
-
52
- #### 1.1 Add Valid Todo
53
- **Steps:**
54
- 1. Click in the "What needs to be done?" input field
55
-
56
- #### 1.2 Add Multiple Todos
57
- ...
58
- ```
59
-
60
- Following file is generated:
61
-
62
- ```ts file=add-valid-todo.spec.ts
63
- // spec: specs/plan.md
64
- // seed: tests/seed.spec.ts
65
-
66
- test.describe('Adding New Todos', () => {
67
- test('Add Valid Todo', async { page } => {
68
- // 1. Click in the "What needs to be done?" input field
69
- await page.click(...);
70
-
71
- ...
72
- });
73
- });
74
- ```
75
- </example-generation>
26
+ Run the affected spec if feasible. Report files changed, tests run, failures, and gaps. For agent team tasks, update `.claude/team/tasks/<slug>/status.json`.
@@ -1,61 +1,26 @@
1
1
  ---
2
2
  name: playwright-test-healer
3
- description: Use this agent when you need to debug and fix failing Playwright tests
4
- tools: Glob, Grep, Read, LS, Edit, MultiEdit, Write, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_generate_locator, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_snapshot, mcp__playwright-test__test_debug, mcp__playwright-test__test_list, mcp__playwright-test__test_run
5
- model: sonnet
6
- color: red
3
+ description: Playwright e2e healer. Use when browser tests fail, become flaky, or need locator/setup fixes while preserving business assertions.
4
+ model: inherit
7
5
  ---
8
6
 
9
- You are the Playwright Test Healer, an expert test automation engineer specializing in debugging and
10
- resolving Playwright test failures. Your mission is to systematically identify, diagnose, and fix
11
- broken Playwright tests using a methodical approach.
7
+ You debug and fix failing Playwright e2e tests.
12
8
 
13
- ## Project-specific test structure (Next.js preset)
9
+ ## Inputs
14
10
 
15
- In this project you MUST respect the existing e2e layout:
11
+ - Failing test output and command.
12
+ - Matching `*.spec.ts` and `*.cases.md` files under `app/__tests__/e2e/**`.
13
+ - Existing page objects and `_shared/` helpers.
16
14
 
17
- - 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`
15
+ ## Rules
21
16
 
22
- When healing tests:
17
+ 1. Follow **`testing/playwright-agents.md`**, **`testing/tests-e2e-structure.md`**, and the **`debug-investigation`** and **`playwright-e2e`** skills.
18
+ 2. Treat `*.cases.md` as the behavior contract.
19
+ 3. Fix locators, waits, setup, mocks, or page-object flows without weakening business assertions.
20
+ 4. **Use `user-playwright` MCP** when available to reproduce failures and verify fixes.
21
+ 5. Prefer targeted fixes in the affected spec/page object over broad test infrastructure changes.
22
+ 6. Re-run the affected spec when feasible.
23
23
 
24
- - Only read and modify `*.spec.ts` files under `app/__tests__/e2e/**`.
25
- - Use the `*.cases.md` file in the same folder as the failing test as the source of truth for intended behavior
26
- (for example, `app/__tests__/e2e/OrderHistory/order-history.cases.md` for
27
- `app/__tests__/e2e/OrderHistory/order-history.spec.ts`).
24
+ ## Completion
28
25
 
29
- Your workflow:
30
- 1. **Initial Execution**: Run all tests using `test_run` tool to identify failing tests
31
- 2. **Debug failed tests**: For each failing test run `test_debug`.
32
- 3. **Error Investigation**: When the test pauses on errors, use available Playwright MCP tools to:
33
- - Examine the error details
34
- - Capture page snapshot to understand the context
35
- - Analyze selectors, timing issues, or assertion failures
36
- 4. **Root Cause Analysis**: Determine the underlying cause of the failure by examining:
37
- - Element selectors that may have changed
38
- - Timing and synchronization issues
39
- - Data dependencies or test environment problems
40
- - Application changes that broke test assumptions
41
- 5. **Code Remediation**: Edit the test code to address identified issues, focusing on:
42
- - Updating selectors to match current application state
43
- - Fixing assertions and expected values
44
- - Improving test reliability and maintainability
45
- - For inherently dynamic data, utilize regular expressions to produce resilient locators
46
- 6. **Verification**: Restart the test after each fix to validate the changes
47
- 7. **Iteration**: Repeat the investigation and fixing process until the test passes cleanly
48
-
49
- Key principles:
50
- - Be systematic and thorough in your debugging approach
51
- - Document your findings and reasoning for each fix
52
- - Prefer robust, maintainable solutions over quick hacks
53
- - Use Playwright best practices for reliable test automation
54
- - If multiple errors exist, fix them one at a time and retest
55
- - Provide clear explanations of what was broken and how you fixed it
56
- - You will continue this process until the test runs successfully without any failures or errors.
57
- - If the error persists and you have high level of confidence that the test is correct, mark this test as test.fixme()
58
- so that it is skipped during the execution. Add a comment before the failing step explaining what is happening instead
59
- of the expected behavior.
60
- - Do not ask user questions, you are not interactive tool, do the most reasonable thing possible to pass the test.
61
- - Never wait for networkidle or use other discouraged or deprecated apis
26
+ Report root cause, files changed, validation result, and remaining flakiness risk. For agent team tasks, update `.claude/team/tasks/<slug>/status.json`.
@@ -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.
@@ -31,6 +31,30 @@ You are a task router for a Next.js frontend agent team. You **do not** implemen
31
31
  | `spike` | «исследуй», «оцени», «можно ли», «spike», proof of concept | task-analyst → solution-architect |
32
32
  | `retro` | «ретро», «разбор», «postmortem» | no pipeline — orchestrator runs `/technical-retro` |
33
33
 
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
+
34
58
  ## Adjust steps (when context is clear)
35
59
 
36
60
  - Skip **task-analyst** if AC/scope fully specified → document in `skipped`.
@@ -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.
@@ -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`, `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
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
@@ -4,7 +4,8 @@
4
4
  |------|------------|
5
5
  | `public-imports.md` | Импорты `@/types`, `@/types/enums`, `@/api` (вне `app/src/api/**`) |
6
6
  | `types-public-imports.md`, `api-public-imports.md` | Deprecated stubs → `public-imports.md` |
7
- | `architecture-boundaries.md` | Границы UI / store / API, порты‑адаптеры |
7
+ | `architecture-boundaries-ui.md` | Slim границы UI при правках компонентов |
8
+ | `architecture-boundaries.md` | Полная карта UI / store / API (api, store, types, lib) |
8
9
  | `layer-barrel-exports.md` | Двухуровневые barrel для слоёв с public API |
9
10
  | `feature-delivery-workflow.md` | Сквозной чеклист новой фичи |
10
11
  | `reference-features.md` | Эталонные пути UI/store/API/types |