@bonesofspring/ai-rules 0.1.39 → 0.1.40

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 CHANGED
@@ -26,7 +26,7 @@ Where things go on `init`:
26
26
  | agents | `.cursor/agents` | `.claude/agents` |
27
27
  | hooks | `.cursor/hooks`, `.cursor/hooks.json` | `.claude/hooks` |
28
28
  | skills | `.cursor/skills` | `.claude/skills` |
29
- | team artifacts template | `.cursor/team` | |
29
+ | team artifacts template | `.cursor/team` | `.claude/team` |
30
30
  | other | — | root `CLAUDE.md` → `.claude/CLAUDE.md` |
31
31
 
32
32
  The package currently ships the **`next`** preset (Next.js stack and whatever else is bundled there). Other preset names: see `presets/` in the [repo](https://github.com/bonesofspring/ai-rules). Name is a single path segment, no `/` or `..`.
package/bin/cli.js CHANGED
@@ -41,6 +41,7 @@ Usage:
41
41
  Notes:
42
42
  init merges into existing target folders; same-named files are overwritten.
43
43
  Cursor init also copies agents/, hooks/, skills/, team/, and hooks.json when present.
44
+ Claude init also copies agents/, hooks/, skills/, team/, and CLAUDE.md when present.
44
45
  clean removes only paths installed by this CLI; other tool files are left intact.
45
46
  Flags may appear before or after the subcommand (e.g. --preset next init cursor).
46
47
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "description": "Presets of Cursor and Claude rules/commands for Revy Ross personal use",
5
5
  "license": "MIT",
6
6
  "author": "Revy Ross",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/bonesofspring/ai-rules.git"
9
+ "url": "git+https://github.com/bonesofspring/ai-rules.git"
10
10
  },
11
11
  "keywords": [
12
12
  "cursor",
@@ -16,7 +16,7 @@
16
16
  "bonesofspring"
17
17
  ],
18
18
  "bin": {
19
- "ai-rules": "./bin/cli.js"
19
+ "ai-rules": "bin/cli.js"
20
20
  },
21
21
  "files": [
22
22
  "README.md",
@@ -15,6 +15,7 @@ See @rules/README.md for the full catalog and loading strategy.
15
15
 
16
16
  | Задача | Куда смотреть |
17
17
  |--------|----------------|
18
+ | Любая новая work-задача | `commands/task.md` + `rules/tooling-and-review/agent-team-orchestrator.md` |
18
19
  | Новая фича end-to-end | `rules/architecture/feature-delivery-workflow.md` |
19
20
  | Стек и слои | `rules/stack/next-app-core.md` |
20
21
  | После любых правок кода | `rules/tooling-and-review/post-change-lint.md` |
@@ -27,4 +28,4 @@ See @rules/README.md for the full catalog and loading strategy.
27
28
  npx @bonesofspring/ai-rules init claude --preset next
28
29
  ```
29
30
 
30
- Копирует `CLAUDE.md`, `rules/**`, `commands/**`, `agents/**` и др. в `.claude/` целевого репозитория.
31
+ Копирует `CLAUDE.md`, `rules/**`, `commands/**`, `agents/**`, `hooks/**`, `team/**` и др. в `.claude/` целевого репозитория.
@@ -10,5 +10,15 @@
10
10
  | `skills/**` | `.claude/skills/**` (если папка есть) |
11
11
  | `agents/**` | `.claude/agents/**` (если папка есть) |
12
12
  | `hooks/**` | `.claude/hooks/**` (если папка есть) |
13
+ | `team/**` | `.claude/team/**` (шаблон артефактов agent team) |
13
14
 
14
15
  Файлы правил — обычный Markdown с опциональным YAML frontmatter (`paths:` для скоупа по путям), не формат `.mdc` Cursor.
16
+
17
+ ## Agent team workflow
18
+
19
+ Cursor-пресет и Claude-пресет используют один и тот же смысловой workflow:
20
+
21
+ - `/task <desc>` → `task-router` → `pipeline.json`;
22
+ - `/task-continue <slug>` → продолжение после human gate;
23
+ - `.claude/agents/*.md` → роли analyst / architect / debugger / developer / reviewer / QA;
24
+ - `.claude/team/tasks/<slug>/` → handoff-артефакты (`brief.md`, `decomposition.md`, `review.md`, `status.json`).
@@ -3,3 +3,18 @@
3
3
  Специализированные подагенты (personas) — по [документации Claude Code](https://code.claude.com/docs), если используете их в проекте.
4
4
 
5
5
  Папка копируется в `.claude/agents/` при `ai-rules init claude --preset next`, если существует.
6
+
7
+ | Agent | Может менять production-код | Назначение |
8
+ |-------|-----------------------------|------------|
9
+ | `task-router` | no | Классифицирует intent и пишет `pipeline.json` |
10
+ | `task-analyst` | no | DoR, acceptance criteria, decomposition |
11
+ | `solution-architect` | no | Cross-layer design, spike, architecture.md |
12
+ | `debugger` | yes, минимально | Root cause, debug-report.md, простые fixes |
13
+ | `feature-developer` | yes | Реализация по decomposition |
14
+ | `code-reviewer` | no | Review artifact, status update |
15
+ | `qa-tester` | tests only | Unit/e2e тесты |
16
+ | `playwright-test-planner` | no | Планирование e2e сценариев |
17
+ | `playwright-test-generator` | tests only | Генерация Playwright specs |
18
+ | `playwright-test-healer` | tests only | Исправление flaky/failing e2e |
19
+
20
+ Оркестрация: `/task`, `/task-continue`, `rules/tooling-and-review/agent-team-orchestrator.md`, артефакты `.claude/team/**`.
@@ -4,6 +4,10 @@
4
4
 
5
5
  | Файл | Назначение |
6
6
  |------|------------|
7
- | `technical-retro.md` | Фасилитация технического ретро (не дублируется в `rules/` экономия контекста) |
7
+ | `task.md` | Единая точка входа: router dynamic pipeline первый agent |
8
+ | `task-continue.md` | Продолжение после human gate / паузы по `pipeline.json` |
9
+ | `feature-start.md` | Legacy analyst-only старт без router |
10
+ | `feature-continue.md` | Legacy продолжение; для `pipeline.json` делегирует смысл `/task-continue` |
11
+ | `technical-retro.md` | Фасилитация технического ретро, включая блок «Работа агентов» |
8
12
 
9
- См. также корневой `README.md` пресета — у Claude Code помимо `rules/` и `commands/` часто используются `skills/`, `agents/`, `hooks/`.
13
+ См. также корневой `README.md` пресета — у Claude Code помимо `rules/` и `commands/` часто используются `skills/`, `agents/`, `hooks/`, `team/`.
@@ -3,3 +3,9 @@
3
3
  Событийные хуки автоматизации Claude Code — по документации продукта, если включены в репозитории.
4
4
 
5
5
  Папка копируется в `.claude/hooks/` при `ai-rules init claude --preset next`, если существует.
6
+
7
+ | Файл | Назначение |
8
+ |------|------------|
9
+ | `chain-team-phases.sh` | Optional chaining helper для agent team pipeline после завершения subagent |
10
+
11
+ Hook-скрипт сам по себе не включает автоматизацию: подключайте его в конфигурации Claude Code hooks целевого проекта, если хотите auto-chain. Без hook workflow продолжает родительский агент по `rules/tooling-and-review/agent-team-orchestrator.md`.
@@ -0,0 +1,123 @@
1
+ #!/usr/bin/env bash
2
+ # Chains agent team phases after subagent completion when wired into Claude Code hooks.
3
+ # Reads stdin JSON from a subagent-stop style hook; writes followup_message to stdout.
4
+
5
+ set -euo pipefail
6
+
7
+ input=$(cat)
8
+
9
+ INPUT="$input" node <<'NODE'
10
+ const fs = require('fs');
11
+ const path = require('path');
12
+
13
+ const inputRaw = process.env.INPUT || '';
14
+ let hookInput;
15
+ try {
16
+ hookInput = JSON.parse(inputRaw);
17
+ } catch {
18
+ process.stdout.write('{}');
19
+ process.exit(0);
20
+ }
21
+
22
+ if (hookInput.status !== 'completed') {
23
+ process.stdout.write('{}');
24
+ process.exit(0);
25
+ }
26
+
27
+ const teamRoot = path.join(process.cwd(), '.claude', 'team');
28
+ const activePath = path.join(teamRoot, 'active-task.json');
29
+
30
+ if (!fs.existsSync(activePath)) {
31
+ process.stdout.write('{}');
32
+ process.exit(0);
33
+ }
34
+
35
+ let active;
36
+ try {
37
+ active = JSON.parse(fs.readFileSync(activePath, 'utf8'));
38
+ } catch {
39
+ process.stdout.write('{}');
40
+ process.exit(0);
41
+ }
42
+
43
+ const slug = active.slug;
44
+ if (!slug) {
45
+ process.stdout.write('{}');
46
+ process.exit(0);
47
+ }
48
+
49
+ const statusPath = path.join(teamRoot, 'tasks', slug, 'status.json');
50
+ if (!fs.existsSync(statusPath)) {
51
+ process.stdout.write('{}');
52
+ process.exit(0);
53
+ }
54
+
55
+ let status;
56
+ try {
57
+ status = JSON.parse(fs.readFileSync(statusPath, 'utf8'));
58
+ } catch {
59
+ process.stdout.write('{}');
60
+ process.exit(0);
61
+ }
62
+
63
+ const now = new Date().toISOString();
64
+
65
+ function writeStatus(next) {
66
+ fs.writeFileSync(statusPath, JSON.stringify({ ...status, ...next, slug, updatedAt: now }, null, 2) + '\n');
67
+ }
68
+
69
+ function out(message) {
70
+ process.stdout.write(JSON.stringify({ followup_message: message }));
71
+ }
72
+
73
+ // Human gate: do not auto-chain during analysis or explicit approval waits.
74
+ if (status.phase === 'analysis' || status.state === 'awaiting_approval') {
75
+ process.stdout.write('{}');
76
+ process.exit(0);
77
+ }
78
+
79
+ // Legacy mode without pipeline.json.
80
+ if (status.phase === 'development' && status.state === 'completed') {
81
+ writeStatus({ phase: 'review', state: 'in_progress' });
82
+ out(
83
+ `Subagent development phase finished for slug "${slug}". ` +
84
+ `Invoke the code-reviewer subagent. ` +
85
+ `Read .claude/team/tasks/${slug}/brief.md and decomposition.md. ` +
86
+ `Review git diff against acceptance criteria per rules/tooling-and-review/code-review-mr.md. ` +
87
+ `Update status.json when done.`,
88
+ );
89
+ process.exit(0);
90
+ }
91
+
92
+ if (status.phase === 'review' && status.state === 'completed') {
93
+ writeStatus({ phase: 'testing', state: 'in_progress' });
94
+ out(
95
+ `Code review completed for slug "${slug}". ` +
96
+ `Invoke the qa-tester subagent. ` +
97
+ `Add or update unit and e2e tests per brief acceptance criteria. ` +
98
+ `Follow rules/testing/playwright-agents.md and rules/testing/tests-e2e-structure.md. ` +
99
+ `Update status.json when done.`,
100
+ );
101
+ process.exit(0);
102
+ }
103
+
104
+ if (status.phase === 'review' && status.state === 'changes_requested') {
105
+ out(
106
+ `Review requested changes for slug "${slug}". ` +
107
+ `Invoke feature-developer with the review fix list, then re-run code-reviewer.`,
108
+ );
109
+ process.exit(0);
110
+ }
111
+
112
+ if (status.phase === 'testing' && status.state === 'completed') {
113
+ writeStatus({ phase: 'done', state: 'completed' });
114
+ out(
115
+ `QA phase completed for slug "${slug}". ` +
116
+ `Suggest running /technical-retro with this slug. ` +
117
+ `Read team artifacts under .claude/team/tasks/${slug}/ and git diff for the retro.`,
118
+ );
119
+ process.exit(0);
120
+ }
121
+
122
+ process.stdout.write('{}');
123
+ NODE
@@ -17,13 +17,15 @@ On-demand сценарии вне постоянного контекста —
17
17
 
18
18
  ## С чего начать новую фичу
19
19
 
20
- **`architecture/feature-delivery-workflow.md`** сквозной чеклист и матрица «зона репозитория правило».
20
+ Для обычной задачи — **`commands/task.md`**: router `pipeline.json` нужные agents. Для ручной реализации без team workflow — **`architecture/feature-delivery-workflow.md`**.
21
21
 
22
22
  ## Каталог правил
23
23
 
24
24
  | Файл | Назначение |
25
25
  |------|------------|
26
26
  | `tooling-and-review/package-manager.md` | Менеджер пакетов перед install/run |
27
+ | `tooling-and-review/agent-team-intake.md` | Когда использовать `/task` и task-router |
28
+ | `tooling-and-review/agent-team-orchestrator.md` | Dynamic pipeline, subagents, gates, handoff artifacts |
27
29
  | `architecture/feature-delivery-workflow.md` | Сквозной порядок работ по фиче, mermaid, матрица слой → правило |
28
30
  | `stack/next-app-core.md` | Стек, слои, порты‑адаптеры, работа агента |
29
31
  | `tooling-and-review/post-change-lint.md` | **Обязательный** ESLint + Stylelint после изменений |
@@ -5,6 +5,8 @@ Lint, package manager, качество кода, code review MR.
5
5
  | Файл | Содержание |
6
6
  |------|------------|
7
7
  | `package-manager.md` | yarn / pnpm / npm / bun — определить по lockfile |
8
+ | `agent-team-intake.md` | Когда предлагать `/task` и router pipeline |
9
+ | `agent-team-orchestrator.md` | Dynamic agent team workflow: router, pipeline, gates |
8
10
  | `post-change-lint.md` | Обязательный `lint:js` + `lint:css` после изменений |
9
11
  | `code-quality.md` | Boy scout rule, рефакторинг, ESLint |
10
12
  | `code-review-mr.md` | Чеклист ревью merge request |