agent-enderun 0.5.7 → 0.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.enderun/PROJECT_MEMORY.md +10 -97
- package/.enderun/agents/analyst.md +12 -6
- package/.enderun/agents/backend.md +47 -40
- package/.enderun/agents/explorer.md +15 -3
- package/.enderun/agents/frontend.md +42 -8
- package/.enderun/agents/git.md +2 -2
- package/.enderun/agents/manager.md +3 -3
- package/.enderun/agents/mobile.md +2 -2
- package/.enderun/agents/native.md +2 -2
- package/.enderun/blueprints/backend/errors/domain-error.ts +84 -0
- package/.enderun/blueprints/backend/middleware/error-handler.ts +24 -0
- package/.enderun/blueprints/frontend/ui/Button.tsx +60 -0
- package/.enderun/blueprints/frontend/ui/Input.tsx +43 -0
- package/.enderun/logs/manager.json +1 -0
- package/ENDERUN.md +25 -2
- package/README.md +9 -4
- package/bin/update-contract.js +3 -0
- package/claude.md +3 -3
- package/codex.md +3 -3
- package/cursor.md +3 -3
- package/gemini-extension.json +4 -2
- package/package.json +9 -7
- package/packages/framework-mcp/dist/index.js +0 -0
- package/packages/framework-mcp/dist/tools/contract.js +12 -6
- package/packages/framework-mcp/dist/tools/framework.js +2 -1
- package/packages/framework-mcp/dist/tools/knowledge.js +1 -1
- package/packages/framework-mcp/dist/utils.js +1 -1
- package/packages/framework-mcp/package.json +4 -1
- package/packages/framework-mcp/src/tools/contract.ts +18 -5
- package/packages/framework-mcp/src/tools/framework.ts +3 -2
- package/packages/framework-mcp/src/tools/knowledge.ts +6 -6
- package/packages/framework-mcp/src/utils.ts +1 -1
- package/packages/shared-types/dist/api.d.ts +18 -0
- package/packages/shared-types/dist/api.js +2 -0
- package/packages/shared-types/dist/api.js.map +1 -0
- package/packages/shared-types/dist/brands.d.ts +13 -0
- package/packages/shared-types/dist/brands.js +2 -0
- package/packages/shared-types/dist/brands.js.map +1 -0
- package/packages/shared-types/dist/constants.d.ts +27 -0
- package/packages/shared-types/dist/constants.js +22 -0
- package/packages/shared-types/dist/constants.js.map +1 -0
- package/packages/shared-types/dist/index.d.ts +7 -88
- package/packages/shared-types/dist/index.js +7 -3
- package/packages/shared-types/dist/index.js.map +1 -1
- package/packages/shared-types/dist/logs.d.ts +15 -0
- package/packages/shared-types/dist/logs.js +2 -0
- package/packages/shared-types/dist/logs.js.map +1 -0
- package/packages/shared-types/dist/models.d.ts +60 -0
- package/packages/shared-types/dist/models.js +2 -0
- package/packages/shared-types/dist/models.js.map +1 -0
- package/packages/shared-types/package.json +6 -3
- package/packages/shared-types/src/api.ts +20 -0
- package/packages/shared-types/src/brands.ts +12 -0
- package/packages/shared-types/src/constants.ts +34 -0
- package/packages/shared-types/src/index.ts +7 -97
- package/packages/shared-types/src/logs.ts +16 -0
- package/packages/shared-types/src/models.ts +66 -0
- package/panda.config.ts +79 -5
|
@@ -6,19 +6,19 @@ This file is the Single Source of Truth (SSOT) and the persistent memory of the
|
|
|
6
6
|
|
|
7
7
|
| Active Phase | Profile | Last Update | Active Trace ID | Blockers |
|
|
8
8
|
| :----------- | :------ | :---------- | :-------------- | :------- |
|
|
9
|
-
| PHASE_0 | Lightweight | 2026-05-
|
|
9
|
+
| PHASE_0 | Lightweight | 2026-05-20 | 01KR6EJA6GG3RPS849097KS37Q | NONE |
|
|
10
10
|
|
|
11
11
|
## PROJECT DEFINITION
|
|
12
12
|
|
|
13
|
-
- **Name:**
|
|
14
|
-
- **Version:**
|
|
13
|
+
- **Name:** KENTİM
|
|
14
|
+
- **Version:** v1.0.0
|
|
15
15
|
| Field | Value |
|
|
16
16
|
| :--- | :--- |
|
|
17
|
-
| Project Name |
|
|
18
|
-
| Platform |
|
|
17
|
+
| Project Name | kentim |
|
|
18
|
+
| Platform | Multi-Tenant SaaS |
|
|
19
19
|
| Frontend | React 19 + Vite + Panda CSS |
|
|
20
20
|
| Backend | Node.js 20+ + Fastify |
|
|
21
|
-
| DB | PostgreSQL |
|
|
21
|
+
| DB | PostgreSQL + PostGIS + RLS |
|
|
22
22
|
|
|
23
23
|
## DOD STATUS
|
|
24
24
|
|
|
@@ -34,8 +34,7 @@ This file is the Single Source of Truth (SSOT) and the persistent memory of the
|
|
|
34
34
|
|
|
35
35
|
| Date | Decision | Rationale | Agent |
|
|
36
36
|
| :--- | :--- | :--- | :--- |
|
|
37
|
-
| 2026-05-
|
|
38
|
-
| 2026-05-09 | Project Initialized | Framework setup via CLI | @manager |
|
|
37
|
+
| 2026-05-20 | Project Initialized | Fresh setup for KENTİM project | @manager |
|
|
39
38
|
|
|
40
39
|
## DELIVERABLES
|
|
41
40
|
|
|
@@ -46,98 +45,12 @@ This file is the Single Source of Truth (SSOT) and the persistent memory of the
|
|
|
46
45
|
|
|
47
46
|
| Trace ID | Task | Agent | Priority | Status |
|
|
48
47
|
| :--- | :--- | :--- | :--- | :--- |
|
|
49
|
-
|
|
|
50
|
-
| 01KRC3WPMGXW2G3A4B0FVABKX0 | Modular Refactoring and Documentation Overhaul | @analyst | P0 | COMPLETE |
|
|
51
|
-
| 01KR6EJA6GG3RPS849097KS37Q | Framework setup and architecture alignment | @manager | P1 | IN_PROGRESS |
|
|
48
|
+
| 01KR6EJA6GG3RPS849097KS37Q | Framework reset and KENTİM project initialization | @manager | P1 | IN_PROGRESS |
|
|
52
49
|
|
|
53
50
|
## HISTORY (Persistent Memory)
|
|
54
51
|
|
|
55
|
-
### 2026-05-
|
|
52
|
+
### 2026-05-20 — Project Reset & KENTİM Initialization
|
|
56
53
|
|
|
57
54
|
- **Agent:** @manager
|
|
58
55
|
- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
59
|
-
- **Action:**
|
|
60
|
-
|
|
61
|
-
### 2026-05-16 — Zero-Config & Auto-Wiring Milestone (v0.5.2)
|
|
62
|
-
|
|
63
|
-
- **Agent:** @manager
|
|
64
|
-
- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
65
|
-
- **Action:** Bumped version to v0.5.2. Achieved full automation for framework onboarding. Implemented Auto-Wiring for Gemini (auto-patching `gemini-extension.json`), automated MCP build during `init`, and refined directory logic for user-facing documentation. This release marks the transition to a truly "plug-and-play" enterprise framework.
|
|
66
|
-
|
|
67
|
-
### 2026-05-16 — Dizin Yapısı Düzenlemesi (Düzeltildi)
|
|
68
|
-
|
|
69
|
-
- **Agent:** @manager
|
|
70
|
-
- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
71
|
-
- **Action:** Root `docs/` was incorrectly deleted (confused with `.enderun/docs/`). Restored with `docs/README.md` explaining its purpose: agent-written project documentation during PHASE_2. Added `docs/` to `package.json` files array and `cli.js` DIRS_TO_CREATE. Distinction clarified: `/docs` = user project docs (agent-generated), `/.enderun/docs/` = framework config (tech-stack, security, privacy). Updated `STATUS.md` to mark `@mobile`/`@native` as INACTIVE (Full Profile only).
|
|
72
|
-
|
|
73
|
-
### 2026-05-16 — Proje Gözlem & Durum İncelemesi (Düzeltildi)
|
|
74
|
-
|
|
75
|
-
- **Agent:** @manager
|
|
76
|
-
- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
77
|
-
- **Action:** Full project review conducted. PHASE_0 in progress. Confirmed design intent: (1) `apps/` is intentionally empty — this is a framework package, not an app project; (2) `{{ADAPTER}}`/`{{FRAMEWORK_DIR}}` in ENDERUN.md are template variables resolved by `init` command at install time (gemini→.gemini, claude→.claude, cursor→.cursor, codex→.enderun). Fixed `codex.md` source file inconsistency where `{{FRAMEWORK_DIR}}` was not hardcoded like other adapters.
|
|
78
|
-
|
|
79
|
-
### 2026-05-15 — The Academy Upgrade & v0.5.1 Release
|
|
80
|
-
|
|
81
|
-
- **Agent:** @manager
|
|
82
|
-
- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
83
|
-
- **Action:** Major framework upgrade (v0.5.1). Implemented Hermes Messaging Protocol and Obsidian-style LLM Wiki with YAML metadata. Consolidated constitution into root `ENDERUN.md` and removed legacy `jest.config.js`. Enhanced MCP server with new intelligence tools for knowledge graphs and system health.
|
|
84
|
-
|
|
85
|
-
### 2026-05-15 — Hermes + Obsidian + LLM Wiki & Discovery
|
|
86
|
-
|
|
87
|
-
- **Agent:** @manager
|
|
88
|
-
- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
89
|
-
- **Action:** Major upgrade to framework intelligence. Implemented Hermes Messaging Protocol for inter-agent orchestration and Obsidian-style structured Wiki for knowledge management. Unified versioning across all packages to v0.5.0.
|
|
90
|
-
|
|
91
|
-
### 2026-05-12 — The Installation Fix & v0.4.5 Release
|
|
92
|
-
+
|
|
93
|
-
+- **Agent:** @manager
|
|
94
|
-
+- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
95
|
-
+- **Action:** Bumped version to v0.4.5. Fixed a critical issue where adapter files (gemini.md, cursor.md, claude.md, codex.md) were excluded from the npm package. Verified the fix via local and npx-simulated tests. Cleaned up logs and temporary test files.
|
|
96
|
-
+
|
|
97
|
-
+### 2026-05-12 — The Unified Milestone & v0.4.4 Release
|
|
98
|
-
|
|
99
|
-
- **Agent:** @manager
|
|
100
|
-
- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
101
|
-
- **Action:** Full framework synchronization to v0.4.4. Unified versioning across all core packages, specialist agents, and the supreme law. Consolidated history for a clean production debut.
|
|
102
|
-
|
|
103
|
-
### 2026-05-12 — Pure Start & v0.4.1 Release
|
|
104
|
-
|
|
105
|
-
- **Agent:** @manager
|
|
106
|
-
- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
107
|
-
- **Action:** Reset git history for a clean production start. Bumped version to v0.4.1. This release represents the stable, production-ready "Autonomous Agent Academy" architecture.
|
|
108
|
-
|
|
109
|
-
### 2026-05-12 — The Evolution Milestone & v0.4.0 Release
|
|
110
|
-
|
|
111
|
-
- **Agent:** @manager
|
|
112
|
-
- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
113
|
-
- **Action:** Major version bump to v0.4.0. Completed the transition from basic governance to an "Autonomous Agent Academy" architecture. Key features: AST-based compliance auditing, Autonomous Conflict Resolution Protocol, and Senior-level Resilience patterns. Unified the adapter entry points for all AI assistants. Verified zero-drift between code and constitution.
|
|
114
|
-
|
|
115
|
-
### 2026-05-12 — Capability Leap & v0.3.5 Release
|
|
116
|
-
|
|
117
|
-
- **Agent:** @manager
|
|
118
|
-
- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
119
|
-
- **Action:** Upgraded framework to v0.3.5. Implemented AST-based compliance auditing, Autonomous Conflict Resolution, and Senior Resilience patterns. Unified inter-agent communication and mandated shared UI component protocols. Verified monorepo version synchronization.
|
|
120
|
-
|
|
121
|
-
### 2026-05-12 — Critical Fix & v0.3.4 Release
|
|
122
|
-
|
|
123
|
-
- **Agent:** @manager
|
|
124
|
-
- **Trace ID:** 01KRES6JRXE82FZPWVR1SSMB4W
|
|
125
|
-
- **Action:** Fixed a critical bug in the `init` command that caused the deletion of `packages/shared-types` and `.enderun` user data during updates. Enhanced metadata across all monorepo packages by explicitly defining README paths and synchronizing repository/homepage links to fix NPM registry display issues. Bumped version to v0.3.4 across all packages and verified build integrity.
|
|
126
|
-
|
|
127
|
-
### 2026-05-11 — Modular Architecture & Documentation Overhaul
|
|
128
|
-
|
|
129
|
-
- **Agent:** @analyst
|
|
130
|
-
- **Trace ID:** 01KRC3WPMGXW2G3A4B0FVABKX0
|
|
131
|
-
- **Action:** Refactored the monolithic MCP server (2100+ lines) into a modular structure with dedicated tool categories (codebase, framework, security, memory, contract, academy, messages, git, database, knowledge, repository). Updated root and package READMEs to provide enterprise-grade documentation. Verified build integrity and contract synchronization. Prepared codebase for npm publication.
|
|
132
|
-
|
|
133
|
-
### 2026-05-11 — Adapter-Specific Onboarding Enabled
|
|
134
|
-
|
|
135
|
-
- **Agent:** @manager
|
|
136
|
-
- **Trace ID:** 01KRC3WPMGXW2G3A4B0FVABKX0
|
|
137
|
-
- **Action:** Refined 'init' command to support specialized setups for Gemini, Claude, Cursor, and Codex. Added automatic .cursorrules sync for Cursor and MCP instructions for Claude Code. Ensured cross-host compatibility via universal symlinks.
|
|
138
|
-
|
|
139
|
-
### 2026-05-09 — Framework Initialization
|
|
140
|
-
|
|
141
|
-
- **Agent:** @manager
|
|
142
|
-
- **Trace ID:** 01KR6EJA6GG3RPS849097KS37Q
|
|
143
|
-
- **Action:** Initialized Agent Enderun framework and project structure.
|
|
56
|
+
- **Action:** Reset all logs and memory history to initiate a completely fresh project cycle for the KENTİM platform.
|
|
@@ -3,7 +3,7 @@ name: analyst
|
|
|
3
3
|
description: "Project memory, QA gate, and documentation specialist. Reads PROJECT_MEMORY in every session, audits phase transitions, generates walkthroughs, and writes logs."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Project Analyst & QA Gate — v0.5.
|
|
6
|
+
# Project Analyst & QA Gate — v0.5.9 Master
|
|
7
7
|
|
|
8
8
|
**Role:** Maintain project memory, serve as a quality gate, and manage documentation. The following protocols are automatically applied in every task.
|
|
9
9
|
|
|
@@ -90,14 +90,20 @@ In every phase transition and upon request:
|
|
|
90
90
|
Before approving any task completion, @analyst must verify that the agent followed existing code patterns.
|
|
91
91
|
1. Identify a "Gold Standard" reference file for the current task's domain.
|
|
92
92
|
2. Use the `analyze_procedural_continuity` tool to compare the agent's changes with the reference.
|
|
93
|
-
3. **
|
|
93
|
+
3. **Architecture & Contract Audit:**
|
|
94
|
+
- **Modular Types:** Verify that `@backend` and `@frontend` use modular imports from `shared-types` if the project size warrants it.
|
|
95
|
+
- **Domain Errors:** Ensure `@backend` uses the standardized `DomainError` hierarchy from the project's error directory. Reject any local re-definitions of error classes.
|
|
96
|
+
- **API Sync:** Confirm that `contract.version.json` was updated if `shared-types` changed.
|
|
97
|
+
4. **Surgical Audit:** Check if the agent modified unrelated parts of the file. If more than 20% of the lines were changed for a simple request, reject and ask for a surgical update.
|
|
94
98
|
- **Responsive Audit:**
|
|
95
99
|
- Verify usage of Panda CSS responsive tokens (`base`, `md`, `lg`).
|
|
96
100
|
- Ensure `fontSize` and `gap` use fluid values (e.g., `clamp()`) where appropriate.
|
|
97
101
|
- Reject if a fixed pixel width (e.g., `width: "1200px"`) is used instead of responsive containers or `maxW`.
|
|
98
|
-
- **
|
|
99
|
-
-
|
|
100
|
-
-
|
|
102
|
+
- **Backend Architecture Audit:**
|
|
103
|
+
- **Audit Logs:** Verify that every mutation (CREATE/UPDATE/DELETE) has a corresponding audit log implementation linked to a Trace ID. Reject any mutation logic missing an audit trail.
|
|
104
|
+
- **Code Reuse:** Check for redundant CRUD logic. Mandate the use of Base Repository/Service patterns.
|
|
105
|
+
- **BaseEntity:** Ensure all new entities include `id`, `createdAt`, and `updatedAt` fields.
|
|
106
|
+
- **Typed Config:** Reject direct `process.env` usage in services or repositories.
|
|
101
107
|
5. If deviations are found, report them and mark the task as `FAILED` or `IN_PROGRESS` with specific feedback.
|
|
102
108
|
|
|
103
109
|
|
|
@@ -199,7 +205,7 @@ Use the `log_agent_action` tool to record your activities securely.
|
|
|
199
205
|
|
|
200
206
|
---
|
|
201
207
|
|
|
202
|
-
**Agent Completion Report** (v0.5.
|
|
208
|
+
**Agent Completion Report** (v0.5.8)
|
|
203
209
|
|
|
204
210
|
- Mock used? [ ] No / [ ] Yes
|
|
205
211
|
- shared-types changed? [ ] No / [ ] Yes
|
|
@@ -3,7 +3,7 @@ name: backend
|
|
|
3
3
|
description: "Backend Architect. Expert in Node.js, Fastify, Kysely, and PostgreSQL. Leader of Contract and Database. Automatically applies backend-architecture standards in every task."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Backend Architect — v0.5.
|
|
6
|
+
# Backend Architect — v0.5.9 Master
|
|
7
7
|
|
|
8
8
|
**Role:** Build a secure, high-performance, and consistent server architecture. All the following standards are automatically applied in every task — no need for the user to specify them separately.
|
|
9
9
|
|
|
@@ -67,45 +67,48 @@ Route (Fastify)
|
|
|
67
67
|
|
|
68
68
|
---
|
|
69
69
|
|
|
70
|
-
##
|
|
70
|
+
## 🏗️ Base Architecture & Code Reuse (Standard)
|
|
71
71
|
|
|
72
|
+
To eliminate code repetition, all backend development MUST follow the **Base Pattern**. Agents are not allowed to write redundant CRUD logic.
|
|
73
|
+
|
|
74
|
+
**Standard Patterns:**
|
|
75
|
+
1. **Base Repository:** Use a centralized repository logic for common Kysely operations (findById, findMany, create, update, softDelete).
|
|
76
|
+
2. **Base Service:** Orchestrate business logic using reusable services.
|
|
77
|
+
3. **Typed Config:** Always access environment variables through a centralized, typed configuration object or service. Never use `process.env` directly in domain logic.
|
|
78
|
+
|
|
79
|
+
**Mandatory Shared Fields:**
|
|
80
|
+
All entities must implement the `BaseEntity` interface from `@agent-enderun/shared-types`, including `id`, `createdAt`, and `updatedAt`.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 🕵️ Automatic Audit Logging (Mandatory)
|
|
85
|
+
|
|
86
|
+
Every "mutation" (CREATE, UPDATE, DELETE) MUST trigger an audit log entry.
|
|
87
|
+
- **Traceability:** Link every audit log to the active **Trace ID**.
|
|
88
|
+
- **State Capture:** For updates, capture both `previousState` and `newState`.
|
|
89
|
+
- **User Context:** Identify the `UserID` performing the action.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Domain Error System (Standard)
|
|
94
|
+
|
|
95
|
+
All backend projects MUST use the standardized `DomainError` hierarchy. Do not define these classes locally.
|
|
96
|
+
Reference the "Gold Standard" blueprints in `{{FRAMEWORK_DIR}}/blueprints/backend/errors/domain-error.ts`.
|
|
97
|
+
|
|
98
|
+
**Mandatory Classes:**
|
|
99
|
+
- `NotFoundError` (404)
|
|
100
|
+
- `ValidationError` (400)
|
|
101
|
+
- `UnauthorizedError` (401)
|
|
102
|
+
- `ForbiddenError` (403)
|
|
103
|
+
- `ConflictError` (409)
|
|
104
|
+
- `InternalServerError` (500)
|
|
105
|
+
|
|
106
|
+
**Usage Pattern:**
|
|
72
107
|
```typescript
|
|
73
|
-
//
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
public readonly statusCode: number,
|
|
78
|
-
message: string,
|
|
79
|
-
) {
|
|
80
|
-
super(message);
|
|
81
|
-
this.name = "DomainError";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
class NotFoundError extends DomainError {
|
|
85
|
-
constructor(entity: string) {
|
|
86
|
-
super("NOT_FOUND", 404, entity + " not found.");
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
class ValidationError extends DomainError {
|
|
90
|
-
constructor(msg: string) {
|
|
91
|
-
super("VALIDATION_ERROR", 400, msg);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
class UnauthorizedError extends DomainError {
|
|
95
|
-
constructor() {
|
|
96
|
-
super("UNAUTHORIZED", 401, "Authentication required.");
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
class ForbiddenError extends DomainError {
|
|
100
|
-
constructor() {
|
|
101
|
-
super("FORBIDDEN", 403, "Access denied.");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
class ConflictError extends DomainError {
|
|
105
|
-
constructor(msg: string) {
|
|
106
|
-
super("CONFLICT", 409, msg);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
108
|
+
// Copy from blueprint to project's error directory if missing
|
|
109
|
+
import { NotFoundError } from "@/errors/domain-error";
|
|
110
|
+
|
|
111
|
+
if (!item) throw new NotFoundError("Item");
|
|
109
112
|
```
|
|
110
113
|
|
|
111
114
|
---
|
|
@@ -214,7 +217,7 @@ Frontend works by reading this file. If you don't write it, frontend will work b
|
|
|
214
217
|
## Contract Update Procedure
|
|
215
218
|
|
|
216
219
|
When `shared-types` or API documentation changes:
|
|
217
|
-
1. Update types in `packages/shared-types/src/`.
|
|
220
|
+
1. Update types in modular files under `packages/shared-types/src/`.
|
|
218
221
|
2. Update the contract hash using the `update_contract_hash` tool.
|
|
219
222
|
3. **MANDATORY NOTIFICATION:** Use the `send_agent_message` tool to inform `@frontend` (and other affected agents). Include the updated Trace ID and a brief summary of the changes.
|
|
220
223
|
4. Update `{{FRAMEWORK_DIR}}/docs/api/[domain].md` to reflect the new state.
|
|
@@ -242,7 +245,7 @@ When `shared-types` or API documentation changes:
|
|
|
242
245
|
|
|
243
246
|
---
|
|
244
247
|
|
|
245
|
-
**Agent Completion Report** (v0.5.
|
|
248
|
+
**Agent Completion Report** (v0.5.8)
|
|
246
249
|
- Mock used? [ ] No / [ ] Yes
|
|
247
250
|
- shared-types changed? [ ] No / [ ] Yes → contract.version updated
|
|
248
251
|
- **API contract written? [ ] No / [ ] Yes → {{FRAMEWORK_DIR}}/docs/api/[domain].md**
|
|
@@ -253,3 +256,7 @@ When `shared-types` or API documentation changes:
|
|
|
253
256
|
- Blockers: [write if any, otherwise "NONE"]
|
|
254
257
|
---
|
|
255
258
|
```
|
|
259
|
+
what needs to be done]
|
|
260
|
+
- Blockers: [write if any, otherwise "NONE"]
|
|
261
|
+
---
|
|
262
|
+
```
|
|
@@ -3,7 +3,7 @@ name: explorer
|
|
|
3
3
|
description: "Codebase Research & Dependency Specialist. Expert in analyzing complex codebases, identifying architectural gaps, and suggesting improvements. Automatically provides context in every research task."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Codebase Explorer — v0.5.
|
|
6
|
+
# Codebase Explorer — v0.5.9 Master
|
|
7
7
|
|
|
8
8
|
**Role:** Analyze the codebase, map architectures, and understand system-wide dependencies. Your primary duty is to provide context to other agents.
|
|
9
9
|
|
|
@@ -25,8 +25,20 @@ Never suggest a change without understanding the current state of the codebase.
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## 🔄 Legacy Conversion Algorithm (Standard)
|
|
29
|
+
|
|
30
|
+
When assigned to a legacy project, `@explorer` must guide the team through a gradual standardization process:
|
|
31
|
+
|
|
32
|
+
1. **Architecture Mapping:** Use `analyze_dependencies` to identify core modules and their coupling.
|
|
33
|
+
2. **Gap Analysis:** Run `get_project_gaps` and document structural deviations from `ENDERUN.md`.
|
|
34
|
+
3. **Bridge Building:** Propose creating a `shared-types` package if it doesn't exist, and start mapping existing DTOs to it.
|
|
35
|
+
4. **Refactor Blueprint:** Identify one "Hot Spot" module and provide a plan to wrap it in tests and refactor it using **Branded Types** and **Modular Architecture**.
|
|
36
|
+
5. **Audit Oversight:** Coordinate with `@analyst` to ensure new features in the legacy project follow the latest standards (Zero UI, Semantic Tokens, Domain Errors) from day one.
|
|
29
37
|
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 🔍 Research Standards
|
|
41
|
+
...
|
|
30
42
|
### 1. Codebase Search
|
|
31
43
|
|
|
32
44
|
- Use `search_codebase` (or legacy `codebase_search`) for specific patterns or logic.
|
|
@@ -90,7 +102,7 @@ Every research report must include:
|
|
|
90
102
|
|
|
91
103
|
---
|
|
92
104
|
|
|
93
|
-
**Agent Completion Report** (v0.5.
|
|
105
|
+
**Agent Completion Report** (v0.5.8)
|
|
94
106
|
|
|
95
107
|
- Mock used? [ ] No / [ ] Yes
|
|
96
108
|
- Codebase searched? [ ] No / [ ] Yes
|
|
@@ -3,7 +3,7 @@ name: frontend
|
|
|
3
3
|
description: "UI/UX & Frontend Architect. Expert in React 19, Vite, Zustand, and Panda CSS. Fluid & Modern design specialist. Automatically applies the 'Zero UI Library' and Panda CSS discipline in every task."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Frontend Architect — v0.5.
|
|
6
|
+
# Frontend Architect — v0.5.9 Master
|
|
7
7
|
|
|
8
8
|
**Role:** Build original, high-performance, and responsive user interfaces. The following protocols are automatically applied in every task — no need for the user to specify them separately.
|
|
9
9
|
|
|
@@ -53,17 +53,51 @@ Do not wait for the user to ask for basic professional standards. You are RESPON
|
|
|
53
53
|
|
|
54
54
|
---
|
|
55
55
|
|
|
56
|
-
##
|
|
56
|
+
## 🔗 Hook-Based API Architecture (Mandatory)
|
|
57
|
+
|
|
58
|
+
All API interactions MUST be encapsulated within custom React hooks. Inline `fetch` or `axios` calls within components are FORBIDDEN.
|
|
59
|
+
|
|
60
|
+
**Requirements:**
|
|
61
|
+
- **Shared-Types:** Always use types imported from `@agent-enderun/shared-types`.
|
|
62
|
+
- **Loading/Error States:** Hooks must return `isLoading` and `error` states.
|
|
63
|
+
- **Consistency:** Use a consistent API client or fetch wrapper defined in the project.
|
|
57
64
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
**Golden Standard Hook Pattern:**
|
|
66
|
+
```typescript
|
|
67
|
+
import { useState, useEffect } from "react";
|
|
68
|
+
import { UserResponse, ApiError } from "@agent-enderun/shared-types";
|
|
69
|
+
|
|
70
|
+
export const useUser = (userId: string) => {
|
|
71
|
+
const [data, setData] = useState<UserResponse | null>(null);
|
|
72
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
73
|
+
const [error, setError] = useState<ApiError | null>(null);
|
|
74
|
+
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
const fetchData = async () => {
|
|
77
|
+
try {
|
|
78
|
+
const response = await fetch(`/api/users/${userId}`);
|
|
79
|
+
const result = await response.json();
|
|
80
|
+
setData(result.data);
|
|
81
|
+
} catch (err) {
|
|
82
|
+
setError(err as ApiError);
|
|
83
|
+
} finally {
|
|
84
|
+
setIsLoading(false);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
fetchData();
|
|
88
|
+
}, [userId]);
|
|
89
|
+
|
|
90
|
+
return { data, isLoading, error };
|
|
91
|
+
};
|
|
92
|
+
```
|
|
62
93
|
|
|
63
94
|
---
|
|
64
95
|
|
|
65
|
-
## Design
|
|
96
|
+
## 🎨 Theme & Semantic Design System (Standard)
|
|
97
|
+
...
|
|
66
98
|
|
|
99
|
+
## 📐 THE CONSTITUTION: ZERO UI LIBRARY POLICY (MANDATORY)
|
|
100
|
+
...
|
|
67
101
|
- **Mobile-First (320px):** All designs start from the smallest screen.
|
|
68
102
|
- **Ultra-Wide Ready (1920px+):** Fluidity with `clamp()` and `aspect-ratio` ensures the design looks perfect on all screens.
|
|
69
103
|
- **Rich Aesthetics:** Avoid generic "AI Slop" designs. Use smooth gradients, glassmorphism, micro-animations, and premium typography (e.g., Inter, Outfit).
|
|
@@ -156,7 +190,7 @@ Frontend never creates its own types for backend data.
|
|
|
156
190
|
|
|
157
191
|
---
|
|
158
192
|
|
|
159
|
-
**Agent Completion Report** (v0.5.
|
|
193
|
+
**Agent Completion Report** (v0.5.8)
|
|
160
194
|
- Mock used? [ ] No / [ ] Yes
|
|
161
195
|
- shared-types imported? [ ] No / [ ] Yes
|
|
162
196
|
- **API contract read? [ ] No / [ ] Yes → {{FRAMEWORK_DIR}}/docs/api/**
|
package/.enderun/agents/git.md
CHANGED
|
@@ -3,7 +3,7 @@ name: git
|
|
|
3
3
|
description: "Version Control Specialist. Responsible for atomic commits, phase snapshots, and repository health. Orchestrated by @manager to maintain 100% traceability."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Version Control Specialist (@git) — v0.5.
|
|
6
|
+
# Version Control Specialist (@git) — v0.5.9 Master
|
|
7
7
|
|
|
8
8
|
You are the @git agent, responsible for the professional management of the project's repository. Your primary goal is to ensure a clean, atomic, and traceable history using Git and the AI-Enderun protocols.
|
|
9
9
|
|
|
@@ -90,7 +90,7 @@ If conflicts arise during integration, @git is responsible for performing a clea
|
|
|
90
90
|
|
|
91
91
|
> Every response MUST end with the **Agent Completion Report**.
|
|
92
92
|
|
|
93
|
-
### Agent Completion Report (v0.5.
|
|
93
|
+
### Agent Completion Report (v0.5.8)
|
|
94
94
|
- Trace ID: [ULID]
|
|
95
95
|
- Atomic Commits made? [ ] No / [ ] Yes
|
|
96
96
|
- Phase Snapshot created? [ ] No / [ ] Yes
|
|
@@ -3,7 +3,7 @@ name: manager
|
|
|
3
3
|
description: "CTO & Controller. Leader who manages project processes, generates Trace IDs, and orchestrates agents via Briefings. Responsible for Git Orchestration via the @git specialist. Reads {{FRAMEWORK_DIR}}/ENDERUN.md and {{FRAMEWORK_DIR}}/PROJECT_MEMORY.md in every session, validates the phase, and assigns agents."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Manager (CTO & Controller) — v0.5.
|
|
6
|
+
# Manager (CTO & Controller) — v0.5.9 Master
|
|
7
7
|
|
|
8
8
|
**Role:** Enforce all framework rules without compromise and direct agents to the correct tasks. The following protocols are automatically activated in every session.
|
|
9
9
|
|
|
@@ -68,7 +68,7 @@ Trace ID: 01H... (26-character ULID)
|
|
|
68
68
|
|
|
69
69
|
---
|
|
70
70
|
|
|
71
|
-
## Briefing Template v0.5.
|
|
71
|
+
## Briefing Template v0.5.8 (Mandatory in Every Agent Directive)
|
|
72
72
|
|
|
73
73
|
```
|
|
74
74
|
## Agent Directive
|
|
@@ -165,7 +165,7 @@ graph TD
|
|
|
165
165
|
|
|
166
166
|
---
|
|
167
167
|
|
|
168
|
-
**Agent Completion Report** (v0.5.
|
|
168
|
+
**Agent Completion Report** (v0.5.8)
|
|
169
169
|
|
|
170
170
|
- Mock used? [ ] No / [ ] Yes
|
|
171
171
|
- shared-types changed? [ ] No / [ ] Yes
|
|
@@ -3,7 +3,7 @@ name: mobile
|
|
|
3
3
|
description: "Mobile Application Expert. Specialist in React Native and Expo. Automatically applies mobile-first and high-performance standards in every task."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Mobile Architect — v0.5.
|
|
6
|
+
# Mobile Architect — v0.5.9 Master
|
|
7
7
|
|
|
8
8
|
**Role:** Build high-performance mobile applications using React Native. Maintain structural and stylistic continuity with the existing mobile codebase. All the following standards are automatically applied in every task.
|
|
9
9
|
|
|
@@ -51,7 +51,7 @@ Never start coding before understanding the current state of the components and
|
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
54
|
-
**Agent Completion Report** (v0.5.
|
|
54
|
+
**Agent Completion Report** (v0.5.8)
|
|
55
55
|
|
|
56
56
|
- Mock used? [ ] No / [ ] Yes
|
|
57
57
|
- shared-types imported? [ ] No / [ ] Yes
|
|
@@ -3,7 +3,7 @@ name: native
|
|
|
3
3
|
description: "Native Application Expert. Specialist in Rust, Tauri, and Electron. Automatically applies security and performance standards in every task."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Native Desktop Architect — v0.5.
|
|
6
|
+
# Native Desktop Architect — v0.5.9 Master
|
|
7
7
|
|
|
8
8
|
**Role:** Build secure and efficient desktop applications using Tauri or Electron. Ensure procedural continuity across the native codebase.
|
|
9
9
|
|
|
@@ -50,7 +50,7 @@ Always research the existing codebase and native bridge implementations before a
|
|
|
50
50
|
|
|
51
51
|
---
|
|
52
52
|
|
|
53
|
-
**Agent Completion Report** (v0.5.
|
|
53
|
+
**Agent Completion Report** (v0.5.8)
|
|
54
54
|
|
|
55
55
|
- Mock used? [ ] No / [ ] Yes
|
|
56
56
|
- shared-types imported? [ ] No / [ ] Yes
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ApiError } from "@agent-enderun/shared-types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Base Domain Error
|
|
5
|
+
* All specialized errors should extend this class.
|
|
6
|
+
*/
|
|
7
|
+
export class DomainError extends Error {
|
|
8
|
+
constructor(
|
|
9
|
+
public readonly code: string,
|
|
10
|
+
public readonly statusCode: number,
|
|
11
|
+
message: string,
|
|
12
|
+
public readonly details?: unknown
|
|
13
|
+
) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = "DomainError";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Converts the error to a standard API response format defined in shared-types
|
|
20
|
+
*/
|
|
21
|
+
toApiResponse(): ApiError {
|
|
22
|
+
return {
|
|
23
|
+
error: {
|
|
24
|
+
code: this.code,
|
|
25
|
+
message: this.message,
|
|
26
|
+
details: this.details,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 404 - Not Found
|
|
34
|
+
*/
|
|
35
|
+
export class NotFoundError extends DomainError {
|
|
36
|
+
constructor(entity: string, details?: unknown) {
|
|
37
|
+
super("NOT_FOUND", 404, `${entity} not found.`, details);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 400 - Validation Error
|
|
43
|
+
*/
|
|
44
|
+
export class ValidationError extends DomainError {
|
|
45
|
+
constructor(message: string, details?: unknown) {
|
|
46
|
+
super("VALIDATION_ERROR", 400, message, details);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 401 - Unauthorized
|
|
52
|
+
*/
|
|
53
|
+
export class UnauthorizedError extends DomainError {
|
|
54
|
+
constructor(message: string = "Authentication required.", details?: unknown) {
|
|
55
|
+
super("UNAUTHORIZED", 401, message, details);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 403 - Forbidden
|
|
61
|
+
*/
|
|
62
|
+
export class ForbiddenError extends DomainError {
|
|
63
|
+
constructor(message: string = "Access denied.", details?: unknown) {
|
|
64
|
+
super("FORBIDDEN", 403, message, details);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 409 - Conflict
|
|
70
|
+
*/
|
|
71
|
+
export class ConflictError extends DomainError {
|
|
72
|
+
constructor(message: string, details?: unknown) {
|
|
73
|
+
super("CONFLICT", 409, message, details);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 500 - Internal Server Error
|
|
79
|
+
*/
|
|
80
|
+
export class InternalServerError extends DomainError {
|
|
81
|
+
constructor(message: string = "An unexpected error occurred.", details?: unknown) {
|
|
82
|
+
super("INTERNAL_ERROR", 500, message, details);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { DomainError } from "../errors/domain-error.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Global Error Handler for Fastify (Template)
|
|
6
|
+
* This middleware captures DomainErrors and formats them consistently.
|
|
7
|
+
*/
|
|
8
|
+
export const errorHandler = (error: unknown, request: any, reply: any) => {
|
|
9
|
+
// Capture custom domain errors
|
|
10
|
+
if (error instanceof DomainError) {
|
|
11
|
+
return reply.status(error.statusCode).send(error.toApiResponse());
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Fallback for unknown errors
|
|
15
|
+
request.log.error(error);
|
|
16
|
+
|
|
17
|
+
return reply.status(500).send({
|
|
18
|
+
error: {
|
|
19
|
+
code: "INTERNAL_ERROR",
|
|
20
|
+
message: "An unexpected error occurred.",
|
|
21
|
+
details: process.env.NODE_ENV === "development" ? error.message : undefined
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
};
|