@runecraft/grimoire 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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -0
  3. package/catalog.json +9 -0
  4. package/dist/grimoire.js +1758 -0
  5. package/package.json +54 -0
  6. package/references/definition-of-done.md +67 -0
  7. package/references/testing-patterns.md +260 -0
  8. package/skills/code-review-and-quality/README.md +13 -0
  9. package/skills/code-review-and-quality/SKILL.md +389 -0
  10. package/skills/code-simplification/README.md +13 -0
  11. package/skills/code-simplification/SKILL.md +338 -0
  12. package/skills/debugging-and-error-recovery/README.md +13 -0
  13. package/skills/debugging-and-error-recovery/SKILL.md +343 -0
  14. package/skills/debugging-and-error-recovery/scripts/__pycache__/triage_state.cpython-314.pyc +0 -0
  15. package/skills/debugging-and-error-recovery/scripts/triage_state.py +206 -0
  16. package/skills/deprecation-and-migration/README.md +13 -0
  17. package/skills/deprecation-and-migration/SKILL.md +248 -0
  18. package/skills/deprecation-and-migration/scripts/__pycache__/migration_tracker.cpython-314.pyc +0 -0
  19. package/skills/deprecation-and-migration/scripts/migration_tracker.py +237 -0
  20. package/skills/doubt-driven-development/README.md +13 -0
  21. package/skills/doubt-driven-development/SKILL.md +251 -0
  22. package/skills/git-commit-learning/.skill-meta.json +14 -0
  23. package/skills/git-commit-learning/README.md +205 -0
  24. package/skills/git-commit-learning/SKILL.md +435 -0
  25. package/skills/git-commit-learning/references/commit-patterns.md +595 -0
  26. package/skills/git-worktree/README.md +13 -0
  27. package/skills/git-worktree/SKILL.md +220 -0
  28. package/skills/idea-refine/README.md +13 -0
  29. package/skills/idea-refine/SKILL.md +186 -0
  30. package/skills/interview-me/README.md +13 -0
  31. package/skills/interview-me/SKILL.md +233 -0
  32. package/skills/linkedin-audit/SKILL.md +98 -0
  33. package/skills/linkedin-audit/references/dashboard-spec.md +43 -0
  34. package/skills/memory-management/README.md +13 -0
  35. package/skills/memory-management/SKILL.md +198 -0
  36. package/skills/security-and-hardening/README.md +13 -0
  37. package/skills/security-and-hardening/SKILL.md +472 -0
  38. package/skills/shipping-and-launch/README.md +13 -0
  39. package/skills/shipping-and-launch/SKILL.md +317 -0
  40. package/skills/skill-forge/README.md +153 -0
  41. package/skills/skill-forge/SKILL.md +291 -0
  42. package/skills/skill-forge/assets/SKILL.template.md +73 -0
  43. package/skills/skill-forge/references/authoring-patterns.md +249 -0
  44. package/skills/skill-forge/references/description-optimization.md +171 -0
  45. package/skills/skill-forge/references/output-evaluation.md +276 -0
  46. package/skills/skill-forge/references/scripts-guide.md +232 -0
  47. package/skills/skill-forge/references/spec.md +175 -0
  48. package/skills/skill-forge/scripts/validate.py +536 -0
  49. package/skills/spec-driven/.skill-meta.json +14 -0
  50. package/skills/spec-driven/README.md +335 -0
  51. package/skills/spec-driven/SKILL.md +174 -0
  52. package/skills/spec-driven/references/code-analysis.md +98 -0
  53. package/skills/spec-driven/references/coding-principles.md +56 -0
  54. package/skills/spec-driven/references/context-limits.md +31 -0
  55. package/skills/spec-driven/references/design.md +199 -0
  56. package/skills/spec-driven/references/discuss.md +136 -0
  57. package/skills/spec-driven/references/implement.md +425 -0
  58. package/skills/spec-driven/references/lessons.md +113 -0
  59. package/skills/spec-driven/references/memory.md +126 -0
  60. package/skills/spec-driven/references/specify.md +210 -0
  61. package/skills/spec-driven/references/sub-agents.md +96 -0
  62. package/skills/spec-driven/references/tasks.md +484 -0
  63. package/skills/spec-driven/references/validate.md +350 -0
  64. package/skills/spec-driven/scripts/__pycache__/lessons.cpython-314.pyc +0 -0
  65. package/skills/spec-driven/scripts/lessons.py +370 -0
  66. package/skills/spec-loop/README.md +36 -0
  67. package/skills/spec-loop/SKILL.md +61 -0
  68. package/skills/test-driven-development/README.md +13 -0
  69. package/skills/test-driven-development/SKILL.md +388 -0
  70. package/skills/typescript-patterns/README.md +13 -0
  71. package/skills/typescript-patterns/SKILL.md +346 -0
  72. package/skills/using-agent-skills/README.md +13 -0
  73. package/skills/using-agent-skills/SKILL.md +187 -0
@@ -0,0 +1,595 @@
1
+ # Commit Patterns Reference
2
+
3
+ Exemplos detalhados por tipo de commit, anti-padrões, e padrões de investigação. Carregue este arquivo quando precisar de exemplos concretos ou quando o SKILL.md não cobrir um caso específico. Todos os exemplos em **português** e **inglês**.
4
+
5
+ ---
6
+
7
+ ## RPI Template Structure
8
+
9
+ ```text
10
+ <type>(<scope>): <descrição clara da mudança comportamental>
11
+
12
+ [CONTEXTO]
13
+ - <task, spec, design doc, RFC, ADR, issue ou referência>
14
+ - <problema de negócio ou técnico>
15
+ - <escopo e compatibilidade>
16
+
17
+ [ALTERAÇÕES ATÔMICAS]
18
+ - <ação verificável 1>
19
+ - <ação verificável 2>
20
+ - <ação verificável N>
21
+
22
+ [DECISÕES TÉCNICAS (Mini-ADR)]
23
+ - <decisão tomada>
24
+ - <alternativa rejeitada, se relevante>
25
+ - <razão da escolha>
26
+ - <ref para ADR/RFC quando existir>
27
+
28
+ [VALIDAÇÃO]
29
+ - <comando> — <passou | falhou>
30
+ - Se não houver teste, explicar por quê.
31
+ ```
32
+
33
+ RPI flow:
34
+
35
+ ```text
36
+ Research → [CONTEXTO]: de onde veio e por quê.
37
+ Plan → [DECISÕES TÉCNICAS]: o que foi decidido.
38
+ Implement → [ALTERAÇÕES ATÔMICAS]: o que foi feito.
39
+ Verify → [VALIDAÇÃO]: como foi comprovado.
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Templates by Change Type
45
+
46
+ ### feat — Nova Funcionalidade
47
+
48
+ #### Português
49
+
50
+ ```text
51
+ feat(checkout): adiciona validação de cupom antes da captura de pagamento
52
+
53
+ [CONTEXTO]
54
+ - Resolve a task CHK-088 reportada pelo time de operações.
55
+ - Cupons expirados estavam sendo aceitos, gerando estornos e reclamações.
56
+ - Escopo: domínio checkout, sem impacto em billing ou catalog.
57
+
58
+ [ALTERAÇÕES ATÔMICAS]
59
+ - Adicionado CouponValidator com regras de data, uso máximo e elegibilidade.
60
+ - Movida validação para antes de PaymentGateway.capture.
61
+ - Adicionado erro de domínio CouponInvalidError com mensagem específica.
62
+
63
+ [DECISÕES TÉCNICAS (Mini-ADR)]
64
+ - Validação ocorre antes de qualquer side-effect externo (captura de pagamento).
65
+ - Alternativa rejeitada: validar após captura e estornar — custo operacional maior.
66
+ - Erro de domínio separado por tipo de falha (expirado, uso excedido, inválido).
67
+
68
+ [VALIDAÇÃO]
69
+ - npm test -- checkout — passou (22/22).
70
+ - Cenários manuais: cupom expirado, cupom válido, sem cupom — todos passaram.
71
+ - npm run typecheck — passou.
72
+ ```
73
+
74
+ #### English
75
+
76
+ ```text
77
+ feat(checkout): add coupon validation before payment capture
78
+
79
+ [CONTEXTO]
80
+ - Resolves task CHK-088 reported by operations team.
81
+ - Expired coupons were being accepted, causing chargebacks and complaints.
82
+ - Scope: checkout domain, no impact on billing or catalog.
83
+
84
+ [ALTERAÇÕES ATÔMICAS]
85
+ - Added CouponValidator with date, max usage, and eligibility rules.
86
+ - Moved validation before PaymentGateway.capture call.
87
+ - Added CouponInvalidError domain error with specific messages per failure type.
88
+
89
+ [DECISÕES TÉCNICAS (Mini-ADR)]
90
+ - Validation runs before any external side-effect (payment capture).
91
+ - Rejected alternative: validate after capture then refund — higher operational cost.
92
+ - Domain error typed by failure reason (expired, overused, invalid).
93
+
94
+ [VALIDAÇÃO]
95
+ - npm test -- checkout — passed (22/22).
96
+ - Manual scenarios: expired coupon, valid coupon, no coupon — all passed.
97
+ - npm run typecheck — passed.
98
+ ```
99
+
100
+ ---
101
+
102
+ ### fix — Correção de Bug
103
+
104
+ #### Português
105
+
106
+ ```text
107
+ fix(billing): corrige cálculo de imposto para clientes internacionais
108
+
109
+ [CONTEXTO]
110
+ - Reportado em JIRA-321: clientes EU recebiam alíquota nacional.
111
+ - Log de erro: "TaxOverride not found 'EU'".
112
+ - Impacto: clientes da União Europeia desde 2026-03.
113
+
114
+ [ALTERAÇÕES ATÔMICAS]
115
+ - Alterado BillingService.resolveTaxRule para consultar countryCode antes do fallback nacional.
116
+ - Mantido comportamento original para clientes sem país informado.
117
+
118
+ [DECISÕES TÉCNICAS (Mini-ADR)]
119
+ - Resolução hierárquica: countryCode → região → default nacional.
120
+ - Alternativa rejeitada: criar tabela de taxas por país — adiciona complexidade desnecessária no momento.
121
+ - Apenas 3 países na UE atualmente; se expandir, reavaliar com ADR.
122
+
123
+ [VALIDAÇÃO]
124
+ - npm test -- billing-tax — passou (14/14).
125
+ - Testado com countryCode 'DE', 'FR', 'BR', null — todos com alíquota correta.
126
+ - npm run typecheck — passou.
127
+ ```
128
+
129
+ #### English
130
+
131
+ ```text
132
+ fix(billing): correct tax calculation for international customers
133
+
134
+ [CONTEXTO]
135
+ - Reported in JIRA-321: EU customers received domestic tax rate.
136
+ - Error log: "TaxOverride not found 'EU'".
137
+ - Impact: European Union customers since 2026-03.
138
+
139
+ [ALTERAÇÕES ATÔMICAS]
140
+ - Changed BillingService.resolveTaxRule to check countryCode before domestic fallback.
141
+ - Preserved original behavior for customers without country info.
142
+
143
+ [DECISÕES TÉCNICAS (Mini-ADR)]
144
+ - Hierarchical resolution: countryCode → region → domestic default.
145
+ - Rejected alternative: per-country tax table — adds unnecessary complexity now.
146
+ - Only 3 EU countries currently; if it grows, reassess with ADR.
147
+
148
+ [VALIDAÇÃO]
149
+ - npm test -- billing-tax — passed (14/14).
150
+ - Tested with countryCode 'DE', 'FR', 'BR', null — all correct rates.
151
+ - npm run typecheck — passed.
152
+ ```
153
+
154
+ ---
155
+
156
+ ### refactor — Reestruturação Interna
157
+
158
+ #### Português
159
+
160
+ ```text
161
+ refactor(catalog): centraliza normalização de SKU no domínio catalog
162
+
163
+ [CONTEXTO]
164
+ - Normalização de SKU estava duplicada em catalog, checkout e inventory.
165
+ - Cada módulo tinha regras ligeiramente diferentes — bugs recorrentes de SKU inconsistente.
166
+ - Decisão registrada em ADR-007: Single Source of Truth for SKU Normalization.
167
+
168
+ [ALTERAÇÕES ATÔMICAS]
169
+ - Criado CatalogService.normalizeSku() como fonte única de normalização.
170
+ - Removida lógica de normalização de checkout e inventory.
171
+ - Adicionado teste de contrato para garantir consistência entre consumidores.
172
+
173
+ [DECISÕES TÉCNICAS (Mini-ADR)]
174
+ - Domínio catalog é o dono natural do SKU — centralizar lá reduz acoplamento.
175
+ - Alternativa rejeitada: shared kernel — adiciona dependência entre domínios.
176
+ - Contrato: normalizeSku(input: string): string, idempotente, trim + uppercase.
177
+
178
+ [VALIDAÇÃO]
179
+ - npm test -- catalog checkout inventory — passou (47/47).
180
+ - SKU "ABC-123 " normaliza para "ABC-123" em todos os módulos.
181
+ - npm run typecheck — passou.
182
+ ```
183
+
184
+ #### English
185
+
186
+ ```text
187
+ refactor(catalog): centralize SKU normalization in catalog domain
188
+
189
+ [CONTEXTO]
190
+ - SKU normalization was duplicated across catalog, checkout, and inventory.
191
+ - Each module had slightly different rules — recurring inconsistent SKU bugs.
192
+ - Decision recorded in ADR-007: Single Source of Truth for SKU Normalization.
193
+
194
+ [ALTERAÇÕES ATÔMICAS]
195
+ - Created CatalogService.normalizeSku() as single source of normalization.
196
+ - Removed normalization logic from checkout and inventory.
197
+ - Added contract test ensuring consistency across consumers.
198
+
199
+ [DECISÕES TÉCNICAS (Mini-ADR)]
200
+ - Catalog domain is the natural owner of SKU — centralizing there reduces coupling.
201
+ - Rejected alternative: shared kernel — introduces cross-domain dependency.
202
+ - Contract: normalizeSku(input: string): string, idempotent, trim + uppercase.
203
+
204
+ [VALIDAÇÃO]
205
+ - npm test -- catalog checkout inventory — passed (47/47).
206
+ - SKU "ABC-123 " normalizes to "ABC-123" in all modules.
207
+ - npm run typecheck — passed.
208
+ ```
209
+
210
+ ---
211
+
212
+ ### docs — Documentação
213
+
214
+ #### Português
215
+
216
+ ```text
217
+ docs(ai): registra padrão de commits RPI para agentes de IA
218
+
219
+ [CONTEXTO]
220
+ - Agentes de IA precisam extrair contexto do histórico Git.
221
+ - Commits vagos como "fix: ajustes" não fornecem contexto pesquisável.
222
+ - Baseado nos princípios de Context Engineering e fluxo RPI.
223
+
224
+ [ALTERAÇÕES ATÔMICAS]
225
+ - Adicionado guia de commits em CONTRIBUTING.md com template RPI.
226
+ - Registrada decisão: commits significativos devem incluir [CONTEXTO], [ALTERAÇÕES ATÔMICAS], [DECISÕES TÉCNICAS] e [VALIDAÇÃO].
227
+
228
+ [VALIDAÇÃO]
229
+ - Sem build/test — documentação revisada por pares.
230
+ ```
231
+
232
+ #### English
233
+
234
+ ```text
235
+ docs(ai): document RPI commit pattern for AI agents
236
+
237
+ [CONTEXTO]
238
+ - AI agents need to extract context from Git history.
239
+ - Vague commits like "fix: stuff" provide no searchable context.
240
+ - Based on Context Engineering principles and RPI workflow.
241
+
242
+ [ALTERAÇÕES ATÔMICAS]
243
+ - Added commit guide to CONTRIBUTING.md with RPI template.
244
+ - Recorded decision: significant commits must include [CONTEXTO], [ALTERAÇÕES ATÔMICAS], [DECISÕES TÉCNICAS], and [VALIDAÇÃO].
245
+
246
+ [VALIDAÇÃO]
247
+ - No build/test — documentation peer-reviewed.
248
+ ```
249
+
250
+ ---
251
+
252
+ ### test — Cobertura de Testes
253
+
254
+ #### Português
255
+
256
+ ```text
257
+ test(auth): adiciona cobertura para logout OIDC e fallback legado
258
+
259
+ [CONTEXTO]
260
+ - Logout OIDC implementado sem testes de integração.
261
+ - Fallback para login legado nunca foi testado — risco de regressão em migração.
262
+
263
+ [ALTERAÇÕES ATÔMICAS]
264
+ - Adicionados 5 testes: logout com sessão ativa, sessão expirada, token inválido, fallback legado, e redirect via end_session_endpoint.
265
+ - Mock do provider OIDC cobre os 3 estados de resposta.
266
+
267
+ [VALIDAÇÃO]
268
+ - npm test -- auth — passou (12/12).
269
+ - Cobertura em auth.service.ts: 87% → 94%.
270
+ ```
271
+
272
+ #### English
273
+
274
+ ```text
275
+ test(auth): add coverage for OIDC logout and legacy fallback
276
+
277
+ [CONTEXTO]
278
+ - OIDC logout implemented without integration tests.
279
+ - Legacy login fallback was never tested — regression risk during migration.
280
+
281
+ [ALTERAÇÕES ATÔMICAS]
282
+ - Added 5 tests: logout with active session, expired session, invalid token, legacy fallback, and end_session_endpoint redirect.
283
+ - OIDC provider mock covers all 3 response states.
284
+
285
+ [VALIDAÇÃO]
286
+ - npm test -- auth — passed (12/12).
287
+ - Coverage in auth.service.ts: 87% → 94%.
288
+ ```
289
+
290
+ ---
291
+
292
+ ### perf — Otimização de Performance
293
+
294
+ #### Português
295
+
296
+ ```text
297
+ perf(catalog): reduz tempo de busca de produtos com cache de SKU
298
+
299
+ [CONTEXTO]
300
+ - Busca de produtos por SKU era o endpoint mais lento (P95: 340ms).
301
+ - Cada request consultava 3 serviços externos sequencialmente.
302
+ - Meta: P95 abaixo de 50ms.
303
+
304
+ [ALTERAÇÕES ATÔMICAS]
305
+ - Adicionado cache em memória com TTL de 5 minutos para ProductService.findBySku.
306
+ - Consultas em paralelo para os 3 serviços externos (Promise.all).
307
+ - Adicionada métrica de cache hit rate.
308
+
309
+ [DECISÕES TÉCNICAS (Mini-ADR)]
310
+ - Cache local (não Redis) pela simplicidade — SKU é imutável, invalidação não é problema.
311
+ - TTL de 5 min é seguro: catálogo atualiza no máximo 1x/hora.
312
+ - Alternativa rejeitada: Redis — overkill para 3 serviços consumidores.
313
+
314
+ [VALIDAÇÃO]
315
+ - npm test -- catalog — passou (31/31).
316
+ - Benchmark: P95 de 340ms → 12ms (cache hit), 38ms (cache miss).
317
+ - npm run typecheck — passou.
318
+ ```
319
+
320
+ #### English
321
+
322
+ ```text
323
+ perf(catalog): reduce product search time with SKU caching
324
+
325
+ [CONTEXTO]
326
+ - Product search by SKU was the slowest endpoint (P95: 340ms).
327
+ - Each request queried 3 external services sequentially.
328
+ - Target: P95 below 50ms.
329
+
330
+ [ALTERAÇÕES ATÔMICAS]
331
+ - Added in-memory cache with 5-minute TTL for ProductService.findBySku.
332
+ - Parallelized queries to 3 external services (Promise.all).
333
+ - Added cache hit rate metric.
334
+
335
+ [DECISÕES TÉCNICAS (Mini-ADR)]
336
+ - Local cache (not Redis) for simplicity — SKU is immutable, invalidation is not an issue.
337
+ - 5-min TTL is safe: catalog updates at most once per hour.
338
+ - Rejected alternative: Redis — overkill for 3 consuming services.
339
+
340
+ [VALIDAÇÃO]
341
+ - npm test -- catalog — passed (31/31).
342
+ - Benchmark: P95 from 340ms → 12ms (cache hit), 38ms (cache miss).
343
+ - npm run typecheck — passed.
344
+ ```
345
+
346
+ ---
347
+
348
+ ### security — Correção de Segurança
349
+
350
+ #### Português
351
+
352
+ ```text
353
+ security(auth): força HTTPS em redirect URI do OIDC
354
+
355
+ [CONTEXTO]
356
+ - Descoberto em auditoria de segurança (2026-Q2): redirect URI aceitava HTTP.
357
+ - Risco: token de autorização interceptável em redes não seguras.
358
+
359
+ [ALTERAÇÕES ATÔMICAS]
360
+ - Adicionada validação de protocolo no OidcService.buildRedirectUri.
361
+ - Redirecionamento HTTP retorna erro 400 com mensagem explicativa.
362
+ - Atualizados 3 testes que usavam HTTP por conveniência.
363
+
364
+ [DECISÕES TÉCNICAS (Mini-ADR)]
365
+ - Bloquear HTTP em vez de redirecionar — falhar cedo e explicitamente.
366
+ - Alternativa rejeitada: redirect silencioso para HTTPS — esconde o problema.
367
+
368
+ [VALIDAÇÃO]
369
+ - npm test -- auth — passou (15/15).
370
+ - Teste manual: HTTP → 400, HTTPS → 302.
371
+ - npm audit — sem vulnerabilidades.
372
+ ```
373
+
374
+ #### English
375
+
376
+ ```text
377
+ security(auth): enforce HTTPS on OIDC redirect URI
378
+
379
+ [CONTEXTO]
380
+ - Discovered in security audit (2026-Q2): redirect URI accepted HTTP.
381
+ - Risk: authorization token interceptable on insecure networks.
382
+
383
+ [ALTERAÇÕES ATÔMICAS]
384
+ - Added protocol validation in OidcService.buildRedirectUri.
385
+ - HTTP redirect returns 400 error with explanatory message.
386
+ - Updated 3 tests that used HTTP for convenience.
387
+
388
+ [DECISÕES TÉCNICAS (Mini-ADR)]
389
+ - Block HTTP instead of silently redirecting — fail early and explicitly.
390
+ - Rejected alternative: silent redirect to HTTPS — hides the problem.
391
+
392
+ [VALIDAÇÃO]
393
+ - npm test -- auth — passed (15/15).
394
+ - Manual test: HTTP → 400, HTTPS → 302.
395
+ - npm audit — no vulnerabilities.
396
+ ```
397
+
398
+ ---
399
+
400
+ ## Anti-Patterns
401
+
402
+ ### Vague Messages (REJECT)
403
+
404
+ ```text
405
+ fix: ajustes
406
+ update
407
+ wip
408
+ cleanup
409
+ mudanças finais
410
+ refactor: melhora código
411
+ fix: corrige bug
412
+ feat: adiciona feature
413
+ chore: dependencies
414
+ ```
415
+
416
+ These teach the AI nothing. They contain no domain, no intent, no decision, no validation.
417
+
418
+ ### Missing Domain Scope
419
+
420
+ ```text
421
+ feat: adiciona validação de cupom
422
+ ```
423
+
424
+ Which domain? billing? checkout? catalog? An AI searching by domain won't find this.
425
+
426
+ Fix:
427
+
428
+ ```text
429
+ feat(checkout): adiciona validação de cupom antes da captura
430
+ ```
431
+
432
+ ### Description That Says What, Not Why
433
+
434
+ ```text
435
+ feat(billing): adiciona campo taxRate na tabela invoices
436
+ ```
437
+
438
+ This describes the diff (what changed in code), not the behavioral change (what the system now does differently).
439
+
440
+ Fix:
441
+
442
+ ```text
443
+ feat(billing): suporta múltiplas alíquotas fiscais por fatura
444
+ ```
445
+
446
+ ### Subjective Validation (REJECT)
447
+
448
+ ```text
449
+ [VALIDAÇÃO]
450
+ - testado manualmente
451
+ - parece funcionar
452
+ - revisão ok
453
+ - tested locally
454
+ ```
455
+
456
+ Not verifiable. Not reproducible. AI works better with binary results.
457
+
458
+ Fix:
459
+
460
+ ```text
461
+ [VALIDAÇÃO]
462
+ - npm test -- billing-tax — passou (14/14).
463
+ - npm run typecheck — passou.
464
+ ```
465
+
466
+ Or if no automated tests exist:
467
+
468
+ ```text
469
+ [VALIDAÇÃO]
470
+ - Sem testes automatizados — este repositório é um vault Obsidian sem runner.
471
+ - Conteúdo revisado manualmente.
472
+ ```
473
+
474
+ ### Generic Technical Decisions (REJECT)
475
+
476
+ ```text
477
+ [DECISÕES TÉCNICAS (Mini-ADR)]
478
+ - Seguir boas práticas.
479
+ - Código limpo.
480
+ - Manter consistência.
481
+ ```
482
+
483
+ Useless for a future agent. Must be specific to the change.
484
+
485
+ Fix:
486
+
487
+ ```text
488
+ [DECISÕES TÉCNICAS (Mini-ADR)]
489
+ - Validação ocorre antes de side-effect externo (captura de pagamento).
490
+ - Alternativa rejeitada: validar após captura e estornar.
491
+ - Razão: custo operacional de estorno > custo de validação prévia.
492
+ ```
493
+
494
+ ### Mega-Commits (REJECT)
495
+
496
+ ```text
497
+ feat: adiciona sistema de notificações completo
498
+
499
+ 50 files changed, 3200 insertions, 800 deletions.
500
+ Includes: billing, orders, identity, dashboard, email, push, SMS.
501
+ ```
502
+
503
+ An AI can't trace which decision affected which domain. Always split into atomic commits.
504
+
505
+ ---
506
+
507
+ ## Domain Scopes Guide
508
+
509
+ | Scope | When |
510
+ |-------|------|
511
+ | `auth` | Authentication, authorization, sessions, tokens, OIDC, SAML |
512
+ | `billing` | Payments, invoices, tax, pricing, Stripe integration |
513
+ | `checkout` | Cart, order placement, coupon validation |
514
+ | `catalog` | Products, SKU, inventory, categories |
515
+ | `identity` | User profiles, roles, permissions, accounts |
516
+ | `orders` | Order lifecycle, fulfillment, status transitions |
517
+ | `events` | Event bus, domain events, message schema |
518
+ | `infra` | Docker, CI/CD, deployments, configuration |
519
+ | `api` | REST/GraphQL contracts, middleware, rate limiting |
520
+ | `ui` | Components, styles, layouts, design system |
521
+ | `docs` | Documentation, ADRs, README updates |
522
+ | `ai` | Agent config, skills, prompts, harness, context |
523
+ | `test` | Test infrastructure, coverage configuration |
524
+ | `db` | Migrations, schema changes, query optimization |
525
+
526
+ ---
527
+
528
+ ## Analysis Commands
529
+
530
+ ### Quick reconnaissance
531
+
532
+ ```bash
533
+ git log --oneline -20
534
+ ```
535
+
536
+ ### Domain-specific history
537
+
538
+ ```bash
539
+ git log --oneline --grep="billing" -20
540
+ git log --oneline --grep="auth" -20
541
+ ```
542
+
543
+ ### File history with intent
544
+
545
+ ```bash
546
+ git log --follow --stat -- src/services/billing.ts
547
+ ```
548
+
549
+ ### Commit content inspection
550
+
551
+ ```bash
552
+ git show <hash>
553
+ git show --stat <hash>
554
+ ```
555
+
556
+ ### Pattern detection
557
+
558
+ ```bash
559
+ git log --oneline -- src/billing/ # all billing commits
560
+ git log --oneline --grep="fix" -- src/ # all fixes
561
+ git log --oneline --since="2026-01-01" # recent changes
562
+ ```
563
+
564
+ ### Finding related commits
565
+
566
+ ```bash
567
+ git log --all --oneline --grep="JIRA-321"
568
+ git log --all --oneline --grep="TaxOverride"
569
+ ```
570
+
571
+ ---
572
+
573
+ ## Confidence Levels for Analysis
574
+
575
+ When reporting extracted patterns:
576
+
577
+ | Level | Condition |
578
+ |-------|-----------|
579
+ | HIGH | 5+ commits confirm the same pattern across different authors or time periods |
580
+ | MEDIUM | 2-4 commits show the pattern, or single author consistently |
581
+ | LOW | 1 commit suggests a pattern — needs more evidence |
582
+
583
+ Always report confidence level. Never present a single-commit observation as project-wide convention.
584
+
585
+ ---
586
+
587
+ ## Integration with spec-driven
588
+
589
+ When spec-driven is orchestrating a BUILD phase and this skill writes a commit:
590
+
591
+ 1. Read the feature spec from `.specs/features/<name>/spec.md`
592
+ 2. Read the task from `.specs/features/<name>/tasks.md`
593
+ 3. Reference the task ID and spec in [CONTEXTO]
594
+ 4. Match the task's acceptance criteria to the [VALIDAÇÃO] section
595
+ 5. Extract design decisions from `.specs/features/<name>/design.md` for [DECISÕES TÉCNICAS]
@@ -0,0 +1,13 @@
1
+ # git-worktree
2
+
3
+ Use git worktrees for parallel feature branches without stashing or cloning. Creates isolated working directories from a single local clone.
4
+
5
+ | Field | Value |
6
+ |-------|-------|
7
+ | Version | 1.0.0 |
8
+ | Trigger | `/worktree`, "git worktree", "parallel branches", "multiple features", "isolate work" |
9
+ | PT trigger | `/worktree`, "branches paralelas", "trabalho isolado", "múltiplas features" |
10
+
11
+ **Do not use for** simple single-branch work, fixing merge conflicts, or repos where disk space is extremely constrained.
12
+
13
+ See [SKILL.md](SKILL.md) for the full process.