@onion-architect-ai/cli 4.1.0-beta.1 → 4.1.0-beta.2
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/dist/cli.js +8 -7
- package/dist/cli.js.map +1 -1
- package/package.json +4 -3
- package/templates/.cursor/agents/compliance/iso-22301-specialist.md +917 -0
- package/templates/.cursor/agents/compliance/iso-27001-specialist.md +641 -0
- package/templates/.cursor/agents/compliance/pmbok-specialist.md +669 -0
- package/templates/.cursor/agents/compliance/security-information-master.md +824 -0
- package/templates/.cursor/agents/compliance/soc2-specialist.md +818 -0
- package/templates/.cursor/agents/deployment/docker-specialist.md +1192 -0
- package/templates/.cursor/agents/meta/agent-creator-specialist.md +1135 -0
- package/templates/.cursor/agents/meta/command-creator-specialist.md +1519 -0
- package/templates/.cursor/agents/meta/metaspec-gate-keeper.md +240 -0
- package/templates/.cursor/agents/meta/onion.md +753 -0
- package/templates/.cursor/agents/research/research-agent.md +292 -0
- package/templates/.cursor/agents/review/corporate-compliance-specialist.md +370 -0
- package/templates/.cursor/commands/common/prompts/README.md +187 -0
- package/templates/.cursor/commands/common/prompts/clickup-patterns.md +144 -0
- package/templates/.cursor/commands/common/prompts/code-review-checklist.md +168 -0
- package/templates/.cursor/commands/common/prompts/git-workflow-patterns.md +235 -0
- package/templates/.cursor/commands/common/prompts/output-formats.md +240 -0
- package/templates/.cursor/commands/common/prompts/technical.md +172 -0
- package/templates/.cursor/commands/common/prompts/validation-rules.md +173 -0
- package/templates/.cursor/commands/common/templates/abstraction-template.md +400 -0
- package/templates/.cursor/commands/common/templates/agent-template.md +353 -0
- package/templates/.cursor/commands/common/templates/business_context_template.md +748 -0
- package/templates/.cursor/commands/common/templates/command-template.md +273 -0
- package/templates/.cursor/commands/common/templates/technical_context_template.md +526 -0
- package/templates/.cursor/commands/development/runflow-dev.md +465 -0
- package/templates/.cursor/commands/docs/build-compliance-docs.md +143 -0
- package/templates/.cursor/commands/git/README.md +606 -0
- package/templates/.cursor/commands/meta/all-tools.md +50 -0
- package/templates/.cursor/commands/meta/analyze-complex-problem.md +186 -0
- package/templates/.cursor/commands/meta/create-abstraction.md +859 -0
- package/templates/.cursor/commands/meta/create-agent-express.md +83 -0
- package/templates/.cursor/commands/meta/create-agent.md +210 -0
- package/templates/.cursor/commands/meta/create-command.md +203 -0
- package/templates/.cursor/commands/meta/create-knowledge-base.md +143 -0
- package/templates/.cursor/commands/meta/create-task-structure.md +150 -0
- package/templates/.cursor/commands/meta/setup-integration.md +257 -0
- package/templates/.cursor/commands/onion/setup.md +843 -0
- package/templates/.cursor/commands/onion.md +168 -0
- package/templates/.cursor/commands/product/README.md +230 -0
- package/templates/.cursor/commands/quick/analisys.md +17 -0
- package/templates/.cursor/commands/validate/collab/pair-testing.md +633 -0
- package/templates/.cursor/commands/validate/collab/three-amigos.md +505 -0
- package/templates/.cursor/commands/validate/qa-points/estimate.md +660 -0
- package/templates/.cursor/commands/validate/test-strategy/analyze.md +1134 -0
- package/templates/.cursor/commands/validate/test-strategy/create.md +392 -0
- package/templates/.cursor/commands/validate/workflow.md +360 -0
- package/templates/.cursor/commands/warm-up.md +91 -0
- package/templates/.cursor/docs/architecture/acoplamento-clickup-problema-analise.md +446 -0
- package/templates/.cursor/docs/architecture/desacoplamento-roadmap.md +360 -0
- package/templates/.cursor/docs/architecture/validacao-fase-1.md +219 -0
- package/templates/.cursor/docs/c4/c4-detection-rules.md +395 -0
- package/templates/.cursor/docs/c4/c4-documentation-templates.md +579 -0
- package/templates/.cursor/docs/c4/c4-mermaid-patterns.md +331 -0
- package/templates/.cursor/docs/c4/c4-templates.md +256 -0
- package/templates/.cursor/docs/clickup/clickup-acceptance-criteria-strategy.md +329 -0
- package/templates/.cursor/docs/clickup/clickup-auto-update-strategy.md +318 -0
- package/templates/.cursor/docs/clickup/clickup-comment-formatter.md +239 -0
- package/templates/.cursor/docs/clickup/clickup-description-fix.md +355 -0
- package/templates/.cursor/docs/clickup/clickup-dual-comment-strategy.md +505 -0
- package/templates/.cursor/docs/clickup/clickup-formatting.md +302 -0
- package/templates/.cursor/docs/clickup/separador-tamanho-otimizado.md +256 -0
- package/templates/.cursor/docs/engineer/pre-pr-acceptance-validation.md +256 -0
- package/templates/.cursor/docs/onion/ESPERANTO.md +278 -0
- package/templates/.cursor/docs/onion/agents-reference.md +832 -0
- package/templates/.cursor/docs/onion/clickup-integration.md +738 -0
- package/templates/.cursor/docs/onion/commands-guide.md +807 -0
- package/templates/.cursor/docs/onion/engineering-flows.md +865 -0
- package/templates/.cursor/docs/onion/getting-started.md +741 -0
- package/templates/.cursor/docs/onion/maintenance-checklist.md +388 -0
- package/templates/.cursor/docs/onion/naming-conventions.md +268 -0
- package/templates/.cursor/docs/onion/practical-examples.md +782 -0
- package/templates/.cursor/docs/product/story-points-integration.md +254 -0
- package/templates/.cursor/docs/product/story-points-validation.md +224 -0
- package/templates/.cursor/docs/reviews/task-manager-docs-review-2025-11-24.md +167 -0
- package/templates/.cursor/docs/strategies/clickup-comment-patterns.md +766 -0
- package/templates/.cursor/docs/strategies/clickup-integration-tests.md +599 -0
- package/templates/.cursor/docs/strategies/clickup-mcp-wrappers-tests.md +854 -0
- package/templates/.cursor/docs/strategies/clickup-regression-tests.md +589 -0
- package/templates/.cursor/docs/strategies/visual-patterns.md +308 -0
- package/templates/.cursor/docs/templates/README.md +624 -0
- package/templates/.cursor/docs/templates/adr-template.md +226 -0
- package/templates/.cursor/docs/templates/analysis-template.md +280 -0
- package/templates/.cursor/docs/templates/execution-plan-template.md +430 -0
- package/templates/.cursor/docs/templates/guide-template.md +367 -0
- package/templates/.cursor/docs/templates/phase-execution-prompt-template.md +504 -0
- package/templates/.cursor/docs/templates/reference-template.md +522 -0
- package/templates/.cursor/docs/templates/solution-template.md +390 -0
- package/templates/.cursor/docs/tools/README.md +325 -0
- package/templates/.cursor/docs/tools/agents.md +330 -0
- package/templates/.cursor/docs/tools/commands.md +606 -0
- package/templates/.cursor/docs/tools/cursor.md +498 -0
- package/templates/.cursor/docs/tools/mcps.md +858 -0
- package/templates/.cursor/docs/tools/rules.md +423 -0
- package/templates/.cursor/rules/language-and-documentation.mdc +371 -0
- package/templates/.cursor/rules/onion-patterns.mdc +197 -0
- package/templates/.cursor/rules/validation-rules.mdc +194 -0
- package/templates/.cursor/utils/clickup-mcp-wrappers.md +671 -0
- package/templates/.cursor/utils/date-time-standards.md +182 -0
- package/templates/.cursor/utils/task-manager/README.md +94 -0
- package/templates/.cursor/utils/task-manager/adapters/asana.md +377 -0
- package/templates/.cursor/utils/task-manager/adapters/clickup.md +467 -0
- package/templates/.cursor/utils/task-manager/adapters/linear.md +421 -0
- package/templates/.cursor/utils/task-manager/detector.md +290 -0
- package/templates/.cursor/utils/task-manager/factory.md +363 -0
- package/templates/.cursor/utils/task-manager/interface.md +248 -0
- package/templates/.cursor/utils/task-manager/types.md +409 -0
- package/templates/.cursor/validation/product-task-validation.md +344 -0
- package/templates/.onion/contexts/business/.context-config.yml +52 -0
- package/templates/.onion/contexts/business/README.md +222 -0
- package/templates/.onion/contexts/business/agents/branding-specialist.md +1030 -0
- package/templates/.onion/contexts/business/agents/clickup-specialist.md +397 -0
- package/templates/.onion/contexts/business/agents/extract-meeting-specialist.md +395 -0
- package/templates/.onion/contexts/business/agents/gamma-specialist.md +1169 -0
- package/templates/.onion/contexts/business/agents/meeting-consolidator.md +483 -0
- package/templates/.onion/contexts/business/agents/pain-price-specialist.md +509 -0
- package/templates/.onion/contexts/business/agents/presentation-orchestrator.md +1191 -0
- package/templates/.onion/contexts/business/agents/product-agent.md +202 -0
- package/templates/.onion/contexts/business/agents/story-points-specialist.md +539 -0
- package/templates/.onion/contexts/business/agents/storytelling-specialist.md +891 -0
- package/templates/.onion/contexts/business/agents/task-specialist.md +618 -0
- package/templates/.onion/contexts/business/agents/whisper-specialist.md +373 -0
- package/templates/.onion/contexts/business/commands/advanced/analyze-pain-price.md +709 -0
- package/templates/.onion/contexts/business/commands/advanced/branding.md +460 -0
- package/templates/.onion/contexts/business/commands/advanced/checklist-sync.md +241 -0
- package/templates/.onion/contexts/business/commands/advanced/presentation.md +189 -0
- package/templates/.onion/contexts/business/commands/advanced/transform-consolidated.md +592 -0
- package/templates/.onion/contexts/business/commands/help.md +212 -0
- package/templates/.onion/contexts/business/commands/intermediate/check.md +48 -0
- package/templates/.onion/contexts/business/commands/intermediate/collect.md +96 -0
- package/templates/.onion/contexts/business/commands/intermediate/consolidate-meetings.md +306 -0
- package/templates/.onion/contexts/business/commands/intermediate/convert-to-tasks.md +220 -0
- package/templates/.onion/contexts/business/commands/intermediate/extract-meeting.md +241 -0
- package/templates/.onion/contexts/business/commands/intermediate/feature.md +431 -0
- package/templates/.onion/contexts/business/commands/intermediate/light-arch.md +97 -0
- package/templates/.onion/contexts/business/commands/intermediate/task-check.md +340 -0
- package/templates/.onion/contexts/business/commands/intermediate/validate-task.md +294 -0
- package/templates/.onion/contexts/business/commands/intermediate/whisper.md +325 -0
- package/templates/.onion/contexts/business/commands/starter/estimate.md +519 -0
- package/templates/.onion/contexts/business/commands/starter/refine.md +186 -0
- package/templates/.onion/contexts/business/commands/starter/spec.md +107 -0
- package/templates/.onion/contexts/business/commands/starter/task.md +585 -0
- package/templates/.onion/contexts/business/commands/starter/warm-up.md +187 -0
- package/templates/.onion/contexts/technical/.context-config.yml +64 -0
- package/templates/.onion/contexts/technical/README.md +238 -0
- package/templates/.onion/contexts/technical/agents/branch-code-reviewer.md +200 -0
- package/templates/.onion/contexts/technical/agents/branch-doc-writer.md +162 -0
- package/templates/.onion/contexts/technical/agents/branch-metaspec-checker.md +68 -0
- package/templates/.onion/contexts/technical/agents/branch-test-planner.md +177 -0
- package/templates/.onion/contexts/technical/agents/c4-architecture-specialist.md +712 -0
- package/templates/.onion/contexts/technical/agents/c4-documentation-specialist.md +658 -0
- package/templates/.onion/contexts/technical/agents/code-reviewer.md +155 -0
- package/templates/.onion/contexts/technical/agents/cursor-specialist.md +249 -0
- package/templates/.onion/contexts/technical/agents/docs-reverse-engineer.md +418 -0
- package/templates/.onion/contexts/technical/agents/gitflow-specialist.md +1207 -0
- package/templates/.onion/contexts/technical/agents/linux-security-specialist.md +676 -0
- package/templates/.onion/contexts/technical/agents/mermaid-specialist.md +516 -0
- package/templates/.onion/contexts/technical/agents/nodejs-specialist.md +673 -0
- package/templates/.onion/contexts/technical/agents/nx-migration-specialist.md +867 -0
- package/templates/.onion/contexts/technical/agents/nx-monorepo-specialist.md +619 -0
- package/templates/.onion/contexts/technical/agents/postgres-specialist.md +1124 -0
- package/templates/.onion/contexts/technical/agents/react-developer.md +132 -0
- package/templates/.onion/contexts/technical/agents/runflow-specialist.md +278 -0
- package/templates/.onion/contexts/technical/agents/system-doc-orchestrator.md +1388 -0
- package/templates/.onion/contexts/technical/agents/test-agent.md +425 -0
- package/templates/.onion/contexts/technical/agents/test-engineer.md +295 -0
- package/templates/.onion/contexts/technical/agents/test-planner.md +118 -0
- package/templates/.onion/contexts/technical/agents/zen-engine-specialist.md +421 -0
- package/templates/.onion/contexts/technical/commands/advanced/bump.md +43 -0
- package/templates/.onion/contexts/technical/commands/advanced/consolidate-documents.md +424 -0
- package/templates/.onion/contexts/technical/commands/advanced/e2e.md +392 -0
- package/templates/.onion/contexts/technical/commands/advanced/feature-finish.md +90 -0
- package/templates/.onion/contexts/technical/commands/advanced/feature-publish.md +91 -0
- package/templates/.onion/contexts/technical/commands/advanced/feature-start.md +158 -0
- package/templates/.onion/contexts/technical/commands/advanced/hotfix-finish.md +98 -0
- package/templates/.onion/contexts/technical/commands/advanced/hotfix-start.md +94 -0
- package/templates/.onion/contexts/technical/commands/advanced/hotfix.md +186 -0
- package/templates/.onion/contexts/technical/commands/advanced/refine-vision.md +27 -0
- package/templates/.onion/contexts/technical/commands/advanced/release-finish.md +98 -0
- package/templates/.onion/contexts/technical/commands/advanced/release-start.md +95 -0
- package/templates/.onion/contexts/technical/commands/advanced/reverse-consolidate.md +160 -0
- package/templates/.onion/contexts/technical/commands/advanced/validate-phase-sync.md +118 -0
- package/templates/.onion/contexts/technical/commands/help.md +329 -0
- package/templates/.onion/contexts/technical/commands/intermediate/build-business-docs.md +276 -0
- package/templates/.onion/contexts/technical/commands/intermediate/build-index.md +128 -0
- package/templates/.onion/contexts/technical/commands/intermediate/build-tech-docs.md +204 -0
- package/templates/.onion/contexts/technical/commands/intermediate/code-review.md +215 -0
- package/templates/.onion/contexts/technical/commands/intermediate/docs-health.md +142 -0
- package/templates/.onion/contexts/technical/commands/intermediate/fast-commit.md +45 -0
- package/templates/.onion/contexts/technical/commands/intermediate/integration.md +523 -0
- package/templates/.onion/contexts/technical/commands/intermediate/pr-update.md +198 -0
- package/templates/.onion/contexts/technical/commands/intermediate/pre-pr.md +91 -0
- package/templates/.onion/contexts/technical/commands/intermediate/start.md +266 -0
- package/templates/.onion/contexts/technical/commands/intermediate/sync-sessions.md +320 -0
- package/templates/.onion/contexts/technical/commands/intermediate/unit.md +378 -0
- package/templates/.onion/contexts/technical/commands/intermediate/validate-docs.md +159 -0
- package/templates/.onion/contexts/technical/commands/starter/docs.md +39 -0
- package/templates/.onion/contexts/technical/commands/starter/help.md +306 -0
- package/templates/.onion/contexts/technical/commands/starter/init.md +139 -0
- package/templates/.onion/contexts/technical/commands/starter/plan.md +111 -0
- package/templates/.onion/contexts/technical/commands/starter/pr.md +136 -0
- package/templates/.onion/contexts/technical/commands/starter/sync.md +228 -0
- package/templates/.onion/contexts/technical/commands/starter/warm-up.md +173 -0
- package/templates/.onion/contexts/technical/commands/starter/work.md +169 -0
- package/templates/.onion/core/commands/help.md +388 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
# 🔍 C4 Project Detection Rules - Sistema Onion
|
|
2
|
+
|
|
3
|
+
## 📋 **Detection Algorithm**
|
|
4
|
+
|
|
5
|
+
Regras para detecção automática de tipos de projeto TypeScript/JavaScript.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🧠 **Detection Flow**
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
1. Read package.json → Extract dependencies & scripts
|
|
13
|
+
2. Check directory structure → Identify patterns
|
|
14
|
+
3. Detect build tools → Framework identification
|
|
15
|
+
4. Calculate confidence → Score each possibility
|
|
16
|
+
5. Select template → Highest confidence or fallback
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 📱 **Single Page Application Rules**
|
|
22
|
+
|
|
23
|
+
### **React SPA Detection**
|
|
24
|
+
```yaml
|
|
25
|
+
react-spa:
|
|
26
|
+
primary_indicators:
|
|
27
|
+
- "react" in dependencies
|
|
28
|
+
- "react-dom" in dependencies
|
|
29
|
+
- src/App.tsx OR src/App.jsx exists
|
|
30
|
+
- public/index.html exists
|
|
31
|
+
|
|
32
|
+
secondary_indicators:
|
|
33
|
+
- src/components/ directory
|
|
34
|
+
- src/pages/ OR src/views/ directory
|
|
35
|
+
- src/hooks/ directory
|
|
36
|
+
- "react-scripts" in dependencies (CRA)
|
|
37
|
+
- "vite" in devDependencies (Vite)
|
|
38
|
+
|
|
39
|
+
build_tools:
|
|
40
|
+
- webpack.config.js (custom webpack)
|
|
41
|
+
- vite.config.ts (Vite)
|
|
42
|
+
- craco.config.js (CRACO)
|
|
43
|
+
|
|
44
|
+
confidence_weight: 0.9
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### **Vue.js SPA Detection**
|
|
48
|
+
```yaml
|
|
49
|
+
vue-spa:
|
|
50
|
+
primary_indicators:
|
|
51
|
+
- "vue" in dependencies
|
|
52
|
+
- src/App.vue exists
|
|
53
|
+
- src/main.ts OR src/main.js exists
|
|
54
|
+
|
|
55
|
+
secondary_indicators:
|
|
56
|
+
- src/components/ directory
|
|
57
|
+
- src/views/ directory
|
|
58
|
+
- src/router/ directory
|
|
59
|
+
- "@vue/cli" in devDependencies
|
|
60
|
+
- "nuxt" in dependencies (if dev mode)
|
|
61
|
+
|
|
62
|
+
build_tools:
|
|
63
|
+
- vue.config.js
|
|
64
|
+
- vite.config.ts
|
|
65
|
+
- nuxt.config.js
|
|
66
|
+
|
|
67
|
+
confidence_weight: 0.9
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### **Angular SPA Detection**
|
|
71
|
+
```yaml
|
|
72
|
+
angular-spa:
|
|
73
|
+
primary_indicators:
|
|
74
|
+
- "@angular/core" in dependencies
|
|
75
|
+
- angular.json exists
|
|
76
|
+
- src/app/app.module.ts exists
|
|
77
|
+
|
|
78
|
+
secondary_indicators:
|
|
79
|
+
- src/app/ directory
|
|
80
|
+
- src/environments/ directory
|
|
81
|
+
- "@angular/cli" in devDependencies
|
|
82
|
+
- "ng" in scripts
|
|
83
|
+
|
|
84
|
+
build_tools:
|
|
85
|
+
- angular.json
|
|
86
|
+
- tsconfig.json (Angular-specific)
|
|
87
|
+
|
|
88
|
+
confidence_weight: 0.95
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 🔌 **API Service Rules**
|
|
94
|
+
|
|
95
|
+
### **Express.js API Detection**
|
|
96
|
+
```yaml
|
|
97
|
+
express-api:
|
|
98
|
+
primary_indicators:
|
|
99
|
+
- "express" in dependencies
|
|
100
|
+
- server.js OR server.ts OR app.js OR app.ts exists
|
|
101
|
+
- NO "react" OR "vue" OR "@angular" in dependencies
|
|
102
|
+
|
|
103
|
+
secondary_indicators:
|
|
104
|
+
- routes/ directory
|
|
105
|
+
- controllers/ directory
|
|
106
|
+
- middleware/ directory
|
|
107
|
+
- models/ directory
|
|
108
|
+
- "nodemon" in devDependencies
|
|
109
|
+
|
|
110
|
+
structure_patterns:
|
|
111
|
+
- app.use() patterns in main file
|
|
112
|
+
- router definitions
|
|
113
|
+
- middleware setup
|
|
114
|
+
|
|
115
|
+
confidence_weight: 0.85
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### **NestJS API Detection**
|
|
119
|
+
```yaml
|
|
120
|
+
nestjs-api:
|
|
121
|
+
primary_indicators:
|
|
122
|
+
- "@nestjs/core" in dependencies
|
|
123
|
+
- "@nestjs/common" in dependencies
|
|
124
|
+
- src/main.ts exists
|
|
125
|
+
- nest-cli.json exists
|
|
126
|
+
|
|
127
|
+
secondary_indicators:
|
|
128
|
+
- src/modules/ directory
|
|
129
|
+
- src/controllers/ directory
|
|
130
|
+
- src/services/ directory
|
|
131
|
+
- "@nestjs/cli" in devDependencies
|
|
132
|
+
- "nest" in scripts
|
|
133
|
+
|
|
134
|
+
decorators:
|
|
135
|
+
- @Controller presence
|
|
136
|
+
- @Injectable presence
|
|
137
|
+
- @Module presence
|
|
138
|
+
|
|
139
|
+
confidence_weight: 0.95
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### **Fastify API Detection**
|
|
143
|
+
```yaml
|
|
144
|
+
fastify-api:
|
|
145
|
+
primary_indicators:
|
|
146
|
+
- "fastify" in dependencies
|
|
147
|
+
- server.js OR server.ts OR app.js OR app.ts exists
|
|
148
|
+
|
|
149
|
+
secondary_indicators:
|
|
150
|
+
- routes/ directory
|
|
151
|
+
- plugins/ directory
|
|
152
|
+
- schemas/ directory
|
|
153
|
+
- fastify.register patterns
|
|
154
|
+
|
|
155
|
+
confidence_weight: 0.8
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 🌐 **Full-stack Application Rules**
|
|
161
|
+
|
|
162
|
+
### **Next.js Detection**
|
|
163
|
+
```yaml
|
|
164
|
+
nextjs-app:
|
|
165
|
+
primary_indicators:
|
|
166
|
+
- "next" in dependencies
|
|
167
|
+
- next.config.js exists
|
|
168
|
+
- pages/ directory OR app/ directory exists
|
|
169
|
+
|
|
170
|
+
secondary_indicators:
|
|
171
|
+
- pages/api/ directory (API routes)
|
|
172
|
+
- app/api/ directory (App Router)
|
|
173
|
+
- pages/_app.tsx exists
|
|
174
|
+
- public/ directory
|
|
175
|
+
- "next" in scripts
|
|
176
|
+
|
|
177
|
+
patterns:
|
|
178
|
+
- getServerSideProps usage
|
|
179
|
+
- getStaticProps usage
|
|
180
|
+
- API route files in pages/api/
|
|
181
|
+
|
|
182
|
+
confidence_weight: 0.95
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### **Nuxt.js Detection**
|
|
186
|
+
```yaml
|
|
187
|
+
nuxtjs-app:
|
|
188
|
+
primary_indicators:
|
|
189
|
+
- "nuxt" in dependencies
|
|
190
|
+
- nuxt.config.js OR nuxt.config.ts exists
|
|
191
|
+
- pages/ directory exists
|
|
192
|
+
|
|
193
|
+
secondary_indicators:
|
|
194
|
+
- components/ directory
|
|
195
|
+
- server/ directory
|
|
196
|
+
- plugins/ directory
|
|
197
|
+
- middleware/ directory
|
|
198
|
+
|
|
199
|
+
confidence_weight: 0.9
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 📦 **Monorepo Rules**
|
|
205
|
+
|
|
206
|
+
### **NX Monorepo Detection**
|
|
207
|
+
```yaml
|
|
208
|
+
nx-monorepo:
|
|
209
|
+
primary_indicators:
|
|
210
|
+
- nx.json exists
|
|
211
|
+
- workspace.json OR angular.json exists
|
|
212
|
+
- apps/ directory exists
|
|
213
|
+
- libs/ directory exists
|
|
214
|
+
|
|
215
|
+
secondary_indicators:
|
|
216
|
+
- "@nx/" OR "@nrwl/" in dependencies
|
|
217
|
+
- project.json files in subdirectories
|
|
218
|
+
- "nx" in scripts
|
|
219
|
+
- tools/ directory
|
|
220
|
+
|
|
221
|
+
structure:
|
|
222
|
+
- multiple apps in apps/
|
|
223
|
+
- shared libraries in libs/
|
|
224
|
+
- workspace configuration
|
|
225
|
+
|
|
226
|
+
confidence_weight: 0.95
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### **Lerna Monorepo Detection**
|
|
230
|
+
```yaml
|
|
231
|
+
lerna-monorepo:
|
|
232
|
+
primary_indicators:
|
|
233
|
+
- lerna.json exists
|
|
234
|
+
- packages/ directory exists
|
|
235
|
+
- "lerna" in devDependencies
|
|
236
|
+
|
|
237
|
+
secondary_indicators:
|
|
238
|
+
- "lerna" commands in scripts
|
|
239
|
+
- multiple package.json in packages/
|
|
240
|
+
- independent versioning setup
|
|
241
|
+
|
|
242
|
+
confidence_weight: 0.9
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### **npm/yarn Workspaces Detection**
|
|
246
|
+
```yaml
|
|
247
|
+
npm-workspaces:
|
|
248
|
+
primary_indicators:
|
|
249
|
+
- "workspaces" field in package.json
|
|
250
|
+
- multiple package.json files in subdirectories
|
|
251
|
+
|
|
252
|
+
secondary_indicators:
|
|
253
|
+
- packages/ OR apps/ directories
|
|
254
|
+
- workspace: protocol in dependencies
|
|
255
|
+
- lerna.json absent (pure workspaces)
|
|
256
|
+
|
|
257
|
+
confidence_weight: 0.8
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## ☁️ **Serverless Rules**
|
|
263
|
+
|
|
264
|
+
### **AWS Lambda Detection**
|
|
265
|
+
```yaml
|
|
266
|
+
aws-lambda:
|
|
267
|
+
primary_indicators:
|
|
268
|
+
- handler.js OR handler.ts exists
|
|
269
|
+
- serverless.yml exists
|
|
270
|
+
- "aws-lambda" OR "aws-sdk" in dependencies
|
|
271
|
+
|
|
272
|
+
secondary_indicators:
|
|
273
|
+
- functions/ directory
|
|
274
|
+
- serverless/ directory
|
|
275
|
+
- "serverless" in devDependencies
|
|
276
|
+
- .aws/ configuration
|
|
277
|
+
|
|
278
|
+
confidence_weight: 0.85
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### **Vercel Functions Detection**
|
|
282
|
+
```yaml
|
|
283
|
+
vercel-functions:
|
|
284
|
+
primary_indicators:
|
|
285
|
+
- vercel.json exists
|
|
286
|
+
- api/ directory exists
|
|
287
|
+
- "@vercel/node" in dependencies
|
|
288
|
+
|
|
289
|
+
secondary_indicators:
|
|
290
|
+
- functions/ directory
|
|
291
|
+
- serverless function patterns
|
|
292
|
+
- deployment configuration
|
|
293
|
+
|
|
294
|
+
confidence_weight: 0.8
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## 🎯 **Confidence Scoring**
|
|
300
|
+
|
|
301
|
+
### **Scoring Algorithm**
|
|
302
|
+
```typescript
|
|
303
|
+
interface ConfidenceCalculation {
|
|
304
|
+
primary_indicators: number // 40% weight
|
|
305
|
+
secondary_indicators: number // 25% weight
|
|
306
|
+
structure_patterns: number // 20% weight
|
|
307
|
+
build_configuration: number // 15% weight
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const calculateConfidence = (detectionData: DetectionData): number => {
|
|
311
|
+
const weights = {
|
|
312
|
+
primary: 0.40,
|
|
313
|
+
secondary: 0.25,
|
|
314
|
+
structure: 0.20,
|
|
315
|
+
build: 0.15
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
return (
|
|
319
|
+
(detectionData.primaryMatches / detectionData.primaryTotal) * weights.primary +
|
|
320
|
+
(detectionData.secondaryMatches / detectionData.secondaryTotal) * weights.secondary +
|
|
321
|
+
(detectionData.structureMatches / detectionData.structureTotal) * weights.structure +
|
|
322
|
+
(detectionData.buildMatches / detectionData.buildTotal) * weights.build
|
|
323
|
+
) * 100
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### **Confidence Levels**
|
|
328
|
+
```yaml
|
|
329
|
+
confidence_levels:
|
|
330
|
+
definitive: 90-100% # Auto-proceed with high confidence
|
|
331
|
+
strong: 70-89% # Proceed with validation
|
|
332
|
+
moderate: 50-69% # Request user confirmation
|
|
333
|
+
weak: 30-49% # Multiple options, user choice
|
|
334
|
+
unknown: 0-29% # Fallback to generic template
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## 🔄 **Fallback Strategy**
|
|
340
|
+
|
|
341
|
+
### **Multi-Pattern Projects**
|
|
342
|
+
```yaml
|
|
343
|
+
hybrid_detection:
|
|
344
|
+
next_with_api:
|
|
345
|
+
- Next.js + Express API combination
|
|
346
|
+
- Full-stack but with separate API
|
|
347
|
+
|
|
348
|
+
monorepo_multi_type:
|
|
349
|
+
- React app + Node API in same monorepo
|
|
350
|
+
- Different templates for different apps
|
|
351
|
+
|
|
352
|
+
custom_architecture:
|
|
353
|
+
- Doesn't match standard patterns
|
|
354
|
+
- Generic template with manual customization
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### **Generic Fallback**
|
|
358
|
+
```yaml
|
|
359
|
+
generic_typescript:
|
|
360
|
+
indicators:
|
|
361
|
+
- tsconfig.json exists
|
|
362
|
+
- TypeScript files present
|
|
363
|
+
- package.json exists
|
|
364
|
+
|
|
365
|
+
template:
|
|
366
|
+
- Basic import/export analysis
|
|
367
|
+
- Generic C4 structure
|
|
368
|
+
- Manual enhancement prompts
|
|
369
|
+
|
|
370
|
+
confidence_weight: 0.3
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## 📋 **Usage in Agent**
|
|
376
|
+
|
|
377
|
+
### **Implementation Pattern**
|
|
378
|
+
```typescript
|
|
379
|
+
// Agent logic for detection
|
|
380
|
+
const projectDetection = {
|
|
381
|
+
analyzePackageJson: 'Check dependencies and scripts',
|
|
382
|
+
scanDirectoryStructure: 'Identify standard patterns',
|
|
383
|
+
detectBuildTools: 'Find configuration files',
|
|
384
|
+
scoreConfidence: 'Calculate match percentages',
|
|
385
|
+
selectTemplate: 'Choose highest confidence template',
|
|
386
|
+
applyFallback: 'Use generic if confidence too low'
|
|
387
|
+
}
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
**Detection Rules**: 🔍 **Comprehensive & Accurate**
|
|
393
|
+
**Coverage**: 10+ project types with confidence scoring
|
|
394
|
+
**Fallback**: Generic template para casos edge
|
|
395
|
+
**Extensibility**: Facilmente expandível para novos tipos
|