@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.
Files changed (227) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/README.md +4 -2
  3. package/bin/cli.js +2 -0
  4. package/package.json +1 -1
  5. package/presets/_shared/README.md +1 -1
  6. package/presets/_shared/core/meta/preset-layering.md +1 -1
  7. package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +6 -4
  8. package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
  9. package/presets/_shared/core/meta/preset-twin-sync.md +2 -0
  10. package/presets/claude/go/agents/build-verifier.md +5 -5
  11. package/presets/claude/go/rules/tooling-and-review/preset-layering.md +1 -1
  12. package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +6 -8
  13. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  14. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +2 -0
  15. package/presets/claude/go/team/fixtures/feature-full.json +5 -23
  16. package/presets/claude/ios-swift/agents/build-verifier.md +6 -7
  17. package/presets/claude/ios-swift/rules/stack/ios-app-core.md +5 -28
  18. package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +1 -1
  19. package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +6 -4
  20. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  21. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +2 -0
  22. package/presets/claude/java/CLAUDE.md +29 -0
  23. package/presets/claude/java/MCP.md +13 -0
  24. package/presets/claude/java/README.md +26 -0
  25. package/presets/claude/java/REPO_AGENTS.md +45 -0
  26. package/presets/claude/java/agents/README.md +32 -0
  27. package/presets/claude/java/agents/api-contract-reviewer.md +23 -0
  28. package/presets/claude/java/agents/build-verifier.md +45 -0
  29. package/presets/claude/java/agents/ci-investigator.md +17 -0
  30. package/presets/claude/java/agents/code-reviewer.md +40 -0
  31. package/presets/claude/java/agents/codebase-analyzer.md +28 -0
  32. package/presets/claude/java/agents/debugger.md +25 -0
  33. package/presets/claude/java/agents/feature-developer.md +43 -0
  34. package/presets/claude/java/agents/integration-test-generator.md +22 -0
  35. package/presets/claude/java/agents/integration-test-healer.md +22 -0
  36. package/presets/claude/java/agents/integration-test-planner.md +22 -0
  37. package/presets/claude/java/agents/migration-specialist.md +31 -0
  38. package/presets/claude/java/agents/performance-auditor.md +22 -0
  39. package/presets/claude/java/agents/qa-tester.md +24 -0
  40. package/presets/claude/java/agents/security-reviewer.md +20 -0
  41. package/presets/claude/java/agents/solution-architect.md +28 -0
  42. package/presets/claude/java/agents/task-analyst.md +25 -0
  43. package/presets/claude/java/agents/task-router.md +69 -0
  44. package/presets/claude/java/agents/tech-writer.md +15 -0
  45. package/presets/claude/java/agents/unit-test-generator.md +21 -0
  46. package/presets/claude/java/agents/unit-test-healer.md +13 -0
  47. package/presets/claude/java/agents/unit-test-planner.md +26 -0
  48. package/presets/claude/java/commands/README.md +13 -0
  49. package/presets/claude/java/commands/feature-continue.md +51 -0
  50. package/presets/claude/java/commands/feature-start.md +30 -0
  51. package/presets/claude/java/commands/task-continue.md +49 -0
  52. package/presets/claude/java/commands/task.md +49 -0
  53. package/presets/claude/java/commands/technical-retro.md +58 -0
  54. package/presets/claude/java/hooks/README.md +16 -0
  55. package/presets/claude/java/hooks/chain-team-phases.sh +381 -0
  56. package/presets/claude/java/hooks/examples/README.md +18 -0
  57. package/presets/claude/java/hooks/examples/format-edited.example.sh +11 -0
  58. package/presets/claude/java/hooks/examples/secret-guard.example.sh +10 -0
  59. package/presets/claude/java/hooks/examples/test-on-save.example.sh +18 -0
  60. package/presets/claude/java/hooks/guard-shell-command.sh +80 -0
  61. package/presets/claude/java/mcp.json +11 -0
  62. package/presets/claude/java/rules/README.md +60 -0
  63. package/presets/claude/java/rules/api-and-data/README.md +14 -0
  64. package/presets/claude/java/rules/api-and-data/adapters-driven.md +38 -0
  65. package/presets/claude/java/rules/api-and-data/adapters-driving.md +38 -0
  66. package/presets/claude/java/rules/api-and-data/api-grpc.md +29 -0
  67. package/presets/claude/java/rules/api-and-data/api-http.md +36 -0
  68. package/presets/claude/java/rules/api-and-data/messaging-adapters.md +24 -0
  69. package/presets/claude/java/rules/api-and-data/persistence-adapters.md +33 -0
  70. package/presets/claude/java/rules/architecture/README.md +16 -0
  71. package/presets/claude/java/rules/architecture/application-usecases.md +32 -0
  72. package/presets/claude/java/rules/architecture/boundaries.md +29 -0
  73. package/presets/claude/java/rules/architecture/composition-root.md +31 -0
  74. package/presets/claude/java/rules/architecture/domain-layer.md +38 -0
  75. package/presets/claude/java/rules/architecture/feature-delivery.md +52 -0
  76. package/presets/claude/java/rules/architecture/module-public-api.md +31 -0
  77. package/presets/claude/java/rules/architecture/ports-interfaces.md +34 -0
  78. package/presets/claude/java/rules/architecture/reference-features.md +34 -0
  79. package/presets/claude/java/rules/stack/README.md +10 -0
  80. package/presets/claude/java/rules/stack/java-app-core.md +32 -0
  81. package/presets/claude/java/rules/stack/java-conventions.md +52 -0
  82. package/presets/claude/java/rules/testing/README.md +11 -0
  83. package/presets/claude/java/rules/testing/e2e.md +22 -0
  84. package/presets/claude/java/rules/testing/integration.md +27 -0
  85. package/presets/claude/java/rules/testing/unit.md +33 -0
  86. package/presets/claude/java/rules/tooling-and-review/README.md +21 -0
  87. package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +26 -0
  88. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +179 -0
  89. package/presets/claude/java/rules/tooling-and-review/code-quality.md +83 -0
  90. package/presets/claude/java/rules/tooling-and-review/code-review.md +59 -0
  91. package/presets/claude/java/rules/tooling-and-review/design-guidance.md +110 -0
  92. package/presets/claude/java/rules/tooling-and-review/java-tooling.md +36 -0
  93. package/presets/claude/java/rules/tooling-and-review/post-change-test.md +32 -0
  94. package/presets/claude/java/rules/tooling-and-review/preset-layering.md +36 -0
  95. package/presets/claude/java/rules/tooling-and-review/preset-no-cross-stack-leakage.md +56 -0
  96. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +39 -0
  97. package/presets/claude/java/rules/tooling-and-review/preset-token-budget.md +41 -0
  98. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +44 -0
  99. package/presets/claude/java/rules/tooling-and-review/security-java.md +29 -0
  100. package/presets/claude/java/rules/tooling-and-review/technical-retro.md +20 -0
  101. package/presets/claude/java/rules/ui-and-accessibility/README.md +5 -0
  102. package/presets/claude/java/skills/README.md +5 -0
  103. package/presets/claude/java/skills/ci-investigation/SKILL.md +11 -0
  104. package/presets/claude/java/skills/code-review/SKILL.md +25 -0
  105. package/presets/claude/java/skills/debug-investigation/SKILL.md +15 -0
  106. package/presets/claude/java/skills/feature-delivery/SKILL.md +30 -0
  107. package/presets/claude/java/skills/integration-testing/SKILL.md +15 -0
  108. package/presets/claude/java/skills/technical-retro/SKILL.md +54 -0
  109. package/presets/claude/java/skills/unit-testing/SKILL.md +14 -0
  110. package/presets/claude/java/skills/write-adr/SKILL.md +41 -0
  111. package/presets/claude/java/team/README.md +27 -0
  112. package/presets/claude/java/team/conventions.md +21 -0
  113. package/presets/claude/java/team/fixtures/bugfix-standard.json +37 -0
  114. package/presets/claude/java/team/fixtures/feature-full.json +25 -0
  115. package/presets/claude/java/team/fixtures/feature-light.json +17 -0
  116. package/presets/claude/next/agents/build-verifier.md +4 -4
  117. package/presets/claude/next/rules/tooling-and-review/preset-layering.md +1 -1
  118. package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +6 -4
  119. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  120. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +2 -0
  121. package/presets/cursor/go/agents/build-verifier.md +5 -5
  122. package/presets/cursor/go/rules/preset-layering.mdc +1 -1
  123. package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +6 -8
  124. package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
  125. package/presets/cursor/go/rules/preset-twin-sync.mdc +2 -0
  126. package/presets/cursor/go/team/fixtures/feature-full.json +5 -23
  127. package/presets/cursor/ios-swift/agents/build-verifier.md +6 -7
  128. package/presets/cursor/ios-swift/rules/ios-app-core.mdc +5 -28
  129. package/presets/cursor/ios-swift/rules/preset-layering.mdc +1 -1
  130. package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +6 -4
  131. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
  132. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +2 -0
  133. package/presets/cursor/java/AGENTS.md +37 -0
  134. package/presets/cursor/java/BUGBOT.md +11 -0
  135. package/presets/cursor/java/MCP.md +15 -0
  136. package/presets/cursor/java/README.md +26 -0
  137. package/presets/cursor/java/REPO_AGENTS.md +45 -0
  138. package/presets/cursor/java/agents/README.md +36 -0
  139. package/presets/cursor/java/agents/api-contract-reviewer.md +23 -0
  140. package/presets/cursor/java/agents/build-verifier.md +45 -0
  141. package/presets/cursor/java/agents/ci-investigator.md +17 -0
  142. package/presets/cursor/java/agents/code-reviewer.md +40 -0
  143. package/presets/cursor/java/agents/codebase-analyzer.md +28 -0
  144. package/presets/cursor/java/agents/debugger.md +25 -0
  145. package/presets/cursor/java/agents/feature-developer.md +43 -0
  146. package/presets/cursor/java/agents/integration-test-generator.md +22 -0
  147. package/presets/cursor/java/agents/integration-test-healer.md +22 -0
  148. package/presets/cursor/java/agents/integration-test-planner.md +22 -0
  149. package/presets/cursor/java/agents/migration-specialist.md +31 -0
  150. package/presets/cursor/java/agents/performance-auditor.md +22 -0
  151. package/presets/cursor/java/agents/qa-tester.md +24 -0
  152. package/presets/cursor/java/agents/security-reviewer.md +20 -0
  153. package/presets/cursor/java/agents/solution-architect.md +28 -0
  154. package/presets/cursor/java/agents/task-analyst.md +25 -0
  155. package/presets/cursor/java/agents/task-router.md +69 -0
  156. package/presets/cursor/java/agents/tech-writer.md +15 -0
  157. package/presets/cursor/java/agents/unit-test-generator.md +21 -0
  158. package/presets/cursor/java/agents/unit-test-healer.md +13 -0
  159. package/presets/cursor/java/agents/unit-test-planner.md +26 -0
  160. package/presets/cursor/java/commands/README.md +54 -0
  161. package/presets/cursor/java/commands/feature-continue.md +19 -0
  162. package/presets/cursor/java/commands/feature-start.md +33 -0
  163. package/presets/cursor/java/commands/task-continue.md +49 -0
  164. package/presets/cursor/java/commands/task.md +49 -0
  165. package/presets/cursor/java/commands/technical-retro.md +81 -0
  166. package/presets/cursor/java/hooks/README.md +12 -0
  167. package/presets/cursor/java/hooks/chain-team-phases.sh +381 -0
  168. package/presets/cursor/java/hooks/examples/README.md +18 -0
  169. package/presets/cursor/java/hooks/examples/format-edited.example.sh +11 -0
  170. package/presets/cursor/java/hooks/examples/secret-guard.example.sh +10 -0
  171. package/presets/cursor/java/hooks/examples/test-on-save.example.sh +18 -0
  172. package/presets/cursor/java/hooks/guard-shell-command.sh +80 -0
  173. package/presets/cursor/java/hooks.json +17 -0
  174. package/presets/cursor/java/mcp.json +11 -0
  175. package/presets/cursor/java/rules/README.md +97 -0
  176. package/presets/cursor/java/rules/adapters-driven.mdc +40 -0
  177. package/presets/cursor/java/rules/adapters-driving.mdc +40 -0
  178. package/presets/cursor/java/rules/agent-team-intake.mdc +20 -0
  179. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +173 -0
  180. package/presets/cursor/java/rules/api-grpc.mdc +31 -0
  181. package/presets/cursor/java/rules/api-http.mdc +38 -0
  182. package/presets/cursor/java/rules/application-usecases.mdc +34 -0
  183. package/presets/cursor/java/rules/architecture-boundaries.mdc +30 -0
  184. package/presets/cursor/java/rules/code-quality-and-refactoring.mdc +84 -0
  185. package/presets/cursor/java/rules/code-review-mr.mdc +54 -0
  186. package/presets/cursor/java/rules/composition-root.mdc +33 -0
  187. package/presets/cursor/java/rules/design-guidance.mdc +112 -0
  188. package/presets/cursor/java/rules/domain-layer.mdc +40 -0
  189. package/presets/cursor/java/rules/feature-delivery-workflow.mdc +47 -0
  190. package/presets/cursor/java/rules/java-app-core.mdc +33 -0
  191. package/presets/cursor/java/rules/java-conventions.mdc +54 -0
  192. package/presets/cursor/java/rules/java-tooling.mdc +34 -0
  193. package/presets/cursor/java/rules/messaging-adapters.mdc +26 -0
  194. package/presets/cursor/java/rules/module-public-api.mdc +33 -0
  195. package/presets/cursor/java/rules/persistence-adapters.mdc +35 -0
  196. package/presets/cursor/java/rules/ports-interfaces.mdc +36 -0
  197. package/presets/cursor/java/rules/post-change-test.mdc +30 -0
  198. package/presets/cursor/java/rules/preset-layering.mdc +36 -0
  199. package/presets/cursor/java/rules/preset-no-cross-stack-leakage.mdc +56 -0
  200. package/presets/cursor/java/rules/preset-pr-checklist.mdc +39 -0
  201. package/presets/cursor/java/rules/preset-token-budget.mdc +41 -0
  202. package/presets/cursor/java/rules/preset-twin-sync.mdc +44 -0
  203. package/presets/cursor/java/rules/reference-features.mdc +36 -0
  204. package/presets/cursor/java/rules/security-java.mdc +31 -0
  205. package/presets/cursor/java/rules/technical-retro.mdc +14 -0
  206. package/presets/cursor/java/rules/tests-e2e.mdc +24 -0
  207. package/presets/cursor/java/rules/tests-integration.mdc +29 -0
  208. package/presets/cursor/java/rules/tests-unit.mdc +35 -0
  209. package/presets/cursor/java/skills/README.md +5 -0
  210. package/presets/cursor/java/skills/ci-investigation/SKILL.md +11 -0
  211. package/presets/cursor/java/skills/code-review/SKILL.md +25 -0
  212. package/presets/cursor/java/skills/debug-investigation/SKILL.md +15 -0
  213. package/presets/cursor/java/skills/feature-delivery/SKILL.md +30 -0
  214. package/presets/cursor/java/skills/integration-testing/SKILL.md +15 -0
  215. package/presets/cursor/java/skills/technical-retro/SKILL.md +54 -0
  216. package/presets/cursor/java/skills/unit-testing/SKILL.md +14 -0
  217. package/presets/cursor/java/skills/write-adr/SKILL.md +41 -0
  218. package/presets/cursor/java/team/README.md +31 -0
  219. package/presets/cursor/java/team/conventions.md +21 -0
  220. package/presets/cursor/java/team/fixtures/bugfix-standard.json +37 -0
  221. package/presets/cursor/java/team/fixtures/feature-full.json +25 -0
  222. package/presets/cursor/java/team/fixtures/feature-light.json +17 -0
  223. package/presets/cursor/next/agents/build-verifier.md +4 -4
  224. package/presets/cursor/next/rules/preset-layering.mdc +1 -1
  225. package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +6 -4
  226. package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
  227. package/presets/cursor/next/rules/preset-twin-sync.mdc +2 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ### Review follow-ups (core sharing / structure)
6
+
7
+ - **Shared-core drift is a hard gate** in `check:preset-structure` / CI (`AI_RULES_DRIFT_FAIL=1`).
8
+ - **build-verifier** agents (next/ios-swift/go/java × Cursor+Claude): twin / REPO_AGENTS / react-performance gates list all four stacks.
9
+ - **Leakage core DRY:** merged go+java forbidden blocks in `meta/preset-no-cross-stack-leakage` (+8 embed adapters).
10
+ - **ios-swift session-start:** trimmed `ios-app-core` toward stretch ≤100 body sum.
11
+ - **Docs:** leakage soft-WARN baseline + drift hardgate in `PRESET-CONTRIBUTION.md`; go/java `feature-full` fixtures drop Playwright/XCUITest skipped noise.
12
+
13
+ ### Java preset
14
+
15
+ - New installable preset **`java`** (Cursor + Claude twins): Spring Boot hexagonal default, layer-first single-module layout, Context7-only MCP, Maven/Gradle detection via `java-tooling` / `post-change-test`.
16
+ - Full mapped rule catalog (~32 stems); always-on trio `java-app-core`, `architecture-boundaries`, `code-quality-and-refactoring` (≤120 body lines).
17
+ - Agent-team surface: 21 agents, 8 skills, 5 commands, hooks + team fixtures; `integration-test-*` (no Playwright/XCUITest/a11y).
18
+ - Structure scripts (`twin-map`, `token-budget`, `leakage`) include `java`; meta cores list four stacks (8 adapters per embed stem).
19
+ - Install: `npx @bonesofspring/ai-rules init cursor|claude --preset java`.
20
+ - Platform asymmetry: `BUGBOT.md` + `hooks.json` Cursor-only; `CLAUDE.md` Claude-only.
21
+
5
22
  ### Claude Code handbook agent discipline
6
23
 
7
24
  Borrowed workflow patterns from [claude-code-rules](https://github.com/nikiforovall/claude-code-rules) (methodology marketplace — not coding standards). Additive on top of structure-change / preset-rules-improvements work.
@@ -52,7 +69,7 @@ Cross-cutting preset packaging work (all six presets unless noted **next-only**)
52
69
  - **Always-on Principles** in shared `quality/code-quality-and-refactoring` (+6 adapters): compact § **Принципы** — KISS, DRY + Rule of Three, YAGNI, SOLID, CUPID, composition over inheritance, Law of Demeter hint. No smell/GoF catalogs in always-on.
53
70
  - **Requestable `quality/design-guidance`** (+6 adapters, Cursor/Claude × next/ios-swift/go): curated Fowler smells (≤12) + GoF (≤8) + skip/avoid; globs `app/src/**/*.{ts,tsx}` / `**/*.swift` / `**/*.go`. Cross-refs in `feature-delivery-workflow` (ubiquitous language) and `code-review-mr` checklist. One-liner wiring in feature-developer / code-review / debugger (+ recommended roles).
54
71
  - **Go hexagonal preset (`go`):** Cursor + Claude twins — 32 rules (always-on: `go-app-core`, `architecture-boundaries`, `code-quality-and-refactoring`), 20 agents (`integration-test-*`, no a11y/Playwright/XCUITest), 7 skills (+ `integration-testing`), hooks/commands/team/MCP. Structure scripts `STACKS` include `go`; leakage `GO_FORBIDDEN_*` + pairwise chain forks. Install: `init cursor|claude --preset go`. Lineage markers on go `feature-delivery-workflow` / `reference-features`; go team fixtures / commands READMEs use Go gates (not xcodebuild/XCUITest copy-paste).
55
- - **Preset structure CI gates:** `scripts/check-preset-{twin-map,token-budget,leakage,structure}.sh` + npm scripts `check:preset-*`; GitHub Actions workflow `.github/workflows/preset-structure.yml` on `packages/ai-rules/**` PRs. Hard FAIL on twin/budget/leakage; soft shared-core drift only (no `AI_RULES_DRIFT_FAIL`).
72
+ - **Preset structure CI gates:** `scripts/check-preset-{twin-map,token-budget,leakage,structure}.sh` + npm scripts `check:preset-*`; GitHub Actions workflow `.github/workflows/preset-structure.yml` on `packages/ai-rules/**` PRs. Hard FAIL on twin/budget/leakage/**shared-core drift** (`AI_RULES_DRIFT_FAIL=1` in structure orchestrator).
56
73
  - **`presets/_shared/core/**`:** stack-agnostic shared prose (quality, agent-team, architecture templates, review, author meta-rules) with `<!-- shared-core: … -->` adapters in Cursor + Claude `next` and `ios-swift`.
57
74
  - **Author meta-rules:** `preset-layering`, `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage` (never always-on / session-start).
58
75
  - **Contributor docs:** `docs/PRESET-CONTRIBUTION.md` (layers, SoT, embed vs lineage sync modes, new-stack checklist).
package/README.md CHANGED
@@ -53,13 +53,15 @@ Where things go on `init`:
53
53
 
54
54
  Skills of note: `write-adr` (all stacks); `react-performance` (**next only**). Living gotchas: `team/conventions.md`. Opt-in rule samples eval: `yarn check:rule-eval` (workflow `rule-eval.yml`; not part of `check:preset-structure`).
55
55
 
56
- The package ships presets including **`next`** (Next.js stack), **`ios-swift`** (iOS apps on Swift / SwiftUI), and **`go`** (Go backends with hexagonal architecture). Other preset names: see `presets/` in the [repo](https://github.com/bonesofspring/ai-rules). Name is a single path segment, no `/` or `..`.
56
+ The package ships presets including **`next`** (Next.js stack), **`ios-swift`** (iOS apps on Swift / SwiftUI), **`go`** (Go backends with hexagonal architecture), and **`java`** (Java / Spring Boot hexagonal backends). Other preset names: see `presets/` in the [repo](https://github.com/bonesofspring/ai-rules). Name is a single path segment, no `/` or `..`.
57
57
 
58
58
  ```bash
59
59
  npx @bonesofspring/ai-rules init cursor --preset ios-swift
60
60
  npx @bonesofspring/ai-rules init claude --preset ios-swift
61
61
  npx @bonesofspring/ai-rules init cursor --preset go
62
62
  npx @bonesofspring/ai-rules init claude --preset go
63
+ npx @bonesofspring/ai-rules init cursor --preset java
64
+ npx @bonesofspring/ai-rules init claude --preset java
63
65
  ```
64
66
 
65
67
  Help: `ai-rules --help`.
@@ -71,7 +73,7 @@ Presets are developed in this monorepo under `presets/`. If you add or change ru
71
73
  - **Taxonomy & layers:** [`presets/_shared/README.md`](presets/_shared/README.md) — shared core (`_shared/core`), stack adapters, platform packaging
72
74
  - **Contribution guide:** [`docs/PRESET-CONTRIBUTION.md`](docs/PRESET-CONTRIBUTION.md) — SoT, twin sync, embed vs lineage, token budget (≤3 always-on), PR checklist, new stack preset, platform-only files (`BUGBOT.md`, `CLAUDE.md`)
73
75
  - **Dogfood / drift scripts:** [`scripts/sync-dogfood-cursor.sh`](scripts/sync-dogfood-cursor.sh) (also syncs root `AGENTS.md` from `REPO_AGENTS.md`; seeds `team/conventions.md` if absent), [`scripts/check-shared-core-drift.sh`](scripts/check-shared-core-drift.sh)
74
- - **Preset structure CI gates** (exit non-zero on FAIL): `yarn check:preset-structure` (or `bash scripts/check-preset-structure.sh`) — twin map, session-start budget (Option A), leakage; soft drift included without `AI_RULES_DRIFT_FAIL`
76
+ - **Preset structure CI gates** (exit non-zero on FAIL): `yarn check:preset-structure` (or `bash scripts/check-preset-structure.sh`) — twin map, session-start budget (Option A), leakage, shared-core drift (`AI_RULES_DRIFT_FAIL=1`)
75
77
  - **Opt-in rule eval:** `yarn check:rule-eval` + `.github/workflows/rule-eval.yml` (`workflow_dispatch` + paths-scoped PR) — **not** wired into `check:preset-structure`
76
78
  - **CLI note:** `_shared` is not an installable `--preset`; `init` copies only `presets/cursor/<name>/` or `presets/claude/<name>/`
77
79
 
package/bin/cli.js CHANGED
@@ -72,9 +72,11 @@ Examples:
72
72
  npx @bonesofspring/ai-rules init cursor next
73
73
  npx @bonesofspring/ai-rules init cursor --preset ios-swift
74
74
  npx @bonesofspring/ai-rules init cursor --preset go
75
+ npx @bonesofspring/ai-rules init cursor --preset java
75
76
  npx @bonesofspring/ai-rules init claude
76
77
  npx @bonesofspring/ai-rules init claude --preset ios-swift
77
78
  npx @bonesofspring/ai-rules init claude --preset go
79
+ npx @bonesofspring/ai-rules init claude --preset java
78
80
  npx @bonesofspring/ai-rules clean cursor
79
81
  `);
80
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Presets of Cursor and Claude rules/commands for Revy Ross personal use",
5
5
  "license": "MIT",
6
6
  "author": "Revy Ross",
@@ -1,6 +1,6 @@
1
1
  # Shared preset core (`presets/_shared`)
2
2
 
3
- Stack-agnostic **prose and checklists** for all installable presets: `next`, `ios-swift`, and `go` (`cursor/<stack>`, `claude/<stack>`).
3
+ Stack-agnostic **prose and checklists** for all installable presets: `next`, `ios-swift`, `go`, and `java` (`cursor/<stack>`, `claude/<stack>`).
4
4
 
5
5
  **Not an installable preset.** CLI `init` copies only under `presets/cursor/<name>/` or `presets/claude/<name>/` — this sibling is never shipped to consumer apps.
6
6
 
@@ -13,7 +13,7 @@
13
13
  ## Куда класть новое правило
14
14
 
15
15
  1. Общие принципы для всех стеков → **core** + адаптеры с `<!-- shared-core: … -->`.
16
- 2. Только один из installable стеков (`next` / `ios-swift` / `go`) → **stack-specific** (не в `_shared`).
16
+ 2. Только один из installable стеков (`next` / `ios-swift` / `go` / `java`) → **stack-specific** (не в `_shared`).
17
17
  3. Только Cursor или только Claude packaging → platform artifact / frontmatter, не дублировать семантику.
18
18
 
19
19
  ## SoT
@@ -6,7 +6,7 @@
6
6
 
7
7
  - `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
8
8
  - `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
9
- - `go` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
9
+ - `go` / `java` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
10
10
  - Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
11
11
 
12
12
  ## Forbidden in ios-swift hooks/agents (FAIL)
@@ -24,14 +24,16 @@ Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild`
24
24
  - `xcuitest-test-` as handoff stems
25
25
  - Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
26
26
 
27
- ## Forbidden in go hooks/agents (FAIL)
27
+ ## Forbidden in go / java hooks/agents (FAIL)
28
+
29
+ Shared backend-stack bans (both `go` and `java`):
28
30
 
29
31
  - `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
30
32
  - Positive yarn recipes `lint:js` / `lint:css`
31
33
  - `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
32
34
  - Agent file `accessibility-reviewer` (no UI surface)
33
35
 
34
- Required instead: `integration-test-*`; build-verifier / `post-change-test` / `go-tooling` (`go test`, `go vet`).
36
+ 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`).
35
37
 
36
38
  ## Soft / document
37
39
 
@@ -40,4 +42,4 @@ Required instead: `integration-test-*`; build-verifier / `post-change-test` / `g
40
42
 
41
43
  ## Chain fork
42
44
 
43
- `hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, and `go` (per platform).
45
+ `hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, `go`, and `java` (per platform).
@@ -6,7 +6,7 @@
6
6
 
7
7
  - [ ] **SoT:** правки в `packages/…` (не только root `.cursor/`)
8
8
  - [ ] **Core:** если менялся `_shared/core/**` — обновлены все `<!-- shared-core: … -->` consumers (или documented intentional fork)
9
- - [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, and go — см. `preset-twin-sync`)
9
+ - [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, go, and java — см. `preset-twin-sync`)
10
10
  - [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table актуален
11
11
  - [ ] **Token budget:** alwaysApply / session-start ≤ 3; meta rules not always-on
12
12
  - [ ] **Leakage:** нет чужих stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
@@ -9,6 +9,7 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
9
9
  | `next` | `presets/cursor/next/rules/*.mdc` | `presets/claude/next/rules/<topic>/` | **Required** in `claude/next/rules/README.md` |
10
10
  | `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
11
11
  | `go` | `presets/cursor/go/rules/*.mdc` | `presets/claude/go/rules/<topic>/` | Keep in `claude/go/rules/README.md` |
12
+ | `java` | `presets/cursor/java/rules/*.mdc` | `presets/claude/java/rules/<topic>/` | Keep in `claude/java/rules/README.md` |
12
13
 
13
14
  ## Same-PR checklist
14
15
 
@@ -27,5 +28,6 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
27
28
  - **next:** missing Claude twin for a changed Cursor rule → **FAIL** (mapping table required).
28
29
  - **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
29
30
  - **go:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift; mapping table required).
31
+ - **java:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift / go; mapping table required).
30
32
 
31
33
  Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (not the reverse). Use `packages/ai-rules/scripts/sync-dogfood-cursor.sh`.
@@ -25,11 +25,11 @@ From `packages/ai-rules/`:
25
25
  yarn check:preset-structure
26
26
  ```
27
27
 
28
- Hard gates: twin-map (stacks include **go**), token-budget (alwaysApply/session-start = 3), leakage (`GO_FORBIDDEN_*`, chain forks go≠next≠ios-swift).
28
+ Hard gates: twin-map (stacks include **go**), token-budget (alwaysApply/session-start = 3), leakage (`GO_FORBIDDEN_*`, chain forks go≠next≠ios-swift≠java), shared-core drift (`AI_RULES_DRIFT_FAIL=1` via `check:preset-structure`).
29
29
 
30
30
  Document PASS/FAIL in `validation-report.md`.
31
31
 
32
- 9. **Root AGENTS template:** each installable preset (`cursor|claude` × `next|ios-swift|go`) must ship `REPO_AGENTS.md` when validating preset packaging → **FAIL** if missing.
33
- 10. **Hooks cookbook:** default `hooks.json` must **not** reference `hooks/examples/` → **FAIL** if it does.
34
- 11. **No react-performance on ios/go:** skill directory / required handoff must be absent under ios-swift and go → **FAIL** (leakage). Prefer `check:preset-leakage`.
35
- 12. **Rule eval (WARN):** `scripts/check-rule-eval.mjs` / `yarn check:rule-eval` should exist for maintainers; smoke optional. Hard fail only when the opt-in eval job runs — not part of default `check:preset-structure`.
32
+ 1. **Root AGENTS template:** each installable preset (`cursor|claude` × `next|ios-swift|go|java`) must ship `REPO_AGENTS.md` when validating preset packaging → **FAIL** if missing.
33
+ 2. **Hooks cookbook:** default `hooks.json` must **not** reference `hooks/examples/` → **FAIL** if it does.
34
+ 3. **No react-performance on ios/go/java:** skill directory / required handoff must be absent under ios-swift, go, and java → **FAIL** (leakage). Prefer `check:preset-leakage`.
35
+ 4. **Rule eval (WARN):** `scripts/check-rule-eval.mjs` / `yarn check:rule-eval` should exist for maintainers; smoke optional. Hard fail only when the opt-in eval job runs — not part of default `check:preset-structure`.
@@ -24,7 +24,7 @@ paths:
24
24
  ## Куда класть новое правило
25
25
 
26
26
  1. Общие принципы для всех стеков → **core** + адаптеры с `<!-- shared-core: … -->`.
27
- 2. Только один из installable стеков (`next` / `ios-swift` / `go`) → **stack-specific** (не в `_shared`).
27
+ 2. Только один из installable стеков (`next` / `ios-swift` / `go` / `java`) → **stack-specific** (не в `_shared`).
28
28
  3. Только Cursor или только Claude packaging → platform artifact / frontmatter, не дублировать семантику.
29
29
 
30
30
  ## SoT
@@ -17,7 +17,7 @@ paths:
17
17
 
18
18
  - `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
19
19
  - `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
20
- - `go` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
20
+ - `go` / `java` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
21
21
  - Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
22
22
 
23
23
  ## Forbidden in ios-swift hooks/agents (FAIL)
@@ -35,14 +35,16 @@ Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild`
35
35
  - `xcuitest-test-` as handoff stems
36
36
  - Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
37
37
 
38
- ## Forbidden in go hooks/agents (FAIL)
38
+ ## Forbidden in go / java hooks/agents (FAIL)
39
+
40
+ Shared backend-stack bans (both `go` and `java`):
39
41
 
40
42
  - `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
41
43
  - Positive yarn recipes `lint:js` / `lint:css`
42
44
  - `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
43
45
  - Agent file `accessibility-reviewer` (no UI surface)
44
46
 
45
- Required instead: `integration-test-*`; build-verifier / `post-change-test` / `go-tooling` (`go test`, `go vet`).
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`).
46
48
 
47
49
  ## Soft / document
48
50
 
@@ -51,8 +53,4 @@ Required instead: `integration-test-*`; build-verifier / `post-change-test` / `g
51
53
 
52
54
  ## Chain fork
53
55
 
54
- `hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, and `go` (per platform).
55
-
56
- ## Stack notes
57
-
58
- Forbidden positive handoffs on this stack are listed in core § go. Prefer `integration-test-*` and `post-change-test`.
56
+ `hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, `go`, and `java` (per platform).
@@ -17,7 +17,7 @@ paths:
17
17
 
18
18
  - [ ] **SoT:** правки в `packages/…` (не только root `.cursor/`)
19
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, and go — см. `preset-twin-sync`)
20
+ - [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, go, and java — см. `preset-twin-sync`)
21
21
  - [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table актуален
22
22
  - [ ] **Token budget:** alwaysApply / session-start ≤ 3; meta rules not always-on
23
23
  - [ ] **Leakage:** нет чужих stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
@@ -20,6 +20,7 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
20
20
  | `next` | `presets/cursor/next/rules/*.mdc` | `presets/claude/next/rules/<topic>/` | **Required** in `claude/next/rules/README.md` |
21
21
  | `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
22
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` |
23
24
 
24
25
  ## Same-PR checklist
25
26
 
@@ -38,5 +39,6 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
38
39
  - **next:** missing Claude twin for a changed Cursor rule → **FAIL** (mapping table required).
39
40
  - **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
40
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).
41
43
 
42
44
  Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (not the reverse). Use `packages/ai-rules/scripts/sync-dogfood-cursor.sh`.
@@ -10,34 +10,16 @@
10
10
  { "agent": "build-verifier", "label": "go test / go vet / golangci-lint", "model": "cheap" },
11
11
  { "agent": "security-reviewer", "label": "Security review", "model": "strong" },
12
12
  { "agent": "code-reviewer", "label": "Code review", "model": "cheap" },
13
- { "agent": "qa-tester", "label": "Integration tests", "scope": "e2e-only" }
13
+ { "agent": "qa-tester", "label": "Integration tests", "scope": "e2e-only" },
14
+ { "agent": "integration-test-planner", "label": "Plan integration coverage" },
15
+ { "agent": "integration-test-generator", "label": "Generate integration tests" }
14
16
  ],
15
17
  "humanGates": ["after:task-analyst"],
16
18
  "autoChain": true,
17
19
  "skipped": [
18
20
  {
19
- "agent": "playwright-test-planner",
20
- "reason": "Go backend uses integration-test-* not Playwright"
21
- },
22
- {
23
- "agent": "playwright-test-generator",
24
- "reason": "Go backend uses integration-test-*"
25
- },
26
- {
27
- "agent": "playwright-test-healer",
28
- "reason": "Go backend uses integration-test-*"
29
- },
30
- {
31
- "agent": "xcuitest-test-planner",
32
- "reason": "Go backend uses integration-test-* — not XCUITest"
33
- },
34
- {
35
- "agent": "xcuitest-test-generator",
36
- "reason": "Go backend uses integration-test-*"
37
- },
38
- {
39
- "agent": "xcuitest-test-healer",
40
- "reason": "Go backend uses integration-test-*"
21
+ "agent": "accessibility-reviewer",
22
+ "reason": "Go backend has no UI surface"
41
23
  }
42
24
  ]
43
25
  }
@@ -35,11 +35,11 @@ When validating **ios-swift preset** changes (or `scope: preset-structure-valida
35
35
  3. **Forbidden handoff strings** in ios-swift `chain-team-phases.sh`: `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`, positive `lint:js` / `lint:css` recipes. See `tooling-and-review/preset-no-cross-stack-leakage.md`.
36
36
  4. **Required handoff stems:** `AGENT_HANDOFF` must include `xcuitest-test-planner` (or generator/healer); build-verifier mentions `xcodebuild` or `post-change-build` / `xcode-tooling`.
37
37
  5. **Roster:** 21 agent stems; no `playwright-test-*` under ios-swift `agents/`.
38
- 6. **Twin presence (hard):** Cursor rule change → Claude twin same PR — **FAIL** if missing (next, ios-swift, and go).
38
+ 6. **Twin presence (hard):** Cursor rule change → Claude twin same PR — **FAIL** if missing (next, ios-swift, go, and java).
39
39
  7. **Mapping / README:** Cursor→Claude mapping table present; core→stack mapping when `_shared` consumers exist.
40
40
  8. **shared-core consumers:** if `_shared/core/**` changed, update all `<!-- shared-core: … -->` consumers (or document intentional fork).
41
41
  9. **Session-start body budget:** sum of the **3** intended session-start rule bodies ≤ **120** lines (stretch ≤100); do **not** include `**/README.md` — record in report.
42
- 10. **Embed drift (soft by default):** `packages/ai-rules/scripts/check-shared-core-drift.sh`; `AI_RULES_DRIFT_FAIL=1` to enforce.
42
+ 10. **Embed drift (hard in `check:preset-structure`):** `packages/ai-rules/scripts/check-shared-core-drift.sh` with `AI_RULES_DRIFT_FAIL=1`.
43
43
  11. **Dogfood (monorepo soft):** `packages/ai-rules/scripts/sync-dogfood-cursor.sh`; mass deletion without migration doc → risk / FAIL for maintainers.
44
44
 
45
45
  ### Soft rules (do not FAIL alone)
@@ -47,11 +47,10 @@ When validating **ios-swift preset** changes (or `scope: preset-structure-valida
47
47
  - **Thin aliases:** `agent-team-intake`, `technical-retro` may be &lt;15 body lines. Enforce ≥15 on **domain** rules.
48
48
  - Embed vs lineage: `docs/PRESET-CONTRIBUTION.md`, `_shared/README.md`.
49
49
 
50
-
51
- 9. **Root AGENTS template:** each installable preset (`cursor|claude` × `next|ios-swift|go`) must ship `REPO_AGENTS.md` when validating preset packaging → **FAIL** if missing.
52
- 10. **Hooks cookbook:** default `hooks.json` must **not** reference `hooks/examples/` → **FAIL** if it does.
53
- 11. **No react-performance on ios/go:** skill directory / required handoff must be absent under ios-swift and go **FAIL** (leakage). Prefer `check:preset-leakage`.
54
- 12. **Rule eval (WARN):** `scripts/check-rule-eval.mjs` / `yarn check:rule-eval` should exist for maintainers; smoke optional. Hard fail only when the opt-in eval job runs — not part of default `check:preset-structure`.
50
+ 12. **Root AGENTS template:** each installable preset (`cursor|claude` × `next|ios-swift|go|java`) must ship `REPO_AGENTS.md` when validating preset packaging → **FAIL** if missing.
51
+ 13. **Hooks cookbook:** default `hooks.json` must **not** reference `hooks/examples/` → **FAIL** if it does.
52
+ 14. **No react-performance on ios/go/java:** skill directory / required handoff must be absent under ios-swift, go, and java → **FAIL** (leakage). Prefer `check:preset-leakage`.
53
+ 15. **Rule eval (WARN):** `scripts/check-rule-eval.mjs` / `yarn check:rule-eval` should exist for maintainers; smoke optional. Hard fail only when the opt-in eval job runs not part of default `check:preset-structure`.
55
54
 
56
55
  ## Output
57
56
 
@@ -4,40 +4,17 @@ description: Базовые принципы, стек и структура iOS
4
4
 
5
5
  # Стек и окружение
6
6
 
7
- Версии Swift, iOS SDK, зависимостей и инструментов**из Xcode-проекта, Package.swift и конфигов целевого репозитория**. Рамка preset:
8
-
9
- - **Язык / платформа:** Swift, iOS (min — из таргета).
10
- - **UI:** SwiftUI — приоритет для нового кода; UIKit — где уже принято в репо.
11
- - **Сборка:** Xcode; SPM и/или CocoaPods — как в репозитории.
12
- - **Concurrency:** `async`/`await`, `Task`, `Actor`; UI — `@MainActor`.
13
- - **Тесты:** XCTest или Swift Testing; UI — XCUITest.
14
- - **Сеть:** `URLSession` или клиент репо; DTO через `Codable`.
15
- - **Дизайн-система:** токены/примитивы из `DesignSystem/` (или аналога); без «магических» значений.
16
- - **Наблюдаемость:** только если уже в проекте — централизованно.
7
+ Версии — **из Xcode / Package.swift / конфигов репо**. Рамка: Swift, iOS; SwiftUI приоритет (UIKit где принято); Xcode + SPM/CocoaPods как в репо; `async`/`await`, `@MainActor`; XCTest/Swift Testing + XCUITest; сеть `URLSession`/`Codable`; UI токены `DesignSystem/`; наблюдаемость только если уже в проекте.
17
8
 
18
9
  # Структура проекта
19
10
 
20
- Ориентир — **feature-first + слои внутри фичи** или **слои на верхнем уровне** (как в репо):
21
-
22
- - `App/` — `@main`, composition root, DI, навигация верхнего уровня.
23
- - `Features/<FeatureName>/` — `Presentation/` (Views, ViewModels), `Domain/` (entities, use cases, протоколы), `Data/` (repos, API, DTO, mappers).
24
- - `Core/` — общие утилиты, extensions, базовые ошибки.
25
- - `DesignSystem/` — UI-примитивы без бизнес-логики.
26
- - `Tests/` / `*Tests/` — unit и UI по конвенции Xcode.
27
-
28
- Новые файлы — в том же слое/модуле, что и аналогичная функциональность.
29
-
30
- Границы зависимостей и DI — **`architecture/boundaries.md`**.
11
+ Feature-first или слои сверху (как в репо): `App/` (composition root), `Features/<Name>/` (Presentation / Domain / Data), `Core/`, `DesignSystem/`, `Tests/`. Новые файлы — рядом с аналогами. Границы/DI — **`architecture/boundaries.md`**.
31
12
 
32
13
  # Swift и качество
33
14
 
34
- - Swift API Design Guidelines + SwiftLint/SwiftFormat репо (если есть).
35
- - Избегать `!` / `try!` в production; `guard` / `if let` / typed errors.
36
- - Копировать существующие паттерны фичи/слоя.
15
+ API Design Guidelines + SwiftLint/SwiftFormat репо; без `!`/`try!` в production; `guard` / typed errors; паттерны соседних файлов.
37
16
 
38
17
  # Работа агента
39
18
 
40
- - Определить слой (Presentation / Domain / Data / DesignSystem / Tests); повторить паттерн соседних файлов.
41
- - Не тянуть `URLSession` во View и DTO во ViewModelдетали в `architecture/boundaries.md`.
42
- - Доставка фичи — `architecture/feature-delivery.md`; после правок Swift — **вызвать** `tooling-and-review/post-change-build.md` (requestable).
43
- - Toolchain перед сборкой — `tooling-and-review/xcode-tooling.md` (requestable).
19
+ - Слой паттерн соседей; без `URLSession` во View и DTO во ViewModel (`architecture/boundaries.md`).
20
+ - Фичи: `architecture/feature-delivery.md`; после Swift **вызвать** `tooling-and-review/post-change-build.md`; toolchain — `tooling-and-review/xcode-tooling.md`.
@@ -24,7 +24,7 @@ paths:
24
24
  ## Куда класть новое правило
25
25
 
26
26
  1. Общие принципы для всех стеков → **core** + адаптеры с `<!-- shared-core: … -->`.
27
- 2. Только один из installable стеков (`next` / `ios-swift` / `go`) → **stack-specific** (не в `_shared`).
27
+ 2. Только один из installable стеков (`next` / `ios-swift` / `go` / `java`) → **stack-specific** (не в `_shared`).
28
28
  3. Только Cursor или только Claude packaging → platform artifact / frontmatter, не дублировать семантику.
29
29
 
30
30
  ## SoT
@@ -17,7 +17,7 @@ paths:
17
17
 
18
18
  - `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
19
19
  - `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
20
- - `go` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
20
+ - `go` / `java` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
21
21
  - Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
22
22
 
23
23
  ## Forbidden in ios-swift hooks/agents (FAIL)
@@ -35,14 +35,16 @@ Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild`
35
35
  - `xcuitest-test-` as handoff stems
36
36
  - Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
37
37
 
38
- ## Forbidden in go hooks/agents (FAIL)
38
+ ## Forbidden in go / java hooks/agents (FAIL)
39
+
40
+ Shared backend-stack bans (both `go` and `java`):
39
41
 
40
42
  - `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
41
43
  - Positive yarn recipes `lint:js` / `lint:css`
42
44
  - `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
43
45
  - Agent file `accessibility-reviewer` (no UI surface)
44
46
 
45
- Required instead: `integration-test-*`; build-verifier / `post-change-test` / `go-tooling` (`go test`, `go vet`).
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`).
46
48
 
47
49
  ## Soft / document
48
50
 
@@ -51,4 +53,4 @@ Required instead: `integration-test-*`; build-verifier / `post-change-test` / `g
51
53
 
52
54
  ## Chain fork
53
55
 
54
- `hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, and `go` (per platform).
56
+ `hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, `go`, and `java` (per platform).
@@ -17,7 +17,7 @@ paths:
17
17
 
18
18
  - [ ] **SoT:** правки в `packages/…` (не только root `.cursor/`)
19
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, and go — см. `preset-twin-sync`)
20
+ - [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, go, and java — см. `preset-twin-sync`)
21
21
  - [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table актуален
22
22
  - [ ] **Token budget:** alwaysApply / session-start ≤ 3; meta rules not always-on
23
23
  - [ ] **Leakage:** нет чужих stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
@@ -20,6 +20,7 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
20
20
  | `next` | `presets/cursor/next/rules/*.mdc` | `presets/claude/next/rules/<topic>/` | **Required** in `claude/next/rules/README.md` |
21
21
  | `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
22
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` |
23
24
 
24
25
  ## Same-PR checklist
25
26
 
@@ -38,5 +39,6 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
38
39
  - **next:** missing Claude twin for a changed Cursor rule → **FAIL** (mapping table required).
39
40
  - **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
40
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).
41
43
 
42
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
+ # Java hexagonal (Claude)
2
+
3
+ Preset for Java backends using ports & adapters (Spring Boot default).
4
+
5
+ **Repo-root agents:** see [`AGENTS.md`](../../AGENTS.md) at the project root.
6
+
7
+ - Session-start: `java-app-core`, `architecture/boundaries`, `code-quality` (exactly 3).
8
+ - Delivery: `architecture/feature-delivery.md` + skill `feature-delivery`.
9
+ - After Java edits: `tooling-and-review/post-change-test.md` (+ `java-tooling`).
10
+ - Integration tests: agents `integration-test-*` + skill `integration-testing` (never Playwright/XCUITest).
11
+ - Unit tests: agents `unit-test-*` + skill `unit-testing` (JUnit 5).
12
+ - ADR: skill `write-adr` (on-demand).
13
+ - How does X work: agent `codebase-analyzer` (explain-as-is; no `/task`).
14
+
15
+ ## Inventory
16
+
17
+ - **21 agents** — `agents/README.md` (no a11y / Playwright / XCUITest)
18
+ - **8 skills** — feature-delivery, unit-testing, integration-testing, ci-investigation, debug-investigation, code-review, technical-retro, write-adr
19
+ - **5 commands** — `/task`, `/task-continue`, `/feature-start`, `/feature-continue`, `/technical-retro`
20
+
21
+ ## Dogfood (5 scenarios)
22
+
23
+ 1. `/task` — domain use case through ports, adapters, configuration.
24
+ 2. HTTP DTO mapping bug — debugger + MockMvc/focused controller test.
25
+ 3. Repository contract — integration-test trio (Testcontainers).
26
+ 4. JUnit 5 unit test for use case with port fake/mock.
27
+ 5. Secrets/authz logging — `security-reviewer` + `security-java`.
28
+
29
+ Init: `npx @bonesofspring/ai-rules init claude --preset java` (also copies `REPO_AGENTS.md` → root `AGENTS.md`).
@@ -0,0 +1,13 @@
1
+ # MCP (preset `java`, Claude)
2
+
3
+ Копируется в `.mcp.json` при `ai-rules init claude --preset java`.
4
+
5
+ ## Servers
6
+
7
+ | Name | Package | Зачем |
8
+ |------|---------|--------|
9
+ | `context7` | `@upstash/context7-mcp` | Актуальная документация Java / Spring / JDK / популярных библиотек |
10
+
11
+ Figma и browser e2e MCP (Playwright / Chrome DevTools) **не** входят в java-пресет (backend-only).
12
+
13
+ Секреты в файл не кладём. Опционально: `CONTEXT7_API_KEY` в окружении.
@@ -0,0 +1,26 @@
1
+ # Preset `java` (Claude)
2
+
3
+ Installable Claude Code preset for **Java hexagonal** services (Spring Boot default).
4
+
5
+ ```bash
6
+ npx @bonesofspring/ai-rules init claude --preset java
7
+ ```
8
+
9
+ ## Layout
10
+
11
+ | Path | Role |
12
+ |------|------|
13
+ | `rules/<topic>/` | Derived twins + mapping table in `rules/README.md` |
14
+ | `rules/ui-and-accessibility/` | N/A stub (backend) |
15
+ | `agents/` | 21 agents + README (no a11y / Playwright / XCUITest) |
16
+ | `skills/` | 8 skills + README |
17
+ | `commands/` | 5 slash commands |
18
+ | `team/` | conventions + fixtures |
19
+ | `hooks/` | Shell guard + team chain (byte-forked); **no `hooks.json`** (Claude platform limit) |
20
+ | `REPO_AGENTS.md` | → consumer root `AGENTS.md` |
21
+ | `CLAUDE.md` | Thin Claude entry + inventory / dogfood — **Claude-only** |
22
+ | `MCP.md` / `mcp.json` | Context7 only |
23
+
24
+ **Platform asymmetry:** `CLAUDE.md` is Claude-only. Cursor SoT has `BUGBOT.md` + `hooks.json` (not shipped here).
25
+
26
+ Cursor SoT: `presets/cursor/java/`. Contribution: `docs/PRESET-CONTRIBUTION.md`.
@@ -0,0 +1,45 @@
1
+ # Java — agent instructions
2
+
3
+ Cross-tool repo-root guide for the **java** hexagonal preset (Spring Boot default). Tool-specific maps stay under `.cursor/AGENTS.md` and `.claude/CLAUDE.md`.
4
+
5
+ ## Cross-tool setup
6
+
7
+ - Treat this file as the **shared** entry for any agent (Cursor, Claude Code, or other).
8
+ - Install:
9
+
10
+ ```bash
11
+ npx @bonesofspring/ai-rules init cursor --preset java
12
+ npx @bonesofspring/ai-rules init claude --preset java
13
+ ```
14
+
15
+ `init` overwrites this file from the preset (`REPO_AGENTS.md` → `AGENTS.md`).
16
+
17
+ ## Commands (test / verify)
18
+
19
+ Detect Maven vs Gradle from the repo (`pom.xml` vs `build.gradle(.kts)`); prefer wrappers.
20
+
21
+ | Gate | Typical command |
22
+ |------|-----------------|
23
+ | Tests | `./mvnw test` or `./gradlew test` |
24
+ | Verify/check (if configured) | `./mvnw verify` or `./gradlew check` |
25
+ | Post-change | requestable `post-change-test` + `java-tooling` |
26
+
27
+ Static analysis — only tools already configured in the repo/CI.
28
+
29
+ ## Security basics
30
+
31
+ - Do not commit secrets (`.env`, tokens, credentials).
32
+ - Review destructive git before running; respect shell hooks.
33
+
34
+ ## Tool entry points
35
+
36
+ | Tool | Map |
37
+ |------|-----|
38
+ | Cursor | `.cursor/AGENTS.md` |
39
+ | Claude Code | `.claude/CLAUDE.md` |
40
+
41
+ Rules: `.cursor/rules/` or `.claude/rules/`. Integration tests: `integration-test-*` (never Playwright/XCUITest).
42
+
43
+ ## Living conventions
44
+
45
+ Gotchas and team decisions: `.cursor/team/conventions.md` and/or `.claude/team/conventions.md` (fill after init; fixtures ship with the preset).
@@ -0,0 +1,32 @@
1
+ # `.claude/agents` (preset java)
2
+
3
+ Ролевые subagents для командного пайплайна Claude Code (Java hexagonal).
4
+
5
+ ## Analysis (on-demand)
6
+
7
+ | Agent | Файл | Production-код |
8
+ |-------|------|----------------|
9
+ | Codebase analyzer | `codebase-analyzer.md` | no (explain-as-is only) |
10
+
11
+ ## Roster (21)
12
+
13
+ | Agent | Production writes |
14
+ |-------|-------------------|
15
+ | task-router, task-analyst, solution-architect | team only |
16
+ | codebase-analyzer | no (explain-as-is only) |
17
+ | feature-developer | yes (Java sources) |
18
+ | build-verifier | no (report only) |
19
+ | debugger, ci-investigator | minimal |
20
+ | code-reviewer, security-reviewer, performance-auditor | team only |
21
+ | migration-specialist, api-contract-reviewer, tech-writer | team / docs |
22
+ | qa-tester, unit-test-*, integration-test-* | tests |
23
+
24
+ **No** `accessibility-reviewer`, Playwright, or XCUITest stems. Replace those intents with **`integration-test-*`**.
25
+
26
+ ## Model matrix
27
+
28
+ | Tier | Agents |
29
+ |------|--------|
30
+ | **cheap** | router, analyst, build-verifier, code-reviewer, tech-writer, codebase-analyzer |
31
+ | **standard** | developer, debugger, ci-investigator, api-contract, qa, unit-*, integration-* |
32
+ | **strong** | solution-architect, migration-specialist, security-reviewer, performance-auditor |