agent-enderun 0.6.5 → 0.6.6

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 (56) hide show
  1. package/.enderun/BRAIN_DASHBOARD.md +12 -12
  2. package/.enderun/PROJECT_MEMORY.md +15 -123
  3. package/.enderun/STATUS.md +13 -13
  4. package/.enderun/agents/README.md +40 -0
  5. package/.enderun/agents/analyst.md +178 -58
  6. package/.enderun/agents/backend.md +224 -58
  7. package/.enderun/agents/explorer.md +123 -50
  8. package/.enderun/agents/frontend.md +216 -26
  9. package/.enderun/agents/git.md +146 -72
  10. package/.enderun/agents/manager.md +23 -3
  11. package/.enderun/agents/mobile.md +136 -66
  12. package/.enderun/agents/native.md +176 -63
  13. package/.enderun/blueprints/README.md +82 -0
  14. package/.enderun/docs/README.md +50 -0
  15. package/.enderun/docs/phase1-reference-app-execution-plan.md +177 -0
  16. package/.enderun/docs/structure-audit-2026-05-24.md +72 -0
  17. package/.enderun/knowledge/README.md +22 -0
  18. package/.enderun/knowledge/database_governance_guidelines.md +118 -0
  19. package/.enderun/knowledge/deployment_checklist.md +132 -6
  20. package/.enderun/knowledge/documentation_ownership.md +122 -0
  21. package/.enderun/knowledge/documentation_ownership_status.md +122 -0
  22. package/.enderun/knowledge/enterprise_capabilities_reference.md +149 -0
  23. package/.enderun/knowledge/enterprise_frontend_adaptation.md +232 -0
  24. package/.enderun/knowledge/enterprise_project_adaptation.md +168 -0
  25. package/.enderun/knowledge/frontend_professionalization_guidelines.md +20 -17
  26. package/.enderun/knowledge/frontend_real_battle_test_protocol.md +162 -0
  27. package/.enderun/knowledge/hermes_live_test_guidelines.md +5 -5
  28. package/.enderun/knowledge/manager_authority_audit_enforcement.md +8 -8
  29. package/.enderun/knowledge/project_scaffold_guidelines.md +4 -4
  30. package/.enderun/knowledge/reference_application_guidelines.md +6 -6
  31. package/ENDERUN.md +13 -6
  32. package/README.md +98 -183
  33. package/bin/hermes-sandbox.js +136 -0
  34. package/docs/action-plan-2026.md +119 -0
  35. package/docs/getting-started.md +12 -238
  36. package/docs/roadmap.md +15 -73
  37. package/framework-mcp/README.md +1 -1
  38. package/framework-mcp/dist/schemas.js +6 -0
  39. package/framework-mcp/dist/tools/database.js +7 -2
  40. package/framework-mcp/dist/tools/framework.js +4 -4
  41. package/framework-mcp/dist/tools/knowledge.js +1 -1
  42. package/framework-mcp/dist/tools/memory.js +2 -2
  43. package/framework-mcp/dist/tools/messages.js +71 -11
  44. package/framework-mcp/dist/utils.js +1 -1
  45. package/framework-mcp/package.json +1 -1
  46. package/framework-mcp/src/tools/database.ts +7 -2
  47. package/framework-mcp/src/tools/framework.ts +4 -4
  48. package/framework-mcp/src/tools/knowledge.ts +1 -1
  49. package/framework-mcp/src/tools/memory.ts +2 -2
  50. package/framework-mcp/src/tools/messages.ts +4 -4
  51. package/framework-mcp/src/utils.ts +18 -1
  52. package/framework-mcp/tsconfig.json +1 -1
  53. package/package.json +3 -3
  54. package/.enderun/messages/2026-05-23-backend-to-manager-auth-errors-reply.json +0 -23
  55. package/.enderun/messages/2026-05-23-manager-to-backend-auth-errors.json +0 -26
  56. /package/.enderun/blueprints/backend/errors/{blueprint.json → config/meta.json} +0 -0
@@ -0,0 +1,122 @@
1
+ # Documentation Ownership — Framework vs User Project
2
+
3
+ **Version:** 1.0
4
+ **Owner:** @manager
5
+ **Created:** May 24, 2026
6
+ **Status:** Mandatory Framework Rule
7
+
8
+ ---
9
+
10
+ ## Purpose
11
+
12
+ In large-scale enterprise projects, it is mandatory to establish clear **ownership** of documentation. Otherwise, framework rules blend with project-specific decisions, causing information noise and rendering the system unmanageable in the long term.
13
+
14
+ ## Core Rule (Mandatory)
15
+
16
+ | Type | Where to Store? | Who is Responsible? | Description |
17
+ |-----|------------------|--------------|----------|
18
+ | **Framework Rules** | `.enderun/knowledge/` | Agent Enderun (all agents) | Mandatory standards and governance rules that all agents must follow |
19
+ | **User Project Documentation** | User project's own `docs/` folder | @manager + relevant agents (especially @frontend, @backend, @analyst) | Project-specific decisions, implementation details, and patterns |
20
+
21
+ ### Clear Distinction
22
+
23
+ - **Framework Rule Example:**
24
+ “All user notifications, confirmations, and high-risk action feedback **must** be done exclusively through the Toaster.”
25
+
26
+ - **User Project Decision Example:**
27
+ “In this project, the `sonner` library will be used as the Toaster. A custom `ConfirmationToast` component will be developed for admin panel confirmations. Details: `docs/frontend/notifications.md`”
28
+
29
+ ---
30
+
31
+ ## Agent Responsibilities
32
+
33
+ ### General Rule (For All Agents)
34
+ - If an agent generates a new pattern, decision, or standard for the user project, they are **mandated** to write this into the user's own documentation structure.
35
+ - These documents are **never** written inside the `.enderun/` folder.
36
+
37
+ ### @frontend Special Responsibilities
38
+ - Toaster implementation, approval flows, notification rules, component pattern decisions -> Written to `docs/frontend/` or `apps/web/docs/` in the user's project.
39
+ - Documentation for high-risk admin UI flows must also reside in the user's project documentation.
40
+
41
+ ### @backend Special Responsibilities
42
+ - API contract decisions, error handling patterns, audit log standards, migration strategies -> Written to `docs/backend/` or `docs/architecture/` in the user's project.
43
+
44
+ ### @analyst and @manager Responsibilities
45
+ - @manager and @analyst audit the agents to ensure that project-specific documentation is written to the correct location.
46
+ - They actively demand the creation of these documents when necessary.
47
+
48
+ ---
49
+
50
+ ## Recommended Folder Structure (For User Project)
51
+
52
+ ```
53
+ docs/
54
+ ├── architecture/
55
+ │ ├── decisions/ # ADRs
56
+ │ ├── approval-flows.md # managerApproval and high-risk workflows
57
+ │ └── notification-strategy.md # Toaster + notification strategy
58
+ ├── frontend/
59
+ │ ├── component-patterns.md
60
+ │ ├── notifications.md # Toaster implementation and rules
61
+ │ └── forms.md
62
+ ├── backend/
63
+ │ ├── error-handling.md
64
+ │ └── audit-logging.md
65
+ └── README.md
66
+ ```
67
+
68
+ > **Note:** If the user project already uses a different documentation structure (e.g., `docs/arch/` or `docs/adr/`), the agents will adapt to that structure. The key requirement is that it must reside "inside the user project's own docs/ structure".
69
+
70
+ ---
71
+
72
+ ## Concrete Examples
73
+
74
+ ### Example 1: General Good vs Bad Approach
75
+
76
+ **Bad Approach (Forbidden):**
77
+ @explorer discovered a massive set of technical debt in a project. They wrote this into `.enderun/knowledge/technical_debt.md`.
78
+
79
+ → **Incorrect.** This information belongs to the user's project.
80
+
81
+ **Good Approach (Correct):**
82
+ After making the same discovery, @explorer wrote the findings into `docs/architecture/technical-debt.md` in the user's project and referenced the relevant team.
83
+
84
+ ---
85
+
86
+ ### Example 2: Good Example for @frontend
87
+
88
+ @frontend designed a custom approval workflow for high-risk admin actions in an enterprise project.
89
+
90
+ **Correct Behavior:**
91
+ - Created a new component (`ConfirmationModal`).
92
+ - Documented how to use this component and under what conditions it requires `managerApproval` in the `docs/frontend/approval-flows.md` file.
93
+ - Placed details of the toaster implementation (which library, which variants, accessibility rules) inside `docs/frontend/notifications.md`.
94
+
95
+ ---
96
+
97
+ ### Example 3: Good Example for @backend
98
+
99
+ @backend defined the audit log strategy and error handling patterns in a project.
100
+
101
+ **Correct Behavior:**
102
+ - Documented the audit log structure and which operations should be logged in `docs/backend/audit-logging.md`.
103
+ - Detailed the `DomainError` hierarchy and its usage rules inside `docs/backend/error-handling.md`.
104
+ - Did not just leave these decisions in code; they documented them professionally.
105
+
106
+ ---
107
+
108
+ These examples demonstrate how agents should write project-specific decisions to the user's own documentation structure rather than polluting framework folders.
109
+
110
+ ---
111
+
112
+ ## Related Documents
113
+
114
+ - `.enderun/knowledge/enterprise_frontend_adaptation.md` (especially sections 8.1 and 9)
115
+ - `.enderun/agents/frontend.md`
116
+ - `.enderun/agents/backend.md`
117
+ - `.enderun/agents/analyst.md`
118
+ - `ENDERUN.md` -> Framework vs User Project Boundary rule
119
+
120
+ ---
121
+
122
+ **This document is one of the foundational rules for maintaining documentation discipline in large enterprise projects with Agent Enderun.**
@@ -0,0 +1,122 @@
1
+ # Documentation Ownership — Implementation Status
2
+
3
+ **Owner:** @manager
4
+ **Last Updated:** May 24, 2026
5
+ **Purpose:** Show the actual, system-wide implementation status of the Documentation Ownership rule (requiring user project documents to reside exclusively in the user's `docs/` folder).
6
+
7
+ ---
8
+
9
+ ## 1. General Maturity Level
10
+
11
+ | Area | Score (10/10) | Comment |
12
+ |------|--------------|---------|
13
+ | Rule defined at constitutional level | 8.5 | Added to `ENDERUN.md` as a "Zero Tolerance" clause |
14
+ | Quality of the central rule document | 9.0 | `documentation_ownership.md` is well-structured and contains concrete examples |
15
+ | Presence of rule in agent definitions | 8.0 | Documented in all 8 agent prompts |
16
+ | Auditability in Completion Reports | 7.5 | Present in most agents, but still weak in some |
17
+ | Necessity in startup protocols | 6.0 | Actively referenced in only 3 agent startup flows |
18
+ | Real enforcement | 4.5 | Strong on paper, but currently weak in practical enforcement |
19
+ | **Overall System Maturity** | **7.2** | **Progressing well, but not yet fully "mature and coercive"** |
20
+
21
+ ---
22
+
23
+ ## 2. Detailed Agent Status (May 24, 2026)
24
+
25
+ | Agent | Rule Text | Completion Report | Startup Protocol | Consistency | Note | Score |
26
+ |------------|-------------|-------------------|-------------------|------------|-----|------|
27
+ | **@manager** | Strong | Present | Present | Good | One of the best-performing agents | 8.5 |
28
+ | **@frontend** | Very Strong | Clean | Present | Very Good | Most detailed and clean agent | 9.0 |
29
+ | **@backend** | Strong | Present | Present | Good | Solid level | 8.0 |
30
+ | **@analyst** | Mid-Good | Present | Partial | Medium | Included inside Memory Management | 6.5 |
31
+ | **@explorer** | Good | Present | Present | Good | Referenced in Startup Protocol | 7.5 |
32
+ | **@git** | Good | Present | None | Good | Newly added, reasonable | 7.0 |
33
+ | **@mobile** | Basic | Present | None | Weak | Basic level only | 4.5 |
34
+ | **@native** | Basic | Present | None | Weak | Basic level only | 4.5 |
35
+
36
+ **Important Note:** The @mobile and @native agents represent the weakest links in this implementation.
37
+
38
+ ---
39
+
40
+ ## 3. Critical Files Status
41
+
42
+ | File | Status | Evaluation |
43
+ |-------|-------|---------------|
44
+ | **ENDERUN.md** | Strong | Contains the "Zero Tolerance" clause |
45
+ | **documentation_ownership.md** | Very Good | Central document is high quality with added examples |
46
+ | **enterprise_project_adaptation.md** | Good | Referenced as a general rule |
47
+ | **enterprise_frontend_adaptation.md** | Very Good | The most detailed and well-crafted document |
48
+ | **enterprise_capabilities_reference.md** | Medium | Mentioned as a reference |
49
+ | **@manager.md** | Good | Present in Mandatory References + Startup Protocol |
50
+ | **frontend.md** | Very Good | Duplications cleaned up, the most mature agent |
51
+ | **backend.md** | Good | Contains Startup Protocol + Completion Report |
52
+ | **explorer.md** | Good | Referenced in the Startup Protocol |
53
+ | **analyst.md** | Medium | Present only inside Memory Management |
54
+
55
+ ---
56
+
57
+ ## 4. Remaining Weak and Risky Areas
58
+
59
+ ### High-Risk Deficiencies
60
+
61
+ 1. **@mobile and @native Agents**
62
+ - The rule only exists at a "basic" level. These agents could create significant inconsistencies when deployed on corporate projects.
63
+
64
+ 2. **Weakness in Session Startup Protocols**
65
+ - The Session Startup Protocols for @analyst, @git, @mobile, and @native agents do not reference this central document.
66
+
67
+ 3. **Lack of Real-World Enforcement**
68
+ - The rule is strong on paper, but @manager lacks a concrete mechanism to systematically audit this during turns.
69
+
70
+ 4. **Missing from "Mandatory References" Lists**
71
+ - For several agents, this document is still not officially listed in their "Mandatory References" section.
72
+
73
+ ### Medium-Level Risks
74
+
75
+ - Some Completion Report items are still written too generally.
76
+ - The rule needs a stronger emphasis in "document-heavy" agents like @explorer and @analyst.
77
+
78
+ ---
79
+
80
+ ## 5. Completed vs. Remaining Work
81
+
82
+ ### Completed Tasks (May 24, 2026)
83
+
84
+ - Rule added to `ENDERUN.md` (strong version)
85
+ - Central document (`documentation_ownership.md`) created and enriched with examples
86
+ - Rule text added to all 8 agent definitions
87
+ - Control item added to 6 agent Completion Reports
88
+ - References added to startup protocols for @manager, @frontend, @backend, and @explorer
89
+ - Duplications cleaned up (especially in `frontend.md`)
90
+
91
+ ### Remaining High-Priority Work
92
+
93
+ | Task | Priority | Difficulty | Owner |
94
+ |----|---------|--------|-------|
95
+ | Elevate @mobile and @native agents to match other agents | High | Medium | @manager |
96
+ | Add references to @analyst, @git, @mobile, and @native Startup Protocols | High | Low | @manager |
97
+ | Add to the "Mandatory References" list for all agents | High | Low | @manager |
98
+ | Define a real-world enforcement/audit mechanism | High | High | @manager |
99
+ | Enrich `documentation_ownership.md` with more examples | Medium | Low | @manager |
100
+ | Add rule to the @manager audit checklist | High | Medium | @manager |
101
+
102
+ ---
103
+
104
+ ## 6. Recommended Next Steps (In Order of Priority)
105
+
106
+ 1. **Elevate @mobile and @native agents** to the same level as other agents on this standard (most urgent).
107
+ 2. Add references to Session Startup Protocols for the remaining agents.
108
+ 3. Integrate this rule into @manager's regular Authority Audit process.
109
+ 4. Enrich the `documentation_ownership.md` file with more real-world examples.
110
+ 5. Periodically update this report (after each major agent capability upgrade).
111
+
112
+ ---
113
+
114
+ **Conclusion:**
115
+
116
+ The Documentation Ownership rule is now **active in the system** and significantly reinforced. However, to reach **full maturity**, further work is required, particularly regarding the @mobile and @native agents and the establishment of concrete enforcement mechanisms.
117
+
118
+ This status report should be used to track whether the rule remains strong in actual practice, not just on paper.
119
+
120
+ ---
121
+
122
+ **Last Updated:** May 24, 2026 — @manager
@@ -0,0 +1,149 @@
1
+ # Agent Enderun — Enterprise / Large-Scale Project Capabilities Reference
2
+
3
+ **Version:** v0.6.5+
4
+ **Owner:** @manager
5
+ **Last Updated:** May 24, 2026
6
+ **Status:** ACTIVE
7
+ **Related Decision:** D004 — Agent Capability First (May 23, 2026)
8
+
9
+ ---
10
+
11
+ ## 1. Purpose
12
+
13
+ This document defines in a single reference point the current capabilities, mandatory rules, and known limitations of the **Agent Enderun** multi-agent system when operating inside **large-scale, complex, enterprise codebases with legacy software**.
14
+
15
+ Objective: Enable any enterprise engineering team (or individual developer) entering the codebase to quickly understand Agent Enderun's realistic strengths and weaknesses.
16
+
17
+ ---
18
+
19
+ ## 2. Core Philosophy (Non-Negotiable Principle)
20
+
21
+ > **"Shape yourself to the user's project."**
22
+
23
+ - No agent shall impose its own reference architecture, folder layout, or technology preferences on the user's codebase.
24
+ - The agent must first discover the existing system deeply (architecture, design system, team conventions, technical debt).
25
+ - It must then adapt its code placements and styling patterns.
26
+ - Only then may it propose low-risk, targeted improvements.
27
+
28
+ This principle (D004) represents the operational backbone of all agent behaviors as of May 2026.
29
+
30
+ ---
31
+
32
+ ## 3. Current Live Capabilities (May 2026)
33
+
34
+ ### 3.1 Discovery and Adaptation
35
+ - **Enterprise Project Discovery Protocol (EPDP)** — Mandatory steps executed before modifying any codebase (root detection, monorepo/polyrepo separation, type contract source of truth, tech stack mapping, domain and team ownership, risk inventory).
36
+ - **Enterprise Frontend Adaptation Protocol (EFDP)** — Maps existing UI organization, design system, shared component location, and team processes. Includes a decision matrix for realistic enterprise scenarios (Tailwind, shadcn/ui, MUI, Panda CSS, packages/ui).
37
+ - **Architecture Discovery Protocol (ADP)** — Analyzes entry points, domain logic, and API contracts.
38
+
39
+ ### 3.2 Management and Control
40
+ - **@manager as Single Entry Point** — In enterprise projects, no user request or agent invocation goes directly to a specialist agent. @manager intercepts every turn, assesses risks, and distributes formal briefings.
41
+ - **High-Risk Administrative Operations** — Operations involving user/permission management, bulk deletes, system config changes, audit log exports, or payment integrations are blocked without @manager approval + the formal `managerApproval` object.
42
+ - **Manager Authority Audit & Enforcement** — A formal checklist and procedure for @manager to audit its own authority and correct specialist agent bypass attempts.
43
+
44
+ ### 3.3 Intelligence and Analysis (MCP Tools)
45
+ - Codebase semantic search (`search_codebase`)
46
+ - Deep dependency analysis and dependency graph generation
47
+ - Contract integrity validation (`verify_api_contract`, `verify_contract_integrity`)
48
+ - Database schema analysis and Mermaid ER diagram generation
49
+ - AST-based security scanning (detecting hardcoded secrets, raw SQL, and unsafe patterns)
50
+ - Blueprint-driven construction for reusing high-quality architectural patterns
51
+ - Repository health check and semantic git commit generation
52
+
53
+ ### 3.4 Inter-Agent Coordination
54
+ - **Hermes Messaging Protocol** — Formal messaging structure (timestamp, from/to, category, priority, traceId, content, status).
55
+ - 4 messaging categories: ACTION, DELEGATION, INFO, ALERT.
56
+ - Message lifecycle: Dispatch → Notification → Acknowledgment.
57
+
58
+ ### 3.5 Security, Risk, and Audit
59
+ - Mandated Trace ID + audit log entry for every critical operation.
60
+ - Automated memory and log updates via `log_agent_action` and `update_project_memory` tools.
61
+ - Constitution compliance analysis.
62
+ - Mandatory rollback plans for all high-risk administration actions.
63
+
64
+ ### 3.6 Memory and Continuity
65
+ - `PROJECT_MEMORY.md` — Single Source of Truth (SSOT) structured with CURRENT STATUS, CRITICAL DECISIONS, ACTIVE TASKS, and HISTORY.
66
+ - File lock mechanism to prevent race conditions during memory updates.
67
+ - Mandatory, audited memory updates at the end of every user session.
68
+
69
+ ---
70
+
71
+ ## 4. Mandatory Protocols (Enterprise Standards)
72
+
73
+ The following protocols are **non-negotiable** in enterprise-scale codebases:
74
+
75
+ 1. Enterprise Project Discovery Protocol (EPDP)
76
+ 2. Enterprise Frontend Adaptation Protocol (EFDP)
77
+ 3. Manager Authority Audit & Enforcement
78
+ 4. High-Risk Administrative Action Briefing + `managerApproval` generation
79
+ 5. Hermes Protocol (for all inter-agent delegations and communications)
80
+ 6. Zero Mock + Contract-First + Branded Types
81
+ 7. Framework vs User Project Boundary (agents only modify the user's project, never framework files under `.enderun/` or `framework-mcp/`)
82
+
83
+ ---
84
+
85
+ ## 5. Agent Maturity Levels (May 24, 2026)
86
+
87
+ | Agent | Current | Target | Priority | Status Note |
88
+ |------------|--------|--------|-----------|-----------------------------------------|
89
+ | @manager | 8.0 | 9.5 | High | Authority Audit system is active |
90
+ | @backend | 7.5 | 9.0 | High | Testing culture and resilience patterns are being hardened |
91
+ | @frontend | 6.5 | 9.0 | Critical | 8-week Professionalization Program is active |
92
+ | @analyst | 6.5 | 8.5 | Medium | Governance audit capabilities are being improved |
93
+ | @explorer | 6.5 | 8.5 | Medium | Risk area reporting is mandatory |
94
+ | @git | 6.0 | 8.0 | Medium | High-risk commit controls added |
95
+ | @mobile | 2.0 | 8.0 | Low | Dormant (basic SOP in place) |
96
+ | @native | 2.0 | 8.0 | Low | Dormant (basic SOP in place) |
97
+
98
+ ---
99
+
100
+ ## 6. Known Limits and Risks (Honest Assessment)
101
+
102
+ - **Lack of Reference App** — A full round-trip has not yet been demonstrated in an active production-grade reference app (highest risk).
103
+ - **Hermes Live Test Gap** — The protocol is defined on paper, but the 4 mandatory live scenarios have not been run between autonomous agents in production.
104
+ - **Academy Performance Data** — Success rate, velocity, and quality metrics are currently simulated.
105
+ - **Frontend Professionalization** | Practical experience is limited in complex legacy environments with mixed styling solutions.
106
+ - **Long-Term Production Usage** — The system has not yet been proven in corporate codebases over months of active human-AI co-development.
107
+
108
+ ---
109
+
110
+ ## 7. Recommended Use-Cases in Large Projects
111
+
112
+ ### Documentation Ownership (Mandatory Rule)
113
+ - Framework rules (e.g., "all notifications must use Toaster") → `.enderun/knowledge/`
114
+ - User project documentation (implementation specs, modal details, project styling conventions) → **User project's own `docs/` folder**.
115
+ - Agents must write project documentation into the user's `docs/` folder. Writing to `.enderun/` is forbidden.
116
+ - Reference rule: `.enderun/knowledge/documentation_ownership.md`
117
+
118
+ ### Monorepo & Multi-Team Environments
119
+ - @manager remains the single point of entry.
120
+ - Domain-based delegation is enforced.
121
+ - Separate Trace IDs and briefings are mandatory for each distinct domain.
122
+
123
+ ### Legacy & Mixed Tech Stack Projects
124
+ - EPDP and EFDP **must** be executed as the very first step.
125
+ - The existing design system (Tailwind, MUI, etc.) is accepted. Proposing a new styling solution is allowed only with written @manager approval.
126
+
127
+ ### Highly Regulated Environments (KVKK, GDPR, PCI, SOC2)
128
+ - All high-risk administrative operations are restricted to @manager + human developer dual-approvals.
129
+ - Audit logs are centralized, immutable, and exportable.
130
+
131
+ ---
132
+
133
+ ## 8. Related Documents (Mandatory Reading)
134
+
135
+ - `.enderun/ENDERUN.md` — The Constitution
136
+ - `.enderun/PROJECT_MEMORY.md` — Project Memory (SSOT)
137
+ - `.enderun/knowledge/enterprise_project_adaptation.md`
138
+ - `.enderun/knowledge/enterprise_frontend_adaptation.md`
139
+ - `.enderun/knowledge/documentation_ownership.md` (Framework rules vs. user project docs boundary)
140
+ - `.enderun/knowledge/manager_authority_audit_enforcement.md`
141
+ - `.enderun/knowledge/hermes_protocol.md`
142
+ - `docs/action-plan-2026.md`
143
+ - `docs/roadmap.md`
144
+
145
+ ---
146
+
147
+ *Note: This document reflects the realistically proven and enforceable capabilities of Agent Enderun as of May 2026, rather than its theoretical potentials. It will be updated as new milestones (reference app completion, Hermes live tests, long-term corporate usage) are successfully hit.*
148
+
149
+ Last Updated: May 24, 2026 — @manager
@@ -0,0 +1,232 @@
1
+ # Enterprise Frontend Adaptation Framework
2
+
3
+ **Version:** 1.0
4
+ **Owner:** @manager
5
+ **Created:** May 24, 2026
6
+ **Purpose:** Elevate the @frontend agent to professional-grade maturity (9.0+) in large, complex, and legacy corporate projects. This document translates the "shape yourself to the user's project" (D004) principle into concrete, enforceable frontend rules.
7
+
8
+ ---
9
+
10
+ ## 1. Core Philosophy (Non-Negotiable Rules)
11
+
12
+ The single greatest mistake in enterprise frontend development is imposing "our way" of doing things on an established system.
13
+
14
+ **Supreme Rule for @frontend:**
15
+
16
+ > **"Shape yourself to the user's existing project. Work within the established structure, maintain the existing quality thresholds, and respect the conventions of the active development teams."**
17
+
18
+ This means:
19
+ - If a project already uses Tailwind CSS + shadcn/ui, **do not** try to force the "Zero UI Library" rule.
20
+ - If a project uses a feature-sliced or domain-driven folder layout, **do not** suddenly dictate placing all components in a flat `ui/` directory.
21
+ - If a project is a massive monorepo and `packages/ui` already exists, **do not** blindly apply the "no shared package creation" rule; adapt to their setup with @manager oversight.
22
+ - If the codebase is legacy, **do not** force a complete rewrite into modern compound component patterns.
23
+
24
+ **The Primary Mission of @frontend:** Accept the reality of the existing system and build the **most professional, accessible, and performant** solutions possible within that specific context.
25
+
26
+ ---
27
+
28
+ ## 2. Enterprise Frontend Discovery Protocol (EFDP)
29
+
30
+ When entering a new or unknown large corporate project, @frontend **must never** start writing code immediately. It must first execute the following discovery protocol.
31
+
32
+ ### 2.1 Architectural Discovery (Mandatory)
33
+
34
+ - **Identify the existing UI organization pattern:**
35
+ - Feature-based (e.g., `/features/users`, `/features/orders`)
36
+ - Technical layer (e.g., `/components`, `/pages`, `/hooks`)
37
+ - Domain-driven
38
+ - Hybrid
39
+ - **Locate where shared components reside:**
40
+ - `src/components/ui/`
41
+ - `packages/ui/`
42
+ - `libs/design-system/`
43
+ - Elsewhere?
44
+ - **Detect design tokens and the styling system in use:**
45
+ - Panda CSS
46
+ - Tailwind CSS + custom configuration
47
+ - SCSS + design tokens
48
+ - CSS-in-JS (Emotion, styled-components)
49
+ - Other?
50
+ - **Determine component library status:**
51
+ - No library (fully custom)
52
+ - Project-internal custom component sets
53
+ - Popular library usage (MUI, Ant Design, shadcn/ui, Chakra UI, etc.)
54
+ - In-house corporate design system
55
+
56
+ ### 2.2 Team and Process Discovery
57
+
58
+ - Who actively maintains this frontend codebase? (Single team vs. multiple distinct teams?)
59
+ - How are design system changes managed? (Is there an RFC process? How are reviews handled?)
60
+ - Are there established accessibility and performance standards? (Is there a checklist or active performance budget?)
61
+ - What is the testing culture? (Cypress, Playwright, Vitest + React Testing Library, or no tests?)
62
+
63
+ ### 2.3 Risks and Constraints Discovery
64
+
65
+ - Which pages are performance-critical? (Dashboards, reporting panels, admin consoles?)
66
+ - Where is PII and sensitive data displayed?
67
+ - Is mobile responsiveness or native shell support (e.g., PWA, React Native shell) mandatory?
68
+ - What are the legacy browser support requirements? (Old Safari, legacy corporate browsers, etc.)
69
+
70
+ ---
71
+
72
+ ## 3. Design System & Component Library Decision Matrix
73
+
74
+ This matrix governs one of the most critical integration decisions in enterprise work:
75
+
76
+ | Existing System | Mandatory @frontend Behavior | @manager Approval Required? |
77
+ |-----------------|-----------------------------|-----------------------------|
78
+ | No design system | Scaffolds the 8-10 core components (Button, Input, Modal, Table, Card, etc.) using Panda or the existing styling engine | No (Initial bootstrap) |
79
+ | Project-internal `components/ui` exists | **Reuse** existing components, write new components in the same directories using identical patterns | No |
80
+ | `packages/ui` or `libs/design-system` exists | Accept this package as the **primary source of truth**. Propose additions to this package only with @manager approval | Yes (Written approval) |
81
+ | Popular library in use (MUI, AntD, shadcn) | Do not suggest "re-writing it". **Accept** the library and write thin, accessible wrappers on top | Yes (Major architectural decision) |
82
+ | Tailwind + shadcn/ui combination | Flexible Zero UI Policy. Work smoothly within the established Tailwind/shadcn ecosystem | Yes (Written approval) |
83
+
84
+ **Golden Rule:** Never adopt a "this project was designed incorrectly, we must fix it" attitude. Focus on adding value to the existing investment.
85
+
86
+ ---
87
+
88
+ ## 4. Incremental Adoption in Legacy & Large Codebases
89
+
90
+ Most enterprise codebases contain legacy modules. @frontend must follow these rules strictly:
91
+
92
+ ### 4.1 Incremental Migration Rules
93
+
94
+ - **Never** propose "rewriting the entire UI".
95
+ - When writing a new feature or page:
96
+ - Reuse existing components where possible.
97
+ - If a new component is mandatory, position it as the **new standard** (designed to slowly phase out legacy ones).
98
+ - If a massive page is being redesigned, modernize it **piece by piece** (Strangler Fig Pattern).
99
+ - Never independently undertake dropping legacy components. This requires an explicit @manager briefing + a migration plan.
100
+
101
+ ### 4.2 "Modern Islands" Strategy
102
+
103
+ Every high-quality, accessible component or hook you write serves as a "modern island" in that project. Over time, other developers adopt these patterns. This is the most effective and lowest-risk modernization strategy.
104
+
105
+ ---
106
+
107
+ ## 5. Data-Heavy Enterprise UI Standards
108
+
109
+ The most complex areas in enterprise apps are dashboards, admin panels, complex forms, and massive data tables.
110
+
111
+ ### Mandatory Standards
112
+
113
+ - **Tables:** Always evaluate virtualization (TanStack Table + react-window or similar). Virtualization is mandatory if displaying 50+ rows.
114
+ - **Forms:** For complex forms (10+ fields), a form state management library (react-hook-form + zod is recommended) must be used. Manual state management is forbidden.
115
+ - **Dashboards:**
116
+ - Progressive loading, streaming, or Suspense is mandatory for heavy data-fetching panels.
117
+ - Each widget must independently manage its loading and error states.
118
+ - **Admin Panels:** High-risk actions must integrate a confirmation modal and @manager approval workflows (as defined in agent protocols).
119
+
120
+ ---
121
+
122
+ ## 6. Performance and Accessibility in the Enterprise Context
123
+
124
+ ### Performance
125
+
126
+ - Bundle size analysis must be executed for every major new feature.
127
+ - Code splitting (route-level + component-level dynamic imports) is mandatory in large-scale apps.
128
+ - Image optimization and proper font loading must be evaluated in every project.
129
+ - Core Web Vitals targets (LCP < 2.5s, INP < 200ms, CLS < 0.1) serve as the benchmark; projects set realistic budgets.
130
+
131
+ ### Accessibility (WCAG 2.2 AA)
132
+
133
+ - Keyboard navigation and focus trap management are heavily checked in complex UI layers (modals, slide-out drawers, custom dropdowns).
134
+ - ARIA usage is verified for correctness, not just presence (no ARIA is better than bad ARIA).
135
+ - Color contrast ratios and touch target minimums (44x44px) are non-negotiable.
136
+
137
+ ---
138
+
139
+ ## 7. Testing in Large Corporate Projects
140
+
141
+ Testing discipline is critical because the ripple effect of changes in large projects is vast.
142
+
143
+ **Mandatory Rules:**
144
+ - Component tests must be written for every newly introduced shared component.
145
+ - Integration tests must be written for critical admin and financial checkout flows.
146
+ - Visual regression testing (e.g., Chromatic, Percy) must be evaluated at the design system level if budget and processes exist.
147
+ - Automated gates must flag contract breaking changes immediately when frontend tests fail.
148
+
149
+ ---
150
+
151
+ ## 8. Enterprise RED LINES for @frontend
152
+
153
+ The following actions are **strictly forbidden**:
154
+
155
+ - Writing code in your own custom style while ignoring the project's existing design system or component library.
156
+ - Proposing or creating a new `packages/ui` or `libs/design-system` in a monorepo without explicit @manager approval.
157
+ - Initiating a massive migration in a legacy codebase to "modernize everything" without prior authorization.
158
+ - Criticizing or dismissing a working, established UI library (MUI, AntD, etc.) as "bad" or "legacy".
159
+ - Exposing high-risk admin actions on the UI without hooking them to @manager briefings and approval checks.
160
+
161
+ ### 8.1 User Notification & Feedback Standards (Mandatory Toaster)
162
+
163
+ User feedback must be **centralized and consistent** in enterprise environments.
164
+
165
+ **Mandatory Rule:**
166
+ - All user notifications (success, error, warning, info), confirmation dialogues, high-risk warnings, and `managerApproval` status feedback **must** be routed exclusively through the Toaster.
167
+ - Using `window.alert()`, `window.confirm()`, or custom non-toaster alert components is **strictly forbidden**.
168
+ - In high-risk workflows, inform users with clear, accessible, and consistent toaster messages.
169
+ - The toaster implementation must comply with accessibility guidelines (correct ARIA live regions, keyboard support).
170
+
171
+ ---
172
+
173
+ ## 9. Documentation Ownership: Framework vs. User Project
174
+
175
+ Documentation ownership must remain absolutely clear in large projects:
176
+
177
+ ### Framework Documentation (Agent Enderun)
178
+ - Location: `.enderun/knowledge/`
179
+ - Content: **Mandatory rules**, patterns, and governance standards that all agents must follow across any project.
180
+ - Examples:
181
+ - Notification Toaster requirement
182
+ - Zero UI Library policy definitions
183
+ - `managerApproval` workflow guidelines
184
+ - Enterprise Frontend Adaptation rules
185
+
186
+ ### User Project Documentation
187
+
188
+ The user's application must maintain its own technical decisions, folder conventions, and style rules **within its own folder structure**.
189
+
190
+ **Mandatory Rule:**
191
+ - @frontend (and all other agents) must write all documents generated for the user's project (architecture decisions, toaster setup, modal details, component patterns, etc.) **directly into the user project's own `docs/` folder**.
192
+ - These documents are **never** written inside `.enderun/` (neither `.enderun/docs/` nor `.enderun/knowledge/`).
193
+
194
+ **Recommended Locations (Inside the User Project):**
195
+ - General architecture decisions and ADRs → `docs/` (project root)
196
+ - Frontend-specific guidelines and patterns → `docs/frontend/` or `apps/web/docs/`
197
+ - Backend-specific standards → `docs/backend/`
198
+ - Project toaster integration details and confirmation modal specs → `docs/frontend/notifications.md` or `docs/architecture/approval-flows.md`
199
+
200
+ **Key Boundary Distinction:**
201
+ - **Framework Rules** (e.g., “All notifications must use the Toaster,” “High-risk actions require `managerApproval`”) → `.enderun/knowledge/`
202
+ - **User Project Implementation** (e.g., which toaster library is installed, how custom modals are built, approval flows layout) → User project's own `docs/` directory
203
+
204
+ **Agent Responsibility:**
205
+ @frontend must actively generate and maintain these project-specific docs within the user's `docs/` folder. A professional agent delivers not just code, but sustainable, well-documented systems.
206
+
207
+ ---
208
+
209
+ ## 10. Enforcement and Responsibility
210
+
211
+ - This framework will be integrated directly into `frontend.md` and enforced as **mandatory**.
212
+ - If @frontend fails to comply with these rules, the task is marked as "incomplete".
213
+ - @manager, @analyst, and @explorer actively audit compliance.
214
+ - For every major task, @frontend must submit the "Enterprise Adaptation Checklist".
215
+
216
+ ---
217
+
218
+ ## 11. Maturity Roadmap
219
+
220
+ Enforcing this framework systematically increases @frontend's corporate readiness score:
221
+ - Initial: 6.5/10
222
+ - Target (Post-integration & testing): 9.0/10
223
+
224
+ **Next Actions:**
225
+ 1. Integrate this framework directly into `.enderun/agents/frontend.md` as core instructions.
226
+ 2. Align `frontend_professionalization_guidelines.md` with these directives.
227
+ 3. Establish the Enterprise Frontend Adaptation Checklist.
228
+ 4. Log progress in the Risk Tracking Dashboard under "@frontend Weakness".
229
+
230
+ ---
231
+
232
+ **This framework is the cornerstone of @frontend's transition to a truly professional, enterprise-ready agent.**