@tera-system/core 0.1.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 (161) hide show
  1. package/LICENSE.md +13 -0
  2. package/MANIFEST.json +24 -0
  3. package/README.md +67 -0
  4. package/RELEASES.md +28 -0
  5. package/WELCOME.md +35 -0
  6. package/agents/application-blueprint.md +407 -0
  7. package/agents/auditor.md +665 -0
  8. package/agents/design-reviewer.md +392 -0
  9. package/agents/domain-expert-agent.md +510 -0
  10. package/agents/domain-research-agent.md +360 -0
  11. package/agents/engineering-agent-dotnet.md +218 -0
  12. package/agents/engineering-agent-phaser.md +275 -0
  13. package/agents/engineering-agent-typescript.md +300 -0
  14. package/agents/engineering-agent.md +143 -0
  15. package/agents/monitor.md +395 -0
  16. package/agents/production-erp-expert.md +506 -0
  17. package/agents/project-knowledge-agent.md +271 -0
  18. package/agents/qa-agent.md +498 -0
  19. package/agents/tera-business-transformation-consultant.md +290 -0
  20. package/agents/tera-client-engagement.md +891 -0
  21. package/agents/tera-software-designer.md +237 -0
  22. package/agents/tera-strategic-advisor.md +325 -0
  23. package/agents/tera-system-evolution.md +759 -0
  24. package/agents/tera.md +520 -0
  25. package/agents/ui-designer.md +426 -0
  26. package/commands/tera-approve.md +34 -0
  27. package/commands/tera-diagnose.md +47 -0
  28. package/commands/tera-gate.md +40 -0
  29. package/commands/tera-help.md +41 -0
  30. package/commands/tera-new-project.md +35 -0
  31. package/commands/tera-plan.md +34 -0
  32. package/commands/tera-request-build.md +45 -0
  33. package/commands/tera-resume.md +34 -0
  34. package/commands/tera-review.md +52 -0
  35. package/commands/tera-status.md +38 -0
  36. package/commands/tera-update.md +48 -0
  37. package/core/project-control/templates/TASK_TEMPLATE.md +146 -0
  38. package/core/tera-system/AGENT_ACTIVATION_MATRIX.md +285 -0
  39. package/core/tera-system/AGENT_DEPENDENCY_MAP.md +117 -0
  40. package/core/tera-system/AGENT_GENERATION_TEMPLATE.md +312 -0
  41. package/core/tera-system/AGENT_PERMISSION_MODEL.md +343 -0
  42. package/core/tera-system/AIS_PROTOCOL.md +191 -0
  43. package/core/tera-system/TERA_AGENT_CONDUCT.md +102 -0
  44. package/core/tera-system/TERA_CONTINUOUS_IMPROVEMENT_POLICY.md +111 -0
  45. package/core/tera-system/TERA_DISTRIBUTION_POLICY.md +291 -0
  46. package/core/tera-system/TERA_PROJECT_DECISION.md +281 -0
  47. package/core/tera-system/TERA_USER_GUIDE.md +462 -0
  48. package/core/tera-system/TOOLING_AND_MCP_POLICY.md +285 -0
  49. package/core/tera-system/TeraApplicationQuestionBank.md +362 -0
  50. package/core/tera-system/TeraArchitectureMap.md +91 -0
  51. package/core/tera-system/TeraClientPolicy.md +366 -0
  52. package/core/tera-system/TeraHelperAgents.md +970 -0
  53. package/core/tera-system/TeraPolicyMap.md +131 -0
  54. package/core/tera-system/TeraPreExecutionGate.md +818 -0
  55. package/core/tera-system/TeraPreparationDocumentationGovernance.md +370 -0
  56. package/core/tera-system/TeraPricingPolicy.md +674 -0
  57. package/core/tera-system/TeraProjectIntakePolicy.md +164 -0
  58. package/core/tera-system/TeraScenarioStressTests.md +168 -0
  59. package/core/tera-system/TeraSubAgents.md +854 -0
  60. package/core/tera-system/TeraSystemMaintenanceChecklist.md +80 -0
  61. package/core/tera-system/TeraTokenPolicy.md +362 -0
  62. package/core/tera-system/Tera_Project_Preparation_Files.md +1045 -0
  63. package/core/tera-system/agent-helpers/application-blueprint-details.md +177 -0
  64. package/core/tera-system/client-helpers/tera-client-engagement-discovery-domains.md +99 -0
  65. package/core/tera-system/client-helpers/tera-client-engagement-gates.md +258 -0
  66. package/core/tera-system/client-helpers/tera-client-engagement-pricing.md +341 -0
  67. package/core/tera-system/client-helpers/tera-client-engagement-protocols.md +692 -0
  68. package/core/tera-system/consulting-helpers/BTCA_METHODOLOGY_FRAMEWORK.md +195 -0
  69. package/core/tera-system/consulting-helpers/BTCA_REPORT_TEMPLATES.md +266 -0
  70. package/core/tera-system/design-system/ACCESSIBILITY_RULES.md +31 -0
  71. package/core/tera-system/design-system/COMPONENT_LIBRARY_SCHEMA.md +46 -0
  72. package/core/tera-system/design-system/DESIGN_MD_INTEGRATION.md +59 -0
  73. package/core/tera-system/design-system/DESIGN_REVIEW_STANDARDS.md +241 -0
  74. package/core/tera-system/design-system/DESIGN_SOURCE_PROTOCOL.md +61 -0
  75. package/core/tera-system/design-system/DESIGN_SYSTEM_OVERVIEW.md +66 -0
  76. package/core/tera-system/design-system/DESIGN_TOKENS_SCHEMA.md +66 -0
  77. package/core/tera-system/design-system/EXTERNAL_REFERENCE_ANALYSIS.md +52 -0
  78. package/core/tera-system/design-system/FIGMA_INTEGRATION.md +138 -0
  79. package/core/tera-system/design-system/INTERNAL_KITS_INDEX.md +26 -0
  80. package/core/tera-system/design-system/LAYOUT_PATTERNS.md +52 -0
  81. package/core/tera-system/design-system/MOBILE_UI_UX_STANDARDS.md +342 -0
  82. package/core/tera-system/design-system/RTL_LTR_RULES.md +39 -0
  83. package/core/tera-system/design-system/UI_ACCEPTANCE_GATE.md +80 -0
  84. package/core/tera-system/design-system/kits/KIT_ADMIN_DASHBOARD.md +102 -0
  85. package/core/tera-system/engineering-governance/ENGINEERING_AGENT_RESPONSIBILITIES.md +210 -0
  86. package/core/tera-system/engineering-governance/ENGINEERING_BEST_PRACTICES.md +468 -0
  87. package/core/tera-system/engineering-governance/ENGINEERING_GOVERNANCE_GATE.md +131 -0
  88. package/core/tera-system/engineering-governance/ENGINEERING_REVIEW_CHECKLIST.md +129 -0
  89. package/core/tera-system/engineering-governance/QUALITY_GATE_THRESHOLDS.md +159 -0
  90. package/core/tera-system/engineering-helpers/engineering-agent-core.md +171 -0
  91. package/core/tera-system/knowledge-base/OPENHANDS_ARCHITECTURE_REFERENCE.md +243 -0
  92. package/core/tera-system/knowledge-base/manufacturing/00_INDEX.md +32 -0
  93. package/core/tera-system/knowledge-base/manufacturing/01_MANUFACTURING_ERP_CORE_CONCEPTS.md +7 -0
  94. package/core/tera-system/knowledge-base/manufacturing/02_SAP_MANUFACTURING_RESEARCH.md +7 -0
  95. package/core/tera-system/knowledge-base/manufacturing/03_DYNAMICS_365_MANUFACTURING_RESEARCH.md +7 -0
  96. package/core/tera-system/knowledge-base/manufacturing/04_ORACLE_MANUFACTURING_RESEARCH.md +7 -0
  97. package/core/tera-system/knowledge-base/manufacturing/05_ODOO_MANUFACTURING_RESEARCH.md +7 -0
  98. package/core/tera-system/knowledge-base/manufacturing/06_ERPNEXT_MANUFACTURING_RESEARCH.md +7 -0
  99. package/core/tera-system/knowledge-base/manufacturing/07_MANUFACTURING_COSTING_GUIDE.md +7 -0
  100. package/core/tera-system/knowledge-base/manufacturing/08_PRODUCTION_DISCOVERY_QUESTIONS.md +7 -0
  101. package/core/tera-system/knowledge-base/manufacturing/09_MANUFACTURING_BLUEPRINT_CHECKLIST.md +7 -0
  102. package/core/tera-system/knowledge-base/manufacturing/10_PRODUCTION_TEST_SCENARIOS.md +7 -0
  103. package/core/tera-system/knowledge-base/manufacturing/11_QUALITY_REWORK_AND_SCRAP_GUIDE.md +7 -0
  104. package/core/tera-system/knowledge-base/manufacturing/12_MRP_AND_PLANNING_GUIDE.md +7 -0
  105. package/core/tera-system/knowledge-base/manufacturing/13_LOCAL_AND_REGIONAL_MANUFACTURING_CONTEXT.md +7 -0
  106. package/core/tera-system/knowledge-base/manufacturing/14_VENDOR_COMPARISON_MATRIX.md +7 -0
  107. package/core/tera-system/product-standards/maintenance-apps/BEST_PRACTICES_DOMAIN.md +325 -0
  108. package/core/tera-system/product-standards/maintenance-apps/STANDARD_DEFINITION.md +142 -0
  109. package/core/tera-system/profiles/PROFILES_INDEX.md +57 -0
  110. package/core/tera-system/profiles/TEMPLATE.md +47 -0
  111. package/core/tera-system/profiles/dotnet-blazor-ef.md +76 -0
  112. package/core/tera-system/profiles/dotnet-razorpages-adonet.md +137 -0
  113. package/core/tera-system/profiles/dotnet-wpf-sqlite.md +159 -0
  114. package/core/tera-system/profiles/effect-bun-opencode.md +109 -0
  115. package/core/tera-system/profiles/flutter-mobile.md +369 -0
  116. package/core/tera-system/profiles/nextjs-prisma.md +110 -0
  117. package/core/tera-system/profiles/phaser-react-node.md +302 -0
  118. package/core/tera-system/profiles/react-pwa.md +97 -0
  119. package/core/tera-system/runtime/CLIENT_DISCOVERY_PROTOCOL.md +145 -0
  120. package/core/tera-system/runtime/DOMAIN_INTELLIGENCE_PROTOCOL.md +124 -0
  121. package/core/tera-system/runtime/MVP_DEFINITION_PROTOCOL.md +176 -0
  122. package/core/tera-system/runtime/TERA_RUNTIME_CHECKLISTS.md +646 -0
  123. package/core/tera-system/runtime/TERA_RUNTIME_PROTOCOLS.md +50 -0
  124. package/core/tera-system/runtime/TERA_RUNTIME_PROTOCOLS_CLIENT.md +355 -0
  125. package/core/tera-system/runtime/TERA_RUNTIME_PROTOCOLS_CORE.md +799 -0
  126. package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES.md +908 -0
  127. package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES_DELIVERY.md +584 -0
  128. package/core/tera-system/runtime/TERA_RUNTIME_TEMPLATES_PREPARATION.md +376 -0
  129. package/core/tera-system/runtime/TERA_SOLUTION_PREPARATION_PROTOCOL.md +335 -0
  130. package/core/tera-system/runtime/TERA_SOLUTION_PREPARATION_TEMPLATES.md +397 -0
  131. package/core/tera-system/runtime/VERSION_LIFECYCLE_PROTOCOL.md +296 -0
  132. package/core/tera-system/semgrep-rules/README.md +32 -0
  133. package/core/tera-system/semgrep-rules/tera-security.yml +66 -0
  134. package/core/tera-system/semgrep-rules/tera-standards.yml +49 -0
  135. package/core/tera-system/teranoo-ui/README.md +48 -0
  136. package/core/tera-system/teranoo-ui/components/button.tsx +51 -0
  137. package/core/tera-system/teranoo-ui/components/card.tsx +49 -0
  138. package/core/tera-system/teranoo-ui/components/dashboard-layout.tsx +36 -0
  139. package/core/tera-system/teranoo-ui/components/data-table.tsx +146 -0
  140. package/core/tera-system/teranoo-ui/components/empty-state.tsx +31 -0
  141. package/core/tera-system/teranoo-ui/components/kpi-card.tsx +42 -0
  142. package/core/tera-system/teranoo-ui/components/page-header.tsx +25 -0
  143. package/core/tera-system/teranoo-ui/components/search-input.tsx +40 -0
  144. package/core/tera-system/teranoo-ui/components/sidebar.tsx +66 -0
  145. package/core/tera-system/teranoo-ui/components/stats-card.tsx +37 -0
  146. package/core/tera-system/teranoo-ui/registry.json +77 -0
  147. package/core/tera-system/teranoo-ui/styles/teranoo-theme.css +61 -0
  148. package/opencode.tera.example.json +30 -0
  149. package/package.json +37 -0
  150. package/scripts/build.mjs +110 -0
  151. package/scripts/install.js +244 -0
  152. package/scripts/lib/license.mjs +90 -0
  153. package/scripts/lib/public-key.pem +3 -0
  154. package/scripts/tera-license.mjs +63 -0
  155. package/tools/tera-clean.ps1 +97 -0
  156. package/tools/tera-fetch.ps1 +165 -0
  157. package/tools/tera-release.ps1 +96 -0
  158. package/tools/tera-schedule.ps1 +59 -0
  159. package/tools/tera-update.ps1 +472 -0
  160. package/tools/tera-watch.ps1 +154 -0
  161. package/tools/update-client-repositories.ps1 +92 -0
@@ -0,0 +1,285 @@
1
+ <!-- © 2026 Majed Khaireddin (Alabasi1980). Tera System — Proprietary. All rights reserved. -->
2
+
3
+ # TOOLING_AND_MCP_POLICY.md
4
+
5
+ # سياسة الأدوات و MCPs لمنظومة Tera
6
+
7
+ ---
8
+
9
+ ## 1. تعريفات أساسية
10
+
11
+ ### 1.1 الفرق بين Agent و Tool و MCP
12
+
13
+ | المفهوم | التعريف | مثال |
14
+ |---|---|---|
15
+ | **Agent** | كيان يفكر ويحلل ويقرر ضمن تخصصه. يقرأ مدخلات، يطبق معرفة، وينتج مخرجات. يملك صلاحية اتخاذ قرار محدودة ضمن نطاقه. | `EngineeringAgent` ينفذ كود بناءً على مهمة. |
16
+ | **Tool** | أمر أو برنامج ينفذ إجراء محددًا. لا يفكر ولا يقرر، فقط ينفذ. قد يكون CLI أو API أو وظيفة برمجية. | `git diff`، `npm test`، `playwright test` |
17
+ | **MCP** (Model Context Protocol) | واجهة اتصال تسمح للـ Agent بالتفاعل مع أنظمة خارجية. يوفر سياقًا إضافيًا للـ Agent (قراءة) أو يسمح له بتنفيذ إجراءات (كتابة). | Playwright MCP لاختبار UI، GitHub MCP لقراءة المستودع |
18
+
19
+ ### 1.2 قاعدة الفصل
20
+
21
+ ```text
22
+ Agent يفكر ويقرر.
23
+ Tool ينفذ.
24
+ MCP يربط الـ Agent بالنظام الخارجي.
25
+ ```
26
+
27
+ > **لا تخلط بين Agent و Tool.**
28
+ >
29
+ > الـ Agent يقرر. الأداة تنفذ. MCP يربط.
30
+ > الأداة لا تقرر. MCP لا يقرر. القرار يبقى عند Tera أو العميل المفوّض.
31
+
32
+ ---
33
+
34
+ ## 2. مبادئ استخدام الأدوات و MCPs
35
+
36
+ ### 2.1 المبادئ العامة
37
+
38
+ 1. **الأداة للتنفيذ، وليست للقرار.**
39
+ 2. **أي استخدام لـ MCP يجب أن يكون له Trigger واضح من Tera.**
40
+ 3. **لا استخدام عشوائي للأدوات.**
41
+ 4. **الصلاحية Read-Only هي الأصل للأدوات التي تتعامل مع بيانات حقيقية.**
42
+ 5. **أداة Write تحتاج موافقة صريحة من Tera أو المستخدم.**
43
+ 6. **لا استخدام لأسرار Production عبر أي أداة.**
44
+ 7. **نتائج الأدوات تُسجل في ملفات project-control المناسبة.**
45
+
46
+ ### 2.2 متى نستخدم MCP؟
47
+
48
+ ```text
49
+ نستخدم MCP عندما:
50
+ - الـ Agent يحتاج معلومات لا توجد في ملفات المشروع.
51
+ - الـ Agent يحتاج التحقق من شيء خارجي (مثل API يعمل، UI يظهر صح).
52
+ - الـ Agent يحتاج تفاعل مع نظام لا يمكن الوصول إليه بالقراءة فقط.
53
+
54
+ لا نستخدم MCP عندما:
55
+ - المعلومة موجودة في ملفات المشروع.
56
+ - يمكن التحقق يدويًا بقراءة بسيطة.
57
+ - الأداة قد تسبب تغيير غير مرغوب في نظام خارجي.
58
+ ```
59
+
60
+ ---
61
+
62
+ ## 3. MCPs المسموحة الآن (الحد الأدنى الضروري)
63
+
64
+ > **✅ الوضع الفعلي الموثق (2026-07-31):** التكوين النشط في `.opencode/opencode.json` و `~/.config/opencode/opencode.jsonc` يتضمن MCPs التالية:
65
+ > - `.opencode/opencode.json`: `playwright` + `semgrep` + `structurizr`
66
+ > - `~/.config/opencode/opencode.jsonc`: `playwright` + `semgrep`
67
+ >
68
+ > **تصحيح نظامي (SCP-2026-07-31-001):** الأقسام 3.2 (API Testing MCP) و 3.3 (Git/GitHub MCP) و 3.4 (Database Read-Only MCP) كانت تسرد MCPs **غير مفعلة فعلياً** في أي تكوين — نُقلت إلى قائمة §4 المؤجلة أو توثيقها كأدوات CLI حسب الحاجة. لا يفقد النظام أي وظيفة من هذا التصحيح.
69
+
70
+ ### 3.1 Playwright / Browser Automation MCP
71
+
72
+ | البند | القيمة |
73
+ |---|---|
74
+ | **الاسم** | Playwright / Browser Automation |
75
+ | **الغرض** | اختبار الواجهات، Smoke Tests، E2E، مراجعة Phase 6، QA في Phase 7 |
76
+ | **الصلاحية الافتراضية** | `BROWSER_READ` (قراءة + Screenshots + تنقل) |
77
+ | **مسموح به لـ** | ✅ جميع العملاء — Coding Agents, Auditor, QA Agent, Design Reviewer, UI Designer |
78
+ | **يقرأ** | ✅ روابط التطبيق، حالة UI، screenshots |
79
+ | **يكتب** | ❌ لا يعدل كودًا |
80
+ | **يعدّل بيانات** | ❌ ممنوع |
81
+ | **ينشر** | ❌ ممنوع |
82
+ | **التبعية** | يجب أن يكون التطبيق قيد التشغيل محليًا أو في بيئة اختبارية |
83
+
84
+ **شروط الاستخدام:**
85
+ - **يُستخدم فقط في بيئة Development/Staging** — ممنوع على Production.
86
+ - **متاح مبدئياً** لجميع العملاء دون موافقة Tera (تشغيل التطبيق لأول مرة يحتاج تأكيد أنه Dev).
87
+ - لا يرسل بيانات حساسة في الاختبارات.
88
+ - أي screenshot يُستخدم كدليل بصري في Handback أو تقارير المراجعة.
89
+ - **ممنوع**: تعديل الكود، تغيير بيانات، نشر.
90
+ - **فُعّل عبر:** MCP Server (`@playwright/mcp`) + CLI (`@playwright/cli`) — راجع SCP-107.
91
+
92
+ ---
93
+
94
+ ### 3.2 Semgrep MCP
95
+
96
+ | البند | القيمة |
97
+ |---|---|
98
+ | **الاسم** | Semgrep Static Analysis |
99
+ | **الغرض** | فحص كود ثابت (أخطاء برمجية، ثغرات، أنماط خطرة) |
100
+ | **الصلاحية الافتراضية** | `READ_ONLY` — يفحص ولا يعدّل |
101
+ | **مسموح به لـ** | ✅ جميع العملاء — عبر MCP (`semgrep_scan_directory`) وعبر CLI (`semgrep --config=tera-system/semgrep-rules/`) |
102
+ | **القواعد** | قواعد Tera المخصصة في `tera-system/semgrep-rules/` |
103
+
104
+ **شروط الاستخدام:**
105
+ - يستخدم مع قواعد Tera (`semgrep-rules/`) أو القواعد العامة عند الحاجة.
106
+ - نتائج الفحص تُسجل في المهمة/التقرير — لا تعديل للكود.
107
+ - **فُعّل عبر:** MCP Server (`semgrep mcp` في `opencode.jsonc` + `mcp-server-semgrep` في `.opencode/opencode.json`) + CLI.
108
+
109
+ ---
110
+
111
+ ### 3.3 أدوات CLI في البوابات (وليست MCPs)
112
+
113
+ بعض الأدوات الحرجة تعمل **كأوامر CLI داخل Quality Gates** بدل MCPs — وهذا مقصود:
114
+ - لا استهلاك توكنز دائم في السياق.
115
+ - تُشغَّل في اللحظة المحددة بقاعدة واضحة.
116
+ - النتيجة: `exit code` + تقرير محفوظ + عتبات في `QUALITY_GATE_THRESHOLDS.md`.
117
+
118
+ | الأداة | الأمر | البوابة |
119
+ |---|---|---|
120
+ | **Semgrep (CLI)** | `semgrep --config=tera-system/semgrep-rules/ --metrics=off <files>` | SEMGREP_SANITY_CHECK — كل مهمة كود |
121
+ | **Trivy** | `trivy fs --scanners vuln,secret,misconfig .` | Trivy Dependency & Secrets Check — قبل التسليم |
122
+ | **Gitleaks** | `gitleaks git . --redact --no-banner` | Gitleaks Git History Secrets Check — قبل التسليم (SCP-2026-07-31-001) |
123
+
124
+ **قاعدة:** لا تُحوَّل أدوات البوابات الحاسمة إلى MCP إلا إذا احتاج العميل الاستعلام التفاعلي من نتائجها لحظياً.
125
+
126
+ ---
127
+
128
+ ### 3.4 مكتبات الجودة في المشاريع (وليست MCPs)
129
+
130
+ | الأداة | الشكل | الاستخدام |
131
+ |---|---|---|
132
+ | **axe-core** (`@axe-core/playwright`) | devDependency داخل اختبارات Playwright | فحص Accessibility للواجهات الجديدة (SCP-2026-07-31-001) |
133
+ | **Testcontainers** (NuGet / npm) | مكتبة اختبارات | اختبارات تكاملية مع خدمات حقيقية (PostgreSQL/Redis/SQL Server) داخل Docker (SCP-2026-07-31-001) |
134
+ | **Bruno** (`@usebruno/cli`) | CLI | توثيق واختبار APIs عبر Collections |
135
+
136
+ ---
137
+
138
+ ### 3.5 Structurizr (C4 Modeling) MCP
139
+
140
+ | البند | القيمة |
141
+ |---|---|
142
+ | **الاسم** | Structurizr C4 Architecture Modeling |
143
+ | **الغرض** | نمذجة البنية المعمارية (C4 Model) عبر Structurizr DSL — توليد Context, Container, Component diagrams |
144
+ | **المصدر** | `colincoleman/structurizr-mcp` (GitHub) — مثبت محلياً في `structurizr-mcp/` |
145
+ | **الصلاحية الافتراضية** | `READ_WRITE` — يقرأ ويكتب ملفات `.dsl` فقط |
146
+ | **المستعمل** | `ApplicationBlueprintAgent` (مُهندس) — لأغراض blueprinting + solution preparation (phases 1–4, SCP-2026-07-28-118) |
147
+ | **يقرأ** | ✅ ملفات Structurizr DSL (`.dsl`) — النماذج المعمارية النصية |
148
+ | **يكتب** | ✅ ملفات `.dsl` جديدة — يعدّل النماذج القائمة بعد موافقة |
149
+ | **يولّد** | ✅ Diagrams (PNG/SVG) من DSL — للتوثيق الداخلي |
150
+ | **يعدّل كود تطبيق** | ❌ ممنوع تماماً |
151
+ | **ينشر diagrams لخارج** | ❌ ممنوع — للتوثيق الداخلي فقط |
152
+
153
+ **✅ الوضع الحالي:** تم تثبيت `colincoleman/structurizr-mcp` (Python, uv) من GitHub إلى `structurizr-mcp/` في جذر المشروع. MCP مسجل في `opencode.json`.
154
+
155
+ **⚠️ يتطلب Docker قيد التشغيل** للتصدير والتحقق:
156
+ - **تصدير diagrams** إلى SVG/PNG
157
+ - **معاينة النماذج** عبر http://localhost:8081
158
+ - **التحقق من DSL** عبر Structurizr CLI داخل Docker
159
+
160
+ **تشغيل الحاوية (مرة واحدة) — من جذر المستودع:**
161
+ ```bash
162
+ docker run -d --rm -p 8081:8080 -v "%CD%\architecture:/usr/local/structurizr" structurizr/structurizr local
163
+ ```
164
+ > **ملاحظة:** المسار نسبي من جذر المستودع (يعمل على أي جهاز). بديل PowerShell: `-v "$PWD\architecture:/usr/local/structurizr"`
165
+ > **ملاحظة:** المنفذ 8081 لأن 8080 مشغول بـ ERPNext. المعاينة عبر http://localhost:8081
166
+
167
+ بدون Docker: الـ MCP يعمل لكنه يقدّم فقط قراءة/كتابة ملفات `.dsl` — لن يعمل validate ولا export diagrams.
168
+
169
+ **شروط الاستخدام:**
170
+ - **المصدر الأساسي هو DSL النصي** — ملف `.dsl` هو مصدر الحقيقة (version-controlled). الـ diagrams هي مخرجات مشتقة.
171
+ - **Docker مطلوب للـ diagrams البصرية** — بدونه، الـ DSL النصي هو المخرج الوحيد.
172
+ - **يُستخدم فقط لـ ApplicationBlueprintAgent** — في سياق blueprinting وليس لكتابة كود.
173
+ - **صلاحية الكتابة:** فقط لملفات `.dsl` — لا يعدّل أي ملف كود تطبيق.
174
+ - **التسجيل:** أي diagram يُولّد يسجل في `project-preparation/BLUEPRINT_DECISION_CANDIDATES.md`.
175
+ - **عدم المشاركة الخارجية:** الـ diagrams للتوثيق الداخلي فقط.
176
+
177
+ ---
178
+
179
+ ## 4. MCPs المؤجلة (ليست الآن)
180
+
181
+ | الأداة | السبب | وقت التفعيل المقترح |
182
+ |---|---|---|
183
+ | **API Testing MCP** | متاحة حالياً عبر curl/webfetch + Bruno CLI — لا حاجة لخادم MCP. | عند الحاجة لاستعلام تفاعلي متكرر من العملاء من نتائج API مباشرة. |
184
+ | **Git / GitHub MCP** | Git CLI الحالية تغطي القراءة والكتابة (بموافقة). | عند اعتماد GitHub سير عمل PRs بكثافة. |
185
+ | **Database Read-Only MCP** | الوصول الحالي عبر CLI/استعلامات مصرّح بها. | عند وجود مشروع يتطلب فحص قواعد بيانات متكرراً من عدة عملاء. |
186
+ | **Figma MCP** | البروتوكول الحالي FIGMA_INTEGRATION.md + UIVisualDesignerAgent يكفي الآن. MCP Figma سيضيف تعقيدًا قبل الحاجة الفعلية. | عند وجود مشروع يعتمد على Figma بانتظام وتتعدد مهام التصميم. |
187
+ | **Deployment / Cloud MCPs** | النشر ليس محورًا حاليًا. DevOpsDeploymentAgent الحالي يغطي التخطيط والتحضير. | عند وجود مشروع يتطلب نشر فعلي متكرر CI/CD. |
188
+ | **Production DB Write Tools** | خطرة جدًا وتحتاج ضوابط أمنية متقدمة. | عند وجود مشروع يتطلب وصول كتابي إلى قاعدة بيانات Production مع خطة rollback موثقة. |
189
+ | **Email / Calendar MCPs** | غير ضرورية حاليًا لمنظومة Tera. | عند الحاجة لجدولة مواعيد أو إرسال اتصالات آلية. |
190
+ | **Drive / Document MCPs** | يمكن إدارة المستندات عبر الملفات المحلية حاليًا. | عند العمل مع عملاء يستخدمون Google Docs أو SharePoint كمصدر أساسي. |
191
+ | **Monitoring / Logging MCPs** | غير ضرورية قبل وجود تطبيق قيد التشغيل الفعلي. | عند وجود تطبيق في Production يحتاج مراقبة. |
192
+ | **SonarQube** | بوابة جودة مركزية قوية لكنها تحتاج خادماً + CI. Semgrep + Trivy + Gitleaks تغطي احتياجنا الحالي. | عند اعتماد CI/CD رسمي أو مشروع كبير يحتاج قياساً مستمراً للتغطية/التكرار. |
193
+ | **Sentry MCP** | مراقبة الأخطاء — مفيدة فقط عند وجود تطبيق في Production. حالياً Sentry SDK قاعدة FLAG في التسليم. | عند أول تطبيق Production فعلي. |
194
+ | **k6** | اختبارات أداء/ضغط — لا يوجد اشتراط أداء في عتبات القبول حالياً. | عند أول متطلب أداء (p95, concurrency) في تسليم عميل. |
195
+
196
+ ---
197
+
198
+ ## 5. قواعد استخدام MCPs
199
+
200
+ ### 5.1 القواعد الأساسية
201
+
202
+ | القاعدة | الشرح |
203
+ |---|---|
204
+ | **Trigger واضح** | أي استخدام MCP يجب أن يكون بناءً على حاجة محددة في `TASK-ID` أو قرار من Tera |
205
+ | **الصلاحية الافتراضية Read-Only** | القراءة هي الأصل. الكتابة استثناء. |
206
+ | **لا أسرار Production** | يمنع استخدام أي أداة مع بيانات أو مفاتيح Production دون عزل تام وإذن صريح |
207
+ | **تسجيل النتائج** | نتيجة أي MCP تُسجل في الملفات الرسمية (`project-control/` المناسب) |
208
+ | **لا تعديل مباشر** | MCP Write يحتاج موافقة صريحة من Tera (أو المستخدم للحالات الحرجة) |
209
+ | **DB Read-Only فقط** | أي MCP Database يكون Read-Only افتراضيًا ولا يُعدّل البيانات |
210
+ | **بيئة اختبارية** | الأدوات تستخدم في بيئة Development أو Staging أولاً |
211
+ | **إبلاغ Tera** | إذا وجدت الأداة مشكلة، تُبلغ Tera بدل اتخاذ قرار بنفسها |
212
+
213
+ ### 5.2 قواعد لكل MCP
214
+
215
+ | MCP | Read | Write (مع إذن) | Test | Production Access |
216
+ |---|---|---|---|---|
217
+ | Playwright | ✅ UI readable فقط | ❌ | ✅ Smoke/E2E | ❌ ممنوع |
218
+ | Semgrep | ✅ كود (فحص) | ❌ | ✅ Static Analysis | ❌ (لا يحتاج) |
219
+ | Structurizr | ✅ ملفات `.dsl` | ✅ `.dsl` فقط | ✅ Validate/Export (Docker) | ❌ |
220
+
221
+ > **الأدوات التالية لم تعد MCPs مفعلة** (تصحيح SCP-2026-07-31-001): API Testing (تتم عبر curl/webfetch/Bruno CLI)، Git/GitHub (يتم عبر أدوات Git CLI الموجودة)، Database Read-Only (يتم عبر CLI/استعلامات عند الحاجة المصرّح بها). هذه القدرات **متاحة عبر الأدوات القياسية** دون الحاجة لخوادم MCP إضافية.
222
+
223
+ ---
224
+
225
+ ## 6. ماذا تفعل Tera عند استخدام MCP؟
226
+
227
+ ### 6.1 قبل الاستخدام
228
+
229
+ 1. يحدد Tera الحاجة والمبرر.
230
+ 2. يحدد الـ MCP المطلوب.
231
+ 3. يحدد الصلاحية (Read / Test / Write with approval).
232
+ 4. يحدد البيئة (Development / Staging / Production بإذن).
233
+ 5. يسجل القرار في `TASK-ID`.
234
+
235
+ ### 6.2 بعد الاستخدام
236
+
237
+ 1. يراجع Tera نتائج الأداة.
238
+ 2. يسجل النتائج في `PROJECT_ACTIVITY_LOG.md`.
239
+ 3. إذا كانت النتائج تؤثر على قرارات: يُسجل في `DECISIONS_LOG.md`.
240
+ 4. إذا كانت النتائج تؤثر على حالة المهمة: يُحدّث `TASK-ID`.
241
+
242
+ ### 6.3 في حال وجود خطأ أو خرق
243
+
244
+ ```
245
+ إذا تسبب MCP في:
246
+ - تغيير غير مرغوب
247
+ - تعديل بيانات خطأ
248
+ - كشف secret
249
+ - تعطيل خدمة
250
+
251
+ تتخذ Tera الإجراءات التالية:
252
+ 1. توقف الأداة فورًا.
253
+ 2. تبلغ المستخدم فورًا.
254
+ 3. تسجل الحادثة في ISSUES_AND_GAPS.md.
255
+ 4. تطبق Emergency Response حسب التصنيف (Yellow/Orange/Red/Black).
256
+ 5. لا تستمر حتى حسم الموقف.
257
+ ```
258
+
259
+ ---
260
+
261
+ ## 7. خريطة طريق الأدوات المستقبلية
262
+
263
+ | المرحلة | الأدوات المضافة | ملاحظة |
264
+ |---|---|---|
265
+ | **حاليًا (2026-07-31)** | MCPs: Playwright, Semgrep, Structurizr — CLI Gates: Semgrep, Trivy, Gitleaks — مكتبات: axe-core, Testcontainers, Bruno — **CI Pipeline: `.github/workflows/tera-ci.yml` (SCP-2026-07-31-002)** | محدودة ومدروسة + خط إصدار آلي |
266
+ | **بعد مشروع متوسط** | Docker/DevOps MCP (إذا بدأ نشر) | فقط إذا تطلب المشروع |
267
+ | **بعد مشروع ERP** | Data Migration MCP (إذا تطلب ERP) | فقط إذا كان هناك ترحيل بيانات |
268
+ | **عند اعتماد Figma** | Figma MCP (للقراءة) | فقط بعد أول مشروع Figma متكرر |
269
+ | **عند وجود Production** | Sentry MCP (قراءة/تحليل فقط)، Monitoring MCP | فقط بعد تشغيل التطبيق فعليًا |
270
+ | **عند اعتماد CI/CD** | SonarQube، k6 (عند متطلبات الأداء) | بعد استقرار أول إصدار رسمي |
271
+ | **بعد استقرار أول إصدار** | dependency-cruiser/NetArchTest، Schemathesis، Stryker (للمنطق الحرج) | عبر بوابة Rollout — مشروع تجريبي واحد ثم قياس ثم تفعيل عام |
272
+ | **عند الحاجة** | Renovate (تحديث التبعيات)، OWASP ZAP (اختبار ديناميكي) | تُقيَّم عند أول حاجة فعلية |
273
+
274
+ > **تجميد الأدوات (SCP-2026-07-31-002):** لا تُضاف أدوات جديدة قبل استقرار أول إصدار رسمي. كل إضافة مستقبلية تمر ببوابة Rollout: مشروع تجريبي واحد ← قياس ← تفعيل عام.
275
+
276
+ ---
277
+
278
+ ## 8. الملخص — قاعدة الأدوات الذهبية
279
+
280
+ > **الأداة تخدم الـ Agent، والـ Agent يخدم Tera.**
281
+ >
282
+ > لا MCP بدون Trigger.
283
+ > لا Write بدون موافقة.
284
+ > لا Production بدون خطة.
285
+ > لا سر بدون تغطية.
@@ -0,0 +1,362 @@
1
+ # Tera Application Question Bank
2
+
3
+ ## Purpose
4
+
5
+ This is the reference question bank for the **Client Discovery and Smart Interview** process — a two-stage approach that first explores the client's idea through open conversation, then follows with adaptive structured questioning across all domains.
6
+
7
+ Tera does not ask all questions. Tera selects the right questions at the right time based on previous answers, and always starts with open listening before any structured questioning.
8
+
9
+ ## How to use this bank
10
+
11
+ 1. **Start with Client Discovery Mode** — open listening, understanding summary, confirmation (see `TERA_RUNTIME_PROTOCOLS_CLIENT.md` Section 18).
12
+ 2. **Enter Smart Interview only if gaps remain** after the Discovery summary is confirmed.
13
+ 3. **Select questions based on gaps** — not all domains, not all questions.
14
+ 4. **When the client doesn't know** — propose a default, document as `Assumption`, do not treat as final decision.
15
+ 5. **Small projects: 10–15 questions. Medium: 20–35. Complex: deeper per domain.**
16
+
17
+ ## Operational mapping to TCEA 13-domain framework
18
+
19
+ This bank remains a **question source**, not a completeness contract by itself.
20
+
21
+ **التعريف الرسمي والترقيم المعتمد للمجالات موجود في المصدر الرسمي:**
22
+ `tera-system/client-helpers/tera-client-engagement-discovery-domains.md`
23
+
24
+ **ملاحظة حول الترقيم:** الترقيم المستخدم حالياً في أسئلة هذا الملف (Q1.x, Q2.x, ...) مبني على ترقيم سابق. للترقيم المعتمد الحالي، راجع `discovery-domains.md`. أسئلة هذا الملف سيتم إعادة ترقيمها لتتوافق مع المصدر الرسمي في تحديث لاحق.
25
+
26
+ **Rule:**
27
+
28
+ ```text
29
+ The question bank helps TCEA ask.
30
+ The Discovery Coverage Summary proves TCEA covered.
31
+ ```
32
+
33
+ ### Practical mapping guidance
34
+
35
+ - Current Domain 1 supports: Business Context & Value
36
+ - Current Domain 2 supports: Users & Roles, Workflow & Operations, Scope & MVP, Notifications, Screens & UX
37
+ - Current Domain 3 supports: Data & Content, Reports & Dashboards
38
+ - Current Domain 4 supports: Integrations & APIs, Technical / Hosting / Compliance
39
+ - Current Domain 5 supports: Design & Branding, Screens & UX
40
+ - Current Domain 6 supports: Security & Audit
41
+ - Current Domain 7 supports: Technical / Hosting / Operational follow-up
42
+
43
+ Acceptance, commercials, warranty, delivery assumptions, and approval-readiness questions may require TCEA to add consulting/commercial questions beyond this bank when needed.
44
+
45
+ ## Assumption Handling
46
+
47
+ When the client cannot answer a question, use this pattern:
48
+
49
+ ### Response format
50
+
51
+ ```
52
+ إذا لم تكن متأكدًا، أقترح الافتراض التالي:
53
+ - الخيار الموصى به: [الخيار]
54
+ - السبب: [شرح مختصر]
55
+ - الحالة: Assumption — يحتاج تأكيد لاحق
56
+ ```
57
+
58
+ ### Documentation format
59
+
60
+ Record all assumptions in a table (inside `project-inputs/` or in a separate file for medium/large projects):
61
+
62
+ ```text
63
+ | المجال | السؤال | افتراض تيرا | الحالة | يحتاج مراجعة قبل |
64
+ |--------|--------|-------------|--------|------------------|
65
+ | تقني | Web/Mobile | Web App | يحتاج تأكيد | التوقيع على النطاق |
66
+ | صلاحيات | عدد الأدوار | Admin + User | يحتاج تأكيد | التنفيذ |
67
+ ```
68
+
69
+ ### Classification
70
+
71
+ | الحالة | المعنى |
72
+ |--------|--------|
73
+ | `مؤكد` | العميل أجاب بوضوح |
74
+ | `يحتاج تأكيد` | اقتراح Tera — لم يؤكده العميل بعد |
75
+ | `مؤجل` | العميل قال "ربما لاحقاً" |
76
+ | `غير محدد حاليًا` | لم يُطرح السؤال بعد أو العميل لم يقرر |
77
+
78
+ ## 🔍 Research Triggers
79
+
80
+ Throughout the Question Bank, some questions are marked with `🔍 Research recommended`. This means:
81
+
82
+ When the client's answer to this question is unclear, uncertain, or the client defers to Tera:
83
+ 1. **Search first** before proposing a default.
84
+ 2. Present findings with sources.
85
+ 3. Let the client choose based on research.
86
+
87
+ ### When research is unavailable or inconclusive
88
+ - Document the limitation clearly.
89
+ - Present as `Unknown — needs client decision` or `Inconclusive research — proceed with caution`.
90
+ - Never present an unresearched opinion as a reliable recommendation.
91
+
92
+ ### Common research triggers by domain
93
+
94
+ | Domain | Topics likely needing research |
95
+ |--------|-------------------------------|
96
+ | Administrative | Competitor analysis, market standards |
97
+ | Functional | Industry-specific workflows, compliance processes |
98
+ | Data/Reporting | Standard report formats, data regulations |
99
+ | Technical | 🔍 Best libraries, frameworks, APIs, hosting providers |
100
+ | Design/UX | 🔍 Design trends, accessibility standards, UI patterns |
101
+ | Security | 🔍 Regulatory requirements, security standards |
102
+ | Operational | 🔍 Hosting providers, DevOps tools, pricing |
103
+
104
+ ### Quick reference: When to search vs when to use judgment
105
+
106
+ | Scenario | Action |
107
+ |---|---|
108
+ | Client: "أي بوابة دفع تنصح؟" | 🔍 **Search** — compare options with sources |
109
+ | Client: "كم عدد المستخدمين؟ 5 فقط" | Use judgment — clear answer |
110
+ | Client: "ما أفضل قاعدة بيانات؟" | 🔍 **Search** — depends on stack, volume, budget |
111
+ | Client: "التطبيق بلاريل" | Use judgment — clear technology |
112
+ | Client: "هل أحتاج ERP؟" | 🔍 **Search** — depends on business processes |
113
+ | Client: "موظفين 10، بدون صلاحيات" | Use judgment — simple scenario |
114
+ | Client: "أحتاج استضافة في السعودية" | 🔍 **Search** — local providers, regulations |
115
+ | Client: "ما رأيك في React؟" | Use judgment — well-known technology |
116
+
117
+ ---
118
+
119
+ ## Domain 1: Administrative / Business Context
120
+
121
+ *Understanding the client, the problem, and the business goal.*
122
+
123
+ ### Essential
124
+ - Q1.1: What is the client name? (if external)
125
+ - Q1.2: Is the client an individual, company, or organization?
126
+ - Q1.3: What is the client's business domain?
127
+ - Q1.4: What problem does this application solve?
128
+ - Q1.5: Who benefits from this application?
129
+ - Q1.6: Is this a new product or replacing an existing system?
130
+ - Q1.7: Is this a paid service, internal tool, or public benefit?
131
+ - Q1.8: Is there a deadline or time constraint?
132
+
133
+ ### Deep dive (when needed)
134
+ - Q1.9: What is the expected number of users at launch? After 6 months?
135
+ - Q1.10: Is there a budget range or cost sensitivity?
136
+ - Q1.11: Are there competitors or similar apps the client knows?
137
+ - Q1.12: Does the client have a business model or monetization plan?
138
+ - Q1.13: Who are the decision makers and stakeholders?
139
+ - Q1.14: What success metrics matter most? (users, revenue, adoption, etc.)
140
+
141
+ ---
142
+
143
+ ## Domain 2: Functional / Operational
144
+
145
+ *Understanding users, roles, workflows, and feature expectations.*
146
+
147
+ ### Essential
148
+ - Q2.1: Who will use this application? (list user types)
149
+ - Q2.2: What are the 3 most important things each user type does?
150
+ - Q2.3: Do users have different permission levels or roles?
151
+ - Q2.4: Is there a registration / login requirement?
152
+ - Q2.5: What is the main workflow from start to finish?
153
+ - Q2.6: Does the application need to send notifications? (email, SMS, in-app)
154
+ - Q2.7: Does the application need to support multiple languages? Which?
155
+
156
+ ### Deep dive (when needed)
157
+ - Q2.8: Describe each workflow step-by-step: trigger, actions, decisions, outcomes.
158
+ - Q2.9: Are there approval workflows? (e.g., manager approves expense)
159
+ - Q2.10: Does the application need a search or filter feature?
160
+ - Q2.11: Is there a dashboard or analytics view?
161
+ - Q2.12: Does the application manage inventory, stock, or resources?
162
+ - Q2.13: Are there scheduled or automated tasks? (cron, batch jobs)
163
+ - Q2.14: Does the application need a mobile-responsive version?
164
+ - Q2.15: Are there offline use cases?
165
+ - Q2.16: Describe any exceptional or edge-case scenarios.
166
+
167
+ ---
168
+
169
+ ## Domain 3: Data and Reporting
170
+
171
+ *Understanding data inputs, outputs, storage, and reporting.*
172
+
173
+ ### Essential
174
+ - Q3.1: What data does the application collect or manage?
175
+ - Q3.2: What are the main data entities? (e.g., users, orders, products)
176
+ - Q3.3: Does the application need to import data from external sources?
177
+ - Q3.4: Does the application need to export data? In what format? (PDF, Excel, CSV)
178
+ - Q3.5: Are there required reports or summaries?
179
+
180
+ ### Deep dive (when needed)
181
+ - Q3.6: What is the expected data volume? (records per day/month)
182
+ - Q3.7: How long should data be retained?
183
+ - Q3.8: Are there data archival or deletion requirements?
184
+ - Q3.9: Are there real-time data requirements?
185
+ - Q3.10: Does the application need to generate invoices, receipts, or financial documents?
186
+ - Q3.11: Are there data validation rules or business calculations?
187
+ - Q3.12: Does the client need a data backup or recovery plan?
188
+ - Q3.13: Are there complex reporting queries or cross-table aggregations?
189
+
190
+ ---
191
+
192
+ ## Domain 3b: Content & Messaging (Content-Heavy only — SCP-2026-08-15-016)
193
+
194
+ *Understanding what the client wants to actually SAY in each screen/page — activated only when Content Type = User-Facing Content / Mixed (موقع، صفحة هبوط، تسويق، محتوى).*
195
+
196
+ ### Essential (Content-Heavy only)
197
+ - Q3b.1: Content Type? (Application Data / User-Facing Content / Mixed)
198
+ - Q3b.2: ما الغرض من هذه الشاشة/الصفحة؟ (Purpose)
199
+ - Q3b.3: لمن هذه الشاشة؟ (Audience)
200
+ - Q3b.4: ما الرسالة الأساسية التي يجب أن يفهمها الزائر؟ (Primary Message)
201
+ - Q3b.5: ما المحتوى المطلوب ظهوره؟ (Required Content Blocks)
202
+ - Q3b.6: ما CTA المطلوب (إن وُجد)؟ وإلى أين؟
203
+ - Q3b.7: ما المحتوى الممنوع/الحساس؟ (Forbidden — راجع D-015)
204
+ - Q3b.8: ما Claims المسموح ادعاؤها؟ (من قرارات Discovery — أرقام موثقة في مصادر الحقيقة فقط)
205
+ - Q3b.9: ما الأولويات بين الرسائل في هذه الشاشة؟ (Content Priorities)
206
+ - Q3b.10: من Content Owner / Source المعتمد؟
207
+
208
+ > **التفعيل:** تُستخدم هذه الأسئلة ضمن **Content Confirmation Gate** (بروتوكول التحضير §7.5) بعد إنتاج `07_SCREENS_AND_UI_STRUCTURE.md` وقبل التصميم النهائي. التطبيقات القياسية (Application Data فقط) لا تستخدمها — Anti-Bloat.
209
+
210
+ ---
211
+
212
+ ## Domain 4: Technical
213
+
214
+ *Understanding technology stack, integrations, and environment.*
215
+
216
+ ### Essential
217
+ - Q4.1: Is the technology stack already decided? What is it?
218
+ - Q4.2: What type of application? (web, mobile, desktop, hybrid)
219
+ - Q4.3: What database is required? (if any)
220
+ - Q4.4: 🔍 Are there external integrations or APIs? (payment gateways, third-party services, legacy systems)
221
+ - Q4.5: 🔍 What is the target environment? (cloud, on-premise, hybrid)
222
+ - Q4.6: Are there any forbidden technologies or libraries?
223
+
224
+ ### Deep dive (when needed)
225
+ - Q4.7: Is there an existing codebase, database, or design system?
226
+ - Q4.8: 🔍 Does the application need to be containerized? (Docker, Kubernetes)
227
+ - Q4.9: 🔍 Are there performance or scalability requirements?
228
+ - Q4.10: What is the expected uptime or SLA?
229
+ - Q4.11: 🔍 Does the application need CI/CD pipeline?
230
+ - Q4.12: 🔍 Are there specific hosting providers preferred or required?
231
+ - Q4.13: Does the client prefer specific frameworks or languages?
232
+ - Q4.14: Are there API versioning requirements?
233
+ - Q4.15: Does the application need webhooks or event-driven architecture?
234
+ - Q4.16: Is there a dev/test/prod environment requirement?
235
+
236
+ ### Mobile-specific (when application type = Mobile)
237
+ - Q4.17: Is the target platform Android, iOS, or both?
238
+ - Q4.18: 🔍 Does the application need offline mode? What data should be available offline?
239
+ - Q4.19: 🔍 Does the application need push notifications? (FCM, local, both)
240
+ - Q4.20: Does the application need device hardware? (camera, GPS, fingerprint, NFC, Bluetooth, barcode scanner)
241
+ - Q4.21: What is the minimum supported Android/iOS version?
242
+ - Q4.22: Are there specific device classes to support? (phones only, tablets, foldables)
243
+ - Q4.23: Will the app be published on Google Play, Apple App Store, or both?
244
+ - Q4.24: Does the client have an Apple Developer account ($99/year)?
245
+ - Q4.25: 🔍 Does the application need background execution? (location tracking, sync, music playback)
246
+ - Q4.26: 🔍 Are there specific accessibility requirements? (screen readers, large fonts, high contrast)
247
+ - Q4.27: 🔍 Does the application need cross-platform framework? (Flutter vs React Native vs native)
248
+ - Q4.28: Does the client have existing APIs or will new APIs be built?
249
+ - Q4.29: 🔍 Does the application need deep linking or universal links?
250
+ - Q4.30: Is there a requirement for app widgets or home screen widgets?
251
+
252
+ ---
253
+
254
+ ## Domain 5: Design and UX
255
+
256
+ *Understanding visual identity, user experience, and design references.*
257
+
258
+ ### Essential
259
+ - Q5.1: Does the client have a logo, brand colors, or existing style guide?
260
+ - Q5.2: 🔍 Are there reference applications or websites the client likes?
261
+ - Q5.3: Are there examples the client explicitly dislikes?
262
+ - Q5.4: 🔍 Does the client prefer a specific design style? (modern, minimal, corporate, playful)
263
+ - Q5.5: Does the application need to be RTL-friendly? (Arabic, Hebrew)
264
+ - Q5.6: Does the client have existing UI components or a design system?
265
+
266
+ ### Deep dive (when needed)
267
+ - Q5.7: Are there specific color palettes or hex codes?
268
+ - Q5.8: What typography or fonts are preferred?
269
+ - Q5.9: Are there icons or illustrations to use?
270
+ - Q5.10: 🔍 Does the client want a mobile-first design?
271
+ - Q5.11: 🔍 Are there accessibility requirements? (WCAG, screen readers)
272
+ - Q5.12: Does the client have wireframes, mockups, or Figma designs?
273
+ - Q5.13: Describe the desired layout or navigation style. (sidebar, top nav, tabbed)
274
+ - Q5.14: Are there form-heavy screens or content-heavy screens?
275
+ - Q5.15: What is the tone of the interface? (professional, casual, educational)
276
+ - Q5.16: Should Tera propose 2-3 design directions using internal kits or `getdesign.md` references?
277
+ - Q5.17: Does the client approve using an external DESIGN.md as inspiration, with project-specific branding overrides?
278
+
279
+ ---
280
+
281
+ ## Domain 6: Security and Permissions
282
+
283
+ *Understanding authentication, authorization, data sensitivity, and compliance.*
284
+
285
+ ### Essential
286
+ - Q6.1: 🔍 Does the application need user authentication? (email/password, SSO, OAuth, social login)
287
+ - Q6.2: Are there different user roles with different permissions?
288
+ - Q6.3: 🔍 Does the application handle sensitive personal data?
289
+ - Q6.4: 🔍 Is there a compliance requirement? (GDPR, HIPAA, SOC2, local regulations)
290
+ - Q6.5: Does the application need audit logs or activity tracking?
291
+ - Q6.6: 🔍 Are there file uploads or document storage? What type?
292
+
293
+ ### Deep dive (when needed)
294
+ - Q6.7: What is the authentication method? (JWT, session-based, OAuth2, SAML)
295
+ - Q6.8: Are there multi-factor authentication requirements?
296
+ - Q6.9: Describe the role hierarchy and permission model.
297
+ - Q6.10: Are there IP restrictions or geographic restrictions?
298
+ - Q6.11: Does the application need encryption at rest and in transit?
299
+ - Q6.12: Are there third-party identity providers? (Azure AD, Okta, Google)
300
+ - Q6.13: Are there data anonymization or pseudonymization needs?
301
+ - Q6.14: What is the data classification level? (public, internal, confidential, restricted)
302
+ - Q6.15: Are there security penetration testing requirements?
303
+
304
+ ---
305
+
306
+ ## Domain 7: Operational and Deployment
307
+
308
+ *Understanding hosting, deployment, maintenance, and delivery.*
309
+
310
+ ### Essential
311
+ - Q7.1: 🔍 Where will the application be hosted? (cloud provider, on-premise, hybrid)
312
+ - Q7.2: Who will maintain the application after delivery?
313
+ - Q7.3: Is there a domain name or SSL certificate already available?
314
+ - Q7.4: 🔍 Are there email service requirements? (transactional emails, notifications)
315
+ - Q7.5: What is the expected timeline for the first release?
316
+
317
+ ### Deep dive (when needed)
318
+ - Q7.6: Is there an IT team that will manage deployment?
319
+ - Q7.7: Are there specific DevOps or infrastructure tools in use?
320
+ - Q7.8: Does the application need monitoring and alerting? (errors, performance, uptime)
321
+ - Q7.9: Are there backup and disaster recovery requirements?
322
+ - Q7.10: Is there a maintenance or support period after delivery?
323
+ - Q7.11: Does the application need a custom domain or subdomain?
324
+ - Q7.12: What is the deployment frequency expectation?
325
+ - Q7.13: Are there API rate limiting or throttling requirements?
326
+ - Q7.14: Does the client need a staging or UAT environment?
327
+ - Q7.15: Are there specific logging or observability requirements?
328
+
329
+ ---
330
+
331
+ ## After Questions: Suggestions and Improvements Phase
332
+
333
+ Once all relevant domains have been covered and Tera has a complete picture, proceed to:
334
+
335
+ 1. **Summarize understanding** — Confirm with the user/client.
336
+ 2. **Identify gaps** — Any area that still needs clarification.
337
+ 3. **Propose improvements** — Tera may suggest:
338
+ - Features that improve the core goal
339
+ - Technologies that fit the requirements
340
+ - Simplifications or scope reductions
341
+ - Deferrals for non-essential items
342
+ 4. **Classify each suggestion** as:
343
+ - `Recommended — Include now`
344
+ - `Recommended — Consider for later phase`
345
+ - `Informational — For awareness only`
346
+ - `Deferred — Not needed for MVP`
347
+ - `Out of scope — Does not align with goals`
348
+ 5. **Document all suggestions separately** from confirmed client requirements.
349
+ 6. **Final confirmation** before moving to formal preparation.
350
+
351
+ ---
352
+
353
+ ## Usage Rules
354
+
355
+ 1. **Tera does not ask all questions.** Select the essential ones first, then deep-dive only in domains that need it.
356
+ 2. **Start with Domain 1 (Administrative), Domain 2 (Functional), and Domain 4 (Technical) essentials.** These give the core picture.
357
+ 3. **Analyze after each batch.** Identify gaps, dependencies, and unexpected areas before choosing the next batch.
358
+ 4. **Group questions in small batches.** 4-7 questions per round is comfortable.
359
+ 5. **Document answers immediately** in `project-inputs/` files.
360
+ 6. **After the interview is complete**, transition to the Suggestions and Improvements phase.
361
+ 7. **For external clients**, Majed acts as intermediary. Tera phrases questions for forwarding.
362
+ 8. **Suggested improvements must be clearly separated** from confirmed requirements.