@polymorphism-tech/morph-spec 4.15.0 → 4.17.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.
- package/README.md +2 -2
- package/bin/morph-spec.js +4 -0
- package/bin/task-manager.js +999 -962
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/agents/ai-agents/vector-search-expert.md +247 -233
- package/framework/agents/backend/ms-agent-expert.md +2 -1
- package/framework/agents/backend/neon-expert.md +397 -0
- package/framework/agents/frontend/gsap-animator.md +131 -0
- package/framework/agents.json +1175 -1077
- package/framework/commands/morph-preflight.md +200 -192
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +1 -1
- package/framework/rules/gsap-standards.md +13 -0
- package/framework/rules/neon-standards.md +25 -0
- package/framework/skills/level-0-meta/mcp-registry.json +1 -1
- package/framework/skills/level-0-meta/morph-agent-teams/SKILL.md +472 -472
- package/framework/skills/level-0-meta/morph-init/SKILL.md +30 -11
- package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +5 -5
- package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +5 -5
- package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +7 -7
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +24 -24
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +12 -12
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +9 -9
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +1 -1
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +1 -1
- package/framework/skills/level-1-workflows/morph-phase-tasks/references/task-planning-patterns.md +143 -143
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +1 -1
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +1 -1
- package/framework/standards/STANDARDS.json +184 -107
- package/framework/standards/ai-agents/production.md +1 -0
- package/framework/standards/ai-agents/setup.md +3 -2
- package/framework/standards/ai-agents/workflows.md +1 -0
- package/framework/standards/architecture/vertical-slice/vertical-slice.md +4 -4
- package/framework/standards/backend/database/postgresql/database.md +58 -78
- package/framework/standards/backend/dotnet/scalar-ui.md +172 -172
- package/framework/standards/backend/dotnet/vsa-handler-patterns.md +274 -274
- package/framework/standards/backend/integrations/asaas/asaas-api.md +1 -1
- package/framework/standards/backend/integrations/clerk/clerk-auth.md +23 -21
- package/framework/standards/frontend/design-system/animations.md +9 -0
- package/framework/standards/frontend/gsap/gsap-core.md +463 -0
- package/framework/standards/frontend/gsap/gsap-plugins.md +294 -0
- package/framework/standards/frontend/gsap/gsap-scrolltrigger.md +318 -0
- package/framework/standards/frontend/nextjs/motion-patterns.md +1 -0
- package/framework/standards/frontend/nextjs/nextjs-patterns.md +47 -37
- package/framework/standards/infrastructure/docker/easypanel-deploy.md +4 -8
- package/framework/standards/infrastructure/neon/neon-pgrag.md +239 -0
- package/framework/standards/infrastructure/neon/neon-pgvector.md +236 -0
- package/framework/standards/infrastructure/neon/neon-semantic-kernel.md +310 -0
- package/framework/standards/infrastructure/neon/neon-setup.md +186 -0
- package/framework/standards/integration/mcp/mcp-tools.md +32 -34
- package/framework/templates/README.md +18 -18
- package/framework/templates/REGISTRY.json +49 -96
- package/framework/templates/code/dotnet/abstractions/api-endpoint.cs +7 -7
- package/framework/templates/code/dotnet/backend/repository.cs +148 -148
- package/framework/templates/code/dotnet/contracts/contracts-vsa.cs +2 -2
- package/framework/templates/code/dotnet/database/vector-entity.cs +93 -0
- package/framework/templates/code/dotnet/feature/endpoint.cs.hbs +1 -1
- package/framework/templates/code/sql/{supabase-migration.sql → postgresql-migration.sql} +8 -17
- package/framework/templates/code/sql/{supabase-migration.template.sql → postgresql-migration.template.sql} +10 -13
- package/framework/templates/code/sql/{rls-policy.sql → postgresql-rls-policy.sql} +8 -8
- package/framework/templates/code/typescript/contracts.ts +167 -168
- package/framework/templates/context/CONTEXT.md +3 -3
- package/framework/templates/docs/proposal.md +6 -6
- package/framework/templates/docs/ui-components.md +1 -1
- package/framework/templates/feature/decisions.md +121 -121
- package/framework/templates/feature/recap.md +145 -145
- package/framework/templates/feature/tasks.md +199 -199
- package/framework/templates/frontend/nextjs/gsap-scroll-section.tsx.hbs +44 -0
- package/framework/templates/infrastructure/docker/docker-compose.template.yml +50 -67
- package/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +38 -38
- package/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +48 -48
- package/framework/templates/infrastructure/docker/easypanel.template.json +46 -54
- package/framework/templates/infrastructure/github/README.md +56 -56
- package/framework/templates/integrations/semantic-kernel-neon.cs +125 -0
- package/framework/workflows/README.md +1 -1
- package/framework/workflows/docs/full-morph.md +69 -69
- package/package.json +1 -1
- package/src/commands/agents/dispatch-agents.js +19 -15
- package/src/commands/project/setup-infra-cmd.js +1 -1
- package/src/commands/state/advance-phase.js +5 -0
- package/src/commands/tasks/task.js +3 -0
- package/src/core/state/state-manager.js +45 -1
- package/src/core/templates/template-registry.js +1 -66
- package/src/lib/detectors/index.js +2 -2
- package/src/lib/generators/architecture-scanner.js +640 -640
- package/src/lib/installers/mcp-installer.js +1 -1
- package/src/lib/tasks/task-classifier.js +15 -1
- package/src/lib/tasks/test-runner.js +5 -1
- package/src/lib/validators/content/content-validator.js +9 -10
- package/src/lib/validators/validation-runner.js +7 -5
- package/src/scripts/setup-infra.js +60 -30
- package/framework/agents/backend/supabase-expert.md +0 -256
- package/framework/rules/supabase-standards.md +0 -29
- package/framework/standards/infrastructure/supabase/mcp-setup.md +0 -142
- package/framework/standards/infrastructure/supabase/supabase-auth.md +0 -176
- package/framework/standards/infrastructure/supabase/supabase-custom-jwt.md +0 -206
- package/framework/standards/infrastructure/supabase/supabase-pgvector.md +0 -169
- package/framework/standards/infrastructure/supabase/supabase-rls.md +0 -184
- package/framework/standards/infrastructure/supabase/supabase-storage.md +0 -153
|
@@ -183,7 +183,8 @@
|
|
|
183
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
184
|
"stacks": [
|
|
185
185
|
"dotnet-vsa",
|
|
186
|
-
"
|
|
186
|
+
"dotnet-vsa",
|
|
187
|
+
"nextjs-neon"
|
|
187
188
|
]
|
|
188
189
|
},
|
|
189
190
|
{
|
|
@@ -572,6 +573,132 @@
|
|
|
572
573
|
"*"
|
|
573
574
|
]
|
|
574
575
|
},
|
|
576
|
+
{
|
|
577
|
+
"id": "frontend-nextjs-motion-patterns",
|
|
578
|
+
"name": "motion patterns",
|
|
579
|
+
"path": "frontend/nextjs/motion-patterns.md",
|
|
580
|
+
"category": "frontend",
|
|
581
|
+
"subcategory": "nextjs",
|
|
582
|
+
"tags": [
|
|
583
|
+
"frontend",
|
|
584
|
+
"nextjs",
|
|
585
|
+
"framer-motion"
|
|
586
|
+
],
|
|
587
|
+
"aliases": [
|
|
588
|
+
"framer-motion",
|
|
589
|
+
"animation variants",
|
|
590
|
+
"motion design",
|
|
591
|
+
"page transition",
|
|
592
|
+
"AnimatePresence"
|
|
593
|
+
],
|
|
594
|
+
"anchors": {
|
|
595
|
+
"variants": "#core-variants-library",
|
|
596
|
+
"tokens": "#design-token-bridge",
|
|
597
|
+
"scroll": "#scroll-animations",
|
|
598
|
+
"accessibility": "#wcag-accessibility-mandatory"
|
|
599
|
+
},
|
|
600
|
+
"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.",
|
|
601
|
+
"stacks": [
|
|
602
|
+
"nextjs"
|
|
603
|
+
]
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"id": "frontend-gsap-core",
|
|
607
|
+
"name": "gsap core",
|
|
608
|
+
"path": "frontend/gsap/gsap-core.md",
|
|
609
|
+
"category": "frontend",
|
|
610
|
+
"subcategory": "gsap",
|
|
611
|
+
"tags": [
|
|
612
|
+
"frontend",
|
|
613
|
+
"gsap",
|
|
614
|
+
"animation",
|
|
615
|
+
"react"
|
|
616
|
+
],
|
|
617
|
+
"aliases": [
|
|
618
|
+
"GSAP",
|
|
619
|
+
"GreenSock",
|
|
620
|
+
"gsap.to",
|
|
621
|
+
"gsap.from",
|
|
622
|
+
"useGSAP",
|
|
623
|
+
"gsap timeline",
|
|
624
|
+
"gsap utils",
|
|
625
|
+
"gsap performance"
|
|
626
|
+
],
|
|
627
|
+
"anchors": {
|
|
628
|
+
"apis": "#core-animation-apis",
|
|
629
|
+
"react": "#reactnextjs-integration",
|
|
630
|
+
"timeline": "#timeline-sequencing",
|
|
631
|
+
"performance": "#performance",
|
|
632
|
+
"accessibility": "#accessibility"
|
|
633
|
+
},
|
|
634
|
+
"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.",
|
|
635
|
+
"stacks": [
|
|
636
|
+
"nextjs"
|
|
637
|
+
]
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"id": "frontend-gsap-scrolltrigger",
|
|
641
|
+
"name": "gsap scrolltrigger",
|
|
642
|
+
"path": "frontend/gsap/gsap-scrolltrigger.md",
|
|
643
|
+
"category": "frontend",
|
|
644
|
+
"subcategory": "gsap",
|
|
645
|
+
"tags": [
|
|
646
|
+
"frontend",
|
|
647
|
+
"gsap",
|
|
648
|
+
"scrolltrigger",
|
|
649
|
+
"scroll-animation"
|
|
650
|
+
],
|
|
651
|
+
"aliases": [
|
|
652
|
+
"ScrollTrigger",
|
|
653
|
+
"scroll animation",
|
|
654
|
+
"pinning",
|
|
655
|
+
"scrubbing",
|
|
656
|
+
"parallax",
|
|
657
|
+
"scroll-driven"
|
|
658
|
+
],
|
|
659
|
+
"anchors": {
|
|
660
|
+
"basic": "#basic-scrolltrigger",
|
|
661
|
+
"scrub": "#scrubbing",
|
|
662
|
+
"pin": "#pinning",
|
|
663
|
+
"batch": "#batch-processing"
|
|
664
|
+
},
|
|
665
|
+
"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.",
|
|
666
|
+
"stacks": [
|
|
667
|
+
"nextjs"
|
|
668
|
+
]
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"id": "frontend-gsap-plugins",
|
|
672
|
+
"name": "gsap plugins",
|
|
673
|
+
"path": "frontend/gsap/gsap-plugins.md",
|
|
674
|
+
"category": "frontend",
|
|
675
|
+
"subcategory": "gsap",
|
|
676
|
+
"tags": [
|
|
677
|
+
"frontend",
|
|
678
|
+
"gsap",
|
|
679
|
+
"plugins"
|
|
680
|
+
],
|
|
681
|
+
"aliases": [
|
|
682
|
+
"Flip",
|
|
683
|
+
"SplitText",
|
|
684
|
+
"MorphSVG",
|
|
685
|
+
"DrawSVG",
|
|
686
|
+
"MotionPath",
|
|
687
|
+
"Draggable",
|
|
688
|
+
"Observer",
|
|
689
|
+
"ScrollToPlugin"
|
|
690
|
+
],
|
|
691
|
+
"anchors": {
|
|
692
|
+
"flip": "#flip-plugin",
|
|
693
|
+
"splittext": "#splittext",
|
|
694
|
+
"morphsvg": "#morphsvg",
|
|
695
|
+
"drawsvg": "#drawsvg"
|
|
696
|
+
},
|
|
697
|
+
"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.",
|
|
698
|
+
"stacks": [
|
|
699
|
+
"nextjs"
|
|
700
|
+
]
|
|
701
|
+
},
|
|
575
702
|
{
|
|
576
703
|
"id": "frontend-nextjs-app-router",
|
|
577
704
|
"name": "app router",
|
|
@@ -833,161 +960,112 @@
|
|
|
833
960
|
]
|
|
834
961
|
},
|
|
835
962
|
{
|
|
836
|
-
"id": "infrastructure-
|
|
837
|
-
"name": "
|
|
838
|
-
"path": "infrastructure/
|
|
963
|
+
"id": "infrastructure-neon-setup",
|
|
964
|
+
"name": "neon setup",
|
|
965
|
+
"path": "infrastructure/neon/neon-setup.md",
|
|
839
966
|
"category": "infrastructure",
|
|
840
|
-
"subcategory": "
|
|
967
|
+
"subcategory": "neon",
|
|
841
968
|
"tags": [
|
|
842
969
|
"infrastructure",
|
|
843
|
-
"
|
|
844
|
-
|
|
845
|
-
"aliases": [
|
|
846
|
-
"supabase CLI",
|
|
847
|
-
"supabase local",
|
|
848
|
-
"supabase tools",
|
|
849
|
-
"supabase configuration",
|
|
850
|
-
"MCP supabase"
|
|
851
|
-
],
|
|
852
|
-
"anchors": {
|
|
853
|
-
"setup": "#mcp-configuration",
|
|
854
|
-
"tools": "#available-tools"
|
|
855
|
-
},
|
|
856
|
-
"digest": "Use Supabase CLI (npx supabase ...) targeting local Docker instance for all database operations. Run npx supabase status to get DB URL, npx supabase db dump --local for schema inspection, psql for queries, and npx supabase migration up --local for migrations. Never connect to production — local is the single source of truth during development.",
|
|
857
|
-
"stacks": [
|
|
858
|
-
"supabase"
|
|
859
|
-
]
|
|
860
|
-
},
|
|
861
|
-
{
|
|
862
|
-
"id": "infrastructure-supabase-supabase-auth",
|
|
863
|
-
"name": "supabase auth",
|
|
864
|
-
"path": "infrastructure/supabase/supabase-auth.md",
|
|
865
|
-
"category": "infrastructure",
|
|
866
|
-
"subcategory": "supabase",
|
|
867
|
-
"tags": [
|
|
868
|
-
"infrastructure",
|
|
869
|
-
"supabase"
|
|
970
|
+
"neon",
|
|
971
|
+
"postgresql"
|
|
870
972
|
],
|
|
871
973
|
"aliases": [
|
|
872
|
-
"
|
|
873
|
-
"
|
|
874
|
-
"
|
|
875
|
-
"
|
|
876
|
-
"
|
|
974
|
+
"Neon",
|
|
975
|
+
"neonctl",
|
|
976
|
+
"serverless postgres",
|
|
977
|
+
"Neon CLI",
|
|
978
|
+
"Neon setup"
|
|
877
979
|
],
|
|
878
980
|
"anchors": {
|
|
879
|
-
"setup": "#
|
|
880
|
-
"
|
|
981
|
+
"setup": "#neon-project-setup",
|
|
982
|
+
"connection": "#connection-strings"
|
|
881
983
|
},
|
|
882
|
-
"digest": "Use
|
|
984
|
+
"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.",
|
|
883
985
|
"stacks": [
|
|
884
|
-
"
|
|
986
|
+
"neon"
|
|
885
987
|
]
|
|
886
988
|
},
|
|
887
989
|
{
|
|
888
|
-
"id": "infrastructure-
|
|
889
|
-
"name": "
|
|
890
|
-
"path": "infrastructure/
|
|
990
|
+
"id": "infrastructure-neon-pgvector",
|
|
991
|
+
"name": "neon pgvector",
|
|
992
|
+
"path": "infrastructure/neon/neon-pgvector.md",
|
|
891
993
|
"category": "infrastructure",
|
|
892
|
-
"subcategory": "
|
|
994
|
+
"subcategory": "neon",
|
|
893
995
|
"tags": [
|
|
894
996
|
"infrastructure",
|
|
895
|
-
"
|
|
997
|
+
"neon",
|
|
998
|
+
"pgvector"
|
|
896
999
|
],
|
|
897
1000
|
"aliases": [
|
|
898
1001
|
"pgvector",
|
|
899
1002
|
"vector embeddings",
|
|
900
1003
|
"similarity search",
|
|
901
|
-
"
|
|
1004
|
+
"Neon vectors",
|
|
902
1005
|
"HNSW index"
|
|
903
1006
|
],
|
|
904
1007
|
"anchors": {
|
|
905
1008
|
"setup": "#pgvector-setup",
|
|
906
1009
|
"queries": "#similarity-queries"
|
|
907
1010
|
},
|
|
908
|
-
"digest": "Enable: CREATE EXTENSION vector. Define column as vector(1536) for OpenAI embeddings. Create HNSW index
|
|
909
|
-
"stacks": [
|
|
910
|
-
"supabase"
|
|
911
|
-
]
|
|
912
|
-
},
|
|
913
|
-
{
|
|
914
|
-
"id": "infrastructure-supabase-supabase-rls",
|
|
915
|
-
"name": "supabase rls",
|
|
916
|
-
"path": "infrastructure/supabase/supabase-rls.md",
|
|
917
|
-
"category": "infrastructure",
|
|
918
|
-
"subcategory": "supabase",
|
|
919
|
-
"tags": [
|
|
920
|
-
"infrastructure",
|
|
921
|
-
"supabase"
|
|
922
|
-
],
|
|
923
|
-
"aliases": [
|
|
924
|
-
"RLS",
|
|
925
|
-
"row level security",
|
|
926
|
-
"postgres policies",
|
|
927
|
-
"multi-tenant security",
|
|
928
|
-
"supabase policies"
|
|
929
|
-
],
|
|
930
|
-
"anchors": {
|
|
931
|
-
"policies": "#rls-policies",
|
|
932
|
-
"patterns": "#tenant-patterns"
|
|
933
|
-
},
|
|
934
|
-
"digest": "Enable RLS on every table: ALTER TABLE ... ENABLE ROW LEVEL SECURITY. User isolation: USING (auth.uid() = user_id). Multi-tenant: USING (tenant_id = (auth.jwt()->>'tenant_id')::uuid). Test policies with SET LOCAL ROLE anon. Service role bypasses RLS — use only server-side. Never rely on application-level security alone.",
|
|
1011
|
+
"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.",
|
|
935
1012
|
"stacks": [
|
|
936
|
-
"
|
|
1013
|
+
"neon"
|
|
937
1014
|
]
|
|
938
1015
|
},
|
|
939
1016
|
{
|
|
940
|
-
"id": "infrastructure-
|
|
941
|
-
"name": "
|
|
942
|
-
"path": "infrastructure/
|
|
1017
|
+
"id": "infrastructure-neon-pgrag",
|
|
1018
|
+
"name": "neon pgrag",
|
|
1019
|
+
"path": "infrastructure/neon/neon-pgrag.md",
|
|
943
1020
|
"category": "infrastructure",
|
|
944
|
-
"subcategory": "
|
|
1021
|
+
"subcategory": "neon",
|
|
945
1022
|
"tags": [
|
|
946
1023
|
"infrastructure",
|
|
947
|
-
"
|
|
1024
|
+
"neon",
|
|
1025
|
+
"pgrag"
|
|
948
1026
|
],
|
|
949
1027
|
"aliases": [
|
|
950
|
-
"
|
|
951
|
-
"
|
|
952
|
-
"
|
|
953
|
-
"
|
|
954
|
-
"
|
|
1028
|
+
"pgrag",
|
|
1029
|
+
"RAG in SQL",
|
|
1030
|
+
"embedding pipeline",
|
|
1031
|
+
"Neon RAG",
|
|
1032
|
+
"in-database RAG"
|
|
955
1033
|
],
|
|
956
1034
|
"anchors": {
|
|
957
|
-
"
|
|
958
|
-
"
|
|
1035
|
+
"setup": "#pgrag-setup",
|
|
1036
|
+
"pipeline": "#rag-pipeline"
|
|
959
1037
|
},
|
|
960
|
-
"digest": "
|
|
1038
|
+
"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.",
|
|
961
1039
|
"stacks": [
|
|
962
|
-
"
|
|
1040
|
+
"neon"
|
|
963
1041
|
]
|
|
964
1042
|
},
|
|
965
1043
|
{
|
|
966
|
-
"id": "infrastructure-
|
|
967
|
-
"name": "
|
|
968
|
-
"path": "infrastructure/
|
|
1044
|
+
"id": "infrastructure-neon-semantic-kernel",
|
|
1045
|
+
"name": "neon semantic kernel",
|
|
1046
|
+
"path": "infrastructure/neon/neon-semantic-kernel.md",
|
|
969
1047
|
"category": "infrastructure",
|
|
970
|
-
"subcategory": "
|
|
1048
|
+
"subcategory": "neon",
|
|
971
1049
|
"tags": [
|
|
972
1050
|
"infrastructure",
|
|
973
|
-
"
|
|
974
|
-
"
|
|
1051
|
+
"neon",
|
|
1052
|
+
"semantic-kernel"
|
|
975
1053
|
],
|
|
976
1054
|
"aliases": [
|
|
977
|
-
"
|
|
978
|
-
"
|
|
979
|
-
"
|
|
980
|
-
"
|
|
1055
|
+
"Semantic Kernel",
|
|
1056
|
+
"vector store",
|
|
1057
|
+
"Neon Semantic Kernel",
|
|
1058
|
+
"SK vector store",
|
|
1059
|
+
"AI memory"
|
|
981
1060
|
],
|
|
982
1061
|
"anchors": {
|
|
983
|
-
"
|
|
984
|
-
"
|
|
985
|
-
"refresh": "#jwt-refresh-patterns"
|
|
1062
|
+
"setup": "#semantic-kernel-setup",
|
|
1063
|
+
"store": "#vector-store-integration"
|
|
986
1064
|
},
|
|
987
|
-
"digest": "
|
|
1065
|
+
"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.",
|
|
988
1066
|
"stacks": [
|
|
989
|
-
"
|
|
990
|
-
"
|
|
1067
|
+
"neon",
|
|
1068
|
+
"semantic-kernel"
|
|
991
1069
|
]
|
|
992
1070
|
},
|
|
993
1071
|
{
|
|
@@ -1016,6 +1094,5 @@
|
|
|
1016
1094
|
"*"
|
|
1017
1095
|
]
|
|
1018
1096
|
}
|
|
1019
|
-
]
|
|
1020
|
-
"total": 67
|
|
1097
|
+
]
|
|
1021
1098
|
}
|
|
@@ -118,6 +118,7 @@ Expose agents as interoperable web services using the standardized A2A protocol.
|
|
|
118
118
|
### Packages
|
|
119
119
|
|
|
120
120
|
```xml
|
|
121
|
+
<!-- ⚠️ MAF packages are in PREVIEW — API surface may change before GA -->
|
|
121
122
|
<PackageReference Include="Microsoft.Agents.AI.Hosting.A2A.AspNetCore" Version="1.0.0-preview.*" />
|
|
122
123
|
```
|
|
123
124
|
|
|
@@ -14,6 +14,7 @@ Semantic Kernel is superseded. Do NOT use `Kernel`, `KernelFunction`, or `Invoke
|
|
|
14
14
|
|
|
15
15
|
```xml
|
|
16
16
|
<!-- .csproj -->
|
|
17
|
+
<!-- ⚠️ MAF packages are in PREVIEW — API surface may change before GA -->
|
|
17
18
|
<PackageReference Include="Microsoft.Agents.AI" Version="1.0.0-preview.*" />
|
|
18
19
|
<PackageReference Include="Microsoft.Agents.AI.Abstractions" Version="1.0.0-preview.*" />
|
|
19
20
|
<PackageReference Include="Microsoft.Agents.AI.OpenAI" Version="1.0.0-preview.*" />
|
|
@@ -25,8 +26,8 @@ Semantic Kernel is superseded. Do NOT use `Kernel`, `KernelFunction`, or `Invoke
|
|
|
25
26
|
<PackageReference Include="Azure.AI.OpenAI" Version="2.*" />
|
|
26
27
|
<PackageReference Include="Azure.Identity" Version="1.*" />
|
|
27
28
|
|
|
28
|
-
<!-- For Microsoft.Extensions.AI abstractions -->
|
|
29
|
-
<PackageReference Include="Microsoft.Extensions.AI" Version="
|
|
29
|
+
<!-- For Microsoft.Extensions.AI abstractions (STABLE — use as fallback when MAF preview breaks) -->
|
|
30
|
+
<PackageReference Include="Microsoft.Extensions.AI" Version="9.5.0" />
|
|
30
31
|
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.3.0-preview.*" />
|
|
31
32
|
```
|
|
32
33
|
|
|
@@ -23,6 +23,7 @@ Workflows compose multiple agents and executors into coordinated pipelines using
|
|
|
23
23
|
### Packages
|
|
24
24
|
|
|
25
25
|
```xml
|
|
26
|
+
<!-- ⚠️ MAF packages are in PREVIEW — API surface may change before GA -->
|
|
26
27
|
<PackageReference Include="Microsoft.Agents.AI" Version="1.0.0-preview.*" />
|
|
27
28
|
<PackageReference Include="Microsoft.Agents.AI.Workflows" Version="1.0.0-preview.*" />
|
|
28
29
|
```
|
|
@@ -16,7 +16,7 @@ Sem MediatR, sem AggregateRoot, sem Domain Events, sem CQRS formal.
|
|
|
16
16
|
{ProjectName}/
|
|
17
17
|
├── Abstractions/
|
|
18
18
|
│ ├── IHandler.cs # Interface central: IHandler<TRequest, TResponse>
|
|
19
|
-
│ ├── IApiEndpoint.cs # Interface de endpoint: void MapEndpoint(
|
|
19
|
+
│ ├── IApiEndpoint.cs # Interface de endpoint: void MapEndpoint(IEndpointRouteBuilder app)
|
|
20
20
|
│ ├── Result.cs # Result<T> / Result (non-generic)
|
|
21
21
|
│ └── Errors/
|
|
22
22
|
│ ├── Error.cs # record Error com factory methods + ErrorType enum
|
|
@@ -81,7 +81,7 @@ namespace {ProjectName}.Abstractions
|
|
|
81
81
|
{
|
|
82
82
|
public interface IApiEndpoint
|
|
83
83
|
{
|
|
84
|
-
void MapEndpoint(
|
|
84
|
+
void MapEndpoint(IEndpointRouteBuilder app);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
```
|
|
@@ -239,7 +239,7 @@ namespace {ProjectName}.Features.BookFeature.CreateBook;
|
|
|
239
239
|
|
|
240
240
|
internal sealed class CreateBookEndpoint : IApiEndpoint
|
|
241
241
|
{
|
|
242
|
-
public void MapEndpoint(
|
|
242
|
+
public void MapEndpoint(IEndpointRouteBuilder app)
|
|
243
243
|
{
|
|
244
244
|
app.MapPost("books", async (
|
|
245
245
|
IHandler<CreateBookRequest, Result<CreateBookResponse>> handler,
|
|
@@ -403,7 +403,7 @@ app.MapApiEndpoints();
|
|
|
403
403
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.3" />
|
|
404
404
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.3" />
|
|
405
405
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.3" />
|
|
406
|
-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0
|
|
406
|
+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.*" /> <!-- use wildcard — Npgsql releases lag behind EF Core -->
|
|
407
407
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.3" />
|
|
408
408
|
<PackageReference Include="Scalar.AspNetCore" Version="2.12.40" />
|
|
409
409
|
<PackageReference Include="Scrutor" Version="7.0.0" />
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Neon PostgreSQL Database Standards
|
|
2
2
|
|
|
3
|
-
> **Scope:** nextjs-
|
|
3
|
+
> **Scope:** nextjs-neon
|
|
4
4
|
> **Layer:** 2 (on keyword)
|
|
5
|
-
> **Keywords:** postgresql, postgres, sql,
|
|
6
|
-
> **Load When:**
|
|
5
|
+
> **Keywords:** postgresql, postgres, sql, neon, database schema
|
|
6
|
+
> **Load When:** neon or postgresql keywords detected
|
|
7
7
|
|
|
8
|
-
Database schema design, migrations, and Row Level Security (RLS) patterns for
|
|
8
|
+
Database schema design, migrations, and Row Level Security (RLS) patterns for Neon PostgreSQL.
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -113,16 +113,20 @@ create policy "Public profiles are viewable by everyone"
|
|
|
113
113
|
|
|
114
114
|
## Migrations
|
|
115
115
|
|
|
116
|
-
### Migration
|
|
116
|
+
### Migration Management (EF Core)
|
|
117
117
|
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
```bash
|
|
119
|
+
# Create a new migration
|
|
120
|
+
dotnet ef migrations add CreateUsersTable
|
|
121
|
+
|
|
122
|
+
# Apply migrations to Neon database
|
|
123
|
+
dotnet ef database update
|
|
124
|
+
|
|
125
|
+
# Generate SQL script for review
|
|
126
|
+
dotnet ef migrations script --idempotent
|
|
123
127
|
```
|
|
124
128
|
|
|
125
|
-
### Migration Template
|
|
129
|
+
### Migration Template (SQL for manual migrations)
|
|
126
130
|
|
|
127
131
|
```sql
|
|
128
132
|
-- Create table
|
|
@@ -250,89 +254,65 @@ create trigger users_soft_delete
|
|
|
250
254
|
|
|
251
255
|
---
|
|
252
256
|
|
|
253
|
-
##
|
|
257
|
+
## Database Queries (EF Core / SQL)
|
|
254
258
|
|
|
255
|
-
### Select
|
|
259
|
+
### Select (EF Core)
|
|
256
260
|
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
```csharp
|
|
262
|
+
var users = await db.Users
|
|
263
|
+
.Where(u => u.IsActive)
|
|
264
|
+
.OrderByDescending(u => u.CreatedAt)
|
|
265
|
+
.Take(10)
|
|
266
|
+
.Select(u => new { u.Id, u.Name, u.Email })
|
|
267
|
+
.ToListAsync(ct);
|
|
264
268
|
```
|
|
265
269
|
|
|
266
|
-
### Insert
|
|
270
|
+
### Insert (EF Core)
|
|
267
271
|
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
.select()
|
|
273
|
-
.single()
|
|
272
|
+
```csharp
|
|
273
|
+
var user = new User { Name = "John", Email = "john@example.com" };
|
|
274
|
+
db.Users.Add(user);
|
|
275
|
+
await db.SaveChangesAsync(ct);
|
|
274
276
|
```
|
|
275
277
|
|
|
276
|
-
### Update
|
|
278
|
+
### Update (EF Core)
|
|
277
279
|
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
280
|
+
```csharp
|
|
281
|
+
var user = await db.Users.FindAsync([userId], ct);
|
|
282
|
+
if (user is not null)
|
|
283
|
+
{
|
|
284
|
+
user.Name = "John Doe";
|
|
285
|
+
await db.SaveChangesAsync(ct);
|
|
286
|
+
}
|
|
285
287
|
```
|
|
286
288
|
|
|
287
|
-
### Delete
|
|
289
|
+
### Delete (EF Core)
|
|
288
290
|
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
.from('users')
|
|
292
|
-
.delete()
|
|
293
|
-
.eq('id', userId)
|
|
291
|
+
```csharp
|
|
292
|
+
await db.Users.Where(u => u.Id == userId).ExecuteDeleteAsync(ct);
|
|
294
293
|
```
|
|
295
294
|
|
|
296
|
-
### Joins (
|
|
295
|
+
### Joins (Navigation Properties)
|
|
297
296
|
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
)
|
|
309
|
-
`)
|
|
297
|
+
```csharp
|
|
298
|
+
var posts = await db.Posts
|
|
299
|
+
.Include(p => p.Author)
|
|
300
|
+
.Select(p => new
|
|
301
|
+
{
|
|
302
|
+
p.Id,
|
|
303
|
+
p.Title,
|
|
304
|
+
Author = new { p.Author.Id, p.Author.Name, p.Author.AvatarUrl }
|
|
305
|
+
})
|
|
306
|
+
.ToListAsync(ct);
|
|
310
307
|
```
|
|
311
308
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
## Realtime Subscriptions
|
|
315
|
-
|
|
316
|
-
### Listen to Changes
|
|
309
|
+
### Direct SQL via Npgsql (Next.js / serverless)
|
|
317
310
|
|
|
318
311
|
```typescript
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
{
|
|
324
|
-
event: '*', // or 'INSERT', 'UPDATE', 'DELETE'
|
|
325
|
-
schema: 'public',
|
|
326
|
-
table: 'posts'
|
|
327
|
-
},
|
|
328
|
-
(payload) => {
|
|
329
|
-
console.log('Change received!', payload)
|
|
330
|
-
}
|
|
331
|
-
)
|
|
332
|
-
.subscribe()
|
|
333
|
-
|
|
334
|
-
// Cleanup
|
|
335
|
-
supabase.removeChannel(channel)
|
|
312
|
+
import { neon } from '@neondatabase/serverless';
|
|
313
|
+
|
|
314
|
+
const sql = neon(process.env.DATABASE_URL!);
|
|
315
|
+
const users = await sql`SELECT id, name, email FROM users WHERE is_active = true ORDER BY created_at DESC LIMIT 10`;
|
|
336
316
|
```
|
|
337
317
|
|
|
338
318
|
---
|
|
@@ -349,4 +329,4 @@ supabase.removeChannel(channel)
|
|
|
349
329
|
|
|
350
330
|
---
|
|
351
331
|
|
|
352
|
-
*
|
|
332
|
+
*Neon PostgreSQL Database Standards - MORPH-SPEC by Polymorphism Tech*
|