@polymorphism-tech/morph-spec 7.0.0 → 7.1.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 (79) hide show
  1. package/README.md +367 -367
  2. package/framework/agents.json +132 -127
  3. package/framework/rubrics/backend.json +41 -36
  4. package/framework/rules/ai-agents-standards.md +45 -15
  5. package/framework/rules/neon-standards.md +25 -26
  6. package/framework/standards/STANDARDS.json +1729 -1133
  7. package/framework/standards/ai-agents/agent-session.md +160 -0
  8. package/framework/standards/ai-agents/batching.md +193 -0
  9. package/framework/standards/ai-agents/context-providers.md +188 -0
  10. package/framework/standards/ai-agents/mcp-server.md +250 -0
  11. package/framework/standards/ai-agents/mcp-tools.md +197 -0
  12. package/framework/standards/ai-agents/middleware-patterns.md +207 -0
  13. package/framework/standards/ai-agents/modalities-image-gen.md +173 -0
  14. package/framework/standards/ai-agents/modalities-speech-to-text.md +171 -0
  15. package/framework/standards/ai-agents/modalities-text-to-speech.md +181 -0
  16. package/framework/standards/ai-agents/modalities-vision.md +201 -0
  17. package/framework/standards/ai-agents/multi-agent-patterns.md +155 -0
  18. package/framework/standards/ai-agents/production.md +114 -258
  19. package/framework/standards/ai-agents/prompts-in-db.md +214 -0
  20. package/framework/standards/ai-agents/providers/model-registry.md +158 -0
  21. package/framework/standards/ai-agents/rag-custom-pgvector.md +243 -0
  22. package/framework/standards/ai-agents/service-tier-flex.md +135 -0
  23. package/framework/standards/ai-agents/setup.md +142 -316
  24. package/framework/standards/ai-agents/structured-output.md +249 -0
  25. package/framework/standards/ai-agents/sweet-spot.md +109 -0
  26. package/framework/standards/ai-agents/workflows.md +114 -284
  27. package/framework/standards/architecture/vertical-slice/vertical-slice.md +433 -429
  28. package/framework/standards/backend/api/validation.md +92 -88
  29. package/framework/standards/backend/database/postgresql/database.md +336 -332
  30. package/framework/standards/backend/database/vector-search-rag.md +599 -541
  31. package/framework/standards/backend/dotnet/fluent-validation-vsa.md +4 -0
  32. package/framework/standards/backend/dotnet/result-pattern.md +4 -0
  33. package/framework/standards/backend/dotnet/scalar-ui.md +176 -172
  34. package/framework/standards/backend/dotnet/scrutor.md +4 -0
  35. package/framework/standards/backend/dotnet/vsa-handler-patterns.md +278 -274
  36. package/framework/standards/backend/integrations/asaas/asaas-api.md +260 -216
  37. package/framework/standards/backend/integrations/hangfire/hangfire-jobs.md +354 -350
  38. package/framework/standards/backend/integrations/neon-auth/neon-auth.md +30 -19
  39. package/framework/standards/backend/integrations/resend/resend-email.md +400 -385
  40. package/framework/standards/data/nosql/cache/redis.md +106 -97
  41. package/framework/standards/data/nosql/cosmos-db.md +127 -118
  42. package/framework/standards/data/vector-search/rag-chunking.md +113 -104
  43. package/framework/standards/frontend/design-system/ai-image-generation.md +4 -0
  44. package/framework/standards/frontend/design-system/animations.md +164 -160
  45. package/framework/standards/frontend/design-system/naming.md +68 -64
  46. package/framework/standards/frontend/gsap/gsap-core.md +14 -8
  47. package/framework/standards/frontend/gsap/gsap-plugins.md +26 -21
  48. package/framework/standards/frontend/gsap/gsap-scrolltrigger.md +9 -7
  49. package/framework/standards/frontend/nextjs/app-router.md +127 -123
  50. package/framework/standards/frontend/nextjs/components.md +136 -132
  51. package/framework/standards/frontend/nextjs/data-fetching.md +130 -126
  52. package/framework/standards/frontend/nextjs/forms.md +134 -128
  53. package/framework/standards/frontend/nextjs/motion-patterns.md +328 -322
  54. package/framework/standards/frontend/nextjs/naming-conventions.md +71 -67
  55. package/framework/standards/frontend/nextjs/nextjs-patterns.md +229 -225
  56. package/framework/standards/frontend/nextjs/project-structure.md +106 -102
  57. package/framework/standards/frontend/nextjs/state-management.md +76 -72
  58. package/framework/standards/frontend/nextjs/testing.md +115 -111
  59. package/framework/standards/infrastructure/docker/easypanel-deploy.md +196 -192
  60. package/framework/standards/infrastructure/neon/neon-pgrag.md +6 -2
  61. package/framework/standards/infrastructure/neon/neon-pgvector.md +4 -0
  62. package/framework/standards/infrastructure/neon/neon-setup.md +5 -1
  63. package/framework/standards/integration/mcp/mcp-tools.md +471 -462
  64. package/framework/templates/REGISTRY.json +1745 -1239
  65. package/framework/templates/code/dotnet/ai-agents/AgentBootstrap.cs.template +39 -0
  66. package/framework/templates/code/dotnet/ai-agents/EmbeddingService.cs.template +68 -0
  67. package/framework/templates/code/dotnet/ai-agents/ModelRegistry.cs.template +117 -0
  68. package/framework/templates/code/dotnet/ai-agents/PromptRepository.cs.template +95 -0
  69. package/framework/templates/code/dotnet/ai-agents/ResilientToolMiddleware.cs.template +61 -0
  70. package/framework/templates/code/dotnet/ai-agents/VectorSearchTool.cs.template +107 -0
  71. package/framework/templates/code/dotnet/ai-agents/model-registry.json.template +58 -0
  72. package/framework/templates/code/sql/ai-agents/agent-prompts-migration.sql.template +58 -0
  73. package/framework/templates/code/sql/ai-agents/pgvector-embeddings-migration.sql.template +91 -0
  74. package/package.json +89 -83
  75. package/src/core/templates/template-registry.js +289 -256
  76. package/src/lib/generators/context-generator.js +516 -518
  77. package/src/lib/generators/scaffold-generator.js +23 -26
  78. package/framework/standards/infrastructure/neon/neon-semantic-kernel.md +0 -310
  79. package/framework/templates/integrations/semantic-kernel-neon.cs +0 -125
@@ -1,1133 +1,1729 @@
1
- {
2
- "version": "1.0.0",
3
- "standards": [
4
- {
5
- "id": "ai-agents-production",
6
- "name": "production",
7
- "path": "ai-agents/production.md",
8
- "category": "ai-agents",
9
- "subcategory": null,
10
- "tags": [
11
- "ai-agents"
12
- ],
13
- "aliases": [
14
- "AI production",
15
- "agent reliability",
16
- "production AI",
17
- "agent safety",
18
- "autonomous systems"
19
- ],
20
- "anchors": {
21
- "reliability": "#reliability-patterns",
22
- "safety": "#safety-guardrails",
23
- "monitoring": "#monitoring-and-logging"
24
- },
25
- "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.",
26
- "stacks": [
27
- "*"
28
- ]
29
- },
30
- {
31
- "id": "ai-agents-setup",
32
- "name": "setup",
33
- "path": "ai-agents/setup.md",
34
- "category": "ai-agents",
35
- "subcategory": null,
36
- "tags": [
37
- "ai-agents"
38
- ],
39
- "aliases": [
40
- "AI agent setup",
41
- "MCP configuration",
42
- "tool configuration",
43
- "Claude setup",
44
- "agent initialization"
45
- ],
46
- "anchors": {
47
- "mcp": "#mcp-configuration",
48
- "tools": "#tool-definitions",
49
- "spawn": "#spawn-configuration"
50
- },
51
- "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.",
52
- "stacks": [
53
- "*"
54
- ]
55
- },
56
- {
57
- "id": "ai-agents-workflows",
58
- "name": "workflows",
59
- "path": "ai-agents/workflows.md",
60
- "category": "ai-agents",
61
- "subcategory": null,
62
- "tags": [
63
- "ai-agents"
64
- ],
65
- "aliases": [
66
- "agent workflow",
67
- "multi-agent",
68
- "orchestration pattern",
69
- "agent chain",
70
- "parallel agents"
71
- ],
72
- "anchors": {
73
- "orchestration": "#orchestration-patterns",
74
- "parallel": "#parallel-execution",
75
- "handoff": "#agent-handoff"
76
- },
77
- "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.",
78
- "stacks": [
79
- "*"
80
- ]
81
- },
82
- {
83
- "id": "architecture-vertical-slice-vertical-slice",
84
- "name": "vertical slice",
85
- "path": "architecture/vertical-slice/vertical-slice.md",
86
- "category": "architecture",
87
- "subcategory": "vertical-slice",
88
- "tags": [
89
- "architecture",
90
- "vertical-slice"
91
- ],
92
- "aliases": [
93
- "vertical slice",
94
- "VSA",
95
- "slice architecture",
96
- "feature slice",
97
- "CQRS slice"
98
- ],
99
- "anchors": {
100
- "structure": "#slice-structure",
101
- "rules": "#slice-rules",
102
- "cqrs": "#cqrs-in-slices"
103
- },
104
- "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.",
105
- "stacks": [
106
- "dotnet"
107
- ]
108
- },
109
- {
110
- "id": "backend-api-validation",
111
- "name": "validation",
112
- "path": "backend/api/validation.md",
113
- "category": "backend",
114
- "subcategory": "api",
115
- "tags": [
116
- "backend",
117
- "api"
118
- ],
119
- "aliases": [
120
- "FluentValidation",
121
- "input validation",
122
- "request validation",
123
- "API validation",
124
- "model validation"
125
- ],
126
- "anchors": {
127
- "fluent": "#fluentvalidation-setup",
128
- "rules": "#validation-rules"
129
- },
130
- "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.",
131
- "stacks": [
132
- "dotnet"
133
- ]
134
- },
135
- {
136
- "id": "backend-database-postgresql-database",
137
- "name": "database",
138
- "path": "backend/database/postgresql/database.md",
139
- "category": "backend",
140
- "subcategory": "database",
141
- "tags": [
142
- "backend",
143
- "database",
144
- "postgresql"
145
- ],
146
- "aliases": [
147
- "PostgreSQL",
148
- "postgres",
149
- "pg",
150
- "database design",
151
- "SQL schema"
152
- ],
153
- "anchors": {
154
- "schema": "#schema-design",
155
- "indexes": "#index-strategy"
156
- },
157
- "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.",
158
- "stacks": [
159
- "dotnet"
160
- ]
161
- },
162
- {
163
- "id": "backend-database-vector-search-rag",
164
- "name": "vector search rag",
165
- "path": "backend/database/vector-search-rag.md",
166
- "category": "backend",
167
- "subcategory": "database",
168
- "tags": [
169
- "backend",
170
- "database"
171
- ],
172
- "aliases": [
173
- "vector search",
174
- "RAG",
175
- "embeddings",
176
- "pgvector",
177
- "semantic search"
178
- ],
179
- "anchors": {
180
- "chunking": "#chunking-strategy",
181
- "retrieval": "#retrieval-patterns"
182
- },
183
- "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.",
184
- "stacks": [
185
- "dotnet",
186
- "nextjs",
187
- "neon"
188
- ]
189
- },
190
- {
191
- "id": "backend-dotnet-result-pattern",
192
- "name": "result pattern",
193
- "path": "backend/dotnet/result-pattern.md",
194
- "category": "backend",
195
- "subcategory": "dotnet",
196
- "tags": [
197
- "backend",
198
- "dotnet",
199
- "vsa"
200
- ],
201
- "aliases": [
202
- "Result<T>",
203
- "railway oriented",
204
- "error handling",
205
- "Match pattern",
206
- "Result monad"
207
- ],
208
- "anchors": {
209
- "anatomy": "#result-anatomy",
210
- "errors": "#error-types-7--custom",
211
- "match": "#match-pattern"
212
- },
213
- "digest": "Use Result<T> for all handler returns — never throw for expected failures. 7 error types (Failure, Unexpected, Validation, Conflict, NotFound, Unauthorized, Forbidden) map to HTTP status codes. Use Match() in endpoints to convert Result to IResult. Implicit conversions allow returning values or errors directly from handlers.",
214
- "stacks": [
215
- "dotnet"
216
- ]
217
- },
218
- {
219
- "id": "backend-dotnet-scrutor",
220
- "name": "scrutor",
221
- "path": "backend/dotnet/scrutor.md",
222
- "category": "backend",
223
- "subcategory": "dotnet",
224
- "tags": [
225
- "backend",
226
- "dotnet",
227
- "vsa"
228
- ],
229
- "aliases": [
230
- "Scrutor",
231
- "auto-discovery",
232
- "assembly scanning",
233
- "decorator registration",
234
- "handler registration"
235
- ],
236
- "anchors": {
237
- "handlers": "#handler-auto-discovery",
238
- "decorators": "#decorator-order",
239
- "endpoints": "#endpoint-auto-discovery"
240
- },
241
- "digest": "Use Scrutor for convention-based DI registration. AddHandlersFromAssembly() scans for IHandler<,> implementations. Decorate<> applies pipeline decorators (validation, logging) — last registered wraps outermost. Register validators before handlers. RegisterApiEndpointsFromAssembly() auto-discovers IApiEndpoint implementations.",
242
- "stacks": [
243
- "dotnet"
244
- ]
245
- },
246
- {
247
- "id": "backend-dotnet-fluent-validation-vsa",
248
- "name": "fluent validation vsa",
249
- "path": "backend/dotnet/fluent-validation-vsa.md",
250
- "category": "backend",
251
- "subcategory": "dotnet",
252
- "tags": [
253
- "backend",
254
- "dotnet",
255
- "vsa"
256
- ],
257
- "aliases": [
258
- "FluentValidation VSA",
259
- "validation decorator",
260
- "validation pipeline",
261
- "AbstractValidator",
262
- "ValidationDecorator"
263
- ],
264
- "anchors": {
265
- "validator": "#validator-structure",
266
- "decorator": "#validationdecorator-pattern",
267
- "conversion": "#fluentvalidation-to-validationerror-conversion"
268
- },
269
- "digest": "Use AbstractValidator<T> per request DTO in feature folders. ValidationDecorator intercepts all handlers via Scrutor, runs validators in parallel, and short-circuits to Result.Failure(ValidationError) on failure. Register AddValidatorsFromAssembly() before AddHandlersFromAssembly(). Never validate inside handlers.",
270
- "stacks": [
271
- "dotnet"
272
- ]
273
- },
274
- {
275
- "id": "backend-dotnet-scalar-ui",
276
- "name": "scalar ui",
277
- "path": "backend/dotnet/scalar-ui.md",
278
- "category": "backend",
279
- "subcategory": "dotnet",
280
- "tags": [
281
- "backend",
282
- "dotnet",
283
- "vsa"
284
- ],
285
- "aliases": [
286
- "Scalar",
287
- "API documentation",
288
- "OpenAPI UI",
289
- "Swagger replacement",
290
- "Scalar.AspNetCore"
291
- ],
292
- "anchors": {
293
- "setup": "#programcs-configuration",
294
- "tags": "#apitags-organization",
295
- "metadata": "#endpoint-metadata"
296
- },
297
- "digest": "Use Scalar.AspNetCore 2.12.40 as API documentation UI — replaces Swagger. MapScalarApiReference() with DeepSpace theme. Group endpoints with .WithTags() and ApiTags constants. Document responses with .Produces<T>(). Guard MapOpenApi() with IsDevelopment(). No Swashbuckle needed.",
298
- "stacks": [
299
- "dotnet"
300
- ]
301
- },
302
- {
303
- "id": "backend-dotnet-vsa-handler-patterns",
304
- "name": "vsa handler patterns",
305
- "path": "backend/dotnet/vsa-handler-patterns.md",
306
- "category": "backend",
307
- "subcategory": "dotnet",
308
- "tags": [
309
- "backend",
310
- "dotnet",
311
- "vsa"
312
- ],
313
- "aliases": [
314
- "VSA handler",
315
- "vertical slice handler",
316
- "feature slice",
317
- "IHandler pattern",
318
- "handler endpoint"
319
- ],
320
- "anchors": {
321
- "handler": "#ihandlertrequest-tresponse",
322
- "folder": "#feature-folder-structure-5-files-per-slice",
323
- "endpoint": "#complete-endpoint-example",
324
- "registration": "#programcs-di-registration-order"
325
- },
326
- "digest": "Each VSA feature is 5 files: Request, Response, Handler, Validator, Endpoint. Use IHandler<TReq,TRes> (not MediatR). Sealed records for DTOs, primary constructors for DI, Guid.CreateVersion7() for IDs. Handler calls Repository+UnitOfWork directly — no service layer. CancellationToken in every async call.",
327
- "stacks": [
328
- "dotnet"
329
- ]
330
- },
331
- {
332
- "id": "backend-integrations-asaas-asaas-api",
333
- "name": "asaas api",
334
- "path": "backend/integrations/asaas/asaas-api.md",
335
- "category": "backend",
336
- "subcategory": "integrations",
337
- "tags": [
338
- "backend",
339
- "integrations",
340
- "asaas"
341
- ],
342
- "aliases": [
343
- "asaas",
344
- "payment",
345
- "PIX",
346
- "boleto",
347
- "Brazilian payment"
348
- ],
349
- "anchors": {
350
- "payments": "#payment-types",
351
- "webhooks": "#webhook-handling"
352
- },
353
- "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.",
354
- "stacks": [
355
- "dotnet"
356
- ]
357
- },
358
- {
359
- "id": "backend-integrations-neon-auth-neon-auth",
360
- "name": "neon auth",
361
- "path": "backend/integrations/neon-auth/neon-auth.md",
362
- "category": "backend",
363
- "subcategory": "integrations",
364
- "tags": [
365
- "backend",
366
- "integrations",
367
- "neon-auth",
368
- "better-auth"
369
- ],
370
- "aliases": [
371
- "neon auth",
372
- "better auth",
373
- "authentication",
374
- "OAuth",
375
- "JWT",
376
- "session management"
377
- ],
378
- "anchors": {
379
- "setup": "#installation--setup",
380
- "middleware": "#route-protection-middleware",
381
- "dotnet": "#net-backend-integration",
382
- "rls": "#row-level-security-integration"
383
- },
384
- "digest": "Use @neondatabase/auth SDK for Next.js. Auth data lives in neon_auth schema — no external provider, no webhooks. Server: createNeonAuth() with NEON_AUTH_BASE_URL + NEON_AUTH_COOKIE_SECRET. Client: createAuthClient(). Pages: AuthView component. Protection: auth.middleware(). .NET: JWT Bearer with Neon Auth authority, NameClaimType=sub. RLS: auth.user_id() via pg_session_jwt.",
385
- "stacks": [
386
- "neon"
387
- ]
388
- },
389
- {
390
- "id": "backend-integrations-hangfire-hangfire-jobs",
391
- "name": "hangfire jobs",
392
- "path": "backend/integrations/hangfire/hangfire-jobs.md",
393
- "category": "backend",
394
- "subcategory": "integrations",
395
- "tags": [
396
- "backend",
397
- "integrations",
398
- "hangfire"
399
- ],
400
- "aliases": [
401
- "hangfire",
402
- "background jobs",
403
- "scheduled jobs",
404
- "recurring",
405
- "cron",
406
- "fire and forget"
407
- ],
408
- "anchors": {
409
- "jobs": "#job-types",
410
- "retry": "#retry-policies"
411
- },
412
- "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.",
413
- "stacks": [
414
- "dotnet"
415
- ]
416
- },
417
- {
418
- "id": "backend-integrations-resend-resend-email",
419
- "name": "resend email",
420
- "path": "backend/integrations/resend/resend-email.md",
421
- "category": "backend",
422
- "subcategory": "integrations",
423
- "tags": [
424
- "backend",
425
- "integrations",
426
- "resend"
427
- ],
428
- "aliases": [
429
- "resend",
430
- "email",
431
- "transactional email",
432
- "SMTP",
433
- "email notification"
434
- ],
435
- "anchors": {
436
- "sending": "#send-email",
437
- "templates": "#email-templates"
438
- },
439
- "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.",
440
- "stacks": [
441
- "dotnet"
442
- ]
443
- },
444
- {
445
- "id": "data-nosql-cache-redis",
446
- "name": "redis",
447
- "path": "data/nosql/cache/redis.md",
448
- "category": "data",
449
- "subcategory": "nosql",
450
- "tags": [
451
- "data",
452
- "nosql",
453
- "cache"
454
- ],
455
- "aliases": [
456
- "redis",
457
- "cache",
458
- "distributed cache",
459
- "IDistributedCache",
460
- "cache-aside",
461
- "StackExchange.Redis"
462
- ],
463
- "anchors": {
464
- "patterns": "#cache-patterns",
465
- "invalidation": "#cache-invalidation"
466
- },
467
- "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.",
468
- "stacks": [
469
- "dotnet",
470
- "azure"
471
- ]
472
- },
473
- {
474
- "id": "data-nosql-cosmos-db",
475
- "name": "cosmos db",
476
- "path": "data/nosql/cosmos-db.md",
477
- "category": "data",
478
- "subcategory": "nosql",
479
- "tags": [
480
- "data",
481
- "nosql"
482
- ],
483
- "aliases": [
484
- "cosmos",
485
- "CosmosDB",
486
- "document database",
487
- "partition key",
488
- "RUs"
489
- ],
490
- "anchors": {
491
- "modeling": "#document-modeling",
492
- "queries": "#query-patterns"
493
- },
494
- "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.",
495
- "stacks": [
496
- "dotnet",
497
- "azure"
498
- ]
499
- },
500
- {
501
- "id": "data-vector-search-rag-chunking",
502
- "name": "rag chunking",
503
- "path": "data/vector-search/rag-chunking.md",
504
- "category": "data",
505
- "subcategory": "vector-search",
506
- "tags": [
507
- "data",
508
- "vector-search"
509
- ],
510
- "aliases": [
511
- "RAG chunking",
512
- "document chunking",
513
- "text splitting",
514
- "chunk overlap",
515
- "embedding chunks"
516
- ],
517
- "anchors": {
518
- "strategies": "#chunking-strategies",
519
- "retrieval": "#retrieval-pipeline"
520
- },
521
- "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.",
522
- "stacks": [
523
- "dotnet",
524
- "azure"
525
- ]
526
- },
527
- {
528
- "id": "frontend-design-system-animations",
529
- "name": "animations",
530
- "path": "frontend/design-system/animations.md",
531
- "category": "frontend",
532
- "subcategory": "design-system",
533
- "tags": [
534
- "frontend",
535
- "design-system"
536
- ],
537
- "aliases": [
538
- "animations",
539
- "transitions",
540
- "motion",
541
- "CSS animations",
542
- "keyframes",
543
- "prefers-reduced-motion"
544
- ],
545
- "anchors": {
546
- "tokens": "#animation-tokens",
547
- "principles": "#motion-principles"
548
- },
549
- "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.",
550
- "stacks": [
551
- "*"
552
- ]
553
- },
554
- {
555
- "id": "frontend-design-system-naming",
556
- "name": "naming",
557
- "path": "frontend/design-system/naming.md",
558
- "category": "frontend",
559
- "subcategory": "design-system",
560
- "tags": [
561
- "frontend",
562
- "design-system"
563
- ],
564
- "aliases": [
565
- "BEM",
566
- "CSS naming",
567
- "class naming",
568
- "design token naming",
569
- "component naming"
570
- ],
571
- "anchors": {
572
- "blocks": "#bem-blocks",
573
- "tokens": "#token-naming"
574
- },
575
- "digest": "BEM for CSS: .block__element--modifier. Design tokens: --color-primary-500, --spacing-4, --font-size-base. Component names PascalCase (React/Next.js) / kebab-case (CSS). No generic names (blue, big). Semantic names only: --color-action, --spacing-page-gutter. Tokens are the single source of truth.",
576
- "stacks": [
577
- "*"
578
- ]
579
- },
580
- {
581
- "id": "frontend-nextjs-motion-patterns",
582
- "name": "motion patterns",
583
- "path": "frontend/nextjs/motion-patterns.md",
584
- "category": "frontend",
585
- "subcategory": "nextjs",
586
- "tags": [
587
- "frontend",
588
- "nextjs",
589
- "framer-motion"
590
- ],
591
- "aliases": [
592
- "framer-motion",
593
- "animation variants",
594
- "motion design",
595
- "page transition",
596
- "AnimatePresence"
597
- ],
598
- "anchors": {
599
- "variants": "#core-variants-library",
600
- "tokens": "#design-token-bridge",
601
- "scroll": "#scroll-animations",
602
- "accessibility": "#wcag-accessibility-mandatory"
603
- },
604
- "digest": "Canonical Framer Motion variants (fadeIn, slideIn, scaleIn, stagger, pageTransition) with design token bridge. Use whileInView for scroll reveals. Respect prefers-reduced-motion via useReducedMotion() — strip transforms, keep opacity.",
605
- "stacks": [
606
- "nextjs"
607
- ]
608
- },
609
- {
610
- "id": "frontend-gsap-core",
611
- "name": "gsap core",
612
- "path": "frontend/gsap/gsap-core.md",
613
- "category": "frontend",
614
- "subcategory": "gsap",
615
- "tags": [
616
- "frontend",
617
- "gsap",
618
- "animation",
619
- "react"
620
- ],
621
- "aliases": [
622
- "GSAP",
623
- "GreenSock",
624
- "gsap.to",
625
- "gsap.from",
626
- "useGSAP",
627
- "gsap timeline",
628
- "gsap utils",
629
- "gsap performance"
630
- ],
631
- "anchors": {
632
- "apis": "#core-animation-apis",
633
- "react": "#reactnextjs-integration",
634
- "timeline": "#timeline-sequencing",
635
- "performance": "#performance",
636
- "accessibility": "#accessibility"
637
- },
638
- "digest": "Use gsap.to/from/fromTo for imperative animations. In React, always use useGSAP() hook from @gsap/react with scope ref for automatic cleanup. Timelines sequence with position parameter. Animate only transforms + opacity for 60fps. Check prefers-reduced-motion. Import durations/easings from design tokens.",
639
- "stacks": [
640
- "nextjs"
641
- ]
642
- },
643
- {
644
- "id": "frontend-gsap-scrolltrigger",
645
- "name": "gsap scrolltrigger",
646
- "path": "frontend/gsap/gsap-scrolltrigger.md",
647
- "category": "frontend",
648
- "subcategory": "gsap",
649
- "tags": [
650
- "frontend",
651
- "gsap",
652
- "scrolltrigger",
653
- "scroll-animation"
654
- ],
655
- "aliases": [
656
- "ScrollTrigger",
657
- "scroll animation",
658
- "pinning",
659
- "scrubbing",
660
- "parallax",
661
- "scroll-driven"
662
- ],
663
- "anchors": {
664
- "basic": "#basic-scrolltrigger",
665
- "scrub": "#scrubbing",
666
- "pin": "#pinning",
667
- "batch": "#batch-processing"
668
- },
669
- "digest": "Register ScrollTrigger plugin client-side only. Use scrub for scroll-linked progress. Pin sections with pin:true. Batch-process list items with ScrollTrigger.batch(). Call ScrollTrigger.refresh() after dynamic content. Kill all triggers in useGSAP cleanup.",
670
- "stacks": [
671
- "nextjs"
672
- ]
673
- },
674
- {
675
- "id": "frontend-gsap-plugins",
676
- "name": "gsap plugins",
677
- "path": "frontend/gsap/gsap-plugins.md",
678
- "category": "frontend",
679
- "subcategory": "gsap",
680
- "tags": [
681
- "frontend",
682
- "gsap",
683
- "plugins"
684
- ],
685
- "aliases": [
686
- "Flip",
687
- "SplitText",
688
- "MorphSVG",
689
- "DrawSVG",
690
- "MotionPath",
691
- "Draggable",
692
- "Observer",
693
- "ScrollToPlugin"
694
- ],
695
- "anchors": {
696
- "flip": "#flip-plugin",
697
- "splittext": "#splittext",
698
- "morphsvg": "#morphsvg",
699
- "drawsvg": "#drawsvg"
700
- },
701
- "digest": "Flip for layout animations (getState then from). SplitText for char/word/line reveals (always revert on cleanup). MorphSVG for path morphing. DrawSVG for stroke animation. MotionPath for path-following. Draggable for drag with bounds/snap. Observer for gesture detection. Register all plugins before use.",
702
- "stacks": [
703
- "nextjs"
704
- ]
705
- },
706
- {
707
- "id": "frontend-nextjs-app-router",
708
- "name": "app router",
709
- "path": "frontend/nextjs/app-router.md",
710
- "category": "frontend",
711
- "subcategory": "nextjs",
712
- "tags": [
713
- "frontend",
714
- "nextjs"
715
- ],
716
- "aliases": [
717
- "app router",
718
- "Next.js 14",
719
- "server components",
720
- "app directory",
721
- "RSC"
722
- ],
723
- "anchors": {
724
- "layout": "#layout-patterns",
725
- "routing": "#routing-patterns"
726
- },
727
- "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.",
728
- "stacks": [
729
- "nextjs"
730
- ]
731
- },
732
- {
733
- "id": "frontend-nextjs-components",
734
- "name": "components",
735
- "path": "frontend/nextjs/components.md",
736
- "category": "frontend",
737
- "subcategory": "nextjs",
738
- "tags": [
739
- "frontend",
740
- "nextjs"
741
- ],
742
- "aliases": [
743
- "react components",
744
- "server component",
745
- "client component",
746
- "shadcn/ui",
747
- "UI components"
748
- ],
749
- "anchors": {
750
- "patterns": "#component-patterns",
751
- "shadcn": "#shadcn-usage"
752
- },
753
- "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.",
754
- "stacks": [
755
- "nextjs"
756
- ]
757
- },
758
- {
759
- "id": "frontend-nextjs-data-fetching",
760
- "name": "data fetching",
761
- "path": "frontend/nextjs/data-fetching.md",
762
- "category": "frontend",
763
- "subcategory": "nextjs",
764
- "tags": [
765
- "frontend",
766
- "nextjs"
767
- ],
768
- "aliases": [
769
- "TanStack Query",
770
- "react-query",
771
- "server actions",
772
- "data fetching",
773
- "useQuery"
774
- ],
775
- "anchors": {
776
- "server": "#server-fetching",
777
- "client": "#client-fetching"
778
- },
779
- "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.",
780
- "stacks": [
781
- "nextjs"
782
- ]
783
- },
784
- {
785
- "id": "frontend-nextjs-forms",
786
- "name": "forms",
787
- "path": "frontend/nextjs/forms.md",
788
- "category": "frontend",
789
- "subcategory": "nextjs",
790
- "tags": [
791
- "frontend",
792
- "nextjs"
793
- ],
794
- "aliases": [
795
- "react-hook-form",
796
- "Zod",
797
- "form validation",
798
- "Server Actions forms",
799
- "useFormState"
800
- ],
801
- "anchors": {
802
- "validation": "#zod-schemas",
803
- "submission": "#form-submission"
804
- },
805
- "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.",
806
- "stacks": [
807
- "nextjs"
808
- ]
809
- },
810
- {
811
- "id": "frontend-nextjs-naming-conventions",
812
- "name": "naming conventions",
813
- "path": "frontend/nextjs/naming-conventions.md",
814
- "category": "frontend",
815
- "subcategory": "nextjs",
816
- "tags": [
817
- "frontend",
818
- "nextjs"
819
- ],
820
- "aliases": [
821
- "naming conventions",
822
- "file naming",
823
- "component naming",
824
- "Next.js naming",
825
- "TypeScript naming"
826
- ],
827
- "anchors": {
828
- "files": "#file-naming",
829
- "components": "#component-naming"
830
- },
831
- "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.",
832
- "stacks": [
833
- "nextjs"
834
- ]
835
- },
836
- {
837
- "id": "frontend-nextjs-nextjs-patterns",
838
- "name": "nextjs patterns",
839
- "path": "frontend/nextjs/nextjs-patterns.md",
840
- "category": "frontend",
841
- "subcategory": "nextjs",
842
- "tags": [
843
- "frontend",
844
- "nextjs"
845
- ],
846
- "aliases": [
847
- "Next.js patterns",
848
- "middleware",
849
- "auth patterns",
850
- "caching patterns",
851
- "image optimization"
852
- ],
853
- "anchors": {
854
- "auth": "#auth-patterns",
855
- "caching": "#caching-patterns"
856
- },
857
- "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.",
858
- "stacks": [
859
- "nextjs"
860
- ]
861
- },
862
- {
863
- "id": "frontend-nextjs-project-structure",
864
- "name": "project structure",
865
- "path": "frontend/nextjs/project-structure.md",
866
- "category": "frontend",
867
- "subcategory": "nextjs",
868
- "tags": [
869
- "frontend",
870
- "nextjs"
871
- ],
872
- "aliases": [
873
- "project structure",
874
- "folder structure",
875
- "src directory",
876
- "app directory organization"
877
- ],
878
- "anchors": {
879
- "structure": "#directory-structure",
880
- "organization": "#feature-organization"
881
- },
882
- "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.",
883
- "stacks": [
884
- "nextjs"
885
- ]
886
- },
887
- {
888
- "id": "frontend-nextjs-state-management",
889
- "name": "state management",
890
- "path": "frontend/nextjs/state-management.md",
891
- "category": "frontend",
892
- "subcategory": "nextjs",
893
- "tags": [
894
- "frontend",
895
- "nextjs"
896
- ],
897
- "aliases": [
898
- "zustand",
899
- "React context",
900
- "global state",
901
- "state management",
902
- "client state"
903
- ],
904
- "anchors": {
905
- "patterns": "#state-patterns",
906
- "server": "#server-state"
907
- },
908
- "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.",
909
- "stacks": [
910
- "nextjs"
911
- ]
912
- },
913
- {
914
- "id": "frontend-nextjs-testing",
915
- "name": "testing",
916
- "path": "frontend/nextjs/testing.md",
917
- "category": "frontend",
918
- "subcategory": "nextjs",
919
- "tags": [
920
- "frontend",
921
- "nextjs"
922
- ],
923
- "aliases": [
924
- "vitest",
925
- "jest",
926
- "testing-library",
927
- "Playwright",
928
- "Next.js testing",
929
- "component tests"
930
- ],
931
- "anchors": {
932
- "unit": "#unit-tests",
933
- "e2e": "#e2e-tests"
934
- },
935
- "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.",
936
- "stacks": [
937
- "nextjs"
938
- ]
939
- },
940
- {
941
- "id": "infrastructure-docker-easypanel-deploy",
942
- "name": "easypanel deploy",
943
- "path": "infrastructure/docker/easypanel-deploy.md",
944
- "category": "infrastructure",
945
- "subcategory": "docker",
946
- "tags": [
947
- "infrastructure",
948
- "docker"
949
- ],
950
- "aliases": [
951
- "easypanel",
952
- "docker deploy",
953
- "self-hosted",
954
- "VPS deployment",
955
- "docker compose"
956
- ],
957
- "anchors": {
958
- "setup": "#easypanel-setup",
959
- "deployment": "#deployment-flow"
960
- },
961
- "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.",
962
- "stacks": [
963
- "docker"
964
- ]
965
- },
966
- {
967
- "id": "infrastructure-neon-setup",
968
- "name": "neon setup",
969
- "path": "infrastructure/neon/neon-setup.md",
970
- "category": "infrastructure",
971
- "subcategory": "neon",
972
- "tags": [
973
- "infrastructure",
974
- "neon",
975
- "postgresql"
976
- ],
977
- "aliases": [
978
- "Neon",
979
- "neonctl",
980
- "serverless postgres",
981
- "Neon CLI",
982
- "Neon setup"
983
- ],
984
- "anchors": {
985
- "setup": "#neon-project-setup",
986
- "connection": "#connection-strings"
987
- },
988
- "digest": "Use neonctl CLI for project management and connection strings. Two connection strings: pooled (-pooler) for application code, direct for EF Core migrations. Configure connection retry for scale-to-zero cold starts. Use database branches for PR previews.",
989
- "stacks": [
990
- "neon"
991
- ]
992
- },
993
- {
994
- "id": "infrastructure-neon-pgvector",
995
- "name": "neon pgvector",
996
- "path": "infrastructure/neon/neon-pgvector.md",
997
- "category": "infrastructure",
998
- "subcategory": "neon",
999
- "tags": [
1000
- "infrastructure",
1001
- "neon",
1002
- "pgvector"
1003
- ],
1004
- "aliases": [
1005
- "pgvector",
1006
- "vector embeddings",
1007
- "similarity search",
1008
- "Neon vectors",
1009
- "HNSW index"
1010
- ],
1011
- "anchors": {
1012
- "setup": "#pgvector-setup",
1013
- "queries": "#similarity-queries"
1014
- },
1015
- "digest": "Enable: CREATE EXTENSION vector. Define column as vector(1536) for OpenAI embeddings. Create HNSW index with tuned maintenance_work_mem. Use direct SQL for similarity search. Batch insert embeddings (100 at a time). RLS policies apply to vector queries.",
1016
- "stacks": [
1017
- "neon"
1018
- ]
1019
- },
1020
- {
1021
- "id": "infrastructure-neon-pgrag",
1022
- "name": "neon pgrag",
1023
- "path": "infrastructure/neon/neon-pgrag.md",
1024
- "category": "infrastructure",
1025
- "subcategory": "neon",
1026
- "tags": [
1027
- "infrastructure",
1028
- "neon",
1029
- "pgrag"
1030
- ],
1031
- "aliases": [
1032
- "pgrag",
1033
- "RAG in SQL",
1034
- "embedding pipeline",
1035
- "Neon RAG",
1036
- "in-database RAG"
1037
- ],
1038
- "anchors": {
1039
- "setup": "#pgrag-setup",
1040
- "pipeline": "#rag-pipeline"
1041
- },
1042
- "digest": "Use pgrag extensions (rag, rag_bge_small_en_v15, rag_jina_reranker_v1_tiny_en) for chunking, embedding, search, and reranking entirely in SQL. No external embedding service needed for basic RAG. Combine with pgvector HNSW indexes for production performance.",
1043
- "stacks": [
1044
- "neon"
1045
- ]
1046
- },
1047
- {
1048
- "id": "infrastructure-neon-semantic-kernel",
1049
- "name": "neon semantic kernel",
1050
- "path": "infrastructure/neon/neon-semantic-kernel.md",
1051
- "category": "infrastructure",
1052
- "subcategory": "neon",
1053
- "tags": [
1054
- "infrastructure",
1055
- "neon",
1056
- "semantic-kernel"
1057
- ],
1058
- "aliases": [
1059
- "Semantic Kernel",
1060
- "vector store",
1061
- "Neon Semantic Kernel",
1062
- "SK vector store",
1063
- "AI memory"
1064
- ],
1065
- "anchors": {
1066
- "setup": "#semantic-kernel-setup",
1067
- "store": "#vector-store-integration"
1068
- },
1069
- "digest": "Use Neon as Semantic Kernel vector store via Npgsql connector. Register IVectorStore with NpgsqlDataSource pointing to pooled Neon endpoint. Store and retrieve embeddings using SK memory abstractions. Combine with pgvector HNSW indexes.",
1070
- "stacks": [
1071
- "neon",
1072
- "semantic-kernel"
1073
- ]
1074
- },
1075
- {
1076
- "id": "integration-mcp-mcp-tools",
1077
- "name": "mcp tools",
1078
- "path": "integration/mcp/mcp-tools.md",
1079
- "category": "integration",
1080
- "subcategory": "mcp",
1081
- "tags": [
1082
- "integration",
1083
- "mcp"
1084
- ],
1085
- "aliases": [
1086
- "MCP",
1087
- "Model Context Protocol",
1088
- "Claude tools",
1089
- "MCP server",
1090
- "MCP client"
1091
- ],
1092
- "anchors": {
1093
- "tools": "#tool-definitions",
1094
- "setup": "#server-setup"
1095
- },
1096
- "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.",
1097
- "stacks": [
1098
- "*"
1099
- ]
1100
- },
1101
- {
1102
- "id": "frontend-design-system-ai-image-generation",
1103
- "name": "AI Image Generation",
1104
- "path": "frontend/design-system/ai-image-generation.md",
1105
- "category": "frontend",
1106
- "subcategory": "design-system",
1107
- "tags": [
1108
- "image",
1109
- "gemini",
1110
- "asset",
1111
- "ai-generation",
1112
- "placeholder",
1113
- "mcp"
1114
- ],
1115
- "aliases": [
1116
- "Image Generation",
1117
- "AI Assets",
1118
- "Gemini Images"
1119
- ],
1120
- "anchors": {
1121
- "when-to-use": "#when-to-use-ai-generated-images",
1122
- "prompt-patterns": "#prompt-engineering-patterns",
1123
- "aspect-ratios": "#aspect-ratio-guide",
1124
- "assets-md": "#assetsmd-format",
1125
- "edit-workflows": "#iterative-editing-workflows"
1126
- },
1127
- "digest": "Guidelines for generating project images with Gemini Image MCP — prompt patterns, aspect ratios, design-system-aware prompts, iterative editing, and assets.md format.",
1128
- "stacks": [
1129
- "nextjs"
1130
- ]
1131
- }
1132
- ]
1133
- }
1
+ {
2
+ "version": "1.0.0",
3
+ "standards": [
4
+ {
5
+ "id": "ai-agents-production",
6
+ "name": "production",
7
+ "path": "ai-agents/production.md",
8
+ "category": "ai-agents",
9
+ "subcategory": null,
10
+ "tags": [
11
+ "ai-agents"
12
+ ],
13
+ "stacks": [
14
+ "dotnet"
15
+ ],
16
+ "aliases": [
17
+ "agent middleware",
18
+ "production agent",
19
+ "a2a protocol",
20
+ "mcp integration",
21
+ "agent observability",
22
+ "agent telemetry",
23
+ "anti-hallucination",
24
+ "semantic caching"
25
+ ],
26
+ "anchors": {
27
+ "middleware": "#middleware-pipeline",
28
+ "a2a": "#a2a-protocol-agent-to-agent",
29
+ "mcp": "#mcp-integration-model-context-protocol",
30
+ "observability": "#observability--opentelemetry"
31
+ },
32
+ "digest": "Production panorama for MAF agents. Middleware (3 levels) and MCP integration are summarized here and treated canonically in ai-agents-middleware-patterns / ai-agents-mcp-tools / ai-agents-mcp-server. Owns: A2A protocol via Microsoft.Agents.AI.A2A; Redis semantic + HybridCache caching; OpenTelemetry observability with AgentOpenTelemetryConsts.DefaultSourceName; security and production checklists."
33
+ },
34
+ {
35
+ "id": "ai-agents-setup",
36
+ "name": "setup",
37
+ "path": "ai-agents/setup.md",
38
+ "category": "ai-agents",
39
+ "subcategory": null,
40
+ "tags": [
41
+ "ai-agents"
42
+ ],
43
+ "stacks": [
44
+ "dotnet"
45
+ ],
46
+ "aliases": [
47
+ "MAF setup",
48
+ "Microsoft Agents AI",
49
+ "ChatClient",
50
+ "AsAIAgent",
51
+ "AIAgent dotnet",
52
+ "agent framework setup",
53
+ "MAF packages",
54
+ "MAF nuget"
55
+ ],
56
+ "anchors": {
57
+ "packages": "#1-packages-nuget",
58
+ "quickstart": "#2-quick-start-canonical-minimal-agent",
59
+ "providers": "#3-setup-by-provider",
60
+ "telemetry": "#5-opentelemetry"
61
+ },
62
+ "digest": "Use Microsoft.Agents.AI 1.0 GA packages. Register IChatClient via DI. Create agents with AsAIAgent() or new ChatClientAgent(). OpenTelemetry source is AgentOpenTelemetryConsts.DefaultSourceName. Provider-agnostic, direct models only. Do NOT use Semantic Kernel or Microsoft.Extensions.AI 9.x."
63
+ },
64
+ {
65
+ "id": "ai-agents-workflows",
66
+ "name": "workflows",
67
+ "path": "ai-agents/workflows.md",
68
+ "category": "ai-agents",
69
+ "subcategory": null,
70
+ "tags": [
71
+ "ai-agents"
72
+ ],
73
+ "stacks": [
74
+ "dotnet"
75
+ ],
76
+ "aliases": [
77
+ "workflow",
78
+ "agent workflow",
79
+ "fan-in",
80
+ "fan-out",
81
+ "when not to use workflow",
82
+ "orchestration",
83
+ "AgentWorkflowBuilder",
84
+ "concurrent workflow"
85
+ ],
86
+ "anchors": {
87
+ "when-not": "#quando-não-usar-um-workflow",
88
+ "when-justified": "#quando-um-workflow-é-justificado",
89
+ "canonical-example": "#exemplo-canônico--fan-in-concurrent"
90
+ },
91
+ "digest": "Workflows are advanced and rare — 95% of agents need only a single agent (see ai-agents-sweet-spot). Reach for a Workflow ONLY for genuine fan-in/out over many inputs or long-running human-in-the-loop. A foreach + LINQ aggregate usually beats a Workflow. APIs (AgentWorkflowBuilder, InProcessExecution) ship in Microsoft.Agents.AI 1.0 GA."
92
+ },
93
+ {
94
+ "id": "ai-agents-sweet-spot",
95
+ "name": "sweet spot",
96
+ "path": "ai-agents/sweet-spot.md",
97
+ "category": "ai-agents",
98
+ "subcategory": null,
99
+ "tags": [
100
+ "ai-agents",
101
+ "maf",
102
+ "decision-tree"
103
+ ],
104
+ "stacks": [
105
+ "dotnet"
106
+ ],
107
+ "aliases": [
108
+ "sweet spot",
109
+ "when to use agent",
110
+ "agent vs workflow",
111
+ "when not to use workflow",
112
+ "MAF decision",
113
+ "simple agent default",
114
+ "4 feature rule",
115
+ "single agent default"
116
+ ],
117
+ "anchors": {
118
+ "rule": "#the-4-feature-rule",
119
+ "decision-tree": "#decision-tree-claude-reads-this-in-plan-phase",
120
+ "anti-patterns": "#anti-patterns-what-claude-should-not-do"
121
+ },
122
+ "digest": "The 4-feature rule (Chat + Structured Output + Tools + RAG Custom) covers 95% of agents. Single-agent is the default; reach for multi-agent or workflow only when fan-in/out or genuine handoff is needed. Read in plan phase before deciding architecture."
123
+ },
124
+ {
125
+ "id": "ai-agents-providers-model-registry",
126
+ "name": "model registry",
127
+ "path": "ai-agents/providers/model-registry.md",
128
+ "category": "ai-agents",
129
+ "subcategory": "providers",
130
+ "tags": [
131
+ "ai-agents",
132
+ "maf",
133
+ "providers",
134
+ "model-config"
135
+ ],
136
+ "stacks": [
137
+ "dotnet"
138
+ ],
139
+ "aliases": [
140
+ "model registry",
141
+ "provider agnostic",
142
+ "model alias",
143
+ "IChatClient factory",
144
+ "multi-model",
145
+ "model selection",
146
+ "model config",
147
+ "switch provider",
148
+ "openai google anthropic ollama",
149
+ "direct model"
150
+ ],
151
+ "anchors": {
152
+ "schema": "#schema-canonical",
153
+ "providers": "#providers-first-class",
154
+ "implementation": "#implementation-pattern",
155
+ "checklist": "#checklist-verifiable-by-morph-eval"
156
+ },
157
+ "digest": "Provider-agnostic pattern: project keeps config/model-registry.json mapping aliases (text-default, vision, reasoning, etc.) to provider+model+options. Agents reference aliases, never hardcoded models. Direct models only (openai/google/anthropic/ollama). Switching provider/model is a one-file change."
158
+ },
159
+ {
160
+ "id": "ai-agents-structured-output",
161
+ "name": "structured output",
162
+ "path": "ai-agents/structured-output.md",
163
+ "category": "ai-agents",
164
+ "subcategory": null,
165
+ "tags": [
166
+ "ai-agents",
167
+ "maf",
168
+ "s-tier"
169
+ ],
170
+ "stacks": [
171
+ "dotnet"
172
+ ],
173
+ "aliases": [
174
+ "structured output",
175
+ "typed response",
176
+ "response format",
177
+ "schema validated output",
178
+ "record output",
179
+ "JSON schema agent",
180
+ "RunAsync generic",
181
+ "typed agent output"
182
+ ],
183
+ "anchors": {
184
+ "api": "#a-api-maf-10-ga",
185
+ "type": "#definindo-o-tipo-de-saída",
186
+ "validation": "#validação-pós-call"
187
+ },
188
+ "digest": "Always return typed records from agents that feed downstream systems. MAF 1.0: RunAsync<T>() returns AgentResponse<T>.Result, or ChatResponseFormat.ForJsonSchema<T>(). Output type is a sealed record/class with [Description] + [JsonPropertyName]. Validate business rules after the call."
189
+ },
190
+ {
191
+ "id": "ai-agents-multi-agent-patterns",
192
+ "name": "multi-agent patterns",
193
+ "path": "ai-agents/multi-agent-patterns.md",
194
+ "category": "ai-agents",
195
+ "subcategory": null,
196
+ "tags": [
197
+ "ai-agents",
198
+ "maf"
199
+ ],
200
+ "stacks": [
201
+ "dotnet"
202
+ ],
203
+ "aliases": [
204
+ "multi-agent",
205
+ "agent as tool",
206
+ "agent composition",
207
+ "sequential agents",
208
+ "handoff",
209
+ "sub-agent",
210
+ "agent orchestration"
211
+ ],
212
+ "anchors": {
213
+ "agent-as-tool": "#agent-as-tool-padrão-recomendado",
214
+ "sequential": "#sequential-cadeia-fixa",
215
+ "decision-tree": "#decision-tree"
216
+ },
217
+ "digest": "Compose agents only when a single agent is not enough (see ai-agents-sweet-spot). Agent-as-Tool (agent.AsAIFunction()) is the simplest and recommended pattern. Sequential = plain imperative C#. Handoff for intent routing. Workflows only for genuine fan-in/out."
218
+ },
219
+ {
220
+ "id": "ai-agents-prompts-in-db",
221
+ "name": "prompts in db",
222
+ "path": "ai-agents/prompts-in-db.md",
223
+ "category": "ai-agents",
224
+ "subcategory": null,
225
+ "tags": [
226
+ "ai-agents",
227
+ "maf",
228
+ "prompts"
229
+ ],
230
+ "stacks": [
231
+ "dotnet"
232
+ ],
233
+ "aliases": [
234
+ "prompts in db",
235
+ "agent prompts",
236
+ "prompt versioning",
237
+ "prompt hot-reload",
238
+ "editable instructions",
239
+ "prompt management"
240
+ ],
241
+ "anchors": {
242
+ "pattern": "#o-pattern",
243
+ "schema": "#schema-da-tabela",
244
+ "versioning": "#versionamento"
245
+ },
246
+ "digest": "Store agent instructions in an agent_prompts table, not hardcoded — the team tunes without a deploy. A PromptRepository loads the active prompt by agent_key with an in-memory cache. Versioning is immutable: INSERT a new version and flip is_active, never UPDATE content."
247
+ },
248
+ {
249
+ "id": "ai-agents-rag-custom-pgvector",
250
+ "name": "rag custom pgvector",
251
+ "path": "ai-agents/rag-custom-pgvector.md",
252
+ "category": "ai-agents",
253
+ "subcategory": null,
254
+ "tags": [
255
+ "ai-agents",
256
+ "maf",
257
+ "rag",
258
+ "pgvector"
259
+ ],
260
+ "stacks": [
261
+ "dotnet"
262
+ ],
263
+ "aliases": [
264
+ "rag",
265
+ "vector search",
266
+ "pgvector",
267
+ "embeddings",
268
+ "custom rag",
269
+ "retrieval",
270
+ "semantic search",
271
+ "knowledge base",
272
+ "RAG tool"
273
+ ],
274
+ "anchors": {
275
+ "architecture": "#arquitetura",
276
+ "tool": "#vectorsearchtool-tool-maf",
277
+ "multi-tenant": "#multi-tenant"
278
+ },
279
+ "digest": "Custom RAG you control: an EmbeddingService generates vectors, a pgvector table stores chunk+embedding+metadata, a typed MAF VectorSearchTool runs the cosine query. Replaces the deleted Semantic Kernel vector-store path. Multi-tenant via tenant_id filter + RLS. Never use hosted RAG."
280
+ },
281
+ {
282
+ "id": "ai-agents-middleware-patterns",
283
+ "name": "middleware patterns",
284
+ "path": "ai-agents/middleware-patterns.md",
285
+ "category": "ai-agents",
286
+ "subcategory": null,
287
+ "tags": [
288
+ "ai-agents",
289
+ "maf",
290
+ "middleware"
291
+ ],
292
+ "stacks": [
293
+ "dotnet"
294
+ ],
295
+ "aliases": [
296
+ "middleware",
297
+ "agent middleware",
298
+ "function calling middleware",
299
+ "retry",
300
+ "anti-hallucination",
301
+ "resilience",
302
+ "telemetry middleware",
303
+ "agent run middleware"
304
+ ],
305
+ "anchors": {
306
+ "levels": "#os-3-níveis-de-middleware",
307
+ "resilience": "#pattern-resilência-retry--rate-limit",
308
+ "anti-hallucination": "#pattern-anti-hallucination"
309
+ },
310
+ "digest": "Three middleware levels intercept agent behavior: Agent Run (whole invocation), Function Calling (individual tool calls), IChatClient (raw LLM calls). Register via .AsBuilder().Use(...). Patterns: telemetry, resilience (retry/rate-limit), anti-hallucination (validate tool args before next())."
311
+ },
312
+ {
313
+ "id": "ai-agents-modalities-vision",
314
+ "name": "modalities vision",
315
+ "path": "ai-agents/modalities-vision.md",
316
+ "category": "ai-agents",
317
+ "subcategory": null,
318
+ "tags": [
319
+ "ai-agents",
320
+ "maf",
321
+ "multimodal",
322
+ "vision"
323
+ ],
324
+ "stacks": [
325
+ "dotnet"
326
+ ],
327
+ "aliases": [
328
+ "vision",
329
+ "image to text",
330
+ "OCR",
331
+ "image analysis",
332
+ "multimodal input",
333
+ "image agent",
334
+ "PDF analysis",
335
+ "visual understanding"
336
+ ],
337
+ "anchors": {
338
+ "when": "#quando-usar-vision",
339
+ "api": "#a-api",
340
+ "example": "#exemplo-c-completo",
341
+ "content-types": "#datacontent-vs-uricontent"
342
+ },
343
+ "digest": "Use vision when the agent needs to interpret images, screenshots, scanned documents or PDFs. MAF exposes multimodal ChatMessage with DataContent (inline bytes) or UriContent (remote URL). Covers OCR, diagram understanding, UI screenshot analysis, and document extraction. Anti-patterns: sending raw Base64 blobs without MIME type, ignoring resolution limits."
344
+ },
345
+ {
346
+ "id": "ai-agents-modalities-image-gen",
347
+ "name": "modalities image gen",
348
+ "path": "ai-agents/modalities-image-gen.md",
349
+ "category": "ai-agents",
350
+ "subcategory": null,
351
+ "tags": [
352
+ "ai-agents",
353
+ "maf",
354
+ "multimodal",
355
+ "image-generation"
356
+ ],
357
+ "stacks": [
358
+ "dotnet"
359
+ ],
360
+ "aliases": [
361
+ "image generation",
362
+ "text to image",
363
+ "dall-e",
364
+ "gpt-image",
365
+ "mockup",
366
+ "image synthesis",
367
+ "generate image",
368
+ "image from text"
369
+ ],
370
+ "anchors": {
371
+ "when": "#quando-usar-geração-de-imagem",
372
+ "api": "#a-api",
373
+ "example": "#exemplo-c-completo",
374
+ "params": "#parâmetros"
375
+ },
376
+ "digest": "Use image generation when the agent must produce images from text prompts — mockups, thumbnails, placeholders, or dynamic visuals. MAF uses ImageClient wrapping the DALL-E / gpt-image provider. Covers quality/size parameters, response format (URL vs Base64), and storing generated images to blob storage. Anti-patterns: generating images inline in HTTP request handlers without queuing."
377
+ },
378
+ {
379
+ "id": "ai-agents-modalities-speech-to-text",
380
+ "name": "modalities speech to text",
381
+ "path": "ai-agents/modalities-speech-to-text.md",
382
+ "category": "ai-agents",
383
+ "subcategory": null,
384
+ "tags": [
385
+ "ai-agents",
386
+ "maf",
387
+ "multimodal",
388
+ "stt",
389
+ "audio"
390
+ ],
391
+ "stacks": [
392
+ "dotnet"
393
+ ],
394
+ "aliases": [
395
+ "speech to text",
396
+ "transcription",
397
+ "whisper",
398
+ "audio to text",
399
+ "voice transcription",
400
+ "STT",
401
+ "audio transcription"
402
+ ],
403
+ "anchors": {
404
+ "when": "#quando-usar-stt",
405
+ "api": "#a-api",
406
+ "example": "#exemplo-c-completo",
407
+ "formats": "#formatos-e-limites"
408
+ },
409
+ "digest": "Use STT when the agent receives voice input or audio files that must be transcribed to text before processing. MAF wraps the Whisper/AudioClient API. Covers supported audio formats (mp3, wav, webm, mp4), file-size limits, language hints, and streaming vs batch transcription. Anti-patterns: piping raw audio into a chat message without transcribing first."
410
+ },
411
+ {
412
+ "id": "ai-agents-modalities-text-to-speech",
413
+ "name": "modalities text to speech",
414
+ "path": "ai-agents/modalities-text-to-speech.md",
415
+ "category": "ai-agents",
416
+ "subcategory": null,
417
+ "tags": [
418
+ "ai-agents",
419
+ "maf",
420
+ "multimodal",
421
+ "tts",
422
+ "audio"
423
+ ],
424
+ "stacks": [
425
+ "dotnet"
426
+ ],
427
+ "aliases": [
428
+ "text to speech",
429
+ "TTS",
430
+ "voice synthesis",
431
+ "audio generation",
432
+ "speech synthesis",
433
+ "voice output",
434
+ "speak text"
435
+ ],
436
+ "anchors": {
437
+ "when": "#quando-usar-tts",
438
+ "api": "#a-api",
439
+ "example": "#exemplo-c-completo",
440
+ "params": "#parâmetros"
441
+ },
442
+ "digest": "Use TTS when the agent must return audio output — voice assistants, accessibility narration, podcast generation. MAF uses AudioClient for text-to-speech with configurable voice, speed, and output format (mp3, opus, flac). Covers streaming audio response, voice selection, and integration with blob storage for async delivery. Anti-patterns: synthesizing long texts synchronously in a request handler."
443
+ },
444
+ {
445
+ "id": "ai-agents-batching",
446
+ "name": "batching",
447
+ "path": "ai-agents/batching.md",
448
+ "category": "ai-agents",
449
+ "subcategory": null,
450
+ "tags": [
451
+ "ai-agents",
452
+ "maf",
453
+ "batching",
454
+ "cost-optimization"
455
+ ],
456
+ "stacks": [
457
+ "dotnet"
458
+ ],
459
+ "aliases": [
460
+ "batching",
461
+ "batch api",
462
+ "bulk prompts",
463
+ "batch processing",
464
+ "async batch",
465
+ "bulk inference",
466
+ "offline batch"
467
+ ],
468
+ "anchors": {
469
+ "when": "#quando-usar-batch",
470
+ "api": "#a-api",
471
+ "example": "#exemplo-c-completo",
472
+ "when-not": "#quando-não-usar"
473
+ },
474
+ "digest": "Use the OpenAI Batch API when processing large volumes of independent prompts (classification, extraction, summarisation) where latency is not critical. Batch jobs receive a ~50% cost discount and run asynchronously with a 24-hour completion window. MAF wraps batch submission, polling, and result parsing. Anti-patterns: using batch for interactive user-facing calls or tasks requiring immediate results."
475
+ },
476
+ {
477
+ "id": "ai-agents-service-tier-flex",
478
+ "name": "service tier flex",
479
+ "path": "ai-agents/service-tier-flex.md",
480
+ "category": "ai-agents",
481
+ "subcategory": null,
482
+ "tags": [
483
+ "ai-agents",
484
+ "maf",
485
+ "cost-optimization",
486
+ "service-tier"
487
+ ],
488
+ "stacks": [
489
+ "dotnet"
490
+ ],
491
+ "aliases": [
492
+ "service tier",
493
+ "flex tier",
494
+ "cost optimization",
495
+ "async tier",
496
+ "priority tier",
497
+ "tier flex",
498
+ "background inference"
499
+ ],
500
+ "anchors": {
501
+ "when": "#quando-usar-tier-flex",
502
+ "api": "#a-api",
503
+ "example": "#exemplo-c",
504
+ "decision": "#decision"
505
+ },
506
+ "digest": "The Flex service tier routes requests to spare capacity at lower cost, accepting variable latency in exchange. Use for background jobs, nightly reports, and any async workload where cost matters more than response time. MAF sets service_tier=flex in ChatOptions. Covers the decision matrix (flex vs default vs batch) and anti-patterns such as using flex for real-time user interactions."
507
+ },
508
+ {
509
+ "id": "ai-agents-agent-session",
510
+ "name": "agent session",
511
+ "path": "ai-agents/agent-session.md",
512
+ "category": "ai-agents",
513
+ "subcategory": null,
514
+ "tags": [
515
+ "ai-agents",
516
+ "maf",
517
+ "conversation",
518
+ "session"
519
+ ],
520
+ "stacks": [
521
+ "dotnet"
522
+ ],
523
+ "aliases": [
524
+ "agent session",
525
+ "chat history",
526
+ "conversation state",
527
+ "chat reducer",
528
+ "history truncation",
529
+ "AgentThread",
530
+ "multi-turn",
531
+ "persistent session"
532
+ ],
533
+ "anchors": {
534
+ "when": "#quando-usar-agentsession",
535
+ "api": "#a-api",
536
+ "example": "#exemplo-c--agente-conversacional-com-session-persistente-entre-turnos",
537
+ "history": "#history-management"
538
+ },
539
+ "digest": "AgentSession manages conversational state across multiple turns — stores and retrieves chat history, applies reducers to trim token usage, and persists sessions between HTTP requests. Use for chat UIs, voice assistants, and any multi-turn interaction. Covers history reducers (sliding window, summarisation), session serialisation, and multi-tenant session isolation. Anti-patterns: keeping history in memory without persistence."
540
+ },
541
+ {
542
+ "id": "ai-agents-context-providers",
543
+ "name": "context providers",
544
+ "path": "ai-agents/context-providers.md",
545
+ "category": "ai-agents",
546
+ "subcategory": null,
547
+ "tags": [
548
+ "ai-agents",
549
+ "maf",
550
+ "context",
551
+ "dependency-injection"
552
+ ],
553
+ "stacks": [
554
+ "dotnet"
555
+ ],
556
+ "aliases": [
557
+ "context provider",
558
+ "dynamic context",
559
+ "context injection",
560
+ "AIContextProvider",
561
+ "memory provider",
562
+ "inject context",
563
+ "system prompt injection"
564
+ ],
565
+ "anchors": {
566
+ "when": "#quando-usar-context-provider",
567
+ "api": "#a-api",
568
+ "example": "#exemplo-c--context-provider-que-injeta-data-atual-e-perfil-do-tenant",
569
+ "comparison": "#context-provider-vs-tools-vs-rag"
570
+ },
571
+ "digest": "AIContextProvider injects dynamic context into the agent's system prompt at runtime — current date, tenant profile, feature flags, user preferences — without requiring the caller to pass it explicitly. Registered via DI, executed before each agent invocation. Covers the decision matrix (Context Provider vs Tools vs RAG), provider chaining, and async data loading. Anti-patterns: fetching slow external data synchronously in a provider."
572
+ },
573
+ {
574
+ "id": "ai-agents-mcp-tools",
575
+ "name": "mcp tools (agent consumer)",
576
+ "path": "ai-agents/mcp-tools.md",
577
+ "category": "ai-agents",
578
+ "subcategory": null,
579
+ "tags": [
580
+ "ai-agents",
581
+ "maf",
582
+ "mcp",
583
+ "tools"
584
+ ],
585
+ "stacks": [
586
+ "dotnet"
587
+ ],
588
+ "aliases": [
589
+ "mcp",
590
+ "model context protocol",
591
+ "mcp client",
592
+ "consume mcp server",
593
+ "mcp tools",
594
+ "external tools",
595
+ "McpClientFactory",
596
+ "agent mcp client"
597
+ ],
598
+ "anchors": {
599
+ "what": "#o-que-é-no-contexto-de-um-agente-maf",
600
+ "api": "#a-api",
601
+ "example": "#exemplo-c",
602
+ "comparison": "#mcp-server-vs-tool-nativa"
603
+ },
604
+ "digest": "Covers how a MAF agent consumes external MCP servers as tool sources. McpClientFactory connects to an MCP server (stdio or SSE transport), discovers available tools, and exposes them as MAF AIFunctions. Use when an MCP server already exposes the capability you need. Covers popular MCP servers, the decision matrix (MCP server vs native MAF tool), and anti-patterns such as wrapping an MCP tool unnecessarily in a native function."
605
+ },
606
+ {
607
+ "id": "ai-agents-mcp-server",
608
+ "name": "mcp server",
609
+ "path": "ai-agents/mcp-server.md",
610
+ "category": "ai-agents",
611
+ "subcategory": null,
612
+ "tags": [
613
+ "ai-agents",
614
+ "maf",
615
+ "mcp",
616
+ "server"
617
+ ],
618
+ "stacks": [
619
+ "dotnet"
620
+ ],
621
+ "aliases": [
622
+ "mcp server",
623
+ "expose mcp",
624
+ "build mcp server",
625
+ "mcp host",
626
+ "publish tools",
627
+ "create mcp server",
628
+ "ModelContextProtocol server"
629
+ ],
630
+ "anchors": {
631
+ "when": "#quando-criar-um-mcp-server",
632
+ "api": "#a-api",
633
+ "example": "#exemplo-c--tools-por-atributo-stdio",
634
+ "http": "#exemplo-c--transport-http",
635
+ "security": "#segurança"
636
+ },
637
+ "digest": "Covers building an MCP server that exposes project capabilities (business logic, databases, internal APIs) to external agents and Claude Code. Uses the ModelContextProtocol .NET SDK: tools via [McpServerToolType]/[McpServerTool] attributes (WithToolsFromAssembly) or McpServerTool.Create for a MAF agent. Covers stdio vs HTTP transport (ModelContextProtocol.AspNetCore, WithHttpTransport stateless, MapMcp), authentication, the decision matrix (native MAF tool vs exposed MCP server), and security such as input validation and rate limiting."
638
+ },
639
+ {
640
+ "id": "architecture-vertical-slice-vertical-slice",
641
+ "name": "vertical slice",
642
+ "path": "architecture/vertical-slice/vertical-slice.md",
643
+ "category": "architecture",
644
+ "subcategory": "vertical-slice",
645
+ "tags": [
646
+ "architecture",
647
+ "vertical-slice"
648
+ ],
649
+ "stacks": [
650
+ "dotnet"
651
+ ],
652
+ "aliases": [
653
+ "vertical slice",
654
+ "VSA",
655
+ "slice architecture",
656
+ "feature slice",
657
+ "CQRS slice"
658
+ ],
659
+ "anchors": {
660
+ "structure": "#estrutura-de-pastas",
661
+ "rules": "#padrões-obrigatórios",
662
+ "cqrs": "#anti-patterns-nunca-fazer-em-vsa"
663
+ },
664
+ "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."
665
+ },
666
+ {
667
+ "id": "backend-api-validation",
668
+ "name": "validation",
669
+ "path": "backend/api/validation.md",
670
+ "category": "backend",
671
+ "subcategory": "api",
672
+ "tags": [
673
+ "backend",
674
+ "api"
675
+ ],
676
+ "stacks": [
677
+ "dotnet"
678
+ ],
679
+ "aliases": [
680
+ "FluentValidation",
681
+ "input validation",
682
+ "request validation",
683
+ "API validation",
684
+ "model validation"
685
+ ],
686
+ "anchors": {
687
+ "fluent": "#validation-patterns",
688
+ "rules": "#validation-patterns"
689
+ },
690
+ "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."
691
+ },
692
+ {
693
+ "id": "backend-database-postgresql-database",
694
+ "name": "database",
695
+ "path": "backend/database/postgresql/database.md",
696
+ "category": "backend",
697
+ "subcategory": "database",
698
+ "tags": [
699
+ "backend",
700
+ "database",
701
+ "postgresql"
702
+ ],
703
+ "stacks": [
704
+ "dotnet"
705
+ ],
706
+ "aliases": [
707
+ "PostgreSQL",
708
+ "postgres",
709
+ "pg",
710
+ "database design",
711
+ "SQL schema"
712
+ ],
713
+ "anchors": {
714
+ "schema": "#schema-design",
715
+ "indexes": "#indexes"
716
+ },
717
+ "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."
718
+ },
719
+ {
720
+ "id": "backend-database-vector-search-rag",
721
+ "name": "vector search rag",
722
+ "path": "backend/database/vector-search-rag.md",
723
+ "category": "backend",
724
+ "subcategory": "database",
725
+ "tags": [
726
+ "backend",
727
+ "database"
728
+ ],
729
+ "stacks": [
730
+ "dotnet",
731
+ "nextjs",
732
+ "neon"
733
+ ],
734
+ "aliases": [
735
+ "vector search",
736
+ "RAG",
737
+ "embeddings",
738
+ "pgvector",
739
+ "semantic search"
740
+ ],
741
+ "anchors": {
742
+ "chunking": "#📥-indexação-de-documentos",
743
+ "retrieval": "#🔍-vector-search-com-ef-core-10"
744
+ },
745
+ "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."
746
+ },
747
+ {
748
+ "id": "backend-dotnet-result-pattern",
749
+ "name": "result pattern",
750
+ "path": "backend/dotnet/result-pattern.md",
751
+ "category": "backend",
752
+ "subcategory": "dotnet",
753
+ "tags": [
754
+ "backend",
755
+ "dotnet",
756
+ "vsa"
757
+ ],
758
+ "stacks": [
759
+ "dotnet"
760
+ ],
761
+ "aliases": [
762
+ "Result<T>",
763
+ "railway oriented",
764
+ "error handling",
765
+ "Match pattern",
766
+ "Result monad"
767
+ ],
768
+ "anchors": {
769
+ "anatomy": "#result-anatomy",
770
+ "errors": "#error-types-7--custom",
771
+ "match": "#match-pattern"
772
+ },
773
+ "digest": "Use Result<T> for all handler returns — never throw for expected failures. 7 error types (Failure, Unexpected, Validation, Conflict, NotFound, Unauthorized, Forbidden) map to HTTP status codes. Use Match() in endpoints to convert Result to IResult. Implicit conversions allow returning values or errors directly from handlers."
774
+ },
775
+ {
776
+ "id": "backend-dotnet-scrutor",
777
+ "name": "scrutor",
778
+ "path": "backend/dotnet/scrutor.md",
779
+ "category": "backend",
780
+ "subcategory": "dotnet",
781
+ "tags": [
782
+ "backend",
783
+ "dotnet",
784
+ "vsa"
785
+ ],
786
+ "stacks": [
787
+ "dotnet"
788
+ ],
789
+ "aliases": [
790
+ "Scrutor",
791
+ "auto-discovery",
792
+ "assembly scanning",
793
+ "decorator registration",
794
+ "handler registration"
795
+ ],
796
+ "anchors": {
797
+ "handlers": "#handler-auto-discovery",
798
+ "decorators": "#decorator-order",
799
+ "endpoints": "#endpoint-auto-discovery"
800
+ },
801
+ "digest": "Use Scrutor for convention-based DI registration. AddHandlersFromAssembly() scans for IHandler<,> implementations. Decorate<> applies pipeline decorators (validation, logging) — last registered wraps outermost. Register validators before handlers. RegisterApiEndpointsFromAssembly() auto-discovers IApiEndpoint implementations."
802
+ },
803
+ {
804
+ "id": "backend-dotnet-fluent-validation-vsa",
805
+ "name": "fluent validation vsa",
806
+ "path": "backend/dotnet/fluent-validation-vsa.md",
807
+ "category": "backend",
808
+ "subcategory": "dotnet",
809
+ "tags": [
810
+ "backend",
811
+ "dotnet",
812
+ "vsa"
813
+ ],
814
+ "stacks": [
815
+ "dotnet"
816
+ ],
817
+ "aliases": [
818
+ "FluentValidation VSA",
819
+ "validation decorator",
820
+ "validation pipeline",
821
+ "AbstractValidator",
822
+ "ValidationDecorator"
823
+ ],
824
+ "anchors": {
825
+ "validator": "#validator-structure",
826
+ "decorator": "#validationdecorator-pattern",
827
+ "conversion": "#fluentvalidation-to-validationerror-conversion"
828
+ },
829
+ "digest": "Use AbstractValidator<T> per request DTO in feature folders. ValidationDecorator intercepts all handlers via Scrutor, runs validators in parallel, and short-circuits to Result.Failure(ValidationError) on failure. Register AddValidatorsFromAssembly() before AddHandlersFromAssembly(). Never validate inside handlers."
830
+ },
831
+ {
832
+ "id": "backend-dotnet-scalar-ui",
833
+ "name": "scalar ui",
834
+ "path": "backend/dotnet/scalar-ui.md",
835
+ "category": "backend",
836
+ "subcategory": "dotnet",
837
+ "tags": [
838
+ "backend",
839
+ "dotnet",
840
+ "vsa"
841
+ ],
842
+ "stacks": [
843
+ "dotnet"
844
+ ],
845
+ "aliases": [
846
+ "Scalar",
847
+ "API documentation",
848
+ "OpenAPI UI",
849
+ "Swagger replacement",
850
+ "Scalar.AspNetCore"
851
+ ],
852
+ "anchors": {
853
+ "setup": "#programcs-configuration",
854
+ "tags": "#apitags-organization",
855
+ "metadata": "#endpoint-metadata"
856
+ },
857
+ "digest": "Use Scalar.AspNetCore 2.12.40 as API documentation UI — replaces Swagger. MapScalarApiReference() with DeepSpace theme. Group endpoints with .WithTags() and ApiTags constants. Document responses with .Produces<T>(). Guard MapOpenApi() with IsDevelopment(). No Swashbuckle needed."
858
+ },
859
+ {
860
+ "id": "backend-dotnet-vsa-handler-patterns",
861
+ "name": "vsa handler patterns",
862
+ "path": "backend/dotnet/vsa-handler-patterns.md",
863
+ "category": "backend",
864
+ "subcategory": "dotnet",
865
+ "tags": [
866
+ "backend",
867
+ "dotnet",
868
+ "vsa"
869
+ ],
870
+ "stacks": [
871
+ "dotnet"
872
+ ],
873
+ "aliases": [
874
+ "VSA handler",
875
+ "vertical slice handler",
876
+ "feature slice",
877
+ "IHandler pattern",
878
+ "handler endpoint"
879
+ ],
880
+ "anchors": {
881
+ "handler": "#ihandlertrequest-tresponse",
882
+ "folder": "#feature-folder-structure-5-files-per-slice",
883
+ "endpoint": "#complete-endpoint-example",
884
+ "registration": "#programcs-di-registration-order"
885
+ },
886
+ "digest": "Each VSA feature is 5 files: Request, Response, Handler, Validator, Endpoint. Use IHandler<TReq,TRes> (not MediatR). Sealed records for DTOs, primary constructors for DI, Guid.CreateVersion7() for IDs. Handler calls Repository+UnitOfWork directly — no service layer. CancellationToken in every async call."
887
+ },
888
+ {
889
+ "id": "backend-integrations-asaas-asaas-api",
890
+ "name": "asaas api",
891
+ "path": "backend/integrations/asaas/asaas-api.md",
892
+ "category": "backend",
893
+ "subcategory": "integrations",
894
+ "tags": [
895
+ "backend",
896
+ "integrations",
897
+ "asaas"
898
+ ],
899
+ "stacks": [
900
+ "dotnet"
901
+ ],
902
+ "aliases": [
903
+ "asaas",
904
+ "payment",
905
+ "PIX",
906
+ "boleto",
907
+ "Brazilian payment"
908
+ ],
909
+ "anchors": {
910
+ "payments": "#create-pix-payment",
911
+ "webhooks": "#webhook-handler"
912
+ },
913
+ "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."
914
+ },
915
+ {
916
+ "id": "backend-integrations-neon-auth-neon-auth",
917
+ "name": "neon auth",
918
+ "path": "backend/integrations/neon-auth/neon-auth.md",
919
+ "category": "backend",
920
+ "subcategory": "integrations",
921
+ "tags": [
922
+ "backend",
923
+ "integrations",
924
+ "neon-auth",
925
+ "better-auth"
926
+ ],
927
+ "stacks": [
928
+ "neon"
929
+ ],
930
+ "aliases": [
931
+ "neon auth",
932
+ "better auth",
933
+ "authentication",
934
+ "OAuth",
935
+ "JWT",
936
+ "session management"
937
+ ],
938
+ "anchors": {
939
+ "setup": "#installation--setup",
940
+ "middleware": "#route-protection-middleware",
941
+ "dotnet": "#net-backend-integration",
942
+ "rls": "#row-level-security-integration"
943
+ },
944
+ "digest": "Use @neondatabase/auth SDK for Next.js. Auth data lives in neon_auth schema — no external provider, no webhooks. Server: createNeonAuth() with NEON_AUTH_BASE_URL + NEON_AUTH_COOKIE_SECRET. Client: createAuthClient(). Pages: AuthView component. Protection: auth.middleware(). .NET: JWT Bearer with Neon Auth authority, NameClaimType=sub. RLS: auth.user_id() via pg_session_jwt."
945
+ },
946
+ {
947
+ "id": "backend-integrations-hangfire-hangfire-jobs",
948
+ "name": "hangfire jobs",
949
+ "path": "backend/integrations/hangfire/hangfire-jobs.md",
950
+ "category": "backend",
951
+ "subcategory": "integrations",
952
+ "tags": [
953
+ "backend",
954
+ "integrations",
955
+ "hangfire"
956
+ ],
957
+ "stacks": [
958
+ "dotnet"
959
+ ],
960
+ "aliases": [
961
+ "hangfire",
962
+ "background jobs",
963
+ "scheduled jobs",
964
+ "recurring",
965
+ "cron",
966
+ "fire and forget"
967
+ ],
968
+ "anchors": {
969
+ "jobs": "#job-types",
970
+ "retry": "#retry--error-handling"
971
+ },
972
+ "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."
973
+ },
974
+ {
975
+ "id": "backend-integrations-resend-resend-email",
976
+ "name": "resend email",
977
+ "path": "backend/integrations/resend/resend-email.md",
978
+ "category": "backend",
979
+ "subcategory": "integrations",
980
+ "tags": [
981
+ "backend",
982
+ "integrations",
983
+ "resend"
984
+ ],
985
+ "stacks": [
986
+ "dotnet"
987
+ ],
988
+ "aliases": [
989
+ "resend",
990
+ "email",
991
+ "transactional email",
992
+ "SMTP",
993
+ "email notification"
994
+ ],
995
+ "anchors": {
996
+ "sending": "#send-email-api-route",
997
+ "templates": "#common-email-templates"
998
+ },
999
+ "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."
1000
+ },
1001
+ {
1002
+ "id": "data-nosql-cache-redis",
1003
+ "name": "redis",
1004
+ "path": "data/nosql/cache/redis.md",
1005
+ "category": "data",
1006
+ "subcategory": "nosql",
1007
+ "tags": [
1008
+ "data",
1009
+ "nosql",
1010
+ "cache"
1011
+ ],
1012
+ "stacks": [
1013
+ "dotnet",
1014
+ "azure"
1015
+ ],
1016
+ "aliases": [
1017
+ "redis",
1018
+ "cache",
1019
+ "distributed cache",
1020
+ "IDistributedCache",
1021
+ "cache-aside",
1022
+ "StackExchange.Redis"
1023
+ ],
1024
+ "anchors": {
1025
+ "patterns": "#cache-aside-pattern",
1026
+ "invalidation": "#ttl-strategy"
1027
+ },
1028
+ "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."
1029
+ },
1030
+ {
1031
+ "id": "data-nosql-cosmos-db",
1032
+ "name": "cosmos db",
1033
+ "path": "data/nosql/cosmos-db.md",
1034
+ "category": "data",
1035
+ "subcategory": "nosql",
1036
+ "tags": [
1037
+ "data",
1038
+ "nosql"
1039
+ ],
1040
+ "stacks": [
1041
+ "dotnet",
1042
+ "azure"
1043
+ ],
1044
+ "aliases": [
1045
+ "cosmos",
1046
+ "CosmosDB",
1047
+ "document database",
1048
+ "partition key",
1049
+ "RUs"
1050
+ ],
1051
+ "anchors": {
1052
+ "modeling": "#container-design",
1053
+ "queries": "#repository-pattern"
1054
+ },
1055
+ "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."
1056
+ },
1057
+ {
1058
+ "id": "data-vector-search-rag-chunking",
1059
+ "name": "rag chunking",
1060
+ "path": "data/vector-search/rag-chunking.md",
1061
+ "category": "data",
1062
+ "subcategory": "vector-search",
1063
+ "tags": [
1064
+ "data",
1065
+ "vector-search"
1066
+ ],
1067
+ "stacks": [
1068
+ "dotnet",
1069
+ "azure"
1070
+ ],
1071
+ "aliases": [
1072
+ "RAG chunking",
1073
+ "document chunking",
1074
+ "text splitting",
1075
+ "chunk overlap",
1076
+ "embedding chunks"
1077
+ ],
1078
+ "anchors": {
1079
+ "strategies": "#chunking-strategies",
1080
+ "retrieval": "#chunking-strategies"
1081
+ },
1082
+ "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."
1083
+ },
1084
+ {
1085
+ "id": "frontend-design-system-animations",
1086
+ "name": "animations",
1087
+ "path": "frontend/design-system/animations.md",
1088
+ "category": "frontend",
1089
+ "subcategory": "design-system",
1090
+ "tags": [
1091
+ "frontend",
1092
+ "design-system"
1093
+ ],
1094
+ "stacks": [
1095
+ "*"
1096
+ ],
1097
+ "aliases": [
1098
+ "animations",
1099
+ "transitions",
1100
+ "motion",
1101
+ "CSS animations",
1102
+ "keyframes",
1103
+ "prefers-reduced-motion"
1104
+ ],
1105
+ "anchors": {
1106
+ "tokens": "#stagger--timing",
1107
+ "principles": "#css-animation-patterns"
1108
+ },
1109
+ "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."
1110
+ },
1111
+ {
1112
+ "id": "frontend-design-system-naming",
1113
+ "name": "naming",
1114
+ "path": "frontend/design-system/naming.md",
1115
+ "category": "frontend",
1116
+ "subcategory": "design-system",
1117
+ "tags": [
1118
+ "frontend",
1119
+ "design-system"
1120
+ ],
1121
+ "stacks": [
1122
+ "*"
1123
+ ],
1124
+ "aliases": [
1125
+ "BEM",
1126
+ "CSS naming",
1127
+ "class naming",
1128
+ "design token naming",
1129
+ "component naming"
1130
+ ],
1131
+ "anchors": {
1132
+ "blocks": "#bem-for-reusable-components",
1133
+ "tokens": "#css-variables-with-namespace"
1134
+ },
1135
+ "digest": "BEM for CSS: .block__element--modifier. Design tokens: --color-primary-500, --spacing-4, --font-size-base. Component names PascalCase (React/Next.js) / kebab-case (CSS). No generic names (blue, big). Semantic names only: --color-action, --spacing-page-gutter. Tokens are the single source of truth."
1136
+ },
1137
+ {
1138
+ "id": "frontend-nextjs-motion-patterns",
1139
+ "name": "motion patterns",
1140
+ "path": "frontend/nextjs/motion-patterns.md",
1141
+ "category": "frontend",
1142
+ "subcategory": "nextjs",
1143
+ "tags": [
1144
+ "frontend",
1145
+ "nextjs",
1146
+ "framer-motion"
1147
+ ],
1148
+ "stacks": [
1149
+ "nextjs"
1150
+ ],
1151
+ "aliases": [
1152
+ "framer-motion",
1153
+ "animation variants",
1154
+ "motion design",
1155
+ "page transition",
1156
+ "AnimatePresence"
1157
+ ],
1158
+ "anchors": {
1159
+ "variants": "#section-1-core-variants-library",
1160
+ "tokens": "#section-2-design-token-bridge",
1161
+ "scroll": "#section-3-scroll-animations",
1162
+ "accessibility": "#section-7-wcag-accessibility-mandatory"
1163
+ },
1164
+ "digest": "Canonical Framer Motion variants (fadeIn, slideIn, scaleIn, stagger, pageTransition) with design token bridge. Use whileInView for scroll reveals. Respect prefers-reduced-motion via useReducedMotion() — strip transforms, keep opacity."
1165
+ },
1166
+ {
1167
+ "id": "frontend-gsap-core",
1168
+ "name": "gsap core",
1169
+ "path": "frontend/gsap/gsap-core.md",
1170
+ "category": "frontend",
1171
+ "subcategory": "gsap",
1172
+ "tags": [
1173
+ "frontend",
1174
+ "gsap",
1175
+ "animation",
1176
+ "react"
1177
+ ],
1178
+ "stacks": [
1179
+ "nextjs"
1180
+ ],
1181
+ "aliases": [
1182
+ "GSAP",
1183
+ "GreenSock",
1184
+ "gsap.to",
1185
+ "gsap.from",
1186
+ "useGSAP",
1187
+ "gsap timeline",
1188
+ "gsap utils",
1189
+ "gsap performance"
1190
+ ],
1191
+ "anchors": {
1192
+ "apis": "#section-3-core-animation-apis",
1193
+ "react": "#section-4-reactnextjs-integration",
1194
+ "timeline": "#section-5-timeline-sequencing",
1195
+ "performance": "#section-7-performance",
1196
+ "accessibility": "#section-8-accessibility"
1197
+ },
1198
+ "digest": "Use gsap.to/from/fromTo for imperative animations. In React, always use useGSAP() hook from @gsap/react with scope ref for automatic cleanup. Timelines sequence with position parameter. Animate only transforms + opacity for 60fps. Check prefers-reduced-motion. Import durations/easings from design tokens."
1199
+ },
1200
+ {
1201
+ "id": "frontend-gsap-scrolltrigger",
1202
+ "name": "gsap scrolltrigger",
1203
+ "path": "frontend/gsap/gsap-scrolltrigger.md",
1204
+ "category": "frontend",
1205
+ "subcategory": "gsap",
1206
+ "tags": [
1207
+ "frontend",
1208
+ "gsap",
1209
+ "scrolltrigger",
1210
+ "scroll-animation"
1211
+ ],
1212
+ "stacks": [
1213
+ "nextjs"
1214
+ ],
1215
+ "aliases": [
1216
+ "ScrollTrigger",
1217
+ "scroll animation",
1218
+ "pinning",
1219
+ "scrubbing",
1220
+ "parallax",
1221
+ "scroll-driven"
1222
+ ],
1223
+ "anchors": {
1224
+ "basic": "#section-2-basic-scrolltrigger",
1225
+ "scrub": "#section-3-scrubbing",
1226
+ "pin": "#section-4-pinning",
1227
+ "batch": "#section-5-batch-processing"
1228
+ },
1229
+ "digest": "Register ScrollTrigger plugin client-side only. Use scrub for scroll-linked progress. Pin sections with pin:true. Batch-process list items with ScrollTrigger.batch(). Call ScrollTrigger.refresh() after dynamic content. Kill all triggers in useGSAP cleanup."
1230
+ },
1231
+ {
1232
+ "id": "frontend-gsap-plugins",
1233
+ "name": "gsap plugins",
1234
+ "path": "frontend/gsap/gsap-plugins.md",
1235
+ "category": "frontend",
1236
+ "subcategory": "gsap",
1237
+ "tags": [
1238
+ "frontend",
1239
+ "gsap",
1240
+ "plugins"
1241
+ ],
1242
+ "stacks": [
1243
+ "nextjs"
1244
+ ],
1245
+ "aliases": [
1246
+ "Flip",
1247
+ "SplitText",
1248
+ "MorphSVG",
1249
+ "DrawSVG",
1250
+ "MotionPath",
1251
+ "Draggable",
1252
+ "Observer",
1253
+ "ScrollToPlugin"
1254
+ ],
1255
+ "anchors": {
1256
+ "flip": "#flip-plugin-free",
1257
+ "splittext": "#splittext",
1258
+ "morphsvg": "#morphsvg",
1259
+ "drawsvg": "#drawsvg"
1260
+ },
1261
+ "digest": "Flip for layout animations (getState then from). SplitText for char/word/line reveals (always revert on cleanup). MorphSVG for path morphing. DrawSVG for stroke animation. MotionPath for path-following. Draggable for drag with bounds/snap. Observer for gesture detection. Register all plugins before use."
1262
+ },
1263
+ {
1264
+ "id": "frontend-nextjs-app-router",
1265
+ "name": "app router",
1266
+ "path": "frontend/nextjs/app-router.md",
1267
+ "category": "frontend",
1268
+ "subcategory": "nextjs",
1269
+ "tags": [
1270
+ "frontend",
1271
+ "nextjs"
1272
+ ],
1273
+ "stacks": [
1274
+ "nextjs"
1275
+ ],
1276
+ "aliases": [
1277
+ "app router",
1278
+ "Next.js 14",
1279
+ "server components",
1280
+ "app directory",
1281
+ "RSC"
1282
+ ],
1283
+ "anchors": {
1284
+ "layout": "#root-layout--required-providers",
1285
+ "routing": "#app-directory-structure"
1286
+ },
1287
+ "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."
1288
+ },
1289
+ {
1290
+ "id": "frontend-nextjs-components",
1291
+ "name": "components",
1292
+ "path": "frontend/nextjs/components.md",
1293
+ "category": "frontend",
1294
+ "subcategory": "nextjs",
1295
+ "tags": [
1296
+ "frontend",
1297
+ "nextjs"
1298
+ ],
1299
+ "stacks": [
1300
+ "nextjs"
1301
+ ],
1302
+ "aliases": [
1303
+ "react components",
1304
+ "server component",
1305
+ "client component",
1306
+ "shadcn/ui",
1307
+ "UI components"
1308
+ ],
1309
+ "anchors": {
1310
+ "patterns": "#three-tier-hierarchy",
1311
+ "shadcn": "#tier-1--shadcnui-primitives"
1312
+ },
1313
+ "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."
1314
+ },
1315
+ {
1316
+ "id": "frontend-nextjs-data-fetching",
1317
+ "name": "data fetching",
1318
+ "path": "frontend/nextjs/data-fetching.md",
1319
+ "category": "frontend",
1320
+ "subcategory": "nextjs",
1321
+ "tags": [
1322
+ "frontend",
1323
+ "nextjs"
1324
+ ],
1325
+ "stacks": [
1326
+ "nextjs"
1327
+ ],
1328
+ "aliases": [
1329
+ "TanStack Query",
1330
+ "react-query",
1331
+ "server actions",
1332
+ "data fetching",
1333
+ "useQuery"
1334
+ ],
1335
+ "anchors": {
1336
+ "server": "#server-component--tanstack-query-handoff",
1337
+ "client": "#usequery-hook-pattern"
1338
+ },
1339
+ "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."
1340
+ },
1341
+ {
1342
+ "id": "frontend-nextjs-forms",
1343
+ "name": "forms",
1344
+ "path": "frontend/nextjs/forms.md",
1345
+ "category": "frontend",
1346
+ "subcategory": "nextjs",
1347
+ "tags": [
1348
+ "frontend",
1349
+ "nextjs"
1350
+ ],
1351
+ "stacks": [
1352
+ "nextjs"
1353
+ ],
1354
+ "aliases": [
1355
+ "react-hook-form",
1356
+ "Zod",
1357
+ "form validation",
1358
+ "Server Actions forms",
1359
+ "useFormState"
1360
+ ],
1361
+ "anchors": {
1362
+ "validation": "#schema-composition",
1363
+ "submission": "#complete-form-pattern"
1364
+ },
1365
+ "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."
1366
+ },
1367
+ {
1368
+ "id": "frontend-nextjs-naming-conventions",
1369
+ "name": "naming conventions",
1370
+ "path": "frontend/nextjs/naming-conventions.md",
1371
+ "category": "frontend",
1372
+ "subcategory": "nextjs",
1373
+ "tags": [
1374
+ "frontend",
1375
+ "nextjs"
1376
+ ],
1377
+ "stacks": [
1378
+ "nextjs"
1379
+ ],
1380
+ "aliases": [
1381
+ "naming conventions",
1382
+ "file naming",
1383
+ "component naming",
1384
+ "Next.js naming",
1385
+ "TypeScript naming"
1386
+ ],
1387
+ "anchors": {
1388
+ "files": "#complete-reference-table",
1389
+ "components": "#complete-reference-table"
1390
+ },
1391
+ "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."
1392
+ },
1393
+ {
1394
+ "id": "frontend-nextjs-nextjs-patterns",
1395
+ "name": "nextjs patterns",
1396
+ "path": "frontend/nextjs/nextjs-patterns.md",
1397
+ "category": "frontend",
1398
+ "subcategory": "nextjs",
1399
+ "tags": [
1400
+ "frontend",
1401
+ "nextjs"
1402
+ ],
1403
+ "stacks": [
1404
+ "nextjs"
1405
+ ],
1406
+ "aliases": [
1407
+ "Next.js patterns",
1408
+ "middleware",
1409
+ "auth patterns",
1410
+ "caching patterns",
1411
+ "image optimization"
1412
+ ],
1413
+ "anchors": {
1414
+ "auth": "#route-handlers-bff-pattern",
1415
+ "caching": "#react-query--neon"
1416
+ },
1417
+ "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."
1418
+ },
1419
+ {
1420
+ "id": "frontend-nextjs-project-structure",
1421
+ "name": "project structure",
1422
+ "path": "frontend/nextjs/project-structure.md",
1423
+ "category": "frontend",
1424
+ "subcategory": "nextjs",
1425
+ "tags": [
1426
+ "frontend",
1427
+ "nextjs"
1428
+ ],
1429
+ "stacks": [
1430
+ "nextjs"
1431
+ ],
1432
+ "aliases": [
1433
+ "project structure",
1434
+ "folder structure",
1435
+ "src directory",
1436
+ "app directory organization"
1437
+ ],
1438
+ "anchors": {
1439
+ "structure": "#canonical-folder-tree",
1440
+ "organization": "#feature-index-pattern"
1441
+ },
1442
+ "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."
1443
+ },
1444
+ {
1445
+ "id": "frontend-nextjs-state-management",
1446
+ "name": "state management",
1447
+ "path": "frontend/nextjs/state-management.md",
1448
+ "category": "frontend",
1449
+ "subcategory": "nextjs",
1450
+ "tags": [
1451
+ "frontend",
1452
+ "nextjs"
1453
+ ],
1454
+ "stacks": [
1455
+ "nextjs"
1456
+ ],
1457
+ "aliases": [
1458
+ "zustand",
1459
+ "React context",
1460
+ "global state",
1461
+ "state management",
1462
+ "client state"
1463
+ ],
1464
+ "anchors": {
1465
+ "patterns": "#state-decision-tree",
1466
+ "server": "#server-state-tanstack-query"
1467
+ },
1468
+ "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."
1469
+ },
1470
+ {
1471
+ "id": "frontend-nextjs-testing",
1472
+ "name": "testing",
1473
+ "path": "frontend/nextjs/testing.md",
1474
+ "category": "frontend",
1475
+ "subcategory": "nextjs",
1476
+ "tags": [
1477
+ "frontend",
1478
+ "nextjs"
1479
+ ],
1480
+ "stacks": [
1481
+ "nextjs"
1482
+ ],
1483
+ "aliases": [
1484
+ "vitest",
1485
+ "jest",
1486
+ "testing-library",
1487
+ "Playwright",
1488
+ "Next.js testing",
1489
+ "component tests"
1490
+ ],
1491
+ "anchors": {
1492
+ "unit": "#component-test-pattern",
1493
+ "e2e": "#test-file-co-location"
1494
+ },
1495
+ "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."
1496
+ },
1497
+ {
1498
+ "id": "infrastructure-docker-easypanel-deploy",
1499
+ "name": "easypanel deploy",
1500
+ "path": "infrastructure/docker/easypanel-deploy.md",
1501
+ "category": "infrastructure",
1502
+ "subcategory": "docker",
1503
+ "tags": [
1504
+ "infrastructure",
1505
+ "docker"
1506
+ ],
1507
+ "stacks": [
1508
+ "docker"
1509
+ ],
1510
+ "aliases": [
1511
+ "easypanel",
1512
+ "docker deploy",
1513
+ "self-hosted",
1514
+ "VPS deployment",
1515
+ "docker compose"
1516
+ ],
1517
+ "anchors": {
1518
+ "setup": "#easypanel-service-config",
1519
+ "deployment": "#zero-downtime-deploys"
1520
+ },
1521
+ "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."
1522
+ },
1523
+ {
1524
+ "id": "infrastructure-neon-setup",
1525
+ "name": "neon setup",
1526
+ "path": "infrastructure/neon/neon-setup.md",
1527
+ "category": "infrastructure",
1528
+ "subcategory": "neon",
1529
+ "tags": [
1530
+ "infrastructure",
1531
+ "neon",
1532
+ "postgresql"
1533
+ ],
1534
+ "stacks": [
1535
+ "neon"
1536
+ ],
1537
+ "aliases": [
1538
+ "Neon",
1539
+ "neonctl",
1540
+ "serverless postgres",
1541
+ "Neon CLI",
1542
+ "Neon setup"
1543
+ ],
1544
+ "anchors": {
1545
+ "setup": "#neon-cli-setup",
1546
+ "connection": "#connection-strings"
1547
+ },
1548
+ "digest": "Use neonctl CLI for project management and connection strings. Two connection strings: pooled (-pooler) for application code, direct for EF Core migrations. Configure connection retry for scale-to-zero cold starts. Use database branches for PR previews."
1549
+ },
1550
+ {
1551
+ "id": "infrastructure-neon-pgvector",
1552
+ "name": "neon pgvector",
1553
+ "path": "infrastructure/neon/neon-pgvector.md",
1554
+ "category": "infrastructure",
1555
+ "subcategory": "neon",
1556
+ "tags": [
1557
+ "infrastructure",
1558
+ "neon",
1559
+ "pgvector"
1560
+ ],
1561
+ "stacks": [
1562
+ "neon"
1563
+ ],
1564
+ "aliases": [
1565
+ "pgvector",
1566
+ "vector embeddings",
1567
+ "similarity search",
1568
+ "Neon vectors",
1569
+ "HNSW index"
1570
+ ],
1571
+ "anchors": {
1572
+ "setup": "#enable-pgvector",
1573
+ "queries": "#similarity-search"
1574
+ },
1575
+ "digest": "Enable: CREATE EXTENSION vector. Define column as vector(1536) for OpenAI embeddings. Create HNSW index with tuned maintenance_work_mem. Use direct SQL for similarity search. Batch insert embeddings (100 at a time). RLS policies apply to vector queries."
1576
+ },
1577
+ {
1578
+ "id": "infrastructure-neon-pgrag",
1579
+ "name": "neon pgrag",
1580
+ "path": "infrastructure/neon/neon-pgrag.md",
1581
+ "category": "infrastructure",
1582
+ "subcategory": "neon",
1583
+ "tags": [
1584
+ "infrastructure",
1585
+ "neon",
1586
+ "pgrag"
1587
+ ],
1588
+ "stacks": [
1589
+ "neon"
1590
+ ],
1591
+ "aliases": [
1592
+ "pgrag",
1593
+ "RAG in SQL",
1594
+ "embedding pipeline",
1595
+ "Neon RAG",
1596
+ "in-database RAG"
1597
+ ],
1598
+ "anchors": {
1599
+ "setup": "#install-pgrag",
1600
+ "pipeline": "#full-rag-pipeline-example"
1601
+ },
1602
+ "digest": "Use pgrag extensions (rag, rag_bge_small_en_v15, rag_jina_reranker_v1_tiny_en) for chunking, embedding, search, and reranking entirely in SQL. No external embedding service needed for basic RAG. Combine with pgvector HNSW indexes for production performance."
1603
+ },
1604
+ {
1605
+ "id": "integration-mcp-mcp-tools",
1606
+ "name": "mcp tools",
1607
+ "path": "integration/mcp/mcp-tools.md",
1608
+ "category": "integration",
1609
+ "subcategory": "mcp",
1610
+ "tags": [
1611
+ "integration",
1612
+ "mcp"
1613
+ ],
1614
+ "stacks": [
1615
+ "*"
1616
+ ],
1617
+ "aliases": [
1618
+ "MCP",
1619
+ "Model Context Protocol",
1620
+ "Claude tools",
1621
+ "MCP server",
1622
+ "MCP client"
1623
+ ],
1624
+ "anchors": {
1625
+ "tools": "#mcp-providers-by-phase",
1626
+ "setup": "#mcp-availability-detection"
1627
+ },
1628
+ "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."
1629
+ },
1630
+ {
1631
+ "id": "frontend-design-system-ai-image-generation",
1632
+ "name": "AI Image Generation",
1633
+ "path": "frontend/design-system/ai-image-generation.md",
1634
+ "category": "frontend",
1635
+ "subcategory": "design-system",
1636
+ "tags": [
1637
+ "image",
1638
+ "gemini",
1639
+ "asset",
1640
+ "ai-generation",
1641
+ "placeholder",
1642
+ "mcp"
1643
+ ],
1644
+ "stacks": [
1645
+ "nextjs"
1646
+ ],
1647
+ "aliases": [
1648
+ "Image Generation",
1649
+ "AI Assets",
1650
+ "Gemini Images"
1651
+ ],
1652
+ "anchors": {
1653
+ "when-to-use": "#when-to-use-ai-generated-images",
1654
+ "prompt-patterns": "#prompt-engineering-patterns",
1655
+ "aspect-ratios": "#aspect-ratio-guide",
1656
+ "assets-md": "#assetsmd-format",
1657
+ "edit-workflows": "#iterative-editing-workflows"
1658
+ },
1659
+ "digest": "Guidelines for generating project images with Gemini Image MCP — prompt patterns, aspect ratios, design-system-aware prompts, iterative editing, and assets.md format."
1660
+ }
1661
+ ],
1662
+ "sharedAliases": {
1663
+ "agent middleware": [
1664
+ "ai-agents-production",
1665
+ "ai-agents-middleware-patterns"
1666
+ ],
1667
+ "anti-hallucination": [
1668
+ "ai-agents-production",
1669
+ "ai-agents-middleware-patterns"
1670
+ ],
1671
+ "when not to use workflow": [
1672
+ "ai-agents-workflows",
1673
+ "ai-agents-sweet-spot"
1674
+ ],
1675
+ "rag": [
1676
+ "ai-agents-rag-custom-pgvector",
1677
+ "backend-database-vector-search-rag"
1678
+ ],
1679
+ "vector search": [
1680
+ "ai-agents-rag-custom-pgvector",
1681
+ "backend-database-vector-search-rag"
1682
+ ],
1683
+ "pgvector": [
1684
+ "ai-agents-rag-custom-pgvector",
1685
+ "backend-database-vector-search-rag",
1686
+ "infrastructure-neon-pgvector"
1687
+ ],
1688
+ "embeddings": [
1689
+ "ai-agents-rag-custom-pgvector",
1690
+ "backend-database-vector-search-rag"
1691
+ ],
1692
+ "semantic search": [
1693
+ "ai-agents-rag-custom-pgvector",
1694
+ "backend-database-vector-search-rag"
1695
+ ],
1696
+ "middleware": [
1697
+ "ai-agents-middleware-patterns",
1698
+ "frontend-nextjs-nextjs-patterns"
1699
+ ],
1700
+ "image generation": [
1701
+ "ai-agents-modalities-image-gen",
1702
+ "frontend-design-system-ai-image-generation"
1703
+ ],
1704
+ "mcp": [
1705
+ "ai-agents-mcp-tools",
1706
+ "integration-mcp-mcp-tools"
1707
+ ],
1708
+ "model context protocol": [
1709
+ "ai-agents-mcp-tools",
1710
+ "integration-mcp-mcp-tools"
1711
+ ],
1712
+ "mcp client": [
1713
+ "ai-agents-mcp-tools",
1714
+ "integration-mcp-mcp-tools"
1715
+ ],
1716
+ "mcp server": [
1717
+ "ai-agents-mcp-server",
1718
+ "integration-mcp-mcp-tools"
1719
+ ],
1720
+ "feature slice": [
1721
+ "architecture-vertical-slice-vertical-slice",
1722
+ "backend-dotnet-vsa-handler-patterns"
1723
+ ],
1724
+ "component naming": [
1725
+ "frontend-design-system-naming",
1726
+ "frontend-nextjs-naming-conventions"
1727
+ ]
1728
+ }
1729
+ }