@polymorphism-tech/morph-spec 4.8.12 → 4.8.15

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 (76) hide show
  1. package/README.md +379 -379
  2. package/bin/morph-spec.js +23 -2
  3. package/bin/{task-manager.cjs → task-manager.js} +249 -172
  4. package/claude-plugin.json +14 -14
  5. package/docs/CHEATSHEET.md +203 -203
  6. package/docs/QUICKSTART.md +1 -1
  7. package/framework/agents.json +224 -140
  8. package/framework/hooks/README.md +202 -202
  9. package/framework/hooks/claude-code/post-tool-use/dispatch.js +48 -2
  10. package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +151 -0
  11. package/framework/hooks/claude-code/pre-tool-use/enforce-phase-writes.js +12 -0
  12. package/framework/hooks/claude-code/pre-tool-use/protect-spec-files.js +6 -0
  13. package/framework/hooks/claude-code/session-start/inject-morph-context.js +34 -0
  14. package/framework/hooks/claude-code/statusline.py +6 -0
  15. package/framework/hooks/claude-code/stop/validate-completion.js +38 -4
  16. package/framework/hooks/claude-code/teammate-idle/teammate-idle.js +87 -0
  17. package/framework/hooks/claude-code/user-prompt/set-terminal-title.js +58 -0
  18. package/framework/hooks/shared/phase-utils.js +4 -1
  19. package/framework/hooks/shared/state-reader.js +1 -0
  20. package/framework/skills/README.md +1 -0
  21. package/framework/skills/level-0-meta/brainstorming/SKILL.md +2 -0
  22. package/framework/skills/level-0-meta/code-review/SKILL.md +16 -0
  23. package/framework/skills/level-0-meta/code-review/references/review-guidelines.md +100 -0
  24. package/framework/skills/level-0-meta/code-review/scripts/scan-csharp.mjs +36 -6
  25. package/framework/skills/level-0-meta/code-review-nextjs/SKILL.md +16 -0
  26. package/framework/skills/level-0-meta/code-review-nextjs/scripts/scan-nextjs.mjs +189 -0
  27. package/framework/skills/level-0-meta/frontend-review/SKILL.md +359 -0
  28. package/framework/skills/level-0-meta/frontend-review/scripts/scan-accessibility.mjs +376 -0
  29. package/framework/skills/level-0-meta/morph-checklist/SKILL.md +1 -1
  30. package/framework/skills/level-0-meta/morph-replicate/SKILL.md +10 -8
  31. package/framework/skills/level-0-meta/morph-replicate/references/blazor-html-mapping.md +70 -0
  32. package/framework/skills/level-0-meta/post-implementation/SKILL.md +315 -0
  33. package/framework/skills/level-0-meta/post-implementation/scripts/detect-dev-server.mjs +153 -0
  34. package/framework/skills/level-0-meta/post-implementation/scripts/detect-stack.mjs +234 -0
  35. package/framework/skills/level-0-meta/terminal-title/SKILL.md +61 -0
  36. package/framework/skills/level-0-meta/terminal-title/scripts/set_title.sh +65 -0
  37. package/framework/skills/level-0-meta/tool-usage-guide/SKILL.md +50 -188
  38. package/framework/skills/level-0-meta/tool-usage-guide/references/tools-per-phase.md +213 -0
  39. package/framework/skills/level-0-meta/verification-before-completion/SKILL.md +2 -0
  40. package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +4 -7
  41. package/framework/skills/level-1-workflows/phase-codebase-analysis/SKILL.md +1 -1
  42. package/framework/skills/level-1-workflows/phase-design/SKILL.md +71 -109
  43. package/framework/skills/level-1-workflows/phase-design/references/architecture-analysis-guide.md +89 -0
  44. package/framework/skills/level-1-workflows/phase-design/references/spec-authoring-guide.md +55 -0
  45. package/framework/skills/level-1-workflows/phase-implement/SKILL.md +171 -114
  46. package/framework/skills/level-1-workflows/phase-implement/references/vsa-implementation-guide.md +92 -0
  47. package/framework/skills/level-1-workflows/phase-setup/SKILL.md +1 -2
  48. package/framework/skills/level-1-workflows/phase-tasks/SKILL.md +35 -159
  49. package/framework/skills/level-1-workflows/phase-tasks/references/task-planning-patterns.md +172 -0
  50. package/framework/skills/level-1-workflows/phase-uiux/SKILL.md +42 -3
  51. package/framework/squad-templates/backend-only.json +14 -1
  52. package/framework/squad-templates/frontend-only.json +14 -1
  53. package/framework/squad-templates/full-stack.json +25 -8
  54. package/framework/standards/STANDARDS.json +631 -86
  55. package/framework/standards/frontend/design-system/aesthetic-direction.md +213 -0
  56. package/framework/templates/project/validate.js +122 -0
  57. package/framework/workflows/configs/zero-touch.json +7 -0
  58. package/package.json +87 -87
  59. package/src/commands/agents/dispatch-agents.js +53 -10
  60. package/src/commands/state/advance-phase.js +88 -13
  61. package/src/commands/state/index.js +2 -1
  62. package/src/commands/state/phase-runner.js +215 -0
  63. package/src/commands/tasks/task.js +25 -4
  64. package/src/core/paths/output-schema.js +2 -1
  65. package/src/lib/detectors/design-system-detector.js +5 -4
  66. package/src/lib/generators/recap-generator.js +16 -0
  67. package/src/lib/orchestration/team-orchestrator.js +171 -89
  68. package/src/lib/phase-chain/eligibility-checker.js +243 -0
  69. package/src/lib/standards/digest-builder.js +231 -0
  70. package/src/lib/tasks/task-parser.js +94 -0
  71. package/src/lib/validators/blazor/blazor-concurrency-analyzer.js +39 -0
  72. package/src/lib/validators/content/content-validator.js +34 -106
  73. package/src/lib/validators/nextjs/next-component-validator.js +2 -0
  74. package/src/lib/validators/validation-runner.js +2 -2
  75. package/src/utils/file-copier.js +1 -0
  76. package/src/utils/hooks-installer.js +31 -7
@@ -9,7 +9,14 @@
9
9
  "subcategory": null,
10
10
  "tags": [
11
11
  "ai-agents"
12
- ]
12
+ ],
13
+ "aliases": ["Blazor AI", "AI chat UI", "streaming Blazor", "agent UI", "chat component"],
14
+ "anchors": {
15
+ "streaming": "#streaming-responses",
16
+ "state": "#ui-state-management",
17
+ "dbcontext": "#dbcontext-in-blazor"
18
+ },
19
+ "digest": "Never inject DbContext directly into Blazor components — use a scoped service factory. Stream AI responses via IAsyncEnumerable. Debounce user input. Handle cancellation with CancellationTokenSource per component lifecycle."
13
20
  },
14
21
  {
15
22
  "id": "ai-agents-production",
@@ -19,7 +26,14 @@
19
26
  "subcategory": null,
20
27
  "tags": [
21
28
  "ai-agents"
22
- ]
29
+ ],
30
+ "aliases": ["AI production", "agent reliability", "production AI", "agent safety", "autonomous systems"],
31
+ "anchors": {
32
+ "reliability": "#reliability-patterns",
33
+ "safety": "#safety-guardrails",
34
+ "monitoring": "#monitoring-and-logging"
35
+ },
36
+ "digest": "Add rate limiting and retry with exponential backoff. Log all agent decisions and tool calls. Implement circuit breakers for external calls. Validate agent output before acting. Never give agents unaudited write access to production systems."
23
37
  },
24
38
  {
25
39
  "id": "ai-agents-setup",
@@ -29,7 +43,14 @@
29
43
  "subcategory": null,
30
44
  "tags": [
31
45
  "ai-agents"
32
- ]
46
+ ],
47
+ "aliases": ["AI agent setup", "MCP configuration", "tool configuration", "Claude setup", "agent initialization"],
48
+ "anchors": {
49
+ "mcp": "#mcp-configuration",
50
+ "tools": "#tool-definitions",
51
+ "spawn": "#spawn-configuration"
52
+ },
53
+ "digest": "Initialize agents with explicit tool lists — never allow unlimited tool access. Configure MCP servers before spawning subagents. Define system prompts with role + constraints + output format. Validate tool availability before dispatch."
33
54
  },
34
55
  {
35
56
  "id": "ai-agents-team-orchestration",
@@ -39,7 +60,13 @@
39
60
  "subcategory": null,
40
61
  "tags": [
41
62
  "ai-agents"
42
- ]
63
+ ],
64
+ "aliases": ["team orchestration", "agent team", "multi-agent coordination", "squad dispatch"],
65
+ "anchors": {
66
+ "patterns": "#orchestration-patterns",
67
+ "communication": "#inter-agent-communication"
68
+ },
69
+ "digest": "Organize agents into squads with a designated leader. Leader decomposes the task and dispatches to specialists. Pass structured briefs between agents — not raw conversation. Each agent outputs a typed result. Leader aggregates into a unified output."
43
70
  },
44
71
  {
45
72
  "id": "ai-agents-workflows",
@@ -49,7 +76,14 @@
49
76
  "subcategory": null,
50
77
  "tags": [
51
78
  "ai-agents"
52
- ]
79
+ ],
80
+ "aliases": ["agent workflow", "multi-agent", "orchestration pattern", "agent chain", "parallel agents"],
81
+ "anchors": {
82
+ "orchestration": "#orchestration-patterns",
83
+ "parallel": "#parallel-execution",
84
+ "handoff": "#agent-handoff"
85
+ },
86
+ "digest": "Use orchestrator→specialist pattern for complex tasks. Parallelize independent subtasks. Pass structured context between agents, not raw conversation. Define explicit success criteria before spawning. Implement timeout and fallback strategies."
53
87
  },
54
88
  {
55
89
  "id": "architecture-ddd-aggregates",
@@ -60,7 +94,14 @@
60
94
  "tags": [
61
95
  "architecture",
62
96
  "ddd"
63
- ]
97
+ ],
98
+ "aliases": ["aggregate root", "DDD aggregate", "domain aggregate", "aggregate pattern"],
99
+ "anchors": {
100
+ "root": "#aggregate-root-design",
101
+ "invariants": "#enforcing-invariants",
102
+ "events": "#domain-events"
103
+ },
104
+ "digest": "AggregateRoot owns its boundary — never reference internal entities from outside. Enforce invariants in aggregate methods, not services. Raise domain events from within the aggregate. Use ID references across aggregate boundaries."
64
105
  },
65
106
  {
66
107
  "id": "architecture-ddd-bounded-contexts",
@@ -71,7 +112,14 @@
71
112
  "tags": [
72
113
  "architecture",
73
114
  "ddd"
74
- ]
115
+ ],
116
+ "aliases": ["bounded context", "BC", "context map", "integration events", "domain boundary"],
117
+ "anchors": {
118
+ "context-map": "#context-map",
119
+ "integration": "#integration-events",
120
+ "acl": "#anti-corruption-layer"
121
+ },
122
+ "digest": "Each bounded context has its own model, ubiquitous language, and database schema. Communicate between contexts via integration events or anti-corruption layers. Never share domain objects across context boundaries."
75
123
  },
76
124
  {
77
125
  "id": "architecture-ddd-complexity-levels",
@@ -82,7 +130,15 @@
82
130
  "tags": [
83
131
  "architecture",
84
132
  "ddd"
85
- ]
133
+ ],
134
+ "aliases": ["DDD level", "domain complexity", "CRUD vs DDD", "complexity decision tree", "domain model level"],
135
+ "anchors": {
136
+ "decision-tree": "#decision-tree",
137
+ "level1": "#level-1-crud",
138
+ "level2": "#level-2-business-logic",
139
+ "level3": "#level-3-bounded-context"
140
+ },
141
+ "digest": "Level 1 CRUD: simple entity + service. Level 2 Business Logic: AggregateRoot, ValueObjects, DomainEvents, CQRS. Level 3 Bounded Context: explicit BC isolation, Integration Events. Use 5-question decision tree to determine level before designing."
86
142
  },
87
143
  {
88
144
  "id": "architecture-ddd-entities",
@@ -93,7 +149,13 @@
93
149
  "tags": [
94
150
  "architecture",
95
151
  "ddd"
96
- ]
152
+ ],
153
+ "aliases": ["DDD entity", "domain entity", "entity class", "entity ID", "entity lifecycle"],
154
+ "anchors": {
155
+ "identity": "#entity-identity",
156
+ "lifecycle": "#entity-lifecycle"
157
+ },
158
+ "digest": "Entities have unique identity that persists through state changes. Identity is the only equality criterion. Mutable state belongs inside the entity, not the service. Avoid anemic entities — put domain logic where the data lives."
97
159
  },
98
160
  {
99
161
  "id": "architecture-ddd-ubiquitous-language",
@@ -104,7 +166,13 @@
104
166
  "tags": [
105
167
  "architecture",
106
168
  "ddd"
107
- ]
169
+ ],
170
+ "aliases": ["ubiquitous language", "domain language", "shared vocabulary", "domain glossary"],
171
+ "anchors": {
172
+ "glossary": "#domain-glossary",
173
+ "naming": "#naming-from-domain"
174
+ },
175
+ "digest": "Use business domain terms directly in code — no translation layer between what the domain expert says and what the code says. If the business says 'Order', the code has Order not SalesTransaction. Maintain a living glossary. Inconsistent naming = inconsistent models."
108
176
  },
109
177
  {
110
178
  "id": "architecture-ddd-value-objects",
@@ -115,7 +183,14 @@
115
183
  "tags": [
116
184
  "architecture",
117
185
  "ddd"
118
- ]
186
+ ],
187
+ "aliases": ["value object", "VO", "immutable value", "domain value type", "strongly typed"],
188
+ "anchors": {
189
+ "equality": "#equality-by-value",
190
+ "validation": "#value-object-validation",
191
+ "factory": "#static-factory-method"
192
+ },
193
+ "digest": "Value objects are immutable and identified by their properties, not ID. Override equality by value. Create via static factory method with validation. Use for Money, Email, Coordinates, DateRange — any domain concept with rules."
119
194
  },
120
195
  {
121
196
  "id": "architecture-vertical-slice-vertical-slice",
@@ -126,7 +201,14 @@
126
201
  "tags": [
127
202
  "architecture",
128
203
  "vertical-slice"
129
- ]
204
+ ],
205
+ "aliases": ["vertical slice", "VSA", "slice architecture", "feature slice", "CQRS slice"],
206
+ "anchors": {
207
+ "structure": "#slice-structure",
208
+ "rules": "#slice-rules",
209
+ "cqrs": "#cqrs-in-slices"
210
+ },
211
+ "digest": "Organize by feature, not layer. Each slice contains Command/Query, Handler, Validator, Response. No cross-slice dependencies — shared code goes to a dedicated Shared project. Use MediatR for in-process CQRS dispatch."
130
212
  },
131
213
  {
132
214
  "id": "backend-api-minimal-api",
@@ -137,7 +219,13 @@
137
219
  "tags": [
138
220
  "backend",
139
221
  "api"
140
- ]
222
+ ],
223
+ "aliases": ["minimal api", "minimal APIs", ".NET minimal API", "route handler", "MapGet"],
224
+ "anchors": {
225
+ "endpoints": "#endpoint-registration",
226
+ "grouping": "#route-groups"
227
+ },
228
+ "digest": "Group endpoints by feature with MapGroup. Use typed results (TypedResults.Ok, TypedResults.NotFound) for Swagger accuracy. Register endpoint groups in extension methods, not Program.cs directly. Add [EndpointSummary] for OpenAPI docs. Prefer Minimal API over controllers for new code."
141
229
  },
142
230
  {
143
231
  "id": "backend-api-rest",
@@ -148,7 +236,13 @@
148
236
  "tags": [
149
237
  "backend",
150
238
  "api"
151
- ]
239
+ ],
240
+ "aliases": ["REST API", "RESTful", "HTTP API", "resource API", "HTTP methods"],
241
+ "anchors": {
242
+ "resources": "#resource-design",
243
+ "errors": "#error-responses"
244
+ },
245
+ "digest": "Resources are nouns, HTTP verbs are actions. GET /users, POST /users, PUT /users/{id}, DELETE /users/{id}. 201+Location for creation, 204 for deletion. Use RFC 9457 ProblemDetails for all errors. Cursor-based pagination for large collections. API versioning via URL path (/v1/)."
152
246
  },
153
247
  {
154
248
  "id": "backend-api-validation",
@@ -159,7 +253,13 @@
159
253
  "tags": [
160
254
  "backend",
161
255
  "api"
162
- ]
256
+ ],
257
+ "aliases": ["FluentValidation", "input validation", "request validation", "API validation", "model validation"],
258
+ "anchors": {
259
+ "fluent": "#fluentvalidation-setup",
260
+ "rules": "#validation-rules"
261
+ },
262
+ "digest": "Use FluentValidation for all request validation. Register validators as scoped services. Return 422 UnprocessableEntity with field-level error messages. Validate at API boundary — not inside domain logic. Never trust client-side validation alone."
163
263
  },
164
264
  {
165
265
  "id": "backend-authentication-passkeys",
@@ -170,7 +270,13 @@
170
270
  "tags": [
171
271
  "backend",
172
272
  "authentication"
173
- ]
273
+ ],
274
+ "aliases": ["passkeys", "WebAuthn", "FIDO2", "passwordless", "biometric auth"],
275
+ "anchors": {
276
+ "registration": "#passkey-registration",
277
+ "authentication": "#passkey-authentication"
278
+ },
279
+ "digest": "Implement WebAuthn/FIDO2 for passwordless authentication. Registration: generate challenge → verify attestation → store credential. Authentication: generate challenge → verify assertion → issue JWT. Use ASP.NET Core Identity with FIDO2 library. Always store relying party ID as domain, not localhost."
174
280
  },
175
281
  {
176
282
  "id": "backend-database-ef-core",
@@ -181,7 +287,14 @@
181
287
  "tags": [
182
288
  "backend",
183
289
  "database"
184
- ]
290
+ ],
291
+ "aliases": ["Entity Framework", "EF Core", "DbContext", "LINQ queries", "ORM"],
292
+ "anchors": {
293
+ "dbcontext": "#dbcontext-patterns",
294
+ "queries": "#query-optimization",
295
+ "migrations": "#migration-strategy"
296
+ },
297
+ "digest": "Use Scoped DbContext per request. Never expose IQueryable outside repository. Use AsNoTracking for read-only queries. Batch writes with SaveChangesAsync. Avoid N+1 queries — use Include for eager loading. Never use lazy loading in production."
185
298
  },
186
299
  {
187
300
  "id": "backend-database-migrations",
@@ -192,7 +305,13 @@
192
305
  "tags": [
193
306
  "backend",
194
307
  "database"
195
- ]
308
+ ],
309
+ "aliases": ["EF migrations", "database migration", "schema migration", "dotnet ef", "Add-Migration"],
310
+ "anchors": {
311
+ "workflow": "#migration-workflow",
312
+ "production": "#production-migrations"
313
+ },
314
+ "digest": "Run migrations at app startup via MigrateAsync() only in dev. In production, apply migrations as part of CI/CD, never at runtime. Never modify existing migrations — always create a new one. Use meaningful names (Add-Migration AddUserEmailIndex). Test rollback on every migration."
196
315
  },
197
316
  {
198
317
  "id": "backend-database-postgresql-database",
@@ -204,7 +323,13 @@
204
323
  "backend",
205
324
  "database",
206
325
  "postgresql"
207
- ]
326
+ ],
327
+ "aliases": ["PostgreSQL", "postgres", "pg", "database design", "SQL schema"],
328
+ "anchors": {
329
+ "schema": "#schema-design",
330
+ "indexes": "#index-strategy"
331
+ },
332
+ "digest": "Use timestamptz for all timestamps (not timestamp). UUID primary keys for public-facing IDs. Add indexes on FK columns and frequently filtered columns. Use GIN indexes for JSON/array columns. JSONB over JSON. Row-level security for multi-tenant. Never store binary in columns — use storage URLs."
208
333
  },
209
334
  {
210
335
  "id": "backend-database-repository-patterns",
@@ -215,7 +340,13 @@
215
340
  "tags": [
216
341
  "backend",
217
342
  "database"
218
- ]
343
+ ],
344
+ "aliases": ["repository", "IRepository", "Unit of Work", "data access", "repository pattern"],
345
+ "anchors": {
346
+ "pattern": "#repository-pattern",
347
+ "uow": "#unit-of-work"
348
+ },
349
+ "digest": "Repository abstracts data access behind an interface. Return domain objects, not IQueryable. Unit of Work coordinates multiple repository operations in one transaction. Avoid generic repositories — domain-specific repositories express intent better. Test repositories with in-memory providers or integration tests."
219
350
  },
220
351
  {
221
352
  "id": "backend-database-vector-search-rag",
@@ -226,7 +357,13 @@
226
357
  "tags": [
227
358
  "backend",
228
359
  "database"
229
- ]
360
+ ],
361
+ "aliases": ["vector search", "RAG", "embeddings", "pgvector", "semantic search"],
362
+ "anchors": {
363
+ "chunking": "#chunking-strategy",
364
+ "retrieval": "#retrieval-patterns"
365
+ },
366
+ "digest": "Chunk documents with 512 token size and 50 token overlap for RAG. Embed with text-embedding-3-small. Store embedding + metadata (source, chunk index). Retrieve top-k=5 by cosine similarity. Re-rank before injecting into LLM context. Use pgvector HNSW index for performance at scale."
230
367
  },
231
368
  {
232
369
  "id": "backend-dotnet-async",
@@ -237,7 +374,13 @@
237
374
  "tags": [
238
375
  "backend",
239
376
  "dotnet"
240
- ]
377
+ ],
378
+ "aliases": ["async/await", "Task<T>", "CancellationToken", "ValueTask", "async programming"],
379
+ "anchors": {
380
+ "cancellation": "#cancellation-token-pattern",
381
+ "parallel": "#parallel-execution-patterns"
382
+ },
383
+ "digest": "Use CancellationToken in all async signatures. Prefer Task<T> over ValueTask<T> unless hot-path allocation is measured. Never async void except event handlers. Task.WhenAll for independent parallel ops."
241
384
  },
242
385
  {
243
386
  "id": "backend-dotnet-core",
@@ -248,7 +391,14 @@
248
391
  "tags": [
249
392
  "backend",
250
393
  "dotnet"
251
- ]
394
+ ],
395
+ "aliases": [".NET core", "dotnet core", "C# patterns", "backend core", "dotnet standards"],
396
+ "anchors": {
397
+ "di": "#dependency-injection",
398
+ "services": "#service-registration",
399
+ "security": "#security-patterns"
400
+ },
401
+ "digest": "Register services in Program.cs with AddScoped/AddSingleton/AddTransient. Use constructor injection only — never service locator. Apply interface segregation. Validate all input at API boundary. Never expose raw exceptions to clients."
252
402
  },
253
403
  {
254
404
  "id": "backend-dotnet-di",
@@ -259,7 +409,13 @@
259
409
  "tags": [
260
410
  "backend",
261
411
  "dotnet"
262
- ]
412
+ ],
413
+ "aliases": ["dependency injection", "IoC", "DI container", "service registration", "inversion of control"],
414
+ "anchors": {
415
+ "patterns": "#di-patterns",
416
+ "anti-patterns": "#di-anti-patterns"
417
+ },
418
+ "digest": "Use constructor injection exclusively. Register concrete types with interfaces. Never use service locator or static factories. Scoped services must not be injected into singletons. Validate dependency graph at startup with ValidateOnBuild."
263
419
  },
264
420
  {
265
421
  "id": "backend-dotnet-program-cs-checklist",
@@ -270,7 +426,13 @@
270
426
  "tags": [
271
427
  "backend",
272
428
  "dotnet"
273
- ]
429
+ ],
430
+ "aliases": ["program.cs", "startup configuration", "NuGet packages", "package setup", "app bootstrap"],
431
+ "anchors": {
432
+ "nuget": "#nuget-packages",
433
+ "middleware": "#middleware-order"
434
+ },
435
+ "digest": "Configure middleware in order: CORS → Auth → Routing → Endpoints. Register all required NuGet packages. Enable Swagger in dev only. Apply global exception handler. Configure HTTPS redirection. Enable CORS before Auth."
274
436
  },
275
437
  {
276
438
  "id": "backend-integrations-asaas-asaas-api",
@@ -282,7 +444,13 @@
282
444
  "backend",
283
445
  "integrations",
284
446
  "asaas"
285
- ]
447
+ ],
448
+ "aliases": ["asaas", "payment", "PIX", "boleto", "Brazilian payment"],
449
+ "anchors": {
450
+ "payments": "#payment-types",
451
+ "webhooks": "#webhook-handling"
452
+ },
453
+ "digest": "Use AsaasClient SDK — never call REST API directly. Register as scoped service. Implement webhook signature verification. Map SDK enums to domain enums at integration boundary. Use idempotency keys for retry safety. Test with Asaas sandbox environment."
286
454
  },
287
455
  {
288
456
  "id": "backend-integrations-clerk-clerk-auth",
@@ -294,7 +462,13 @@
294
462
  "backend",
295
463
  "integrations",
296
464
  "clerk"
297
- ]
465
+ ],
466
+ "aliases": ["clerk", "authentication", "OAuth", "JWT", "session management"],
467
+ "anchors": {
468
+ "setup": "#clerk-setup",
469
+ "middleware": "#auth-middleware"
470
+ },
471
+ "digest": "Add ClerkMiddleware to ASP.NET pipeline. Access userId via User.GetClerkUserId(). Configure allowed redirect URLs in Clerk dashboard. Use [Authorize] for protected endpoints. Never store passwords — Clerk manages credentials. Sync Clerk users to local DB on first login."
298
472
  },
299
473
  {
300
474
  "id": "backend-integrations-hangfire-hangfire-jobs",
@@ -306,7 +480,13 @@
306
480
  "backend",
307
481
  "integrations",
308
482
  "hangfire"
309
- ]
483
+ ],
484
+ "aliases": ["hangfire", "background jobs", "scheduled jobs", "recurring", "cron", "fire and forget"],
485
+ "anchors": {
486
+ "jobs": "#job-types",
487
+ "retry": "#retry-policies"
488
+ },
489
+ "digest": "Use IDbContextFactory for scoped DB operations in jobs — never inject DbContext directly into job classes. BackgroundJob.Enqueue for fire-and-forget, RecurringJob.AddOrUpdate for cron. Add RetryCountAttribute for retries. Secure Hangfire Dashboard with auth in production. Never put long-running work in a single job — decompose."
310
490
  },
311
491
  {
312
492
  "id": "backend-integrations-resend-resend-email",
@@ -318,7 +498,13 @@
318
498
  "backend",
319
499
  "integrations",
320
500
  "resend"
321
- ]
501
+ ],
502
+ "aliases": ["resend", "email", "transactional email", "SMTP", "email notification"],
503
+ "anchors": {
504
+ "sending": "#send-email",
505
+ "templates": "#email-templates"
506
+ },
507
+ "digest": "Register ResendClient as singleton. Provide both HTML and plain-text alternatives. Handle bounce/complaint webhooks to maintain sender reputation. Never send from test domains in production. Queue emails via Hangfire for reliability — don't send inline in request handlers."
322
508
  },
323
509
  {
324
510
  "id": "context-analytics",
@@ -328,7 +514,13 @@
328
514
  "subcategory": null,
329
515
  "tags": [
330
516
  "context"
331
- ]
517
+ ],
518
+ "aliases": ["analytics", "GTM", "GA4", "event tracking", "data layer"],
519
+ "anchors": {
520
+ "events": "#event-tracking",
521
+ "setup": "#analytics-setup"
522
+ },
523
+ "digest": "Install GTM via component, not raw script. Track custom events via dataLayer.push. GA4 events follow snake_case naming. Define event schema before implementing. Never log PII in analytics events. Test event firing with GA4 DebugView or GTM Preview before production."
332
524
  },
333
525
  {
334
526
  "id": "context-bundles",
@@ -338,7 +530,13 @@
338
530
  "subcategory": null,
339
531
  "tags": [
340
532
  "context"
341
- ]
533
+ ],
534
+ "aliases": ["context bundles", "bundled context", "spec bundles", "feature bundles"],
535
+ "anchors": {
536
+ "structure": "#bundle-structure",
537
+ "loading": "#context-loading"
538
+ },
539
+ "digest": "Bundle related context files to reduce per-agent injection overhead. Define bundle manifests listing included standards by scope. Agents load their assigned bundle, not the full context. Bundles are versioned — bump version when standards change significantly."
342
540
  },
343
541
  {
344
542
  "id": "context-priming",
@@ -348,7 +546,13 @@
348
546
  "subcategory": null,
349
547
  "tags": [
350
548
  "context"
351
- ]
549
+ ],
550
+ "aliases": ["context priming", "agent priming", "system prompt", "context injection"],
551
+ "anchors": {
552
+ "patterns": "#priming-patterns",
553
+ "efficiency": "#context-efficiency"
554
+ },
555
+ "digest": "Prime agents with role + constraints + output format in the first message. Keep priming concise — under 200 tokens. Include only relevant standards for the current phase. Re-prime after context compaction. Never include full file contents when a digest suffices."
352
556
  },
353
557
  {
354
558
  "id": "core-architecture",
@@ -358,7 +562,13 @@
358
562
  "subcategory": null,
359
563
  "tags": [
360
564
  "core"
361
- ]
565
+ ],
566
+ "aliases": ["architecture", "clean architecture", "layered architecture", "SOLID", "design principles"],
567
+ "anchors": {
568
+ "layers": "#layer-boundaries",
569
+ "patterns": "#architectural-patterns"
570
+ },
571
+ "digest": "Apply Clean Architecture: dependency rule points inward (Infrastructure → Application → Domain). Domain has no external dependencies. Application orchestrates use cases. Infrastructure implements ports. SOLID principles at every layer. Never skip architecture review for cross-cutting concerns."
362
572
  },
363
573
  {
364
574
  "id": "core-coding",
@@ -368,7 +578,13 @@
368
578
  "subcategory": null,
369
579
  "tags": [
370
580
  "core"
371
- ]
581
+ ],
582
+ "aliases": ["coding standards", "code style", "clean code", "naming conventions", "code quality"],
583
+ "anchors": {
584
+ "naming": "#naming-conventions",
585
+ "patterns": "#code-patterns"
586
+ },
587
+ "digest": "PascalCase for types/methods, camelCase for fields/locals, UPPER_SNAKE_CASE for constants. Methods are verbs, classes are nouns. Single responsibility per class/method. Max 30 lines per method. Prefer immutability. No magic strings — use constants or enums. Every public API has XML docs."
372
588
  },
373
589
  {
374
590
  "id": "core-git-branching-strategy",
@@ -378,7 +594,13 @@
378
594
  "subcategory": null,
379
595
  "tags": [
380
596
  "core"
381
- ]
597
+ ],
598
+ "aliases": ["git flow", "branch strategy", "feature branch", "gitflow", "branch naming"],
599
+ "anchors": {
600
+ "branching": "#branch-naming",
601
+ "workflow": "#git-workflow"
602
+ },
603
+ "digest": "Branch naming: feature/{ticket}-{description}, fix/{ticket}-{description}. main is production-ready, develop is integration branch. PRs require passing CI and at least one review. Squash merge for features. Delete branches after merge. Protect main and develop with required checks."
382
604
  },
383
605
  {
384
606
  "id": "core-git",
@@ -388,7 +610,13 @@
388
610
  "subcategory": null,
389
611
  "tags": [
390
612
  "core"
391
- ]
613
+ ],
614
+ "aliases": ["git", "commit messages", "conventional commits", "changelog", "git hooks"],
615
+ "anchors": {
616
+ "commits": "#commit-format",
617
+ "hooks": "#pre-commit-hooks"
618
+ },
619
+ "digest": "Conventional Commits: feat, fix, chore, docs, refactor, test, style. Scope in parentheses: feat(auth): add JWT validation. Breaking changes use BREAKING CHANGE footer. Commits are atomic — one logical change per commit. Pre-commit hooks run build + lint. Never commit .env or secrets."
392
620
  },
393
621
  {
394
622
  "id": "core-testing",
@@ -398,7 +626,13 @@
398
626
  "subcategory": null,
399
627
  "tags": [
400
628
  "core"
401
- ]
629
+ ],
630
+ "aliases": ["testing", "unit tests", "integration tests", "TDD", "test coverage", "xUnit"],
631
+ "anchors": {
632
+ "patterns": "#test-patterns",
633
+ "coverage": "#coverage-requirements"
634
+ },
635
+ "digest": "Arrange-Act-Assert in every test. Unit tests for domain logic — no DB or HTTP. Integration tests use TestContainers for real dependencies. Minimum 80% coverage on domain layer. Mock external services at system boundaries. Test names: Given_When_Then or MethodName_Scenario_ExpectedResult."
402
636
  },
403
637
  {
404
638
  "id": "data-nosql-blob-storage",
@@ -409,7 +643,13 @@
409
643
  "tags": [
410
644
  "data",
411
645
  "nosql"
412
- ]
646
+ ],
647
+ "aliases": ["blob storage", "Azure Storage", "file storage", "BlobServiceClient", "object storage"],
648
+ "anchors": {
649
+ "upload": "#upload-patterns",
650
+ "access": "#sas-tokens"
651
+ },
652
+ "digest": "Use BlobServiceClient with DefaultAzureCredential — never hardcode connection strings. Organize by container/virtual-path. Generate SAS tokens for client-side access with minimum permissions and short TTL. Set content-type on upload. Use CDN for public assets. Enable versioning + soft delete for business data."
413
653
  },
414
654
  {
415
655
  "id": "data-nosql-cache-redis",
@@ -421,7 +661,13 @@
421
661
  "data",
422
662
  "nosql",
423
663
  "cache"
424
- ]
664
+ ],
665
+ "aliases": ["redis", "cache", "distributed cache", "IDistributedCache", "cache-aside", "StackExchange.Redis"],
666
+ "anchors": {
667
+ "patterns": "#cache-patterns",
668
+ "invalidation": "#cache-invalidation"
669
+ },
670
+ "digest": "IDistributedCache for cache-aside pattern. Set TTL on every entry — never cache without expiry. Serialize with System.Text.Json. Sliding expiration for sessions, absolute for computed results. Invalidate by key prefix. Redis eviction policy must be set (allkeys-lru). Never cache PII without encryption."
425
671
  },
426
672
  {
427
673
  "id": "data-nosql-cosmos-db",
@@ -432,7 +678,13 @@
432
678
  "tags": [
433
679
  "data",
434
680
  "nosql"
435
- ]
681
+ ],
682
+ "aliases": ["cosmos", "CosmosDB", "document database", "partition key", "RUs"],
683
+ "anchors": {
684
+ "modeling": "#document-modeling",
685
+ "queries": "#query-patterns"
686
+ },
687
+ "digest": "Choose partition key with high cardinality for even distribution. Design documents for single-partition reads. Enable TTL for ephemeral data. Prefer point reads (O(1)) over cross-partition queries. Set provisioned throughput based on measured RUs. Use change feed for event-driven processing."
436
688
  },
437
689
  {
438
690
  "id": "data-vector-search-azure-ai-search",
@@ -443,7 +695,13 @@
443
695
  "tags": [
444
696
  "data",
445
697
  "vector-search"
446
- ]
698
+ ],
699
+ "aliases": ["Azure AI Search", "cognitive search", "vector search", "hybrid search", "semantic ranking"],
700
+ "anchors": {
701
+ "indexing": "#index-setup",
702
+ "queries": "#search-queries"
703
+ },
704
+ "digest": "Create index with semantic configuration for hybrid search (keyword + vector). Batch index uploads (1000 docs/batch). Use OData filters for pre-filtering before vector search. Apply RRF fusion for hybrid ranking. Set up incremental indexing for updates. Add enrichment pipeline for PDFs/images."
447
705
  },
448
706
  {
449
707
  "id": "data-vector-search-rag-chunking",
@@ -454,7 +712,13 @@
454
712
  "tags": [
455
713
  "data",
456
714
  "vector-search"
457
- ]
715
+ ],
716
+ "aliases": ["RAG chunking", "document chunking", "text splitting", "chunk overlap", "embedding chunks"],
717
+ "anchors": {
718
+ "strategies": "#chunking-strategies",
719
+ "retrieval": "#retrieval-pipeline"
720
+ },
721
+ "digest": "Recursive character splitting: 512 token chunks, 50 token overlap. Embed with text-embedding-3-small (1536 dims). Store chunk + metadata (source, page, section). Retrieve top-k=5 by cosine similarity. Re-rank with cross-encoder before LLM injection. Evaluate retrieval quality with RAGAS."
458
722
  },
459
723
  {
460
724
  "id": "frontend-blazor-design-checklist",
@@ -465,7 +729,13 @@
465
729
  "tags": [
466
730
  "frontend",
467
731
  "blazor"
468
- ]
732
+ ],
733
+ "aliases": ["blazor checklist", "blazor design review", "UI checklist", "component checklist"],
734
+ "anchors": {
735
+ "components": "#component-checklist",
736
+ "accessibility": "#a11y-checklist"
737
+ },
738
+ "digest": "Every Blazor component must: use @inject not constructor injection, define loading and error states, implement IDisposable for event subscriptions, use CancellationToken for async ops. Fluent UI: use DataGrid not custom tables, FluentDialog for modals, FluentTooltip for hints. No hardcoded colors."
469
739
  },
470
740
  {
471
741
  "id": "frontend-blazor-fluent-ui-setup",
@@ -476,7 +746,13 @@
476
746
  "tags": [
477
747
  "frontend",
478
748
  "blazor"
479
- ]
749
+ ],
750
+ "aliases": ["fluent ui setup", "blazor fluent", "Microsoft Fluent UI", "FluentUI install"],
751
+ "anchors": {
752
+ "setup": "#package-setup",
753
+ "theme": "#theme-configuration"
754
+ },
755
+ "digest": "Install Microsoft.FluentUI.AspNetCore.Components. Register: builder.Services.AddFluentUIComponents(). Add <FluentDesignTheme> to MainLayout.razor. Install FluentIcons package separately. Set CachingEnabled=true for icons in production. Configure theme via --accent-color CSS variable in app.css."
480
756
  },
481
757
  {
482
758
  "id": "frontend-blazor-fluent-ui",
@@ -487,7 +763,13 @@
487
763
  "tags": [
488
764
  "frontend",
489
765
  "blazor"
490
- ]
766
+ ],
767
+ "aliases": ["fluent ui components", "FluentDataGrid", "FluentDialog", "FluentButton", "FluentCombobox"],
768
+ "anchors": {
769
+ "grid": "#data-grid",
770
+ "forms": "#form-components"
771
+ },
772
+ "digest": "Use FluentDataGrid with virtualization for >100 rows. FluentDialog requires DialogService injection. FluentTextField uses @bind-Value. FluentCombobox with @bind-Value and TOption type param. Never mix FluentUI and MudBlazor in the same project. Use Appearance enum for button variants."
491
773
  },
492
774
  {
493
775
  "id": "frontend-blazor-html-conversion",
@@ -498,7 +780,13 @@
498
780
  "tags": [
499
781
  "frontend",
500
782
  "blazor"
501
- ]
783
+ ],
784
+ "aliases": ["html to blazor", "blazor migration", "html conversion", "razor conversion"],
785
+ "anchors": {
786
+ "mapping": "#html-to-blazor-mapping",
787
+ "components": "#component-patterns"
788
+ },
789
+ "digest": "Convert <div> containers to <FluentStack> or <FluentGrid>. Replace <input> with FluentTextField/FluentCheckbox/FluentSelect. Convert <table> to FluentDataGrid. Replace class= with Class=. Event handlers: onclick → @onclick. Use CascadingValue for theme propagation. Blazor-specific: @ref, @key, @bind."
502
790
  },
503
791
  {
504
792
  "id": "frontend-blazor-lifecycle",
@@ -509,7 +797,13 @@
509
797
  "tags": [
510
798
  "frontend",
511
799
  "blazor"
512
- ]
800
+ ],
801
+ "aliases": ["blazor lifecycle", "OnInitialized", "OnAfterRender", "StateHasChanged", "component lifecycle"],
802
+ "anchors": {
803
+ "hooks": "#lifecycle-hooks",
804
+ "async": "#async-patterns"
805
+ },
806
+ "digest": "OnInitializedAsync for data loading (not constructor or OnInitialized). JSInterop only in OnAfterRenderAsync(firstRender:true). Dispose event subscriptions in IDisposable.Dispose(). Call StateHasChanged() after async state changes from non-UI threads. Cancel background work with CancellationTokenSource in Dispose()."
513
807
  },
514
808
  {
515
809
  "id": "frontend-blazor-pitfalls",
@@ -520,7 +814,13 @@
520
814
  "tags": [
521
815
  "frontend",
522
816
  "blazor"
523
- ]
817
+ ],
818
+ "aliases": ["blazor anti-patterns", "blazor mistakes", "blazor gotchas", "blazor bugs", "common errors"],
819
+ "anchors": {
820
+ "concurrency": "#concurrency-pitfalls",
821
+ "memory": "#memory-leaks"
822
+ },
823
+ "digest": "Never inject DbContext directly — use IDbContextFactory. Avoid async void event handlers (use async Task). Route parameters need [Parameter] attribute. Use EventCallback<T> not Action<T> for parent-child callbacks. Dispose HttpClient connections, SignalR connections, and timers in IDisposable."
524
824
  },
525
825
  {
526
826
  "id": "frontend-blazor-state",
@@ -531,7 +831,30 @@
531
831
  "tags": [
532
832
  "frontend",
533
833
  "blazor"
534
- ]
834
+ ],
835
+ "aliases": ["blazor state", "cascading value", "state container", "component state", "Fluxor"],
836
+ "anchors": {
837
+ "patterns": "#state-patterns",
838
+ "sharing": "#state-sharing"
839
+ },
840
+ "digest": "CascadingParameter for app-wide state (auth, theme). Scoped services as state containers for per-user state. Local component state with private fields + StateHasChanged. Never store state in static fields — use DI. localStorage via IJSRuntime for persistence. Fluxor for complex state with multiple consumers."
841
+ },
842
+ {
843
+ "id": "frontend-design-system-aesthetic-direction",
844
+ "name": "aesthetic direction",
845
+ "path": "frontend/design-system/aesthetic-direction.md",
846
+ "category": "frontend",
847
+ "subcategory": "design-system",
848
+ "tags": [
849
+ "frontend",
850
+ "design-system"
851
+ ],
852
+ "aliases": ["aesthetic direction", "visual design", "brand identity", "design language", "design tone"],
853
+ "anchors": {
854
+ "principles": "#design-principles",
855
+ "tokens": "#design-tokens"
856
+ },
857
+ "digest": "Define aesthetic direction before generating mockups: tone (professional/playful), density (compact/spacious), brand colors (primary, secondary, accent). Document in design-system.md. All UI decisions derive from aesthetic direction — never use arbitrary colors or spacing values."
535
858
  },
536
859
  {
537
860
  "id": "frontend-design-system-animations",
@@ -542,7 +865,13 @@
542
865
  "tags": [
543
866
  "frontend",
544
867
  "design-system"
545
- ]
868
+ ],
869
+ "aliases": ["animations", "transitions", "motion", "CSS animations", "keyframes", "prefers-reduced-motion"],
870
+ "anchors": {
871
+ "tokens": "#animation-tokens",
872
+ "principles": "#motion-principles"
873
+ },
874
+ "digest": "Use CSS custom properties for durations: --duration-fast (100ms), --duration-normal (200ms), --duration-slow (300ms). Prefer transform/opacity for GPU-accelerated animations. Always respect prefers-reduced-motion. No decorative animations over 300ms. Ease-out for entrances, ease-in for exits."
546
875
  },
547
876
  {
548
877
  "id": "frontend-design-system-naming",
@@ -553,7 +882,13 @@
553
882
  "tags": [
554
883
  "frontend",
555
884
  "design-system"
556
- ]
885
+ ],
886
+ "aliases": ["BEM", "CSS naming", "class naming", "design token naming", "component naming"],
887
+ "anchors": {
888
+ "blocks": "#bem-blocks",
889
+ "tokens": "#token-naming"
890
+ },
891
+ "digest": "BEM for CSS: .block__element--modifier. Design tokens: --color-primary-500, --spacing-4, --font-size-base. Component names PascalCase (Blazor) / kebab-case (CSS). No generic names (blue, big). Semantic names only: --color-action, --spacing-page-gutter. Tokens are the single source of truth."
557
892
  },
558
893
  {
559
894
  "id": "frontend-nextjs-app-router",
@@ -564,7 +899,13 @@
564
899
  "tags": [
565
900
  "frontend",
566
901
  "nextjs"
567
- ]
902
+ ],
903
+ "aliases": ["app router", "Next.js 14", "server components", "app directory", "RSC"],
904
+ "anchors": {
905
+ "layout": "#layout-patterns",
906
+ "routing": "#routing-patterns"
907
+ },
908
+ "digest": "Server Components by default — only add 'use client' when needed (interactivity, browser APIs, hooks). Layouts persist across navigations. Parallel Routes with @folder for simultaneous views. Route Groups with (folder) to organize without affecting URL. Use generateMetadata() for dynamic SEO metadata."
568
909
  },
569
910
  {
570
911
  "id": "frontend-nextjs-components",
@@ -575,7 +916,13 @@
575
916
  "tags": [
576
917
  "frontend",
577
918
  "nextjs"
578
- ]
919
+ ],
920
+ "aliases": ["react components", "server component", "client component", "shadcn/ui", "UI components"],
921
+ "anchors": {
922
+ "patterns": "#component-patterns",
923
+ "shadcn": "#shadcn-usage"
924
+ },
925
+ "digest": "Server Components for data fetching and static content. Client Components for interactivity. shadcn/ui components are copy-paste — customize in src/components/ui/. Never use index.tsx for named exports. One component per file. Avoid prop drilling — use composition or Context API."
579
926
  },
580
927
  {
581
928
  "id": "frontend-nextjs-data-fetching",
@@ -586,7 +933,13 @@
586
933
  "tags": [
587
934
  "frontend",
588
935
  "nextjs"
589
- ]
936
+ ],
937
+ "aliases": ["TanStack Query", "react-query", "server actions", "data fetching", "useQuery"],
938
+ "anchors": {
939
+ "server": "#server-fetching",
940
+ "client": "#client-fetching"
941
+ },
942
+ "digest": "Server Components: fetch() with caching tags for static/ISR. Client Components: TanStack Query useQuery/useMutation for client-side state. Server Actions for mutations from Client Components. Never fetch in useEffect — use TanStack Query. Set revalidate intervals for ISR. Use React Suspense for loading states."
590
943
  },
591
944
  {
592
945
  "id": "frontend-nextjs-forms",
@@ -597,7 +950,13 @@
597
950
  "tags": [
598
951
  "frontend",
599
952
  "nextjs"
600
- ]
953
+ ],
954
+ "aliases": ["react-hook-form", "Zod", "form validation", "Server Actions forms", "useFormState"],
955
+ "anchors": {
956
+ "validation": "#zod-schemas",
957
+ "submission": "#form-submission"
958
+ },
959
+ "digest": "react-hook-form with Zod resolver for client forms. Define Zod schema before component. Server Actions for mutations: 'use server' directive. Use useFormState/useActionState for Server Action feedback. Never submit to API routes — use Server Actions or React Query mutations. Display field-level errors from Zod."
601
960
  },
602
961
  {
603
962
  "id": "frontend-nextjs-naming-conventions",
@@ -608,7 +967,13 @@
608
967
  "tags": [
609
968
  "frontend",
610
969
  "nextjs"
611
- ]
970
+ ],
971
+ "aliases": ["naming conventions", "file naming", "component naming", "Next.js naming", "TypeScript naming"],
972
+ "anchors": {
973
+ "files": "#file-naming",
974
+ "components": "#component-naming"
975
+ },
976
+ "digest": "Pages: lowercase kebab-case (user-profile/page.tsx). Components: PascalCase (UserProfile.tsx). Hooks: camelCase with 'use' prefix (useUserProfile.ts). API routes: kebab-case. Types: PascalCase. No default exports except page.tsx and layout.tsx. Feature-based co-location preferred."
612
977
  },
613
978
  {
614
979
  "id": "frontend-nextjs-nextjs-patterns",
@@ -619,7 +984,13 @@
619
984
  "tags": [
620
985
  "frontend",
621
986
  "nextjs"
622
- ]
987
+ ],
988
+ "aliases": ["Next.js patterns", "middleware", "auth patterns", "caching patterns", "image optimization"],
989
+ "anchors": {
990
+ "auth": "#auth-patterns",
991
+ "caching": "#caching-patterns"
992
+ },
993
+ "digest": "Middleware for auth redirects (use matcher config). next/image for all images (auto-optimization). next/link for navigation (prefetching). loading.tsx for Suspense boundaries per route. error.tsx for error boundaries. Use unstable_cache for expensive server computations with tag-based revalidation."
623
994
  },
624
995
  {
625
996
  "id": "frontend-nextjs-project-structure",
@@ -630,7 +1001,13 @@
630
1001
  "tags": [
631
1002
  "frontend",
632
1003
  "nextjs"
633
- ]
1004
+ ],
1005
+ "aliases": ["project structure", "folder structure", "src directory", "app directory organization"],
1006
+ "anchors": {
1007
+ "structure": "#directory-structure",
1008
+ "organization": "#feature-organization"
1009
+ },
1010
+ "digest": "src/app/ for routes, src/components/ for shared UI, src/lib/ for utilities, src/hooks/ for custom hooks, src/types/ for TypeScript types. Co-locate feature components near their routes. Public API via components/index.ts. Avoid barrel files in app/ directory. Keep pages thin — logic in hooks and utilities."
634
1011
  },
635
1012
  {
636
1013
  "id": "frontend-nextjs-state-management",
@@ -641,7 +1018,13 @@
641
1018
  "tags": [
642
1019
  "frontend",
643
1020
  "nextjs"
644
- ]
1021
+ ],
1022
+ "aliases": ["zustand", "React context", "global state", "state management", "client state"],
1023
+ "anchors": {
1024
+ "patterns": "#state-patterns",
1025
+ "server": "#server-state"
1026
+ },
1027
+ "digest": "TanStack Query for server state (caching, background sync, optimistic updates). Zustand for global client state (auth, theme, user preferences). URL params for shareable UI state (filters, pagination). useState for local component state. Avoid Redux — Zustand is sufficient for most Next.js use cases."
645
1028
  },
646
1029
  {
647
1030
  "id": "frontend-nextjs-testing",
@@ -652,7 +1035,13 @@
652
1035
  "tags": [
653
1036
  "frontend",
654
1037
  "nextjs"
655
- ]
1038
+ ],
1039
+ "aliases": ["vitest", "jest", "testing-library", "Playwright", "Next.js testing", "component tests"],
1040
+ "anchors": {
1041
+ "unit": "#unit-tests",
1042
+ "e2e": "#e2e-tests"
1043
+ },
1044
+ "digest": "Vitest for unit tests, React Testing Library for component tests. Mock next/navigation with vi.mock. Test Server Actions with direct function calls. Use MSW for API mocking in component tests. Playwright for E2E tests against running app. Never test implementation details — test user behavior and output."
656
1045
  },
657
1046
  {
658
1047
  "id": "infrastructure-azure-azure",
@@ -663,7 +1052,13 @@
663
1052
  "tags": [
664
1053
  "infrastructure",
665
1054
  "azure"
666
- ]
1055
+ ],
1056
+ "aliases": ["azure", "Azure setup", "resource group", "subscription", "azure baseline"],
1057
+ "anchors": {
1058
+ "resources": "#core-resources",
1059
+ "security": "#security-baseline"
1060
+ },
1061
+ "digest": "Organize resources by resource groups per environment (dev/staging/prod). Use managed identities for service-to-service auth — never service principals or keys in code. Tag all resources (env, project, owner). Enable diagnostic settings for all services. All secrets in Key Vault. Apply Azure Policy for compliance guardrails."
667
1062
  },
668
1063
  {
669
1064
  "id": "infrastructure-azure-bicep-bicep-patterns",
@@ -675,7 +1070,13 @@
675
1070
  "infrastructure",
676
1071
  "azure",
677
1072
  "bicep"
678
- ]
1073
+ ],
1074
+ "aliases": ["bicep", "ARM template", "IaC", "infrastructure as code", "resource deployment"],
1075
+ "anchors": {
1076
+ "modules": "#module-patterns",
1077
+ "parameters": "#parameter-files"
1078
+ },
1079
+ "digest": "Structure as main.bicep + modules/. Parameters in parameters.{env}.bicepparams. Use @secure() for secrets — never hardcode. Run What-If before apply. Use existing keyword for cross-RG references. Modules are reusable units — never duplicate resource blocks. Deploy via CI/CD pipeline, not ad hoc."
679
1080
  },
680
1081
  {
681
1082
  "id": "infrastructure-azure-devops-azure-devops-setup",
@@ -687,7 +1088,13 @@
687
1088
  "infrastructure",
688
1089
  "azure",
689
1090
  "devops"
690
- ]
1091
+ ],
1092
+ "aliases": ["azure devops", "ADO", "pipelines", "YAML pipeline", "azure-pipelines.yml"],
1093
+ "anchors": {
1094
+ "setup": "#organization-setup",
1095
+ "pipelines": "#pipeline-setup"
1096
+ },
1097
+ "digest": "YAML pipelines checked into repo — no classic editor. Separate environments: dev, staging, prod with approval gates. Service connections use managed identity (no service principals). Variable groups for per-env config. Artifacts feed for private NuGet packages. Branch policies require PR + CI for main/develop."
691
1098
  },
692
1099
  {
693
1100
  "id": "infrastructure-azure-devops-local-development",
@@ -699,7 +1106,13 @@
699
1106
  "infrastructure",
700
1107
  "azure",
701
1108
  "devops"
702
- ]
1109
+ ],
1110
+ "aliases": ["local dev", "azurite", "local azure", "dev container", "local secrets", "dotnet user-secrets"],
1111
+ "anchors": {
1112
+ "emulators": "#local-emulators",
1113
+ "secrets": "#local-secrets"
1114
+ },
1115
+ "digest": "Use Azurite for local Blob/Queue/Table storage emulation. dotnet user-secrets for local credentials — never .env files committed to git. Use Connection String for local, Managed Identity for deployed. Dev containers for reproducible environments. Local HTTPS with ASP.NET dev certificates."
703
1116
  },
704
1117
  {
705
1118
  "id": "infrastructure-azure-services-functions",
@@ -711,7 +1124,13 @@
711
1124
  "infrastructure",
712
1125
  "azure",
713
1126
  "services"
714
- ]
1127
+ ],
1128
+ "aliases": ["Azure Functions", "serverless", "function app", "timer trigger", "HTTP trigger", "Durable Functions"],
1129
+ "anchors": {
1130
+ "triggers": "#trigger-types",
1131
+ "bindings": "#input-output-bindings"
1132
+ },
1133
+ "digest": "Use isolated worker model (.NET 8+). HTTP triggers for API endpoints, Timer triggers for scheduled work, Service Bus triggers for event processing. Configure scale-out limits to prevent runaway costs. Durable Functions for long-running orchestrations. Deploy with deployment slots for zero-downtime."
715
1134
  },
716
1135
  {
717
1136
  "id": "infrastructure-azure-services-service-bus",
@@ -723,7 +1142,13 @@
723
1142
  "infrastructure",
724
1143
  "azure",
725
1144
  "services"
726
- ]
1145
+ ],
1146
+ "aliases": ["service bus", "message queue", "topics", "subscriptions", "dead letter queue"],
1147
+ "anchors": {
1148
+ "setup": "#namespace-setup",
1149
+ "patterns": "#messaging-patterns"
1150
+ },
1151
+ "digest": "Topics+subscriptions for pub/sub, queues for point-to-point. Set MaxDeliveryCount=10 for retry limit. Monitor dead letter queue. Use message sessions for ordered processing. Implement idempotent handlers (check processed message IDs). Use managed identity for authentication. Prefetch for high-throughput consumers."
727
1152
  },
728
1153
  {
729
1154
  "id": "infrastructure-azure-services-storage",
@@ -735,7 +1160,13 @@
735
1160
  "infrastructure",
736
1161
  "azure",
737
1162
  "services"
738
- ]
1163
+ ],
1164
+ "aliases": ["azure storage", "blob", "table storage", "queue storage", "storage account tiers"],
1165
+ "anchors": {
1166
+ "tiers": "#storage-tiers",
1167
+ "security": "#access-control"
1168
+ },
1169
+ "digest": "Hot tier for frequently accessed, cool for infrequent, archive for compliance. Always use managed identity — not storage keys. Enable versioning + soft delete for business data. Lifecycle management rules for cost optimization. Private endpoints for secure access from VNet. CDN for public static assets."
739
1170
  },
740
1171
  {
741
1172
  "id": "infrastructure-docker-easypanel-deploy",
@@ -746,7 +1177,13 @@
746
1177
  "tags": [
747
1178
  "infrastructure",
748
1179
  "docker"
749
- ]
1180
+ ],
1181
+ "aliases": ["easypanel", "docker deploy", "self-hosted", "VPS deployment", "docker compose"],
1182
+ "anchors": {
1183
+ "setup": "#easypanel-setup",
1184
+ "deployment": "#deployment-flow"
1185
+ },
1186
+ "digest": "Create app in EasyPanel from container registry image. Configure environment variables in EasyPanel UI — not in Dockerfile. Use EasyPanel's managed Postgres/Redis for databases. Configure /health endpoint for health checks. Enable HTTPS via Let's Encrypt automatically. Use EasyPanel volumes for persistent storage."
750
1187
  },
751
1188
  {
752
1189
  "id": "infrastructure-supabase-mcp-setup",
@@ -757,7 +1194,13 @@
757
1194
  "tags": [
758
1195
  "infrastructure",
759
1196
  "supabase"
760
- ]
1197
+ ],
1198
+ "aliases": ["supabase MCP", "supabase tools", "supabase configuration", "MCP supabase"],
1199
+ "anchors": {
1200
+ "setup": "#mcp-configuration",
1201
+ "tools": "#available-tools"
1202
+ },
1203
+ "digest": "Configure Supabase MCP server with project URL and service_role key in .claude/settings.json. Use MCP tools for schema inspection, query execution, and migration management. Never expose service_role key client-side. Set up anon key for client SDK. Enable in Claude settings for database introspection during design phase."
761
1204
  },
762
1205
  {
763
1206
  "id": "infrastructure-supabase-supabase-auth",
@@ -768,7 +1211,13 @@
768
1211
  "tags": [
769
1212
  "infrastructure",
770
1213
  "supabase"
771
- ]
1214
+ ],
1215
+ "aliases": ["supabase auth", "magic link", "OAuth", "JWT supabase", "row level security auth"],
1216
+ "anchors": {
1217
+ "setup": "#auth-setup",
1218
+ "providers": "#auth-providers"
1219
+ },
1220
+ "digest": "Use Supabase Auth for magic links, OAuth (Google, GitHub), phone OTP. Configure site URL and redirect URLs in dashboard. Server-side: use supabase.auth.getUser() not getSession(). Enable email confirmations for production. JWT expiry 3600s. RLS policies must reference auth.uid() for user isolation."
772
1221
  },
773
1222
  {
774
1223
  "id": "infrastructure-supabase-supabase-pgvector",
@@ -779,7 +1228,13 @@
779
1228
  "tags": [
780
1229
  "infrastructure",
781
1230
  "supabase"
782
- ]
1231
+ ],
1232
+ "aliases": ["pgvector", "vector embeddings", "similarity search", "supabase vectors", "HNSW index"],
1233
+ "anchors": {
1234
+ "setup": "#pgvector-setup",
1235
+ "queries": "#similarity-queries"
1236
+ },
1237
+ "digest": "Enable: CREATE EXTENSION vector. Define column as vector(1536) for OpenAI embeddings. Create HNSW index: CREATE INDEX USING hnsw (embedding vector_cosine_ops). Use match_documents() RPC for similarity search. Batch insert embeddings (100 at a time). RLS policies apply to vector queries like all other tables."
783
1238
  },
784
1239
  {
785
1240
  "id": "infrastructure-supabase-supabase-rls",
@@ -790,7 +1245,13 @@
790
1245
  "tags": [
791
1246
  "infrastructure",
792
1247
  "supabase"
793
- ]
1248
+ ],
1249
+ "aliases": ["RLS", "row level security", "postgres policies", "multi-tenant security", "supabase policies"],
1250
+ "anchors": {
1251
+ "policies": "#rls-policies",
1252
+ "patterns": "#tenant-patterns"
1253
+ },
1254
+ "digest": "Enable RLS on every table: ALTER TABLE ... ENABLE ROW LEVEL SECURITY. User isolation: USING (auth.uid() = user_id). Multi-tenant: USING (tenant_id = (auth.jwt()->>'tenant_id')::uuid). Test policies with SET LOCAL ROLE anon. Service role bypasses RLS — use only server-side. Never rely on application-level security alone."
794
1255
  },
795
1256
  {
796
1257
  "id": "infrastructure-supabase-supabase-storage",
@@ -801,7 +1262,13 @@
801
1262
  "tags": [
802
1263
  "infrastructure",
803
1264
  "supabase"
804
- ]
1265
+ ],
1266
+ "aliases": ["supabase storage", "file uploads", "storage buckets", "storage policies", "signed URLs"],
1267
+ "anchors": {
1268
+ "buckets": "#bucket-setup",
1269
+ "policies": "#storage-policies"
1270
+ },
1271
+ "digest": "Public buckets for CDN-served assets, private for user files (signed URLs). Storage policies use same RLS syntax as tables. Upload: supabase.storage.from('bucket').upload(path, file). Signed URLs: createSignedUrl(path, 3600). Set content-type on upload. Enable image transformations for on-the-fly resizing."
805
1272
  },
806
1273
  {
807
1274
  "id": "integration-api-graphql",
@@ -812,7 +1279,13 @@
812
1279
  "tags": [
813
1280
  "integration",
814
1281
  "api"
815
- ]
1282
+ ],
1283
+ "aliases": ["graphql", "Hot Chocolate", "GraphQL schema", "query", "mutation", "subscription"],
1284
+ "anchors": {
1285
+ "setup": "#hot-chocolate-setup",
1286
+ "patterns": "#schema-patterns"
1287
+ },
1288
+ "digest": "Use Hot Chocolate for .NET GraphQL. Define types with [GraphQLType], mutations with [UseMutationConvention]. Enable pagination with [UsePaging]. Use DataLoader to prevent N+1 queries. Add [Authorize] for field-level security. Never expose internal exceptions — use custom error types. Enable introspection only in dev."
816
1289
  },
817
1290
  {
818
1291
  "id": "integration-api-grpc",
@@ -823,7 +1296,13 @@
823
1296
  "tags": [
824
1297
  "integration",
825
1298
  "api"
826
- ]
1299
+ ],
1300
+ "aliases": ["grpc", "protobuf", ".proto files", "gRPC service", "server streaming"],
1301
+ "anchors": {
1302
+ "proto": "#proto-design",
1303
+ "patterns": "#service-patterns"
1304
+ },
1305
+ "digest": "Define .proto files first, generate C# stubs. Use proto3 syntax. Unary for request-response, server streaming for real-time data. GrpcChannel with managed credentials. Add grpc-health-probe for health checks. Prefer REST for external APIs, gRPC for internal service-to-service. Use Buf for proto linting and schema registry."
827
1306
  },
828
1307
  {
829
1308
  "id": "integration-api-rest-design",
@@ -834,7 +1313,13 @@
834
1313
  "tags": [
835
1314
  "integration",
836
1315
  "api"
837
- ]
1316
+ ],
1317
+ "aliases": ["REST design", "RESTful API", "HTTP API design", "resource naming", "API versioning"],
1318
+ "anchors": {
1319
+ "resources": "#resource-naming",
1320
+ "errors": "#error-handling"
1321
+ },
1322
+ "digest": "Resources are nouns, HTTP verbs are actions: GET /users, POST /users, PUT /users/{id}, DELETE /users/{id}. 201+Location for creation, 204 for deletion. RFC 9457 ProblemDetails for errors. Cursor-based pagination for large collections. URL versioning (/api/v1/). HATEOAS links for discoverable APIs."
838
1323
  },
839
1324
  {
840
1325
  "id": "integration-event-driven-cqrs",
@@ -845,7 +1330,13 @@
845
1330
  "tags": [
846
1331
  "integration",
847
1332
  "event-driven"
848
- ]
1333
+ ],
1334
+ "aliases": ["CQRS", "command query separation", "MediatR", "read model", "write model"],
1335
+ "anchors": {
1336
+ "commands": "#command-patterns",
1337
+ "queries": "#query-patterns"
1338
+ },
1339
+ "digest": "Commands mutate state, queries read state — never mix. Commands return void or Result (not data). Queries return DTOs (not domain entities). Use MediatR for in-process CQRS. Validate commands at API boundary before handler. Read models can be denormalized for query performance."
849
1340
  },
850
1341
  {
851
1342
  "id": "integration-event-driven-event-sourcing",
@@ -856,7 +1347,13 @@
856
1347
  "tags": [
857
1348
  "integration",
858
1349
  "event-driven"
859
- ]
1350
+ ],
1351
+ "aliases": ["event sourcing", "event store", "event replay", "aggregate events", "append-only log"],
1352
+ "anchors": {
1353
+ "events": "#domain-events",
1354
+ "replay": "#event-replay"
1355
+ },
1356
+ "digest": "Store events as immutable past-tense facts: OrderCreated, PaymentProcessed. Aggregate rebuilds state from event stream. Take snapshots for aggregates with >100 events. Use EventStoreDB or CosmosDB change feed for storage. Projections build read models from events. Never delete events — use correction events."
860
1357
  },
861
1358
  {
862
1359
  "id": "integration-event-driven-service-bus",
@@ -867,7 +1364,13 @@
867
1364
  "tags": [
868
1365
  "integration",
869
1366
  "event-driven"
870
- ]
1367
+ ],
1368
+ "aliases": ["service bus integration", "message broker", "event bus", "publisher", "consumer"],
1369
+ "anchors": {
1370
+ "topics": "#topic-subscription",
1371
+ "patterns": "#integration-patterns"
1372
+ },
1373
+ "digest": "Publish domain events to Service Bus after aggregate persistence (transactional outbox). Consumers must be idempotent — check processed message IDs. Use correlation IDs for distributed tracing. Message envelope includes schema version. Consumer groups enable event replay. Monitor dead letter queue in production."
871
1374
  },
872
1375
  {
873
1376
  "id": "integration-mcp-mcp-tools",
@@ -878,7 +1381,13 @@
878
1381
  "tags": [
879
1382
  "integration",
880
1383
  "mcp"
881
- ]
1384
+ ],
1385
+ "aliases": ["MCP", "Model Context Protocol", "Claude tools", "MCP server", "MCP client"],
1386
+ "anchors": {
1387
+ "tools": "#tool-definitions",
1388
+ "setup": "#server-setup"
1389
+ },
1390
+ "digest": "MCP tools extend Claude with external data and actions. Tools are synchronous request-response with typed inputSchema. Resources provide read-only data access. Prompts are reusable templates. Register MCP servers in .claude/settings.json. Prefer @context7 for live library docs. Test tools with MCP Inspector before integrating."
882
1391
  },
883
1392
  {
884
1393
  "id": "observability-logging",
@@ -888,7 +1397,13 @@
888
1397
  "subcategory": null,
889
1398
  "tags": [
890
1399
  "observability"
891
- ]
1400
+ ],
1401
+ "aliases": ["logging", "serilog", "ILogger", "structured logging", "log levels", "Application Insights"],
1402
+ "anchors": {
1403
+ "setup": "#serilog-setup",
1404
+ "patterns": "#logging-patterns"
1405
+ },
1406
+ "digest": "Use Serilog with structured logging. Sinks: Console (dev), Application Insights (prod). Inject ILogger<T> — never static Logger. Log levels: Debug for trace, Information for business events, Warning for recoverable, Error for failures. Include correlation IDs in all logs. Never log PII or credentials."
892
1407
  },
893
1408
  {
894
1409
  "id": "observability-metrics",
@@ -898,7 +1413,13 @@
898
1413
  "subcategory": null,
899
1414
  "tags": [
900
1415
  "observability"
901
- ]
1416
+ ],
1417
+ "aliases": ["metrics", "prometheus", "OpenTelemetry metrics", "custom metrics", "counters", "histograms"],
1418
+ "anchors": {
1419
+ "setup": "#metrics-setup",
1420
+ "instruments": "#metric-types"
1421
+ },
1422
+ "digest": "System.Diagnostics.Metrics API for .NET. Register meters: builder.Services.AddMetrics(). Types: Counter (total count), Histogram (latency distribution), Gauge (current value). Export to Prometheus or Azure Monitor. Tag dimensions: environment, service, version. Define SLIs from business metrics, not technical ones."
902
1423
  },
903
1424
  {
904
1425
  "id": "observability-monitoring",
@@ -908,7 +1429,13 @@
908
1429
  "subcategory": null,
909
1430
  "tags": [
910
1431
  "observability"
911
- ]
1432
+ ],
1433
+ "aliases": ["monitoring", "alerts", "dashboards", "Application Insights", "health checks", "SLA"],
1434
+ "anchors": {
1435
+ "alerts": "#alert-rules",
1436
+ "dashboards": "#dashboard-setup"
1437
+ },
1438
+ "digest": "Health checks: /health for liveness, /health/ready for readiness. Application Insights for distributed tracing. SLA-based alerts: p99 latency, error rate >1%, availability <99.9%. Azure Workbooks dashboards per feature. Availability tests for external endpoints. Each alert has an on-call runbook."
912
1439
  },
913
1440
  {
914
1441
  "id": "observability-tracing",
@@ -918,7 +1445,13 @@
918
1445
  "subcategory": null,
919
1446
  "tags": [
920
1447
  "observability"
921
- ]
1448
+ ],
1449
+ "aliases": ["tracing", "OpenTelemetry", "distributed trace", "spans", "W3C TraceContext"],
1450
+ "anchors": {
1451
+ "setup": "#otel-setup",
1452
+ "propagation": "#context-propagation"
1453
+ },
1454
+ "digest": "Add OpenTelemetry SDK. Auto-instrument HTTP, SQL, Service Bus. Propagate W3C TraceContext across services. Custom spans for business operations: using var span = tracer.StartActiveSpan('operation'). Export to Azure Monitor or Jaeger. Sampling: 10% in prod, 100% for errors. Correlate traces with logs via trace ID."
922
1455
  },
923
1456
  {
924
1457
  "id": "workflows-parallel-execution",
@@ -928,7 +1461,13 @@
928
1461
  "subcategory": null,
929
1462
  "tags": [
930
1463
  "workflows"
931
- ]
1464
+ ],
1465
+ "aliases": ["parallel", "Task.WhenAll", "concurrent", "parallelism", "async parallel", "Parallel.ForEachAsync"],
1466
+ "anchors": {
1467
+ "patterns": "#parallel-patterns",
1468
+ "throttling": "#concurrency-limits"
1469
+ },
1470
+ "digest": "Task.WhenAll for I/O-bound independent parallel ops. Parallel.ForEachAsync with CancellationToken for CPU-bound batches. SemaphoreSlim for concurrency limiting. Channel<T> for producer-consumer. Never Task.WhenAll with DbContext — use separate factory-created instances per task. Measure actual benefit before adding parallelism."
932
1471
  },
933
1472
  {
934
1473
  "id": "workflows-thread-management",
@@ -938,7 +1477,13 @@
938
1477
  "subcategory": null,
939
1478
  "tags": [
940
1479
  "workflows"
941
- ]
1480
+ ],
1481
+ "aliases": ["threads", "ThreadPool", "ConfigureAwait", "deadlock prevention", "async void", "synchronization"],
1482
+ "anchors": {
1483
+ "patterns": "#thread-patterns",
1484
+ "deadlocks": "#deadlock-prevention"
1485
+ },
1486
+ "digest": "Use async/await throughout — never mix blocking calls (.Result, .Wait()). ConfigureAwait(false) in library code. Never Thread.Sleep — use Task.Delay with CancellationToken. Lock-free with Interlocked for counters, ConcurrentDictionary for shared state. ThreadPool.QueueUserWorkItem only for truly detached background work."
942
1487
  }
943
1488
  ]
944
1489
  }