@bonesofspring/ai-rules 0.1.37 → 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.
Files changed (90) hide show
  1. package/README.md +7 -3
  2. package/bin/cli.js +56 -31
  3. package/package.json +3 -3
  4. package/presets/claude/next/CLAUDE.md +25 -5
  5. package/presets/claude/next/README.md +10 -0
  6. package/presets/claude/next/agents/README.md +15 -0
  7. package/presets/claude/next/agents/code-reviewer.md +56 -0
  8. package/presets/claude/next/agents/debugger.md +58 -0
  9. package/presets/claude/next/agents/feature-developer.md +45 -0
  10. package/presets/claude/next/agents/qa-tester.md +54 -0
  11. package/presets/claude/next/agents/solution-architect.md +70 -0
  12. package/presets/claude/next/agents/task-analyst.md +105 -0
  13. package/presets/claude/next/agents/task-router.md +105 -0
  14. package/presets/claude/next/commands/README.md +10 -2
  15. package/presets/claude/next/commands/feature-continue.md +46 -0
  16. package/presets/claude/next/commands/feature-start.md +25 -0
  17. package/presets/claude/next/commands/task-continue.md +43 -0
  18. package/presets/claude/next/commands/task.md +40 -0
  19. package/presets/claude/next/commands/technical-retro.md +53 -0
  20. package/presets/claude/next/hooks/README.md +6 -0
  21. package/presets/claude/next/hooks/chain-team-phases.sh +123 -0
  22. package/presets/claude/next/rules/README.md +49 -11
  23. package/presets/claude/next/rules/api-and-data/README.md +7 -1
  24. package/presets/claude/next/rules/api-and-data/api-services.md +57 -0
  25. package/presets/claude/next/rules/api-and-data/http-client.md +40 -0
  26. package/presets/claude/next/rules/api-and-data/store-rtk.md +65 -0
  27. package/presets/claude/next/rules/architecture/README.md +11 -1
  28. package/presets/claude/next/rules/architecture/api-public-imports.md +25 -0
  29. package/presets/claude/next/rules/architecture/architecture-boundaries.md +67 -0
  30. package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +99 -0
  31. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +53 -0
  32. package/presets/claude/next/rules/architecture/types-public-imports.md +28 -0
  33. package/presets/claude/next/rules/stack/README.md +9 -1
  34. package/presets/claude/next/rules/stack/arrow-functions.md +40 -0
  35. package/presets/claude/next/rules/stack/navigation-router.md +56 -0
  36. package/presets/claude/next/rules/stack/next-app-core.md +83 -0
  37. package/presets/claude/next/rules/stack/no-type-assertion.md +52 -0
  38. package/presets/claude/next/rules/stack/types-jsdoc.md +37 -0
  39. package/presets/claude/next/rules/testing/README.md +9 -1
  40. package/presets/claude/next/rules/testing/playwright-agents.md +69 -0
  41. package/presets/claude/next/rules/testing/tests-e2e-structure.md +52 -0
  42. package/presets/claude/next/rules/testing/tests-unit.md +66 -0
  43. package/presets/claude/next/rules/tooling-and-review/README.md +14 -1
  44. package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +9 -0
  45. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +97 -0
  46. package/presets/claude/next/rules/tooling-and-review/code-quality.md +50 -0
  47. package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +67 -0
  48. package/presets/claude/next/rules/tooling-and-review/package-manager.md +20 -0
  49. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +43 -0
  50. package/presets/claude/next/rules/ui-and-accessibility/README.md +8 -1
  51. package/presets/claude/next/rules/ui-and-accessibility/component-styles.md +50 -0
  52. package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +20 -0
  53. package/presets/claude/next/rules/ui-and-accessibility/no-props-spread.md +52 -0
  54. package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +90 -0
  55. package/presets/claude/next/team/README.md +64 -0
  56. package/presets/claude/next/team/tasks/.gitkeep +1 -0
  57. package/presets/cursor/next/agents/README.md +25 -0
  58. package/presets/cursor/next/agents/code-reviewer.md +57 -0
  59. package/presets/cursor/next/agents/debugger.md +59 -0
  60. package/presets/cursor/next/agents/feature-developer.md +46 -0
  61. package/presets/cursor/next/agents/qa-tester.md +55 -0
  62. package/presets/cursor/next/agents/solution-architect.md +71 -0
  63. package/presets/cursor/next/agents/task-analyst.md +111 -0
  64. package/presets/cursor/next/agents/task-router.md +106 -0
  65. package/presets/cursor/next/commands/README.md +33 -1
  66. package/presets/cursor/next/commands/feature-continue.md +14 -0
  67. package/presets/cursor/next/commands/feature-start.md +28 -0
  68. package/presets/cursor/next/commands/task-continue.md +43 -0
  69. package/presets/cursor/next/commands/task.md +40 -0
  70. package/presets/cursor/next/commands/technical-retro.md +76 -0
  71. package/presets/cursor/next/hooks/chain-team-phases.sh +216 -0
  72. package/presets/cursor/next/hooks.json +11 -0
  73. package/presets/cursor/next/rules/README.md +10 -3
  74. package/presets/cursor/next/rules/agent-team-intake.mdc +14 -0
  75. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +102 -0
  76. package/presets/cursor/next/rules/api-public-imports.mdc +1 -0
  77. package/presets/cursor/next/rules/api-services.mdc +1 -0
  78. package/presets/cursor/next/rules/architecture-boundaries.mdc +1 -1
  79. package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +5 -2
  80. package/presets/cursor/next/rules/code-review-mr.mdc +6 -7
  81. package/presets/cursor/next/rules/feature-delivery-workflow.mdc +5 -5
  82. package/presets/cursor/next/rules/layer-barrel-exports.mdc +58 -0
  83. package/presets/cursor/next/rules/next-app-core.mdc +1 -1
  84. package/presets/cursor/next/rules/package-manager.mdc +25 -0
  85. package/presets/cursor/next/rules/post-change-lint.mdc +48 -0
  86. package/presets/cursor/next/rules/react-ui.mdc +10 -0
  87. package/presets/cursor/next/rules/technical-retro.mdc +5 -51
  88. package/presets/cursor/next/rules/types-public-imports.mdc +1 -0
  89. package/presets/cursor/next/team/README.md +106 -0
  90. package/presets/cursor/next/team/tasks/.gitkeep +0 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @bonesofspring/ai-rules
2
2
 
3
- Presets for Cursor and Claude Code: rules, commands, plus for Claude `CLAUDE.md` and `skills` / `agents` / `hooks` when the preset includes them. Install from npm into a project so you don’t have to copy files out of the repo by hand.
3
+ Presets for Cursor and Claude Code: rules, commands, plus optional `agents`, `hooks`, `skills`, and team artifacts when the preset includes them. For Claude: `CLAUDE.md`. Install from npm into a project so you don’t have to copy files out of the repo by hand.
4
4
 
5
5
  Node 18+.
6
6
 
@@ -15,7 +15,7 @@ Global: `npm i -g @bonesofspring/ai-rules`, then `ai-rules ...`.
15
15
 
16
16
  `init` merges into the current directory: dirs are created, matching files are **overwritten**. `--preset` and the subcommand can be in either order, e.g. `--preset=next init cursor`.
17
17
 
18
- `clean cursor` / `clean claude` removes what this CLI installs: for Cursor, the entire `.cursor` directory; for Claude, `.claude/rules`, `.claude/commands`, `skills`, `agents`, `hooks`, and `CLAUDE.md` when present. Anything else under `.claude` is left alone.
18
+ `clean cursor` / `clean claude` removes what this CLI installs: `rules`, `commands`, optional `agents`, `hooks`, `skills`, `team`, Cursor `hooks.json`, and Claude `CLAUDE.md` when present. Other files under `.cursor/` or `.claude/` are left intact.
19
19
 
20
20
  Where things go on `init`:
21
21
 
@@ -23,7 +23,11 @@ Where things go on `init`:
23
23
  |---|--------|--------|
24
24
  | rules | `.cursor/rules` | `.claude/rules` |
25
25
  | commands | `.cursor/commands` | `.claude/commands` |
26
- | other | | root `CLAUDE.md` → `.claude/CLAUDE.md`; folders `skills`, `agents`, `hooks` → under `.claude/` with the same names |
26
+ | agents | `.cursor/agents` | `.claude/agents` |
27
+ | hooks | `.cursor/hooks`, `.cursor/hooks.json` | `.claude/hooks` |
28
+ | skills | `.cursor/skills` | `.claude/skills` |
29
+ | team artifacts template | `.cursor/team` | `.claude/team` |
30
+ | other | — | root `CLAUDE.md` → `.claude/CLAUDE.md` |
27
31
 
28
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 `..`.
29
33
 
package/bin/cli.js CHANGED
@@ -15,13 +15,17 @@ const PRESETS = {
15
15
  rulesDir: '.cursor/rules',
16
16
  commandsDir: '.cursor/commands',
17
17
  relBase: ['presets', 'cursor'],
18
+ /** Optional dirs under preset root → under `.cursor/` (recursive copy). */
19
+ optionalCursorDirs: ['agents', 'hooks', 'skills', 'team'],
20
+ /** Copied from preset root to `.cursor/hooks.json` when present. */
21
+ hooksJsonSrc: 'hooks.json',
18
22
  },
19
23
  claude: {
20
24
  rulesDir: '.claude/rules',
21
25
  commandsDir: '.claude/commands',
22
26
  relBase: ['presets', 'claude'],
23
27
  /** Optional dirs under preset root → under `.claude/` (recursive copy). */
24
- optionalClaudeDirs: ['skills', 'agents', 'hooks'],
28
+ optionalClaudeDirs: ['skills', 'agents', 'hooks', 'team'],
25
29
  /** Copied from preset root to `.claude/CLAUDE.md` when present. */
26
30
  claudeMdSrc: 'CLAUDE.md',
27
31
  },
@@ -36,7 +40,9 @@ Usage:
36
40
 
37
41
  Notes:
38
42
  init merges into existing target folders; same-named files are overwritten.
39
- clean cursor removes the entire .cursor directory (if present).
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.
45
+ clean removes only paths installed by this CLI; other tool files are left intact.
40
46
  Flags may appear before or after the subcommand (e.g. --preset next init cursor).
41
47
 
42
48
  Examples:
@@ -116,10 +122,17 @@ function copyDir(src, dest) {
116
122
  copyDir(from, to);
117
123
  } else {
118
124
  fs.copyFileSync(from, to);
125
+ if (e.name.endsWith('.sh')) {
126
+ fs.chmodSync(to, 0o755);
127
+ }
119
128
  }
120
129
  }
121
130
  }
122
131
 
132
+ function getOptionalDirs(cfg) {
133
+ return cfg.optionalCursorDirs || cfg.optionalClaudeDirs || [];
134
+ }
135
+
123
136
  function removeDirIfExists(dir) {
124
137
  if (fs.existsSync(dir)) {
125
138
  fs.rmSync(dir, { recursive: true, force: true });
@@ -138,16 +151,17 @@ function presetHasAnySource(base, cfg) {
138
151
  if (fs.existsSync(rulesSrc) || fs.existsSync(commandsSrc)) {
139
152
  return true;
140
153
  }
141
- if (cfg.optionalClaudeDirs) {
142
- for (const name of cfg.optionalClaudeDirs) {
143
- if (fs.existsSync(path.join(base, name))) {
144
- return true;
145
- }
154
+ for (const name of getOptionalDirs(cfg)) {
155
+ if (fs.existsSync(path.join(base, name))) {
156
+ return true;
146
157
  }
147
158
  }
148
159
  if (cfg.claudeMdSrc && fs.existsSync(path.join(base, cfg.claudeMdSrc))) {
149
160
  return true;
150
161
  }
162
+ if (cfg.hooksJsonSrc && fs.existsSync(path.join(base, cfg.hooksJsonSrc))) {
163
+ return true;
164
+ }
151
165
  return false;
152
166
  }
153
167
 
@@ -195,13 +209,21 @@ function cmdInit(tool, preset) {
195
209
  console.log(`Copied commands → ${cfg.commandsDir}`);
196
210
  }
197
211
 
198
- if (tool === 'claude' && cfg.optionalClaudeDirs) {
199
- for (const name of cfg.optionalClaudeDirs) {
200
- const src = path.join(base, name);
201
- if (fs.existsSync(src)) {
202
- copyDir(src, path.join(cwd, '.claude', name));
203
- console.log(`Copied ${name}/ → .claude/${name}/`);
204
- }
212
+ const toolRoot = tool === 'cursor' ? '.cursor' : '.claude';
213
+ for (const name of getOptionalDirs(cfg)) {
214
+ const src = path.join(base, name);
215
+ if (fs.existsSync(src)) {
216
+ copyDir(src, path.join(cwd, toolRoot, name));
217
+ console.log(`Copied ${name}/ → ${toolRoot}/${name}/`);
218
+ }
219
+ }
220
+
221
+ if (tool === 'cursor' && cfg.hooksJsonSrc) {
222
+ const hooksFrom = path.join(base, cfg.hooksJsonSrc);
223
+ if (fs.existsSync(hooksFrom)) {
224
+ fs.mkdirSync(path.join(cwd, '.cursor'), { recursive: true });
225
+ fs.copyFileSync(hooksFrom, path.join(cwd, '.cursor', 'hooks.json'));
226
+ console.log('Copied hooks.json → .cursor/hooks.json');
205
227
  }
206
228
  }
207
229
  } catch (err) {
@@ -218,26 +240,29 @@ function cmdClean(tool) {
218
240
  process.exit(1);
219
241
  }
220
242
  const cwd = process.cwd();
221
- if (tool === 'cursor') {
222
- removeDirIfExists(path.join(cwd, '.cursor'));
223
- console.log('Removed .cursor (if present)');
224
- return;
225
- }
243
+ const toolRoot = tool === 'cursor' ? '.cursor' : '.claude';
244
+ const removedParts = [cfg.rulesDir, cfg.commandsDir];
245
+
226
246
  removeDirIfExists(path.join(cwd, cfg.rulesDir));
227
247
  removeDirIfExists(path.join(cwd, cfg.commandsDir));
228
- if (tool === 'claude' && cfg.optionalClaudeDirs) {
229
- for (const name of cfg.optionalClaudeDirs) {
230
- removeDirIfExists(path.join(cwd, '.claude', name));
231
- }
232
- removeFileIfExists(path.join(cwd, '.claude', 'CLAUDE.md'));
248
+
249
+ const optionalDirs = getOptionalDirs(cfg);
250
+ for (const name of optionalDirs) {
251
+ removeDirIfExists(path.join(cwd, toolRoot, name));
252
+ removedParts.push(`${toolRoot}/${name}`);
233
253
  }
234
- console.log(
235
- `Removed ${cfg.rulesDir} and ${cfg.commandsDir}` +
236
- (tool === 'claude' && cfg.optionalClaudeDirs
237
- ? `, optional .claude/{${cfg.optionalClaudeDirs.join(',')}}, and .claude/CLAUDE.md`
238
- : '') +
239
- ' (if present)',
240
- );
254
+
255
+ if (cfg.claudeMdSrc) {
256
+ removeFileIfExists(path.join(cwd, toolRoot, 'CLAUDE.md'));
257
+ removedParts.push(`${toolRoot}/CLAUDE.md`);
258
+ }
259
+
260
+ if (cfg.hooksJsonSrc) {
261
+ removeFileIfExists(path.join(cwd, toolRoot, 'hooks.json'));
262
+ removedParts.push(`${toolRoot}/hooks.json`);
263
+ }
264
+
265
+ console.log(`Removed ${removedParts.join(', ')} (if present)`);
241
266
  }
242
267
 
243
268
  function main() {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.1.37",
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",
@@ -1,11 +1,31 @@
1
1
  # Next.js stack — project instructions
2
2
 
3
- Краткая точка входа для Claude Code. Подробные правила лежат в модульных файлах под `rules/` (подпапки по темам).
3
+ Краткая точка входа для Claude Code. Подробные правила модульные файлы под `rules/` (подпапки по темам).
4
4
 
5
- See @rules/README.md for how this preset splits instructions.
5
+ See @rules/README.md for the full catalog and loading strategy.
6
6
 
7
7
  ## Conventions
8
8
 
9
- - Держите **одну тему на файл**; для больших областей — подпапки в `rules/<topic>/`.
10
- - Скоуп по путям проектачерез frontmatter `paths:` в отдельных `.md` (см. официальные docs по path-specific rules).
11
- - Slash-командыв `commands/`; переиспользуемые сценарии в `skills/`.
9
+ - **Одна тема на файл**; для больших областей — подпапки в `rules/<topic>/`.
10
+ - **Глобальные правила** (стиль, архитектура, lint, workflow) без frontmatter `paths:` (загружаются при старте сессии).
11
+ - **Domain-specific правила** YAML frontmatter `paths:` с glob-паттернами (подгружаются при работе с matching-файлами).
12
+ - Slash-команды — в `commands/`; переиспользуемые сценарии — в `skills/`; subagents — в `agents/`.
13
+
14
+ ## Quick start
15
+
16
+ | Задача | Куда смотреть |
17
+ |--------|----------------|
18
+ | Любая новая work-задача | `commands/task.md` + `rules/tooling-and-review/agent-team-orchestrator.md` |
19
+ | Новая фича end-to-end | `rules/architecture/feature-delivery-workflow.md` |
20
+ | Стек и слои | `rules/stack/next-app-core.md` |
21
+ | После любых правок кода | `rules/tooling-and-review/post-change-lint.md` |
22
+ | Code review MR | `rules/tooling-and-review/code-review-mr.md` |
23
+ | Техническое ретро | `commands/technical-retro.md` |
24
+
25
+ ## Install
26
+
27
+ ```bash
28
+ npx @bonesofspring/ai-rules init claude --preset next
29
+ ```
30
+
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/**`.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: code-reviewer
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
5
+ ---
6
+
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
+
9
+ ## Inputs
10
+
11
+ 1. `.claude/team/tasks/<slug>/brief.md` — verify implementation matches acceptance criteria.
12
+ 2. `.claude/team/tasks/<slug>/decomposition.md` — check coverage of planned tasks.
13
+ 3. Git diff for changed files (`git diff`, `git status`).
14
+
15
+ Apply the checklist from **`rules/tooling-and-review/code-review-mr.md`**: architecture, imports (`@/types`, `@/api`), types, UI patterns, tests, HTTP client usage.
16
+
17
+ ## Review artifact
18
+
19
+ Write `.claude/team/tasks/<slug>/review.md` with this format:
20
+
21
+ ```markdown
22
+ # Code review: <slug>
23
+
24
+ ## Verdict
25
+ APPROVE | APPROVE_WITH_NOTES | REQUEST_CHANGES
26
+
27
+ ## Critical (must fix)
28
+ - ...
29
+
30
+ ## Warnings (should fix)
31
+ - ...
32
+
33
+ ## Suggestions (nice to have)
34
+ - ...
35
+
36
+ ## AC coverage
37
+ | Criterion | Status | Notes |
38
+ |-----------|--------|-------|
39
+ ```
40
+
41
+ ## On completion
42
+
43
+ Update `status.json`:
44
+
45
+ ```json
46
+ {
47
+ "slug": "<slug>",
48
+ "currentAgent": "code-reviewer",
49
+ "state": "completed",
50
+ "updatedAt": "<ISO8601>"
51
+ }
52
+ ```
53
+
54
+ If **REQUEST_CHANGES**, list specific fixes and set `"state": "changes_requested"` instead of `"completed"`.
55
+
56
+ Do not mix this output with retrospective facilitation — keep review and retro separate.
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: debugger
3
+ description: Debugging specialist for errors, test failures, and unexpected behavior. Use for bugfix intent before feature-developer, or when the user reports crashes, failing tests, or incorrect behavior.
4
+ model: inherit
5
+ ---
6
+
7
+ You are an expert debugger for a Next.js TypeScript frontend.
8
+
9
+ ## Inputs
10
+
11
+ 1. `.claude/team/tasks/<slug>/brief.md` if present; else the user task description.
12
+ 2. `.claude/team/tasks/<slug>/pipeline.json` for context.
13
+ 3. Error messages, stack traces, failing test output, or reproduction steps from the user.
14
+
15
+ ## Process
16
+
17
+ 1. Capture error message, stack trace, and reproduction steps.
18
+ 2. Inspect relevant code — do not guess.
19
+ 3. Form hypothesis; verify with minimal checks.
20
+ 4. Document root cause in `.claude/team/tasks/<slug>/debug-report.md`:
21
+
22
+ ```markdown
23
+ # Debug report: <slug>
24
+
25
+ ## Symptoms
26
+ ...
27
+
28
+ ## Root cause
29
+ ...
30
+
31
+ ## Evidence
32
+ ...
33
+
34
+ ## Recommended fix
35
+ ...
36
+
37
+ ## Files to change
38
+ - path/to/file.ts — ...
39
+ ```
40
+
41
+ 5. If fix is trivial and clearly scoped, you **may** apply the minimal fix. Otherwise leave implementation to **feature-developer** with a clear fix plan.
42
+
43
+ ## On completion
44
+
45
+ Update `status.json`:
46
+
47
+ ```json
48
+ {
49
+ "slug": "<slug>",
50
+ "currentAgent": "debugger",
51
+ "state": "completed",
52
+ "updatedAt": "<ISO8601>"
53
+ }
54
+ ```
55
+
56
+ Handoff summary: root cause, recommended fix, files touched (if any).
57
+
58
+ Do not perform formal code review or write e2e plans — those are separate agents.
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: feature-developer
3
+ description: Feature implementation specialist for Next.js stack. Implements tasks from decomposition.md following feature-delivery-workflow. Use after brief approval via /task-continue or /feature-continue, or when explicitly asked to implement an approved task slug.
4
+ model: inherit
5
+ ---
6
+
7
+ You are a senior frontend developer working in a Next.js monorepo with strict layer boundaries.
8
+
9
+ ## Before coding
10
+
11
+ 1. Read `.claude/team/tasks/<slug>/brief.md` and `decomposition.md`.
12
+ 2. Read `.claude/team/tasks/<slug>/status.json` — proceed only if `state` is `approved` or `in_progress` and implementation is the current pipeline step.
13
+ 3. Follow **`rules/architecture/feature-delivery-workflow.md`** for layer order and the matrix «zone → rule file».
14
+ 4. Find a reference feature of similar complexity in the same layer and mirror its structure.
15
+
16
+ ## Task execution rules
17
+
18
+ - Do **not** start a task marked blocked or whose dependencies are incomplete.
19
+ - Work tasks in dependency order (types → api → mocks → store → ui → unit → e2e), unless `pipeline.json` scopes a narrower task.
20
+ - Mark completed tasks in `decomposition.md` with `[x]` or a **Done** column update.
21
+ - After all code changes run **`rules/tooling-and-review/post-change-lint.md`**: `lint:js`, `lint:css`, `type-check` from `app/`.
22
+
23
+ ## On completion
24
+
25
+ Update `status.json`:
26
+
27
+ ```json
28
+ {
29
+ "slug": "<slug>",
30
+ "currentAgent": "feature-developer",
31
+ "state": "completed",
32
+ "updatedAt": "<ISO8601>"
33
+ }
34
+ ```
35
+
36
+ For legacy tasks without `pipeline.json`, keep `"phase": "development"`.
37
+
38
+ Provide a short handoff summary:
39
+
40
+ - Tasks completed vs remaining
41
+ - Files changed (by layer)
42
+ - Lint/type-check result
43
+ - Known gaps or follow-ups for reviewer
44
+
45
+ Do not perform formal code review — that is the code-reviewer subagent's job.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: qa-tester
3
+ description: QA and test specialist. Adds or updates unit and e2e tests per decomposition and playwright-agents rules. Use after code review completes for a team task slug.
4
+ model: inherit
5
+ ---
6
+
7
+ You are a QA engineer for a Next.js frontend with Jest/Vitest unit tests and Playwright e2e, depending on the target repository.
8
+
9
+ ## Inputs
10
+
11
+ 1. `.claude/team/tasks/<slug>/brief.md` — acceptance criteria drive test scenarios.
12
+ 2. `.claude/team/tasks/<slug>/decomposition.md` — test-related tasks (unit, e2e).
13
+ 3. Reviewer notes if `changes_requested` was resolved.
14
+
15
+ ## Test strategy
16
+
17
+ ### Unit tests
18
+
19
+ Follow **`rules/testing/tests-unit.md`**. Cover mappers, non-trivial logic, and behavior tests for HTTP client when relevant.
20
+
21
+ ### E2E tests
22
+
23
+ Follow **`rules/testing/playwright-agents.md`** and **`rules/testing/tests-e2e-structure.md`**:
24
+
25
+ - Plans: `app/__tests__/e2e/<Area>/*.cases.md`
26
+ - Specs: `*.spec.ts` in the same folder
27
+ - Use existing page objects and `_shared/` helpers
28
+
29
+ When planning e2e, act as **Planner**; when generating specs, act as **Generator**.
30
+
31
+ ## Execution
32
+
33
+ - Run relevant unit tests for changed modules.
34
+ - Run affected e2e specs if feasible; report failures clearly.
35
+
36
+ ## On completion
37
+
38
+ Update `status.json`:
39
+
40
+ ```json
41
+ {
42
+ "slug": "<slug>",
43
+ "currentAgent": "qa-tester",
44
+ "state": "completed",
45
+ "updatedAt": "<ISO8601>"
46
+ }
47
+ ```
48
+
49
+ Provide summary:
50
+
51
+ - Tests added/updated (paths)
52
+ - Test run results
53
+ - Gaps vs acceptance criteria
54
+ - Suggest `/technical-retro` with the slug when done
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: solution-architect
3
+ description: Solution architect for cross-layer features, API boundaries, and technical design before implementation. Use for spike intent or when router adds architect step for complex features. Writes design docs only; never writes production code.
4
+ model: inherit
5
+ ---
6
+
7
+ You are a solution architect for a Next.js frontend with strict layer boundaries (types, api, store, ui).
8
+
9
+ ## Inputs
10
+
11
+ 1. `.claude/team/tasks/<slug>/brief.md` and `decomposition.md` (from analyst).
12
+ 2. `.claude/team/tasks/<slug>/pipeline.json`.
13
+ 3. Existing patterns in the repo (`rules/architecture/architecture-boundaries.md`, `rules/architecture/feature-delivery-workflow.md`).
14
+
15
+ ## Deliverable
16
+
17
+ Write `.claude/team/tasks/<slug>/architecture.md`:
18
+
19
+ ```markdown
20
+ # Architecture: <slug>
21
+
22
+ ## Context
23
+ ...
24
+
25
+ ## Proposed design
26
+ ### Types (@/types)
27
+ ...
28
+
29
+ ### API layer (@/api)
30
+ ...
31
+
32
+ ### Store (RTK)
33
+ ...
34
+
35
+ ### UI
36
+ ...
37
+
38
+ ## Data flow
39
+ (mermaid or bullet flow)
40
+
41
+ ## Risks and alternatives
42
+ ...
43
+
44
+ ## Open decisions
45
+ - ...
46
+ ```
47
+
48
+ ## Rules
49
+
50
+ - Align with existing layer boundaries — no DTO in UI, no HTTP from components.
51
+ - Reference concrete paths in the repo (similar features as templates).
52
+ - Flag when decomposition should change — list suggested updates for analyst/developer.
53
+ - Do **not** write production code or tests.
54
+
55
+ ## On completion
56
+
57
+ Update `status.json`:
58
+
59
+ ```json
60
+ {
61
+ "slug": "<slug>",
62
+ "currentAgent": "solution-architect",
63
+ "state": "completed",
64
+ "updatedAt": "<ISO8601>"
65
+ }
66
+ ```
67
+
68
+ For `spike` intent with human gate after architect: set `"state": "awaiting_approval"` if design needs user sign-off.
69
+
70
+ Handoff: summary of design decisions and recommended next steps for developer.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: task-analyst
3
+ description: Task analysis specialist. Clarifies requirements, validates acceptance criteria, and decomposes work into concrete tasks. Use for /feature-start, task intake, or when the user asks to analyze or decompose a feature before coding. Writes only team artifacts; never writes production code.
4
+ model: inherit
5
+ ---
6
+
7
+ You are a senior business/technical analyst for a Next.js frontend team.
8
+
9
+ Your job is to reach **Definition of Ready (DoR)** before any implementation starts. You may write only `.claude/team/**` artifacts. You do **not** write production code or modify application source files.
10
+
11
+ ## Clarification cycle (mandatory)
12
+
13
+ 1. Rephrase the task in your own words (goal, user value, boundaries).
14
+ 2. Ask **1–3 questions per iteration** — never more than 3 at once.
15
+ 3. List explicit **assumptions** when information is missing.
16
+ 4. Do **not** decompose until acceptance criteria are **testable and unambiguous**.
17
+ 5. If critical unknowns remain, mark them in `open_questions` and ask the user before finalizing.
18
+ 6. Repeat until DoR is met or the user explicitly accepts remaining risks.
19
+
20
+ ## Definition of Ready checklist
21
+
22
+ Before writing artifacts, confirm:
23
+
24
+ - [ ] Goal and **out-of-scope** are stated
25
+ - [ ] **Acceptance criteria** are verifiable (Given/When/Then or checklist)
26
+ - [ ] **Risks and dependencies** are listed
27
+ - [ ] **Decomposition** covers all layers touched (types, api, store, ui, tests)
28
+ - [ ] Each task has layer, dependencies, and "done when"
29
+
30
+ ## Artifacts (required output)
31
+
32
+ Create or update files under `.claude/team/tasks/<slug>/`:
33
+
34
+ ### `brief.md`
35
+
36
+ ```markdown
37
+ # Brief: <title>
38
+
39
+ ## Slug
40
+ <slug>
41
+
42
+ ## Goal
43
+ ...
44
+
45
+ ## Out of scope
46
+ ...
47
+
48
+ ## Acceptance criteria
49
+ - [ ] ...
50
+
51
+ ## Assumptions
52
+ - ...
53
+
54
+ ## Risks and dependencies
55
+ - ...
56
+
57
+ ## Open questions
58
+ - ...
59
+ ```
60
+
61
+ ### `decomposition.md`
62
+
63
+ ```markdown
64
+ # Decomposition: <slug>
65
+
66
+ ## Tasks
67
+
68
+ | ID | Layer | Description | Depends on | Done when |
69
+ |----|-------|-------------|------------|-----------|
70
+ | T1 | types | ... | — | ... |
71
+
72
+ ## Suggested rule references
73
+ - `rules/architecture/feature-delivery-workflow.md` for layer order
74
+ ```
75
+
76
+ ### `status.json`
77
+
78
+ ```json
79
+ {
80
+ "slug": "<slug>",
81
+ "phase": "analysis",
82
+ "state": "awaiting_approval",
83
+ "updatedAt": "<ISO8601>"
84
+ }
85
+ ```
86
+
87
+ Also write `.claude/team/active-task.json`:
88
+
89
+ ```json
90
+ { "slug": "<slug>" }
91
+ ```
92
+
93
+ ## Slug naming
94
+
95
+ Use kebab-case from the task title (e.g. `order-history-date-filter`). Max 48 chars.
96
+
97
+ ## Handoff
98
+
99
+ When DoR is reached and artifacts are saved:
100
+
101
+ 1. Set `status.json` → `"phase": "analysis"`, `"state": "awaiting_approval"`.
102
+ 2. Summarize brief and task count for the user.
103
+ 3. **Stop** and ask the user to review artifacts. Tell them to run `/task-continue <slug>` or `/feature-continue <slug>` after approval or reply with corrections.
104
+
105
+ Do not invoke the developer or any implementation subagent.