@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,91 @@
1
+ <!-- © 2026 Majed Khaireddin (Alabasi1980). Tera System — Proprietary. All rights reserved. -->
2
+
3
+ # Tera Architecture Map
4
+
5
+ ## 1. Purpose
6
+
7
+ This file describes Tera as an operating system for client and software project delivery.
8
+
9
+ It is a map, not a policy source. Rules remain in the files listed in `TeraPolicyMap.md`.
10
+
11
+ ## 2. Architectural Layers
12
+
13
+ | Layer | Responsibility | Main files/folders |
14
+ |---|---|---|
15
+ | Identity and authority | Defines Tera role, authority, runtime order, decision ownership, and core agent conduct gate | `.opencode/agents/tera.md`, `TERA_AGENT_CONDUCT.md` |
16
+ | Strategic advisory and decision support | Helps Majed evaluate whether a decision, project, fork, or direction is right before execution; advisory only, no approval or execution authority | `.opencode/agents/tera-strategic-advisor.md` |
17
+ | Project intake | Captures raw idea, technical context, missing information, and readiness | `TeraProjectIntakePolicy.md`, `project-inputs/` |
18
+ | Client engagement and approval | Manages client profile, contacts, approval package, and change control — the commercial truth layer | `TeraClient*.md`, `clients/`, `.opencode/agents/tera-client-engagement.md` |
19
+ | Solution preparation (phases 1–4) | Owned by مُهندس (ApplicationBlueprintAgent). Converts confirmed handoff into blueprint, intake, project decision, preparation planning, delegation, cross-review, baseline, and Engineering Handoff Package | `.opencode/agents/application-blueprint.md`, `Tera_Project_Preparation_Files.md`, `project-preparation/`, `runtime/TERA_SOLUTION_PREPARATION_*.md` |
20
+ | Design governance | Controls design source decisions, design tokens, component rules, internal kits, and UI acceptance | `tera-system/design-system/`, `project-preparation/28_UI_UX_GUIDELINES.md` |
21
+ | Engineering handoff gate | Two-gate handoff between مُهندس and Tera: Solution Readiness Gate → Engineering Handoff Package → Engineering Intake Gate | `ENGINEERING_HANDOFF_PACKAGE.md`, `project-control/` |
22
+ | Execution orchestration (phases 5–7) | Owned by TeraAgent (Engineering Delivery Lead). Execution planning, delegation to Coding/QA/Audit agents, Pre/Post gates, implementation, delivery, closure | `TeraPreExecutionGate.md`, `runtime/TERA_RUNTIME_*.md`, `project-control/` |
23
+ | Technical specialization | Keeps stack-specific behavior outside the generic Tera system | `tera-system/profiles/` |
24
+ | Domain knowledge specialization | Keeps reusable domain knowledge references outside generic agent prompts | `tera-system/knowledge-base/` |
25
+ | Sub-agent lifecycle | Defines, generates, narrows, activates, and reviews specialized agents | `TeraSubAgents.md`, `AGENT_GENERATION_TEMPLATE.md`, `generated-agents/` |
26
+ | Delivery, handoff, and closure | Produces final delivery readiness, release notes, client handover material, acceptance records, and closure reports | `project-control/DELIVERY_READINESS_REPORT.md`, `project-control/PROJECT_CLOSURE_REPORT.md`, `clients/.../delivery/` |
27
+ | Project implementation knowledge | Maintains concise current-state operational knowledge per screen/module/service | `project-knowledge/` داخل كل تطبيق |
28
+ | Tera distribution and versioning | Builds releases and distributes Tera to client repositories in a versioned, verifiable way; clients derive updates from the origin repository (RepositoryUrl) via fetch + verified release packages (Tag + Manifest + SHA lockfile + updater tools); ownership contract separates Tera-managed from client-owned files | `tera-system/TERA_DISTRIBUTION_POLICY.md`, `tera-workshop/tools/tera-fetch.ps1`, `tera-workshop/tools/tera-release.ps1`, `tera-workshop/tools/tera-update.ps1`, `.tera/lock.json` داخل مستودعات العملاء |
29
+
30
+ ## 3. Folder Roles
31
+
32
+ | Folder | Role | Must not be used for |
33
+ |---|---|---|
34
+ | `tera-system/` | System reference and policies | Project-specific outputs |
35
+ | `.opencode/agents/` | Active runtime agents | Long policy details |
36
+ | `project-inputs/` | Raw or normalized intake inputs | Formal preparation replacements |
37
+ | `project-preparation/` | Solution preparation outputs (مُهندس) | Client-facing approval package |
38
+ | `clients/` | Client records, approval, assets, communications, delivery | Internal-only execution planning |
39
+ | `project-control/` | Task, issue, decision, activity, state tracking; Engineering Handoff Package | Requirements source of truth |
40
+ | `generated-agents/opencode/` | Draft generated agents | Active runtime without review |
41
+ | `tera-system/design-system/` | System design governance, schemas, gates, internal kits | Project-specific design decisions |
42
+ | `tera-system/profiles/` | Technology-specific execution rules | Generic project policy |
43
+ | `tera-system/knowledge-base/` | Reusable domain knowledge references | Project-specific client facts |
44
+ | `tera-system/engineering-helpers/` | Shared engineering reference files | Language-specific profiles |
45
+ | `tera-workshop/` | System development and tooling files | Core policy or project files |
46
+ | `tera-workshop/tools/` | Official Tera updater tooling (tera-update.ps1 + batch updater) used to pin/upgrade Tera in client repositories | Client application code; replacing client-owned files |
47
+ | `book/` | Comprehensive user-facing documentation and guides (Quick Start, Vision, Quality, Policies) | Runtime operational files; per-project records |
48
+ | `architecture/` | Structurizr C4 workspace (`.dsl` source of truth + exported diagrams) | Application code; client project files |
49
+
50
+ ## 4. Core Flow
51
+
52
+ ```text
53
+ Client / User Idea
54
+ -> Owner Strategic Advisory when requested
55
+ -> [External] TCEA: Client Discovery → Pricing → Approval → Handoff
56
+ -> مُهندس: Blueprint + Phases 1–4 → Solution Baseline → Solution Readiness Gate
57
+ -> Engineering Handoff Package
58
+ -> Tera: Engineering Intake Gate → Phase 5 Execution Planning
59
+ -> Phase 6: Delegated Implementation (Coding/QA/Audit agents)
60
+ -> Phase 7: Technical Delivery & Closure
61
+ -> [External] TCEA: client-facing delivery support when requested
62
+ ```
63
+
64
+ ## 5. External Client Flow
65
+
66
+ ```text
67
+ Client Registration → Contacts → Application Intake
68
+ → Client Questions through Majed → Discovery Coverage
69
+ → Client Approval Package → Approval Record → Execution Authorization
70
+ → TCEA Handoff to مُهندس
71
+ → مُهندس: Blueprint + Phases 1–4 → Solution Baseline
72
+ → Solution Readiness Gate → Engineering Handoff Package
73
+ → Tera: Engineering Intake Gate → Phases 5–7
74
+ → Change Control for later requests
75
+ ```
76
+
77
+ ## 6. Runtime Design Principle
78
+
79
+ All core runtime agents must pass the conduct gate in `tera-system/TERA_AGENT_CONDUCT.md`.
80
+
81
+ `.opencode/agents/tera.md` should answer:
82
+ - What must Tera load now?
83
+ - What is forbidden now?
84
+ - Which policy should Tera read for details?
85
+ - Is Build Mode allowed?
86
+
87
+ It should not duplicate full policies, templates, or long agent contracts.
88
+
89
+ ## 7. Stability Rule
90
+
91
+ When the system grows, add new policies only when there is a clear operating gap. Prefer updating maps and existing policies over creating new layers.
@@ -0,0 +1,366 @@
1
+ # Tera Client Policy
2
+
3
+ > Merged from: `TeraClientEngagementPolicy.md`, `TeraClientApprovalPolicy.md`, `TeraClientChangeControlPolicy.md`, `TeraClientFacingContentPolicy.md` (v1.0)
4
+
5
+ ## 1. Purpose
6
+
7
+ This policy defines how Tera handles external client projects — from discovery and engagement through approval, change control, and client-facing documentation.
8
+
9
+ Tera must treat client work as a documented relationship, not only a technical build request.
10
+
11
+ ---
12
+
13
+ ## 2. Core Rules
14
+
15
+ ```text
16
+ Spoken client input is not final until documented.
17
+ No documented client context = No client project preparation.
18
+ No documented approval authority = No final client approval.
19
+ No Client Approval Package = No Implementation.
20
+ No Approved Scope = No Build Mode.
21
+ No Approved Design Direction = No Final UI Implementation.
22
+ No Approved Change Request = No Scope Expansion.
23
+ No Client Handover Package = No client project closure.
24
+ Client approval must be visible in files, not only in chat.
25
+ ```
26
+
27
+ ---
28
+
29
+ ## 3. Client Workspace Structure
30
+
31
+ Client-facing and client-management files belong under:
32
+
33
+ ```text
34
+ clients/
35
+ ```
36
+
37
+ Required structure:
38
+
39
+ ```text
40
+ clients/
41
+ CLIENT-[client-name-or-id]/
42
+ CLIENT_PROFILE.md
43
+ CONTACTS.md
44
+ applications/
45
+ APP-[app-name-or-id]/
46
+ client-approval/
47
+ client-assets/
48
+ client-communications/
49
+ delivery/
50
+ ```
51
+
52
+ Rules:
53
+
54
+ - Each client must have a dedicated folder.
55
+ - Each client application must have a dedicated application folder.
56
+ - Do not mix client-facing approval material with internal `project-preparation/` files.
57
+ - Do not store secrets, passwords, access tokens, or private credentials in client files.
58
+ - Final client handover material belongs in `clients/CLIENT-*/applications/APP-*/delivery/`.
59
+
60
+ ---
61
+
62
+ ## 4. Required Client Profile
63
+
64
+ ```text
65
+ CLIENT_PROFILE.md
66
+ ```
67
+
68
+ Minimum content:
69
+
70
+ - client name
71
+ - client type: individual / company / organization
72
+ - business domain
73
+ - default client-facing language: Arabic unless the user decides otherwise
74
+ - technical familiarity: low / medium / high / unknown
75
+ - decision style and communication notes
76
+ - project sensitivity: low / medium / high / critical
77
+ - preferred approval method
78
+ - general relationship notes
79
+
80
+ ---
81
+
82
+ ## 5. Required Contacts File
83
+
84
+ ```text
85
+ CONTACTS.md
86
+ ```
87
+
88
+ Minimum content per contact:
89
+
90
+ - name
91
+ - role at client side
92
+ - decision authority: decision maker / reviewer / technical contact / finance / other
93
+ - phone number if available
94
+ - email if available
95
+ - preferred communication channel
96
+ - approval authority: yes / no / unknown
97
+ - communication notes
98
+
99
+ Tera must not treat approval from a contact as final unless that contact has documented approval authority or the user explicitly confirms it.
100
+
101
+ ### Client Discovery Output — Application Proposal
102
+
103
+ After the Client Discovery + Smart Interview process completes (see `TERA_RUNTIME_PROTOCOLS_CLIENT.md` Section 18), the designated agent (TCEA for external clients, مُهندس for internal projects — SCP-2026-07-28-118) generates a **professional client-facing Application Proposal** as an HTML page using `tera-workshop/APPLICATION_PROPOSAL_TEMPLATE.html`.
104
+
105
+ The proposal captures: understanding, users & roles, scope (MVP + out-of-scope), requirements by domain, assumptions, and proposed roadmap. Generated from `tera-workshop/APPLICATION_PROPOSAL_TEMPLATE.html`.
106
+
107
+ The proposal is saved under `clients/.../client-approval/` and **must be approved by the client** before formal preparation begins. The approved proposal becomes the official scope reference for all subsequent gates.
108
+
109
+ ---
110
+
111
+ ## 6. Client Discovery
112
+
113
+ When a new external client project starts, Tera must enter Client Discovery before implementation.
114
+
115
+ Client Discovery gathers:
116
+
117
+ - client identity
118
+ - contacts and approval authority
119
+ - application idea
120
+ - client goals
121
+ - client pain points
122
+ - preferred style and visual direction
123
+ - reference apps, sites, documents, colors, or brand assets
124
+ - non-preferred examples
125
+ - expected approval process
126
+ - budget/time sensitivity if the user chooses to provide it
127
+ - client-specific risks
128
+
129
+ ### Mandatory Discovery Coverage Rule
130
+
131
+ For external client work managed through `TeraClientEngagementAgent`, confirmed understanding alone is not sufficient.
132
+
133
+ TCEA must not treat scope, quotation, or handoff outputs as ready until mandatory discovery coverage has been evaluated across the required discovery domains and approved by Majed.
134
+
135
+ ### Discovery Coverage Evidence
136
+
137
+ Discovery coverage must be visible in files, not only in chat.
138
+
139
+ Recommended operational evidence:
140
+
141
+ ```text
142
+ clients/.../client-engagement/DISCOVERY_COVERAGE_SUMMARY.md
143
+ ```
144
+
145
+ The file should show:
146
+ - domain coverage status
147
+ - blocking vs non-blocking gaps
148
+ - assumptions
149
+ - readiness decision for scope / quotation / handoff
150
+
151
+ ### Final Rule
152
+
153
+ ```text
154
+ No discovery coverage evidence = no trusted client scope, no trusted quotation basis, and no trusted internal handoff.
155
+ ```
156
+
157
+ ### Majed as Client Intermediary
158
+
159
+ The normal operating model is:
160
+
161
+ - Tera asks Majed short, direct client questions.
162
+ - Majed asks the client.
163
+ - Majed returns the answers to Tera.
164
+ - Tera documents material answers in the correct files.
165
+
166
+ Tera must phrase questions so they can be forwarded to the client with minimal editing.
167
+
168
+ ### Improvement Suggestions
169
+
170
+ Tera may suggest improvements, additions, or simplifications only if they:
171
+
172
+ - support the client's original goal
173
+ - do not change the core project idea
174
+ - are clearly marked as suggestions
175
+ - are separated from confirmed scope
176
+ - are offered for Majed to review with the client
177
+
178
+ Suggestions do not become scope until approved and documented.
179
+
180
+ ---
181
+
182
+ ## 7. Client Approval Package
183
+
184
+ ### Location
185
+
186
+ ```text
187
+ clients/CLIENT-[client-name-or-id]/applications/APP-[app-name-or-id]/client-approval/
188
+ ```
189
+
190
+ ### Required Files
191
+
192
+ The default mandatory package is:
193
+
194
+ - `01_CLIENT_PROJECT_BRIEF.md`
195
+ - `02_CLIENT_PROPOSAL.md`
196
+ - `03_SCOPE_OF_WORK.md`
197
+ - `04_FEATURE_SCOPE_MATRIX.md`
198
+ - `05_USER_FLOWS.md`
199
+ - `06_SCREEN_MAP.md`
200
+ - `07_DESIGN_DIRECTION.md`
201
+ - `08_PROTOTYPE_PLAN.md`
202
+ - `09_ACCEPTANCE_CRITERIA.md`
203
+ - `10_CLIENT_APPROVAL_RECORD.md`
204
+ - `11_CHANGE_CONTROL.md`
205
+
206
+ If a file is not applicable to a very small project, Tera must still create an explicit section in `10_CLIENT_APPROVAL_RECORD.md` explaining why it is not applicable and what replaced it.
207
+
208
+ ### Approval Gates
209
+
210
+ | Gate | Required approval |
211
+ |---|---|
212
+ | Gate 1: Idea Approval | The client confirms the project idea is understood correctly. |
213
+ | Gate 2: Scope Approval | The client confirms what is in scope, out of scope, and deferred. |
214
+ | Gate 3: Flow Approval | The client confirms the main user and business flows. |
215
+ | Gate 4: Screen Approval | The client confirms the screen list and screen purposes. |
216
+ | Gate 5: Design Direction Approval | The client confirms visual direction, tone, and references. |
217
+ | Gate 6: Prototype Approval | The client confirms the prototype or prototype plan when applicable. |
218
+ | Gate 7: Execution Authorization | The client authorizes moving into implementation. |
219
+
220
+ ### Approval Record
221
+
222
+ `10_CLIENT_APPROVAL_RECORD.md` must document:
223
+
224
+ - client name
225
+ - application name
226
+ - approval date or pending status
227
+ - approving contact
228
+ - approval authority evidence or user confirmation
229
+ - approved files
230
+ - pending decisions
231
+ - rejected or deferred items
232
+ - execution authorization status
233
+
234
+ ### Relationship to Internal Implementation
235
+
236
+ Implementation tasks must trace back to approved scope and acceptance criteria.
237
+
238
+ Tera must not create implementation `TASK-ID`s for client work before Gate 7 passes.
239
+
240
+ If Majed explicitly authorizes a pre-approval technical spike, it must be treated as non-deliverable research only, must not modify final application code, must not become client scope, and must be documented separately from Build Mode.
241
+
242
+ ---
243
+
244
+ ## 8. Change Control
245
+
246
+ ```text
247
+ No undocumented change requests during execution.
248
+ ```
249
+
250
+ ### Change Log Location
251
+
252
+ ```text
253
+ clients/CLIENT-[client-name-or-id]/applications/APP-[app-name-or-id]/client-approval/11_CHANGE_CONTROL.md
254
+ ```
255
+
256
+ If a change affects execution tasks, also record the related decision or issue in `project-control/`.
257
+
258
+ ### Change Types
259
+
260
+ | Type | Meaning | Default action |
261
+ |---|---|---|
262
+ | Clarification | Explains an existing approved item without changing scope | Document and continue |
263
+ | Minor Adjustment | Small change inside approved scope | Document and allow if low risk |
264
+ | Enhancement | Improves an approved feature but adds work | Ask user before adding |
265
+ | New Scope | Adds a new feature, screen, workflow, integration, or data area | Requires explicit approval |
266
+ | Phase 2 | Valuable but not needed for current delivery | Defer |
267
+ | Rejected | Conflicts with project goal, approved scope, or constraints | Do not implement |
268
+
269
+ ### Change Record Format
270
+
271
+ Each change record must include:
272
+
273
+ - change ID
274
+ - date
275
+ - requester
276
+ - request summary
277
+ - affected approved file or gate
278
+ - classification
279
+ - scope impact
280
+ - design impact
281
+ - technical impact
282
+ - time/cost impact if known
283
+ - decision: approve / defer / reject / needs client decision
284
+ - approval authority
285
+ - related task or issue if any
286
+
287
+ ### Implementation Restriction
288
+
289
+ Tera must not implement a change classified as `Enhancement` or `New Scope` until Majed confirms the required client approval and the approval is documented.
290
+
291
+ For `New Scope`, approval from the documented client approval authority is required unless Majed explicitly records that the item is deferred to a later phase and will not affect the current build.
292
+
293
+ ### Final Rule
294
+
295
+ ```text
296
+ Approved project scope can only change through an approved change record.
297
+ ```
298
+
299
+ ---
300
+
301
+ ## 9. Client-Facing Content
302
+
303
+ ### Default Language
304
+
305
+ Client-facing documents are written in Arabic by default.
306
+
307
+ Use another language only when Majed explicitly requests it.
308
+
309
+ ### Content Rules
310
+
311
+ Client-facing content must be:
312
+
313
+ - clear and readable by non-technical clients
314
+ - concise but complete enough for approval
315
+ - free of internal Tera implementation details
316
+ - free of sub-agent names, internal orchestration details, token policies, or runtime mechanics
317
+ - explicit about scope, assumptions, exclusions, and pending decisions
318
+ - careful not to promise uncertain timelines, costs, integrations, or capabilities
319
+
320
+ ### Separation Rule
321
+
322
+ Do not expose internal Tera files directly as client documents unless Tera has rewritten them into client-facing form.
323
+
324
+ Examples:
325
+
326
+ - `project-preparation/08_TECHNICAL_ARCHITECTURE.md` is internal.
327
+ - `clients/.../client-approval/02_CLIENT_PROPOSAL.md` is client-facing.
328
+
329
+ ### Approval Language
330
+
331
+ Every approval document must include a clear approval section, such as:
332
+
333
+ ```text
334
+ حالة الاعتماد: معتمد / يحتاج تعديل / مرفوض / بانتظار قرار
335
+ ملاحظات العميل:
336
+ الشخص المعتمد:
337
+ تاريخ الاعتماد:
338
+ ```
339
+
340
+ ### Suggestion Language
341
+
342
+ Suggestions must be marked clearly:
343
+
344
+ ```text
345
+ اقتراح من تيرا - يحتاج موافقة العميل قبل اعتباره ضمن النطاق.
346
+ ```
347
+
348
+ ### Final Rule
349
+
350
+ ```text
351
+ Client-facing content must protect clarity, scope, and trust.
352
+ ```
353
+
354
+ ---
355
+
356
+ ## 10. Relationship to Internal Tera Files
357
+
358
+ Client files are official relationship and approval records.
359
+
360
+ Internal Tera files remain responsible for execution planning:
361
+
362
+ - `project-inputs/`
363
+ - `project-preparation/`
364
+ - `project-control/`
365
+
366
+ If a client-facing file conflicts with an internal Tera file, Tera must stop affected work and ask the user to resolve the contradiction.