@polymorphism-tech/morph-spec 4.21.0 → 5.0.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.
- package/CLAUDE.md +57 -71
- package/README.md +2 -2
- package/bin/morph-spec.js +224 -491
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/CLAUDE.md +55 -38
- package/framework/MORPH.md +244 -0
- package/framework/agents.json +127 -1183
- package/framework/commands/morph-apply.md +56 -240
- package/framework/commands/morph-archive.md +48 -85
- package/framework/commands/morph-preflight.md +7 -7
- package/framework/commands/morph-proposal.md +35 -191
- package/framework/commands/morph-status.md +19 -50
- package/framework/commands/morph-troubleshoot.md +2 -2
- package/framework/evals/rubrics/README.md +44 -0
- package/framework/evals/rubrics/architecture.md +46 -0
- package/framework/evals/rubrics/code-quality.md +50 -0
- package/framework/evals/rubrics/contracts.md +47 -0
- package/framework/evals/rubrics/test-coverage.md +50 -0
- package/framework/evals/scenarios/dotnet-crud.yaml +42 -0
- package/framework/evals/scenarios/nextjs-auth.yaml +38 -0
- package/framework/evals/suites/standard.yaml +5 -0
- package/framework/evals/trace-schema.md +67 -0
- package/framework/hooks/claude-code/core/README.md +3 -0
- package/framework/hooks/claude-code/core/denylist.json +14 -0
- package/framework/hooks/claude-code/{pre-tool-use → core}/enforce-phase-writes.js +5 -5
- package/framework/hooks/claude-code/core/post-edit-typecheck.js +69 -0
- package/framework/hooks/claude-code/core/pre-bash-denylist.js +29 -0
- package/framework/hooks/claude-code/{pre-tool-use → core}/protect-spec-files.js +4 -6
- package/framework/hooks/claude-code/{stop → core}/validate-completion.js +13 -82
- package/framework/hooks/shared/phase-utils.js +20 -28
- package/framework/hooks/shared/state-reader.js +4 -5
- package/framework/{skills/level-0-meta/mcp-registry.json → mcp/registry.json} +254 -210
- package/framework/phases.json +40 -114
- package/framework/rubrics/eval-rubric.json +66 -0
- package/framework/skills/README.md +39 -64
- package/framework/skills/core/README.md +3 -0
- package/framework/skills/core/morph-brainstorming/SKILL.md +102 -0
- package/framework/skills/core/morph-eval/SKILL.md +57 -0
- package/framework/skills/core/morph-implement/SKILL.md +83 -0
- package/framework/skills/core/morph-plan/SKILL.md +64 -0
- package/framework/skills/core/morph-review/SKILL.md +62 -0
- package/framework/skills/core/morph-stack-scan/SKILL.md +109 -0
- package/framework/skills/core/morph-standards/SKILL.md +49 -0
- package/framework/standards/STANDARDS.json +32 -0
- package/framework/standards/frontend/design-system/ai-image-generation.md +244 -0
- package/framework/standards/integration/mcp/mcp-tools.md +48 -0
- package/framework/templates/CLAUDE.md.core.guide.md +29 -0
- package/framework/templates/CLAUDE.md.core.template +22 -0
- package/framework/templates/REGISTRY.json +4 -4
- package/framework/workflows/configs/fast-track.json +5 -10
- package/framework/workflows/configs/full.json +4 -8
- package/framework/workflows/configs/quick.json +32 -0
- package/framework/workflows/configs/standard.json +57 -64
- package/package.json +7 -6
- package/src/commands/mcp/mcp-setup.js +58 -31
- package/src/commands/project/doctor.js +69 -70
- package/src/commands/project/init.js +26 -5
- package/src/commands/project/status.js +18 -19
- package/src/commands/state/approve.js +1 -1
- package/src/commands/validation/validate-feature.js +18 -112
- package/src/core/paths/output-schema.js +133 -151
- package/src/core/state/phase-state-machine.js +10 -24
- package/src/core/state/state-manager.js +17 -17
- package/src/core/workflows/workflow-detector.js +214 -31
- package/src/core/workflows/workflow-router.js +204 -0
- package/src/dashboard/app/pages/AgentMap.jsx +32 -33
- package/src/dashboard/app/pages/LiveState.jsx +1 -1
- package/src/dashboard/app/pages/PhasePipeline.jsx +2 -4
- package/src/dashboard/app/pages/SkillsLibrary.jsx +2 -3
- package/src/dashboard/app/pages/Workflows.jsx +2 -2
- package/src/dashboard/scanner/agents-scanner.js +30 -35
- package/src/lib/agents/metrics-aggregator.js +1 -1
- package/src/lib/agents/output-collector.js +7 -8
- package/src/lib/context/context-builder.js +289 -0
- package/src/lib/detectors/claude-config-detector.js +19 -3
- package/src/lib/generators/context-generator.js +20 -42
- package/src/lib/generators/index.js +1 -0
- package/src/lib/generators/mandate-generator.js +512 -0
- package/src/lib/generators/metadata-extractor.js +1 -1
- package/src/lib/generators/recap-generator.js +3 -4
- package/src/lib/installers/mcp-installer.js +300 -92
- package/src/lib/phase-chain/phase-validator.js +36 -40
- package/src/lib/stack/stack-profile.js +74 -91
- package/src/lib/tasks/task-parser.js +1 -1
- package/src/lib/tasks/wave-resolver.js +353 -0
- package/src/lib/validators/checkpoint-persistence.js +2 -2
- package/src/lib/validators/content/cross-phase-validator.js +281 -0
- package/src/lib/validators/content/index.js +1 -0
- package/src/lib/validators/shared/emit-validator-dispatch.js +6 -56
- package/src/scripts/global-install.js +2 -27
- package/src/utils/agents-installer.js +224 -447
- package/src/utils/claude-settings-manager.js +57 -15
- package/src/utils/file-copier.js +1 -0
- package/src/utils/hooks-installer.js +15 -117
- package/src/utils/skills-installer.js +12 -18
- package/bin/detect-agents.js +0 -226
- package/bin/task-manager.js +0 -1036
- package/framework/agents/README.md +0 -13
- package/framework/agents/ai-agents/ai-system-architect.md +0 -194
- package/framework/agents/ai-agents/vector-search-expert.md +0 -247
- package/framework/agents/architecture/architecture-expert.md +0 -98
- package/framework/agents/architecture/morph-spec-architect.md +0 -66
- package/framework/agents/architecture/packages-validator.md +0 -89
- package/framework/agents/architecture/security-expert.md +0 -79
- package/framework/agents/architecture/seo-growth-hacker.md +0 -168
- package/framework/agents/architecture/standards-architect.md +0 -153
- package/framework/agents/backend/dotnet-senior.md +0 -163
- package/framework/agents/backend/ef-modeler.md +0 -119
- package/framework/agents/backend/hangfire-orchestrator.md +0 -133
- package/framework/agents/backend/ms-agent-expert.md +0 -55
- package/framework/agents/backend/neon-expert.md +0 -379
- package/framework/agents/frontend/css-specialist.md +0 -89
- package/framework/agents/frontend/design-system-validator.md +0 -100
- package/framework/agents/frontend/gsap-animator.md +0 -131
- package/framework/agents/frontend/nextjs-component-validator.md +0 -97
- package/framework/agents/frontend/nextjs-expert.md +0 -201
- package/framework/agents/frontend/ui-designer.md +0 -259
- package/framework/agents/infrastructure/infra-architect.md +0 -215
- package/framework/agents/integrations/asaas-financial.md +0 -138
- package/framework/agents/integrations/neon-auth.md +0 -151
- package/framework/agents/integrations/resend-email.md +0 -127
- package/framework/hooks/claude-code/post-tool-use/agent-complete.js +0 -122
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +0 -363
- package/framework/hooks/claude-code/post-tool-use/handle-tool-failure.js +0 -78
- package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +0 -194
- package/framework/hooks/claude-code/pre-compact/save-morph-context.js +0 -199
- package/framework/hooks/claude-code/pre-tool-use/task-tracking-guard.js +0 -55
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +0 -323
- package/framework/hooks/claude-code/session-start/post-compact-restore.js +0 -41
- package/framework/hooks/claude-code/session-start/resume-context.js +0 -77
- package/framework/hooks/claude-code/teammate-idle/teammate-idle.js +0 -90
- package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +0 -114
- package/framework/hooks/shared/compact-restore.js +0 -123
- package/framework/hooks/shared/dispatch-helpers.js +0 -147
- package/framework/hooks/shared/skill-reminder-helpers.js +0 -79
- package/framework/hooks/shared/stale-task-reset.js +0 -57
- package/framework/hooks/shared/worktree-helpers.js +0 -75
- package/framework/skills/level-0-meta/README.md +0 -7
- package/framework/skills/level-0-meta/morph-agent-teams/SKILL.md +0 -472
- package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +0 -174
- package/framework/skills/level-0-meta/morph-brainstorming/references/proposal-example.md +0 -138
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +0 -145
- package/framework/skills/level-0-meta/morph-code-review/SKILL.md +0 -250
- package/framework/skills/level-0-meta/morph-code-review/references/review-example.md +0 -164
- package/framework/skills/level-0-meta/morph-code-review/references/review-guidelines.md +0 -100
- package/framework/skills/level-0-meta/morph-code-review/scripts/scan-csharp.mjs +0 -151
- package/framework/skills/level-0-meta/morph-code-review-nextjs/SKILL.md +0 -165
- package/framework/skills/level-0-meta/morph-code-review-nextjs/references/review-example-nextjs.md +0 -254
- package/framework/skills/level-0-meta/morph-code-review-nextjs/scripts/scan-nextjs.mjs +0 -189
- package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +0 -344
- package/framework/skills/level-0-meta/morph-frontend-review/scripts/scan-accessibility.mjs +0 -376
- package/framework/skills/level-0-meta/morph-init/SKILL.md +0 -537
- package/framework/skills/level-0-meta/morph-parallel-dispatch/SKILL.md +0 -225
- package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +0 -382
- package/framework/skills/level-0-meta/morph-post-implementation/scripts/detect-dev-server.mjs +0 -153
- package/framework/skills/level-0-meta/morph-post-implementation/scripts/detect-stack.mjs +0 -234
- package/framework/skills/level-0-meta/morph-simulation-checklist/SKILL.md +0 -106
- package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +0 -243
- package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +0 -169
- package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +0 -148
- package/framework/skills/level-0-meta/morph-verification-before-completion/scripts/check-phase-outputs.mjs +0 -110
- package/framework/skills/level-1-workflows/README.md +0 -7
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +0 -269
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +0 -453
- package/framework/skills/level-1-workflows/morph-phase-design/references/architecture-analysis-guide.md +0 -44
- package/framework/skills/level-1-workflows/morph-phase-design/references/spec-authoring-guide.md +0 -55
- package/framework/skills/level-1-workflows/morph-phase-design/references/spec-example.md +0 -253
- package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +0 -38
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +0 -493
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/code-quality-reviewer-prompt.md +0 -50
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +0 -46
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/spec-reviewer-prompt.md +0 -47
- package/framework/skills/level-1-workflows/morph-phase-implement/references/recap-example.md +0 -132
- package/framework/skills/level-1-workflows/morph-phase-implement/references/vsa-implementation-guide.md +0 -92
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +0 -257
- package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +0 -14
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +0 -291
- package/framework/skills/level-1-workflows/morph-phase-tasks/references/task-planning-patterns.md +0 -143
- package/framework/skills/level-1-workflows/morph-phase-tasks/references/tasks-example.md +0 -404
- package/framework/skills/level-1-workflows/morph-phase-tasks/scripts/validate-tasks.mjs +0 -112
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +0 -788
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +0 -147
- package/framework/squad-templates/backend-only.json +0 -47
- package/framework/squad-templates/frontend-only.json +0 -56
- package/framework/squad-templates/full-stack.json +0 -74
- package/src/commands/agents/agent-metrics.js +0 -174
- package/src/commands/agents/audit-dispatch.js +0 -82
- package/src/commands/agents/detect-agents.js +0 -275
- package/src/commands/agents/dispatch-agents.js +0 -461
- package/src/commands/agents/index.js +0 -13
- package/src/commands/agents/manage-agents.js +0 -352
- package/src/commands/agents/project-metrics.js +0 -74
- package/src/commands/phase/phase-reset.js +0 -74
- package/src/commands/scope/escalate.js +0 -217
- package/src/commands/state/advance-phase.js +0 -600
- package/src/commands/state/phase-runner.js +0 -215
- package/src/commands/state/state.js +0 -444
- package/src/commands/task/expand.js +0 -100
- package/src/commands/tasks/index.js +0 -4
- package/src/commands/tasks/task.js +0 -105
- package/src/commands/templates/index.js +0 -5
- package/src/commands/templates/template-render.js +0 -93
- package/src/commands/trust/trust.js +0 -118
- package/src/lib/agents/agents-manager.js +0 -349
- package/src/lib/build/build-runner.js +0 -99
- package/src/lib/checkpoints/checkpoint-hooks.js +0 -111
- package/src/lib/contracts/sprint-contract-generator.js +0 -137
- package/src/lib/scope/impact-analyzer.js +0 -106
- package/src/lib/trust/trust-manager.js +0 -157
- package/src/utils/tier-helpers.js +0 -24
- /package/framework/hooks/claude-code/{post-tool-use → core}/loop-detect.js +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# [Nome do Projeto]
|
|
2
|
+
|
|
3
|
+
[1-2 frases sobre o domínio do sistema, quem usa, qual o principal constraint.]
|
|
4
|
+
|
|
5
|
+
## Stack
|
|
6
|
+
|
|
7
|
+
VSA + .NET 10 + EF Core + Neon (Postgres) + Microsoft Agent Framework + Next.js (App Router) + Tailwind + Framer Motion + Shadcn + Hangfire (quando necessário).
|
|
8
|
+
|
|
9
|
+
Padrões proibidos por padrão: `Guid.NewGuid()` (use `Guid.CreateVersion7()`), classes não-sealed sem justificativa, exceptions como fluxo de controle, Repository pattern.
|
|
10
|
+
|
|
11
|
+
## Harness
|
|
12
|
+
|
|
13
|
+
morph-spec NLH — leia `.morph/framework/MORPH.md` ao iniciar cada sessão. Em seguida, leia `.morph/state.json` para identificar a feature ativa e a fase atual; assuma o papel correspondente (Orchestrator/Specialist/Evaluator) e continue o trabalho.
|
|
14
|
+
|
|
15
|
+
## Standards do projeto
|
|
16
|
+
|
|
17
|
+
[Liste de 3 a 6 IDs de `.morph/framework/standards/STANDARDS.json` específicos deste projeto, se algum desviar do default. Caso contrário, deixe vazio — os defaults do stack já são aplicados pelo morph-plan.]
|
|
18
|
+
|
|
19
|
+
## Slash commands
|
|
20
|
+
|
|
21
|
+
- `/morph-proposal {feature}` — entendimento de negócio + spec/mandate/tasks (Gates 1 e 2)
|
|
22
|
+
- `/morph-apply {feature}` — execução autônoma das tarefas + review (Gate 3)
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"path": "docs/spec.md",
|
|
51
51
|
"location": "framework",
|
|
52
52
|
"category": "documentation",
|
|
53
|
-
"phase": "
|
|
53
|
+
"phase": "plan",
|
|
54
54
|
"required": true,
|
|
55
55
|
"description": "Detailed technical spec with architecture, data model, API contracts",
|
|
56
56
|
"outputName": "spec.md",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"path": "feature/tasks.md",
|
|
71
71
|
"location": "framework",
|
|
72
72
|
"category": "documentation",
|
|
73
|
-
"phase": "
|
|
73
|
+
"phase": "plan",
|
|
74
74
|
"required": true,
|
|
75
75
|
"description": "Task breakdown with IDs, dependencies, estimates, and checkpoints",
|
|
76
76
|
"outputName": "tasks.md",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"path": "feature/decisions.md",
|
|
90
90
|
"location": "framework",
|
|
91
91
|
"category": "documentation",
|
|
92
|
-
"phase": "
|
|
92
|
+
"phase": "plan",
|
|
93
93
|
"required": true,
|
|
94
94
|
"description": "ADR format for documenting architectural decisions with context, alternatives, consequences",
|
|
95
95
|
"outputName": "decisions.md",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"path": "feature/recap.md",
|
|
110
110
|
"location": "framework",
|
|
111
111
|
"category": "documentation",
|
|
112
|
-
"phase": "
|
|
112
|
+
"phase": "implement",
|
|
113
113
|
"required": true,
|
|
114
114
|
"description": "Post-implementation summary with deliverables, metrics, lessons learned",
|
|
115
115
|
"outputName": "recap.md",
|
|
@@ -31,21 +31,16 @@
|
|
|
31
31
|
"tooltip"
|
|
32
32
|
],
|
|
33
33
|
"phases": {
|
|
34
|
-
"run": ["proposal", "
|
|
35
|
-
"skip": ["uiux", "
|
|
34
|
+
"run": ["proposal", "implement"],
|
|
35
|
+
"skip": ["uiux", "plan", "review", "sync"],
|
|
36
36
|
"skipIfCondition": {},
|
|
37
37
|
"combined": {}
|
|
38
38
|
},
|
|
39
|
-
"pausePoints": [
|
|
40
|
-
{
|
|
41
|
-
"phase": "tasks",
|
|
42
|
-
"question": "Approve task breakdown?"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
39
|
+
"pausePoints": [],
|
|
45
40
|
"outputs": {
|
|
46
|
-
"required": ["proposal.md"
|
|
41
|
+
"required": ["proposal.md"],
|
|
47
42
|
"optional": ["recap.md"],
|
|
48
|
-
"skip": ["spec.md", "contracts.cs", "contracts.ts", "plan.md", "design-system.md", "schema-analysis.md"]
|
|
43
|
+
"skip": ["spec.md", "contracts.cs", "contracts.ts", "plan.md", "tasks.md", "mandate.md", "design-system.md", "schema-analysis.md"]
|
|
49
44
|
},
|
|
50
45
|
"priority": 1
|
|
51
46
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"integração"
|
|
30
30
|
],
|
|
31
31
|
"phases": {
|
|
32
|
-
"run": ["proposal", "uiux", "
|
|
32
|
+
"run": ["proposal", "uiux", "plan", "implement", "review", "sync"],
|
|
33
33
|
"skip": [],
|
|
34
34
|
"skipIfCondition": {
|
|
35
35
|
"uiux": "!hasUIAgents"
|
|
@@ -46,17 +46,13 @@
|
|
|
46
46
|
"question": "Approve UI/UX designs?",
|
|
47
47
|
"condition": "hasUIAgents"
|
|
48
48
|
},
|
|
49
|
-
{
|
|
50
|
-
"phase": "design",
|
|
51
|
-
"question": "Approve technical specification?"
|
|
52
|
-
},
|
|
53
49
|
{
|
|
54
50
|
"phase": "plan",
|
|
55
|
-
"question": "Approve
|
|
51
|
+
"question": "Approve spec, plan, and task breakdown?"
|
|
56
52
|
},
|
|
57
53
|
{
|
|
58
|
-
"phase": "
|
|
59
|
-
"question": "Approve
|
|
54
|
+
"phase": "review",
|
|
55
|
+
"question": "Approve for merge/PR?"
|
|
60
56
|
}
|
|
61
57
|
],
|
|
62
58
|
"outputs": {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "quick",
|
|
3
|
+
"name": "Quick (Single-Shot)",
|
|
4
|
+
"description": "Single-shot for trivial changes — skips all ceremony. Typo fixes, config changes, small bug fixes.",
|
|
5
|
+
"priority": 0,
|
|
6
|
+
"criteria": {
|
|
7
|
+
"maxFiles": 2,
|
|
8
|
+
"maxLines": 20,
|
|
9
|
+
"maxComponents": 0,
|
|
10
|
+
"noInfrastructure": true
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"fix", "typo", "rename", "update", "change", "add", "remove",
|
|
14
|
+
"bump", "config", "label", "text", "string", "color", "css",
|
|
15
|
+
"toggle", "flag", "icon", "badge", "tooltip", "placeholder"
|
|
16
|
+
],
|
|
17
|
+
"phases": {
|
|
18
|
+
"run": ["proposal", "implement"],
|
|
19
|
+
"skip": ["uiux", "plan", "review", "sync"],
|
|
20
|
+
"skipIfCondition": {},
|
|
21
|
+
"combined": {}
|
|
22
|
+
},
|
|
23
|
+
"pausePoints": [],
|
|
24
|
+
"outputs": {
|
|
25
|
+
"required": ["proposal.md"],
|
|
26
|
+
"optional": [],
|
|
27
|
+
"skip": ["spec.md", "contracts.cs", "contracts.ts", "plan.md", "tasks.md", "mandate.md", "design-system.md", "schema-analysis.md", "review-report.md"]
|
|
28
|
+
},
|
|
29
|
+
"gates": {
|
|
30
|
+
"autoApproveAll": true
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,64 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "standard",
|
|
3
|
-
"name": "Standard (Medium Complexity)",
|
|
4
|
-
"description": "Medium complexity features - 3-10 files, tactical decisions",
|
|
5
|
-
"criteria": {
|
|
6
|
-
"minFiles": 3,
|
|
7
|
-
"maxFiles": 10,
|
|
8
|
-
"minLines": 50,
|
|
9
|
-
"maxLines": 500,
|
|
10
|
-
"maxComponents": 2,
|
|
11
|
-
"noInfrastructure": true,
|
|
12
|
-
"tacticalDecisions": true
|
|
13
|
-
},
|
|
14
|
-
"keywords": [
|
|
15
|
-
"paginação",
|
|
16
|
-
"pagination",
|
|
17
|
-
"paginate",
|
|
18
|
-
"filtro",
|
|
19
|
-
"filter",
|
|
20
|
-
"filtering",
|
|
21
|
-
"refatorar",
|
|
22
|
-
"refactor",
|
|
23
|
-
"performance",
|
|
24
|
-
"exportar",
|
|
25
|
-
"export",
|
|
26
|
-
"optimize",
|
|
27
|
-
"sorting",
|
|
28
|
-
"search",
|
|
29
|
-
"busca"
|
|
30
|
-
],
|
|
31
|
-
"phases": {
|
|
32
|
-
"run": ["proposal", "
|
|
33
|
-
"skip": [],
|
|
34
|
-
"skipIfCondition": {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"outputs": {
|
|
59
|
-
"required": ["proposal.md", "spec.md", "plan.md", "recap.md"],
|
|
60
|
-
"optional": ["decisions.md"],
|
|
61
|
-
"skip": ["contracts.cs"]
|
|
62
|
-
},
|
|
63
|
-
"priority": 2
|
|
64
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "standard",
|
|
3
|
+
"name": "Standard (Medium Complexity)",
|
|
4
|
+
"description": "Medium complexity features - 3-10 files, tactical decisions",
|
|
5
|
+
"criteria": {
|
|
6
|
+
"minFiles": 3,
|
|
7
|
+
"maxFiles": 10,
|
|
8
|
+
"minLines": 50,
|
|
9
|
+
"maxLines": 500,
|
|
10
|
+
"maxComponents": 2,
|
|
11
|
+
"noInfrastructure": true,
|
|
12
|
+
"tacticalDecisions": true
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"paginação",
|
|
16
|
+
"pagination",
|
|
17
|
+
"paginate",
|
|
18
|
+
"filtro",
|
|
19
|
+
"filter",
|
|
20
|
+
"filtering",
|
|
21
|
+
"refatorar",
|
|
22
|
+
"refactor",
|
|
23
|
+
"performance",
|
|
24
|
+
"exportar",
|
|
25
|
+
"export",
|
|
26
|
+
"optimize",
|
|
27
|
+
"sorting",
|
|
28
|
+
"search",
|
|
29
|
+
"busca"
|
|
30
|
+
],
|
|
31
|
+
"phases": {
|
|
32
|
+
"run": ["proposal", "plan", "implement", "review", "sync"],
|
|
33
|
+
"skip": ["uiux"],
|
|
34
|
+
"skipIfCondition": {},
|
|
35
|
+
"combined": {}
|
|
36
|
+
},
|
|
37
|
+
"pausePoints": [
|
|
38
|
+
{
|
|
39
|
+
"phase": "proposal",
|
|
40
|
+
"question": "Approve feature proposal?"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"phase": "plan",
|
|
44
|
+
"question": "Approve plan and task breakdown?"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"phase": "review",
|
|
48
|
+
"question": "Approve for merge/PR?"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"outputs": {
|
|
52
|
+
"required": ["proposal.md", "spec.md", "plan.md", "recap.md"],
|
|
53
|
+
"optional": ["decisions.md"],
|
|
54
|
+
"skip": ["contracts.cs"]
|
|
55
|
+
},
|
|
56
|
+
"priority": 2
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polymorphism-tech/morph-spec",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "MORPH-SPEC:
|
|
3
|
+
"version": "5.0.1",
|
|
4
|
+
"description": "MORPH-SPEC: NLH (Natural Language Harness) for spec-driven development with Claude Code",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
7
7
|
"claude",
|
|
8
8
|
"ai-coding",
|
|
9
9
|
"ai-first",
|
|
10
10
|
"spec-driven",
|
|
11
|
+
"nlh",
|
|
12
|
+
"natural-language-harness",
|
|
13
|
+
"autonomy",
|
|
11
14
|
"dotnet",
|
|
12
15
|
"dotnet10",
|
|
13
16
|
"nextjs",
|
|
14
|
-
"agent-framework",
|
|
15
17
|
"vsa",
|
|
18
|
+
"vertical-slice",
|
|
16
19
|
"framework",
|
|
17
|
-
"developer-tools",
|
|
18
20
|
"morph",
|
|
19
|
-
"polymorphism"
|
|
20
|
-
"micro-saas"
|
|
21
|
+
"polymorphism"
|
|
21
22
|
],
|
|
22
23
|
"main": "src/index.js",
|
|
23
24
|
"bin": {
|
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
loadMcpRegistry,
|
|
26
26
|
isRemoteMcp,
|
|
27
27
|
generateStitchProxy,
|
|
28
|
-
patchConfigForPlatform
|
|
28
|
+
patchConfigForPlatform,
|
|
29
|
+
setupStitch
|
|
29
30
|
} from '../../lib/installers/mcp-installer.js';
|
|
30
31
|
import { detectClaudeConfig } from '../../lib/detectors/claude-config-detector.js';
|
|
31
32
|
import { detectProject } from '../../lib/detectors/index.js';
|
|
32
|
-
import { installMcpServers } from '../../utils/claude-settings-manager.js';
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Detect the current project's stack.
|
|
@@ -207,35 +207,58 @@ async function setupSpecificMcp(targetPath, name, stack, existingMcps) {
|
|
|
207
207
|
|
|
208
208
|
const credentials = mcpEntry.install.credentials || [];
|
|
209
209
|
|
|
210
|
-
// Stitch MCP —
|
|
210
|
+
// Stitch MCP — automated setup via setupStitch()
|
|
211
211
|
if (name === 'stitch' && !mcpEntry.install.autoInstall) {
|
|
212
|
-
console.log(chalk.cyan(`\n Setting up Stitch MCP (
|
|
212
|
+
console.log(chalk.cyan(`\n Setting up Stitch MCP (automated)\n`));
|
|
213
213
|
console.log(chalk.gray(` Usage: ${mcpEntry.usage}`));
|
|
214
214
|
console.log('');
|
|
215
215
|
|
|
216
|
+
// Allow user to provide GCP project if auto-detection might fail
|
|
217
|
+
let gcpProject;
|
|
216
218
|
const gcpCred = credentials.find(c => c.envVar === 'STITCH_GCP_PROJECT');
|
|
217
|
-
const {
|
|
219
|
+
const { gcpProjectInput } = await inquirer.prompt([{
|
|
218
220
|
type: 'input',
|
|
219
|
-
name: '
|
|
220
|
-
message: gcpCred ? `${gcpCred.name}:` : 'GCP Project ID:',
|
|
221
|
+
name: 'gcpProjectInput',
|
|
222
|
+
message: gcpCred ? `${gcpCred.name} (leave blank for auto-detect):` : 'GCP Project ID (blank for auto-detect):',
|
|
221
223
|
}]);
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
if (gcpProjectInput?.trim()) gcpProject = gcpProjectInput.trim();
|
|
225
|
+
|
|
226
|
+
const spinner = ora('Setting up Stitch MCP...').start();
|
|
227
|
+
const result = await setupStitch(targetPath, { gcpProject });
|
|
228
|
+
|
|
229
|
+
// Report step-by-step results
|
|
230
|
+
for (const step of result.steps) {
|
|
231
|
+
if (step.success) {
|
|
232
|
+
switch (step.step) {
|
|
233
|
+
case 'find-gcloud': spinner.text = `gcloud found (${step.source})`; break;
|
|
234
|
+
case 'verify-adc': spinner.text = 'ADC credentials verified'; break;
|
|
235
|
+
case 'detect-project': spinner.text = `GCP project: ${step.gcpProject}`; break;
|
|
236
|
+
case 'enable-api': spinner.text = 'Stitch API enabled'; break;
|
|
237
|
+
case 'generate-proxy': spinner.text = `Proxy generated: ${step.proxyPath}`; break;
|
|
238
|
+
case 'install-mcp': spinner.text = 'MCP config installed in .mcp.json'; break;
|
|
239
|
+
case 'health-check': spinner.text = `Health-check passed (protocol ${step.protocolVersion})`; break;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
227
242
|
}
|
|
228
243
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
console.log(chalk.green(` ✓ Stitch MCP configured (using OAuth proxy)`));
|
|
244
|
+
if (result.success) {
|
|
245
|
+
spinner.succeed('Stitch MCP setup complete');
|
|
246
|
+
for (const step of result.steps) {
|
|
247
|
+
if (step.step === 'health-check' && step.success) {
|
|
248
|
+
console.log(chalk.green(` ✓ Health-check passed (protocol ${step.protocolVersion})`));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
237
251
|
} else {
|
|
238
|
-
|
|
252
|
+
const failedStep = result.steps.find(s => !s.success && s.step !== 'enable-api' && s.step !== 'health-check');
|
|
253
|
+
spinner.fail(`Stitch setup failed at: ${failedStep?.step || 'unknown'}`);
|
|
254
|
+
if (failedStep?.error) {
|
|
255
|
+
console.log(chalk.red(` ${failedStep.error}`));
|
|
256
|
+
}
|
|
257
|
+
// Show health-check warning if it failed but setup otherwise succeeded
|
|
258
|
+
const healthStep = result.steps.find(s => s.step === 'health-check');
|
|
259
|
+
if (healthStep && !healthStep.success) {
|
|
260
|
+
console.log(chalk.yellow(` ⚠ Health-check: ${healthStep.error}`));
|
|
261
|
+
}
|
|
239
262
|
}
|
|
240
263
|
|
|
241
264
|
if (mcpEntry.companionSkills?.installCommand) {
|
|
@@ -292,7 +315,7 @@ async function setupSpecificMcp(targetPath, name, stack, existingMcps) {
|
|
|
292
315
|
const { installNow } = await inquirer.prompt([{
|
|
293
316
|
type: 'confirm',
|
|
294
317
|
name: 'installNow',
|
|
295
|
-
message: 'Add to .
|
|
318
|
+
message: 'Add to .mcp.json now?',
|
|
296
319
|
default: true
|
|
297
320
|
}]);
|
|
298
321
|
|
|
@@ -345,7 +368,7 @@ async function setupSpecificMcp(targetPath, name, stack, existingMcps) {
|
|
|
345
368
|
} else {
|
|
346
369
|
// Show config snippet
|
|
347
370
|
const instructions = generateSetupInstructions(name, mcpEntry);
|
|
348
|
-
console.log(chalk.gray('\n Add to .
|
|
371
|
+
console.log(chalk.gray('\n Add to .mcp.json → mcpServers:'));
|
|
349
372
|
console.log(chalk.gray(' ' + '─'.repeat(55)));
|
|
350
373
|
for (const line of instructions.configSnippet.split('\n')) {
|
|
351
374
|
console.log(chalk.gray(` ${line}`));
|
|
@@ -424,20 +447,24 @@ async function interactiveWizard(targetPath, stack, existingMcps) {
|
|
|
424
447
|
}]);
|
|
425
448
|
|
|
426
449
|
if (setupNow) {
|
|
427
|
-
// Stitch —
|
|
450
|
+
// Stitch — automated setup via setupStitch()
|
|
428
451
|
if (name === 'stitch' && !entry.install.autoInstall) {
|
|
429
452
|
const gcpCred = entry.install.credentials?.find(c => c.envVar === 'STITCH_GCP_PROJECT');
|
|
430
453
|
const { gcpProject } = await inquirer.prompt([{
|
|
431
454
|
type: 'input',
|
|
432
455
|
name: 'gcpProject',
|
|
433
|
-
message: gcpCred ? `${gcpCred.name}:` : 'GCP Project ID:',
|
|
456
|
+
message: gcpCred ? `${gcpCred.name} (blank for auto-detect):` : 'GCP Project ID (blank for auto-detect):',
|
|
434
457
|
}]);
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
458
|
+
|
|
459
|
+
const stitchSpinner = ora('Setting up Stitch MCP...').start();
|
|
460
|
+
const stitchResult = await setupStitch(targetPath, { gcpProject: gcpProject?.trim() || undefined });
|
|
461
|
+
if (stitchResult.success) {
|
|
462
|
+
stitchSpinner.succeed('Stitch MCP setup complete');
|
|
463
|
+
} else {
|
|
464
|
+
const failedStep = stitchResult.steps.find(s => !s.success && s.step !== 'enable-api' && s.step !== 'health-check');
|
|
465
|
+
stitchSpinner.fail(`Stitch setup failed: ${failedStep?.error || 'unknown'}`);
|
|
466
|
+
}
|
|
467
|
+
if (entry.companionSkills?.installCommand) {
|
|
441
468
|
const skillResults = installCompanionSkills({ stitch: entry });
|
|
442
469
|
for (const r of skillResults) {
|
|
443
470
|
if (r.success) console.log(chalk.green(` ✓ Companion skills: ${r.repo}`));
|