@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
package/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0
4
+
5
+ ### Breaking
6
+
7
+ - **Import rules merged:** `types-public-imports.mdc` and `api-public-imports.mdc` → **`public-imports.mdc`** (Claude: `architecture/public-imports.md`). Old filenames remain as deprecated stubs for one release cycle.
8
+ - **`feature-delivery-flow.mdc` removed** — content merged into `feature-delivery-workflow.mdc`.
9
+ - **`agent-team-intake`** no longer always-on (Cursor: `alwaysApply: false`; Claude: `paths:` on commands/team). Use orchestrator or `/task`.
10
+
11
+ ### Changed
12
+
13
+ - Slimmed always-on rules: `next-app-core`, `code-quality-and-refactoring`, `post-change-lint`, `package-manager` (~9 KB baseline vs ~21 KB).
14
+ - Narrowed globs: `css-property-order-stylelint`, `no-type-assertion-as-import-export`, `reference-features`, `public-imports`.
15
+ - `css-property-order` stub — property list delegated to Stylelint `--fix`.
16
+ - Slimmed `task-router` agent; pipeline JSON examples moved to `agents/README.md`.
17
+ - Agents reference skills as SSOT; scoped lint for `feature-developer` when next step is `build-verifier`.
18
+ - Orchestrator: explicit fast-path when to skip pipeline.
19
+
20
+ ## 0.1.42
21
+
22
+ Prior releases — see git history.
@@ -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.1.42",
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.
@@ -7,7 +7,7 @@ See @rules/README.md for the full catalog and loading strategy.
7
7
  ## Conventions
8
8
 
9
9
  - **Одна тема на файл**; для больших областей — подпапки в `rules/<topic>/`.
10
- - **Session-start rules** — только базовые инварианты (`next-app-core`, lint, package manager, intake, code-quality).
10
+ - **Session-start rules** — только базовые инварианты (`next-app-core`, lint, package manager, code-quality).
11
11
  - **Domain-specific rules** — YAML frontmatter `paths:` (подгружаются при работе с matching-файлами).
12
12
  - Slash-команды — в `commands/`; сценарии — в `skills/`; subagents — в `agents/`.
13
13
 
@@ -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,18 +52,80 @@
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.
58
+
59
+ ## pipeline.json reference
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
+
74
+ ### Step fields
75
+
76
+ | Field | Required | Description |
77
+ |-------|----------|-------------|
78
+ | `agent` | yes | Subagent name (kebab-case) or array for `parallel: true` |
79
+ | `label` | yes | Short human-readable step name |
80
+ | `scope` | no | e.g. `unit-in-dev`, `e2e-only`, `regression`, `full` |
81
+ | `skipIf` | no | `debugger.fixed` \| `ci-investigator.resolved` |
82
+ | `parallel` | no | When `true` and `agent` is array — invoke all in one turn |
83
+
84
+ ### Minimal template
85
+
86
+ ```json
87
+ {
88
+ "slug": "<slug>",
89
+ "intent": "feature",
90
+ "summary": "One-line task summary",
91
+ "steps": [
92
+ { "agent": "task-analyst", "label": "Clarify and decompose" },
93
+ { "agent": "feature-developer", "label": "Implement + unit tests", "scope": "unit-in-dev" },
94
+ { "agent": "build-verifier", "label": "Lint, type-check, unit smoke" },
95
+ { "agent": "code-reviewer", "label": "Code review" }
96
+ ],
97
+ "humanGates": ["after:task-analyst"],
98
+ "autoChain": true,
99
+ "skipped": []
100
+ }
101
+ ```
102
+
103
+ ### Example: bugfix skipIf
104
+
105
+ ```json
106
+ {
107
+ "intent": "bugfix",
108
+ "steps": [
109
+ { "agent": "debugger", "label": "Root cause" },
110
+ { "agent": "feature-developer", "label": "Fix if needed", "skipIf": "debugger.fixed" },
111
+ { "agent": "build-verifier", "label": "Validation" },
112
+ { "agent": "code-reviewer", "label": "Review" }
113
+ ],
114
+ "humanGates": []
115
+ }
116
+ ```
117
+
118
+ ### Initial status.json
119
+
120
+ ```json
121
+ {
122
+ "slug": "<slug>",
123
+ "intent": "<intent>",
124
+ "pipelineIndex": 0,
125
+ "currentAgent": "<steps[0].agent>",
126
+ "phase": "executing",
127
+ "state": "in_progress",
128
+ "awaitingHumanGate": false,
129
+ "updatedAt": "<ISO8601>"
130
+ }
131
+ ```
@@ -12,7 +12,7 @@ You are an API contract reviewer for a layered Next.js frontend (`@/types`, `@/a
12
12
  2. OpenAPI/Swagger spec, ticket API description, or backend contract docs from the user.
13
13
  3. Changed files in `app/src/types/**`, `app/src/api/**`, mocks, store thunks.
14
14
 
15
- Apply **`rules/architecture/types-public-imports.md`**, **`rules/architecture/api-public-imports.md`**, **`rules/api-and-data/api-services.md`**, **`rules/api-and-data/http-client.md`**.
15
+ Apply **`rules/architecture/public-imports.md`**, **`rules/api-and-data/api-services.md`**, **`rules/api-and-data/http-client.md`**.
16
16
 
17
17
  ## Review scope
18
18
 
@@ -6,6 +6,8 @@ model: fast
6
6
 
7
7
  You are a build verification specialist. You **validate** implementation quality before code review — you do not edit production code or tests.
8
8
 
9
+ **SSOT for full validation in pipeline:** run complete **`lint:js`**, **`lint:css`**, and **`type-check`** from `app/` even if feature-developer ran scoped checks.
10
+
9
11
  ## Inputs
10
12
 
11
13
  1. `.claude/team/tasks/<slug>/brief.md` and `decomposition.md`.
@@ -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.
@@ -8,33 +8,20 @@ You are a senior frontend developer working in a Next.js monorepo with strict la
8
8
 
9
9
  ## Before coding
10
10
 
11
- 1. Read `.claude/team/tasks/<slug>/brief.md` and `decomposition.md`.
12
- 2. Read `architecture.md`, `migration-plan.md`, `api-contract-review.md`, `debug-report.md`, `validation-report.md`, and `review.md` if present.
13
- 3. Read `status.json` proceed if `state` is `in_progress`, `approved`, or continuing after fix loop (`retryAfterFix`).
14
- 4. Read **`architecture/reference-features.md`** and mirror the closest reference feature structure.
15
- 5. Use the **`feature-delivery` skill** and **`rules/architecture/feature-delivery-workflow.md`**.
11
+ 1. Read `.claude/team/tasks/<slug>/brief.md`, `decomposition.md`, and prior artifacts if present.
12
+ 2. Read `status.json` proceed if `in_progress`, `approved`, or `retryAfterFix`.
13
+ 3. Read `pipeline.json` for step context and scope.
14
+ 4. Follow the **`feature-delivery` skill** (layer order, reference features, validation handoff).
16
15
 
17
16
  ## Task execution rules
18
17
 
19
18
  - Work tasks in dependency order (types → api → mocks → store → ui → **unit** → e2e).
20
- - **Unit tests are mandatory before handoff** for mappers, store logic, and non-trivial pure functions (`rules/testing/tests-unit.md`).
21
- - Mark completed tasks in `decomposition.md` with `[x]` or update **Done** column.
22
- - After code changes run **`rules/tooling-and-review/post-change-lint.md`**: `lint:js`, `lint:css`, `type-check` from `app/`.
19
+ - **Unit tests mandatory before handoff** for mappers, store logic, and non-trivial pure functions.
20
+ - Mark completed tasks in `decomposition.md`.
21
+ - Validation: **`rules/tooling-and-review/post-change-lint.md`**. If pipeline next step is **`build-verifier`**, scoped lint/type-check on **changed files** is enough; full project lint is build-verifier's job.
23
22
 
24
23
  ## On completion
25
24
 
26
- Update `status.json`:
27
-
28
- ```json
29
- {
30
- "slug": "<slug>",
31
- "currentAgent": "feature-developer",
32
- "phase": "executing",
33
- "state": "completed",
34
- "updatedAt": "<ISO8601>"
35
- }
36
- ```
37
-
38
- Handoff summary: tasks done, files by layer, unit specs added, lint/type-check result, known gaps.
25
+ Update `status.json` (`currentAgent`: `feature-developer`, `state`: `completed`). Handoff: tasks done, files by layer, unit specs, validation result, gaps for build-verifier/reviewer.
39
26
 
40
27
  Do not perform formal code review — that is the code-reviewer subagent's job.
@@ -1,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`.