@eltonssouza/development-utility-kit 1.0.0

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 (137) hide show
  1. package/.claude/agents/analyst.md +198 -0
  2. package/.claude/agents/backend-developer.md +126 -0
  3. package/.claude/agents/brain-keeper.md +229 -0
  4. package/.claude/agents/code-reviewer.md +181 -0
  5. package/.claude/agents/database-engineer.md +94 -0
  6. package/.claude/agents/devops-engineer.md +141 -0
  7. package/.claude/agents/frontend-developer.md +97 -0
  8. package/.claude/agents/gate-keeper.md +118 -0
  9. package/.claude/agents/migrator.md +291 -0
  10. package/.claude/agents/mobile-developer.md +80 -0
  11. package/.claude/agents/n8n-specialist.md +94 -0
  12. package/.claude/agents/product-owner.md +115 -0
  13. package/.claude/agents/qa-engineer.md +232 -0
  14. package/.claude/agents/release-engineer.md +204 -0
  15. package/.claude/agents/scaffold.md +87 -0
  16. package/.claude/agents/security-engineer.md +199 -0
  17. package/.claude/agents/sprint-runner.md +44 -0
  18. package/.claude/agents/stack-resolver.md +84 -0
  19. package/.claude/agents/tech-lead.md +182 -0
  20. package/.claude/agents/update-template.md +54 -0
  21. package/.claude/agents/ux-designer.md +118 -0
  22. package/.claude/settings.json +44 -0
  23. package/.claude/skills/README.md +332 -0
  24. package/.claude/skills/active-project/SKILL.md +129 -0
  25. package/.claude/skills/api-integration-test/SKILL.md +64 -0
  26. package/.claude/skills/auto-test-guard/SKILL.md +237 -0
  27. package/.claude/skills/auto-test-guard/resources/backend-tests.md +20 -0
  28. package/.claude/skills/auto-test-guard/resources/e2e-tests.md +24 -0
  29. package/.claude/skills/auto-test-guard/resources/execution-report.md +49 -0
  30. package/.claude/skills/auto-test-guard/resources/frontend-tests.md +18 -0
  31. package/.claude/skills/auto-test-guard/resources/initial-setup.md +108 -0
  32. package/.claude/skills/auto-test-guard/resources/run-suite.md +48 -0
  33. package/.claude/skills/auto-test-guard/resources/senior-gate.md +19 -0
  34. package/.claude/skills/brain-keeper/SKILL.md +60 -0
  35. package/.claude/skills/brain-keeper/obsidian/app.json +9 -0
  36. package/.claude/skills/brain-keeper/obsidian/appearance.json +4 -0
  37. package/.claude/skills/brain-keeper/obsidian/core-plugins.json +20 -0
  38. package/.claude/skills/brain-keeper/obsidian/daily-notes.json +5 -0
  39. package/.claude/skills/brain-keeper/obsidian/graph.json +32 -0
  40. package/.claude/skills/brain-keeper/obsidian/snippets/folder-colors.css +90 -0
  41. package/.claude/skills/brain-keeper/obsidian/templates.json +5 -0
  42. package/.claude/skills/brain-keeper/templates/README.md +51 -0
  43. package/.claude/skills/brain-keeper/templates/adr.md +40 -0
  44. package/.claude/skills/brain-keeper/templates/bug.md +35 -0
  45. package/.claude/skills/brain-keeper/templates/daily.md +38 -0
  46. package/.claude/skills/brain-keeper/templates/feature.md +62 -0
  47. package/.claude/skills/brain-keeper/templates/meeting.md +34 -0
  48. package/.claude/skills/brain-keeper/templates/tech-debt.md +21 -0
  49. package/.claude/skills/caveman/SKILL.md +187 -0
  50. package/.claude/skills/create-stack-pack/SKILL.md +281 -0
  51. package/.claude/skills/grill-me/SKILL.md +79 -0
  52. package/.claude/skills/honcho-memory/SKILL.md +207 -0
  53. package/.claude/skills/honcho-memory/docs/api-endpoints-verified.md +75 -0
  54. package/.claude/skills/honcho-memory/hooks/on-prompt-submit.js +221 -0
  55. package/.claude/skills/honcho-memory/hooks/on-stop.js +193 -0
  56. package/.claude/skills/honcho-memory/lib/honcho-client.js +363 -0
  57. package/.claude/skills/honcho-memory/lib/memory-injector.js +93 -0
  58. package/.claude/skills/honcho-memory/package.json +32 -0
  59. package/.claude/skills/honcho-memory/scripts/cli.js +370 -0
  60. package/.claude/skills/honcho-memory/scripts/setup.js +109 -0
  61. package/.claude/skills/honcho-memory/tests/t001-api-endpoints-verified.test.js +89 -0
  62. package/.claude/skills/honcho-memory/tests/t002-structure.test.js +97 -0
  63. package/.claude/skills/honcho-memory/tests/t003-honcho-client.test.js +162 -0
  64. package/.claude/skills/honcho-memory/tests/t004-soft-delete.test.js +259 -0
  65. package/.claude/skills/honcho-memory/tests/t005-memory-injector.test.js +175 -0
  66. package/.claude/skills/honcho-memory/tests/t006-on-prompt-submit.test.js +215 -0
  67. package/.claude/skills/honcho-memory/tests/t007-on-stop.test.js +165 -0
  68. package/.claude/skills/honcho-memory/tests/t008-cli.test.js +214 -0
  69. package/.claude/skills/honcho-memory/tests/t009-setup.test.js +232 -0
  70. package/.claude/skills/honcho-memory/tests/t010-skill-md.test.js +114 -0
  71. package/.claude/skills/honcho-memory/tests/t011-settings-hooks.test.js +105 -0
  72. package/.claude/skills/honcho-memory/tests/t012-docs-update.test.js +106 -0
  73. package/.claude/skills/honcho-memory/tests/t013-smoke-e2e.test.js +90 -0
  74. package/.claude/skills/pair-debug/SKILL.md +288 -0
  75. package/.claude/skills/prd-ready-check/SKILL.md +58 -0
  76. package/.claude/skills/project-manager/SKILL.md +167 -0
  77. package/.claude/skills/quality-standards/SKILL.md +201 -0
  78. package/.claude/skills/quick-feature/SKILL.md +264 -0
  79. package/.claude/skills/run-sprint/SKILL.md +342 -0
  80. package/.claude/skills/scaffold/SKILL.md +58 -0
  81. package/.claude/skills/stack-discovery/SKILL.md +159 -0
  82. package/.claude/skills/test-coverage-auditor/SKILL.md +59 -0
  83. package/.claude/skills/to-issues/SKILL.md +163 -0
  84. package/.claude/skills/to-prd/SKILL.md +130 -0
  85. package/.claude/skills/update-template/SKILL.md +254 -0
  86. package/.claude/stacks/CODEOWNERS +30 -0
  87. package/.claude/stacks/README.md +88 -0
  88. package/.claude/stacks/_template.md +116 -0
  89. package/.claude/stacks/java/spring-boot-3.md +376 -0
  90. package/.claude/stacks/java/spring-boot-4.md +438 -0
  91. package/.claude/stacks/typescript/angular-18.md +420 -0
  92. package/.claude/stacks/typescript/angular-19.md +397 -0
  93. package/.claude/stacks/typescript/angular-21.md +494 -0
  94. package/CLAUDE.md +453 -0
  95. package/README.md +391 -0
  96. package/bin/cli.js +773 -0
  97. package/bin/lib/backup.js +62 -0
  98. package/bin/lib/detect-stack.js +476 -0
  99. package/bin/lib/help.js +233 -0
  100. package/bin/lib/identity.js +108 -0
  101. package/bin/lib/local-dir.js +69 -0
  102. package/bin/lib/manifest.js +236 -0
  103. package/bin/lib/sync-all.js +394 -0
  104. package/bin/lib/version-check.js +398 -0
  105. package/dashboard/db.js +199 -0
  106. package/dashboard/package.json +22 -0
  107. package/dashboard/public/app.js +709 -0
  108. package/dashboard/public/content/docs/agents-reference.en.md +911 -0
  109. package/dashboard/public/content/docs/architecture-overview.en.md +260 -0
  110. package/dashboard/public/content/docs/autonomy-matrix.en.md +186 -0
  111. package/dashboard/public/content/docs/git-flow.en.md +525 -0
  112. package/dashboard/public/content/docs/honcho-memory.en.md +394 -0
  113. package/dashboard/public/content/docs/hooks-reference.en.md +420 -0
  114. package/dashboard/public/content/docs/pipeline.en.md +400 -0
  115. package/dashboard/public/content/docs/quality-gate.en.md +315 -0
  116. package/dashboard/public/content/docs/skills-reference.en.md +500 -0
  117. package/dashboard/public/content/docs/stack-rules.en.md +362 -0
  118. package/dashboard/public/content/docs/troubleshooting.en.md +637 -0
  119. package/dashboard/public/content/manifest.json +102 -0
  120. package/dashboard/public/content/manual/backend.en.md +1138 -0
  121. package/dashboard/public/content/manual/existing-project.en.md +831 -0
  122. package/dashboard/public/content/manual/frontend.en.md +1065 -0
  123. package/dashboard/public/content/manual/fullstack.en.md +1508 -0
  124. package/dashboard/public/content/manual/mobile.en.md +866 -0
  125. package/dashboard/public/index.html +108 -0
  126. package/dashboard/public/style.css +610 -0
  127. package/dashboard/public/vendor/marked.min.js +69 -0
  128. package/dashboard/rtk.js +143 -0
  129. package/dashboard/server-app.js +403 -0
  130. package/dashboard/server.js +104 -0
  131. package/dashboard/test/sprint1.test.js +406 -0
  132. package/dashboard/test/sprint2.test.js +571 -0
  133. package/dashboard/test/sprint3.test.js +560 -0
  134. package/package.json +33 -0
  135. package/scripts/hooks/subagent-telemetry.sh +14 -0
  136. package/scripts/hooks/telemetry-writer.js +250 -0
  137. package/scripts/latest-versions.json +56 -0
@@ -0,0 +1,1138 @@
1
+ # Backend Manual — Java 25 + Spring Boot 4
2
+
3
+ This manual is the definitive starting point for any backend developer who
4
+ opens the `development-utility-kit` dashboard for the first time. It covers the
5
+ backend flow only (Java 25 + Spring Boot 4 + DDD), with no fluff and no
6
+ generic examples. Every command, trigger, and agent reference here was
7
+ checked against the real harness code — nothing was invented.
8
+
9
+ Prerequisites before you start:
10
+
11
+ - JDK 25 or higher installed (`java -version` should respond 25+)
12
+ - Maven 3.9+ (`mvn -v`) — the `./mvnw` wrapper is generated by the scaffold
13
+ - Docker Desktop + Docker Compose v2 (for Testcontainers + local stack)
14
+ - Node.js 18+ (required by the `duk` binary distributed via npx)
15
+ - Cowork (recommended) **or** Claude Code CLI (`claude`) authenticated
16
+
17
+ If any of these are missing, **stop here** and install them first. The
18
+ harness assumes the environment is already healthy.
19
+
20
+ ---
21
+
22
+ ## 1. Five-minute onboarding
23
+
24
+ This is the shortest path from "I have an empty folder" to "I have a Spring
25
+ Boot 4 backend with a senior+ gate running". Five steps, every command real.
26
+
27
+ ### Step 1 — Create or enter the canonical project folder
28
+
29
+ Every new project lives in `C:\development\source\projects\<name>\`. If the
30
+ folder doesn't exist yet:
31
+
32
+ ```bash
33
+ mkdir -p C:\development\source\projects\my-backend-api
34
+ cd C:\development\source\projects\my-backend-api
35
+ git init
36
+ ```
37
+
38
+ If you prefer the guided scaffold, use the interactive wrapper:
39
+
40
+ ```bash
41
+ # Windows (CMD or double-click)
42
+ C:\development\tools\development-utility-kit\scripts\new-project.bat
43
+
44
+ # Git Bash / WSL / Mac / Linux
45
+ bash /c/development/tools/development-utility-kit/scripts/new-project.sh
46
+ ```
47
+
48
+ ### Step 2 — Install the harness into the folder
49
+
50
+ The `duk` binary (installed via npx) injects `.claude/`, `CLAUDE.md`, and
51
+ the skill/agent settings. It is idempotent — run it as often as you like.
52
+
53
+ ```bash
54
+ # Recommended form (no global install):
55
+ npx @eltonssouza/development-utility-kit install
56
+
57
+ # If the duk binary is already on PATH:
58
+ duk install
59
+
60
+ # Preview what would be modified (writes nothing):
61
+ duk install --dry-run
62
+
63
+ # Install into a subdirectory only (e.g. monorepo):
64
+ duk install --sub backend
65
+ ```
66
+
67
+ Expected output: creation of `.claude/`, `CLAUDE.md`, `docs/`, and a backup
68
+ `.claude.backup-YYYYMMDD-HHMMSS/` if previous configuration existed.
69
+
70
+ ### Step 3 — Edit the `Project Identity` section of `CLAUDE.md`
71
+
72
+ This is the **only section** of `CLAUDE.md` you should edit by hand. The
73
+ remaining sections are harness-owned and will be overwritten on
74
+ `update-template` (the `Project Identity` section is preserved by the merge).
75
+
76
+ Open `CLAUDE.md` and fill in:
77
+
78
+ ```markdown
79
+ ## Project Identity
80
+
81
+ - **Project name**: `my-backend-api`
82
+ - **Project type**: `backend`
83
+ - **Primary stack**: `Java 25 + Spring Boot 4`
84
+ - **Database**: `PostgreSQL 17 + Redis 7`
85
+ - **Domain**: `e-commerce`
86
+ - **Team size**: `3 backend`
87
+ - **Additional rules**: _(leave empty if none)_
88
+ ```
89
+
90
+ The `Project type` field is decisive — bootstrap skills read this value to
91
+ decide what to scaffold.
92
+
93
+ ### Step 4 — Open Cowork or Claude Code in the folder
94
+
95
+ In any terminal **inside** the project folder:
96
+
97
+ ```bash
98
+ # Claude Code CLI:
99
+ claude
100
+
101
+ # OR open the folder in Cowork as a local session
102
+ ```
103
+
104
+ You are ready for the first conversation.
105
+
106
+ ### Step 5 — First prompt: scaffold the backend
107
+
108
+ Type **literally** into the chat:
109
+
110
+ ```text
111
+ scaffolda o backend
112
+ ```
113
+
114
+ (Yes — the trigger phrase is Portuguese by design; the skill matches the
115
+ keyword regardless of UI language. The English alias `scaffold the backend`
116
+ also works.)
117
+
118
+ The `bootstrap-backend-java` skill fires by keyword match, reads
119
+ `Project Identity`, calls Spring Initializr (Spring Boot 4.0+, Java 25+),
120
+ and generates:
121
+
122
+ ```
123
+ backend/
124
+ ├── pom.xml (Spring Boot 4 parent, Java 25)
125
+ ├── src/main/java/com/<org>/<app>/
126
+ │ ├── domain/ (model, repository ports)
127
+ │ ├── application/ (use cases, record DTOs)
128
+ │ ├── infrastructure/ (JPA adapters, security, config)
129
+ │ └── web/ (controllers, advice, ProblemDetail)
130
+ ├── src/main/resources/
131
+ │ ├── application.yml
132
+ │ └── db/migration/V1__init.sql (Flyway baseline)
133
+ ├── src/test/ (JUnit 5 + Mockito + Testcontainers)
134
+ └── README.md
135
+ docker-compose.yml (postgres + redis at root level)
136
+ ```
137
+
138
+ In parallel, the initial gate is configured: JaCoCo (coverage), Pitest
139
+ (mutation), SpotBugs, OWASP dependency-check. `gate-keeper` has what it
140
+ needs to live by from the very first commit.
141
+
142
+ From here on, you no longer touch the scaffold — every new iteration is via
143
+ chat prompt.
144
+
145
+ ---
146
+
147
+ ## 2. How the harness actually works
148
+
149
+ Before listing skills, understand the architecture. **There is no CLI
150
+ command that invokes a skill or an agent.** This is a common mistake.
151
+
152
+ ### The real `duk` CLI
153
+
154
+ The `duk` binary (in `bin/cli.js`) exposes exactly three commands:
155
+
156
+ | Command | Purpose |
157
+ |---|---|
158
+ | `duk install` | Injects `.claude/` + `CLAUDE.md` into CWD. Alias: `duk update`. |
159
+ | `duk install --sub backend` | Same, into a subfolder. |
160
+ | `duk install --dry-run` | Show the diff without writing. |
161
+ | `duk dashboard` | Start the local dashboard at `http://localhost:4242`. |
162
+ | `duk dashboard --port 4243 --no-open` | Custom port, no browser. |
163
+
164
+ There is **no** `duk grill-me`, `duk project-manager`, `duk run-sprint`, or
165
+ `duk <any-skill>`. Skills are not command-line entities — they are
166
+ `SKILL.md` files that Claude Code/Cowork **fires automatically by keyword
167
+ match in the user prompt**.
168
+
169
+ ### Skill vs Agent vs Task tool
170
+
171
+ | Layer | Lives in | How it's invoked |
172
+ |---|---|---|
173
+ | Skill | `.claude/skills/<name>/SKILL.md` | Keyword match in the user prompt |
174
+ | Agent | `.claude/agents/<name>.md` | Skill calls via Task tool (not directly by user) |
175
+ | Task tool | Claude Code built-in | Skills use it to delegate work to agents |
176
+
177
+ You talk to the skill in natural language. It delegates to the appropriate
178
+ agents through the Task tool. Agents do the real work (write code, run
179
+ tests, produce ADRs) and return to the skill, which returns to you.
180
+
181
+ ### Keyword → skill map
182
+
183
+ | Skill | Triggers (type literally; mixed PT/EN supported) |
184
+ |---|---|
185
+ | `bootstrap-backend-java` | `scaffolda o backend`, `scaffold the backend`, `bootstrap backend`, `start a Spring Boot backend` |
186
+ | `grill-me` | `grill me about <X>`, `interview me on <X>`, `stress-test the plan for <Y>`, `rubber duck` |
187
+ | `to-prd` | `generate PRD`, `create PRD`, `to-prd` |
188
+ | `to-issues` | `break into issues`, `generate issues`, `to-issues` |
189
+ | `run-sprint` | `run sprint 1`, `execute sprint 2 of PLAN_<X>.md`, `implement the sprint tasks` |
190
+ | `auto-test-guard` | `run the tests`, `generate tests`, `full suite`, `make sure nothing broke` |
191
+ | `prd-ready-check` | `ready for production?`, `DoD`, `can we ship`, `run the final checklist` |
192
+ | `api-integration-test` | `integration test`, `smoke test`, `bring everything up and test` |
193
+ | `pair-debug` | `let's debug <X>`, `investigate this bug`, `find the root cause`, `why doesn't this work` |
194
+ | `brain-keeper` | `record in the brain`, `update brain`, `daily log`, `save ADR to vault` |
195
+ | `active-project` | `/active-project <path>`, `activate project at <path>` |
196
+ | `update-template` | `update the template`, `sync with claude-code-agents`, `pull the new skills` |
197
+ | `project-manager` | catch-all — any prompt without a more specific skill |
198
+ | `caveman` | `caveman lite`, `caveman ultra`, `stop caveman` |
199
+ | `honcho-memory` | `remember that <fact>`, `memorize`, `never <X>`, `always <X>`, `/honcho save`, `/honcho list`, `/honcho status` |
200
+
201
+ ---
202
+
203
+ ## 3. Skills relevant to the backend
204
+
205
+ The master table below lists every skill relevant to a backend project.
206
+ Each one has a dedicated card in the following subsections.
207
+
208
+ | Skill | When to use | Output |
209
+ |---|---|---|
210
+ | `bootstrap-backend-java` | Empty folder, after first `duk install` | `backend/` Spring Boot 4 + compose |
211
+ | `grill-me` | Vague idea, before any PRD/PLAN | `docs/discovery/DISCOVERY_<NAME>.md` |
212
+ | `to-prd` | Discovery done, missing product doc | `docs/prd/PRD_<NAME>.md` |
213
+ | `to-issues` | PRD done, you want GitHub issues | `docs/issues/ISSUES_<NAME>.md` |
214
+ | `run-sprint` | PLAN ready with sprints defined | Code + green tests (TDD) |
215
+ | `auto-test-guard` | End of task or explicit gate request | Full suite + thresholds |
216
+ | `prd-ready-check` | Before tagging a release | GO/NO-GO verdict |
217
+ | `api-integration-test` | You want a real smoke (not unit) | curl report + logs |
218
+ | `pair-debug` | Non-obvious bug, intermittent failure | hypothesis→probe→fix loop |
219
+ | `brain-keeper` | End of sprint/feature, want history | `docs/brain/` daily + feature + ADR |
220
+ | `honcho-memory` | Persist preference/context cross-session | Persistent memory |
221
+ | `active-project` | Fast non-interactive adoption by path | `.claude/` installed at path |
222
+ | `update-template` | Pull new skills/agents from harness | Merge into `.claude/` + backup |
223
+ | `caveman` | You want telegraphic answers | Output 65-75% smaller |
224
+
225
+ ### 3.1. `bootstrap-backend-java`
226
+
227
+ **When to use:** first time in a new `type: backend` project, or whenever
228
+ you need the standard skeleton.
229
+
230
+ **Triggers:**
231
+
232
+ ```text
233
+ scaffold the backend
234
+ scaffolda o backend
235
+ bootstrap backend
236
+ start a Spring Boot backend
237
+ ```
238
+
239
+ **What it does:**
240
+
241
+ 1. Reads `CLAUDE.md` → `Project Identity` (name, stack, db).
242
+ 2. Calls Spring Initializr with Spring Boot 4.0+ / Java 25+.
243
+ 3. Creates DDD structure (`domain/`, `application/`, `infrastructure/`, `web/`).
244
+ 4. Adds `pom.xml` with JaCoCo, Pitest, SpotBugs, OWASP DC.
245
+ 5. Creates root `docker-compose.yml` with postgres + redis.
246
+ 6. Generates first Flyway migration (`V1__init.sql`).
247
+ 7. Configures `application.yml` (dev profile, datasource, actuator).
248
+ 8. Test stub with working Testcontainers Postgres.
249
+
250
+ **Typical chat output:**
251
+
252
+ ```text
253
+ [bootstrap-backend-java]
254
+ ✓ Read CLAUDE.md → my-backend-api / e-commerce
255
+ ✓ Spring Initializr → spring-boot 4.0.0, java 25
256
+ ✓ DDD structure created at backend/
257
+ ✓ pom.xml with senior+ gate (JaCoCo 0.8.12, Pitest 1.17, SpotBugs 4.8, OWASP 10.0)
258
+ ✓ docker-compose.yml (postgres:17, redis:7)
259
+ ✓ Flyway baseline at V1__init.sql
260
+ ✓ application.yml dev profile ready
261
+ ✓ Sample test with @Testcontainers green
262
+
263
+ Suggested next step: "grill me about <first feature>"
264
+ ```
265
+
266
+ ### 3.2. `grill-me`
267
+
268
+ **When to use:** any new feature idea, before going to PRD/PLAN. The skill
269
+ runs a Socratic interview (10-30 turns) and forces you to make scope, edge
270
+ cases, priority, and success metric explicit. **On the human path, `analyst`
271
+ refuses to produce a PLAN without a valid DISCOVERY** (see ADR-013/017).
272
+
273
+ **Triggers:**
274
+
275
+ ```text
276
+ grill me about adding JWT authentication
277
+ interview me on the payment module
278
+ stress-test the plan for distributed cache
279
+ rubber duck on the orders webhook idea
280
+ ```
281
+
282
+ **Real conversation example (8 turns):**
283
+
284
+ ```text
285
+ You:
286
+ grill me about adding JWT authentication
287
+
288
+ Claude (grill-me):
289
+ > Let's understand the goal. Will JWT be issued by your own backend (login
290
+ > with email/password) or by an external IdP (Keycloak, Auth0)? I recommend
291
+ > your own backend for the MVP — less integration. Confirm?
292
+
293
+ You:
294
+ own backend
295
+
296
+ Claude:
297
+ > Refresh token: opaque (uuid in Redis) or JWT too? I recommend opaque +
298
+ > rotation on every refresh. Trade-off: one extra Redis trip vs immediate
299
+ > revocability. OK?
300
+
301
+ You:
302
+ opaque + rotation
303
+
304
+ Claude:
305
+ > RBAC: fixed roles (USER/ADMIN) or granular (permissions table)? I
306
+ > recommend fixed roles for the MVP — granularize when a 3rd user type
307
+ > appears.
308
+
309
+ You:
310
+ fixed roles, USER and ADMIN
311
+
312
+ Claude:
313
+ > Expiration policy: access 15min, refresh 7d? OK for your "stay logged in
314
+ > for a week" window?
315
+
316
+ You:
317
+ yes
318
+
319
+ Claude:
320
+ > Password: bcrypt cost 12 (Spring Security 6+ default) or argon2? Bcrypt
321
+ > covers 99% of cases. I recommend bcrypt 12 + rate limit on /login
322
+ > (5/min/IP).
323
+
324
+ You:
325
+ bcrypt 12
326
+
327
+ Claude:
328
+ > Success metric? Suggest: POST /login P95 < 200ms, expected 401 error
329
+ > rate < 5% (attack), 0 tokens leaked in logs.
330
+
331
+ You:
332
+ done
333
+
334
+ Claude:
335
+ > Persisted to docs/discovery/DISCOVERY_auth-jwt.md with 8 sections.
336
+ > Suggested next step: "generate PRD"
337
+ ```
338
+
339
+ ### 3.3. `to-prd`
340
+
341
+ **When to use:** when the DISCOVERY is done and you want a formal product
342
+ document (with Goals, User Stories, FR, NFR, Out of scope) for team
343
+ reference.
344
+
345
+ **Triggers:**
346
+
347
+ ```text
348
+ generate PRD
349
+ create PRD
350
+ to-prd
351
+ ```
352
+
353
+ **Output:** `docs/prd/PRD_<NAME>.md` with 6 sections:
354
+
355
+ 1. Overview
356
+ 2. Goals (measurable)
357
+ 3. User Stories
358
+ 4. Functional Requirements
359
+ 5. Non-functional Requirements
360
+ 6. Out of scope
361
+
362
+ ### 3.4. `to-issues`
363
+
364
+ **When to use:** PRD is ready and you want to break it into issues, ready
365
+ for `gh issue create`.
366
+
367
+ **Triggers:**
368
+
369
+ ```text
370
+ break into issues
371
+ generate issues
372
+ to-issues
373
+ ```
374
+
375
+ **Output:** `docs/issues/ISSUES_<NAME>.md` with `[ISSUE-N]`
376
+ copy-paste-ready blocks.
377
+
378
+ ### 3.5. `run-sprint`
379
+
380
+ **When to use:** a `docs/plans/PLAN_<NAME>.md` exists (produced by
381
+ `analyst`) and you want to execute a specific sprint in orchestrated TDD
382
+ mode.
383
+
384
+ **Non-negotiable prerequisite:** the PLAN must have **goal-ready DoD**
385
+ (Definition of Done expressed as a verifiable objective, not a task
386
+ checklist). `analyst` refuses to produce a PLAN without DISCOVERY.
387
+
388
+ **Triggers:**
389
+
390
+ ```text
391
+ run sprint 1 of PLAN_auth-jwt.md
392
+ execute sprint 2
393
+ implement the sprint 1 tasks
394
+ let's code sprint 1
395
+ ```
396
+
397
+ **What it does per task:**
398
+
399
+ 1. `qa-engineer` writes a failing test (JUnit 5 + Mockito or Testcontainers).
400
+ 2. `backend-developer` implements code until the test passes.
401
+ 3. `gate-keeper` validates senior+ thresholds (coverage, mutation, SpotBugs).
402
+ 4. If the gate fails, it routes back to `backend-developer` with diagnosis.
403
+ 5. If the gate passes, move on to the next task.
404
+
405
+ ### 3.6. `auto-test-guard`
406
+
407
+ **When to use:** at the end of any significant task, or explicitly.
408
+
409
+ **Triggers:**
410
+
411
+ ```text
412
+ run the tests
413
+ generate tests
414
+ test everything
415
+ full suite
416
+ make sure nothing broke
417
+ ```
418
+
419
+ **Mandatory backend thresholds:**
420
+
421
+ | Metric | Minimum | Tool |
422
+ |---|---|---|
423
+ | Line coverage | 85% | JaCoCo |
424
+ | Branch coverage | 80% | JaCoCo |
425
+ | Mutation score (domain + application) | 70% | Pitest |
426
+ | SpotBugs CRITICAL/HIGH | 0 | SpotBugs Maven |
427
+ | OWASP CVE CVSS≥7.0 | 0 | OWASP DC |
428
+ | Pyramid — % E2E | ≤30% (hard) / ≤15% (ideal) | auto count |
429
+
430
+ If any threshold fails, `gate-keeper` blocks the merge. `tech-lead` rejects
431
+ the PR.
432
+
433
+ ### 3.7. `api-integration-test`
434
+
435
+ **When to use:** real smoke — app started via docker compose plus actual
436
+ curl/HTTP. Not unit, not mock.
437
+
438
+ **Triggers:**
439
+
440
+ ```text
441
+ integration test
442
+ smoke test
443
+ bring everything up and test
444
+ ```
445
+
446
+ **What it does:**
447
+
448
+ 1. `docker compose up -d` (postgres + redis + backend).
449
+ 2. Waits for `/actuator/health` to return UP.
450
+ 3. Runs the list of critical endpoints (main CRUD, auth, error paths).
451
+ 4. Verifies ProblemDetail (RFC 9457) in error responses.
452
+ 5. Tear down + report.
453
+
454
+ ### 3.8. `prd-ready-check`
455
+
456
+ **When to use:** before tag/release/deploy. This is the final gate that
457
+ cross-references PRD/DoD with the real code state.
458
+
459
+ **Triggers:**
460
+
461
+ ```text
462
+ ready for production?
463
+ DoD
464
+ can we ship?
465
+ run the final checklist
466
+ ```
467
+
468
+ **Output:** GO or NO-GO verdict with a detailed list of what's missing.
469
+
470
+ ### 3.9. `pair-debug`
471
+
472
+ **When to use:** non-obvious bug. Intermittent failure. Error only in prod.
473
+ Behavior diverges between environments. **Never** use this in "try and see"
474
+ mode — the skill forces explicit hypotheses before any change.
475
+
476
+ **Triggers:**
477
+
478
+ ```text
479
+ let's debug this 500 on GET /users
480
+ investigate this Hibernate LazyInitException
481
+ find the root cause of the migration failure
482
+ why does this work locally but not in prod
483
+ ```
484
+
485
+ **Loop example:**
486
+
487
+ ```text
488
+ You:
489
+ let's debug this 500 on GET /api/v1/users in prod
490
+
491
+ Claude (pair-debug):
492
+ > Symptom: 500 on GET /api/v1/users only in prod.
493
+ > Hypothesis 1 (70% confidence): Lazy loading of User.roles fires outside
494
+ > a transaction. Probe: grep "@Transactional" in UserService + Hibernate
495
+ > logs for LazyInitializationException.
496
+ > Run probe? (yes/no)
497
+
498
+ You:
499
+ yes
500
+
501
+ Claude:
502
+ > Probe done. Result: UserService.findAll() has no @Transactional.
503
+ > Prod log has 47 occurrences of LazyInitializationException in the last
504
+ > 24h. Hypothesis 1 CONFIRMED.
505
+ > Fix: add @Transactional(readOnly=true) to UserService.findAll().
506
+ > Dispatching backend-developer to apply + qa-engineer for a regression
507
+ > test that fails without the fix.
508
+ ```
509
+
510
+ ### 3.10. `brain-keeper`
511
+
512
+ **When to use:** at the end of a sprint or feature, to record history in
513
+ Obsidian format (vault at `docs/brain/`).
514
+
515
+ **Triggers:**
516
+
517
+ ```text
518
+ record in the brain
519
+ update brain
520
+ daily log
521
+ save ADR to vault
522
+ ```
523
+
524
+ **Output:**
525
+
526
+ - `docs/brain/daily/2026-05-27.md`
527
+ - `docs/brain/features/<slug>.md`
528
+ - `docs/brain/decisions/ADR-NNN-<slug>.md`
529
+ - `docs/brain/architecture/tech-debt.md` (updated)
530
+ - MOC (Map of Content) regenerated
531
+
532
+ ### 3.11. `honcho-memory`
533
+
534
+ **When to use:** when a preference, constraint, or project context must
535
+ persist across sessions.
536
+
537
+ **Triggers (PT/EN):**
538
+
539
+ ```text
540
+ remember that I prefer immutable records for DTOs
541
+ memorize: I always use Testcontainers, never H2
542
+ never use var in public method signatures
543
+ always include @PreAuthorize on sensitive endpoints
544
+ /honcho save
545
+ /honcho list
546
+ /honcho status
547
+ /honcho forget <id>
548
+ ```
549
+
550
+ The skill injects a `[HONCHO MEMORY]` block at the top of every subsequent
551
+ prompt, so agents start respecting your preference without you having to
552
+ remind them.
553
+
554
+ ### 3.12. `active-project`
555
+
556
+ **When to use:** fast, non-interactive adoption of an existing project at a
557
+ specific path.
558
+
559
+ **Triggers:**
560
+
561
+ ```text
562
+ /active-project C:\my-legacy-project
563
+ activate project at C:\my-legacy-project
564
+ adopt the project at C:\old-code
565
+ ```
566
+
567
+ ### 3.13. `update-template`
568
+
569
+ **When to use:** pull new skills/agents/ADRs from the harness into a
570
+ project that was already adopted.
571
+
572
+ **Triggers:**
573
+
574
+ ```text
575
+ update the template
576
+ sync with claude-code-agents
577
+ pull the new skills
578
+ ```
579
+
580
+ The `Project Identity` section of the project's `CLAUDE.md` is preserved in
581
+ the merge.
582
+
583
+ ### 3.14. `caveman`
584
+
585
+ **When to use:** when you want telegraphic answers (~65-75% fewer tokens).
586
+
587
+ **Triggers:**
588
+
589
+ ```text
590
+ caveman lite (default telegraphic mode)
591
+ caveman full (reduced markdown)
592
+ caveman ultra (max compression, clean code)
593
+ stop caveman (back to normal)
594
+ ```
595
+
596
+ By default, `caveman` is **on** with profile ULTRA for code and FULL for
597
+ `.md`.
598
+
599
+ ---
600
+
601
+ ## 4. Agents — who does what
602
+
603
+ You don't invoke agents directly. But you do need to know who is
604
+ responsible for what — so that you understand the responses and can escalate
605
+ correctly in case of conflict.
606
+
607
+ | Agent | Model | When it acts |
608
+ |---|---|---|
609
+ | `product-owner` | Opus 4.7 | Product decisions, scope, rules, priority, API contract |
610
+ | `tech-lead` | Opus 4.7 | Final technical decisions, approves/blocks merges |
611
+ | `security-engineer` | Opus 4.7 | OWASP audit, LGPD/GDPR, technical veto on high/critical |
612
+ | `architect` | Sonnet 4.6 | Architecture ADRs (DDD, Hexagonal, patterns) |
613
+ | `analyst` | Sonnet 4.6 | Produces `PLAN_*.md` with goal-ready DoD |
614
+ | `backend-developer` | Sonnet 4.6 | Java/Spring implementation (delegated by `sprint-runner`) |
615
+ | `database-engineer` | Sonnet 4.6 | Schema, index, migration, query perf |
616
+ | `qa-engineer` | Sonnet 4.6 | Writes tests (JUnit 5 + Mockito + Testcontainers) |
617
+ | `gate-keeper` | Sonnet 4.6 | Runs senior+ gate, validates thresholds |
618
+ | `code-reviewer` | Sonnet 4.6 | Initial PR review |
619
+ | `devops-engineer` | Sonnet 4.6 | Dockerfile, CI/CD, infra |
620
+ | `migrator` | Sonnet 4.6 | Java 8/11/17 → 25, Spring Boot 2/3 → 4 |
621
+ | `sprint-runner` | Sonnet 4.6 | Orchestrates the sprint, delegates in parallel |
622
+ | `brain-keeper` | Sonnet 4.6 | History in `docs/brain/` |
623
+ | `auditor` | Sonnet 4.6 | Audits `.claude/` consistency |
624
+ | `release-engineer` | Sonnet 4.6 | Version bump, CHANGELOG, tag |
625
+ | `scaffold` | Haiku 4.5 | Initial scaffold pipeline |
626
+
627
+ ### Autonomy Matrix — the master rule
628
+
629
+ Agents decide on their own. Asking the human is a rare exception. Summary:
630
+
631
+ - `product-owner` escalates to the human **only in 4 cases**: irreversible
632
+ action on customer data, relevant financial cost, breaking change in a
633
+ published public contract, identity/brand change.
634
+ - `tech-lead` escalates **only in 3 cases**: unresolvable technical
635
+ conflict, breaking change on a public contract in production, extra
636
+ infra > R$ 200/month.
637
+ - `security-engineer` holds **technical veto** on high/critical (OWASP) —
638
+ blocks merges without needing the human.
639
+ - Other agents **never** escalate to the human — they go up to PO (product)
640
+ or TL (technical).
641
+
642
+ ---
643
+
644
+ ## 5. Workflow 1 — Build a feature from scratch
645
+
646
+ Concrete example: implement `POST /api/v1/products` with JWT authentication
647
+ requiring the ADMIN role. I'll show every turn the way you'd really do it.
648
+
649
+ ### Turn 1 — Discovery
650
+
651
+ ```text
652
+ You:
653
+ grill me about creating POST /api/v1/products with JWT authentication
654
+
655
+ Claude (grill-me fires):
656
+ > Let's understand the goal. Should POST /products accept creation by any
657
+ > authenticated user or only the ADMIN role? I recommend restricting to
658
+ > ADMIN via @PreAuthorize. Confirm?
659
+ ```
660
+
661
+ ### Turn 2
662
+
663
+ ```text
664
+ You:
665
+ confirm ADMIN
666
+
667
+ Claude:
668
+ > Next: validation. Expected fields are name, price, stock. Acceptable
669
+ > price range? I recommend positive BigDecimal, max 9999999.99. Should
670
+ > name be unique per tenant? I recommend a DB-level unique constraint.
671
+ ```
672
+
673
+ ### Turn 3
674
+
675
+ ```text
676
+ You:
677
+ positive BigDecimal up to 9999999.99, name unique per tenant
678
+
679
+ Claude:
680
+ > Idempotency: can the client send the same POST twice? I recommend an
681
+ > Idempotency-Key header (UUID), 24h Redis store, returning the same
682
+ > response on the second hit. OK?
683
+ ```
684
+
685
+ ### Turns 4-9
686
+
687
+ It continues until the discovery covers: errors (ProblemDetail), success
688
+ metric, mandatory tests, observability (correlation ID), rate limit.
689
+ Around turn 10:
690
+
691
+ ```text
692
+ Claude:
693
+ > Persisted the discovery to docs/discovery/DISCOVERY_products-crud.md
694
+ > with 9 sections. Suggested next step: "generate PRD"
695
+ ```
696
+
697
+ ### Turn 11 — PRD
698
+
699
+ ```text
700
+ You:
701
+ generate PRD
702
+
703
+ Claude (to-prd):
704
+ > Created docs/prd/PRD_products-crud.md with 6 sections: Overview, Goals,
705
+ > User Stories, FR (8 items), NFR (latency, throughput, security), Out of
706
+ > scope. Next: "break into issues" or "analyst, produce the plan".
707
+ ```
708
+
709
+ ### Turn 12 — PLAN
710
+
711
+ ```text
712
+ You:
713
+ analyst, produce the plan
714
+
715
+ Claude (analyst):
716
+ > Produced docs/plans/PLAN_products-crud.md with 2 sprints, 6 tasks,
717
+ > goal-ready DoD per sprint. Sprint 1: schema + create + validation.
718
+ > Sprint 2: idempotency + rate limit + observability.
719
+ > To execute: "run sprint 1 of PLAN_products-crud.md"
720
+ ```
721
+
722
+ ### Turn 13 — Sprint execution
723
+
724
+ ```text
725
+ You:
726
+ run sprint 1 of PLAN_products-crud.md
727
+
728
+ Claude (run-sprint):
729
+ > [Sprint 1 — 3 tasks, TDD mode]
730
+ > [Task 1.1] Schema + Flyway migration
731
+ > ├─ database-engineer: V2__create_products.sql + index (name, tenant_id)
732
+ > ├─ qa-engineer: migration test via Testcontainers
733
+ > └─ gate-keeper: ✓
734
+ > [Task 1.2] DTO record + Bean Validation
735
+ > ├─ qa-engineer: failing ProductRequestTest
736
+ > ├─ backend-developer: ProductRequest record + @NotBlank + @Positive
737
+ > └─ gate-keeper: coverage 92% / mutation 78% / SpotBugs 0 ✓
738
+ > [Task 1.3] Controller + service + @PreAuthorize("hasRole('ADMIN')")
739
+ > ├─ qa-engineer: ProductControllerTest (201, 400, 403, 409)
740
+ > ├─ backend-developer: ProductController + ProductService
741
+ > └─ gate-keeper: coverage 89% / mutation 74% / SpotBugs 0 ✓
742
+ > Sprint 1 GREEN. Next: "run sprint 2" or "integration test"
743
+ ```
744
+
745
+ ### Turn 14 — Smoke
746
+
747
+ ```text
748
+ You:
749
+ integration test
750
+
751
+ Claude (api-integration-test):
752
+ > docker compose up -d (postgres + redis + backend) ...
753
+ > /actuator/health UP in 4.2s
754
+ > POST /api/v1/products with valid payload + ADMIN token → 201 ✓
755
+ > POST without token → 401 + ProblemDetail ✓
756
+ > POST with USER token → 403 + ProblemDetail ✓
757
+ > POST with duplicate name → 409 + ProblemDetail ✓
758
+ > POST with negative price → 400 + ProblemDetail (field "price") ✓
759
+ > Tear down. Integration OK.
760
+ ```
761
+
762
+ ### Turn 15 — Final gate
763
+
764
+ ```text
765
+ You:
766
+ ready for production?
767
+
768
+ Claude (prd-ready-check):
769
+ > Running ./mvnw clean verify, OWASP scan, E2E smoke, lint...
770
+ > Line coverage: 89% (>= 85%) ✓
771
+ > Branch coverage: 82% (>= 80%) ✓
772
+ > Mutation score: 74% (>= 70%) ✓
773
+ > SpotBugs: 0 CRITICAL, 0 HIGH ✓
774
+ > OWASP: 0 CVE CVSS >= 7.0 ✓
775
+ > Pyramid: 12% E2E (<= 30%) ✓
776
+ > VERDICT: GO ✓
777
+ ```
778
+
779
+ ### Turn 16 — History
780
+
781
+ ```text
782
+ You:
783
+ record in the brain
784
+
785
+ Claude (brain-keeper):
786
+ > Created:
787
+ > - docs/brain/daily/2026-05-27.md
788
+ > - docs/brain/features/products-crud.md
789
+ > - docs/brain/decisions/ADR-042-jwt-auth.md
790
+ > - docs/brain/architecture/tech-debt.md (updated)
791
+ > MOC regenerated.
792
+ ```
793
+
794
+ ---
795
+
796
+ ## 6. Workflow 2 — Debug a production bug
797
+
798
+ Scenario: mysterious 500 on `GET /api/v1/users`, only in production, does
799
+ not reproduce locally.
800
+
801
+ ```text
802
+ You:
803
+ let's debug this 500 on GET /api/v1/users in prod
804
+
805
+ Claude (pair-debug):
806
+ > Symptom: 500 on GET /api/v1/users only in prod.
807
+ > Known prod vs local diffs: prod has real data (10k users), local has 5.
808
+ > Prod connection pool 20, local 5.
809
+ > Hypothesis 1 (70% confidence): Lazy loading of User.roles fires outside
810
+ > a transaction in the controller. Locally every user has their roles
811
+ > already in the 2nd-level cache; in prod the cache mixes.
812
+ > Probe: grep "@Transactional" in UserService + UserController;
813
+ > grep "LazyInitializationException" in the last 24h of prod logs.
814
+ > Run probe? (yes/no)
815
+
816
+ You:
817
+ yes
818
+
819
+ Claude:
820
+ > Probe done.
821
+ > ✓ UserController.list() calls userService.findAll() returning List<User>.
822
+ > ✗ UserService.findAll() has NO @Transactional.
823
+ > ✗ User.roles is @OneToMany(fetch = LAZY).
824
+ > ✗ Prod logs: 47 LazyInitializationException in the last 24h, all on
825
+ > /api/v1/users.
826
+ > Hypothesis 1 CONFIRMED with 99% confidence.
827
+ >
828
+ > Proposed fix (option A — smaller blast radius):
829
+ > 1. Add @Transactional(readOnly=true) to UserService.findAll().
830
+ > 2. Map to UserResponse (record DTO) inside the transaction.
831
+ > 3. Controller only serializes the DTO — User never leaks.
832
+ >
833
+ > Proposed fix (option B — only if A doesn't cover):
834
+ > Eager fetch of roles via @EntityGraph.
835
+ >
836
+ > I recommend A — decouples the web layer from the entity.
837
+ > Dispatching backend-developer for A + qa-engineer for regression test
838
+ > (List<User> without a transaction must fail with LazyInitException).
839
+ ```
840
+
841
+ ---
842
+
843
+ ## 7. Workflow 3 — Spring Boot 2/3 → 4 migration
844
+
845
+ ```text
846
+ You:
847
+ migrate this project from Spring Boot 2.7 to 4.0
848
+
849
+ Claude (migrator):
850
+ > Phase 1 — Assessment (read-only)
851
+ > Catalogued: 23 removed APIs, 5 deprecated, 8 config changes.
852
+ > Generating MIGRATION-2.7-to-4.0.md at project root.
853
+ > Estimate: 2-3 dev days + 1 test day.
854
+ >
855
+ > Phase 2 — Quick wins (non-breaking)
856
+ > - List.of() where Arrays.asList()
857
+ > - Optional.orElseThrow() where .get()
858
+ > - records where the DTO is purely immutable
859
+ > - Pattern matching in switch
860
+ > Estimate: 2h.
861
+ >
862
+ > Phase 3 — Breaking changes (explicit ADR per major)
863
+ > 3.1 javax.* → jakarta.* (Spring Boot 3)
864
+ > 3.2 WebSecurityConfigurerAdapter → SecurityFilterChain
865
+ > 3.3 RestTemplate → RestClient (Spring Boot 4)
866
+ > 3.4 application.properties → ConfigData reorg
867
+ > Each item becomes an ADR in docs/decisions/.
868
+ >
869
+ > Phase 4 — Validation gate
870
+ > mvn verify GREEN at end of each phase, regression mandatory.
871
+ >
872
+ > Prerequisite: gate-keeper must establish a green baseline first. Run
873
+ > baseline now? (yes/no)
874
+ ```
875
+
876
+ ---
877
+
878
+ ## 8. Workflow 4 — Adopting an existing project
879
+
880
+ Three scenarios, three flows.
881
+
882
+ ### Case 1 — I'm already inside the folder
883
+
884
+ ```bash
885
+ cd C:\my-legacy-project
886
+ duk install # idempotent, takes automatic backup
887
+ # Edit CLAUDE.md > Project Identity
888
+ ```
889
+
890
+ ### Case 2 — Activate by path (non-interactive)
891
+
892
+ In any terminal with Cowork/Claude Code open, in chat:
893
+
894
+ ```text
895
+ /active-project C:\my-legacy-project
896
+ ```
897
+
898
+ ### Case 3 — Update template in an adopted project
899
+
900
+ ```bash
901
+ duk install # re-injects current harness version
902
+ ```
903
+
904
+ Or in chat:
905
+
906
+ ```text
907
+ update the template
908
+ ```
909
+
910
+ The `Project Identity` section of the project's `CLAUDE.md` is
911
+ **preserved** in the merge; the other sections are overwritten with the
912
+ latest harness version.
913
+
914
+ ---
915
+
916
+ ## 9. Cheat sheet — triggers by intent
917
+
918
+ | I want to... | Type in chat |
919
+ |---|---|
920
+ | Start a new project | `scaffold the backend` |
921
+ | Feature discovery | `grill me about <X>` |
922
+ | Generate PRD | `generate PRD` |
923
+ | Break into issues | `break into issues` |
924
+ | Generate technical plan | `analyst, produce the plan from the PRD` |
925
+ | Execute a sprint | `run sprint <N> of PLAN_<NAME>.md` |
926
+ | Run tests / gate | `run the tests` or `full suite` |
927
+ | Smoke integration | `integration test` |
928
+ | Final production gate | `ready for production?` |
929
+ | Debug a non-obvious bug | `let's debug <X>` |
930
+ | Record history | `record in the brain` |
931
+ | Coverage audit | `audit the tests` |
932
+ | Technical decision | `tech-lead, decide between <A> and <B>` |
933
+ | Security audit | `security audit` |
934
+ | Model the DB | `model the database for <X>` |
935
+ | Dockerize | `dockerize the backend` |
936
+ | Migrate version | `migrate from Spring Boot 2.7 to 4.0` |
937
+ | Save a memory | `remember that <fact>` |
938
+ | List memories | `/honcho list` |
939
+ | Forget a memory | `/honcho forget <id>` |
940
+ | Telegraphic style | `caveman ultra` |
941
+ | Back to normal | `stop caveman` |
942
+ | Update template | `update the template` |
943
+ | Activate project by path | `/active-project <path>` |
944
+
945
+ ---
946
+
947
+ ## 10. Decision tree — which skill to use
948
+
949
+ ```
950
+ You have... Use...
951
+ ───────────────────────────────── ──────────────────────────────────
952
+ Empty folder (new project) scaffold the backend
953
+ Legacy project, first adoption duk install + edit CLAUDE.md
954
+ Legacy project at a known path /active-project <path>
955
+ Vague feature idea grill me about <X>
956
+ DISCOVERY done, missing PRD generate PRD
957
+ PRD done, want issues break into issues
958
+ PRD done, want technical PLAN analyst, produce the plan
959
+ PLAN with sprints defined run sprint <N>
960
+ Task implemented, want gate run the tests
961
+ Sprint complete integration test
962
+ Everything green, before release ready for production?
963
+ Obscure/intermittent bug let's debug <X>
964
+ Obsolete stack version migrate from <X> to <Y>
965
+ Save a preference remember that <X>
966
+ Forgot what's in memory /honcho list
967
+ Sprint history record in the brain
968
+ Sync with updated harness update the template
969
+ Conflict between 2 technical approaches tech-lead, decide between <A> and <B>
970
+ Security vuln suspicion security audit
971
+ Don't know which skill fits just type the request — project-manager catches it
972
+ ```
973
+
974
+ ---
975
+
976
+ ## 11. Minimal `CLAUDE.md` configuration
977
+
978
+ This is the section you edit. **Don't touch the rest** — `update-template`
979
+ overwrites everything except this.
980
+
981
+ ```markdown
982
+ ## Project Identity
983
+
984
+ - **Project name**: `my-backend-api`
985
+ - **Project type**: `backend`
986
+ - **Primary stack**: `Java 25 + Spring Boot 4`
987
+ - **Database**: `PostgreSQL 17 + Redis 7`
988
+ - **Domain**: `e-commerce`
989
+ - **Team size**: `3 backend`
990
+ - **Additional rules**: _(leave empty if none)_
991
+ ```
992
+
993
+ Tips:
994
+
995
+ - `Project type: backend` unlocks `bootstrap-backend-java`.
996
+ For mobile/frontend/fullstack, adjust and use the matching bootstrap.
997
+ - `Primary stack` must mention `Java <N>` so the scaffold picks the right
998
+ JDK.
999
+ - `Database` is used by `database-engineer` to choose dialect and
1000
+ Testcontainer image.
1001
+ - `Additional rules` accepts free text — things like "SOX audit
1002
+ mandatory", "deploy only in the 22h-04h window", etc.
1003
+
1004
+ ---
1005
+
1006
+ ## 12. Antipatterns — what NOT to do
1007
+
1008
+ | ❌ Wrong | ✓ Right |
1009
+ |---|---|
1010
+ | `duk project-manager "create endpoint"` | type `create endpoint POST /products` in chat |
1011
+ | `duk grill-me` | type `grill me about <X>` in chat |
1012
+ | Skipping `grill-me` and going straight to `analyst` (human path) | always go through discovery |
1013
+ | Forcing an implementation while ignoring `gate-keeper` | wait for the gate to pass before moving on |
1014
+ | Commit with `Co-Authored-By: Claude` | commit as a human author (CLAUDE.md forbids it) |
1015
+ | Mentioning Claude/AI/LLM in commit subject/body | Conventional Commit, no trace of AI |
1016
+ | `@Entity` exposed in controller | always a record DTO (separate req/res) |
1017
+ | H2 in tests | `Testcontainers` with real Postgres |
1018
+ | `// TODO` in committed code | `docs/brain/architecture/tech-debt.md` |
1019
+ | Hardcoded credentials | `C:\development\tools\credentials\vps.txt` |
1020
+ | `var` in a public method signature/return | explicit type |
1021
+ | Inline `@Transactional` floating in a controller | service method with `@Transactional(readOnly=true)` |
1022
+ | `permitAll()` in prod | RBAC with `@PreAuthorize` + CORS per domain |
1023
+ | Log of token/PII/password | never log it — `security-engineer` vetoes |
1024
+ | Flyway migration without index | index in the same `V<N>__*.sql` that creates the FK |
1025
+
1026
+ ---
1027
+
1028
+ ## 13. Backend troubleshooting
1029
+
1030
+ | Symptom | Likely cause | Fix |
1031
+ |---|---|---|
1032
+ | `Address already in use: 8080` | Previous app hung | `netstat -ano | findstr :8080` + `taskkill /PID <pid> /F` |
1033
+ | `java: invalid target release: 25` | Wrong JDK on PATH | `sdk use java 25.0.0-tem` or fix `JAVA_HOME` |
1034
+ | `Flyway: Found non-empty schema(s)` | Local DB dirty from a previous test | `docker compose down -v && docker compose up -d` |
1035
+ | `Flyway lock not released` | Aborted migration | `UPDATE flyway_schema_history SET success=true WHERE installed_rank=<n>` or drop schema |
1036
+ | CORS blocks the frontend call | `permitAll()` or origin not listed | configure `addAllowedOriginPattern` in `WebMvcConfigurer` |
1037
+ | Secret committed by mistake | `application.yml` with real password | rebase + `git filter-repo` + rotate credential |
1038
+ | `sprint-runner` doesn't delegate | PLAN without goal-ready DoD | re-run `analyst` with a valid DISCOVERY |
1039
+ | `gate-keeper` fails on coverage | JaCoCo not configured in pom | check `jacoco-maven-plugin` + `prepare-agent` goal |
1040
+ | Mutation score < 70% | Tests only check getters/setters | write business-rule tests in `domain/` |
1041
+ | OWASP fails with CVE ≥ 7.0 | Vulnerable dependency | bump the version; if unfeasible, acceptance ADR signed by `security-engineer` |
1042
+ | `Testcontainers` slow on the first run | postgres image not cached | `docker pull postgres:17` ahead of time |
1043
+ | 401 on an endpoint that should be public | Too-generic SecurityFilterChain | explicit `requestMatchers("/api/v1/public/**").permitAll()` |
1044
+ | `LazyInitializationException` in production | Missing `@Transactional` | add `@Transactional(readOnly=true)` in the query service |
1045
+ | Local build OK, CI fails | Plugin pinned to incompatible version | check `pom.xml` against the CI matrix |
1046
+
1047
+ ---
1048
+
1049
+ ## 14. Honcho memory in practice — backend examples
1050
+
1051
+ Useful memories for a Java backend project:
1052
+
1053
+ ```text
1054
+ remember that I prefer immutable records for DTOs
1055
+ remember that I always use @Transactional(readOnly=true) on queries
1056
+ remember that I prefer Testcontainers for Postgres, never H2
1057
+ never use var in public method signatures
1058
+ always include @PreAuthorize on sensitive endpoints
1059
+ always require Idempotency-Key on mutating POSTs
1060
+ remember that rate limit is 100 req/min per IP on /login
1061
+ remember that correlation ID via MDC is mandatory on every request
1062
+ ```
1063
+
1064
+ Audit and cleanup:
1065
+
1066
+ ```text
1067
+ /honcho list # list all active memories
1068
+ /honcho status # show integration + last flush
1069
+ /honcho forget <id> # remove a stale memory
1070
+ /honcho save # force a manual flush
1071
+ ```
1072
+
1073
+ The memory persists across sessions: if you exit Claude Code and come back
1074
+ tomorrow, preferences are still respected without needing to remind anyone.
1075
+
1076
+ ---
1077
+
1078
+ ## 15. Active hooks (summary)
1079
+
1080
+ The `.claude/settings.json` installed by `duk install` activates four hooks
1081
+ that run automatically:
1082
+
1083
+ - **UserPromptSubmit** — injects the `[HONCHO MEMORY]` block at the start
1084
+ of every prompt so agents respect preferences without repetition.
1085
+ - **PreToolUse `Bash`** — blocks commands that delete test files
1086
+ (`rm src/test/...`, etc.). Hard fail.
1087
+ - **PostToolUse `Write`** — runs Prettier on freshly-written `.json`/`.md`
1088
+ files and injects a "write the matching test" reminder.
1089
+ - **Stop** — at the end of each turn, saves a project-context summary to
1090
+ Honcho for future-session recall.
1091
+
1092
+ Details: [Hooks reference](../docs/hooks-reference).
1093
+
1094
+ ---
1095
+
1096
+ ## 16. Quick glossary
1097
+
1098
+ | Term | Short definition |
1099
+ |---|---|
1100
+ | Skill | `.claude/skills/<name>/SKILL.md` file. Entry point by keyword. |
1101
+ | Agent | `.claude/agents/<name>.md` file. Executor invoked by a skill via the Task tool. |
1102
+ | Task tool | Claude Code built-in. Skills use it to delegate to agents. |
1103
+ | DISCOVERY | `docs/discovery/DISCOVERY_<X>.md`, output of `grill-me`. |
1104
+ | PRD | `docs/prd/PRD_<X>.md`, product document. Output of `to-prd`. |
1105
+ | ISSUES | `docs/issues/ISSUES_<X>.md`. Output of `to-issues`. |
1106
+ | PLAN | `docs/plans/PLAN_<X>.md`. Technical plan with sprints and goal-ready DoD. |
1107
+ | ADR | `docs/decisions/ADR-NNN-<slug>.md`. Recorded technical decision. |
1108
+ | Goal-ready DoD | Definition of Done expressed as a verifiable objective (not a checklist). |
1109
+ | Senior+ gate | Set of thresholds in `auto-test-guard` + `gate-keeper`. |
1110
+ | Autonomy Matrix | The rule of who decides what without escalating to the human. |
1111
+ | Obsidian vault | `docs/brain/` formatted for Obsidian. |
1112
+ | Honcho | Persistent cross-session memory system. |
1113
+ | Technical veto | `security-engineer` blocks merges on high/critical without human sign-off. |
1114
+ | Test pyramid | unit > integration > E2E; E2E ≤ 30% of total. |
1115
+
1116
+ ---
1117
+
1118
+ ## 17. Cross-references
1119
+
1120
+ Deeper technical docs in the dashboard:
1121
+
1122
+ - [Architecture overview](../docs/architecture-overview)
1123
+ - [Agents reference](../docs/agents-reference)
1124
+ - [Skills reference](../docs/skills-reference)
1125
+ - [Pipeline](../docs/pipeline)
1126
+ - [Quality gate](../docs/quality-gate)
1127
+ - [Stack rules](../docs/stack-rules)
1128
+ - [Hooks reference](../docs/hooks-reference)
1129
+ - [Honcho memory](../docs/honcho-memory)
1130
+ - [Git Flow](../docs/git-flow)
1131
+ - [Troubleshooting](../docs/troubleshooting)
1132
+
1133
+ And the sibling manuals:
1134
+
1135
+ - [Frontend manual](./frontend.en.md) — Angular 21
1136
+ - [Mobile manual](./mobile.en.md) — React Native 0.84+
1137
+ - [Fullstack manual](./fullstack.en.md) — backend + frontend monorepo
1138
+ - [Existing project manual](./existing-project.en.md) — adoption in legacy code