agent-enderun 0.4.7 → 0.5.1

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 (41) hide show
  1. package/.enderun/PROJECT_MEMORY.md +15 -1
  2. package/.enderun/docs/tech-stack.md +38 -10
  3. package/.enderun/knowledge/branded_types_pattern.md +7 -0
  4. package/.enderun/knowledge/hermes_protocol.md +59 -0
  5. package/.enderun/knowledge/zero_ui_library_policy.md +8 -4
  6. package/ENDERUN.md +11 -6
  7. package/README.md +62 -51
  8. package/bin/cli.js +8 -10
  9. package/bin/update-contract.js +44 -0
  10. package/claude.md +4 -1
  11. package/codex.md +4 -1
  12. package/cursor.md +4 -1
  13. package/gemini.md +4 -1
  14. package/package.json +10 -8
  15. package/packages/framework-mcp/dist/index.js +2 -1
  16. package/packages/framework-mcp/dist/schemas.js +14 -0
  17. package/packages/framework-mcp/dist/tools/framework.js +25 -0
  18. package/packages/framework-mcp/dist/tools/knowledge.js +75 -11
  19. package/packages/framework-mcp/dist/tools/memory.js +3 -1
  20. package/packages/framework-mcp/dist/tools/messages.js +61 -8
  21. package/packages/framework-mcp/dist/tools/repository.js +6 -2
  22. package/packages/framework-mcp/dist/utils.js +3 -3
  23. package/packages/framework-mcp/package.json +1 -1
  24. package/packages/framework-mcp/src/index.ts +2 -1
  25. package/packages/framework-mcp/src/schemas.ts +18 -0
  26. package/packages/framework-mcp/src/tools/academy.ts +17 -11
  27. package/packages/framework-mcp/src/tools/codebase.ts +5 -5
  28. package/packages/framework-mcp/src/tools/contract.ts +3 -3
  29. package/packages/framework-mcp/src/tools/database.ts +1 -1
  30. package/packages/framework-mcp/src/tools/framework.ts +29 -5
  31. package/packages/framework-mcp/src/tools/git.ts +1 -1
  32. package/packages/framework-mcp/src/tools/index.ts +1 -1
  33. package/packages/framework-mcp/src/tools/knowledge.ts +88 -14
  34. package/packages/framework-mcp/src/tools/memory.ts +5 -3
  35. package/packages/framework-mcp/src/tools/messages.ts +81 -13
  36. package/packages/framework-mcp/src/tools/repository.ts +8 -3
  37. package/packages/framework-mcp/src/tools/security.ts +2 -2
  38. package/packages/framework-mcp/src/utils.ts +3 -3
  39. package/packages/shared-types/contract.version.json +7 -4
  40. package/packages/shared-types/package.json +1 -1
  41. package/.enderun/ENDERUN.md +0 -205
@@ -1,205 +0,0 @@
1
- # Agent Enderun (v0.4.7)
2
- # Place in project root. This file is the single source of truth for Base Project AI Extensions.
3
-
4
- ## 🎖️ AGENT CHECKLIST (MANDATORY BEFORE RESPONSE)
5
- > Check this list at the end of every response:
6
- > - [ ] **Zero Mock:** Did you use fake data or placeholders? (Strictly Forbidden)
7
- > - [ ] **Contract First:** Are `shared-types` and `contract.version.json` up to date?
8
- > - [ ] **Audit Log:** Did you log this action in `{{FRAMEWORK_DIR}}/logs/[agent].json`?
9
- > - [ ] **CLI Orchestration:** Does the action comply with `gemini cli` rules?
10
- > - [ ] **No "..." allowed:** Did you write the code completely without omitting parts?
11
-
12
- ---
13
-
14
- ## Constitution Status
15
- 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/`.
16
-
17
- ---
18
-
19
- ## STEP 0 — STARTUP (EVERY SESSION, NON-NEGOTIABLE)
20
-
21
- 1. **Read ./{{ADAPTER}}.md First:** Read and fully understand this file before taking any action.
22
- 2. **Check `{{FRAMEWORK_DIR}}/docs/` Folder:** Verify the existence of the `{{FRAMEWORK_DIR}}/docs/` folder (located within the framework directory).
23
- 3. **Absorb Context:** Read `{{FRAMEWORK_DIR}}/docs/tech-stack.md`. If it is empty, ask the user to fill it before proceeding.
24
- 4. **Demand Context:** If the `{{FRAMEWORK_DIR}}/docs/` folder does not exist, ask the user for project context and target audience information before writing any code.
25
- 5. Default Frontend: React 19 + Vite (SPA) + react-router-dom (User Preference)
26
-
27
- **NEVER SKIP THIS STEP.** Do not assume context; read first, then act.
28
-
29
- ---
30
-
31
- ## CORE PRINCIPLES
32
-
33
- - **Agent Academy Focus:** This repository is dedicated to the development and evolution of AI Agents. All actions must aim to improve agent intelligence, autonomy, and procedural continuity.
34
- - **Zero-Request Logging Policy:** Agents MUST log every action and update `PROJECT_MEMORY.md` automatically at the end of every turn, without waiting for a user directive. This is the "Operating Mode" of the framework.
35
- - **Immediate Memory Sync:** Every state change, decision, or improved capability must be reflected in the memory files immediately.
36
- - **Contract-First Agent Evolution:** Tools and SOPs used by agents must be defined via schemas and contracts first.
37
- - **Zero Mock Policy:** The use of fake (mock) data or placeholders is strictly forbidden. Every line of code must connect to a real endpoint or a typed contract. (Exception: Controlled mock usage is allowed for external 3rd party services like Stripe, Twilio).
38
- - **Branded Types Law:** All IDs (UserID, ProjectID, etc.) must be in the "Branded Types" format defined under `packages/shared-types`. Using plain strings or numbers is forbidden.
39
- - **CLI-First Policy:** Due to the AI CLI Assistant focus, all outputs must be user-friendly (using Chalk, Clack, etc.) and stream-based. All commands must support the `--output json` flag and produce machine-readable output.
40
- - **Audit Logging Necessity:** Every critical action must be logged traceably under the `{{FRAMEWORK_DIR}}/logs/` folder.
41
- - **Design Continuity & Response Policy:** All UI changes MUST be responsive (Mobile-First + Fluid) and surgical. Unnecessary overhauls of existing layouts are strictly forbidden.
42
- - **Shared Component First Policy:** Defining common UI elements (Button, Input, Card, etc.) inside page files is FORBIDDEN. All atomic UI components must be created in a shared directory (e.g., `apps/web/src/components/ui/`) and reused across the project.
43
- - **File Ownership Rule:** Each file is the responsibility of a single agent.
44
- - **CLI Command Mapping:** All CLI commands in the project must be defined in the `{{FRAMEWORK_DIR}}/cli-commands.json` file and assigned to the relevant agent.
45
- - **Exit Code Standard:** Standard exit codes (e.g., 64: User Error, 70: Internal Error) must be used in error situations.
46
- - **Phase-Based Execution:** The development process must progress through defined Phases. You cannot move to the next phase until the current one is completed.
47
- - **CLI-Driven Orchestration:** All agent interactions and task delegations must be traceable via `gemini cli`.
48
- - **Monorepo Discipline:** Commands must always be run from the monorepo root directory using npm workspaces (e.g., `npm run dev --workspace=web`).
49
-
50
- ---
51
-
52
- ## STEP 1 — VALIDATE BEFORE ACTING
53
-
54
- Before writing any code or design, check `{{FRAMEWORK_DIR}}/docs/tech-stack.md`:
55
-
56
- | Unknown | Action |
57
- |---|---|
58
- | Target Audience | Ask — do not proceed |
59
- | Platform (web / mobile / desktop / backend) | Ask — do not proceed |
60
- | **Technology Stack** | **Check `{{FRAMEWORK_DIR}}/docs/tech-stack.md` → If missing → ASK** |
61
- | **Execution Profile (Full / Lightweight)** | **Ask — do not proceed** |
62
- | Database (MariaDB / SQLite / PostgreSQL) | Ask — do not proceed |
63
- | Environment (prototype / production) | Ask — do not proceed |
64
- | Auth required? | Ask — do not proceed |
65
- | Monorepo or separate repos? | Ask — do not proceed |
66
- | Deploy target (Vercel / Docker / Bare metal)? | Ask — do not proceed |
67
- | i18n (multi-language) required? | Ask — do not proceed |
68
- | API versioning strategy? | Ask — do not proceed |
69
- | Accessibility level (WCAG AA / AAA)? | Default AA — ask if different |
70
- | Scope too broad ("build the whole app") | Break into parts → confirm each part |
71
-
72
- Small details (port, filename, folder name) → assume and state them.
73
-
74
- Always write assumptions at the top of your response:
75
- ```
76
- Assumption: [what] — [why]
77
- ```
78
-
79
- ---
80
-
81
- ## OUTPUT FLOWS (MANDATORY STANDARDS)
82
-
83
- Every agent must use the **Mandatory Output Flow** defined in their specific `.md` file. However, the following sections are mandatory in all outputs:
84
-
85
- - **Assumptions:** All assumptions made.
86
- - **Problem:** What is being built and why (Max 2-3 sentences).
87
- - **File Tree:** Complete folder and file structure.
88
- - **Code:** Complete code content (using "..." is forbidden).
89
- - **Audit Logging:** How the changes are logged.
90
- - **Tests:** Test file for every service and utility.
91
-
92
- ---
93
-
94
- ## ABSOLUTE DON'TS — APPLIES TO EVERY RESPONSE
95
-
96
- - **`any` Type is Forbidden:** The use of `any` is strictly forbidden in TypeScript projects.
97
- - **`console.log` is Forbidden:** `console.log` cannot be present in production code.
98
- - **Mock Data is Forbidden:** Sahte (mock) veri veya yer tutucu kullanımı kesinlikle yasaktır. Her kod satırı gerçek bir uç noktaya veya tiplendirilmiş bir kontrata bağlanmalıdır. (İstisna: Stripe, Twilio gibi harici 3. taraf servisler için kontrollü mock kullanımına izin verilir).
99
- - **File Ownership Violation:** Making unauthorized changes in files outside your scope is forbidden.
100
- - **Security Rule Violation:** Violating security protocols is strictly forbidden.
101
- - **Hardcoded Secrets:** Embedding API keys or env variables inside the code is forbidden.
102
- - **Raw SQL Strings:** Direct strings cannot be used for SQL queries; strictly use `Kysely`.
103
- - **Direct DB call in a controller:** Database operations cannot be performed directly inside a Controller.
104
- - **Missing try/catch on async operations:** Error handling (try/catch) is mandatory for asynchronous operations.
105
-
106
- ---
107
-
108
- ## LANGUAGE POLICY
109
-
110
- - Code comments: English (Explain why it was done, not what it does).
111
- - Variable / function / class / file names: English.
112
- - User-facing UI text: English (Default).
113
- - Communication: English by default (Global rule).
114
-
115
- ---
116
-
117
- ## EXECUTION PROFILES
118
-
119
- Depending on the size and complexity of the project, there are two execution profiles. The Team Lead must determine this profile at the start of the project:
120
-
121
- - **Lightweight Profile (MVP):** Only `team-lead`, `backend-architect`, `frontend-specialist`, and `design-specialist` are active. Mandatory for rapid prototyping, small projects, and low-budget work. Mobile, desktop, and test agents are bypassed.
122
- - **Full Profile (Enterprise):** team-lead, backend-architect, frontend-specialist, design-specialist, test-engineer
123
-
124
- ---
125
-
126
- ## API & CONTRACT MANAGEMENT
127
-
128
- ### 1. contract.version.json Standard
129
- This file is the single source of truth for API stability. `@backend-architect` is responsible for its integrity.
130
-
131
- ```json
132
- {
133
- "version": "MAJOR.MINOR",
134
- "last_updated": "ISO-8601",
135
- "contract_hash": "sha256-hash-of-shared-types",
136
- "breaking_changes": [
137
- { "version": "1.0", "description": "Initial stable release" }
138
- ],
139
- "deprecated_versions": []
140
- }
141
- ```
142
- - **MAJOR:** Incremented on breaking changes (Phase Rollback required).
143
- - **MINOR:** Incremented on additive changes (New fields/endpoints).
144
-
145
- ---
146
-
147
- ## STATE MACHINE & EXECUTION PHASES
148
-
149
- The development process follows a strict State Machine. Transition to the next phase is prohibited until the "Success Criteria" of the current phase is met.
150
-
151
- - **[STATE: PHASE_0] Discovery & Setup:** Profile selection (Lightweight/Full), requirement analysis, and validating `{{FRAMEWORK_DIR}}/docs/tech-stack.md`.
152
- - **[STATE: PHASE_1] Architecture & Contracts:** Setup of data models, API schemas, and `packages/shared-types`. Cannot proceed until Frontend and Backend approve these schemas.
153
- - **[STATE: PHASE_2] Core Development:** Active agents build core features in parallel based on the selected profile. (Under the apps/ folder)
154
- - **[STATE: PHASE_3] Integration & Testing:** System integration.
155
- - **[STATE: PHASE_4] Optimization & Deployment:** Performance audit and deployment.
156
-
157
- **Rollback Rule:** If a missing field or error is detected in the API schema (`shared-types`) during Phase 2 or later, the system immediately transitions to `[STATE: ROLLBACK_PHASE_1]`. All relevant agents stop their processes, switch to `WAITING` state, and cannot return to Phase 2 until the `backend-architect` resolves the issues.
158
-
159
- ---
160
-
161
- ## AGENT TIMEOUT & ESCALATION
162
-
163
- Every agent must produce a response for their assigned task within a maximum of 30 minutes (or the time defined per project). Upon timeout, `task-specialist` automatically moves the relevant task to `BLOCKED` status and leaves an escalation message for the `@team-lead`.
164
-
165
- ---
166
-
167
- ## CLI STANDARDS & CONFIGURATION
168
-
169
- ### 1. CLI Command Map (`{{FRAMEWORK_DIR}}/cli-commands.json`)
170
- All CLI commands are centrally managed in this file. Each command must have a designated owner agent.
171
-
172
- ### 2. Configuration (`{{FRAMEWORK_DIR}}/config.json`)
173
- CLI behaviors (logLevel, outputFormat, defaultProfile) are managed through this file.
174
-
175
- **Priority Rule:** CLI Flags > `{{FRAMEWORK_DIR}}/config.json` > `.env` > Default Values.
176
-
177
- ### 3. Exit Codes
178
- - `0`: Success
179
- - `64`: User Error (Invalid argument, missing parameter)
180
- - `70`: Internal Error (Software error, crash)
181
- - `71`: Connection/Network Error
182
-
183
- ---
184
-
185
- ## API VERSIONING STRATEGY
186
-
187
- All APIs are versioned via the URL path (`/api/v1/...`). The `packages/shared-types/contract.version.json` file uses the MAJOR.MINOR format, and must be updated with every change. The `@backend-architect` is responsible for its accuracy. The MAJOR version is incremented for every breaking change. Old versions continue to be supported for at least 1 MAJOR release.
188
-
189
- ---
190
-
191
- ## PARALLEL EXECUTION & COORDINATION RULES
192
-
193
- 1. **Shared-Types as Source of Truth:** All agents reference `packages/shared-types` and the `contract.version.json` file.
194
- 2. **Commit-Level Logging:** Every agent must log every atomic change to the `{{FRAMEWORK_DIR}}/logs/[agent-name].json` file.
195
- 3. **Implicit Dependency Lock:** If an agent's required output is not ready, it switches to `WAITING` state.
196
- 4. **Ownership Enforcement:** Changes to files outside an agent's scope cannot be made without `@team-lead` approval.
197
- 5. **No Blind Coding:** Agents must periodically read `{{FRAMEWORK_DIR}}/logs/` and `{{FRAMEWORK_DIR}}/STATUS.md`.
198
- 6. **Agent Directives (Message Queue):** `{{FRAMEWORK_DIR}}/messages/` is used for inter-agent communication.
199
- - **Message Queue Lock Protocol:** Before writing to a file, check for `{{FRAMEWORK_DIR}}/messages/.lock`.
200
- - If it exists, wait 500ms and retry (max 3 retries).
201
- - If lock persists after 3 retries, the agent MUST assume a **stale lock**, delete it, and notify `@team-lead` in their log.
202
- - Delete `.lock` and the message file immediately after processing.
203
- 7. **Phase Rollback Protocol:** If contracts are insufficient, return to Phase 1. All agents become `WAITING` and write `CONTRACT_CHANGED` to their log.
204
- 8. **Next.js Ownership Rule:** `apps/web/api/` and `server/actions/` -> @backend-architect. `apps/web/(routes)/` and `components/` -> @frontend-specialist.
205
- 9. **Zero Mock Test Policy:** Real database usage via Docker (TestContainers) is mandatory for integration tests.