agent-enderun 0.8.8 → 0.9.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 (103) hide show
  1. package/.enderun/BRAIN_DASHBOARD.md +4 -4
  2. package/{ENDERUN.md → .enderun/ENDERUN.md} +4 -2
  3. package/.enderun/PROJECT_MEMORY.md +12 -45
  4. package/.enderun/STATUS.md +9 -8
  5. package/.enderun/agents/agent_army_schema.json +29 -7
  6. package/.enderun/agents/analyst.md +3 -5
  7. package/.enderun/agents/backend.md +11 -31
  8. package/.enderun/agents/devops.md +2 -3
  9. package/.enderun/agents/explorer.md +4 -4
  10. package/.enderun/agents/frontend.md +76 -69
  11. package/.enderun/agents/git.md +3 -3
  12. package/.enderun/agents/manager.md +30 -42
  13. package/.enderun/agents/mobile.md +3 -3
  14. package/.enderun/agents/native.md +106 -0
  15. package/.enderun/agents/orchestrator.md +2 -2
  16. package/.enderun/agents/qa.md +7 -10
  17. package/.enderun/agents/schema/agent-lifecycle-schema.json +29 -8
  18. package/.enderun/agents/security.md +2 -2
  19. package/.enderun/cli-commands.json +4 -0
  20. package/.enderun/config.json +2 -2
  21. package/.enderun/knowledge/SHIM_TEMPLATE.md +25 -0
  22. package/.enderun/knowledge/eslint-standards.md +63 -0
  23. package/.enderun/knowledge/hermes_protocol.md +1 -1
  24. package/.enderun/knowledge/manager_authority_audit_enforcement.md +2 -2
  25. package/.enderun/mcp_config.json +9 -0
  26. package/.enderun/memory-graph/agent-contexts/analyst.json +1 -1
  27. package/.enderun/memory-graph/agent-contexts/backend.json +1 -1
  28. package/.enderun/memory-graph/agent-contexts/devops.json +1 -1
  29. package/.enderun/memory-graph/agent-contexts/explorer.json +1 -1
  30. package/.enderun/memory-graph/agent-contexts/frontend.json +1 -1
  31. package/.enderun/memory-graph/agent-contexts/git.json +1 -1
  32. package/.enderun/memory-graph/agent-contexts/manager.json +1 -1
  33. package/.enderun/memory-graph/agent-contexts/mobile.json +1 -1
  34. package/.enderun/memory-graph/agent-contexts/native.json +1 -0
  35. package/.enderun/memory-graph/agent-contexts/orchestrator.json +1 -1
  36. package/.enderun/memory-graph/agent-contexts/qa.json +1 -1
  37. package/.enderun/memory-graph/agent-contexts/security.json +1 -1
  38. package/.enderun/memory-graph/graph.json +123 -15
  39. package/.enderun/memory-graph/shared-facts.json +26 -31
  40. package/README.md +89 -413
  41. package/agent.md +25 -0
  42. package/bin/cli.js +9 -9
  43. package/bin/update-contract.js +34 -37
  44. package/bin/validate-agent-army.js +38 -13
  45. package/claude.md +14 -8
  46. package/docs/README.md +35 -16
  47. package/docs/tech-stack.md +30 -0
  48. package/eslint.config.js +68 -0
  49. package/framework-mcp/dist/index.js +184 -24
  50. package/framework-mcp/package.json +6 -33
  51. package/framework-mcp/tsconfig.json +3 -6
  52. package/gemini.md +12 -6
  53. package/grok.md +25 -0
  54. package/package.json +12 -6
  55. package/panda.config.ts +86 -86
  56. package/tsconfig.json +9 -0
  57. package/.enderun/logs/analyst.json +0 -1
  58. package/.enderun/logs/backend.json +0 -1
  59. package/.enderun/logs/devops.json +0 -1
  60. package/.enderun/logs/explorer.json +0 -1
  61. package/.enderun/logs/frontend.json +0 -1
  62. package/.enderun/logs/git.json +0 -1
  63. package/.enderun/logs/manager.json +0 -1
  64. package/.enderun/logs/mobile.json +0 -1
  65. package/.enderun/logs/native.json +0 -1
  66. package/.enderun/logs/orchestrator.json +0 -1
  67. package/.enderun/logs/qa.json +0 -1
  68. package/.enderun/logs/security.json +0 -1
  69. package/.env.example +0 -10
  70. package/cursor.md +0 -19
  71. package/framework-mcp/README.md +0 -55
  72. package/framework-mcp/dist/schemas.js +0 -84
  73. package/framework-mcp/dist/tools/codebase.js +0 -294
  74. package/framework-mcp/dist/tools/contract.js +0 -197
  75. package/framework-mcp/dist/tools/framework.js +0 -225
  76. package/framework-mcp/dist/tools/git.js +0 -51
  77. package/framework-mcp/dist/tools/governance.js +0 -696
  78. package/framework-mcp/dist/tools/index.js +0 -47
  79. package/framework-mcp/dist/tools/knowledge.js +0 -133
  80. package/framework-mcp/dist/tools/memory.js +0 -217
  81. package/framework-mcp/dist/tools/messages.js +0 -193
  82. package/framework-mcp/dist/tools/monitoring.js +0 -294
  83. package/framework-mcp/dist/tools/orchestration.js +0 -369
  84. package/framework-mcp/dist/tools/pipeline.js +0 -267
  85. package/framework-mcp/dist/tools/security.js +0 -137
  86. package/framework-mcp/dist/utils.js +0 -121
  87. package/framework-mcp/src/index.ts +0 -49
  88. package/framework-mcp/src/schemas.ts +0 -106
  89. package/framework-mcp/src/tools/codebase.ts +0 -284
  90. package/framework-mcp/src/tools/contract.ts +0 -221
  91. package/framework-mcp/src/tools/framework.ts +0 -223
  92. package/framework-mcp/src/tools/git.ts +0 -42
  93. package/framework-mcp/src/tools/governance.ts +0 -891
  94. package/framework-mcp/src/tools/index.ts +0 -50
  95. package/framework-mcp/src/tools/knowledge.ts +0 -141
  96. package/framework-mcp/src/tools/memory.ts +0 -207
  97. package/framework-mcp/src/tools/messages.ts +0 -213
  98. package/framework-mcp/src/tools/monitoring.ts +0 -351
  99. package/framework-mcp/src/tools/orchestration.ts +0 -440
  100. package/framework-mcp/src/tools/pipeline.ts +0 -353
  101. package/framework-mcp/src/tools/security.ts +0 -143
  102. package/framework-mcp/src/utils.ts +0 -130
  103. package/src/cli/index.ts +0 -2188
@@ -1,4 +1,4 @@
1
- # 🧠 Agent Enderun Brain Dashboard
1
+ # 🧠 Agent Enderun Brain Dashboard (v1.0)
2
2
 
3
3
  This dashboard provides a high-level overview of the Army's performance, quality trends, and architectural health.
4
4
 
@@ -12,7 +12,7 @@ This dashboard provides a high-level overview of the Army's performance, quality
12
12
  | **Active Trace IDs** | 0 | 🟢 None |
13
13
  | **Agent Velocity** | — | — |
14
14
  | **Contract Integrity** | 100% | ✅ Valid |
15
- | **Army Size** | 11 agents | ✅ Complete |
15
+ | **Army Size** | 12 agents | ✅ Complete |
16
16
 
17
17
  ---
18
18
 
@@ -20,7 +20,7 @@ This dashboard provides a high-level overview of the Army's performance, quality
20
20
 
21
21
  - **Security Audit Status**: 🟢 Clean (Last scan: 2026-05-26)
22
22
  - **Constitution Compliance**: 🔵 100% (Last audit: 2026-05-26)
23
- - **Documentation Debt**: 🟢 Low (English standardization complete)
23
+ - **Documentation Debt**: 🟢 Low (v1.0 English standardization complete)
24
24
 
25
25
  ---
26
26
 
@@ -38,7 +38,7 @@ This dashboard provides a high-level overview of the Army's performance, quality
38
38
 
39
39
  | Version | Date | Description | Hash |
40
40
  | :--- | :--- | :--- | :--- |
41
- | v1.0.0-alpha | 2026-05-25 | Full 11-Agent Army + Memory Graph + Orchestration MCP | `sha256:army-v1` |
41
+ | v1.0.0-alpha | 2026-05-25 | Full 12-Agent Army + Memory Graph + Orchestration MCP | `sha256:army-v1` |
42
42
 
43
43
  ---
44
44
 
@@ -3,11 +3,13 @@
3
3
 
4
4
  ## 🎖️ AGENT CHECKLIST (MANDATORY BEFORE RESPONSE)
5
5
  > Check this list at the end of every response:
6
- - [ ] **Surgical Quality:** Did you use the `replace` tool for targeted changes? For files >100 lines, focus on changed blocks and use `...` for untouched sections to preserve token limit. (Quality over Volume)
6
+ - [ ] **Surgical Quality:** Did you use the `replace_text` tool for targeted changes? For files >100 lines, focus on changed blocks. (Quality over Volume)
7
+ - [ ] **Autonomous Growth:** Use `create_app` for generating new modules from specs.
7
8
  - [ ] **Contract First:** Are the app's types and apps/backend/contract.version.json up to date?
8
9
  - [ ] **Audit Log:** Did you log this action in `{{FRAMEWORK_DIR}}/logs/[agent].json`?
9
10
  - [ ] **CLI Orchestration:** Does the action comply with `{{ADAPTER}} cli` rules?
10
11
  - [ ] **Complete Context:** Ensure all changed logic is fully written. Placeholder `...` is only for *unchanged* surrounding code.
12
+ - [ ] **ESLint Compliance:** Did you run `npm run lint` (or `agent-enderun check:lint`)? Zero errors required; follow `{{FRAMEWORK_DIR}}/knowledge/eslint-standards.md`.
11
13
 
12
14
  ---
13
15
 
@@ -35,7 +37,7 @@ To minimize AI costs and maximize speed, all agents must adhere to the **Token E
35
37
  ---
36
38
 
37
39
  ## Constitution Status
38
- This file (`./{{ADAPTER}}.md`) and the `{{FRAMEWORK_DIR}}/docs/` folder represent the "Supreme Law" of the project. All agents must read this file first in every session and strictly comply with its rules 100%. All framework-specific documentation is stored within `{{FRAMEWORK_DIR}}/docs/`.
40
+ This file (`./.enderun/ENDERUN.md`) and the `.enderun/docs/` folder represent the "Supreme Law" of the project. All agents must read this file first in every session and strictly comply with its rules 100%. All framework-specific documentation is stored within `.enderun/docs/`.
39
41
 
40
42
  ---
41
43
 
@@ -1,53 +1,20 @@
1
- # PROJECT MEMORY — Agent Enderun
2
-
3
- This file is the Single Source of Truth (SSOT) and the persistent memory of the project.
4
-
5
1
  ## CURRENT STATUS
6
2
 
7
- | Active Phase | Profile | Last Update | Active Trace ID | Blockers |
8
- | :----------- | :------ | :---------- | :-------------- | :------- |
9
- | PHASE_0 | Full | 2026-05-28 | NONE | NONE |
10
-
11
- ## PROJECT DEFINITION
12
-
13
- | Field | Value |
14
- | :--- | :--- |
15
- | Project Name | Agent Enderun |
16
- | Version | 0.8.8 |
17
- | Platform | Node.js CLI + MCP orchestration framework |
18
- | Frontend | N/A (framework core, no user-facing frontend) |
19
- | Backend | Node.js + framework-mcp MCP server + CLI orchestration |
20
- | DB | None (framework core) |
21
-
22
- ## DOD STATUS
23
-
24
- | Phase | Status | Note |
25
- | :--- | :--- | :--- |
26
- | PHASE_0 | PENDING | Discovery & Setup |
27
- | PHASE_1 | PENDING | Architecture & Contracts |
28
- | PHASE_2 | PENDING | Core Development |
29
- | PHASE_3 | PENDING | Integration & Testing |
30
- | PHASE_4 | PENDING | Optimization & Deployment |
31
-
32
- ## CRITICAL DECISIONS
33
-
34
- | Date | Decision | Rationale | Agent |
35
- | :--- | :--- | :--- | :--- |
36
- | 2026-05-26 | Framework Cleanup | Pristine memory state established for npmjs publish. | @manager |
37
-
38
- ## DELIVERABLES
39
-
40
- | Module | Status | Agent | Date |
41
- | :--- | :--- | :--- | :--- |
3
+ - Phase: PHASE_0 (Discovery & Setup)
4
+ - Trace ID: 01HGT8J5E2N0W0W0W0W0W0W0W0
5
+ - @manager state: IDLE - System Restored to Factory Settings.
42
6
 
43
7
  ## ACTIVE TASKS
44
8
 
45
9
  | Trace ID | Task | Agent | Priority | Status |
46
10
  | :--- | :--- | :--- | :--- | :--- |
47
11
 
48
- ## HISTORY (Persistent Memory)
49
-
50
- ### 2026-05-26 Framework Cleanup
51
-
52
- - **Agent:** @manager
53
- - **Action:** Framework memory reset successfully performed. Pristine memory state established. Ready to receive custom project instructions and start scaffolding.
12
+ ## CRITICAL DECISIONS
13
+ - **Tech Stack:** Node.js/Fastify, React/Vite, PostgreSQL, Kysely.
14
+ - **Surgical Standard:** replace_text/patch_file is mandatory for all edits.
15
+ - **Contract First:** All developments must start with type definitions.
16
+ - **Memory Standard:** Auto-pruning active (max 10 entries).
17
+
18
+ ## HISTORY
19
+ - **SYSTEM INITIALIZED:** Framework v0.9.0 promoted to stable release state.
20
+ - **CLEAN SLATE:** All developmental logs, messages, and temporary histories purged for fresh start.
@@ -1,5 +1,5 @@
1
1
  # 🏛️ AGENT ENDERUN — ORDU KOMUTA DASHBOARDI
2
- > v0.8.8 | State Machine Active | Memory Graph: Online
2
+ > v0.9.0 | State Machine Active | Memory Graph: Online
3
3
 
4
4
  ---
5
5
 
@@ -7,9 +7,9 @@
7
7
 
8
8
  | Agent | State | CurrentTask | BlockedBy | HealthScore | LastAction |
9
9
  | :--- | :--- | :--- | :--- | :--- | :--- |
10
- | @manager | IDLE | | — | 9.5/10 | Framework Reset |
11
- | @orchestrator | IDLE | — | — | 9.8/10 | |
12
- | @analyst | IDLE | — | — | 9.6/10 | |
10
+ | @manager | ACTIVE | Readiness Mühürleme | — | 10/10 | v0.9.0 Promotion |
11
+ | @orchestrator | IDLE | — | — | 9.8/10 | Path Synchronization |
12
+ | @analyst | IDLE | — | — | 9.6/10 | Contract Review |
13
13
  | @backend | IDLE | — | — | 9.2/10 | — |
14
14
  | @frontend | IDLE | — | — | 9.0/10 | — |
15
15
  | @security | IDLE | — | — | 9.3/10 | — |
@@ -18,6 +18,7 @@
18
18
  | @explorer | IDLE | — | — | 9.4/10 | — |
19
19
  | @git | IDLE | — | — | 9.1/10 | — |
20
20
  | @mobile | IDLE | — | — | 8.8/10 | — |
21
+ | @native | IDLE | — | — | 8.9/10 | — |
21
22
 
22
23
  ---
23
24
 
@@ -27,10 +28,10 @@
27
28
  | :--- | :--- |
28
29
  | **Framework Versiyonu** | v0.8.8 |
29
30
  | **Sistem Sağlığı** | 🟢 GREEN |
30
- | **Toplam Trace** | 0 |
31
- | **Aktif Görevler** | 0 |
31
+ | **Büyük Yönetişim Denetimi** | TAMAMLANDI |
32
+ | **Aktif Görevler** | 1 |
32
33
  | **Blokaj Sayısı** | 0 |
33
- | **Aktif Agent Sayısı** | 11 |
34
+ | **Aktif Agent Sayısı** | 12 |
34
35
  | **Kuyruk Boyutu** | 0 |
35
36
 
36
37
  ---
@@ -49,6 +50,7 @@
49
50
  @git → @manager
50
51
  @explorer → @manager
51
52
  @mobile → @manager
53
+ @native → @manager
52
54
  ```
53
55
 
54
56
  ---
@@ -58,4 +60,3 @@
58
60
  `IDLE → BRIEFED → EXECUTING → DONE → IDLE`
59
61
 
60
62
  Detay: `.enderun/agents/schema/agent-lifecycle-schema.json`
61
- json`
@@ -1,10 +1,18 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "title": "Agent Enderun Army Schema",
4
- "description": "Strongly-typed schema for all specialist agents in the Enderun Army. Every agent definition file must validate against this. v1.0: Removed enum lock on agent names to allow new specialist agents.",
4
+ "description": "Strongly-typed schema for all specialist agents in the Enderun Army. Every agent.json must validate against this. v1.0: Removed enum lock on agent names to allow new specialist agents.",
5
5
  "version": "1.0.0",
6
6
  "type": "object",
7
- "required": ["name", "capability", "role", "specialization", "rules", "permittedDirectories", "hermesChannels"],
7
+ "required": [
8
+ "name",
9
+ "capability",
10
+ "role",
11
+ "specialization",
12
+ "rules",
13
+ "permittedDirectories",
14
+ "hermesChannels"
15
+ ],
8
16
  "properties": {
9
17
  "name": {
10
18
  "type": "string",
@@ -31,13 +39,17 @@
31
39
  },
32
40
  "rules": {
33
41
  "type": "array",
34
- "items": { "type": "string" },
42
+ "items": {
43
+ "type": "string"
44
+ },
35
45
  "minItems": 1,
36
46
  "description": "Mandatory behavioral rules the agent must never violate."
37
47
  },
38
48
  "permittedDirectories": {
39
49
  "type": "array",
40
- "items": { "type": "string" },
50
+ "items": {
51
+ "type": "string"
52
+ },
41
53
  "minItems": 1,
42
54
  "description": "Directories this agent is authorized to read/write. Any access outside these requires @manager approval."
43
55
  },
@@ -58,7 +70,9 @@
58
70
  "type": "object",
59
71
  "additionalProperties": {
60
72
  "type": "array",
61
- "items": { "type": "string" }
73
+ "items": {
74
+ "type": "string"
75
+ }
62
76
  },
63
77
  "description": "Named checklists the agent must execute. e.g. 'beforeEveryResponse', 'beforeDelegating'"
64
78
  },
@@ -76,10 +90,18 @@
76
90
  "type": "array",
77
91
  "items": {
78
92
  "type": "string",
79
- "enum": ["core", "specialist", "infrastructure", "governance", "quality", "security", "orchestration"]
93
+ "enum": [
94
+ "core",
95
+ "specialist",
96
+ "infrastructure",
97
+ "governance",
98
+ "quality",
99
+ "security",
100
+ "orchestration"
101
+ ]
80
102
  },
81
103
  "description": "Classification tags for filtering and grouping agents."
82
104
  }
83
105
  },
84
106
  "additionalProperties": false
85
- }
107
+ }
@@ -3,7 +3,7 @@ name: analyst
3
3
  description: "Verification & QA Specialist Agent for Agent Enderun"
4
4
  ---
5
5
 
6
- # @analyst — Verification & QA
6
+ # @analyst — Verification & QA
7
7
 
8
8
  - **Name:** @analyst
9
9
  - **Capability:** 9.6
@@ -26,7 +26,7 @@ description: "Verification & QA Specialist Agent for Agent Enderun"
26
26
 
27
27
  ---
28
28
 
29
- # Project Analyst & QA Gate
29
+ # Project Analyst & QA Gate
30
30
 
31
31
  **Role:** Maintain project memory, serve as a quality gate, and manage documentation. The following protocols are automatically applied in every task.
32
32
 
@@ -47,8 +47,6 @@ When analyzing or preparing documentation, never read the content of a file just
47
47
  - **Continuity Audit:** Have recent changes followed the established patterns and **blueprints**?
48
48
  - Are there pending roadmap items?
49
49
  - Is there any BLOCKED status?
50
- - Always retrieve your agent-specific context with `get_agent_context` and include only the relevant summary in your analysis.
51
- - Prefer `get_memory_insights` or `get_project_gaps` before reading full memory files; keep prompts compact.
52
50
 
53
51
  ### Writing — Lock Protocol
54
52
 
@@ -224,7 +222,7 @@ Use the `log_agent_action` tool to record your activities securely.
224
222
 
225
223
  ---
226
224
 
227
- **Agent Completion Report**
225
+ **Agent Completion Report**
228
226
 
229
227
  - Mock used? [ ] No / [ ] Yes
230
228
  - shared-types changed? [ ] No / [ ] Yes
@@ -3,7 +3,7 @@ name: backend
3
3
  description: "Domain Logic & Databases Specialist Agent for Agent Enderun"
4
4
  ---
5
5
 
6
- # @backend — Domain Logic & Databases
6
+ # @backend — Domain Logic & Databases
7
7
 
8
8
  - **Name:** @backend
9
9
  - **Capability:** 9.2
@@ -28,7 +28,7 @@ description: "Domain Logic & Databases Specialist Agent for Agent Enderun"
28
28
 
29
29
  ---
30
30
 
31
- # Backend Architect
31
+ # Backend Architect
32
32
 
33
33
  **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.
34
34
 
@@ -161,19 +161,6 @@ Route (Fastify)
161
161
 
162
162
  ---
163
163
 
164
- ## 🗄️ Database Migration Safety & Schema Governance (Zero-Downtime)
165
-
166
- To prevent data loss and dynamic API breaks during production updates, the agent MUST enforce **Zero-Downtime migrations**:
167
- - **No Yikhici Changes (Destructive Schema Modifications Forbidden)**: Directly running `ALTER TABLE ... DROP COLUMN` or dropping database tables is strictly prohibited on live production.
168
- - **Phased Deprecation Path (2-Step Migration Strategy)**:
169
- 1. *Phase 1 (Deploy Code + Additive Schema)*: Create the new table or column. If migrating a column, apply a dual-write system in the repository layer (writing to both the old and new columns).
170
- 2. *Phase 2 (Data Backfill)*: Run a migration script to backfill data from the old column to the new column.
171
- 3. *Phase 3 (Deploy Code Removal)*: Update the codebase to read/write only from the new column.
172
- 4. *Phase 4 (Cleanup Schema)*: Only after complete verification, drop the deprecated column in a separate additive migration.
173
- - **Soft Delete Standard**: Always use a nullable `deletedAt: Date | null` column. Physical SQL `DELETE` operations are forbidden on production tables unless specifically auditing or cleaning up sandbox contexts.
174
-
175
- ---
176
-
177
164
  ## 🏗️ Base Architecture & Code Reuse (Standard)
178
165
 
179
166
  To eliminate code repetition, all backend development MUST follow the **Base Pattern**. Agents are not allowed to write redundant CRUD logic.
@@ -188,16 +175,12 @@ All entities must implement the `BaseEntity` interface (from the app's local typ
188
175
 
189
176
  ---
190
177
 
191
- ## 🕵️ Structured Logging & OpenTelemetry Telemetry (Mandatory)
192
-
193
- All server executions and state changes must emit structured JSON logs. Bypassing structured log aggregation via standard `console.log` is strictly forbidden.
178
+ ## 🕵️ Automatic Audit Logging (Mandatory)
194
179
 
195
- - **JSON Logging Standard (Pino/Winston)**: All system transactions, network hooks, and repository statements must be logged in JSON structure:
196
- ```ts
197
- logger.info({ trace_id, action: 'USER_CREATE', userId: user.id }, "User record created successfully");
198
- ```
199
- - **Trace Context Propagation**: Every log entry, API payload, and Kysely database statement must contain the active **Trace ID** (`trace_id`). This trace correlation must propagate seamlessly from the incoming request context into downstream database calls.
200
- - **Audit Logging**: Every mutation (CREATE, UPDATE, DELETE) must generate an audit log entry detailing both the `previousState` and `newState` mapped against the performing `UserID` and active `trace_id`.
180
+ Every "mutation" (CREATE, UPDATE, DELETE) MUST trigger an audit log entry.
181
+ - **Traceability:** Link every audit log to the active **Trace ID**.
182
+ - **State Capture:** For updates, capture both `previousState` and `newState`.
183
+ - **User Context:** Identify the `UserID` performing the action.
201
184
 
202
185
  ---
203
186
 
@@ -242,15 +225,14 @@ await db.transaction().execute(async (trx) => { ... });
242
225
  ## Async Error Management (Mandatory for every async block)
243
226
 
244
227
  ```typescript
245
- async function createUser(data: CreateUserDTO, ctx: RequestContext): Promise<User> {
228
+ async function createUser(data: CreateUserDTO): Promise<User> {
246
229
  try {
247
230
  const existing = await userRepository.findByEmail(data.email);
248
231
  if (existing) throw new ConflictError("Email already in use.");
249
232
  return await userRepository.create(data);
250
233
  } catch (error) {
251
234
  if (error instanceof DomainError) throw error;
252
- // Log structured error including OpenTelemetry trace correlation
253
- logger.error({ error, trace_id: ctx.traceId }, "Unexpected database mutation error.");
235
+ logger.error({ error }, "Unexpected error.");
254
236
  throw new DomainError("INTERNAL_ERROR", 500, "Server error.");
255
237
  }
256
238
  }
@@ -348,16 +330,14 @@ When app types or API documentation changes:
348
330
  | Raw SQL strings | Injection risk; only Kysely |
349
331
  | DB calls in Controller | Repository pattern is mandatory |
350
332
  | `any` type | Use `unknown` + type guard |
351
- | `console.log` or unstructured logging | Use `pino` structured logger with `trace_id` correlation |
333
+ | `console.log` | Use `pino` logger |
352
334
  | Async without try/catch | Every error must be handled |
353
335
  | Hardcoded secrets | `.env` hierarchy is mandatory |
354
336
  | Returning error with 200 OK | Real HTTP status (4xx, 5xx) is mandatory |
355
- | Direct destructive column dropping | Causes API breaks and system downtime on production |
356
- | Type/API Contract Drift | Markdown contracts and TypeScript types must be kept in perfect sync |
357
337
 
358
338
  ---
359
339
 
360
- **Agent Completion Report**
340
+ **Agent Completion Report**
361
341
  - Mock used? [ ] No / [ ] Yes
362
342
  - App types changed? [ ] No / [ ] Yes → contract.version updated
363
343
  - **API contract written? [ ] No / [ ] Yes → .enderun/docs/api/[domain].md**
@@ -3,7 +3,7 @@ name: devops
3
3
  description: "Infrastructure & Deployment Orchestration Specialist Agent for Agent Enderun"
4
4
  ---
5
5
 
6
- # @devops — Infrastructure & Deployment
6
+ # @devops — Infrastructure & Deployment
7
7
 
8
8
  - **Name:** @devops
9
9
  - **Capability:** 9.0
@@ -59,7 +59,7 @@ description: "Infrastructure & Deployment Orchestration Specialist Agent for Age
59
59
 
60
60
  ---
61
61
 
62
- # @devops — Infrastructure & Deployment Orchestration
62
+ # @devops — Infrastructure & Deployment Orchestration
63
63
 
64
64
  ## Identity & Mission
65
65
 
@@ -118,7 +118,6 @@ Maintain strict environment parity:
118
118
  Every deploy must have a documented rollback plan:
119
119
  ```markdown
120
120
  ## Rollback Plan — Deploy ENR-DEPLOY-{ID}
121
- - **Previous stable version:** v{X.Y.Z} (git tag: {tag})
122
121
  - **Rollback trigger:** Health check failure or CRITICAL error rate spike
123
122
  - **Rollback steps:** [numbered steps]
124
123
  - **Estimated rollback time:** {N} minutes
@@ -3,7 +3,7 @@ name: explorer
3
3
  description: "Codebase Discovery & Architecture Specialist Agent for Agent Enderun"
4
4
  ---
5
5
 
6
- # @explorer — Codebase Discovery & Architecture
6
+ # @explorer — Codebase Discovery & Architecture
7
7
 
8
8
  - **Name:** @explorer
9
9
  - **Capability:** 9.4
@@ -25,7 +25,7 @@ description: "Codebase Discovery & Architecture Specialist Agent for Agent Ender
25
25
 
26
26
  ---
27
27
 
28
- # Codebase Explorer
28
+ # Codebase Explorer
29
29
 
30
30
  **Role:** Analyze the codebase, map architectures, and understand system-wide dependencies. Your primary duty is to provide context to other agents.
31
31
 
@@ -40,7 +40,7 @@ Never suggest a change without understanding the current state of the codebase.
40
40
  ## 🔌 SESSION STARTUP PROTOCOL (Mandatory)
41
41
 
42
42
  1. Read `.enderun/PROJECT_MEMORY.md` via `read_project_memory` tool. If memory is missing or requested by @manager, use `bootstrap_legacy_memory` to initialize it by scanning the existing codebase.
43
- 2. Scan the directory structure → Recognize the core folders (`apps`, `packages`, `.enderun`).
43
+ 2. Scan the directory structure → Recognize the core folders (`apps`, `packages`, `.gemini`).
44
44
  3. Identify the main configuration files (`package.json`, `tsconfig.json`, `ENDERUN.md`).
45
45
 
46
46
  > ✅ **End of Session:** Update `.enderun/PROJECT_MEMORY.md` HISTORY (via `update_project_memory`) + log action via `log_agent_action`. Every turn MUST end with an automated log and memory update.
@@ -124,7 +124,7 @@ Every research report must include:
124
124
 
125
125
  ---
126
126
 
127
- **Agent Completion Report**
127
+ **Agent Completion Report**
128
128
 
129
129
  - Mock used? [ ] No / [ ] Yes
130
130
  - Codebase searched? [ ] No / [ ] Yes
@@ -3,7 +3,7 @@ name: frontend
3
3
  description: "Fluid Responsive UI Specialist Agent for Agent Enderun"
4
4
  ---
5
5
 
6
- # @frontend — Fluid Responsive UI
6
+ # @frontend — Fluid Responsive UI
7
7
 
8
8
  - **Name:** @frontend
9
9
  - **Capability:** 9.0
@@ -28,7 +28,7 @@ description: "Fluid Responsive UI Specialist Agent for Agent Enderun"
28
28
 
29
29
  ---
30
30
 
31
- # Frontend Architect
31
+ # Frontend Architect
32
32
 
33
33
  **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.
34
34
 
@@ -94,12 +94,6 @@ All UI components must be written using **centralized responsive styles** and **
94
94
  - Header + body separation
95
95
  - Consistent appearance on mobile and desktop
96
96
 
97
- #### 6. Toast / Toaster (Notifications & Errors)
98
- - Positioned strictly at the **bottom-right** corner of the viewport
99
- - Auto-dismiss capability with manual dismiss action
100
- - Semantic visual styles: success (green), error (red/amber), info (blue)
101
- - Used for all backend API and network errors instead of invasive inline alerts
102
-
103
97
  **Agent Rule:**
104
98
  Never deviate from the patterns above for any new UI element. Do not write ad-hoc styles. If you want to extend existing patterns, ask @manager first.
105
99
 
@@ -110,7 +104,7 @@ Never deviate from the patterns above for any new UI element. Do not write ad-ho
110
104
  Do not wait for the user to ask for basic professional standards. You are RESPONSIBLE for including:
111
105
  - **Loading States:** Skeletons or spinners for all async operations.
112
106
  - **Empty States:** Clear messaging when no data is available.
113
- - **Error UI:** Graceful handling of backend errors with user feedback, displayed via custom toast notifications (Toaster) positioned at the **bottom-right** of the screen.
107
+ - **Error UI:** Graceful handling of backend errors with user feedback.
114
108
  - **Confirmations:** Modals for all destructive actions (delete, reset).
115
109
 
116
110
  ---
@@ -132,85 +126,100 @@ Do not wait for the user to ask for basic professional standards. You are RESPON
132
126
 
133
127
  ---
134
128
 
135
- ## 🔗 Hook-Based API & Caching Architecture (React Query / SWR) (Mandatory)
129
+ ## 🔗 Hook-Based API Architecture (Mandatory)
136
130
 
137
- All API interactions and state fetching MUST be encapsulated within custom React hooks powered by a robust server-state caching library like **TanStack Query (React Query)** or **SWR**. Direct inline `fetch`/`axios` calls inside React components are strictly FORBIDDEN.
131
+ All API interactions MUST be encapsulated within custom React hooks. Inline `fetch` or `axios` calls within components are FORBIDDEN.
138
132
 
139
- **Enterprise Architecture Requirements:**
140
- - **Request Deduplication & Caching**: All query hooks must utilize Query Keys (e.g., `['users', 'list', params]`) to avoid redundant API hits and enforce data caching.
141
- - **Cache Invalidation on Mutation**: All mutations (create, update, delete) must define an `onSuccess` callback to invalidate query keys, guaranteeing data freshness.
142
- - **App's Local Types**: Always use domain types imported from `apps/web/src/types`.
143
- - **Feature Flag Governance**: Any critical feature must be toggled programmatically via `features.isEnabled('feature-name')` to ensure safe deployment.
133
+ **Requirements:**
134
+ - **App's Local Types:** Always use types imported from the app's local types directory.
135
+ - **Loading/Error States:** Hooks must return `isLoading` and `error` states.
136
+ - **Consistency:** Use a consistent API client or fetch wrapper defined in the project.
144
137
 
145
- ### Golden Standard Page Hook Patterns (TanStack Query Standard)
138
+ ### Golden Standard Page Hook Patterns
146
139
 
147
- #### 1. useListPage (For Paginated/Searchable Lists)
148
- - Built on top of `useQuery` with dynamic Query Keys: `['domain', 'list', params]`.
149
- - Implements request deduplication, loading states, and pagination helpers (`setPage`, `setSearch`).
140
+ #### 1. useListPage (For List Pages)
141
+ - Pagination, search, and filter support
142
+ - Helper functions: `setPage`, `setLimit`, `setSearch`, `setParams`
143
+ - CRUD placeholders (`createItem`, `updateItem`, `deleteItem`)
144
+ - Flexible usage via generic `<T>` type
150
145
 
151
146
  **Usage Example:**
152
147
  ```ts
153
- export const useUserList = (params: UserListParams) => {
154
- return useQuery({
155
- queryKey: ['users', 'list', params],
156
- queryFn: () => api.get<User[]>('/api/users', { params }),
157
- staleTime: 5000, // 5 seconds fresh state
158
- });
159
- };
148
+ const { data, loading, error, pagination, setSearch, setPage } = useListPage<User>({
149
+ fetchFn: async (params) => fetch(`/api/users?${new URLSearchParams(params)}`).then(r => r.json()),
150
+ initialParams: { page: 1, limit: 10 }
151
+ });
160
152
  ```
161
153
 
162
- #### 2. useDetailPage (For Detail & Mutations)
163
- - Employs `useQuery` for fetching single entities by ID, and `useMutation` for CRUD updates/deletes.
164
- - **Cache invalidation is mandatory**: Must invalidate lists upon modifications.
154
+ #### 2. useDetailPage (For Detail Pages)
155
+ Standard hook for detail pages.
156
+
157
+ **Mandatory Features:**
158
+ - Fetch single record by ID (`fetchFn`)
159
+ - Update (`updateFn`) and Delete (`deleteFn`) supported optionally
160
+ - Helper functions: `refetch`, `setId`, `update`, `remove`
161
+ - Show meaningful message to the user on error
165
162
 
166
163
  **Usage Example:**
167
164
  ```ts
168
- export const useUserDetail = (id: UserID) => {
169
- const queryClient = useQueryClient();
170
-
171
- const query = useQuery({
172
- queryKey: ['users', 'detail', id],
173
- queryFn: () => api.get<User>(`/api/users/${id}`),
174
- });
175
-
176
- const updateMutation = useMutation({
177
- mutationFn: (data: UpdateUserDTO) => api.put(`/api/users/${id}`, data),
178
- onSuccess: () => {
179
- // Invalidate both detail and lists to trigger dynamic re-fetch
180
- queryClient.invalidateQueries({ queryKey: ['users', 'detail', id] });
181
- queryClient.invalidateQueries({ queryKey: ['users', 'list'] });
182
- }
183
- });
184
-
185
- return { ...query, update: updateMutation.mutate, isUpdating: updateMutation.isPending };
186
- };
165
+ const { data, loading, error, update, remove, refetch } = useDetailPage<User>({
166
+ fetchFn: (id) => fetch(`/api/users/${id}`).then(r => r.json()),
167
+ updateFn: (id, data) => fetch(`/api/users/${id}`, {
168
+ method: 'PUT',
169
+ headers: { 'Content-Type': 'application/json' },
170
+ body: JSON.stringify(data)
171
+ }).then(r => r.json()),
172
+ deleteFn: (id) => fetch(`/api/users/${id}`, { method: 'DELETE' }),
173
+ initialId: userId
174
+ });
187
175
  ```
188
176
 
189
177
  **Agent Rule:**
190
- - Never perform a direct fetch without query key association.
191
- - Always implement cache invalidation for list views when mutating detail screens.
178
+ - Never perform direct fetch on detail pages. Always use `useDetailPage`.
179
+ - Loading + error states must be managed for update and delete operations.
180
+ - If optimistic updates are used, a rollback mechanism must be added on error.
181
+
182
+ #### 3. useFormPage (For Form Pages)
183
+ Standard hook for form pages and modal forms.
192
184
 
193
- #### 3. useFormPage (For Forms and Validations)
194
- - Integrates form state validation with mutation handlers.
195
- - Manages optimistic UI updates or rollback mechanisms on backend failures.
185
+ **Mandatory Features:**
186
+ - Form state management
187
+ - Validation function support (client-side)
188
+ - Helpers: `setValue`, `setValues`, `handleSubmit`, `resetForm`
189
+ - Success/error message management after submit
196
190
 
197
191
  **Usage Example:**
198
192
  ```ts
199
- export const useUserForm = () => {
200
- const queryClient = useQueryClient();
201
-
202
- return useMutation({
203
- mutationFn: (data: CreateUserDTO) => api.post('/api/users', data),
204
- onSuccess: () => {
205
- queryClient.invalidateQueries({ queryKey: ['users', 'list'] });
206
- }
207
- });
208
- };
193
+ const {
194
+ values,
195
+ errors,
196
+ isSubmitting,
197
+ isSuccess,
198
+ handleSubmit,
199
+ setValue,
200
+ resetForm
201
+ } = useFormPage<UserForm>({
202
+ initialValues: { name: '', email: '' },
203
+ validate: (values) => {
204
+ const errs: any = {};
205
+ if (!values.name) errs.name = 'Ad zorunlu';
206
+ if (!values.email?.includes('@')) errs.email = 'Please enter a valid email';
207
+ return errs;
208
+ },
209
+ onSubmit: async (values) => {
210
+ await fetch('/api/users', {
211
+ method: 'POST',
212
+ body: JSON.stringify(values)
213
+ });
214
+ }
215
+ });
209
216
  ```
210
217
 
211
218
  **Agent Rule:**
212
- - Form components must go through the mutation hook layout.
213
- - Loading, error, and dynamic validation parameters must be rendered.
219
+ - `useFormPage` must be used on every page that contains a form.
220
+ - Inline form state management (manual useState) is forbidden.
221
+ - Validation must always be done client-side, and backend error messages must also be captured.
222
+ - Loading + success/error states must be managed after submit.
214
223
 
215
224
  **Agent Rule:**
216
225
  For every new page, you must use the appropriate one of these three patterns. Do not make inline API calls. Always go through a hook.
@@ -316,12 +325,10 @@ Frontend never creates its own types for backend data. Instead, it uses the type
316
325
  | `any` type | Use `unknown` or proper interfaces |
317
326
  | Hardcoded colors/spacing | Design System tokens must be used |
318
327
  | Non-responsive layout | Mobile-first and ultra-wide support are mandatory |
319
- | Manual fetch without caching (React Query) | Bypassing caching layer causes request duplicate bloat |
320
- | Deploying critical features without feature flags | Higher risk of breaking production workflows |
321
328
 
322
329
  ---
323
330
 
324
- **Agent Completion Report**
331
+ **Agent Completion Report**
325
332
 
326
333
  - Mock used? [ ] No / [ ] Yes
327
334
  - App types imported? [ ] No / [ ] Yes