@polymorphism-tech/morph-spec 1.0.4 → 2.0.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 (152) hide show
  1. package/CLAUDE.md +1381 -0
  2. package/LICENSE +72 -0
  3. package/README.md +89 -6
  4. package/bin/detect-agents.js +225 -0
  5. package/bin/morph-spec.js +120 -0
  6. package/bin/render-template.js +302 -0
  7. package/bin/semantic-detect-agents.js +246 -0
  8. package/bin/validate-agents-skills.js +239 -0
  9. package/bin/validate-agents.js +69 -0
  10. package/bin/validate-phase.js +263 -0
  11. package/content/.azure/README.md +293 -0
  12. package/content/.azure/docs/azure-devops-setup.md +454 -0
  13. package/content/.azure/docs/branch-strategy.md +398 -0
  14. package/content/.azure/docs/local-development.md +515 -0
  15. package/content/.azure/pipelines/pipeline-variables.yml +34 -0
  16. package/content/.azure/pipelines/prod-pipeline.yml +319 -0
  17. package/content/.azure/pipelines/staging-pipeline.yml +234 -0
  18. package/content/.azure/pipelines/templates/build-dotnet.yml +75 -0
  19. package/content/.azure/pipelines/templates/deploy-app-service.yml +94 -0
  20. package/content/.azure/pipelines/templates/deploy-container-app.yml +120 -0
  21. package/content/.azure/pipelines/templates/infra-deploy.yml +90 -0
  22. package/content/.claude/commands/morph-apply.md +118 -26
  23. package/content/.claude/commands/morph-archive.md +9 -9
  24. package/content/.claude/commands/morph-clarify.md +184 -0
  25. package/content/.claude/commands/morph-design.md +275 -0
  26. package/content/.claude/commands/morph-proposal.md +56 -15
  27. package/content/.claude/commands/morph-setup.md +100 -0
  28. package/content/.claude/commands/morph-status.md +47 -32
  29. package/content/.claude/commands/morph-tasks.md +319 -0
  30. package/content/.claude/commands/morph-uiux.md +211 -0
  31. package/content/.claude/skills/specialists/ai-system-architect.md +604 -0
  32. package/content/.claude/skills/specialists/ms-agent-expert.md +143 -89
  33. package/content/.claude/skills/specialists/ui-ux-designer.md +744 -9
  34. package/content/.claude/skills/stacks/dotnet-blazor.md +244 -8
  35. package/content/.claude/skills/stacks/dotnet-nextjs.md +2 -2
  36. package/content/.morph/.morphversion +5 -0
  37. package/content/.morph/config/agents.json +101 -8
  38. package/content/.morph/config/azure-pricing.json +70 -0
  39. package/content/.morph/config/azure-pricing.schema.json +50 -0
  40. package/content/.morph/config/config.template.json +15 -3
  41. package/content/.morph/docs/STORY-DRIVEN-DEVELOPMENT.md +392 -0
  42. package/content/.morph/hooks/README.md +239 -0
  43. package/content/.morph/hooks/pre-commit-agents.sh +24 -0
  44. package/content/.morph/hooks/pre-commit-all.sh +48 -0
  45. package/content/.morph/hooks/pre-commit-costs.sh +91 -0
  46. package/content/.morph/hooks/pre-commit-specs.sh +49 -0
  47. package/content/.morph/hooks/pre-commit-tests.sh +60 -0
  48. package/content/.morph/project.md +5 -4
  49. package/content/.morph/schemas/agent.schema.json +296 -0
  50. package/content/.morph/standards/agent-framework-setup.md +453 -0
  51. package/content/.morph/standards/architecture.md +142 -7
  52. package/content/.morph/standards/azure.md +218 -23
  53. package/content/.morph/standards/coding.md +47 -12
  54. package/content/.morph/standards/dotnet10-migration.md +494 -0
  55. package/content/.morph/standards/fluent-ui-setup.md +590 -0
  56. package/content/.morph/standards/migration-guide.md +514 -0
  57. package/content/.morph/standards/passkeys-auth.md +423 -0
  58. package/content/.morph/standards/vector-search-rag.md +536 -0
  59. package/content/.morph/state.json +18 -0
  60. package/content/.morph/templates/FluentDesignTheme.cs +149 -0
  61. package/content/.morph/templates/MudTheme.cs +281 -0
  62. package/content/.morph/templates/contracts.cs +55 -55
  63. package/content/.morph/templates/decisions.md +4 -4
  64. package/content/.morph/templates/design-system.css +226 -0
  65. package/content/.morph/templates/infra/.dockerignore.example +89 -0
  66. package/content/.morph/templates/infra/Dockerfile.example +82 -0
  67. package/content/.morph/templates/infra/README.md +286 -0
  68. package/content/.morph/templates/infra/app-service.bicep +164 -0
  69. package/content/.morph/templates/infra/deploy.ps1 +229 -0
  70. package/content/.morph/templates/infra/deploy.sh +208 -0
  71. package/content/.morph/templates/infra/main.bicep +41 -7
  72. package/content/.morph/templates/infra/parameters.dev.json +6 -0
  73. package/content/.morph/templates/infra/parameters.prod.json +6 -0
  74. package/content/.morph/templates/infra/parameters.staging.json +29 -0
  75. package/content/.morph/templates/proposal.md +3 -3
  76. package/content/.morph/templates/recap.md +3 -3
  77. package/content/.morph/templates/spec.md +9 -8
  78. package/content/.morph/templates/sprint-status.yaml +68 -0
  79. package/content/.morph/templates/state.template.json +222 -0
  80. package/content/.morph/templates/story.md +143 -0
  81. package/content/.morph/templates/tasks.md +1 -1
  82. package/content/.morph/templates/ui-components.md +276 -0
  83. package/content/.morph/templates/ui-design-system.md +286 -0
  84. package/content/.morph/templates/ui-flows.md +336 -0
  85. package/content/.morph/templates/ui-mockups.md +133 -0
  86. package/content/.morph/test-infra/example.bicep +59 -0
  87. package/content/CLAUDE.md +124 -0
  88. package/content/README.md +79 -0
  89. package/detectors/config-detector.js +223 -0
  90. package/detectors/conversation-analyzer.js +163 -0
  91. package/detectors/index.js +84 -0
  92. package/detectors/standards-generator.js +275 -0
  93. package/detectors/structure-detector.js +221 -0
  94. package/docs/README.md +149 -0
  95. package/docs/api/cost-calculator.js.html +513 -0
  96. package/docs/api/design-system-generator.js.html +382 -0
  97. package/docs/api/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  98. package/docs/api/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  99. package/docs/api/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  100. package/docs/api/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  101. package/docs/api/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  102. package/docs/api/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  103. package/docs/api/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  104. package/docs/api/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  105. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  106. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  107. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  108. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  109. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  110. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  111. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  112. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  113. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  114. package/docs/api/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  115. package/docs/api/global.html +5263 -0
  116. package/docs/api/index.html +96 -0
  117. package/docs/api/scripts/collapse.js +39 -0
  118. package/docs/api/scripts/commonNav.js +28 -0
  119. package/docs/api/scripts/linenumber.js +25 -0
  120. package/docs/api/scripts/nav.js +12 -0
  121. package/docs/api/scripts/polyfill.js +4 -0
  122. package/docs/api/scripts/prettify/Apache-License-2.0.txt +202 -0
  123. package/docs/api/scripts/prettify/lang-css.js +2 -0
  124. package/docs/api/scripts/prettify/prettify.js +28 -0
  125. package/docs/api/scripts/search.js +99 -0
  126. package/docs/api/state-manager.js.html +423 -0
  127. package/docs/api/styles/jsdoc.css +776 -0
  128. package/docs/api/styles/prettify.css +80 -0
  129. package/docs/examples.md +328 -0
  130. package/docs/getting-started.md +302 -0
  131. package/docs/installation.md +361 -0
  132. package/docs/templates.md +418 -0
  133. package/docs/validation-checklist.md +266 -0
  134. package/package.json +39 -12
  135. package/src/commands/cost.js +181 -0
  136. package/src/commands/create-story.js +283 -0
  137. package/src/commands/detect.js +104 -0
  138. package/src/commands/doctor.js +67 -0
  139. package/src/commands/generate.js +149 -0
  140. package/src/commands/init.js +69 -45
  141. package/src/commands/shard-spec.js +224 -0
  142. package/src/commands/sprint-status.js +250 -0
  143. package/src/commands/state.js +333 -0
  144. package/src/commands/sync.js +167 -0
  145. package/src/commands/update-pricing.js +206 -0
  146. package/src/commands/update.js +88 -13
  147. package/src/lib/complexity-analyzer.js +292 -0
  148. package/src/lib/cost-calculator.js +429 -0
  149. package/src/lib/design-system-generator.js +298 -0
  150. package/src/lib/state-manager.js +340 -0
  151. package/src/utils/file-copier.js +59 -0
  152. package/src/utils/version-checker.js +175 -0
@@ -0,0 +1,91 @@
1
+ #!/bin/bash
2
+
3
+ # MORPH-SPEC Pre-commit Hook: Cost Validation
4
+ #
5
+ # Valida custos de arquivos Bicep antes de permitir commit.
6
+ # Bloqueia commits que excedem o limite configurado sem ADR.
7
+ #
8
+ # Instalação:
9
+ # cp .morph/hooks/pre-commit-costs.sh .git/hooks/pre-commit
10
+ # chmod +x .git/hooks/pre-commit
11
+ #
12
+ # Ou use symlink:
13
+ # ln -s ../../.morph/hooks/pre-commit-costs.sh .git/hooks/pre-commit
14
+
15
+ set -e
16
+
17
+ # Colors
18
+ RED='\033[0;31m'
19
+ YELLOW='\033[1;33m'
20
+ GREEN='\033[0;32m'
21
+ NC='\033[0m' # No Color
22
+
23
+ echo -e "${GREEN}🔍 MORPH-SPEC: Validating infrastructure costs...${NC}"
24
+
25
+ # Encontrar arquivos Bicep modificados no staged area
26
+ BICEP_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.bicep$' || true)
27
+
28
+ if [ -z "$BICEP_FILES" ]; then
29
+ echo -e "${GREEN}✓ No Bicep files changed, skipping cost validation.${NC}"
30
+ exit 0
31
+ fi
32
+
33
+ echo "Found Bicep files:"
34
+ echo "$BICEP_FILES" | sed 's/^/ - /'
35
+
36
+ # Rodar cost calculator
37
+ RESULT=$(node bin/calculate-costs.js $BICEP_FILES --json 2>&1)
38
+ EXIT_CODE=$?
39
+
40
+ # Parse result JSON
41
+ MONTHLY_COST=$(echo "$RESULT" | grep -o '"monthly":[^,]*' | cut -d':' -f2 | tr -d ' ')
42
+ REQUIRES_ADR=$(echo "$RESULT" | grep -o '"requiresADR":[^,]*' | cut -d':' -f2 | tr -d ' ')
43
+
44
+ echo -e "\n${YELLOW}Estimated Monthly Cost: \$${MONTHLY_COST}${NC}"
45
+
46
+ # Se não requer ADR, aprovar
47
+ if [ "$REQUIRES_ADR" != "true" ]; then
48
+ echo -e "${GREEN}✓ Cost is within limits. Proceeding with commit.${NC}"
49
+ exit 0
50
+ fi
51
+
52
+ # Se requer ADR, verificar se existe decisions.md com ADR de custo
53
+ echo -e "\n${YELLOW}⚠️ Cost exceeds ADR threshold!${NC}"
54
+ echo "Checking for cost ADR in decisions.md..."
55
+
56
+ # Procurar decisions.md em outputs de features
57
+ DECISIONS_FILES=$(find .morph/project/outputs -name "decisions.md" 2>/dev/null || true)
58
+
59
+ ADR_FOUND=false
60
+
61
+ for file in $DECISIONS_FILES; do
62
+ # Procurar por ADR que menciona "cost" ou "Infrastructure Costs"
63
+ if grep -qi "ADR.*cost\|Infrastructure Costs" "$file"; then
64
+ echo -e "${GREEN}✓ Found cost ADR in: $file${NC}"
65
+ ADR_FOUND=true
66
+ break
67
+ fi
68
+ done
69
+
70
+ if [ "$ADR_FOUND" = true ]; then
71
+ echo -e "${GREEN}✓ Cost ADR documented. Proceeding with commit.${NC}"
72
+ exit 0
73
+ else
74
+ echo -e "${RED}❌ COMMIT BLOCKED!${NC}"
75
+ echo ""
76
+ echo "Monthly cost (\$$MONTHLY_COST) exceeds the configured ADR threshold."
77
+ echo ""
78
+ echo "To proceed, you must:"
79
+ echo " 1. Document a cost ADR in .morph/project/outputs/{feature}/decisions.md"
80
+ echo " 2. Include justification for infrastructure costs"
81
+ echo ""
82
+ echo "Example ADR:"
83
+ echo " ## ADR-XXX: Infrastructure Costs"
84
+ echo " "
85
+ echo " **Estimated Monthly Cost:** \$$MONTHLY_COST"
86
+ echo " "
87
+ echo " **Justification:**"
88
+ echo " {Why these resources are necessary and cost-effective}"
89
+ echo ""
90
+ exit 1
91
+ fi
@@ -0,0 +1,49 @@
1
+ #!/bin/bash
2
+ # MORPH-SPEC Pre-Commit Hook: Spec Validation
3
+ # Validates that spec.md files have required sections
4
+
5
+ echo "🔍 Validating spec files..."
6
+
7
+ # Find modified spec.md files
8
+ SPEC_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep 'spec\.md$')
9
+
10
+ if [ -z "$SPEC_FILES" ]; then
11
+ echo "✓ No spec files modified"
12
+ exit 0
13
+ fi
14
+
15
+ HAS_ERRORS=false
16
+
17
+ for spec_file in $SPEC_FILES; do
18
+ echo "Checking: $spec_file"
19
+
20
+ # Required sections
21
+ REQUIRED_SECTIONS=(
22
+ "## 📋 Metadata"
23
+ "## 🎯 Overview"
24
+ "## 🏗️ Technical Design"
25
+ "## ✅ Acceptance Criteria"
26
+ )
27
+
28
+ for section in "${REQUIRED_SECTIONS[@]}"; do
29
+ if ! grep -q "$section" "$spec_file"; then
30
+ echo " ❌ Missing section: $section"
31
+ HAS_ERRORS=true
32
+ fi
33
+ done
34
+
35
+ # Check if has at least one user story or requirement
36
+ if ! grep -qi "user story\|requirement\|acceptance criteria" "$spec_file"; then
37
+ echo " ⚠️ Warning: No user stories or requirements found"
38
+ fi
39
+ done
40
+
41
+ if [ "$HAS_ERRORS" = true ]; then
42
+ echo ""
43
+ echo "❌ COMMIT BLOCKED: spec.md files are incomplete"
44
+ echo " Add missing sections before committing"
45
+ exit 1
46
+ fi
47
+
48
+ echo "✓ All spec files are valid"
49
+ exit 0
@@ -0,0 +1,60 @@
1
+ #!/bin/bash
2
+ # MORPH-SPEC Pre-Commit Hook: Test Coverage
3
+ # Ensures new code has corresponding tests
4
+
5
+ echo "🧪 Checking test coverage..."
6
+
7
+ # Find modified C# files (excluding tests)
8
+ CS_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.cs$' | grep -v 'Tests\|Test\.cs$')
9
+
10
+ if [ -z "$CS_FILES" ]; then
11
+ echo "✓ No production code modified"
12
+ exit 0
13
+ fi
14
+
15
+ MISSING_TESTS=false
16
+
17
+ for cs_file in $CS_FILES; do
18
+ # Extract class name
19
+ class_name=$(basename "$cs_file" .cs)
20
+
21
+ # Look for corresponding test file
22
+ test_patterns=(
23
+ "*/${class_name}Tests.cs"
24
+ "*/${class_name}Test.cs"
25
+ "*/Test${class_name}.cs"
26
+ )
27
+
28
+ FOUND_TEST=false
29
+ for pattern in "${test_patterns[@]}"; do
30
+ if find . -path "$pattern" 2>/dev/null | grep -q .; then
31
+ FOUND_TEST=true
32
+ break
33
+ fi
34
+ done
35
+
36
+ if [ "$FOUND_TEST" = false ]; then
37
+ # Check if it's a trivial file (DTO, model, etc.)
38
+ if grep -qi 'record\|DTO\|Model\|Entity' "$cs_file" && ! grep -qi 'class.*{.*public.*{' "$cs_file"; then
39
+ echo " ℹ️ Skipping trivial file: $cs_file"
40
+ continue
41
+ fi
42
+
43
+ echo " ⚠️ No test found for: $cs_file"
44
+ MISSING_TESTS=true
45
+ else
46
+ echo " ✓ Test found for: $cs_file"
47
+ fi
48
+ done
49
+
50
+ if [ "$MISSING_TESTS" = true ]; then
51
+ echo ""
52
+ echo "⚠️ WARNING: Some files don't have tests"
53
+ echo " Consider adding tests before committing"
54
+ echo " Override with: git commit --no-verify"
55
+ # Don't block, just warn
56
+ exit 0
57
+ fi
58
+
59
+ echo "✓ Test coverage looks good"
60
+ exit 0
@@ -15,11 +15,12 @@
15
15
 
16
16
  | Layer | Technology | Version |
17
17
  |-------|------------|---------|
18
- | Frontend | Blazor Server | .NET 9 |
19
- | Backend | ASP.NET Core | 9.0 |
18
+ | Frontend | Blazor Server | .NET 10 |
19
+ | UI Library | Fluent UI Blazor (recomendado) | 4.0+ |
20
+ | Backend | ASP.NET Core | 10.0 |
20
21
  | Database | Azure SQL | Free Tier |
21
- | ORM | Entity Framework Core | 9.0 |
22
- | AI | MS Agent Framework / Semantic Kernel | Latest |
22
+ | ORM | Entity Framework Core | 10.0 |
23
+ | AI | Microsoft Agent Framework | .NET 10 |
23
24
  | Jobs | Hangfire | Latest |
24
25
  | Hosting | Azure Container Apps | Consumption |
25
26
 
@@ -0,0 +1,296 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://polymorphism.com.br/morph-spec/schemas/agent.schema.json",
4
+ "title": "MORPH-SPEC Agent Configuration Schema",
5
+ "description": "JSON Schema for validating agents.json configuration file",
6
+ "type": "object",
7
+ "required": ["version", "agents"],
8
+ "properties": {
9
+ "version": {
10
+ "type": "string",
11
+ "description": "Schema version",
12
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
13
+ "examples": ["1.0.0", "2.1.0"]
14
+ },
15
+ "agents": {
16
+ "type": "object",
17
+ "description": "Agent definitions organized by type",
18
+ "required": ["core", "specialists"],
19
+ "properties": {
20
+ "core": {
21
+ "type": "array",
22
+ "description": "Core agents (always active)",
23
+ "items": {
24
+ "$ref": "#/definitions/agent"
25
+ },
26
+ "minItems": 1
27
+ },
28
+ "specialists": {
29
+ "type": "array",
30
+ "description": "Specialist agents (activated on-demand by keywords)",
31
+ "items": {
32
+ "$ref": "#/definitions/specialistAgent"
33
+ }
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ }
38
+ },
39
+ "additionalProperties": false,
40
+ "definitions": {
41
+ "agent": {
42
+ "type": "object",
43
+ "description": "Base agent definition",
44
+ "required": ["id", "name", "emoji", "type", "description", "responsibilities"],
45
+ "properties": {
46
+ "id": {
47
+ "type": "string",
48
+ "description": "Unique agent identifier (kebab-case)",
49
+ "pattern": "^[a-z][a-z0-9-]*$",
50
+ "examples": ["standards-architect", "azure-architect"]
51
+ },
52
+ "name": {
53
+ "type": "string",
54
+ "description": "Human-readable agent name",
55
+ "minLength": 3,
56
+ "maxLength": 50,
57
+ "examples": ["Standards Architect", "Azure Architect"]
58
+ },
59
+ "emoji": {
60
+ "type": "string",
61
+ "description": "Agent emoji (single character)",
62
+ "pattern": "^.{1,2}$",
63
+ "examples": ["📐", "☁️", "🔥"]
64
+ },
65
+ "type": {
66
+ "type": "string",
67
+ "description": "Agent type",
68
+ "enum": ["core", "specialist"],
69
+ "examples": ["core", "specialist"]
70
+ },
71
+ "skillPath": {
72
+ "type": "string",
73
+ "description": "Path to agent skill file (relative to repo root)",
74
+ "pattern": "^[^/].*\\.md$",
75
+ "examples": [".claude/skills/specialists/standards-architect.md"]
76
+ },
77
+ "description": {
78
+ "type": "string",
79
+ "description": "Brief agent description (PT-BR or EN)",
80
+ "minLength": 10,
81
+ "maxLength": 200,
82
+ "examples": ["Guardião dos padrões de código e arquitetura"]
83
+ },
84
+ "responsibilities": {
85
+ "type": "array",
86
+ "description": "List of agent responsibilities",
87
+ "items": {
88
+ "type": "string",
89
+ "minLength": 5,
90
+ "maxLength": 150
91
+ },
92
+ "minItems": 1,
93
+ "maxItems": 10,
94
+ "examples": [
95
+ ["Validar aderência aos padrões", "Revisar nomenclatura"]
96
+ ]
97
+ },
98
+ "validatesPhases": {
99
+ "type": "array",
100
+ "description": "Which MORPH phases this agent validates",
101
+ "items": {
102
+ "type": "string",
103
+ "enum": ["setup", "uiux-design", "design", "clarify", "tasks", "implement", "sync"]
104
+ },
105
+ "uniqueItems": true,
106
+ "examples": [["design", "implement"]]
107
+ },
108
+ "expertise": {
109
+ "type": "array",
110
+ "description": "Areas of expertise",
111
+ "items": {
112
+ "type": "string",
113
+ "minLength": 3,
114
+ "maxLength": 100
115
+ },
116
+ "examples": [["Container Apps", "Azure SQL", "Bicep"]]
117
+ },
118
+ "patterns": {
119
+ "type": "array",
120
+ "description": "Technical patterns the agent specializes in",
121
+ "items": {
122
+ "type": "string",
123
+ "minLength": 3,
124
+ "maxLength": 100
125
+ },
126
+ "examples": [["CQRS", "Repository", "DI"]]
127
+ },
128
+ "limits": {
129
+ "type": "object",
130
+ "description": "Agent-specific limits (e.g., for Cost Guardian)",
131
+ "additionalProperties": true
132
+ },
133
+ "defaultModel": {
134
+ "type": "string",
135
+ "description": "Default AI model for this agent",
136
+ "examples": ["gpt-4o-mini", "claude-3-5-sonnet"]
137
+ },
138
+ "deliverables": {
139
+ "type": "array",
140
+ "description": "Outputs this agent is responsible for",
141
+ "items": {
142
+ "type": "string",
143
+ "minLength": 3,
144
+ "maxLength": 100
145
+ },
146
+ "examples": [["ui-design-system.md", "ui-mockups.md"]]
147
+ },
148
+ "workflow": {
149
+ "type": "array",
150
+ "description": "Step-by-step workflow for this agent",
151
+ "items": {
152
+ "type": "string",
153
+ "minLength": 5,
154
+ "maxLength": 200
155
+ },
156
+ "examples": [
157
+ ["1. Analisar contexto", "2. Gerar proposta", "3. Validar com usuário"]
158
+ ]
159
+ },
160
+ "techniques": {
161
+ "type": "array",
162
+ "description": "Techniques or methodologies the agent uses",
163
+ "items": {
164
+ "type": "string",
165
+ "minLength": 3,
166
+ "maxLength": 100
167
+ },
168
+ "examples": [["5 Whys", "MoSCoW", "User story mapping"]]
169
+ }
170
+ },
171
+ "additionalProperties": false
172
+ },
173
+ "specialistAgent": {
174
+ "type": "object",
175
+ "required": ["id", "name", "emoji", "type", "description", "responsibilities", "autoActivation"],
176
+ "properties": {
177
+ "id": {
178
+ "type": "string",
179
+ "description": "Unique agent identifier (kebab-case)",
180
+ "pattern": "^[a-z][a-z0-9-]*$"
181
+ },
182
+ "name": {
183
+ "type": "string",
184
+ "description": "Human-readable agent name",
185
+ "minLength": 3,
186
+ "maxLength": 50
187
+ },
188
+ "emoji": {
189
+ "type": "string",
190
+ "description": "Agent emoji (single character)",
191
+ "pattern": "^.{1,2}$"
192
+ },
193
+ "type": {
194
+ "const": "specialist"
195
+ },
196
+ "skillPath": {
197
+ "type": "string",
198
+ "description": "Path to agent skill file",
199
+ "pattern": "^[^/].*\\.md$"
200
+ },
201
+ "description": {
202
+ "type": "string",
203
+ "description": "Brief agent description",
204
+ "minLength": 10,
205
+ "maxLength": 200
206
+ },
207
+ "responsibilities": {
208
+ "type": "array",
209
+ "description": "List of agent responsibilities",
210
+ "items": {
211
+ "type": "string",
212
+ "minLength": 5,
213
+ "maxLength": 150
214
+ },
215
+ "minItems": 1,
216
+ "maxItems": 10
217
+ },
218
+ "autoActivation": {
219
+ "type": "object",
220
+ "description": "Auto-activation configuration for specialist agents",
221
+ "required": ["keywords"],
222
+ "properties": {
223
+ "keywords": {
224
+ "type": "array",
225
+ "description": "Keywords that trigger this agent (lowercase, alphanumeric + hyphens/underscores)",
226
+ "items": {
227
+ "type": "string",
228
+ "pattern": "^[a-z][a-z0-9_-]*$",
229
+ "minLength": 2,
230
+ "maxLength": 50
231
+ },
232
+ "minItems": 1,
233
+ "uniqueItems": true
234
+ },
235
+ "minKeywords": {
236
+ "type": "integer",
237
+ "description": "Minimum number of keyword matches required (default: 1)",
238
+ "minimum": 1,
239
+ "default": 1
240
+ }
241
+ },
242
+ "additionalProperties": false
243
+ },
244
+ "validatesPhases": {
245
+ "type": "array",
246
+ "items": {
247
+ "type": "string",
248
+ "enum": ["setup", "uiux-design", "design", "clarify", "tasks", "implement", "sync"]
249
+ },
250
+ "uniqueItems": true
251
+ },
252
+ "expertise": {
253
+ "type": "array",
254
+ "items": {
255
+ "type": "string",
256
+ "minLength": 3,
257
+ "maxLength": 100
258
+ }
259
+ },
260
+ "patterns": {
261
+ "type": "array",
262
+ "items": {
263
+ "type": "string",
264
+ "minLength": 3,
265
+ "maxLength": 100
266
+ }
267
+ },
268
+ "deliverables": {
269
+ "type": "array",
270
+ "items": {
271
+ "type": "string",
272
+ "minLength": 3,
273
+ "maxLength": 100
274
+ }
275
+ },
276
+ "workflow": {
277
+ "type": "array",
278
+ "items": {
279
+ "type": "string",
280
+ "minLength": 5,
281
+ "maxLength": 200
282
+ }
283
+ },
284
+ "techniques": {
285
+ "type": "array",
286
+ "items": {
287
+ "type": "string",
288
+ "minLength": 3,
289
+ "maxLength": 100
290
+ }
291
+ }
292
+ },
293
+ "additionalProperties": false
294
+ }
295
+ }
296
+ }