@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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Breaking
|
|
6
|
+
|
|
7
|
+
- **Import rules merged:** `types-public-imports.mdc` and `api-public-imports.mdc` → **`public-imports.mdc`** (Claude: `architecture/public-imports.md`). Old filenames remain as deprecated stubs for one release cycle.
|
|
8
|
+
- **`feature-delivery-flow.mdc` removed** — content merged into `feature-delivery-workflow.mdc`.
|
|
9
|
+
- **`agent-team-intake`** no longer always-on (Cursor: `alwaysApply: false`; Claude: `paths:` on commands/team). Use orchestrator or `/task`.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Slimmed always-on rules: `next-app-core`, `code-quality-and-refactoring`, `post-change-lint`, `package-manager` (~9 KB baseline vs ~21 KB).
|
|
14
|
+
- Narrowed globs: `css-property-order-stylelint`, `no-type-assertion-as-import-export`, `reference-features`, `public-imports`.
|
|
15
|
+
- `css-property-order` stub — property list delegated to Stylelint `--fix`.
|
|
16
|
+
- Slimmed `task-router` agent; pipeline JSON examples moved to `agents/README.md`.
|
|
17
|
+
- Agents reference skills as SSOT; scoped lint for `feature-developer` when next step is `build-verifier`.
|
|
18
|
+
- Orchestrator: explicit fast-path when to skip pipeline.
|
|
19
|
+
|
|
20
|
+
## 0.1.42
|
|
21
|
+
|
|
22
|
+
Prior releases — see git history.
|
package/CONTRIBUTING.md
ADDED
|
@@ -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 (
|
|
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
|
|
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
|
-
"
|
|
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,
|
|
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
|
|
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
|
-
##
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
|
64
|
-
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
|
|
69
|
-
|
|
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/
|
|
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:
|
|
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
|
|
12
|
-
2. Read `
|
|
13
|
-
3. Read `
|
|
14
|
-
4.
|
|
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
|
|
21
|
-
- Mark completed tasks in `decomposition.md
|
|
22
|
-
-
|
|
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:
|
|
4
|
-
|
|
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
|
|
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
|
-
##
|
|
9
|
+
## Inputs
|
|
14
10
|
|
|
15
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
4
|
-
|
|
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
|
|
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
|
-
##
|
|
9
|
+
## Inputs
|
|
14
10
|
|
|
15
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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`.
|