@bonesofspring/ai-rules 0.2.7 → 0.2.8
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 +18 -1
- package/README.md +4 -2
- package/bin/cli.js +2 -0
- package/package.json +1 -1
- package/presets/_shared/README.md +1 -1
- package/presets/_shared/core/meta/preset-layering.md +1 -1
- package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +6 -4
- package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
- package/presets/_shared/core/meta/preset-twin-sync.md +2 -0
- package/presets/claude/go/agents/build-verifier.md +5 -5
- package/presets/claude/go/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +6 -8
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/go/team/fixtures/feature-full.json +5 -23
- package/presets/claude/ios-swift/agents/build-verifier.md +6 -7
- package/presets/claude/ios-swift/rules/stack/ios-app-core.md +5 -28
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +6 -4
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/java/CLAUDE.md +29 -0
- package/presets/claude/java/MCP.md +13 -0
- package/presets/claude/java/README.md +26 -0
- package/presets/claude/java/REPO_AGENTS.md +45 -0
- package/presets/claude/java/agents/README.md +32 -0
- package/presets/claude/java/agents/api-contract-reviewer.md +23 -0
- package/presets/claude/java/agents/build-verifier.md +45 -0
- package/presets/claude/java/agents/ci-investigator.md +17 -0
- package/presets/claude/java/agents/code-reviewer.md +40 -0
- package/presets/claude/java/agents/codebase-analyzer.md +28 -0
- package/presets/claude/java/agents/debugger.md +25 -0
- package/presets/claude/java/agents/feature-developer.md +43 -0
- package/presets/claude/java/agents/integration-test-generator.md +22 -0
- package/presets/claude/java/agents/integration-test-healer.md +22 -0
- package/presets/claude/java/agents/integration-test-planner.md +22 -0
- package/presets/claude/java/agents/migration-specialist.md +31 -0
- package/presets/claude/java/agents/performance-auditor.md +22 -0
- package/presets/claude/java/agents/qa-tester.md +24 -0
- package/presets/claude/java/agents/security-reviewer.md +20 -0
- package/presets/claude/java/agents/solution-architect.md +28 -0
- package/presets/claude/java/agents/task-analyst.md +25 -0
- package/presets/claude/java/agents/task-router.md +69 -0
- package/presets/claude/java/agents/tech-writer.md +15 -0
- package/presets/claude/java/agents/unit-test-generator.md +21 -0
- package/presets/claude/java/agents/unit-test-healer.md +13 -0
- package/presets/claude/java/agents/unit-test-planner.md +26 -0
- package/presets/claude/java/commands/README.md +13 -0
- package/presets/claude/java/commands/feature-continue.md +51 -0
- package/presets/claude/java/commands/feature-start.md +30 -0
- package/presets/claude/java/commands/task-continue.md +49 -0
- package/presets/claude/java/commands/task.md +49 -0
- package/presets/claude/java/commands/technical-retro.md +58 -0
- package/presets/claude/java/hooks/README.md +16 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +381 -0
- package/presets/claude/java/hooks/examples/README.md +18 -0
- package/presets/claude/java/hooks/examples/format-edited.example.sh +11 -0
- package/presets/claude/java/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/java/hooks/examples/test-on-save.example.sh +18 -0
- package/presets/claude/java/hooks/guard-shell-command.sh +80 -0
- package/presets/claude/java/mcp.json +11 -0
- package/presets/claude/java/rules/README.md +60 -0
- package/presets/claude/java/rules/api-and-data/README.md +14 -0
- package/presets/claude/java/rules/api-and-data/adapters-driven.md +38 -0
- package/presets/claude/java/rules/api-and-data/adapters-driving.md +38 -0
- package/presets/claude/java/rules/api-and-data/api-grpc.md +29 -0
- package/presets/claude/java/rules/api-and-data/api-http.md +36 -0
- package/presets/claude/java/rules/api-and-data/messaging-adapters.md +24 -0
- package/presets/claude/java/rules/api-and-data/persistence-adapters.md +33 -0
- package/presets/claude/java/rules/architecture/README.md +16 -0
- package/presets/claude/java/rules/architecture/application-usecases.md +32 -0
- package/presets/claude/java/rules/architecture/boundaries.md +29 -0
- package/presets/claude/java/rules/architecture/composition-root.md +31 -0
- package/presets/claude/java/rules/architecture/domain-layer.md +38 -0
- package/presets/claude/java/rules/architecture/feature-delivery.md +52 -0
- package/presets/claude/java/rules/architecture/module-public-api.md +31 -0
- package/presets/claude/java/rules/architecture/ports-interfaces.md +34 -0
- package/presets/claude/java/rules/architecture/reference-features.md +34 -0
- package/presets/claude/java/rules/stack/README.md +10 -0
- package/presets/claude/java/rules/stack/java-app-core.md +32 -0
- package/presets/claude/java/rules/stack/java-conventions.md +52 -0
- package/presets/claude/java/rules/testing/README.md +11 -0
- package/presets/claude/java/rules/testing/e2e.md +22 -0
- package/presets/claude/java/rules/testing/integration.md +27 -0
- package/presets/claude/java/rules/testing/unit.md +33 -0
- package/presets/claude/java/rules/tooling-and-review/README.md +21 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +26 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +179 -0
- package/presets/claude/java/rules/tooling-and-review/code-quality.md +83 -0
- package/presets/claude/java/rules/tooling-and-review/code-review.md +59 -0
- package/presets/claude/java/rules/tooling-and-review/design-guidance.md +110 -0
- package/presets/claude/java/rules/tooling-and-review/java-tooling.md +36 -0
- package/presets/claude/java/rules/tooling-and-review/post-change-test.md +32 -0
- package/presets/claude/java/rules/tooling-and-review/preset-layering.md +36 -0
- package/presets/claude/java/rules/tooling-and-review/preset-no-cross-stack-leakage.md +56 -0
- package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +39 -0
- package/presets/claude/java/rules/tooling-and-review/preset-token-budget.md +41 -0
- package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +44 -0
- package/presets/claude/java/rules/tooling-and-review/security-java.md +29 -0
- package/presets/claude/java/rules/tooling-and-review/technical-retro.md +20 -0
- package/presets/claude/java/rules/ui-and-accessibility/README.md +5 -0
- package/presets/claude/java/skills/README.md +5 -0
- package/presets/claude/java/skills/ci-investigation/SKILL.md +11 -0
- package/presets/claude/java/skills/code-review/SKILL.md +25 -0
- package/presets/claude/java/skills/debug-investigation/SKILL.md +15 -0
- package/presets/claude/java/skills/feature-delivery/SKILL.md +30 -0
- package/presets/claude/java/skills/integration-testing/SKILL.md +15 -0
- package/presets/claude/java/skills/technical-retro/SKILL.md +54 -0
- package/presets/claude/java/skills/unit-testing/SKILL.md +14 -0
- package/presets/claude/java/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/java/team/README.md +27 -0
- package/presets/claude/java/team/conventions.md +21 -0
- package/presets/claude/java/team/fixtures/bugfix-standard.json +37 -0
- package/presets/claude/java/team/fixtures/feature-full.json +25 -0
- package/presets/claude/java/team/fixtures/feature-light.json +17 -0
- package/presets/claude/next/agents/build-verifier.md +4 -4
- package/presets/claude/next/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +6 -4
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/cursor/go/agents/build-verifier.md +5 -5
- package/presets/cursor/go/rules/preset-layering.mdc +1 -1
- package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +6 -8
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/go/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/go/team/fixtures/feature-full.json +5 -23
- package/presets/cursor/ios-swift/agents/build-verifier.md +6 -7
- package/presets/cursor/ios-swift/rules/ios-app-core.mdc +5 -28
- package/presets/cursor/ios-swift/rules/preset-layering.mdc +1 -1
- package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +6 -4
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/java/AGENTS.md +37 -0
- package/presets/cursor/java/BUGBOT.md +11 -0
- package/presets/cursor/java/MCP.md +15 -0
- package/presets/cursor/java/README.md +26 -0
- package/presets/cursor/java/REPO_AGENTS.md +45 -0
- package/presets/cursor/java/agents/README.md +36 -0
- package/presets/cursor/java/agents/api-contract-reviewer.md +23 -0
- package/presets/cursor/java/agents/build-verifier.md +45 -0
- package/presets/cursor/java/agents/ci-investigator.md +17 -0
- package/presets/cursor/java/agents/code-reviewer.md +40 -0
- package/presets/cursor/java/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/java/agents/debugger.md +25 -0
- package/presets/cursor/java/agents/feature-developer.md +43 -0
- package/presets/cursor/java/agents/integration-test-generator.md +22 -0
- package/presets/cursor/java/agents/integration-test-healer.md +22 -0
- package/presets/cursor/java/agents/integration-test-planner.md +22 -0
- package/presets/cursor/java/agents/migration-specialist.md +31 -0
- package/presets/cursor/java/agents/performance-auditor.md +22 -0
- package/presets/cursor/java/agents/qa-tester.md +24 -0
- package/presets/cursor/java/agents/security-reviewer.md +20 -0
- package/presets/cursor/java/agents/solution-architect.md +28 -0
- package/presets/cursor/java/agents/task-analyst.md +25 -0
- package/presets/cursor/java/agents/task-router.md +69 -0
- package/presets/cursor/java/agents/tech-writer.md +15 -0
- package/presets/cursor/java/agents/unit-test-generator.md +21 -0
- package/presets/cursor/java/agents/unit-test-healer.md +13 -0
- package/presets/cursor/java/agents/unit-test-planner.md +26 -0
- package/presets/cursor/java/commands/README.md +54 -0
- package/presets/cursor/java/commands/feature-continue.md +19 -0
- package/presets/cursor/java/commands/feature-start.md +33 -0
- package/presets/cursor/java/commands/task-continue.md +49 -0
- package/presets/cursor/java/commands/task.md +49 -0
- package/presets/cursor/java/commands/technical-retro.md +81 -0
- package/presets/cursor/java/hooks/README.md +12 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +381 -0
- package/presets/cursor/java/hooks/examples/README.md +18 -0
- package/presets/cursor/java/hooks/examples/format-edited.example.sh +11 -0
- package/presets/cursor/java/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/java/hooks/examples/test-on-save.example.sh +18 -0
- package/presets/cursor/java/hooks/guard-shell-command.sh +80 -0
- package/presets/cursor/java/hooks.json +17 -0
- package/presets/cursor/java/mcp.json +11 -0
- package/presets/cursor/java/rules/README.md +97 -0
- package/presets/cursor/java/rules/adapters-driven.mdc +40 -0
- package/presets/cursor/java/rules/adapters-driving.mdc +40 -0
- package/presets/cursor/java/rules/agent-team-intake.mdc +20 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +173 -0
- package/presets/cursor/java/rules/api-grpc.mdc +31 -0
- package/presets/cursor/java/rules/api-http.mdc +38 -0
- package/presets/cursor/java/rules/application-usecases.mdc +34 -0
- package/presets/cursor/java/rules/architecture-boundaries.mdc +30 -0
- package/presets/cursor/java/rules/code-quality-and-refactoring.mdc +84 -0
- package/presets/cursor/java/rules/code-review-mr.mdc +54 -0
- package/presets/cursor/java/rules/composition-root.mdc +33 -0
- package/presets/cursor/java/rules/design-guidance.mdc +112 -0
- package/presets/cursor/java/rules/domain-layer.mdc +40 -0
- package/presets/cursor/java/rules/feature-delivery-workflow.mdc +47 -0
- package/presets/cursor/java/rules/java-app-core.mdc +33 -0
- package/presets/cursor/java/rules/java-conventions.mdc +54 -0
- package/presets/cursor/java/rules/java-tooling.mdc +34 -0
- package/presets/cursor/java/rules/messaging-adapters.mdc +26 -0
- package/presets/cursor/java/rules/module-public-api.mdc +33 -0
- package/presets/cursor/java/rules/persistence-adapters.mdc +35 -0
- package/presets/cursor/java/rules/ports-interfaces.mdc +36 -0
- package/presets/cursor/java/rules/post-change-test.mdc +30 -0
- package/presets/cursor/java/rules/preset-layering.mdc +36 -0
- package/presets/cursor/java/rules/preset-no-cross-stack-leakage.mdc +56 -0
- package/presets/cursor/java/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/java/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/java/rules/preset-twin-sync.mdc +44 -0
- package/presets/cursor/java/rules/reference-features.mdc +36 -0
- package/presets/cursor/java/rules/security-java.mdc +31 -0
- package/presets/cursor/java/rules/technical-retro.mdc +14 -0
- package/presets/cursor/java/rules/tests-e2e.mdc +24 -0
- package/presets/cursor/java/rules/tests-integration.mdc +29 -0
- package/presets/cursor/java/rules/tests-unit.mdc +35 -0
- package/presets/cursor/java/skills/README.md +5 -0
- package/presets/cursor/java/skills/ci-investigation/SKILL.md +11 -0
- package/presets/cursor/java/skills/code-review/SKILL.md +25 -0
- package/presets/cursor/java/skills/debug-investigation/SKILL.md +15 -0
- package/presets/cursor/java/skills/feature-delivery/SKILL.md +30 -0
- package/presets/cursor/java/skills/integration-testing/SKILL.md +15 -0
- package/presets/cursor/java/skills/technical-retro/SKILL.md +54 -0
- package/presets/cursor/java/skills/unit-testing/SKILL.md +14 -0
- package/presets/cursor/java/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/java/team/README.md +31 -0
- package/presets/cursor/java/team/conventions.md +21 -0
- package/presets/cursor/java/team/fixtures/bugfix-standard.json +37 -0
- package/presets/cursor/java/team/fixtures/feature-full.json +25 -0
- package/presets/cursor/java/team/fixtures/feature-light.json +17 -0
- package/presets/cursor/next/agents/build-verifier.md +4 -4
- package/presets/cursor/next/rules/preset-layering.mdc +1 -1
- package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +6 -4
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/next/rules/preset-twin-sync.mdc +2 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Design smells (Fowler) and curated GoF patterns for agents. Load when assessing structure, smells, or pattern fit.
|
|
3
|
+
paths:
|
|
4
|
+
- "**/*.java"
|
|
5
|
+
---
|
|
6
|
+
<!-- shared-core: quality/design-guidance.md -->
|
|
7
|
+
|
|
8
|
+
# Design guidance (smells & patterns)
|
|
9
|
+
|
|
10
|
+
Словарь **code smells** (Fowler) и **design patterns** (GoF) для агентов при implement / review / debug.
|
|
11
|
+
|
|
12
|
+
Применять только в scope задачи или MR. Лёгкий refactor — да; «большой» rewrite без явного запроса — нет.
|
|
13
|
+
|
|
14
|
+
Называть паттерн **только если** репозиторий уже так делает или это минимальный match. Иначе — extract/split/move без ярлыка GoF.
|
|
15
|
+
|
|
16
|
+
Не заменяет always-on Principles в `code-quality-and-refactoring` (KISS, DRY + Rule of Three, YAGNI, SOLID, CUPID, composition, Demeter).
|
|
17
|
+
|
|
18
|
+
## When to load
|
|
19
|
+
|
|
20
|
+
- **Feature delivery / implement** — оценка структуры модулей, границ и дублирования.
|
|
21
|
+
- **Code review** — smells и pattern fit **в диффе MR**, не по всему репо.
|
|
22
|
+
- **Debug** — root-cause похож на wrong abstraction, Feature Envy, Message Chains, Shotgun Surgery.
|
|
23
|
+
- **Light refactor only** — улучшения в рамках boy-scout / MR scope; не расширять задачу ради каталога.
|
|
24
|
+
|
|
25
|
+
Агенты и skills подгружают stem по one-liner wiring — не копировать этот каталог в промпт агента.
|
|
26
|
+
|
|
27
|
+
## How to use (agent rules of thumb)
|
|
28
|
+
|
|
29
|
+
1. Сначала сверить с Principles (always-on): проще ли решение, нет ли ранней абстракции, соблюдён ли public API.
|
|
30
|
+
2. Затем отметить smells **в изменённых файлах** задачи/MR; предложить fix только если он укладывается в light refactor.
|
|
31
|
+
3. Паттерн GoF — опциональный ярлык после того, как структура уже ясна; не начинать дизайн с выбора паттерна.
|
|
32
|
+
4. Если smell и паттерн конфликтуют с границами слоёв стека — побеждают stack boundaries и existing repo patterns.
|
|
33
|
+
5. Не требовать переименования «под GoF», если поведение уже корректно и читаемо.
|
|
34
|
+
|
|
35
|
+
## Code smells (Fowler, curated ≤12)
|
|
36
|
+
|
|
37
|
+
Таблица: smell → detect hint → fix hint (одна линия каждый). Без механических меню рефакторинга.
|
|
38
|
+
|
|
39
|
+
| # | Smell | Detect | Fix hint |
|
|
40
|
+
|---|-------|--------|----------|
|
|
41
|
+
| 1 | Duplicate Code | одинаковая логика в ≥2 местах | dedupe после Rule of Three |
|
|
42
|
+
| 2 | Long Method / Long Module | единица делает слишком много | extract в рамках scope; без big rewrite |
|
|
43
|
+
| 3 | Feature Envy | метод чаще трогает чужие данные, чем свои | сдвинуть логику к данным / public API |
|
|
44
|
+
| 4 | Data Clumps | одни и те же группы аргументов кочуют вместе | сгруппировать в type / value object |
|
|
45
|
+
| 5 | Primitive Obsession | сырые string/int вместо доменных понятий | typed ids / value objects при нужде домена |
|
|
46
|
+
| 6 | Speculative Generality | неиспользуемые хуки, флаги, абстракции «на будущее» | удалить (YAGNI) |
|
|
47
|
+
| 7 | Message Chains | цепочки `a.b.c.d` | Demeter; facade / public API модуля |
|
|
48
|
+
| 8 | Middle Man | класс почти только прокидывает вызовы | убрать pass-through **или** оставить как boundary |
|
|
49
|
+
| 9 | Divergent Change | один модуль меняется по разным причинам | split по поводам изменения |
|
|
50
|
+
| 10 | Shotgun Surgery | одно смысловое изменение разъезжается по многим файлам | consolidate ответственность |
|
|
51
|
+
| 11 | Inappropriate Intimacy | доступ к чужим internals / private деталям | только public API / ports / facades |
|
|
52
|
+
| 12 | Refused Bequest / Parallel Inheritance | подтип игнорирует базу; зеркальные иерархии классов | composition; не плодить параллельные деревья |
|
|
53
|
+
|
|
54
|
+
**Skip Fowler (не в core):** Lazy Class, Incomplete Library Class, Comments-as-smell dogma, полный каталог 70+, пошаговые recipe-меню.
|
|
55
|
+
|
|
56
|
+
Приоритет при конфликте smells: Inappropriate Intimacy и Message Chains (границы модулей) > Duplicate Code (после Rule of Three) > Long Method внутри уже правильного модуля.
|
|
57
|
+
|
|
58
|
+
## Design patterns (GoF, curated ≤8)
|
|
59
|
+
|
|
60
|
+
Suggest only when repo already uses the shape or the match is minimal. Prefer extract-function over naming Strategy ради ярлыка.
|
|
61
|
+
|
|
62
|
+
Паттерны ниже — **разрешённый минимум** для агентов; остальной GoF по умолчанию в Skip.
|
|
63
|
+
|
|
64
|
+
| Pattern | When to suggest | Anti-trigger |
|
|
65
|
+
|---------|-----------------|--------------|
|
|
66
|
+
| Strategy | взаимозаменяемые алгоритмы уже (или явно скоро) выбираются политикой | один алгоритм без ветвления политики |
|
|
67
|
+
| Adapter | обернуть внешний / чужой API под локальный port | лишняя обёртка вокруг своего же API |
|
|
68
|
+
| Facade | упростить multi-step subsystem за public API | facade превращается в god-object |
|
|
69
|
+
| Factory Method | полиморфное создание уже принято в стиле репо | factory на каждый тривиальный `new` |
|
|
70
|
+
| Decorator | аддитивное поведение без взрыва subclass-иерархий | decorator «для слоёв» без реальной нужды |
|
|
71
|
+
| Observer | events / subscriptions уже есть в архитектуре | самодельный pub/sub без прецедента в репо |
|
|
72
|
+
| Template Method | общий algorithm skeleton + вариативные hooks | наследование ради пары отличающихся строк |
|
|
73
|
+
| Composite | дерево однородных узлов (UI/domain), как уже в репо | Composite на плоский список без иерархии |
|
|
74
|
+
|
|
75
|
+
Если сомневаешься между двумя паттернами — выбери более простой extract/compose без имени; ярлык можно добавить на review, если репо уже так говорит.
|
|
76
|
+
|
|
77
|
+
## Skip / avoid by default
|
|
78
|
+
|
|
79
|
+
| Catalog | Skip |
|
|
80
|
+
|---------|------|
|
|
81
|
+
| GoF | Singleton, Abstract Factory, Flyweight, Memento, Interpreter, Visitor, Bridge, Prototype |
|
|
82
|
+
| GoF (conditional) | Command, Chain of Responsibility, State — упоминать **только если** репо уже использует |
|
|
83
|
+
| Fowler | всё сверх 12 smells выше |
|
|
84
|
+
| DDD | Aggregates, bounded-context maps, event sourcing, CQRS — **не в core** |
|
|
85
|
+
| DDD (pointer) | ubiquitous language anti-pattern — расширять в `feature-delivery-workflow`, не здесь |
|
|
86
|
+
| GRASP | список Larman как отдельные правила — skip (перекрывается SOLID/CUPID) |
|
|
87
|
+
| Clean Code dogma | жёсткие caps на строки функции / «ровно один assert» — skip |
|
|
88
|
+
|
|
89
|
+
Не вводить второй stem (`refactoring-smells` / `design-patterns-for-agents`) — один каталог: `design-guidance`.
|
|
90
|
+
|
|
91
|
+
## Out of scope for this stem
|
|
92
|
+
|
|
93
|
+
- Полный GoF (23) и полный Fowler catalog.
|
|
94
|
+
- Stack-specific рецепты (пути модулей, lint-команды) — только в **Stack notes** адаптера.
|
|
95
|
+
- Security, a11y, perf — отдельные review-правила; здесь только структурные smells/patterns.
|
|
96
|
+
- Четвёртое always-on правило — запрещено; этот stem только requestable / agent-load.
|
|
97
|
+
|
|
98
|
+
## Cross-refs
|
|
99
|
+
|
|
100
|
+
- Always-on Principles: `code-quality-and-refactoring`.
|
|
101
|
+
- DIP / ports vs adapters: stack `architecture-boundaries` (детали стека — в Stack notes адаптеров).
|
|
102
|
+
- Ubiquitous language: `feature-delivery-workflow` (lineage).
|
|
103
|
+
- MR checklist (smells in scope; pattern name only if repo uses it): `code-review-mr`.
|
|
104
|
+
- Token / twin policy for authors: `preset-token-budget`, `preset-twin-sync` (meta, not consumer always-on).
|
|
105
|
+
|
|
106
|
+
## Stack notes
|
|
107
|
+
|
|
108
|
+
- Strategy via small interfaces at **ports**; adapters (Spring/JPA/HTTP) implement, domain stays free of frameworks.
|
|
109
|
+
- Suggest Facade at package public API; avoid Singleton in favor of composition root / `@Configuration` wiring.
|
|
110
|
+
- Prefer records / immutable VOs for Strategy inputs when the repo already uses them — do not invent patterns mid-module.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Java toolchain commands (Maven/Gradle test, verify) — requestable
|
|
3
|
+
paths:
|
|
4
|
+
- .cursor/team/**/*
|
|
5
|
+
- .claude/team/**/*
|
|
6
|
+
- "**/*.java"
|
|
7
|
+
- "**/pom.xml"
|
|
8
|
+
- "**/build.gradle"
|
|
9
|
+
- "**/build.gradle.kts"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Java tooling (requestable)
|
|
14
|
+
|
|
15
|
+
Before running commands, detect the build tool from the repository:
|
|
16
|
+
|
|
17
|
+
1. Prefer wrappers when present: `./mvnw`, `./gradlew`.
|
|
18
|
+
2. `pom.xml` → Maven; `build.gradle` / `build.gradle.kts` → Gradle.
|
|
19
|
+
3. If both descriptors exist, follow CI/README — do not guess.
|
|
20
|
+
4. JDK version — from toolchain plugin, `maven.compiler.release` / Gradle toolchain, or CI image.
|
|
21
|
+
|
|
22
|
+
## Typical commands
|
|
23
|
+
|
|
24
|
+
| Goal | Maven | Gradle |
|
|
25
|
+
|------|-------|--------|
|
|
26
|
+
| Unit/integration tests | `./mvnw test` or `mvn test` | `./gradlew test` |
|
|
27
|
+
| Packaged verify (if configured) | `./mvnw verify` | `./gradlew check` |
|
|
28
|
+
| Compile only | `./mvnw -DskipTests compile` | `./gradlew classes` |
|
|
29
|
+
|
|
30
|
+
Static analysis / formatters (Checkstyle, SpotBugs, Error Prone, Spotless, etc.) — **run only if the repo/CI already configures them**. Do not introduce a new tool as a hard gate.
|
|
31
|
+
|
|
32
|
+
## Agent requirements
|
|
33
|
+
|
|
34
|
+
- Mandatory after Java edits: **`tooling-and-review/post-change-test.md`**.
|
|
35
|
+
- Never require Playwright, XCUITest, `lint:js`, `lint:css`, or `xcodebuild` as Java handoffs.
|
|
36
|
+
- Integration tests: prefer Testcontainers / Spring test slices — agents `integration-test-*`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Mandatory verification after Java code edits (Maven/Gradle test + repo static gates)
|
|
3
|
+
paths:
|
|
4
|
+
- .cursor/team/**/*
|
|
5
|
+
- .claude/team/**/*
|
|
6
|
+
- "**/*.java"
|
|
7
|
+
- "**/pom.xml"
|
|
8
|
+
- "**/build.gradle"
|
|
9
|
+
- "**/build.gradle.kts"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Post-change test (requestable, mandatory after Java edits)
|
|
14
|
+
|
|
15
|
+
After changing Java sources or build descriptors:
|
|
16
|
+
|
|
17
|
+
1. Detect Maven vs Gradle via **`tooling-and-review/java-tooling.md`** (wrappers preferred).
|
|
18
|
+
2. Run the repository test task (`mvn test` / `./gradlew test`, or the CI-documented equivalent).
|
|
19
|
+
3. If the repo defines a verify/check profile (Failsafe, `check`, Spotless, etc.), run that next.
|
|
20
|
+
4. Apply **only** formatter/static-analysis steps already wired in the project or CI — do not mandate Checkstyle, SpotBugs, or Error Prone.
|
|
21
|
+
|
|
22
|
+
## Pass / fail
|
|
23
|
+
|
|
24
|
+
- **PASS:** tests green; configured static gates green (when present).
|
|
25
|
+
- **FAIL:** red tests or configured gate failures — fix before handoff.
|
|
26
|
+
- Do **not** substitute yarn `lint:js`/`lint:css`, Playwright, XCUITest, or `xcodebuild`.
|
|
27
|
+
|
|
28
|
+
## Related
|
|
29
|
+
|
|
30
|
+
- Tooling discovery: `tooling-and-review/java-tooling.md`
|
|
31
|
+
- Unit: `testing/unit.md` (JUnit 5)
|
|
32
|
+
- Integration: `testing/integration.md` + `integration-test-*` agents
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring meta-rule (preset-layering)
|
|
3
|
+
paths:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
- .claude/**/*
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-layering.md -->
|
|
11
|
+
|
|
12
|
+
# Preset layering
|
|
13
|
+
|
|
14
|
+
Правила для **авторов пресетов** (`packages/ai-rules/presets/**`). Не always-on в consumer apps.
|
|
15
|
+
|
|
16
|
+
## Слои
|
|
17
|
+
|
|
18
|
+
| Слой | Где | Что класть |
|
|
19
|
+
|------|-----|------------|
|
|
20
|
+
| **Core** | `presets/_shared/core/**` | Stack-agnostic prose + checklists; без frontmatter; без путей `app/**`, `Features/**`, Playwright, xcodebuild |
|
|
21
|
+
| **Stack** | `presets/{cursor\|claude}/<stack>/` | Domain/tooling, always-on trio стека, stack examples в **Stack notes** |
|
|
22
|
+
| **Platform** | Cursor `.mdc` / Claude `.md` | Frontmatter (`alwaysApply`/`globs` vs `paths:`), platform-only (`BUGBOT.md`, `CLAUDE.md`) |
|
|
23
|
+
|
|
24
|
+
## Куда класть новое правило
|
|
25
|
+
|
|
26
|
+
1. Общие принципы для всех стеков → **core** + адаптеры с `<!-- shared-core: … -->`.
|
|
27
|
+
2. Только один из installable стеков (`next` / `ios-swift` / `go` / `java`) → **stack-specific** (не в `_shared`).
|
|
28
|
+
3. Только Cursor или только Claude packaging → platform artifact / frontmatter, не дублировать семантику.
|
|
29
|
+
|
|
30
|
+
## SoT
|
|
31
|
+
|
|
32
|
+
- Packages path — SoT; root `.cursor/` — dogfood sync.
|
|
33
|
+
- Per stack: **Cursor** `presets/cursor/<stack>/` → Claude twin same PR.
|
|
34
|
+
- `_shared` **не** `--preset` и не копируется CLI `init`.
|
|
35
|
+
|
|
36
|
+
См. также: `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage`.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring meta-rule (preset-no-cross-stack-leakage)
|
|
3
|
+
paths:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
- .claude/**/*
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-no-cross-stack-leakage.md -->
|
|
11
|
+
|
|
12
|
+
# Preset no cross-stack leakage
|
|
13
|
+
|
|
14
|
+
Запрет протекания stack-specific имён, путей и handoff stems между пресетами.
|
|
15
|
+
|
|
16
|
+
## Principles
|
|
17
|
+
|
|
18
|
+
- `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
|
|
19
|
+
- `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
|
|
20
|
+
- `go` / `java` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
|
|
21
|
+
- Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
|
|
22
|
+
|
|
23
|
+
## Forbidden in ios-swift hooks/agents (FAIL)
|
|
24
|
+
|
|
25
|
+
In ios-swift `chain-team-phases.sh` / agent handoffs (Cursor + Claude):
|
|
26
|
+
|
|
27
|
+
- `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`
|
|
28
|
+
- `app/__tests__/e2e` as a required path
|
|
29
|
+
- Positive yarn recipes `lint:js` / `lint:css` as commands to run (negation prose alone is weak — prefer zero occurrences)
|
|
30
|
+
|
|
31
|
+
Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild` or `post-change-build` / `xcode-tooling`.
|
|
32
|
+
|
|
33
|
+
## Forbidden in next hooks/agents (FAIL when present as required)
|
|
34
|
+
|
|
35
|
+
- `xcuitest-test-` as handoff stems
|
|
36
|
+
- Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
|
|
37
|
+
|
|
38
|
+
## Forbidden in go / java hooks/agents (FAIL)
|
|
39
|
+
|
|
40
|
+
Shared backend-stack bans (both `go` and `java`):
|
|
41
|
+
|
|
42
|
+
- `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
|
|
43
|
+
- Positive yarn recipes `lint:js` / `lint:css`
|
|
44
|
+
- `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
|
|
45
|
+
- Agent file `accessibility-reviewer` (no UI surface)
|
|
46
|
+
|
|
47
|
+
Required instead: `integration-test-*`; build-verifier / `post-change-test` plus stack tooling — `go-tooling` (`go test`, `go vet`) or `java-tooling` (`mvn test` / `./gradlew test`).
|
|
48
|
+
|
|
49
|
+
## Soft / document
|
|
50
|
+
|
|
51
|
+
- Mentioning the other stack in **docs** comparing presets is OK.
|
|
52
|
+
- `build-verifier` may reference other stacks when validating **preset packaging** (`scope: preset-structure-validation`).
|
|
53
|
+
|
|
54
|
+
## Chain fork
|
|
55
|
+
|
|
56
|
+
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, `go`, and `java` (per platform).
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring meta-rule (preset-pr-checklist)
|
|
3
|
+
paths:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
- .claude/**/*
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-pr-checklist.md -->
|
|
11
|
+
|
|
12
|
+
# Preset PR checklist
|
|
13
|
+
|
|
14
|
+
Чеклист для PR, затрагивающих `packages/ai-rules/presets/**` (и dogfood `.cursor/` sync).
|
|
15
|
+
|
|
16
|
+
## Before merge
|
|
17
|
+
|
|
18
|
+
- [ ] **SoT:** правки в `packages/…` (не только root `.cursor/`)
|
|
19
|
+
- [ ] **Core:** если менялся `_shared/core/**` — обновлены все `<!-- shared-core: … -->` consumers (или documented intentional fork)
|
|
20
|
+
- [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, go, and java — см. `preset-twin-sync`)
|
|
21
|
+
- [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table актуален
|
|
22
|
+
- [ ] **Token budget:** alwaysApply / session-start ≤ 3; meta rules not always-on
|
|
23
|
+
- [ ] **Leakage:** нет чужих stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
|
|
24
|
+
- [ ] **Twin depth:** domain ≥15 lines; thin aliases documented
|
|
25
|
+
- [ ] **README:** stack `rules/README.md` core→stack mapping / catalog updated if stems added
|
|
26
|
+
- [ ] **CHANGELOG / package README:** note when public preset paths or install surface change
|
|
27
|
+
- [ ] **Dogfood:** run `packages/ai-rules/scripts/sync-dogfood-cursor.sh` (or document intentional skip) when maintaining this monorepo
|
|
28
|
+
- [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
|
|
29
|
+
|
|
30
|
+
## Pointers
|
|
31
|
+
|
|
32
|
+
- Layering: `preset-layering`
|
|
33
|
+
- Sync: `preset-twin-sync`
|
|
34
|
+
- Budget: `preset-token-budget`
|
|
35
|
+
- Leakage: `preset-no-cross-stack-leakage`
|
|
36
|
+
- Validation: stack `agents/build-verifier.md` → preset-structure section
|
|
37
|
+
- Dogfood script: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`
|
|
38
|
+
- Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
|
|
39
|
+
- Orchestrator: when editing presets, load this checklist + twin-sync
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring meta-rule (preset-token-budget)
|
|
3
|
+
paths:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
- .claude/**/*
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-token-budget.md -->
|
|
11
|
+
|
|
12
|
+
# Preset token budget
|
|
13
|
+
|
|
14
|
+
Инварианты загрузки правил в **установленном** пресете (consumer app).
|
|
15
|
+
|
|
16
|
+
## Hard caps
|
|
17
|
+
|
|
18
|
+
| Platform | Always-on | Cap |
|
|
19
|
+
|----------|-----------|-----|
|
|
20
|
+
| Cursor | `alwaysApply: true` | **≤ 3** |
|
|
21
|
+
| Claude | rules **without** `paths:` | **ровно 3** |
|
|
22
|
+
|
|
23
|
+
**Claude Option A (README exclusion):** when counting Claude rules without `paths:` / session-start, **exclude `**/README.md`** (topic indexes are not session-start rules). The intended session-start trio remains **exactly 3**; body budget sums **only those 3** rules.
|
|
24
|
+
|
|
25
|
+
Session-start body budget (где задокументировано): ≤120 строк суммарно (stretch ≤100).
|
|
26
|
+
|
|
27
|
+
## Meta / author rules
|
|
28
|
+
|
|
29
|
+
Rules for preset authors (`preset-layering`, `preset-twin-sync`, …):
|
|
30
|
+
|
|
31
|
+
- **Never** `alwaysApply: true` on consumer installs.
|
|
32
|
+
- Cursor: `globs` limited to `packages/ai-rules/presets/**` (and dogfood `.cursor/**` where useful).
|
|
33
|
+
- Claude: `paths:` limited to `packages/ai-rules/presets/**` (and `.claude/**` dogfood if present).
|
|
34
|
+
|
|
35
|
+
## Heavy workflows
|
|
36
|
+
|
|
37
|
+
Orchestrator, feature-delivery, code-review, post-change gates, domain globs — **requestable / paths**, not always-on.
|
|
38
|
+
|
|
39
|
+
## Verifier
|
|
40
|
+
|
|
41
|
+
build-verifier **FAIL** if alwaysApply / session-start count exceeds 3 (Claude count **excludes `**/README.md`**), or if a `preset-*` meta rule is marked always-on.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring meta-rule (preset-twin-sync)
|
|
3
|
+
paths:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
- .claude/**/*
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-twin-sync.md -->
|
|
11
|
+
|
|
12
|
+
# Preset twin sync
|
|
13
|
+
|
|
14
|
+
Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
|
|
15
|
+
|
|
16
|
+
## Matrix
|
|
17
|
+
|
|
18
|
+
| Stack | Cursor SoT | Claude derive | Mapping table |
|
|
19
|
+
|-------|------------|---------------|---------------|
|
|
20
|
+
| `next` | `presets/cursor/next/rules/*.mdc` | `presets/claude/next/rules/<topic>/` | **Required** in `claude/next/rules/README.md` |
|
|
21
|
+
| `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
|
|
22
|
+
| `go` | `presets/cursor/go/rules/*.mdc` | `presets/claude/go/rules/<topic>/` | Keep in `claude/go/rules/README.md` |
|
|
23
|
+
| `java` | `presets/cursor/java/rules/*.mdc` | `presets/claude/java/rules/<topic>/` | Keep in `claude/java/rules/README.md` |
|
|
24
|
+
|
|
25
|
+
## Same-PR checklist
|
|
26
|
+
|
|
27
|
+
1. Edit Cursor rule first (body + frontmatter).
|
|
28
|
+
2. Update Claude twin: body + `paths:` (from Cursor `globs:` / requestable triggers); drop `alwaysApply`.
|
|
29
|
+
3. Update mapping table row if stem/path changed.
|
|
30
|
+
4. If body embeds core (`<!-- shared-core: … -->`), sync core consumers across stacks when core changed.
|
|
31
|
+
|
|
32
|
+
## Twin depth
|
|
33
|
+
|
|
34
|
+
- **Domain** rules: ≥15 body lines (FAIL if thin without documented alias reason).
|
|
35
|
+
- **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
|
|
36
|
+
|
|
37
|
+
## Severity (build-verifier)
|
|
38
|
+
|
|
39
|
+
- **next:** missing Claude twin for a changed Cursor rule → **FAIL** (mapping table required).
|
|
40
|
+
- **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
|
|
41
|
+
- **go:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift; mapping table required).
|
|
42
|
+
- **java:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift / go; mapping table required).
|
|
43
|
+
|
|
44
|
+
Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (not the reverse). Use `packages/ai-rules/scripts/sync-dogfood-cursor.sh`.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Security basics for Java backends (secrets, auth, PII, TLS)
|
|
3
|
+
paths:
|
|
4
|
+
- "**/security/**/*"
|
|
5
|
+
- "**/auth/**/*"
|
|
6
|
+
- "**/config/**/*"
|
|
7
|
+
- "**/configuration/**/*"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Security (Java)
|
|
11
|
+
|
|
12
|
+
- Secrets from env / secret manager — never commit keys, tokens, or `.env` with credentials; do not log passwords or bearer tokens.
|
|
13
|
+
- Validate and canonicalize untrusted input at the driving adapter edge (Bean Validation / explicit checks).
|
|
14
|
+
- Prefer prepared statements / parameterized queries / JPA bind parameters in persistence adapters.
|
|
15
|
+
- TLS and secure cookie/header defaults when exposing HTTP.
|
|
16
|
+
- AuthN/AuthZ in filters, Spring Security config, or driving adapters; pass identity into use cases as a domain value (user ID / claims), **not** raw headers or `SecurityContext` types.
|
|
17
|
+
- Minimize PII in logs; redact where needed.
|
|
18
|
+
|
|
19
|
+
## Spring Security (pointer only)
|
|
20
|
+
|
|
21
|
+
- When the repo uses Spring Security: keep filter chains and `SecurityFilterChain` beans in configuration / security adapters — **not** in domain.
|
|
22
|
+
- Do not invent a full security architecture in this rule; follow existing `SecurityConfig` patterns and repo docs.
|
|
23
|
+
- Method security (`@PreAuthorize`) belongs at application/adapter edges already using it — do not sprinkle onto domain entities.
|
|
24
|
+
|
|
25
|
+
## Config
|
|
26
|
+
|
|
27
|
+
- Distinguish public vs secret config fields in types (`@ConfigurationProperties` / plain records).
|
|
28
|
+
- Fail closed when auth is misconfigured in production profiles.
|
|
29
|
+
- Static analysis / secret scanners: run only if the repo/CI already wires them.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Technical retro alias — use /technical-retro command
|
|
3
|
+
paths:
|
|
4
|
+
- .cursor/team/**/*
|
|
5
|
+
- .claude/team/**/*
|
|
6
|
+
- "**/*.java"
|
|
7
|
+
- src/main/java/**/*
|
|
8
|
+
- "**/configuration/**"
|
|
9
|
+
- "**/*Application.java"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<!-- shared-core: review/technical-retro.md -->
|
|
13
|
+
|
|
14
|
+
# Техническое ретро — rule alias
|
|
15
|
+
|
|
16
|
+
Полный сценарий (включая блок **«Работа агентов»** для slug из team tasks) — в slash-команде:
|
|
17
|
+
|
|
18
|
+
**`commands/technical-retro.md`** → `/technical-retro`
|
|
19
|
+
|
|
20
|
+
Используй rule только если command недоступен. Не дублируй содержимое command в ответе — следуй command-файлу и skill `technical-retro`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ci-investigation
|
|
3
|
+
description: Investigates failing CI checks on PRs and branches — mvn/gradle test, compiler, lint, integration, preset-structure — with local reproduction and minimal fixes. Use when CI is red or for ci-fix pipeline tasks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CI investigation (Java)
|
|
7
|
+
|
|
8
|
+
1. Identify job + log excerpt.
|
|
9
|
+
2. Reproduce locally with the same commands.
|
|
10
|
+
3. Minimal fix; for ai-rules preset PRs run `yarn check:preset-structure`.
|
|
11
|
+
4. Do not treat Playwright/xcodebuild/`lint:js` as default Java gates.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: Reviews pull requests and branch diffs for Java hexagonal services using architecture, ports/adapters, networking, and testing standards. Use when the user asks for review or when code-reviewer runs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code review (Java)
|
|
7
|
+
|
|
8
|
+
1. Diff-first; load `tooling-and-review/code-review.md` + hexagonal rules.
|
|
9
|
+
2. Check layer leaks, port ownership, composition root purity, tests, security-sensitive bits.
|
|
10
|
+
3. **Reuse lens:** flag new helpers that duplicate existing packages/utilities; prefer shared adapters over copy-paste.
|
|
11
|
+
4. **Efficiency lens:** unnecessary allocations, N+1 I/O, sequential work that should be concurrent, hot-path bloat, missing context cancellation.
|
|
12
|
+
5. Write `review.md` using the output contract below.
|
|
13
|
+
|
|
14
|
+
## Output
|
|
15
|
+
|
|
16
|
+
- Each finding: **`path:line`** — problem — impact — concrete fix direction.
|
|
17
|
+
- Severity: **`blocker` | `important` | `nit`** (list blocker → nit).
|
|
18
|
+
- End with a verdict line: **`Safe to merge | needs changes | reject`**.
|
|
19
|
+
- Map agent status: Safe to merge → `completed`; needs changes / reject → `changes_requested`.
|
|
20
|
+
|
|
21
|
+
Never require iOS/Next-only gates (XCUITest, Playwright, `lint:js`).
|
|
22
|
+
|
|
23
|
+
## Design guidance
|
|
24
|
+
|
|
25
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug-investigation
|
|
3
|
+
description: Investigates bugs, failing tests, and unexpected behavior in Java services with runtime evidence before applying minimal fixes. Use for bugfix tasks, debugger agent runs, or regressions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Debug investigation (Java)
|
|
7
|
+
|
|
8
|
+
1. Capture failing `mvn test` / `./gradlew test` / logs / stack traces.
|
|
9
|
+
2. Hypothesize layer (domain vs adapter vs wiring).
|
|
10
|
+
3. Minimal fix + regression test when appropriate.
|
|
11
|
+
4. Document in `debug-report.md`.
|
|
12
|
+
|
|
13
|
+
## Design guidance
|
|
14
|
+
|
|
15
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-delivery
|
|
3
|
+
description: Delivers Java hexagonal backend features end-to-end across domain, application/ports, adapters, composition root, tests, and post-change-test validation. Use when implementing or extending a feature, especially through /task or feature-developer.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Feature Delivery (Java hexagonal)
|
|
7
|
+
|
|
8
|
+
1. Read brief, AC, and decomposition.
|
|
9
|
+
2. Follow `feature-delivery-workflow.mdc` + `reference-features.mdc`: domain → application/ports → driven adapters → driving adapters → composition root → tests.
|
|
10
|
+
3. Wire DI only in `configuration/` / `*Application.java`.
|
|
11
|
+
4. Add unit tests for domain/use cases; integration tests for risky adapters.
|
|
12
|
+
5. After Java edits: **invoke** `post-change-test.mdc` (+ `java-tooling.mdc`).
|
|
13
|
+
|
|
14
|
+
## Do / Don't
|
|
15
|
+
|
|
16
|
+
- **Do** keep ports owned by application; map wire types at adapters.
|
|
17
|
+
- **Don't** put SQL/business rules in HTTP handlers or frameworks in domain.
|
|
18
|
+
- **Don't** use Playwright, XCUITest, or yarn lint as this stack's gate.
|
|
19
|
+
|
|
20
|
+
## Scope discipline
|
|
21
|
+
|
|
22
|
+
Implement only the current AC / decomposition task. Clarify ambiguity before coding; do not add unrelated hardening or drive-by refactors. See `feature-developer` → **Zero improvisation**.
|
|
23
|
+
|
|
24
|
+
## Handoff
|
|
25
|
+
|
|
26
|
+
Summarize by layer + validation. Update `.claude/team/tasks/<slug>/status.json`.
|
|
27
|
+
|
|
28
|
+
## Design guidance
|
|
29
|
+
|
|
30
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: integration-testing
|
|
3
|
+
description: Plans, generates, and heals Java integration and adapter contract tests (MockMvc, Testcontainers). Use for integration-test-* agents or adapter/e2e coverage.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Integration testing (Java)
|
|
7
|
+
|
|
8
|
+
1. Read `tests-integration` / `tests-e2e` rules and task brief.
|
|
9
|
+
2. Prefer testing driven adapters behind ports; HTTP adapters with `MockMvc` + fakes.
|
|
10
|
+
3. Use build tags / CI job split if the repo already does.
|
|
11
|
+
4. Do not introduce Playwright or XCUITest.
|
|
12
|
+
|
|
13
|
+
## Agents
|
|
14
|
+
|
|
15
|
+
`integration-test-planner` → `integration-test-generator` → `integration-test-healer` as needed.
|
|
@@ -0,0 +1,54 @@
|
|
|
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** (mvn test / ./gradlew test), reviewer, QA/integration tests, hooks, and rules.
|
|
31
|
+
|
|
32
|
+
## Wrong-turn taxonomy (optional)
|
|
33
|
+
|
|
34
|
+
When artifacts or the user mention agent mistakes, tag incidents:
|
|
35
|
+
|
|
36
|
+
| Kind | Signal |
|
|
37
|
+
|------|--------|
|
|
38
|
+
| `correction` | User pushback («no», «don't», «actually») |
|
|
39
|
+
| `retry` | Same tool/approach 2+ times before success |
|
|
40
|
+
| `waste` | Many searches before the right file |
|
|
41
|
+
| `reversal` | Edit then revert / delete |
|
|
42
|
+
| `dead-end` | Env/tool failure (missing binary, wrong path) |
|
|
43
|
+
|
|
44
|
+
Severity: **high** (explicit correction / large waste) · **med** · **low**. Confidence 0–100 — be honest; low-confidence items are optional.
|
|
45
|
+
|
|
46
|
+
## Preset feedback loop
|
|
47
|
+
|
|
48
|
+
If the same issue appeared in **2+** tasks (or **3+** for packaging a new rule/skill — Rule of Three), add section **Preset updates**:
|
|
49
|
+
|
|
50
|
+
- Proposed change to `.claude/rules/`, `.claude/agents/`, `.claude/skills/`, or **`.claude/team/conventions.md`** (prefer conventions for project gotchas)
|
|
51
|
+
- One concrete snippet or file path
|
|
52
|
+
- Whether it belongs in session-start vs `paths:` vs skill vs conventions (see `PRESET-CONTRIBUTION` → Building blocks)
|
|
53
|
+
|
|
54
|
+
Do not apply preset or conventions changes without user approval.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: unit-testing
|
|
3
|
+
description: Plans, generates, and heals parameterized JUnit unit tests for domain, use cases, and mappers using *Test.java and tests-unit rules. Use for unit-test planning, generation, or healing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Unit testing (Java)
|
|
7
|
+
|
|
8
|
+
1. Prefer JUnit 5 `@ParameterizedTest` (and AssertJ assertions) beside code under test (`*Test.java`).
|
|
9
|
+
2. Fake outbound ports for use cases with Mockito; no real DB/network.
|
|
10
|
+
3. Follow `tests-unit.md`; heal with `unit-test-healer` when red.
|
|
11
|
+
|
|
12
|
+
## Agents
|
|
13
|
+
|
|
14
|
+
`unit-test-planner` → `unit-test-generator` → `unit-test-healer`.
|