@bonesofspring/ai-rules 0.1.40 → 0.1.42
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/README.md +12 -3
- package/bin/cli.js +211 -50
- package/package.json +2 -1
- package/presets/claude/next/CLAUDE.md +11 -7
- package/presets/claude/next/README.md +2 -2
- package/presets/claude/next/agents/README.md +50 -1
- package/presets/claude/next/agents/accessibility-reviewer.md +65 -0
- package/presets/claude/next/agents/api-contract-reviewer.md +69 -0
- package/presets/claude/next/agents/build-verifier.md +62 -0
- package/presets/claude/next/agents/ci-investigator.md +62 -0
- package/presets/claude/next/agents/code-reviewer.md +7 -1
- package/presets/claude/next/agents/debugger.md +7 -2
- package/presets/claude/next/agents/feature-developer.md +11 -16
- package/presets/claude/next/agents/migration-specialist.md +69 -0
- package/presets/claude/next/agents/performance-auditor.md +68 -0
- package/presets/claude/next/agents/qa-tester.md +4 -2
- package/presets/claude/next/agents/security-reviewer.md +64 -0
- package/presets/claude/next/agents/task-analyst.md +6 -2
- package/presets/claude/next/agents/task-router.md +83 -16
- package/presets/claude/next/agents/tech-writer.md +60 -0
- package/presets/claude/next/agents/unit-test-generator.md +37 -0
- package/presets/claude/next/agents/unit-test-healer.md +38 -0
- package/presets/claude/next/agents/unit-test-planner.md +62 -0
- package/presets/claude/next/commands/README.md +1 -1
- package/presets/claude/next/commands/feature-continue.md +5 -0
- package/presets/claude/next/commands/feature-start.md +5 -0
- package/presets/claude/next/commands/task-continue.md +8 -2
- package/presets/claude/next/commands/task.md +10 -0
- package/presets/claude/next/commands/technical-retro.md +6 -1
- package/presets/claude/next/hooks/README.md +5 -8
- package/presets/claude/next/hooks/chain-team-phases.sh +258 -39
- package/presets/claude/next/hooks/guard-shell-command.sh +77 -0
- package/presets/claude/next/rules/README.md +20 -44
- package/presets/claude/next/rules/architecture/api-public-imports.md +6 -0
- package/presets/claude/next/rules/architecture/architecture-boundaries.md +5 -0
- package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +5 -0
- package/presets/claude/next/rules/architecture/layer-barrel-exports.md +5 -0
- package/presets/claude/next/rules/architecture/reference-features.md +34 -0
- package/presets/claude/next/rules/architecture/types-public-imports.md +6 -0
- package/presets/claude/next/rules/stack/arrow-functions.md +5 -0
- package/presets/claude/next/rules/stack/navigation-router.md +5 -0
- package/presets/claude/next/rules/stack/next-app-router.md +36 -0
- package/presets/claude/next/rules/stack/no-type-assertion.md +6 -0
- package/presets/claude/next/rules/testing/playwright-agents.md +5 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +32 -8
- package/presets/claude/next/rules/ui-and-accessibility/component-styles.md +6 -0
- package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +6 -0
- package/presets/claude/next/rules/ui-and-accessibility/no-props-spread.md +5 -0
- package/presets/claude/next/rules/ui-and-accessibility/react-a11y-coding.md +37 -0
- package/presets/claude/next/skills/README.md +11 -1
- package/presets/claude/next/skills/ci-investigation/SKILL.md +36 -0
- package/presets/claude/next/skills/code-review/SKILL.md +26 -0
- package/presets/claude/next/skills/debug-investigation/SKILL.md +28 -0
- package/presets/claude/next/skills/feature-delivery/SKILL.md +30 -0
- package/presets/claude/next/skills/playwright-e2e/SKILL.md +31 -0
- package/presets/claude/next/skills/technical-retro/SKILL.md +40 -0
- package/presets/claude/next/skills/unit-testing/SKILL.md +32 -0
- package/presets/claude/next/team/README.md +25 -43
- package/presets/cursor/next/AGENTS.md +43 -0
- package/presets/cursor/next/BUGBOT.md +14 -0
- package/presets/cursor/next/agents/README.md +52 -0
- package/presets/cursor/next/agents/accessibility-reviewer.md +67 -0
- package/presets/cursor/next/agents/api-contract-reviewer.md +71 -0
- package/presets/cursor/next/agents/build-verifier.md +64 -0
- package/presets/cursor/next/agents/ci-investigator.md +64 -0
- package/presets/cursor/next/agents/code-reviewer.md +8 -1
- package/presets/cursor/next/agents/debugger.md +7 -2
- package/presets/cursor/next/agents/feature-developer.md +10 -8
- package/presets/cursor/next/agents/migration-specialist.md +71 -0
- package/presets/cursor/next/agents/performance-auditor.md +70 -0
- package/presets/cursor/next/agents/playwright-test-generator.md +26 -0
- package/presets/cursor/next/agents/playwright-test-healer.md +26 -0
- package/presets/cursor/next/agents/playwright-test-planner.md +28 -0
- package/presets/cursor/next/agents/qa-tester.md +4 -2
- package/presets/cursor/next/agents/security-reviewer.md +66 -0
- package/presets/cursor/next/agents/task-analyst.md +3 -2
- package/presets/cursor/next/agents/task-router.md +84 -17
- package/presets/cursor/next/agents/tech-writer.md +62 -0
- package/presets/cursor/next/agents/unit-test-generator.md +39 -0
- package/presets/cursor/next/agents/unit-test-healer.md +40 -0
- package/presets/cursor/next/agents/unit-test-planner.md +64 -0
- package/presets/cursor/next/commands/README.md +17 -1
- package/presets/cursor/next/commands/feature-continue.md +5 -0
- package/presets/cursor/next/commands/feature-start.md +5 -0
- package/presets/cursor/next/commands/task-continue.md +8 -2
- package/presets/cursor/next/commands/task.md +10 -0
- package/presets/cursor/next/commands/technical-retro.md +6 -1
- package/presets/cursor/next/hooks/README.md +8 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +192 -28
- package/presets/cursor/next/hooks/guard-shell-command.sh +77 -0
- package/presets/cursor/next/hooks.json +7 -1
- package/presets/cursor/next/rules/README.md +16 -6
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +32 -8
- package/presets/cursor/next/rules/api-public-imports.mdc +2 -1
- package/presets/cursor/next/rules/architecture-boundaries.mdc +2 -1
- package/presets/cursor/next/rules/arrow-functions.mdc +2 -1
- package/presets/cursor/next/rules/code-review-mr.mdc +1 -1
- package/presets/cursor/next/rules/css-property-order-stylelint.mdc +4 -1
- package/presets/cursor/next/rules/feature-delivery-flow.mdc +1 -1
- package/presets/cursor/next/rules/feature-delivery-workflow.mdc +2 -2
- package/presets/cursor/next/rules/layer-barrel-exports.mdc +2 -1
- package/presets/cursor/next/rules/navigation-router-stack.mdc +2 -1
- package/presets/cursor/next/rules/next-app-router.mdc +36 -0
- package/presets/cursor/next/rules/no-cross-component-styles-import.mdc +4 -1
- package/presets/cursor/next/rules/no-props-spread.mdc +1 -1
- package/presets/cursor/next/rules/no-type-assertion-as-import-export.mdc +2 -1
- package/presets/cursor/next/rules/playwright-agents.mdc +2 -1
- package/presets/cursor/next/rules/react-a11y-coding.mdc +37 -0
- package/presets/cursor/next/rules/reference-features.mdc +35 -0
- package/presets/cursor/next/rules/types-public-imports.mdc +2 -1
- package/presets/cursor/next/skills/README.md +15 -0
- package/presets/cursor/next/skills/ci-investigation/SKILL.md +36 -0
- package/presets/cursor/next/skills/code-review/SKILL.md +26 -0
- package/presets/cursor/next/skills/debug-investigation/SKILL.md +28 -0
- package/presets/cursor/next/skills/feature-delivery/SKILL.md +30 -0
- package/presets/cursor/next/skills/playwright-e2e/SKILL.md +31 -0
- package/presets/cursor/next/skills/technical-retro/SKILL.md +40 -0
- package/presets/cursor/next/skills/unit-testing/SKILL.md +32 -0
- package/presets/cursor/next/team/README.md +38 -40
|
@@ -17,12 +17,26 @@ Parent agent = **manager**. Router plans; specialists execute. Artifacts: `.clau
|
|
|
17
17
|
| Agent | May edit production code | Typical intent |
|
|
18
18
|
|-------|--------------------------|----------------|
|
|
19
19
|
| `task-router` | no | Every `/task` — writes `pipeline.json` |
|
|
20
|
-
| `task-analyst` | no | feature, refactor, test-only |
|
|
20
|
+
| `task-analyst` | no | feature, refactor, test-only, a11y, docs-only, migration |
|
|
21
21
|
| `solution-architect` | no | spike, complex cross-layer feature |
|
|
22
|
+
| `migration-specialist` | no | migration — phased upgrade plan |
|
|
23
|
+
| `api-contract-reviewer` | no | new/changed backend API contracts |
|
|
22
24
|
| `debugger` | yes, minimal fixes only | bugfix |
|
|
23
|
-
| `
|
|
25
|
+
| `ci-investigator` | yes, minimal CI fixes | ci-fix |
|
|
26
|
+
| `feature-developer` | yes | feature, bugfix, refactor, migration, a11y |
|
|
27
|
+
| `build-verifier` | no | lint/type-check/unit gate after developer |
|
|
28
|
+
| `accessibility-reviewer` | no | a11y, UI-heavy feature |
|
|
29
|
+
| `performance-auditor` | no | perf-audit, perf-sensitive feature |
|
|
24
30
|
| `code-reviewer` | no | most pipelines, review-only |
|
|
31
|
+
| `security-reviewer` | no | auth, forms, sensitive data |
|
|
25
32
|
| `qa-tester` | tests only | feature, bugfix, test-only |
|
|
33
|
+
| `unit-test-planner` | no | unit-only — coverage plan |
|
|
34
|
+
| `unit-test-generator` | tests only | unit-only — spec generation |
|
|
35
|
+
| `unit-test-healer` | tests only | failing/flaky unit tests |
|
|
36
|
+
| `playwright-test-planner` | no | e2e scenario planning |
|
|
37
|
+
| `playwright-test-generator` | tests only | e2e spec generation |
|
|
38
|
+
| `playwright-test-healer` | tests only | failing/flaky e2e fixes |
|
|
39
|
+
| `tech-writer` | docs only | docs-only, feature/migration docs |
|
|
26
40
|
|
|
27
41
|
Full prompts: `.claude/agents/*.md`. Artifact conventions: `.claude/team/README.md`.
|
|
28
42
|
|
|
@@ -69,18 +83,28 @@ flowchart TD
|
|
|
69
83
|
| `in_progress` | Current step running |
|
|
70
84
|
| `completed` | Current step done; hook or orchestrator advances |
|
|
71
85
|
| `awaiting_approval` | Human gate; wait for `/task-continue` |
|
|
72
|
-
| `changes_requested` | Reviewer blocked; re-run developer |
|
|
86
|
+
| `changes_requested` | Reviewer blocked; re-run developer (`retryAfterFix`) |
|
|
87
|
+
| `validation_failed` | build-verifier failed; re-run developer then build-verifier |
|
|
88
|
+
|
|
89
|
+
## Pipeline step options
|
|
90
|
+
|
|
91
|
+
| Field | Use |
|
|
92
|
+
|-------|-----|
|
|
93
|
+
| `skipIf` | `debugger.fixed` / `ci-investigator.resolved` |
|
|
94
|
+
| `parallel: true` | `agent` array — invoke all in one parent turn |
|
|
95
|
+
| `scope` | e.g. `unit-in-dev`, `e2e-only` |
|
|
73
96
|
|
|
74
97
|
## Rules (strict)
|
|
75
98
|
|
|
76
99
|
1. **`/task` always starts with task-router** (except user says "skip router" with documented pipeline).
|
|
77
100
|
2. Read `pipeline.json` before every subagent invocation.
|
|
78
|
-
3. One role per subagent call.
|
|
101
|
+
3. One role per subagent call — **except** parallel steps.
|
|
79
102
|
4. **Never** skip `humanGates` without `/task-continue` or explicit user approval.
|
|
80
|
-
5. Persist handoffs
|
|
81
|
-
6. On `changes_requested`:
|
|
82
|
-
7.
|
|
83
|
-
8.
|
|
103
|
+
5. Persist handoffs including `validation-report.md`.
|
|
104
|
+
6. On `changes_requested`: hook sets `retryAfterFix` → developer → same reviewer.
|
|
105
|
+
7. On `validation_failed`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
|
|
106
|
+
8. When all steps complete, suggest `/technical-retro <slug>`.
|
|
107
|
+
9. If `autoChain: false`, manual step only.
|
|
84
108
|
|
|
85
109
|
## Invoking agents
|
|
86
110
|
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths:
|
|
3
|
+
- app/src/**/*.{css,ts,tsx}
|
|
4
|
+
- app/**/*.css
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# Порядок CSS-свойств (как в Stylelint)
|
|
2
8
|
|
|
3
9
|
Действует для **любого** CSS в репозитории: `.css`, стилевые блоки в `styles.ts` / `styles.tsx`, `styled` / Linaria и другой CSS-in-JS в `.ts` / `.tsx`, если этот код попадает под `lint:css`.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths:
|
|
3
|
+
- app/src/ui/**/*.tsx
|
|
4
|
+
- app/src/ui/**/*.ts
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# A11y при разработке UI
|
|
8
|
+
|
|
9
|
+
Reviewer (`accessibility-reviewer`) проверяет diff; эти правила — **при написании** кода.
|
|
10
|
+
|
|
11
|
+
## Семантика и ARIA
|
|
12
|
+
|
|
13
|
+
- Предпочитать **нативные элементы** (`button`, `a`, `label`, `input`) вместо `div` с `onClick`.
|
|
14
|
+
- **`role` / `aria-*`** — только когда нативного аналога нет; не дублировать то, что даёт семантика.
|
|
15
|
+
- Заголовки — иераархия `h1`–`h6` без пропусков уровней ради стилей.
|
|
16
|
+
|
|
17
|
+
## Формы
|
|
18
|
+
|
|
19
|
+
- Каждый input связан с **`label`** (`htmlFor` / `id` или обёртка).
|
|
20
|
+
- Сообщения об ошибках — **`aria-describedby`**, `aria-invalid` при validation errors.
|
|
21
|
+
- Кнопки submit vs button — явный `type`.
|
|
22
|
+
|
|
23
|
+
## Клавиатура и focus
|
|
24
|
+
|
|
25
|
+
- Все интерактивные элементы **достижимы с Tab** и активируются Enter/Space где ожидается.
|
|
26
|
+
- **Modals/drawers** — focus trap, возврат focus на trigger при закрытии, Esc закрывает (если по UX).
|
|
27
|
+
- Не удалять видимый **focus outline** без замены на доступный custom focus style.
|
|
28
|
+
|
|
29
|
+
## Контент
|
|
30
|
+
|
|
31
|
+
- Изображения — **`alt`** (пустой `alt` только для декора).
|
|
32
|
+
- Иконки-кнопки — **`aria-label`** или visually hidden text.
|
|
33
|
+
- Динамические обновления — `aria-live` для критичных status/error (умеренно).
|
|
34
|
+
|
|
35
|
+
## Проверка
|
|
36
|
+
|
|
37
|
+
- При сомнении — devtools a11y tree или `accessibility-reviewer` в pipeline для UI-heavy фич.
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# `.claude/skills` (preset next)
|
|
2
2
|
|
|
3
|
-
[Skills](https://code.claude.com/docs/en/skills) в Claude Code — сценарии, которые подгружаются по необходимости, а не в каждой сессии целиком.
|
|
3
|
+
[Skills](https://code.claude.com/docs/en/skills) в Claude Code — сценарии, которые подгружаются по необходимости, а не в каждой сессии целиком. Они синхронизированы по смыслу с `.cursor/skills` из Cursor-пресета.
|
|
4
|
+
|
|
5
|
+
| Skill | Когда использовать |
|
|
6
|
+
|-------|--------------------|
|
|
7
|
+
| `feature-delivery` | End-to-end feature work across types, API, store, UI, tests |
|
|
8
|
+
| `code-review` | MR/diff review using project architecture and test standards |
|
|
9
|
+
| `debug-investigation` | Reproducing and fixing bugs with root-cause evidence |
|
|
10
|
+
| `ci-investigation` | Diagnosing and fixing failing CI checks on PRs/branches |
|
|
11
|
+
| `unit-testing` | Planning, generating, or healing unit test coverage |
|
|
12
|
+
| `playwright-e2e` | Planning, generating, or healing Playwright e2e coverage |
|
|
13
|
+
| `technical-retro` | Technical retrospective for a task, sprint, incident, or agent pipeline |
|
|
4
14
|
|
|
5
15
|
Папка копируется в `.claude/skills/` при `ai-rules init claude --preset next`, если существует.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ci-investigation
|
|
3
|
+
description: Investigates failing CI checks on PRs and branches — lint, type-check, unit, e2e — with local reproduction and minimal fixes. Use when CI is red or for ci-fix pipeline tasks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CI Investigation
|
|
7
|
+
|
|
8
|
+
## Workflow
|
|
9
|
+
|
|
10
|
+
1. Identify the **first failing check** (lint, type-check, unit, e2e, build).
|
|
11
|
+
2. Capture error output — ignore cascading failures until root cause is found.
|
|
12
|
+
3. Reproduce locally with the same commands CI uses from `app/`:
|
|
13
|
+
- `lint:js`, `lint:css`, `type-check`
|
|
14
|
+
- targeted unit test file or suite
|
|
15
|
+
- affected Playwright spec if e2e failed
|
|
16
|
+
4. Inspect git diff for changed files related to the failure.
|
|
17
|
+
5. Apply **minimal fix** — no unrelated refactors.
|
|
18
|
+
|
|
19
|
+
## Artifact
|
|
20
|
+
|
|
21
|
+
Write `ci-report.md` under the task slug folder:
|
|
22
|
+
|
|
23
|
+
- Failed check name and link/log excerpt
|
|
24
|
+
- Root cause classification
|
|
25
|
+
- Fix applied (or handoff to feature-developer)
|
|
26
|
+
- Validation commands and results
|
|
27
|
+
|
|
28
|
+
## Handoff Rules
|
|
29
|
+
|
|
30
|
+
- Config-only or one-line fixes → fix in place, re-run check.
|
|
31
|
+
- Missing tests or architecture work → document and route to `feature-developer` or `qa-tester`.
|
|
32
|
+
- Flaky e2e → prefer `playwright-test-healer` after ci-investigator identifies the spec.
|
|
33
|
+
|
|
34
|
+
## Validation
|
|
35
|
+
|
|
36
|
+
Always re-run the failing command locally before marking complete. If environment blocks execution, state the exact command and blocker.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: Reviews pull requests, merge requests, git diffs, and branch changes using the preset's architecture, import, UI, API, and testing standards. Use when the user asks for review or when code-reviewer runs in an agent pipeline.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review
|
|
7
|
+
|
|
8
|
+
## Inputs
|
|
9
|
+
|
|
10
|
+
Use the local repository as the source of truth: `git status`, `git diff`, task artifacts under `.claude/team/tasks/<slug>/` when present, and opened files. Do not invent hosting metadata such as labels, CI status, or reviewers.
|
|
11
|
+
|
|
12
|
+
## Review Order
|
|
13
|
+
|
|
14
|
+
1. Understand the intent and affected layers.
|
|
15
|
+
2. Check correctness and regressions first.
|
|
16
|
+
3. Verify architecture boundaries: UI does not know DTO/transport, store does not depend on UI, API services do not pull UI/store.
|
|
17
|
+
4. Check public imports through `@/types` and `@/api`, plus barrel updates for new public symbols.
|
|
18
|
+
5. Review UI consistency, styling conventions, and prop shape.
|
|
19
|
+
6. Check tests: unit for mapper/domain logic, behavior tests for HTTP client changes, e2e plan/spec updates for user flows.
|
|
20
|
+
7. Report validation gaps: lint, stylelint, type-check, or relevant tests not run.
|
|
21
|
+
|
|
22
|
+
## Output
|
|
23
|
+
|
|
24
|
+
Lead with findings ordered by severity. Each finding should include the file, the problem, impact, and a concrete fix direction. If there are no findings, say so and call out remaining test or validation risk.
|
|
25
|
+
|
|
26
|
+
For agent team tasks, write `.claude/team/tasks/<slug>/review.md` and set `status.json` to `completed` or `changes_requested`.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug-investigation
|
|
3
|
+
description: Investigates bugs, failing tests, crashes, and incorrect behavior with runtime evidence before applying minimal fixes. Use for bugfix tasks, debugger agent runs, regressions, and flaky test diagnosis.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Debug Investigation
|
|
7
|
+
|
|
8
|
+
## Process
|
|
9
|
+
|
|
10
|
+
1. Reproduce the issue or collect the closest available evidence: error output, failing test, browser snapshot, logs, or user steps.
|
|
11
|
+
2. Define expected vs actual behavior in one sentence.
|
|
12
|
+
3. Trace the failing path through the smallest relevant slice of the codebase.
|
|
13
|
+
4. Identify the root cause before editing. Avoid broad refactors during bugfixes.
|
|
14
|
+
5. Apply the smallest fix that preserves existing architecture and public contracts.
|
|
15
|
+
6. Add or update a regression test when the behavior is user-facing or likely to recur.
|
|
16
|
+
7. Run the narrow failing check first, then relevant lint/type/test validation.
|
|
17
|
+
|
|
18
|
+
## Artifacts
|
|
19
|
+
|
|
20
|
+
For agent team tasks, write `.claude/team/tasks/<slug>/debug-report.md` with:
|
|
21
|
+
|
|
22
|
+
- Reproduction steps or evidence source.
|
|
23
|
+
- Root cause.
|
|
24
|
+
- Fix scope.
|
|
25
|
+
- Regression coverage.
|
|
26
|
+
- Remaining risk.
|
|
27
|
+
|
|
28
|
+
Update `status.json` when complete.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-delivery
|
|
3
|
+
description: Delivers Next.js frontend features end-to-end across domain types, API services, store, UI, mocks, tests, and validation. Use when implementing or extending a feature, especially through /task or feature-developer.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Feature Delivery
|
|
7
|
+
|
|
8
|
+
## Workflow
|
|
9
|
+
|
|
10
|
+
1. Read the task brief, acceptance criteria, and decomposition if present.
|
|
11
|
+
2. Read **`architecture/reference-features.md`** and mirror the closest reference feature.
|
|
12
|
+
3. Work in layer order: types -> API -> store -> UI -> **unit tests** -> e2e (if in scope).
|
|
13
|
+
4. Keep DTOs out of UI/store; expose domain types through `@/types` and API calls through `@/api`.
|
|
14
|
+
5. Prefer small, reviewable edits; update barrels when adding public symbols.
|
|
15
|
+
6. Add or update focused tests for changed behavior.
|
|
16
|
+
7. Run project validation from `app/`: `lint:js`, `lint:css`, and `type-check` when TypeScript changed.
|
|
17
|
+
|
|
18
|
+
## Rule Map
|
|
19
|
+
|
|
20
|
+
- Core stack and layers: `rules/stack/next-app-core.md`, `rules/architecture/architecture-boundaries.md`.
|
|
21
|
+
- Data/API: `rules/api-and-data/http-client.md`, `rules/api-and-data/api-services.md`, `rules/api-and-data/store-rtk.md`.
|
|
22
|
+
- Public imports: `rules/architecture/types-public-imports.md`, `rules/architecture/api-public-imports.md`, `rules/architecture/layer-barrel-exports.md`.
|
|
23
|
+
- UI: `rules/ui-and-accessibility/react-ui.md`, `react-a11y-coding.md`, `no-props-spread.md`, `component-styles.md`.
|
|
24
|
+
- App Router: `rules/stack/next-app-router.md`.
|
|
25
|
+
- Tests: `rules/testing/tests-unit.md`, `rules/testing/tests-e2e-structure.md`, `rules/testing/playwright-agents.md`.
|
|
26
|
+
- Finish: `rules/tooling-and-review/post-change-lint.md`, `rules/tooling-and-review/package-manager.md`.
|
|
27
|
+
|
|
28
|
+
## Handoff
|
|
29
|
+
|
|
30
|
+
Summarize completed work by layer, validation results, and known gaps. If this is part of an agent team task, update `.claude/team/tasks/<slug>/status.json`.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playwright-e2e
|
|
3
|
+
description: Plans, generates, and heals Playwright e2e tests using this preset's app/__tests__/e2e layout, *.cases.md plans, page objects, and shared helpers. Use for e2e planning, test generation, or fixing failing browser tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Playwright E2E
|
|
7
|
+
|
|
8
|
+
## Project Layout
|
|
9
|
+
|
|
10
|
+
- Test root: `app/__tests__/e2e`.
|
|
11
|
+
- Test plans: `*.cases.md` files under the matching feature folder.
|
|
12
|
+
- Executable specs: `*.spec.ts` files in the same folder.
|
|
13
|
+
- Seed/setup reference: `app/__tests__/e2e/seed.spec.ts`.
|
|
14
|
+
|
|
15
|
+
Do not introduce top-level `specs/` or `tests/` folders for real coverage unless the user explicitly asks for a sandbox.
|
|
16
|
+
|
|
17
|
+
## Planner
|
|
18
|
+
|
|
19
|
+
Create or update the relevant `*.cases.md` file. Each scenario should include title, preconditions, steps, and expected result. Cover happy path, important edge cases, validation, and error states.
|
|
20
|
+
|
|
21
|
+
## Generator
|
|
22
|
+
|
|
23
|
+
Generate specs from `*.cases.md` into the same folder. Reuse existing page objects and `_shared/` helpers. Keep test names aligned with scenario names.
|
|
24
|
+
|
|
25
|
+
## Healer
|
|
26
|
+
|
|
27
|
+
Fix selectors, waits, setup, or page-object details without weakening business assertions. Use the matching `*.cases.md` file as the behavior contract.
|
|
28
|
+
|
|
29
|
+
## Validation
|
|
30
|
+
|
|
31
|
+
Run the affected spec when feasible. If the environment blocks execution, report the command that should be run and the blocker.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: technical-retro
|
|
3
|
+
description: Facilitates technical retrospectives for tasks, sprints, incidents, releases, and agent-team pipelines. Use when the user asks for retro, postmortem, process review, or action items after delivery.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Technical Retro
|
|
7
|
+
|
|
8
|
+
## Inputs
|
|
9
|
+
|
|
10
|
+
Ask for missing period, focus, task slug, participants, or format constraints. If a slug is provided, read `.claude/team/tasks/<slug>/` artifacts and local git status/diff. Do not invent facts not present in artifacts or the user's message.
|
|
11
|
+
|
|
12
|
+
## Facilitation Principles
|
|
13
|
+
|
|
14
|
+
- Focus on process and system behavior, not blame.
|
|
15
|
+
- Separate facts, interpretations, and proposed actions.
|
|
16
|
+
- Balance what worked with what slowed delivery.
|
|
17
|
+
- Keep action items concrete, owned, and measurable.
|
|
18
|
+
|
|
19
|
+
## Default Structure
|
|
20
|
+
|
|
21
|
+
1. Goal and scope.
|
|
22
|
+
2. Timeline or factual observations.
|
|
23
|
+
3. What worked.
|
|
24
|
+
4. What hurt quality, speed, or confidence.
|
|
25
|
+
5. Root causes for the top one or two issues.
|
|
26
|
+
6. Experiments and action items.
|
|
27
|
+
|
|
28
|
+
## Agent Team Block
|
|
29
|
+
|
|
30
|
+
For `/task` pipelines, include router, analyst, developer, **build-verifier**, reviewer, QA/e2e, hooks, and rules.
|
|
31
|
+
|
|
32
|
+
## Preset feedback loop
|
|
33
|
+
|
|
34
|
+
If the same issue appeared in 2+ tasks, add section **Preset updates**:
|
|
35
|
+
|
|
36
|
+
- Proposed change to `.claude/rules/`, `.claude/agents/`, or `.claude/skills/`
|
|
37
|
+
- One concrete diff or file path to update
|
|
38
|
+
- Whether it belongs in session-start rules vs `paths:` vs skill
|
|
39
|
+
|
|
40
|
+
Do not apply preset changes without user approval.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: unit-testing
|
|
3
|
+
description: Plans, generates, and heals unit tests for mappers, thunks, HTTP client behavior, and React components using colocated *.spec.ts files and tests-unit rules. Use for unit test planning, generation, or fixing failing unit tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Unit Testing
|
|
7
|
+
|
|
8
|
+
## Project Layout
|
|
9
|
+
|
|
10
|
+
- Specs colocated with source: `*.spec.ts` / `*.spec.tsx` next to the module under test.
|
|
11
|
+
- Legacy `*.test.ts` / `*.test.tsx` — do not rename without a separate task.
|
|
12
|
+
- Runner: Jest or Vitest as configured in the target repo; components use `@testing-library/react`.
|
|
13
|
+
|
|
14
|
+
Follow **`rules/testing/tests-unit.md`**.
|
|
15
|
+
|
|
16
|
+
## Planner
|
|
17
|
+
|
|
18
|
+
Write or update `.claude/team/tasks/<slug>/unit-test-plan.md`.
|
|
19
|
+
|
|
20
|
+
Each scenario needs a Russian `it()` title (capital letter after each sentence). Cover mappers, thunks, client behavior branches, and component interactions per AC.
|
|
21
|
+
|
|
22
|
+
## Generator
|
|
23
|
+
|
|
24
|
+
Implement specs from `unit-test-plan.md`. Reuse project test-store, HTTP mocks, and existing test utilities. Do not change production code.
|
|
25
|
+
|
|
26
|
+
## Healer
|
|
27
|
+
|
|
28
|
+
Fix mocks, async timing, selectors, and setup — preserve business assertions. Use `unit-test-plan.md` and `brief.md` as the behavior contract.
|
|
29
|
+
|
|
30
|
+
## Validation
|
|
31
|
+
|
|
32
|
+
Run affected unit tests from `app/` when feasible. Report command, pass/fail, and remaining gaps vs plan.
|
|
@@ -4,61 +4,43 @@
|
|
|
4
4
|
|
|
5
5
|
## Layout
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```
|
|
8
8
|
.claude/team/
|
|
9
|
-
active-task.json
|
|
9
|
+
active-task.json
|
|
10
10
|
tasks/
|
|
11
11
|
<slug>/
|
|
12
|
-
pipeline.json
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
debug-report.md
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
pipeline.json
|
|
13
|
+
status.json
|
|
14
|
+
brief.md
|
|
15
|
+
decomposition.md
|
|
16
|
+
debug-report.md
|
|
17
|
+
validation-report.md
|
|
18
|
+
architecture.md
|
|
19
|
+
migration-plan.md
|
|
20
|
+
ci-report.md
|
|
21
|
+
a11y-review.md
|
|
22
|
+
perf-report.md
|
|
23
|
+
security-review.md
|
|
24
|
+
api-contract-review.md
|
|
25
|
+
unit-test-plan.md
|
|
26
|
+
documentation.md
|
|
27
|
+
review.md
|
|
19
28
|
```
|
|
20
29
|
|
|
21
|
-
##
|
|
22
|
-
|
|
23
|
-
- kebab-case, derived from task title
|
|
24
|
-
- max 48 characters
|
|
25
|
-
- example: `order-history-date-filter`
|
|
30
|
+
## pipeline.json schema
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```json
|
|
30
|
-
{
|
|
31
|
-
"slug": "order-history-date-filter",
|
|
32
|
-
"intent": "feature",
|
|
33
|
-
"pipelineIndex": 0,
|
|
34
|
-
"currentAgent": "task-analyst",
|
|
35
|
-
"phase": "executing",
|
|
36
|
-
"state": "in_progress",
|
|
37
|
-
"awaitingHumanGate": false,
|
|
38
|
-
"updatedAt": "2026-05-29T12:00:00.000Z"
|
|
39
|
-
}
|
|
40
|
-
```
|
|
32
|
+
Same as Cursor preset — see `agents/task-router.md` for examples with `build-verifier`, `skipIf`, and `parallel` steps.
|
|
41
33
|
|
|
42
|
-
|
|
34
|
+
## status.json
|
|
43
35
|
|
|
44
|
-
|
|
45
|
-
|-------|-------------|
|
|
46
|
-
| `awaiting_approval` | Brief/design ready; human gate |
|
|
47
|
-
| `approved` | User approved via `/task-continue` or `/feature-continue` |
|
|
48
|
-
| `in_progress` | Active subagent working |
|
|
49
|
-
| `completed` | Current phase/step finished |
|
|
50
|
-
| `changes_requested` | Review found required fixes |
|
|
51
|
-
|
|
52
|
-
## Git
|
|
53
|
-
|
|
54
|
-
Commit task artifacts if you want them to survive `ai-rules clean claude`. Alternatively copy finished tasks to `docs/agent-workflow/tasks/<slug>/`.
|
|
36
|
+
Use **`phase: executing`** in pipeline mode. Optional fields: `parallelCompleted`, `retryAfterFix`, `validation_failed` state.
|
|
55
37
|
|
|
56
38
|
## Workflow entry
|
|
57
39
|
|
|
58
40
|
```bash
|
|
59
|
-
/task
|
|
60
|
-
# review gate artifacts if requested, then:
|
|
41
|
+
/task <описание>
|
|
61
42
|
/task-continue <slug>
|
|
62
|
-
# after pipeline:
|
|
63
43
|
/technical-retro <slug>
|
|
64
44
|
```
|
|
45
|
+
|
|
46
|
+
Legacy: `/feature-start`, `/feature-continue`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Next.js stack — Cursor agent team
|
|
2
|
+
|
|
3
|
+
Краткая точка входа для Cursor. Подробные правила — `.cursor/rules/*.mdc`; сценарии — `.cursor/skills/**`.
|
|
4
|
+
|
|
5
|
+
See `.cursor/rules/README.md` for the full catalog and loading strategy.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
| Задача | Куда смотреть |
|
|
10
|
+
|--------|----------------|
|
|
11
|
+
| Любая новая work-задача | `/task` → `commands/task.md` + `agent-team-orchestrator.mdc` |
|
|
12
|
+
| Новая фича end-to-end | skill `feature-delivery` + `feature-delivery-workflow.mdc` |
|
|
13
|
+
| Стек и слои | `next-app-core.mdc` |
|
|
14
|
+
| Эталонные фичи | `reference-features.mdc` (заполнить пути в репо) |
|
|
15
|
+
| После правок кода | `post-change-lint.mdc` |
|
|
16
|
+
| Code review MR | skill `code-review` + `code-review-mr.mdc` |
|
|
17
|
+
| Валидация перед review | agent `build-verifier` |
|
|
18
|
+
| Техническое ретро | `/technical-retro` + skill `technical-retro` |
|
|
19
|
+
|
|
20
|
+
## Когда использовать `/task`
|
|
21
|
+
|
|
22
|
+
- Реализация, багфикс, миграция, тесты, ревью MR, CI-fix — **предпочтительно через `/task`**.
|
|
23
|
+
- Простой one-liner без архитектурного риска — можно без pipeline, если пользователь явно просит.
|
|
24
|
+
- Вопросы «как работает X» — ответ без `/task`.
|
|
25
|
+
|
|
26
|
+
## Intent → pipeline (кратко)
|
|
27
|
+
|
|
28
|
+
| intent | Типичный pipeline |
|
|
29
|
+
|--------|-------------------|
|
|
30
|
+
| `feature` | analyst → developer (+ unit) → build-verifier → reviewer → e2e/QA |
|
|
31
|
+
| `bugfix` | debugger → developer (skip if fixed) → build-verifier → reviewer |
|
|
32
|
+
| `ci-fix` | ci-investigator → developer (skip if resolved) → build-verifier |
|
|
33
|
+
| `migration` | analyst → migration-specialist → developer → build-verifier → reviewer → QA |
|
|
34
|
+
|
|
35
|
+
Полная таблица — `agents/README.md`, router — `agents/task-router.md`.
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx @bonesofspring/ai-rules init cursor --preset next
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Копирует rules, commands, agents, hooks, skills, team, `hooks.json`, `BUGBOT.md`, `AGENTS.md`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Cursor Bugbot Review Guidelines
|
|
2
|
+
|
|
3
|
+
Follow the **`code-review` skill** and **`code-review-mr.mdc`** for the full checklist.
|
|
4
|
+
|
|
5
|
+
## Priorities
|
|
6
|
+
|
|
7
|
+
1. Correctness regressions and runtime bugs.
|
|
8
|
+
2. Architecture boundary violations (`architecture-boundaries.mdc`).
|
|
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.
|
|
@@ -2,15 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
Ролевые subagents для командного пайплайна Cursor.
|
|
4
4
|
|
|
5
|
+
## Planning and routing
|
|
6
|
+
|
|
5
7
|
| Agent | Файл | Production-код |
|
|
6
8
|
|-------|------|----------------|
|
|
7
9
|
| Router | `task-router.md` | no |
|
|
8
10
|
| Аналитик | `task-analyst.md` | no |
|
|
9
11
|
| Архитектор | `solution-architect.md` | no |
|
|
12
|
+
| Migration planner | `migration-specialist.md` | no |
|
|
13
|
+
| API contract reviewer | `api-contract-reviewer.md` | no |
|
|
14
|
+
|
|
15
|
+
## Implementation and CI
|
|
16
|
+
|
|
17
|
+
| Agent | Файл | Production-код |
|
|
18
|
+
|-------|------|----------------|
|
|
10
19
|
| Debugger | `debugger.md` | minimal fix only |
|
|
20
|
+
| CI investigator | `ci-investigator.md` | minimal CI fix only |
|
|
21
|
+
| Build verifier | `build-verifier.md` | no |
|
|
11
22
|
| Разработчик | `feature-developer.md` | yes |
|
|
23
|
+
|
|
24
|
+
## Review specialists
|
|
25
|
+
|
|
26
|
+
| Agent | Файл | Production-код |
|
|
27
|
+
|-------|------|----------------|
|
|
12
28
|
| Ревьюер | `code-reviewer.md` | no |
|
|
29
|
+
| A11y reviewer | `accessibility-reviewer.md` | no |
|
|
30
|
+
| Security reviewer | `security-reviewer.md` | no |
|
|
31
|
+
| Performance auditor | `performance-auditor.md` | no |
|
|
32
|
+
|
|
33
|
+
## Testing
|
|
34
|
+
|
|
35
|
+
| Agent | Файл | Production-код |
|
|
36
|
+
|-------|------|----------------|
|
|
13
37
|
| QA | `qa-tester.md` | tests only |
|
|
38
|
+
| Unit planner | `unit-test-planner.md` | no |
|
|
39
|
+
| Unit generator | `unit-test-generator.md` | tests only |
|
|
40
|
+
| Unit healer | `unit-test-healer.md` | tests only |
|
|
41
|
+
| Playwright planner | `playwright-test-planner.md` | e2e plans only |
|
|
42
|
+
| Playwright generator | `playwright-test-generator.md` | e2e tests only |
|
|
43
|
+
| Playwright healer | `playwright-test-healer.md` | e2e fixes only |
|
|
44
|
+
|
|
45
|
+
## Documentation
|
|
46
|
+
|
|
47
|
+
| Agent | Файл | Production-код |
|
|
48
|
+
|-------|------|----------------|
|
|
49
|
+
| Tech writer | `tech-writer.md` | docs only |
|
|
14
50
|
|
|
15
51
|
Копируется в `.cursor/agents/` при `ai-rules init cursor --preset next`.
|
|
16
52
|
|
|
@@ -23,3 +59,19 @@
|
|
|
23
59
|
| `/feature-start`, `/feature-continue` | Legacy (совместимость) |
|
|
24
60
|
|
|
25
61
|
Правило: `agent-team-orchestrator.mdc`. План: `pipeline.json` в `.cursor/team/tasks/<slug>/`.
|
|
62
|
+
|
|
63
|
+
## Intent → pipeline (кратко)
|
|
64
|
+
|
|
65
|
+
| intent | Типичный pipeline |
|
|
66
|
+
|--------|-------------------|
|
|
67
|
+
| `feature` | analyst → developer (+ unit) → build-verifier → reviewer → e2e/QA |
|
|
68
|
+
| `bugfix` | debugger → developer (skipIf fixed) → build-verifier → reviewer |
|
|
69
|
+
| `ci-fix` | ci-investigator → developer (skipIf resolved) → build-verifier |
|
|
70
|
+
| `migration` | analyst → migration-specialist → developer → reviewer → QA |
|
|
71
|
+
| `perf-audit` | performance-auditor |
|
|
72
|
+
| `a11y` | analyst → developer → a11y-reviewer → code-reviewer |
|
|
73
|
+
| `unit-only` | unit-planner → unit-generator (или healer) |
|
|
74
|
+
| `e2e-only` | playwright planner → generator (или healer) |
|
|
75
|
+
| `docs-only` | analyst → tech-writer |
|
|
76
|
+
|
|
77
|
+
Опциональные шаги (router добавляет по контексту): `api-contract-reviewer`, `accessibility-reviewer`, `security-reviewer`, `performance-auditor`, `tech-writer`.
|