@polymorphism-tech/morph-spec 4.18.0 → 4.19.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 (44) hide show
  1. package/README.md +2 -2
  2. package/bin/task-manager.js +12 -0
  3. package/claude-plugin.json +1 -1
  4. package/docs/CHEATSHEET.md +1 -1
  5. package/docs/QUICKSTART.md +1 -1
  6. package/framework/agents/architecture/architecture-expert.md +86 -0
  7. package/framework/agents/architecture/morph-spec-architect.md +66 -0
  8. package/framework/agents/architecture/packages-validator.md +77 -0
  9. package/framework/agents/architecture/security-expert.md +67 -0
  10. package/framework/agents/backend/ms-agent-expert.md +1 -1
  11. package/framework/agents/frontend/design-system-validator.md +88 -0
  12. package/framework/agents/frontend/nextjs-component-validator.md +85 -0
  13. package/framework/agents/frontend/{ui-ux-designer.md → ui-designer.md} +31 -0
  14. package/framework/agents.json +1 -1
  15. package/framework/hooks/claude-code/post-tool-use/dispatch.js +39 -0
  16. package/framework/hooks/claude-code/post-tool-use/handle-tool-failure.js +78 -44
  17. package/framework/hooks/claude-code/post-tool-use/loop-detect.js +103 -0
  18. package/framework/hooks/claude-code/session-start/inject-morph-context.js +21 -2
  19. package/framework/hooks/claude-code/stop/validate-completion.js +48 -1
  20. package/framework/hooks/shared/activity-logger.js +56 -1
  21. package/framework/hooks/shared/build-check.js +79 -0
  22. package/framework/hooks/shared/payload-utils.js +39 -0
  23. package/framework/hooks/shared/session-snapshot.js +105 -0
  24. package/framework/phases.json +1 -1
  25. package/framework/skills/level-0-meta/mcp-registry.json +34 -1
  26. package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +1 -1
  27. package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +1 -1
  28. package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +11 -1
  29. package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +12 -1
  30. package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +1 -1
  31. package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +1 -1
  32. package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +119 -11
  33. package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +1 -1
  34. package/framework/standards/ai-agents/production.md +5 -2
  35. package/framework/standards/ai-agents/setup.md +13 -14
  36. package/framework/standards/ai-agents/workflows.md +8 -6
  37. package/framework/standards/backend/database/vector-search-rag.md +1 -1
  38. package/framework/templates/code/dotnet/jobs/agent.cs +0 -1
  39. package/package.json +1 -1
  40. package/src/commands/mcp/mcp-setup.js +21 -0
  41. package/src/commands/project/init.js +11 -0
  42. package/src/lib/contracts/sprint-contract-generator.js +137 -0
  43. package/src/lib/installers/mcp-installer.js +25 -0
  44. package/src/utils/hooks-installer.js +12 -1
@@ -152,11 +152,44 @@
152
152
  "warnings": ["API call execution requires your Asaas access_token. Doc search works without authentication."],
153
153
  "setupGuide": "Run: claude mcp add --transport http asaas https://docs.asaas.com/mcp"
154
154
  }
155
+ },
156
+ "stitch": {
157
+ "phases": ["uiux"],
158
+ "tools": ["create_project", "list_projects", "get_project", "list_screens", "get_screen", "generate_screen_from_text", "fetch_screen_code", "fetch_screen_image"],
159
+ "detection": "mcpServers includes stitch",
160
+ "fallback": "HTML mockup + Playwright screenshots (Step 3.5 workflow)",
161
+ "usage": "AI-generated screen designs, design.md export, visual design exploration",
162
+ "healthCheck": {
163
+ "toolPattern": "stitch",
164
+ "testCall": "Call list_projects to verify connectivity",
165
+ "testParams": {},
166
+ "successIndicator": "Returns a list of projects (possibly empty) without auth errors",
167
+ "failureHint": "Stitch MCP not responding. Ensure @_davideast/stitch-mcp is installed or configure official MCP: claude mcp add stitch --transport http https://stitch.googleapis.com/mcp"
168
+ },
169
+ "install": {
170
+ "autoInstall": true,
171
+ "transport": "stdio",
172
+ "config": {
173
+ "command": "cmd",
174
+ "args": ["/c", "npx", "-y", "@_davideast/stitch-mcp@latest", "proxy"]
175
+ },
176
+ "credentials": [],
177
+ "prerequisites": [],
178
+ "stackRelevance": ["nextjs", "nextjs-neon", "vite"],
179
+ "warnings": ["Community MCP tool. Official alternative: claude mcp add stitch --transport http https://stitch.googleapis.com/mcp (requires gcloud auth)"],
180
+ "setupGuide": "Auto-installed via npx. For official Google MCP: claude mcp add stitch --transport http https://stitch.googleapis.com/mcp"
181
+ },
182
+ "companionSkills": {
183
+ "repo": "google-labs-code/stitch-skills",
184
+ "installCommand": "npx skills add google-labs-code/stitch-skills",
185
+ "skills": ["stitch-design", "stitch-loop", "design-md", "prompt-enhance", "react-components", "shadcn-ui"],
186
+ "description": "Official Stitch agent skills for Claude Code — design generation, multi-page loops, design.md export"
187
+ }
155
188
  }
156
189
  },
157
190
  "phaseMatrix": {
158
191
  "proposal": ["context7"],
159
- "uiux": ["playwright", "context7"],
192
+ "uiux": ["playwright", "context7", "stitch"],
160
193
  "design": ["context7", "github"],
161
194
  "tasks": ["context7", "github"],
162
195
  "implement": ["context7", "playwright", "github", "vercel"]
@@ -10,7 +10,7 @@ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion,
10
10
  mcp__playwright__browser_navigate, mcp__playwright__browser_resize,
11
11
  mcp__playwright__browser_take_screenshot, mcp__playwright__browser_snapshot,
12
12
  mcp__playwright__browser_evaluate, mcp__playwright__browser_console_messages
13
- cliVersion: "4.18.0"
13
+ cliVersion: "4.19.0"
14
14
  stacks:
15
15
  - nextjs
16
16
  ---
@@ -3,7 +3,7 @@ name: morph-phase-codebase-analysis
3
3
  description: MORPH-SPEC Design sub-phase that analyzes existing codebase and database schema, producing schema-analysis.md with real column names, types, relationships, and field mismatches. Use at the start of Design phase before generating contracts.cs to prevent incorrect field names or types.
4
4
  user-invocable: false
5
5
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
6
- cliVersion: "4.18.0"
6
+ cliVersion: "4.19.0"
7
7
  ---
8
8
 
9
9
  # MORPH Codebase Analysis - Design Sub-phase
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 2 (Design). Schema-first interactive design: reads
4
4
  argument-hint: "[feature-name]"
5
5
  user-invocable: false
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Agent
7
- cliVersion: "4.18.0"
7
+ cliVersion: "4.19.0"
8
8
  ---
9
9
 
10
10
  # MORPH Design — Phase 2
@@ -440,4 +440,14 @@ morph-spec state set $ARGUMENTS costs.estimated {X.XX}
440
440
  | `decisions` | `.morph/features/{feature}/2-design/decisions.md` |
441
441
  <!-- /morph-outputs -->
442
442
 
443
+ ## Relevant Standards
444
+
445
+ Before starting the design phase, proactively read standards relevant to the project's stack:
446
+ - Architecture standards: `.morph/framework/standards/architecture/` — especially vertical-slice patterns
447
+ - Backend standards: `.morph/framework/standards/backend/` — for API contracts and patterns
448
+ - Data standards: `.morph/framework/standards/data/` — for database schema and access patterns
449
+ - These standards are also available as rules that auto-load when editing matching file types.
450
+
451
+ ---
452
+
443
453
  Continue automatically to Plan phase after approval.
@@ -5,7 +5,7 @@ argument-hint: "[feature-name]"
5
5
  context: fork
6
6
  agent: general-purpose
7
7
  user-invocable: false
8
- cliVersion: "4.18.0"
8
+ cliVersion: "4.19.0"
9
9
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Agent
10
10
  ---
11
11
 
@@ -479,4 +479,15 @@ Agent(subagent_type=morph-standards-architect, prompt=<filled prompts/code-quali
479
479
 
480
480
  ---
481
481
 
482
+ ## Relevant Standards
483
+
484
+ During implementation, standards auto-load via rules when editing relevant file types.
485
+ For proactive reference:
486
+ - Architecture: `.morph/framework/standards/architecture/` — structural compliance
487
+ - Backend/Frontend: `.morph/framework/standards/backend/` or `.morph/framework/standards/frontend/`
488
+ - Security: `.morph/framework/standards/security/` — authentication, authorization patterns
489
+ - Testing: follow the project's existing test patterns (check `test/` or `tests/` directory)
490
+
491
+ ---
492
+
482
493
  Feature complete! Consider creating a PR and running `morph-spec generate recap $ARGUMENTS`.
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 3 (Plan). Generates a detailed implementation plan
4
4
  argument-hint: "[feature-name]"
5
5
  user-invocable: false
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
7
- cliVersion: "4.18.0"
7
+ cliVersion: "4.19.0"
8
8
  ---
9
9
 
10
10
  # MORPH Plan — Phase 3
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 4 (Tasks). Breaks approved spec into bottom-up ord
4
4
  argument-hint: "[feature-name]"
5
5
  user-invocable: false
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
7
- cliVersion: "4.18.0"
7
+ cliVersion: "4.19.0"
8
8
  ---
9
9
 
10
10
  # MORPH Tasks — Phase 4
@@ -4,7 +4,7 @@ description: MORPH-SPEC Phase 2 (UI/UX). Creates design-system.md, mockups.md, c
4
4
  argument-hint: "[feature-name]"
5
5
  user-invocable: false
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
7
- cliVersion: "4.18.0"
7
+ cliVersion: "4.19.0"
8
8
  ---
9
9
 
10
10
  # MORPH UI/UX Design - Phase 2
@@ -43,8 +43,10 @@ Conditional phase for features with front-end. Collects UI/UX requirements, gene
43
43
  | Capture existing app | **Playwright MCP** `browser_navigate()` + `browser_take_screenshot()` | — |
44
44
  | Read Tailwind config | **Read** `tailwind.config.{js,ts}` | **Grep** `colors:` |
45
45
  | Trend research | **Context7 MCP** / **WebSearch** | — |
46
+ | Generate AI screen designs | **Stitch MCP** `generate_screen_from_text()` + `fetch_screen_image()` | HTML mockup + Playwright (Step 3.5) |
47
+ | Export design tokens from Stitch | **Stitch MCP** `fetch_screen_code()` | Manual design-system.md creation |
46
48
 
47
- **MCPs for this phase:** Playwright (preview, inspection, responsiveness), Context7 (component docs).
49
+ **MCPs for this phase:** Playwright (preview, inspection, responsiveness), Context7 (component docs), Stitch (optional: AI screen generation, design.md export).
48
50
 
49
51
  **Anti-patterns:**
50
52
  - Task agent to read a screenshot (use Read directly on image)
@@ -244,6 +246,37 @@ Track: `dsExists` (bool).
244
246
  | **B** | `dsExists` AND NOT `cssTokensFound` | Print: `✓ Design system found (no CSS tokens to cross-check)`. Proceed to Step 1. |
245
247
  | **C** | NOT `dsExists` AND tokens found | Auto-generate `.morph/context/design-system.md` from ALL scanned token sources (CSS vars, Tailwind config, etc.). Merge tokens from multiple sources, preferring Tailwind/Theme config over raw CSS. If Step 0.2 produced `existing-ui-analysis.md`, cross-reference visual analysis with extracted tokens. Proceed to Step 1. |
246
248
  | **D** | NOT `dsExists` AND NOT `cssTokensFound` | Greenfield project. Ask user for aesthetic direction + brand color using `AskUserQuestion` (same options as morph-init). Scaffold from template. Proceed to Step 1. |
249
+ | **E** | Stitch MCP available AND `design.md` found in project root | Parse Stitch design.md, extract color/typography/spacing/radius/shadow tokens, map into `.morph/context/design-system.md` template. If `dsExists`, merge (Stitch fills gaps, manually-set tokens preserved). Add changelog entry. Proceed to Step 1. |
250
+
251
+ **Case E — Stitch design.md integration:**
252
+
253
+ > **Prerequisite:** Stitch MCP detected (tools matching pattern `stitch` found) OR a `design.md` file exists in the project root.
254
+
255
+ 1. If Stitch MCP is available, check for existing projects:
256
+ ```
257
+ stitch__list_projects({})
258
+ ```
259
+ If projects exist, list screens and fetch the design export:
260
+ ```
261
+ stitch__list_screens({ projectId: selectedProjectId })
262
+ stitch__fetch_screen_code({ screenId: screenId })
263
+ ```
264
+
265
+ 2. If `design.md` exists in project root (manual export from Stitch), read it directly.
266
+
267
+ 3. Parse the design.md content and map tokens into `design-system.md` template sections:
268
+ - Color values → `## Color Tokens` (map to `--color-primary`, `--color-accent`, etc.)
269
+ - Font families/sizes → `## Typography` (map to `--font-display`, `--font-body`)
270
+ - Spacing values → `## Spacing Tokens`
271
+ - Border radius → `## Border Radius Tokens`
272
+ - Shadow definitions → `## Shadow Tokens`
273
+
274
+ 4. Write or merge into `.morph/context/design-system.md` using the existing template structure.
275
+
276
+ 5. Add changelog entry:
277
+ `- [today's date] [morph-phase-uiux] Tokens imported from Stitch design.md ({N} tokens)`
278
+
279
+ Print: `✓ Design system populated from Stitch design — .morph/context/design-system.md`
247
280
 
248
281
  **Case C — auto-generate from scanned tokens:**
249
282
 
@@ -416,11 +449,79 @@ Detect the stack from `.morph/config/config.json` and recommend the appropriate
416
449
 
417
450
  > **MCP:** After selecting the UI library, use **Context7 MCP** (`resolve-library-id` → `query-docs`) to fetch the library's latest component API (e.g., shadcn/ui primitives, Radix props, MUI component APIs). This ensures component specs in `components.md` reference real, current props — not outdated or hallucinated ones. If Context7 is not available, use **WebSearch** + **WebFetch** to check the official component documentation.
418
451
 
419
- ### Step 3.5: Visual Mockup (Playwright MCP)
452
+ ### Step 3.5: Visual Mockup (Playwright MCP or Stitch MCP)
420
453
 
421
- > **Purpose:** Generate a real HTML preview using project design tokens before writing formal specs.
454
+ > **Purpose:** Generate a real visual preview using project design tokens before writing formal specs.
422
455
  > Seeing the actual visual before committing to components prevents misaligned specs.
423
456
 
457
+ #### 3.5.0 — Stitch MCP Path (Alternative to HTML Mockup)
458
+
459
+ > **Skip if:** Stitch MCP is NOT available. Fall through to 3.5.1 (HTML mockup).
460
+ > **Use when:** Stitch MCP is detected and user wants AI-generated screen designs.
461
+
462
+ If Stitch MCP is available, present the user with a choice:
463
+
464
+ ```json
465
+ {
466
+ "questions": [{
467
+ "header": "Design Tool",
468
+ "question": "Stitch MCP is available for AI-generated screen designs. How would you like to create visual mockups?",
469
+ "multiSelect": false,
470
+ "options": [
471
+ { "label": "Use Stitch", "description": "Generate screens via Google Stitch AI — higher fidelity, exportable design.md" },
472
+ { "label": "Use HTML mockup", "description": "Generate HTML file + Playwright screenshots — current default workflow" }
473
+ ]
474
+ }]
475
+ }
476
+ ```
477
+
478
+ **If "Use Stitch" selected:**
479
+
480
+ 1. **Create or select project:**
481
+ ```
482
+ stitch__create_project({ name: "{feature-name}-design" })
483
+ ```
484
+ Or if project already exists (from Case E in Step 0.5.3), reuse it.
485
+
486
+ 2. **Generate screens from design brief:**
487
+ Build a prompt from the aesthetic direction (Step 1.5), selected trends (Step 1.3), and user input (Step 2):
488
+ ```
489
+ stitch__generate_screen_from_text({
490
+ projectId: projectId,
491
+ prompt: "Create a {detectedDomain} screen with {aestheticDirection} direction. Colors: {primaryColor}, {accentColor}. Font: {fontPair}. Layout: {layoutDescription}. Features: {componentList}"
492
+ })
493
+ ```
494
+
495
+ 3. **Fetch screen images for review:**
496
+ ```
497
+ stitch__list_screens({ projectId: projectId })
498
+ stitch__fetch_screen_image({ screenId: screenId })
499
+ ```
500
+ Save images to `.morph/features/$ARGUMENTS/1-ui/stitch-screen-*.png`
501
+
502
+ 4. **Present to user for feedback** (same approval loop as 3.5.3):
503
+ - Show Stitch-generated screen images
504
+ - Ask: "Does this visual direction match your intent?"
505
+ - Iterate: regenerate via `generate_screen_from_text` with refined prompts
506
+
507
+ 5. **Export design tokens:**
508
+ ```
509
+ stitch__fetch_screen_code({ screenId: approvedScreenId })
510
+ ```
511
+ Parse the design.md export and update `.morph/context/design-system.md` with any new or refined tokens.
512
+
513
+ 6. **Skip to Step 4** — Stitch screens replace the HTML mockup. `mockups.md` still documents states and interactions textually.
514
+
515
+ > **Key advantage:** Unlike screenshots, the Stitch MCP transmits real HTML/CSS code via `fetch_screen_code()`.
516
+ > This produces dramatically higher fidelity results than screenshot-based workflows because Claude Code
517
+ > receives the actual component structure, CSS properties, and design tokens — not pixel approximations.
518
+ > Use `react-components` or `shadcn-ui` companion skills to convert Stitch HTML into production React components.
519
+
520
+ **If "Use HTML mockup" selected:**
521
+ → Proceed to 3.5.1 (existing workflow, unchanged)
522
+
523
+ ---
524
+
424
525
  #### 3.5.1 — Generate HTML Mockup
425
526
 
426
527
  Create an HTML file that represents the main screen/layout using **real tokens from `.morph/context/design-system.md`**:
@@ -533,6 +634,13 @@ Create the following files in `.morph/features/$ARGUMENTS/`:
533
634
  - Spacing and layout (grid, margins, paddings)
534
635
  - Base components (buttons, inputs, cards)
535
636
 
637
+ **If Stitch was used (Step 3.5.0):**
638
+ - Derive `design-system.md` primarily from Stitch's exported design.md
639
+ - Map Stitch tokens into existing template sections (Color Tokens, Typography, Spacing, etc.)
640
+ - Cross-reference with tokens from Step 0.5 — preserve manually-set tokens, let Stitch values fill gaps
641
+ - Add to `## Aesthetic Direction`: "Visual direction generated via Google Stitch (project: {projectName})"
642
+ - Ensure all CSS custom properties use the standard `--color-*`, `--font-*`, `--space-*` naming convention
643
+
536
644
  #### 4.2. `mockups.md`
537
645
 
538
646
  ASCII wireframes + descriptions:
@@ -666,13 +774,13 @@ Use `AskUserQuestion` to capture explicit approval before advancing:
666
774
 
667
775
  ## Phase Outputs
668
776
 
669
- <!-- morph-outputs:uiux -->
670
- | Output | Caminho |
671
- |--------|---------|
672
- | `uiDesignSystem` | `.morph/features/{feature}/1-ui/design-system.md` |
673
- | `uiMockups` | `.morph/features/{feature}/1-ui/mockups.md` |
674
- | `uiComponents` | `.morph/features/{feature}/1-ui/components.md` |
675
- | `uiFlows` | `.morph/features/{feature}/1-ui/flows.md` |
777
+ <!-- morph-outputs:uiux -->
778
+ | Output | Caminho |
779
+ |--------|---------|
780
+ | `uiDesignSystem` | `.morph/features/{feature}/1-ui/design-system.md` |
781
+ | `uiMockups` | `.morph/features/{feature}/1-ui/mockups.md` |
782
+ | `uiComponents` | `.morph/features/{feature}/1-ui/components.md` |
783
+ | `uiFlows` | `.morph/features/{feature}/1-ui/flows.md` |
676
784
  <!-- /morph-outputs -->
677
785
 
678
786
  ---
@@ -4,7 +4,7 @@ description: Guided workflow for mid-implementation scope escalation — analyze
4
4
  user-invocable: true
5
5
  argument-hint: "[feature-name]"
6
6
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
7
- cliVersion: "4.18.0"
7
+ cliVersion: "4.19.0"
8
8
  ---
9
9
 
10
10
  # Scope Escalation Workflow
@@ -118,10 +118,13 @@ 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 -->
122
- <PackageReference Include="Microsoft.Agents.AI.Hosting.A2A.AspNetCore" Version="1.0.0-preview.*" />
121
+ <!-- A2A hosting — not yet published on NuGet, uncomment when GA -->
122
+ <!-- <PackageReference Include="Microsoft.Agents.AI.Hosting.A2A.AspNetCore" Version="1.0.0-preview.*" /> -->
123
123
  ```
124
124
 
125
+ > **Note:** The A2A hosting package is part of the MAF preview and is **not yet available on NuGet**.
126
+ > The patterns below reflect the expected API surface. Until GA, implement A2A manually via HTTP endpoints.
127
+
125
128
  ### Expose Agent via A2A
126
129
 
127
130
  ```csharp
@@ -14,23 +14,23 @@ 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 -->
18
- <PackageReference Include="Microsoft.Agents.AI" Version="1.0.0-preview.*" />
19
- <PackageReference Include="Microsoft.Agents.AI.Abstractions" Version="1.0.0-preview.*" />
20
- <PackageReference Include="Microsoft.Agents.AI.OpenAI" Version="1.0.0-preview.*" />
21
-
22
- <!-- For Web API hosting + A2A -->
23
- <PackageReference Include="Microsoft.Agents.AI.Hosting" Version="1.0.0-preview.*" />
17
+ <!-- Microsoft.Extensions.AI — STABLE abstractions for IChatClient, AIFunctionFactory, tools -->
18
+ <PackageReference Include="Microsoft.Extensions.AI" Version="9.5.0" />
19
+ <PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.3.0-preview.*" />
24
20
 
25
21
  <!-- For Azure OpenAI -->
26
22
  <PackageReference Include="Azure.AI.OpenAI" Version="2.*" />
27
23
  <PackageReference Include="Azure.Identity" Version="1.*" />
28
24
 
29
- <!-- For Microsoft.Extensions.AI abstractions (STABLE — use as fallback when MAF preview breaks) -->
30
- <PackageReference Include="Microsoft.Extensions.AI" Version="9.5.0" />
31
- <PackageReference Include="Microsoft.Extensions.AI.OpenAI" Version="9.3.0-preview.*" />
25
+ <!-- For A2A protocol hosting (when GA) -->
26
+ <!-- <PackageReference Include="Microsoft.Agents.AI.Hosting.A2A.AspNetCore" Version="1.0.0-preview.*" /> -->
32
27
  ```
33
28
 
29
+ > **Note:** The Microsoft Agent Framework (MAF) packages (`Microsoft.Agents.AI.*`) are **not yet published on NuGet**.
30
+ > Use `Microsoft.Extensions.AI` as the primary package — it provides `IChatClient`, `AIFunctionFactory`,
31
+ > and all abstractions shown in this guide. The MAF `ChatClientAgent`, `AsAIAgent()`, and `AgentWorkflowBuilder`
32
+ > APIs documented here reflect the expected GA surface. Until MAF ships, implement agents using `IChatClient` directly.
33
+
34
34
  ---
35
35
 
36
36
  ## Quick Start (Minimal Agent)
@@ -38,7 +38,7 @@ Semantic Kernel is superseded. Do NOT use `Kernel`, `KernelFunction`, or `Invoke
38
38
  ```csharp
39
39
  using Azure.AI.OpenAI;
40
40
  using Azure.Identity;
41
- using Microsoft.Agents.AI;
41
+ using Microsoft.Extensions.AI;
42
42
 
43
43
  AIAgent agent = new AzureOpenAIClient(
44
44
  new Uri("https://your-resource.openai.azure.com/"),
@@ -104,7 +104,6 @@ builder.Services.AddSingleton<IChatClient>(sp =>
104
104
  ### Using ChatClientAgent
105
105
 
106
106
  ```csharp
107
- using Microsoft.Agents.AI;
108
107
  using Microsoft.Extensions.AI;
109
108
 
110
109
  public class OrderAnalysisAgent
@@ -374,7 +373,7 @@ builder.Services.AddOpenTelemetry()
374
373
 
375
374
  ## Checklist
376
375
 
377
- - [ ] `Microsoft.Agents.AI` + `Microsoft.Agents.AI.OpenAI` installed
376
+ - [ ] `Microsoft.Extensions.AI` + `Microsoft.Extensions.AI.OpenAI` installed
378
377
  - [ ] `IChatClient` registered as singleton via DI
379
378
  - [ ] Agents created with `ChatClientAgent` or `AsAIAgent()`
380
379
  - [ ] Agents registered with `builder.AddAIAgent()` (keyed services)
@@ -391,7 +390,7 @@ builder.Services.AddOpenTelemetry()
391
390
 
392
391
  | Wrong | Correct |
393
392
  |-------|---------|
394
- | `using Microsoft.SemanticKernel` | `using Microsoft.Agents.AI` |
393
+ | `using Microsoft.SemanticKernel` | `using Microsoft.Extensions.AI` |
395
394
  | `Kernel.InvokePromptAsync()` | `agent.RunAsync()` |
396
395
  | `[KernelFunction]` | `AIFunctionFactory.Create()` |
397
396
  | `[AgentTool]` attribute | `[Description]` + `AIFunctionFactory` |
@@ -23,11 +23,14 @@ 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 -->
27
- <PackageReference Include="Microsoft.Agents.AI" Version="1.0.0-preview.*" />
28
- <PackageReference Include="Microsoft.Agents.AI.Workflows" Version="1.0.0-preview.*" />
26
+ <!-- Microsoft.Extensions.AI — core abstractions -->
27
+ <PackageReference Include="Microsoft.Extensions.AI" Version="9.5.0" />
29
28
  ```
30
29
 
30
+ > **Note:** Workflow orchestration APIs (`AgentWorkflowBuilder`, `BuildSequential`, `CreateGroupChatBuilderWith`)
31
+ > are part of the MAF preview that is **not yet published on NuGet**. The patterns documented here reflect
32
+ > the expected GA surface. Until MAF ships, implement sequential/parallel workflows manually using `IChatClient`.
33
+
31
34
  ---
32
35
 
33
36
  ## 5 Orchestration Patterns
@@ -51,8 +54,7 @@ Agents execute in order — each agent receives the output of the previous one.
51
54
  ```
52
55
 
53
56
  ```csharp
54
- using Microsoft.Agents.AI;
55
- using Microsoft.Agents.AI.Workflows;
57
+ using Microsoft.Extensions.AI;
56
58
 
57
59
  AIAgent writer = new ChatClientAgent(chatClient, new ChatClientAgentOptions
58
60
  {
@@ -330,7 +332,7 @@ var agent = chatClient.AsAIAgent(instructions: prompt, name: "Analyst");
330
332
 
331
333
  ## Checklist
332
334
 
333
- - [ ] `Microsoft.Agents.AI.Workflows` package installed
335
+ - [ ] `Microsoft.Extensions.AI` package installed
334
336
  - [ ] Orchestration pattern selected and justified
335
337
  - [ ] Agents have clear, single responsibilities
336
338
  - [ ] Workflow built with `AgentWorkflowBuilder`
@@ -239,7 +239,7 @@ EF.Functions.VectorDistance(vector1, vector2, DistanceFunction.Cosine)
239
239
  ### Implementação RAG com Agent Framework
240
240
 
241
241
  ```csharp
242
- using Microsoft.Agents.AI;
242
+ using Microsoft.Extensions.AI;
243
243
 
244
244
  public interface IDocumentAssistantAgent
245
245
  {
@@ -5,7 +5,6 @@
5
5
 
6
6
  using System.ComponentModel;
7
7
  using System.Text.Json;
8
- using Microsoft.Agents.AI;
9
8
  using Microsoft.Extensions.AI;
10
9
  using Microsoft.Extensions.Logging;
11
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymorphism-tech/morph-spec",
3
- "version": "4.18.0",
3
+ "version": "4.19.0",
4
4
  "description": "MORPH-SPEC: AI-First development framework with validation pipeline and multi-stack support",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -16,6 +16,7 @@ import ora from 'ora';
16
16
  import {
17
17
  orchestrateMcpSetup,
18
18
  installAutoMcps,
19
+ installCompanionSkills,
19
20
  installMcpWithCredentials,
20
21
  generateSetupInstructions,
21
22
  formatMcpStatusTable,
@@ -120,6 +121,16 @@ async function autoInstall(targetPath, stack, existingMcps) {
120
121
  console.log(chalk.gray(` Skipped (already configured): ${result.skipped.join(', ')}`));
121
122
  }
122
123
 
124
+ // Install companion skills for MCPs that define them
125
+ const skillResults = installCompanionSkills(orchestration.autoInstallable);
126
+ for (const r of skillResults) {
127
+ if (r.success) {
128
+ console.log(chalk.green(` ✓ Companion skills installed: ${r.repo}`));
129
+ } else {
130
+ console.log(chalk.yellow(` ⚠ Failed to install companion skills: ${r.repo}`));
131
+ }
132
+ }
133
+
123
134
  console.log('');
124
135
  }
125
136
 
@@ -305,6 +316,16 @@ async function interactiveWizard(targetPath, stack, existingMcps) {
305
316
  const spinner = ora('Installing...').start();
306
317
  const result = await installAutoMcps(targetPath, orchestration.autoInstallable);
307
318
  spinner.succeed(`Installed: ${result.added.join(', ')}`);
319
+
320
+ // Install companion skills for MCPs that define them
321
+ const skillResults = installCompanionSkills(orchestration.autoInstallable);
322
+ for (const r of skillResults) {
323
+ if (r.success) {
324
+ console.log(chalk.green(` ✓ Companion skills: ${r.repo}`));
325
+ } else {
326
+ console.log(chalk.yellow(` ⚠ Companion skills failed: ${r.repo}`));
327
+ }
328
+ }
308
329
  }
309
330
  }
310
331
 
@@ -20,6 +20,7 @@ import { generateSettings, saveIntegrations } from '../../lib/generators/setting
20
20
  import {
21
21
  orchestrateMcpSetup,
22
22
  installAutoMcps,
23
+ installCompanionSkills,
23
24
  installMcpWithCredentials,
24
25
  generateSetupInstructions,
25
26
  formatMcpStatusTable,
@@ -256,6 +257,16 @@ export async function initCommand(options) {
256
257
  for (const name of result.added) {
257
258
  autoInstalled[name] = orchestration.autoInstallable[name];
258
259
  }
260
+
261
+ // Install companion skills for MCPs that define them (e.g., Stitch agent skills)
262
+ const skillResults = installCompanionSkills(orchestration.autoInstallable);
263
+ for (const r of skillResults) {
264
+ if (r.success) {
265
+ logger.info(`✓ Companion skills installed: ${r.repo}`);
266
+ } else {
267
+ logger.warn(`Failed to install companion skills: ${r.repo}`);
268
+ }
269
+ }
259
270
  }
260
271
  }
261
272