@polymorphism-tech/morph-spec 7.0.0 → 7.1.1

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 (89) hide show
  1. package/README.md +368 -368
  2. package/claude-plugin.json +14 -14
  3. package/docs/CHEATSHEET.md +199 -199
  4. package/docs/QUICKSTART.md +200 -200
  5. package/framework/CLAUDE.md +1 -1
  6. package/framework/MORPH.md +4 -1
  7. package/framework/agents.json +132 -127
  8. package/framework/rubrics/backend.json +41 -36
  9. package/framework/rules/ai-agents-standards.md +45 -15
  10. package/framework/rules/neon-standards.md +25 -26
  11. package/framework/skills/core/morph-brainstorming/SKILL.md +1 -1
  12. package/framework/skills/core/morph-plan/SKILL.md +3 -1
  13. package/framework/skills/core/morph-stack-scan/SKILL.md +3 -3
  14. package/framework/standards/STANDARDS.json +1729 -1133
  15. package/framework/standards/ai-agents/agent-session.md +160 -0
  16. package/framework/standards/ai-agents/batching.md +193 -0
  17. package/framework/standards/ai-agents/context-providers.md +188 -0
  18. package/framework/standards/ai-agents/mcp-server.md +250 -0
  19. package/framework/standards/ai-agents/mcp-tools.md +197 -0
  20. package/framework/standards/ai-agents/middleware-patterns.md +207 -0
  21. package/framework/standards/ai-agents/modalities-image-gen.md +173 -0
  22. package/framework/standards/ai-agents/modalities-speech-to-text.md +171 -0
  23. package/framework/standards/ai-agents/modalities-text-to-speech.md +181 -0
  24. package/framework/standards/ai-agents/modalities-vision.md +201 -0
  25. package/framework/standards/ai-agents/multi-agent-patterns.md +155 -0
  26. package/framework/standards/ai-agents/production.md +114 -258
  27. package/framework/standards/ai-agents/prompts-in-db.md +214 -0
  28. package/framework/standards/ai-agents/providers/model-registry.md +158 -0
  29. package/framework/standards/ai-agents/rag-custom-pgvector.md +243 -0
  30. package/framework/standards/ai-agents/service-tier-flex.md +135 -0
  31. package/framework/standards/ai-agents/setup.md +142 -316
  32. package/framework/standards/ai-agents/structured-output.md +249 -0
  33. package/framework/standards/ai-agents/sweet-spot.md +109 -0
  34. package/framework/standards/ai-agents/workflows.md +114 -284
  35. package/framework/standards/architecture/vertical-slice/vertical-slice.md +439 -429
  36. package/framework/standards/backend/api/validation.md +92 -88
  37. package/framework/standards/backend/database/postgresql/database.md +336 -332
  38. package/framework/standards/backend/database/vector-search-rag.md +599 -541
  39. package/framework/standards/backend/dotnet/fluent-validation-vsa.md +4 -0
  40. package/framework/standards/backend/dotnet/result-pattern.md +4 -0
  41. package/framework/standards/backend/dotnet/scalar-ui.md +176 -172
  42. package/framework/standards/backend/dotnet/scrutor.md +4 -0
  43. package/framework/standards/backend/dotnet/vsa-handler-patterns.md +310 -274
  44. package/framework/standards/backend/integrations/asaas/asaas-api.md +260 -216
  45. package/framework/standards/backend/integrations/hangfire/hangfire-jobs.md +354 -350
  46. package/framework/standards/backend/integrations/neon-auth/neon-auth.md +30 -19
  47. package/framework/standards/backend/integrations/resend/resend-email.md +400 -385
  48. package/framework/standards/data/nosql/cache/redis.md +106 -97
  49. package/framework/standards/data/nosql/cosmos-db.md +127 -118
  50. package/framework/standards/data/vector-search/rag-chunking.md +113 -104
  51. package/framework/standards/frontend/design-system/ai-image-generation.md +4 -0
  52. package/framework/standards/frontend/design-system/animations.md +164 -160
  53. package/framework/standards/frontend/design-system/naming.md +68 -64
  54. package/framework/standards/frontend/gsap/gsap-core.md +14 -8
  55. package/framework/standards/frontend/gsap/gsap-plugins.md +26 -21
  56. package/framework/standards/frontend/gsap/gsap-scrolltrigger.md +9 -7
  57. package/framework/standards/frontend/nextjs/app-router.md +127 -123
  58. package/framework/standards/frontend/nextjs/components.md +136 -132
  59. package/framework/standards/frontend/nextjs/data-fetching.md +130 -126
  60. package/framework/standards/frontend/nextjs/forms.md +134 -128
  61. package/framework/standards/frontend/nextjs/motion-patterns.md +328 -322
  62. package/framework/standards/frontend/nextjs/naming-conventions.md +71 -67
  63. package/framework/standards/frontend/nextjs/nextjs-patterns.md +229 -225
  64. package/framework/standards/frontend/nextjs/project-structure.md +106 -102
  65. package/framework/standards/frontend/nextjs/state-management.md +76 -72
  66. package/framework/standards/frontend/nextjs/testing.md +115 -111
  67. package/framework/standards/infrastructure/docker/easypanel-deploy.md +196 -192
  68. package/framework/standards/infrastructure/neon/neon-pgrag.md +6 -2
  69. package/framework/standards/infrastructure/neon/neon-pgvector.md +4 -0
  70. package/framework/standards/infrastructure/neon/neon-setup.md +5 -1
  71. package/framework/standards/integration/mcp/mcp-tools.md +471 -462
  72. package/framework/templates/CLAUDE.md.core.template +1 -1
  73. package/framework/templates/REGISTRY.json +1745 -1239
  74. package/framework/templates/code/dotnet/ai-agents/AgentBootstrap.cs.template +39 -0
  75. package/framework/templates/code/dotnet/ai-agents/EmbeddingService.cs.template +68 -0
  76. package/framework/templates/code/dotnet/ai-agents/ModelRegistry.cs.template +117 -0
  77. package/framework/templates/code/dotnet/ai-agents/PromptRepository.cs.template +95 -0
  78. package/framework/templates/code/dotnet/ai-agents/ResilientToolMiddleware.cs.template +61 -0
  79. package/framework/templates/code/dotnet/ai-agents/VectorSearchTool.cs.template +107 -0
  80. package/framework/templates/code/dotnet/ai-agents/model-registry.json.template +58 -0
  81. package/framework/templates/code/dotnet/backend/repository.cs +3 -10
  82. package/framework/templates/code/sql/ai-agents/agent-prompts-migration.sql.template +58 -0
  83. package/framework/templates/code/sql/ai-agents/pgvector-embeddings-migration.sql.template +91 -0
  84. package/package.json +89 -83
  85. package/src/core/templates/template-registry.js +289 -256
  86. package/src/lib/generators/context-generator.js +516 -518
  87. package/src/lib/generators/scaffold-generator.js +23 -26
  88. package/framework/standards/infrastructure/neon/neon-semantic-kernel.md +0 -310
  89. package/framework/templates/integrations/semantic-kernel-neon.cs +0 -125
@@ -1,127 +1,132 @@
1
- {
2
- "version": "5.0.0",
3
- "schema": "domain-personas",
4
- "total_agents": 7,
5
- "description": "Domain personas dispatched per task by the morph-implement skill. The 3 roles (Orchestrator/Specialist/Evaluator) are assumed by Claude itself per MORPH.md — these are domain personas the Specialist consults when working in a specific area.",
6
- "agents": {
7
- "dotnet-senior": {
8
- "title": ".NET Senior Engineer",
9
- "icon": "🔷",
10
- "color": "blue",
11
- "domains": ["backend", "backend-api", "architecture"],
12
- "keywords": [
13
- "backend", "api", "dotnet", ".net", "csharp", "c#",
14
- "minimal api", "vertical slice", "vsa", "result pattern",
15
- "feature slice", "endpoint", "handler", "validator"
16
- ],
17
- "stack": ["dotnet"],
18
- "standards": [
19
- "architecture-vertical-slice-vertical-slice",
20
- "backend-dotnet-result-pattern",
21
- "backend-dotnet-vsa-handler-patterns",
22
- "backend-dotnet-fluent-validation-vsa"
23
- ],
24
- "persona": "Você é um engenheiro .NET sênior. Pensa em VSA com handlers diretos, result pattern, sealed classes, Guid.CreateVersion7(). Não usa Repository pattern, não usa exceptions como fluxo. Consulta o standard antes de escrever cada slice. Nomeia tudo em PascalCase para tipos, camelCase para parâmetros."
25
- },
26
- "ef-modeler": {
27
- "title": "EF Core / Database Modeler",
28
- "icon": "🗄️",
29
- "color": "cyan",
30
- "domains": ["database", "data-modeling", "migrations"],
31
- "keywords": [
32
- "ef core", "entity framework", "neon", "postgres", "postgresql",
33
- "migration", "dbcontext", "navigation property", "configuration"
34
- ],
35
- "stack": ["dotnet"],
36
- "standards": [
37
- "backend-database-postgresql-database",
38
- "infrastructure-neon-setup",
39
- "infrastructure-neon-pgvector"
40
- ],
41
- "persona": "Você é um especialista em EF Core sobre Neon (Postgres). Pensa em migrations explícitas, configurações fluentes, navigation properties bem nomeadas, índices intencionais. Sempre Guid.CreateVersion7() para PKs. Sealed entities. Nunca leak de DbContext fora do handler."
42
- },
43
- "maf-expert": {
44
- "title": "Microsoft Agent Framework Expert",
45
- "icon": "🤖",
46
- "color": "purple",
47
- "domains": ["ai-agents", "ai-orchestration"],
48
- "keywords": [
49
- "agent", "ai agent", "maf", "microsoft agent framework",
50
- "tool", "tool calling", "rag", "vector search", "llm",
51
- "orchestration", "multi-agent"
52
- ],
53
- "stack": ["dotnet"],
54
- "standards": [
55
- "ai-agents-setup",
56
- "ai-agents-workflows",
57
- "ai-agents-production"
58
- ],
59
- "persona": "Você é especialista no Microsoft Agent Framework. Pensa em agentes como serviços com responsabilidade única, ferramentas tipadas, prompts versionados, telemetria de cada chamada. RAG com vector search, MCP quando aplicável. Não inventa orquestração quando MAF já oferece."
60
- },
61
- "nextjs-expert": {
62
- "title": "Next.js / React Expert",
63
- "icon": "⚛️",
64
- "color": "green",
65
- "domains": ["frontend", "ui", "react", "nextjs"],
66
- "keywords": [
67
- "nextjs", "next.js", "react", "app router", "server component",
68
- "client component", "tailwind", "framer motion", "shadcn"
69
- ],
70
- "stack": ["nextjs"],
71
- "standards": [
72
- "frontend-nextjs-app-router",
73
- "frontend-nextjs-components",
74
- "frontend-nextjs-data-fetching",
75
- "frontend-nextjs-naming-conventions",
76
- "frontend-nextjs-state-management"
77
- ],
78
- "persona": "Você escreve Next.js App Router idiomático. Server Components por padrão, Client Components apenas quando há interatividade real. Tailwind + Shadcn + Framer Motion. Tipos via Zod. Nada de getServerSideProps. RSC streaming quando faz sentido."
79
- },
80
- "ui-designer": {
81
- "title": "UI/UX Designer",
82
- "icon": "🎨",
83
- "color": "magenta",
84
- "domains": ["ui", "ux", "design-system", "accessibility"],
85
- "keywords": [
86
- "design", "ui", "ux", "design system", "tokens", "wcag",
87
- "accessibility", "mockup", "flow", "shadcn", "tailwind"
88
- ],
89
- "stack": ["nextjs"],
90
- "standards": [
91
- "frontend-design-system-naming",
92
- "frontend-design-system-animations",
93
- "frontend-nextjs-motion-patterns"
94
- ],
95
- "persona": "Você desenha sistemas, não telas isoladas. Pensa em tokens (cor, espaço, tipografia), componentes reutilizáveis, estados (default/hover/focus/disabled/loading/error), acessibilidade WCAG AA. Mockups em Tailwind direto, sem Figma intermediário."
96
- },
97
- "infra-engineer": {
98
- "title": "Infrastructure / Jobs Engineer",
99
- "icon": "⚙️",
100
- "color": "yellow",
101
- "domains": ["infrastructure", "jobs", "deployment", "observability"],
102
- "keywords": [
103
- "hangfire", "background job", "queue", "deployment",
104
- "docker", "ci/cd", "telemetry", "logging", "monitoring"
105
- ],
106
- "stack": ["dotnet"],
107
- "standards": [
108
- "backend-integrations-hangfire-hangfire-jobs",
109
- "infrastructure-docker-easypanel-deploy",
110
- "backend-dotnet-scrutor"
111
- ],
112
- "persona": "Você cuida de infra: jobs assíncronos com Hangfire (apenas quando há razão real), deployment, observabilidade. Pensa em retry, idempotência, dead-letter, métricas. Não inventa infra — usa o que o stack já oferece."
113
- },
114
- "evaluator": {
115
- "title": "Code & Architecture Evaluator",
116
- "icon": "🔍",
117
- "color": "red",
118
- "domains": ["evaluation", "review", "quality"],
119
- "keywords": [
120
- "review", "eval", "score", "rubric", "audit", "quality"
121
- ],
122
- "stack": ["*"],
123
- "standards": [],
124
- "persona": "Você aplica as rubricas em framework/evals/rubrics/. Não reescreve código — produz scores 0-10 por dimensão (architecture, contracts, code-quality, test-coverage), feedback priorizado, e ação clara (aprovado/feedback/escalar). Silêncio em scores ≥ 8 é o sinal correto."
125
- }
126
- }
127
- }
1
+ {
2
+ "version": "5.0.0",
3
+ "schema": "domain-personas",
4
+ "total_agents": 7,
5
+ "description": "Domain personas dispatched per task by the morph-implement skill. The 3 roles (Orchestrator/Specialist/Evaluator) are assumed by Claude itself per MORPH.md — these are domain personas the Specialist consults when working in a specific area.",
6
+ "agents": {
7
+ "dotnet-senior": {
8
+ "title": ".NET Senior Engineer",
9
+ "icon": "🔷",
10
+ "color": "blue",
11
+ "domains": ["backend", "backend-api", "architecture"],
12
+ "keywords": [
13
+ "backend", "api", "dotnet", ".net", "csharp", "c#",
14
+ "minimal api", "vertical slice", "vsa", "result pattern",
15
+ "feature slice", "endpoint", "handler", "validator"
16
+ ],
17
+ "stack": ["dotnet"],
18
+ "standards": [
19
+ "architecture-vertical-slice-vertical-slice",
20
+ "backend-dotnet-result-pattern",
21
+ "backend-dotnet-vsa-handler-patterns",
22
+ "backend-dotnet-fluent-validation-vsa"
23
+ ],
24
+ "persona": "Você é um engenheiro .NET sênior. Pensa em VSA com handlers diretos, result pattern, sealed classes, Guid.CreateVersion7(). Acesso a dados híbrido: IRepository<T> + IUnitOfWork para CRUD, DbContext direto no slice para queries específicas; nunca uma camada de Service/Manager. Não usa exceptions como fluxo. Consulta o standard antes de escrever cada slice. Nomeia tudo em PascalCase para tipos, camelCase para parâmetros."
25
+ },
26
+ "ef-modeler": {
27
+ "title": "EF Core / Database Modeler",
28
+ "icon": "🗄️",
29
+ "color": "cyan",
30
+ "domains": ["database", "data-modeling", "migrations"],
31
+ "keywords": [
32
+ "ef core", "entity framework", "neon", "postgres", "postgresql",
33
+ "migration", "dbcontext", "navigation property", "configuration"
34
+ ],
35
+ "stack": ["dotnet"],
36
+ "standards": [
37
+ "backend-database-postgresql-database",
38
+ "infrastructure-neon-setup",
39
+ "infrastructure-neon-pgvector"
40
+ ],
41
+ "persona": "Você é um especialista em EF Core sobre Neon (Postgres). Pensa em migrations explícitas, configurações fluentes, navigation properties bem nomeadas, índices intencionais. Sempre Guid.CreateVersion7() para PKs. Sealed entities. Nunca leak de DbContext fora do handler."
42
+ },
43
+ "maf-expert": {
44
+ "title": "Microsoft Agent Framework Expert",
45
+ "icon": "🤖",
46
+ "color": "purple",
47
+ "domains": ["ai-agents", "ai-orchestration"],
48
+ "keywords": [
49
+ "agent", "ai agent", "maf", "microsoft agent framework",
50
+ "tool", "tool calling", "rag", "vector search", "llm",
51
+ "orchestration", "multi-agent"
52
+ ],
53
+ "stack": ["dotnet"],
54
+ "standards": [
55
+ "ai-agents-setup",
56
+ "ai-agents-sweet-spot",
57
+ "ai-agents-providers-model-registry",
58
+ "ai-agents-structured-output",
59
+ "ai-agents-prompts-in-db",
60
+ "ai-agents-rag-custom-pgvector",
61
+ "ai-agents-middleware-patterns",
62
+ "ai-agents-multi-agent-patterns"
63
+ ],
64
+ "persona": "Você é especialista no Microsoft Agent Framework (MAF 1.0 GA). Aplica a regra do sweet-spot: single-agent + structured output + tools + RAG custom resolvem 95%. Refere alias do Model Registry, nunca model hardcoded. Provider-agnostic, direct models sempre (OpenAI/Google/Anthropic/Ollama) — nunca hosted agent service. Não usa Semantic Kernel nem Workflows como default — só quando fan-in/out genuíno aparece. Telemetria via AgentOpenTelemetryConsts.DefaultSourceName."
65
+ },
66
+ "nextjs-expert": {
67
+ "title": "Next.js / React Expert",
68
+ "icon": "⚛️",
69
+ "color": "green",
70
+ "domains": ["frontend", "ui", "react", "nextjs"],
71
+ "keywords": [
72
+ "nextjs", "next.js", "react", "app router", "server component",
73
+ "client component", "tailwind", "framer motion", "shadcn"
74
+ ],
75
+ "stack": ["nextjs"],
76
+ "standards": [
77
+ "frontend-nextjs-app-router",
78
+ "frontend-nextjs-components",
79
+ "frontend-nextjs-data-fetching",
80
+ "frontend-nextjs-naming-conventions",
81
+ "frontend-nextjs-state-management"
82
+ ],
83
+ "persona": "Você escreve Next.js App Router idiomático. Server Components por padrão, Client Components apenas quando há interatividade real. Tailwind + Shadcn + Framer Motion. Tipos via Zod. Nada de getServerSideProps. RSC streaming quando faz sentido."
84
+ },
85
+ "ui-designer": {
86
+ "title": "UI/UX Designer",
87
+ "icon": "🎨",
88
+ "color": "magenta",
89
+ "domains": ["ui", "ux", "design-system", "accessibility"],
90
+ "keywords": [
91
+ "design", "ui", "ux", "design system", "tokens", "wcag",
92
+ "accessibility", "mockup", "flow", "shadcn", "tailwind"
93
+ ],
94
+ "stack": ["nextjs"],
95
+ "standards": [
96
+ "frontend-design-system-naming",
97
+ "frontend-design-system-animations",
98
+ "frontend-nextjs-motion-patterns"
99
+ ],
100
+ "persona": "Você desenha sistemas, não telas isoladas. Pensa em tokens (cor, espaço, tipografia), componentes reutilizáveis, estados (default/hover/focus/disabled/loading/error), acessibilidade WCAG AA. Mockups em Tailwind direto, sem Figma intermediário."
101
+ },
102
+ "infra-engineer": {
103
+ "title": "Infrastructure / Jobs Engineer",
104
+ "icon": "⚙️",
105
+ "color": "yellow",
106
+ "domains": ["infrastructure", "jobs", "deployment", "observability"],
107
+ "keywords": [
108
+ "hangfire", "background job", "queue", "deployment",
109
+ "docker", "ci/cd", "telemetry", "logging", "monitoring"
110
+ ],
111
+ "stack": ["dotnet"],
112
+ "standards": [
113
+ "backend-integrations-hangfire-hangfire-jobs",
114
+ "infrastructure-docker-easypanel-deploy",
115
+ "backend-dotnet-scrutor"
116
+ ],
117
+ "persona": "Você cuida de infra: jobs assíncronos com Hangfire (apenas quando há razão real), deployment, observabilidade. Pensa em retry, idempotência, dead-letter, métricas. Não inventa infra — usa o que o stack já oferece."
118
+ },
119
+ "evaluator": {
120
+ "title": "Code & Architecture Evaluator",
121
+ "icon": "🔍",
122
+ "color": "red",
123
+ "domains": ["evaluation", "review", "quality"],
124
+ "keywords": [
125
+ "review", "eval", "score", "rubric", "audit", "quality"
126
+ ],
127
+ "stack": ["*"],
128
+ "standards": [],
129
+ "persona": "Você aplica as rubricas em framework/evals/rubrics/. Não reescreve código — produz scores 0-10 por dimensão (architecture, contracts, code-quality, test-coverage), feedback priorizado, e ação clara (aprovado/feedback/escalar). Silêncio em scores ≥ 8 é o sinal correto."
130
+ }
131
+ }
132
+ }
@@ -1,36 +1,41 @@
1
- {
2
- "id": "backend",
3
- "version": "1.0.0",
4
- "description": "Backend-focused rubric. Higher weight on architecture, security, and package health.",
5
- "categories": {
6
- "functionality": {
7
- "weight": 0.30,
8
- "validators": ["contract-compliance"],
9
- "description": "Core feature correctness and contract compliance"
10
- },
11
- "code_quality": {
12
- "weight": 0.30,
13
- "validators": ["architecture"],
14
- "description": "Architecture patterns, dependency direction, and code structure"
15
- },
16
- "design_ui": {
17
- "weight": 0.05,
18
- "validators": ["design-system", "css", "contrast", "nextjs-component"],
19
- "description": "Design system compliance (minimal weight for backend projects)"
20
- },
21
- "security": {
22
- "weight": 0.15,
23
- "validators": [],
24
- "description": "Security posture (agent-evaluated, no automated validator)"
25
- },
26
- "packages": {
27
- "weight": 0.20,
28
- "validators": ["packages"],
29
- "description": "Dependency health, version compatibility, and deprecated packages"
30
- }
31
- },
32
- "thresholds": {
33
- "approve": 8.0,
34
- "retry": 6.0
35
- }
36
- }
1
+ {
2
+ "id": "backend",
3
+ "version": "1.0.0",
4
+ "description": "Backend-focused rubric. Higher weight on architecture, security, and package health.",
5
+ "categories": {
6
+ "functionality": {
7
+ "weight": 0.25,
8
+ "validators": ["contract-compliance"],
9
+ "description": "Core feature correctness and contract compliance"
10
+ },
11
+ "code_quality": {
12
+ "weight": 0.25,
13
+ "validators": ["architecture"],
14
+ "description": "Architecture patterns, dependency direction, and code structure"
15
+ },
16
+ "design_ui": {
17
+ "weight": 0.05,
18
+ "validators": ["design-system", "css", "contrast", "nextjs-component"],
19
+ "description": "Design system compliance (minimal weight for backend projects)"
20
+ },
21
+ "security": {
22
+ "weight": 0.15,
23
+ "validators": [],
24
+ "description": "Security posture (agent-evaluated, no automated validator)"
25
+ },
26
+ "packages": {
27
+ "weight": 0.20,
28
+ "validators": ["packages"],
29
+ "description": "Dependency health, version compatibility, and deprecated packages"
30
+ },
31
+ "maf_compliance": {
32
+ "weight": 0.10,
33
+ "validators": [],
34
+ "description": "MAF agent compliance (agent-evaluated, applies only when the feature touches AI agents): Microsoft.Agents.AI GA packages used; Model Registry alias referenced not hardcoded models; structured output for pipelined agents; prompts from DB not hardcoded; no Semantic Kernel; no hosted agent services."
35
+ }
36
+ },
37
+ "thresholds": {
38
+ "approve": 8.0,
39
+ "retry": 6.0
40
+ }
41
+ }
@@ -1,15 +1,45 @@
1
- ---
2
- paths:
3
- - "**/Agents/**"
4
- - "**/agents/**"
5
- - "**/*Agent*.cs"
6
- stacks:
7
- - dotnet
8
- ---
9
-
10
- # Microsoft Agent Framework Standards
11
-
12
- @.morph/framework/standards/ai-agents/setup.md
13
- @.morph/framework/standards/ai-agents/workflows.md
14
- @.morph/framework/standards/ai-agents/production.md
15
- @.morph/framework/standards/integration/mcp/mcp-tools.md
1
+ ---
2
+ paths:
3
+ - "**/Agents/**"
4
+ - "**/agents/**"
5
+ - "**/*Agent*.cs"
6
+ stacks:
7
+ - dotnet
8
+ ---
9
+
10
+ # Microsoft Agent Framework Standards
11
+
12
+ > **Layer 0/1 — auto-carregados.** São os standards core: aplicam-se a praticamente todo
13
+ > agente MAF. Carregue-os sempre que tocar código de agentes.
14
+
15
+ @.morph/framework/standards/ai-agents/setup.md
16
+ @.morph/framework/standards/ai-agents/sweet-spot.md
17
+ @.morph/framework/standards/ai-agents/providers/model-registry.md
18
+ @.morph/framework/standards/ai-agents/structured-output.md
19
+ @.morph/framework/standards/ai-agents/multi-agent-patterns.md
20
+ @.morph/framework/standards/ai-agents/prompts-in-db.md
21
+ @.morph/framework/standards/ai-agents/rag-custom-pgvector.md
22
+ @.morph/framework/standards/ai-agents/middleware-patterns.md
23
+ @.morph/framework/standards/ai-agents/workflows.md
24
+ @.morph/framework/standards/ai-agents/production.md
25
+
26
+ ---
27
+
28
+ > **Layer 2 — sob demanda (NÃO auto-carregados).** São standards de modalidade, otimização e
29
+ > MCP: relevantes apenas quando a feature usa especificamente esse recurso. Carregue via
30
+ > `morph-standards` quando uma keyword corresponder — manter fora do auto-load preserva o
31
+ > context window para o trabalho que importa.
32
+
33
+ | Standard | Carregue quando a feature envolve |
34
+ |----------|-----------------------------------|
35
+ | `ai-agents/modalities-vision.md` | imagem → texto (OCR, análise de documento, visão) |
36
+ | `ai-agents/modalities-image-gen.md` | texto → imagem (geração de mockups, posts, assets) |
37
+ | `ai-agents/modalities-speech-to-text.md` | áudio → texto (transcrição, legendagem) |
38
+ | `ai-agents/modalities-text-to-speech.md` | texto → áudio (síntese de voz) |
39
+ | `ai-agents/batching.md` | processar N prompts independentes em lote (Batch API) |
40
+ | `ai-agents/service-tier-flex.md` | otimização de custo em jobs assíncronos (tier flex) |
41
+ | `ai-agents/agent-session.md` | agentes conversacionais com histórico/reducers |
42
+ | `ai-agents/context-providers.md` | injeção dinâmica de contexto (`AIContextProvider`) |
43
+ | `ai-agents/mcp-tools.md` | agente MAF consome um MCP server externo |
44
+ | `ai-agents/mcp-server.md` | projeto expõe capacidades como MCP server |
45
+ | `integration/mcp/mcp-tools.md` | integração MCP cross-domain (fora do escopo MAF) |
@@ -1,26 +1,25 @@
1
- ---
2
- paths:
3
- - "**/neon/**"
4
- - "**/database/**"
5
- - "**/*Migration*.sql"
6
- - "**/*migration*.sql"
7
- stacks:
8
- - neon
9
- ---
10
-
11
- # Neon PostgreSQL Standards
12
-
13
- @.morph/framework/standards/infrastructure/neon/neon-setup.md
14
- @.morph/framework/standards/infrastructure/neon/neon-pgvector.md
15
- @.morph/framework/standards/infrastructure/neon/neon-pgrag.md
16
- @.morph/framework/standards/infrastructure/neon/neon-semantic-kernel.md
17
- @.morph/framework/standards/backend/integrations/neon-auth/neon-auth.md
18
-
19
- ## SQL Templates
20
-
21
- | Template | Path | Purpose |
22
- |----------|------|---------|
23
- | PostgreSQL Migration | `.morph/framework/templates/code/sql/postgresql-migration.sql` | Database migration |
24
- | PostgreSQL RLS Policy | `.morph/framework/templates/code/sql/postgresql-rls-policy.sql` | Row-level security |
25
-
26
- Read the template and adapt to your project structure.
1
+ ---
2
+ paths:
3
+ - "**/neon/**"
4
+ - "**/database/**"
5
+ - "**/*Migration*.sql"
6
+ - "**/*migration*.sql"
7
+ stacks:
8
+ - neon
9
+ ---
10
+
11
+ # Neon PostgreSQL Standards
12
+
13
+ @.morph/framework/standards/infrastructure/neon/neon-setup.md
14
+ @.morph/framework/standards/infrastructure/neon/neon-pgvector.md
15
+ @.morph/framework/standards/infrastructure/neon/neon-pgrag.md
16
+ @.morph/framework/standards/backend/integrations/neon-auth/neon-auth.md
17
+
18
+ ## SQL Templates
19
+
20
+ | Template | Path | Purpose |
21
+ |----------|------|---------|
22
+ | PostgreSQL Migration | `.morph/framework/templates/code/sql/postgresql-migration.sql` | Database migration |
23
+ | PostgreSQL RLS Policy | `.morph/framework/templates/code/sql/postgresql-rls-policy.sql` | Row-level security |
24
+
25
+ Read the template and adapt to your project structure.
@@ -26,7 +26,7 @@ O harness conhece o stack por padrão. Não pergunte sobre tecnologia a menos qu
26
26
  | Frontend | Next.js App Router + Tailwind + Framer Motion + Shadcn |
27
27
  | Jobs async | Hangfire — apenas se a feature requer processamento em background |
28
28
 
29
- **Padrões proibidos:** `Guid.NewGuid()`, classes não-sealed sem justificativa, exceptions sem result pattern, Repository pattern (VSA usa handlers diretos).
29
+ **Padrões proibidos:** `Guid.NewGuid()`, classes não-sealed sem justificativa, exceptions sem result pattern, camada de Service/Manager entre handler e dados, SQL cru sem justificativa. Acesso a dados em VSA é híbrido: `IRepository<T>` + `IUnitOfWork` para CRUD; `DbContext` direto no slice para queries específicas.
30
30
 
31
31
  ## O que fazer
32
32
 
@@ -33,7 +33,9 @@ Ao iniciar a fase plan — após o `proposal.md` ser aprovado e antes de qualque
33
33
  - `Guid.NewGuid()` → usar `Guid.CreateVersion7()`
34
34
  - Classes não-sealed sem justificativa documentada
35
35
  - Exceptions como fluxo de controle → usar result pattern com `result.Match()`
36
- - Repository pattern / `IRepository<T>` → handlers VSA acessam DbContext diretamente
36
+ - Camada de Service/Manager entre handler e dados → handler usa `IRepository<T>` ou `DbContext` direto
37
+ - SQL cru (`FromSqlRaw`, `ExecuteQuery(string)`) sem justificativa em `decisions.md` → usar LINQ
38
+ - Política de acesso a dados (registre no mandate como orientação, não proibição): `IRepository<T>` + `IUnitOfWork` para CRUD simples; `ApplicationDbContext` injetado direto no slice para queries específicas (joins, projeção, paginação).
37
39
  - Checklist de done com critérios verificáveis por tarefa.
38
40
 
39
41
  4. Produza `tasks.json` em `.morph/features/{feature}/2-plan/` seguindo o schema em `.morph/framework/schemas/tasks.schema.json`.
@@ -28,7 +28,7 @@ Quando o projeto já tem código existente e você precisa entender o estado atu
28
28
  | Frontend | Next.js App Router + Tailwind + Framer Motion + Shadcn |
29
29
  | Jobs | Hangfire (apenas quando necessário) |
30
30
 
31
- **Padrões proibidos:** `Guid.NewGuid()`, classes não-sealed sem justificativa, exceptions como fluxo de controle, Repository pattern, `IRepository<T>`.
31
+ **Padrões proibidos:** `Guid.NewGuid()`, classes não-sealed sem justificativa, exceptions como fluxo de controle, camada de Service/Manager entre handler e dados, SQL cru sem justificativa. Acesso a dados em VSA é híbrido: `IRepository<T>` + `IUnitOfWork` para CRUD; `DbContext` direto no slice para queries específicas.
32
32
 
33
33
  ## Greenfield short-circuit
34
34
 
@@ -61,7 +61,7 @@ Antes de despachar Explore, verifique se o projeto é greenfield:
61
61
  - Erros: Result pattern (`result.Match()`)
62
62
 
63
63
  ## Padrões proibidos
64
- `Guid.NewGuid()`, classes não-sealed sem justificativa, exceptions como fluxo de controle, Repository pattern, `IRepository<T>`.
64
+ `Guid.NewGuid()`, classes não-sealed sem justificativa, exceptions como fluxo de controle, camada de Service/Manager entre handler e dados, SQL cru sem justificativa. Acesso a dados em VSA é híbrido: `IRepository<T>` + `IUnitOfWork` para CRUD; `DbContext` direto no slice para queries específicas.
65
65
 
66
66
  ## Recomendação
67
67
  Compliance trivial (greenfield). Prosseguir para morph-brainstorming.
@@ -101,7 +101,7 @@ Antes de despachar Explore, verifique se o projeto é greenfield:
101
101
  | Severidade | Critério |
102
102
  |------------|---------|
103
103
  | **Bloqueante** | Runtime diferente (.NET 8 ou anterior), ORM diferente (Dapper puro sem EF Core), banco diferente (MySQL, SQL Server) |
104
- | **Alto** | `Guid.NewGuid()` generalizado, Repository pattern em toda a codebase, exceptions como fluxo de controle |
104
+ | **Alto** | `Guid.NewGuid()` generalizado, camada de Service/Manager entre handler e dados, SQL cru generalizado, exceptions como fluxo de controle |
105
105
  | **Médio** | Classes não-sealed, Pages Router em vez de App Router, biblioteca de UI diferente |
106
106
  | **Baixo** | Versões de pacotes desatualizadas mas compatíveis |
107
107