agent-enderun 1.1.5 → 1.1.7
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.md +13 -10
- package/README.md +14 -31
- package/bin/run-multi-test.js +77 -0
- package/dist/framework-mcp/src/tools/dashboard/start_dashboard.d.ts +5 -0
- package/dist/framework-mcp/src/tools/dashboard/start_dashboard.js +30 -0
- package/dist/framework-mcp/src/tools/dashboard/start_dashboard.js.map +1 -0
- package/dist/framework-mcp/src/tools/definitions.js +118 -0
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +5 -0
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +51 -0
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -0
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +8 -4
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.js +3 -0
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/audit_deps.d.ts +6 -0
- package/dist/framework-mcp/src/tools/framework/audit_deps.js +42 -0
- package/dist/framework-mcp/src/tools/framework/audit_deps.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/run_tests.d.ts +5 -0
- package/dist/framework-mcp/src/tools/framework/run_tests.js +26 -0
- package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -0
- package/dist/framework-mcp/src/tools/index.js +24 -0
- package/dist/framework-mcp/src/tools/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/memory/get_insights.d.ts +6 -0
- package/dist/framework-mcp/src/tools/memory/get_insights.js +35 -0
- package/dist/framework-mcp/src/tools/memory/get_insights.js.map +1 -0
- package/dist/framework-mcp/src/tools/memory/read_memory.d.ts +6 -0
- package/dist/framework-mcp/src/tools/memory/read_memory.js +29 -0
- package/dist/framework-mcp/src/tools/memory/read_memory.js.map +1 -0
- package/dist/framework-mcp/src/tools/messaging/send_message.js +1 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.d.ts +5 -0
- package/dist/framework-mcp/src/tools/observability/check_ports.js +27 -0
- package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -0
- package/dist/framework-mcp/src/tools/observability/get_health.d.ts +5 -0
- package/dist/framework-mcp/src/tools/observability/get_health.js +21 -0
- package/dist/framework-mcp/src/tools/observability/get_health.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/get_gaps.d.ts +6 -0
- package/dist/framework-mcp/src/tools/search/get_gaps.js +49 -0
- package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/get_map.d.ts +6 -0
- package/dist/framework-mcp/src/tools/search/get_map.js +45 -0
- package/dist/framework-mcp/src/tools/search/get_map.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/grep_search.d.ts +5 -0
- package/dist/framework-mcp/src/tools/search/grep_search.js +60 -0
- package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/list_dir.d.ts +5 -0
- package/dist/framework-mcp/src/tools/search/list_dir.js +29 -0
- package/dist/framework-mcp/src/tools/search/list_dir.js.map +1 -0
- package/dist/framework-mcp/src/tools/types.d.ts +10 -5
- package/dist/framework-mcp/src/utils/compliance.d.ts +5 -0
- package/dist/framework-mcp/src/utils/compliance.js +30 -0
- package/dist/framework-mcp/src/utils/compliance.js.map +1 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +5 -5
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
- package/dist/src/cli/adapters/types.d.ts +2 -2
- package/dist/src/cli/adapters.d.ts +1 -1
- package/dist/src/cli/adapters.js +45 -77
- package/dist/src/cli/adapters.js.map +1 -1
- package/dist/src/cli/commands/check.js +52 -6
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/init.d.ts +5 -1
- package/dist/src/cli/commands/init.js +184 -106
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +3 -3
- package/dist/src/cli/commands/orchestrate.js +14 -8
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/status.js +3 -2
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/index.js +4 -3
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/shims.js +6 -6
- package/dist/src/cli/utils/app-backend.d.ts +2 -0
- package/dist/src/cli/utils/app-backend.js +236 -0
- package/dist/src/cli/utils/app-backend.js.map +1 -0
- package/dist/src/cli/utils/app-docs.d.ts +3 -0
- package/dist/src/cli/utils/app-docs.js +59 -0
- package/dist/src/cli/utils/app-docs.js.map +1 -0
- package/dist/src/cli/utils/app-frontend.d.ts +2 -0
- package/dist/src/cli/utils/app-frontend.js +248 -0
- package/dist/src/cli/utils/app-frontend.js.map +1 -0
- package/dist/src/cli/utils/app-inferrer.d.ts +14 -0
- package/dist/src/cli/utils/app-inferrer.js +39 -0
- package/dist/src/cli/utils/app-inferrer.js.map +1 -0
- package/dist/src/cli/utils/app-types.d.ts +3 -0
- package/dist/src/cli/utils/app-types.js +233 -0
- package/dist/src/cli/utils/app-types.js.map +1 -0
- package/dist/src/cli/utils/app.d.ts +5 -32
- package/dist/src/cli/utils/app.js +5 -794
- package/dist/src/cli/utils/app.js.map +1 -1
- package/dist/src/cli/utils/memory.js +8 -4
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/modules/adapters/antigravity-cli.js +3 -3
- package/dist/src/modules/adapters/antigravity-cli.js.map +1 -1
- package/dist/src/modules/adapters/claude.js +1 -1
- package/dist/src/modules/adapters/claude.js.map +1 -1
- package/dist/src/modules/adapters/codex.js +2 -2
- package/dist/src/modules/adapters/codex.js.map +1 -1
- package/dist/src/modules/adapters/cursor.js +1 -1
- package/dist/src/modules/adapters/cursor.js.map +1 -1
- package/dist/src/modules/adapters/definitions.d.ts +9 -0
- package/dist/src/modules/adapters/definitions.js +124 -0
- package/dist/src/modules/adapters/definitions.js.map +1 -0
- package/dist/src/modules/adapters/gemini.js +2 -2
- package/dist/src/modules/adapters/gemini.js.map +1 -1
- package/dist/src/modules/adapters/grok.js +1 -1
- package/dist/src/modules/adapters/grok.js.map +1 -1
- package/dist/src/modules/agents/definitions.js +26 -27
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/shared/config.d.ts +3 -3
- package/dist/src/shared/logger.js +8 -5
- package/dist/src/shared/logger.js.map +1 -1
- package/dist/tests/adapter.test.d.ts +1 -0
- package/dist/tests/adapter.test.js +129 -0
- package/dist/tests/adapter.test.js.map +1 -0
- package/dist/tests/agents-definitions.test.d.ts +1 -0
- package/dist/tests/agents-definitions.test.js +54 -0
- package/dist/tests/agents-definitions.test.js.map +1 -0
- package/dist/tests/approve.test.d.ts +1 -0
- package/dist/tests/approve.test.js +88 -0
- package/dist/tests/approve.test.js.map +1 -0
- package/dist/tests/config.test.d.ts +1 -0
- package/dist/tests/config.test.js +58 -0
- package/dist/tests/config.test.js.map +1 -0
- package/dist/tests/container.runner.d.ts +1 -0
- package/dist/tests/container.runner.js +68 -0
- package/dist/tests/container.runner.js.map +1 -0
- package/dist/tests/container.test.d.ts +1 -0
- package/dist/tests/container.test.js +73 -0
- package/dist/tests/container.test.js.map +1 -0
- package/dist/tests/errors.test.d.ts +1 -0
- package/dist/tests/errors.test.js +64 -0
- package/dist/tests/errors.test.js.map +1 -0
- package/dist/tests/fs-utils.test.d.ts +1 -0
- package/dist/tests/fs-utils.test.js +101 -0
- package/dist/tests/fs-utils.test.js.map +1 -0
- package/dist/tests/logger.test.d.ts +1 -0
- package/dist/tests/logger.test.js +81 -0
- package/dist/tests/logger.test.js.map +1 -0
- package/dist/tests/memory-utils.test.d.ts +1 -0
- package/dist/tests/memory-utils.test.js +173 -0
- package/dist/tests/memory-utils.test.js.map +1 -0
- package/dist/tests/orchestrate.test.d.ts +1 -0
- package/dist/tests/orchestrate.test.js +131 -0
- package/dist/tests/orchestrate.test.js.map +1 -0
- package/dist/tests/skills-definitions.test.d.ts +1 -0
- package/dist/tests/skills-definitions.test.js +34 -0
- package/dist/tests/skills-definitions.test.js.map +1 -0
- package/dist/tests/status.test.d.ts +1 -0
- package/dist/tests/status.test.js +105 -0
- package/dist/tests/status.test.js.map +1 -0
- package/dist/tests/string.test.d.ts +1 -0
- package/dist/tests/string.test.js +89 -0
- package/dist/tests/string.test.js.map +1 -0
- package/dist/tests/time.test.d.ts +1 -0
- package/dist/tests/time.test.js +48 -0
- package/dist/tests/time.test.js.map +1 -0
- package/dist/tests/trace.test.d.ts +1 -0
- package/dist/tests/trace.test.js +61 -0
- package/dist/tests/trace.test.js.map +1 -0
- package/dist/vitest.config.js +1 -0
- package/dist/vitest.config.js.map +1 -1
- package/docs/getting-started.md +4 -0
- package/docs/user/corporate-governance.md +25 -0
- package/framework-mcp/dist/tools/dashboard/start_dashboard.js +29 -0
- package/framework-mcp/dist/tools/definitions.js +118 -0
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +50 -0
- package/framework-mcp/dist/tools/file_system/replace_text.js +8 -4
- package/framework-mcp/dist/tools/file_system/write_file.js +3 -0
- package/framework-mcp/dist/tools/framework/audit_deps.js +41 -0
- package/framework-mcp/dist/tools/framework/run_tests.js +25 -0
- package/framework-mcp/dist/tools/index.js +24 -0
- package/framework-mcp/dist/tools/memory/get_insights.js +34 -0
- package/framework-mcp/dist/tools/memory/read_memory.js +28 -0
- package/framework-mcp/dist/tools/messaging/send_message.js +1 -1
- package/framework-mcp/dist/tools/observability/check_ports.js +26 -0
- package/framework-mcp/dist/tools/observability/get_health.js +20 -0
- package/framework-mcp/dist/tools/search/get_gaps.js +48 -0
- package/framework-mcp/dist/tools/search/get_map.js +44 -0
- package/framework-mcp/dist/tools/search/grep_search.js +59 -0
- package/framework-mcp/dist/tools/search/list_dir.js +28 -0
- package/framework-mcp/dist/utils/compliance.js +29 -0
- package/framework-mcp/package.json +1 -1
- package/framework-mcp/src/tools/dashboard/start_dashboard.ts +33 -0
- package/framework-mcp/src/tools/definitions.ts +118 -0
- package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +70 -0
- package/framework-mcp/src/tools/file_system/replace_text.ts +10 -4
- package/framework-mcp/src/tools/file_system/write_file.ts +5 -0
- package/framework-mcp/src/tools/framework/audit_deps.ts +49 -0
- package/framework-mcp/src/tools/framework/run_tests.ts +28 -0
- package/framework-mcp/src/tools/index.ts +24 -0
- package/framework-mcp/src/tools/memory/get_insights.ts +41 -0
- package/framework-mcp/src/tools/memory/read_memory.ts +31 -0
- package/framework-mcp/src/tools/messaging/send_message.ts +1 -1
- package/framework-mcp/src/tools/observability/check_ports.ts +30 -0
- package/framework-mcp/src/tools/observability/get_health.ts +25 -0
- package/framework-mcp/src/tools/search/get_gaps.ts +54 -0
- package/framework-mcp/src/tools/search/get_map.ts +50 -0
- package/framework-mcp/src/tools/search/grep_search.ts +66 -0
- package/framework-mcp/src/tools/search/list_dir.ts +34 -0
- package/framework-mcp/src/tools/types.ts +11 -1
- package/framework-mcp/src/utils/compliance.ts +37 -0
- package/framework-mcp/tests/tools/messaging/send_message.test.ts +5 -5
- package/package.json +3 -3
- package/src/cli/adapters/types.ts +2 -2
- package/src/cli/adapters.ts +45 -80
- package/src/cli/commands/check.ts +52 -6
- package/src/cli/commands/init.ts +193 -114
- package/src/cli/commands/orchestrate.ts +14 -8
- package/src/cli/commands/status.ts +3 -2
- package/src/cli/index.ts +4 -3
- package/src/cli/shims.ts +6 -6
- package/src/cli/utils/app-backend.ts +249 -0
- package/src/cli/utils/app-docs.ts +65 -0
- package/src/cli/utils/app-frontend.ts +257 -0
- package/src/cli/utils/app-inferrer.ts +53 -0
- package/src/cli/utils/app-types.ts +243 -0
- package/src/cli/utils/app.ts +5 -849
- package/src/cli/utils/memory.ts +8 -4
- package/src/modules/adapters/definitions.ts +125 -0
- package/src/modules/agents/definitions.ts +26 -27
- package/src/shared/logger.ts +8 -5
- package/templates/prompts/bug-fix-recipe.md +20 -0
- package/templates/prompts/new-feature-recipe.md +19 -0
- package/templates/prompts/refactoring-recipe.md +21 -0
- package/templates/standards/architecture-standards.md +23 -0
- package/templates/standards/crud-governance.md +21 -0
- package/templates/standards/frontend-standards.md +38 -0
- package/templates/standards/i18n-standards.md +17 -0
- package/templates/standards/logging-and-secrets.md +29 -0
- package/templates/standards/mobile-standards.md +24 -0
- package/templates/standards/quality-standards.md +31 -0
- package/templates/standards/security-standards.md +21 -0
- package/templates/standards/tailwind-standards.md +20 -0
- package/templates/standards/testing-standards.md +31 -0
- package/src/modules/adapters/antigravity-cli.ts +0 -25
- package/src/modules/adapters/claude.ts +0 -36
- package/src/modules/adapters/codex.ts +0 -22
- package/src/modules/adapters/cursor.ts +0 -22
- package/src/modules/adapters/gemini.ts +0 -27
- package/src/modules/adapters/grok.ts +0 -20
- package/templates/architecture/agents-manifest.md +0 -79
- package/templates/architecture/approval-flows.md +0 -61
- package/templates/architecture/enterprise-architecture.md +0 -69
- package/templates/architecture/standards/crud-governance.md +0 -46
- package/templates/architecture/standards/data-fetching-patterns.md +0 -13
- package/templates/architecture/standards/design-system.md +0 -31
- package/templates/architecture/standards/documentation-ownership.md +0 -21
- package/templates/architecture/standards/logging.md +0 -7
- package/templates/architecture/standards/mobile-standards.md +0 -48
- package/templates/architecture/standards/tech-stack.md +0 -9
- package/templates/backend/error-handling.md +0 -74
- package/templates/frontend/component-patterns.md +0 -91
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# ⚖️ Kurumsal Kod Kalitesi ve Disiplini (Linting & Standards)
|
|
2
|
+
|
|
3
|
+
Bu belge, Agent Enderun ordusu tarafından üretilen tüm kodların uyması gereken teknik disiplin kurallarını tanımlar. Amaç; sıfır hata, maksimum okunabilirlik ve sürdürülebilirliktir.
|
|
4
|
+
|
|
5
|
+
## 1. TypeScript Disiplini
|
|
6
|
+
- **Strict Mode:** Tüm projelerde `strict: true` zorunludur.
|
|
7
|
+
- **No Explicit Any:** `any` kullanımı kesinlikle yasaktır. Belirsiz tipler için `unknown` kullanılmalı ve tip muhafazaları (type guards) ile doğrulanmalıdır.
|
|
8
|
+
- **Exhaustive Checks:** `switch-case` yapılarında tüm durumlar (exhaustive) kontrol edilmeli veya `never` tipi ile güvenlik sağlanmalıdır.
|
|
9
|
+
|
|
10
|
+
## 2. ESLint ve Statik Analiz
|
|
11
|
+
- **Zero Warnings:** Kod tabanında hiçbir ESLint uyarısı (warning) veya hatası (error) bulunamaz.
|
|
12
|
+
- **Naming Conventions:**
|
|
13
|
+
- Değişkenler ve fonksiyonlar: `camelCase`
|
|
14
|
+
- Sınıflar ve Tipler: `PascalCase`
|
|
15
|
+
- Sabitler: `UPPER_SNAKE_CASE`
|
|
16
|
+
- Dosya isimleri: `kebab-case`
|
|
17
|
+
- **Imports:** Kullanılmayan importlar otomatik olarak temizlenmeli ve import sırası düzenli olmalıdır.
|
|
18
|
+
|
|
19
|
+
## 3. Formatlama (Prettier)
|
|
20
|
+
- **Consistency:** Tüm dosyalarda tek tip formatlama zorunludur.
|
|
21
|
+
- **Indentation:** 4 boşluk (4 spaces).
|
|
22
|
+
- **Quotes:** Çift tırnak (`"`) kullanımı.
|
|
23
|
+
- **Semicolons:** Her ifade noktalı virgül (`;`) ile bitmelidir.
|
|
24
|
+
|
|
25
|
+
## 4. Hata Yönetimi (Error Handling)
|
|
26
|
+
- **No Silent Failures:** Boş `catch` blokları yasaktır. Her hata en azından loglanmalı veya üst katmana iletilmelidir.
|
|
27
|
+
- **Custom Errors:** İş mantığı hataları için projeye özgü `AppError` sınıfları kullanılmalıdır.
|
|
28
|
+
|
|
29
|
+
## 5. Denetim Döngüsü
|
|
30
|
+
- **Pre-commit:** Kod commit edilmeden önce mutlaka `npm run lint` ve `npm run type-check` çalıştırılmalıdır.
|
|
31
|
+
- **@quality Audit:** Tüm değişiklikler `@quality` ajanı tarafından bu standartlara göre denetlenir.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# 🛡️ Kurumsal Güvenlik ve Veri Koruma Standartları
|
|
2
|
+
|
|
3
|
+
Bu belge, Agent Enderun tarafından yönetilen projelerdeki güvenlik protokollerini ve veri koruma standartlarını tanımlar.
|
|
4
|
+
|
|
5
|
+
## 1. Veri Tabanı Güvenliği (RLS)
|
|
6
|
+
- **Row Level Security (RLS):** Tüm kullanıcı verileri RLS politikaları ile korunmalıdır. Bir kullanıcı, `@manager` tarafından onaylanmış bir izin protokolü dışında başka bir kullanıcının verisine erişemez.
|
|
7
|
+
- **SQL Injection:** Ham SQL sorguları kesinlikle yasaktır (Kysely zorunluluğu).
|
|
8
|
+
- **Encryption at Rest:** Hassas veriler (PII) veritabanında şifrelenmiş olarak saklanmalıdır.
|
|
9
|
+
|
|
10
|
+
## 2. Kimlik Doğrulama ve Yetkilendirme
|
|
11
|
+
- **JWT / Session:** Sadece `@security` ajanı tarafından onaylanmış güvenli kimlik doğrulama yöntemleri kullanılır.
|
|
12
|
+
- **Role Based Access Control (RBAC):** Yetkilendirme şemaları `apps/backend/src/security/roles.ts` altında merkezi olarak yönetilmelidir.
|
|
13
|
+
|
|
14
|
+
## 3. API Güvenliği
|
|
15
|
+
- **CORS:** Sadece izin verilen domainler API'ye erişebilir.
|
|
16
|
+
- **Rate Limiting:** Tüm API uç noktaları için rate limiting uygulanmalıdır.
|
|
17
|
+
- **Input Validation:** Zod veya benzeri bir kütüphane ile tüm girdiler (request body, params) sıkı bir şekilde doğrulanmalıdır.
|
|
18
|
+
|
|
19
|
+
## 4. Sır Yönetimi (Secret Management)
|
|
20
|
+
- **No Hardcoded Secrets:** API anahtarları, şifreler veya gizli anahtarlar asla kod içinde saklanamaz.
|
|
21
|
+
- **.env Discipline:** Tüm gizli değişkenler `.env` dosyası üzerinden yönetilmeli ve bu dosya asla git'e pushlanmamalıdır.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 🌊 Kurumsal Tailwind CSS Standartları
|
|
2
|
+
|
|
3
|
+
Bu belge, Tailwind CSS kullanılan projelerde kod kalitesini ve tasarım disiplinini korumak için gereken kuralları tanımlar.
|
|
4
|
+
|
|
5
|
+
## 1. Tasarım Disiplini ve Kısıtlamalar
|
|
6
|
+
- **No Arbitrary Values:** `h-[123px]` veya `bg-[#fafafa]` gibi rastgele değerler kullanılması yasaktır. Tüm değerler `tailwind.config.ts` içindeki temadan beslenmelidir.
|
|
7
|
+
- **Utility-First, Not Utility-Only:** Çok karmaşıklaşan class yapıları `@apply` ile veya bileşenlere bölünerek (Atomic Design) yönetilmelidir.
|
|
8
|
+
- **Prettier Plugin:** Sınıf sıralaması için mutlaka `prettier-plugin-tailwindcss` kullanılmalıdır.
|
|
9
|
+
|
|
10
|
+
## 2. Responsive ve Mobil-First
|
|
11
|
+
- **Mobile-First:** Stiller önce mobil için yazılmalı, ardından `sm:`, `md:`, `lg:` prefixleri ile genişletilmelidir.
|
|
12
|
+
- **Consistency:** Proje genelinde tutarlı breakpoint kullanımı (standard Tailwind breakpoints) zorunludur.
|
|
13
|
+
|
|
14
|
+
## 3. Temiz Kod ve Organizasyon
|
|
15
|
+
- **Clean Templates:** HTML/JSX içinde 10'dan fazla Tailwind sınıfı varsa, bu sınıflar `cva` (Class Variance Authority) veya `clsx`/`tailwind-merge` gibi araçlarla organize edilmelidir.
|
|
16
|
+
- **Component Isolation:** UI bileşenleri `apps/web/src/components/ui/` altında toplanmalı ve her bileşen kendi Tailwind sınıflarını barındırmalıdır.
|
|
17
|
+
|
|
18
|
+
## 4. Performans ve Erişilebilirlik
|
|
19
|
+
- **JIT Mode:** Her zaman Just-in-Time mode kullanılmalıdır.
|
|
20
|
+
- **Contrast:** Tema renkleri seçilirken WCAG AA standartlarına uyulmalıdır.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# 🧪 Kurumsal Test Standartları
|
|
2
|
+
|
|
3
|
+
Bu belge, Agent Enderun tarafından yönetilen projelerdeki test disiplini ve kapsam kurallarını tanımlar. Kod kalitesi, otomatik testlerle güvence altına alınmalıdır.
|
|
4
|
+
|
|
5
|
+
## 1. Test Piramidi ve Stratejisi
|
|
6
|
+
- **Unit Tests (Birim Testler):** İş mantığının (Business Logic) en küçük parçaları için yazılır. Hızlı ve izole olmalıdır.
|
|
7
|
+
- **Integration Tests (Entegrasyon Testleri):** Servislerin veritabanı veya dış API'ler ile uyumunu denetler.
|
|
8
|
+
- **E2E Tests (Uçtan Uca Testler):** Kritik kullanıcı akışlarını (Login, Checkout vb.) gerçek tarayıcı ortamında simüle eder.
|
|
9
|
+
|
|
10
|
+
## 2. Yazım Kuralları ve İsimlendirme
|
|
11
|
+
- **Framework:** Vitest (Birim/Entegrasyon) ve Playwright (E2E) standarttır.
|
|
12
|
+
- **Dosya İsimlendirme:** `[modul-ismi].test.ts` formatı kullanılır.
|
|
13
|
+
- **Pattern (Given-When-Then):**
|
|
14
|
+
```typescript
|
|
15
|
+
it("should create a user when valid data is provided", async () => {
|
|
16
|
+
// Given (Hazırlık)
|
|
17
|
+
const userData = { ... };
|
|
18
|
+
// When (Eylem)
|
|
19
|
+
const result = await userService.create(userData);
|
|
20
|
+
// Then (Doğrulama)
|
|
21
|
+
expect(result.id).toBeDefined();
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 3. Kapsam ve Başarı Kriterleri
|
|
26
|
+
- **Kritik Yol Kapsamı:** Auth, Ödeme ve Veri Mutasyonu süreçleri %100 test kapsamına alınmalıdır.
|
|
27
|
+
- **Zero Mock Policy (Internal):** Proje içi servisler arasında mock yerine gerçek kontratlar ve test veritabanları kullanılmalıdır. Dış servisler (Stripe, Twilio vb.) mocklanabilir.
|
|
28
|
+
|
|
29
|
+
## 4. Denetim
|
|
30
|
+
- `@quality` ajanı, her yeni fonksiyonda ilgili test dosyasının güncellendiğini doğrular.
|
|
31
|
+
- Testleri geçmeyen kodlar (`npm run test`) asla onaylanmaz.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { writeJsonFile } from "../../shared/fs.js";
|
|
3
|
-
import type { AdapterConfig } from "./types.js";
|
|
4
|
-
import { registerGlobalAntigravityPlugins } from "./shared.js";
|
|
5
|
-
|
|
6
|
-
export const config: AdapterConfig = {
|
|
7
|
-
id: "antigravity-cli",
|
|
8
|
-
frameworkDir: ".agents",
|
|
9
|
-
shimFile: "AGENTS.md",
|
|
10
|
-
shimTemplate: "src/cli/shims/antigravity-cli.md",
|
|
11
|
-
role: "general",
|
|
12
|
-
templateDir: ".enderun",
|
|
13
|
-
nestedDirs: ["agents", "rules", "knowledge"],
|
|
14
|
-
rulesDir: ".agents/rules",
|
|
15
|
-
rulesExt: ".md"
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export function postInit(projectRoot: string, mcpBlock: unknown): void {
|
|
19
|
-
writeJsonFile(path.join(projectRoot, config.frameworkDir, "mcp_config.json"), mcpBlock);
|
|
20
|
-
console.warn(`✅ Antigravity CLI MCP → ${config.frameworkDir}/mcp_config.json`);
|
|
21
|
-
|
|
22
|
-
// Global registration
|
|
23
|
-
registerGlobalAntigravityPlugins(mcpBlock);
|
|
24
|
-
}
|
|
25
|
-
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { writeJsonFile } from "../../shared/fs.js";
|
|
3
|
-
import { findClaudeConfigPath, addMcpServerToClaude } from "../../cli/utils/claude.js";
|
|
4
|
-
import type { AdapterConfig } from "./types.js";
|
|
5
|
-
|
|
6
|
-
export const config: AdapterConfig = {
|
|
7
|
-
id: "claude",
|
|
8
|
-
frameworkDir: ".claude",
|
|
9
|
-
shimFile: "CLAUDE.md",
|
|
10
|
-
shimTemplate: "src/cli/shims/claude.md",
|
|
11
|
-
role: "architect",
|
|
12
|
-
templateDir: ".enderun",
|
|
13
|
-
nestedDirs: ["agents", "rules", "knowledge"],
|
|
14
|
-
rulesDir: ".claude/rules",
|
|
15
|
-
rulesExt: ".md"
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export function postInit(projectRoot: string, mcpBlock: unknown): void {
|
|
19
|
-
const configPath = findClaudeConfigPath();
|
|
20
|
-
if (configPath) {
|
|
21
|
-
const block = mcpBlock as { mcpServers: Record<string, unknown> };
|
|
22
|
-
// Build mcpEntry matching what adapters.ts does
|
|
23
|
-
const mcpEntry = block.mcpServers["agent-enderun"] as Record<string, unknown>;
|
|
24
|
-
const ok = addMcpServerToClaude(configPath, "agent-enderun", mcpEntry);
|
|
25
|
-
if (ok) {
|
|
26
|
-
console.warn(`✅ Claude MCP registered → ${configPath}`);
|
|
27
|
-
} else {
|
|
28
|
-
console.warn("⚠️ Could not patch Claude config automatically.");
|
|
29
|
-
}
|
|
30
|
-
} else {
|
|
31
|
-
console.warn("⚠️ Claude config not found. Add MCP manually (see README).");
|
|
32
|
-
}
|
|
33
|
-
writeJsonFile(path.join(projectRoot, config.frameworkDir, "mcp_config.json"), mcpBlock);
|
|
34
|
-
writeJsonFile(path.join(projectRoot, ".mcp.json"), mcpBlock);
|
|
35
|
-
console.warn("✅ Claude Code Project MCP → .mcp.json");
|
|
36
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { writeJsonFile } from "../../shared/fs.js";
|
|
3
|
-
import type { AdapterConfig } from "./types.js";
|
|
4
|
-
|
|
5
|
-
export const config: AdapterConfig = {
|
|
6
|
-
id: "codex",
|
|
7
|
-
frameworkDir: ".github",
|
|
8
|
-
shimFile: "copilot-instructions.md",
|
|
9
|
-
shimTemplate: "src/cli/shims/codex.md",
|
|
10
|
-
role: "implementer",
|
|
11
|
-
templateDir: ".enderun",
|
|
12
|
-
nestedDirs: ["agents", "rules", "knowledge", "instructions"],
|
|
13
|
-
rulesDir: ".github/instructions",
|
|
14
|
-
rulesExt: ".md"
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export function postInit(projectRoot: string, mcpBlock: unknown): void {
|
|
18
|
-
writeJsonFile(path.join(projectRoot, config.frameworkDir, "mcp_config.json"), mcpBlock);
|
|
19
|
-
writeJsonFile(path.join(projectRoot, ".vscode/mcp.json"), mcpBlock);
|
|
20
|
-
writeJsonFile(path.join(projectRoot, ".mcp.json"), mcpBlock);
|
|
21
|
-
console.warn("✅ GitHub Copilot Project MCP → .vscode/mcp.json & .mcp.json");
|
|
22
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { writeJsonFile } from "../../shared/fs.js";
|
|
3
|
-
import type { AdapterConfig } from "./types.js";
|
|
4
|
-
|
|
5
|
-
export const config: AdapterConfig = {
|
|
6
|
-
id: "cursor",
|
|
7
|
-
frameworkDir: ".cursor",
|
|
8
|
-
shimFile: "CURSOR.md",
|
|
9
|
-
shimTemplate: "src/cli/shims/cursor.mdc",
|
|
10
|
-
role: "implementer",
|
|
11
|
-
templateDir: ".enderun",
|
|
12
|
-
nestedDirs: ["agents", "rules", "knowledge"],
|
|
13
|
-
rulesDir: ".cursor/rules",
|
|
14
|
-
rulesExt: ".mdc"
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export function postInit(projectRoot: string, mcpBlock: unknown): void {
|
|
18
|
-
const frameworkDir = config.frameworkDir;
|
|
19
|
-
// Native Cursor project-level MCP config
|
|
20
|
-
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp.json"), mcpBlock);
|
|
21
|
-
console.warn(`✅ Cursor IDE Project MCP → ${frameworkDir}/mcp.json`);
|
|
22
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { writeJsonFile } from "../../shared/fs.js";
|
|
3
|
-
import type { AdapterConfig } from "./types.js";
|
|
4
|
-
import { registerGlobalAntigravityPlugins } from "./shared.js";
|
|
5
|
-
|
|
6
|
-
export const config: AdapterConfig = {
|
|
7
|
-
id: "gemini",
|
|
8
|
-
frameworkDir: ".gemini",
|
|
9
|
-
shimFile: "GEMINI.md",
|
|
10
|
-
shimTemplate: "src/cli/shims/gemini.md",
|
|
11
|
-
role: "commander",
|
|
12
|
-
templateDir: ".enderun",
|
|
13
|
-
nestedDirs: ["agents", "rules", "knowledge"],
|
|
14
|
-
rulesDir: ".gemini/rules",
|
|
15
|
-
rulesExt: ".md"
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export function postInit(projectRoot: string, mcpBlock: unknown): void {
|
|
19
|
-
const frameworkDir = config.frameworkDir;
|
|
20
|
-
// Standard project-level MCP config
|
|
21
|
-
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp.json"), mcpBlock);
|
|
22
|
-
console.warn(`✅ Gemini MCP registered → ${frameworkDir}/mcp.json`);
|
|
23
|
-
|
|
24
|
-
// Global registration
|
|
25
|
-
registerGlobalAntigravityPlugins(mcpBlock);
|
|
26
|
-
}
|
|
27
|
-
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { writeJsonFile } from "../../shared/fs.js";
|
|
3
|
-
import type { AdapterConfig } from "./types.js";
|
|
4
|
-
|
|
5
|
-
export const config: AdapterConfig = {
|
|
6
|
-
id: "grok",
|
|
7
|
-
frameworkDir: ".grok",
|
|
8
|
-
shimFile: "GROK.md",
|
|
9
|
-
shimTemplate: "src/cli/shims/grok.md",
|
|
10
|
-
role: "researcher",
|
|
11
|
-
templateDir: ".enderun",
|
|
12
|
-
nestedDirs: ["agents", "rules", "knowledge"],
|
|
13
|
-
rulesDir: ".grok/rules",
|
|
14
|
-
rulesExt: ".md"
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export function postInit(projectRoot: string, mcpBlock: unknown): void {
|
|
18
|
-
writeJsonFile(path.join(projectRoot, config.frameworkDir, "mcp_config.json"), mcpBlock);
|
|
19
|
-
console.warn(`✅ Grok MCP → ${config.frameworkDir}/mcp_config.json`);
|
|
20
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# 🎖️ Agent Enderun — Agent Army Manifest
|
|
2
|
-
|
|
3
|
-
This document serves as the complete manifest of the 13 specialist agents forming the **Enderun Army**. Each agent is mapped to a specific capability index, toolset, and specialized directive under the Enderun Discipline (Osmanlı Nizami).
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 🏛️ Agent Army Overview
|
|
8
|
-
|
|
9
|
-
| Agent Name | Role | Capability | Primary Tools | Tags |
|
|
10
|
-
| :--- | :--- | :--- | :--- | :--- |
|
|
11
|
-
| **`@manager`** | Orchestration | 10/10 | `orchestrate_loop`, `send_agent_message` | `core`, `orchestration` |
|
|
12
|
-
| **`@architect`** | System Design | 9/10 | `write_file`, `replace_text` | `core`, `design` |
|
|
13
|
-
| **`@backend`** | Backend Logic | 9/10 | `replace_text`, `run_shell_command` | `core`, `logic` |
|
|
14
|
-
| **`@frontend`** | User Interface | 9/10 | `replace_text`, `view_file` | `core`, `ui` |
|
|
15
|
-
| **`@quality`** | Quality Audit | 9/10 | `run_shell_command`, `view_file` | `core`, `audit` |
|
|
16
|
-
| **`@database`** | Data Management | 9/10 | `replace_text`, `run_shell_command` | `core`, `data` |
|
|
17
|
-
| **`@devops`** | Infrastructure | 9/10 | `run_shell_command`, `view_file` | `core`, `infra` |
|
|
18
|
-
| **`@explorer`** | Reconnaissance | 8/10 | `grep_search`, `list_dir`, `glob` | `core`, `recon` |
|
|
19
|
-
| **`@git`** | Version Control | 9/10 | `run_shell_command`, `view_file` | `core`, `logistics` |
|
|
20
|
-
| **`@mobile`** | Mobile Apps | 9/10 | `replace_text`, `view_file` | `core`, `mobile` |
|
|
21
|
-
| **`@native`** | System-Level | 9/10 | `run_shell_command`, `replace_text` | `core`, `native` |
|
|
22
|
-
| **`@security`** | Security Audit | 10/10 | `grep_search`, `run_shell_command` | `core`, `security` |
|
|
23
|
-
| **`@analyst`** | Requirements | 9/10 | `grep_search`, `list_dir` | `core`, `strategy` |
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## 🤖 Specialist Directives
|
|
28
|
-
|
|
29
|
-
### 1. `@manager` (Orchestrator)
|
|
30
|
-
- **Directive:** Strategic commander of the army. Coordinates executions, schedules traces, and delegates tasks to specialists.
|
|
31
|
-
- **Mandate:** Enforces Enderun discipline, inherits and passes Trace IDs, and handles final compliance approvals.
|
|
32
|
-
|
|
33
|
-
### 2. `@architect` (Lead Architect)
|
|
34
|
-
- **Directive:** Outlines initial codebase design, defines schema contracts, and manages the architectural blueprint.
|
|
35
|
-
- **Mandate:** Enforces strict modular boundaries and verifies structural sanity.
|
|
36
|
-
|
|
37
|
-
### 3. `@backend` (Backend Specialist)
|
|
38
|
-
- **Directive:** Builds REST/GraphQL API systems, develops server components, and manages server business rules.
|
|
39
|
-
- **Mandate:** Ensures robust error handling, schema boundaries, and server logic.
|
|
40
|
-
|
|
41
|
-
### 4. `@frontend` (Frontend Specialist)
|
|
42
|
-
- **Directive:** Builds user interfaces, manages layouts and states using modern styling (Panda CSS, CSS variables).
|
|
43
|
-
- **Mandate:** Enforces design systems, accessibility, and high performance rendering.
|
|
44
|
-
|
|
45
|
-
### 5. `@quality` (Quality Specialist)
|
|
46
|
-
- **Directive:** Validates unit coverage, performs static analyses, and ensures code rules compliance.
|
|
47
|
-
- **Mandate:** Runs ESLint rules, checks console logs, and audits project safety.
|
|
48
|
-
|
|
49
|
-
### 6. `@database` (Database Specialist)
|
|
50
|
-
- **Directive:** Designs relational/NoSQL schemas, writes migrations, and optimizes SQL query metrics.
|
|
51
|
-
- **Mandate:** Guarantees data transaction integrity and index configurations.
|
|
52
|
-
|
|
53
|
-
### 7. `@devops` (Infrastructure Specialist)
|
|
54
|
-
- **Directive:** Establishes CI/CD pipelines, configures Docker environments, and tracks cloud deployments.
|
|
55
|
-
- **Mandate:** Ensures high availability, automation scripts, and safe release cycles.
|
|
56
|
-
|
|
57
|
-
### 8. `@explorer` (Intel Explorer)
|
|
58
|
-
- **Directive:** Gathers codebase intelligence, discovers file dependencies, and maps codebase symbols.
|
|
59
|
-
- **Mandate:** Guides planning agents by providing context graphs and code dependencies.
|
|
60
|
-
|
|
61
|
-
### 9. `@git` (Logistics Master)
|
|
62
|
-
- **Directive:** Handles atomic commit flows, merges code, resolves conflicts, and manages release tags.
|
|
63
|
-
- **Mandate:** Enforces descriptive commit tags mapped to active Trace IDs.
|
|
64
|
-
|
|
65
|
-
### 10. `@mobile` (Mobile Specialist)
|
|
66
|
-
- **Directive:** Implements mobile interfaces using cross-platform layouts (React Native / Expo).
|
|
67
|
-
- **Mandate:** Optimizes mobile assets, native performance, and state stores.
|
|
68
|
-
|
|
69
|
-
### 11. `@native` (Native Division)
|
|
70
|
-
- **Directive:** Interfaces with native operating system hooks, constructs desktop platforms, and manages hardware bridges.
|
|
71
|
-
- **Mandate:** Exercises deep security protocols during system interactions.
|
|
72
|
-
|
|
73
|
-
### 12. `@security` (Security Specialist)
|
|
74
|
-
- **Directive:** Audits repositories for credentials/secrets, evaluates package dependencies, and verifies authentication flows.
|
|
75
|
-
- **Mandate:** Rejects insecure actions, validates cryptographic keys, and enforces access control checks.
|
|
76
|
-
|
|
77
|
-
### 13. `@analyst` (Business Analyst)
|
|
78
|
-
- **Directive:** Maps requirements to codebase implementations, writes business specification rules, and audits contracts.
|
|
79
|
-
- **Mandate:** Validates feature alignment against system specifications.
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# Enterprise Approval Flows & Governance Protocol (v0.8.5)
|
|
2
|
-
|
|
3
|
-
This protocol defines the strict governance model for high-risk operations and cross-agent approval flows within the Agent Enderun framework. It ensures that no critical mutations or sensitive actions are executed by AI specialists without formal orchestration and explicit authorization.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 🔒 1. High-Risk Action Catalog
|
|
8
|
-
|
|
9
|
-
Specialist agents (@backend, @frontend, @devops, etc.) are strictly prohibited from performing any of the following administrative operations autonomously. If requested, they must halt work, shift to `WAITING` status, and escalate to `@manager` via the **Hermes Protocol**.
|
|
10
|
-
|
|
11
|
-
| Category | High-Risk Operations | Designated Controller |
|
|
12
|
-
| :--- | :--- | :--- |
|
|
13
|
-
| **Data Management** | Bulk delete/purge, data migration, PII export, schema modifications. | `@manager` |
|
|
14
|
-
| **System Security** | Security credentials modification, CSP rule changes, private keys rotation. | `@security` & `@manager` |
|
|
15
|
-
| **Infrastructure** | Production deployment triggers, container orchestration changes, ENV vars rotation. | `@devops` & `@manager` |
|
|
16
|
-
| **Contract Stability**| Breaking API modifications, major type updates inside `src/types/`. | `@backend` & `@manager` |
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## 💬 2. Hermes approval Flow (`managerApproval`)
|
|
21
|
-
|
|
22
|
-
When a specialist agent encounters a high-risk operation, it must execute the following message queue protocol.
|
|
23
|
-
|
|
24
|
-
### Step 1: Lock the Hermes Inbox
|
|
25
|
-
To prevent race conditions, the agent must check for `{{FRAMEWORK_DIR}}/messages/.lock`. If the lock is active, the agent retries (up to 3 times, waiting 500ms between attempts). If no lock exists, it creates `.lock` to claim the channel.
|
|
26
|
-
|
|
27
|
-
### Step 2: Write Approval Request File
|
|
28
|
-
The requesting agent writes a structured JSON file inside `{{FRAMEWORK_DIR}}/queue/pending/` or `{{FRAMEWORK_DIR}}/messages/` with the unique `Trace ID` (ULID) and a `managerApproval` request flag:
|
|
29
|
-
|
|
30
|
-
```json
|
|
31
|
-
{
|
|
32
|
-
"traceId": "01JM5S8A0F2B4C6D8E0G2H4J6K",
|
|
33
|
-
"from": "@backend",
|
|
34
|
-
"to": "@manager",
|
|
35
|
-
"category": "ALERT",
|
|
36
|
-
"priority": "HIGH",
|
|
37
|
-
"action": "RUN_DATABASE_MIGRATION",
|
|
38
|
-
"payload": {
|
|
39
|
-
"migrationFile": "20260527_add_tenant_rls_policy.sql",
|
|
40
|
-
"rationale": "Enables multi-tenant Row Level Security (RLS) on PostgreSQL."
|
|
41
|
-
},
|
|
42
|
-
"timestamp": "2026-05-27T20:45:00Z"
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Step 3: Shift Agent State
|
|
47
|
-
The requesting agent updates its state inside `.enderun/STATUS.md` to `WAITING` and appends `BLOCKED_BY_APPROVAL` to its action log.
|
|
48
|
-
|
|
49
|
-
### Step 4: Human-in-the-Loop Signing
|
|
50
|
-
In production workspaces, the `@manager` compiles the war-room report and requests the human architect (CTO) to sign off on the transaction. The human developer signs the transaction by executing:
|
|
51
|
-
```bash
|
|
52
|
-
npx agent-enderun approve 01JM5S8A0F2B4C6D8E0G2H4J6K
|
|
53
|
-
```
|
|
54
|
-
Or by writing a signed token to the message queue.
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## 🚦 3. Conflict Resolution & Rollback
|
|
59
|
-
|
|
60
|
-
1. **Approval Rejection:** If the transaction is rejected, `@manager` issues a `REJECTED` signal. The specialist agent rolls back any staged changes and returns to `IDLE` state.
|
|
61
|
-
2. **Stale Lock Recovery:** If a Hermes inbox `.lock` remains for more than 1.5 seconds, the active agent assumes a **stale lock** (LLM timeout), deletes the lock, and logs the incident to `@manager`.
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# 🎖️ Agent Enderun — Enterprise Architecture & Standards
|
|
2
|
-
|
|
3
|
-
This document establishes the architecture patterns, design guidelines, and code structures of the **Enderun Core Framework** for enterprise deployments.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 🏛️ Project Directory Structure
|
|
8
|
-
|
|
9
|
-
```text
|
|
10
|
-
agent-enderun/
|
|
11
|
-
├── bin/ # Executable CLI entrypoints
|
|
12
|
-
├── docs/ # Technical documentation & design guides
|
|
13
|
-
├── framework-mcp/ # Modular MCP server implementation (workspace)
|
|
14
|
-
│ ├── src/ # MCP server source files
|
|
15
|
-
│ └── tests/ # Unit tests for MCP server tools
|
|
16
|
-
├── src/ # CLI & Core framework logic
|
|
17
|
-
│ ├── cli/ # Command line interface commands & adapters
|
|
18
|
-
│ │ ├── adapters/ # Target-specific IDE adapters (VS Code, Cursor, etc.)
|
|
19
|
-
│ │ ├── commands/ # Subcommand handlers (init, status, check)
|
|
20
|
-
│ │ └── utils/ # CLI-specific utilities
|
|
21
|
-
│ ├── modules/ # Core framework modules
|
|
22
|
-
│ │ ├── adapters/ # Target environment adapter profiles
|
|
23
|
-
│ │ ├── agents/ # Orchestrator & Specialist Agent definitions
|
|
24
|
-
│ │ └── skills/ # Capability templates for specialist actions
|
|
25
|
-
│ └── shared/ # Core shared business components
|
|
26
|
-
│ ├── config.ts # Zod environment configuration
|
|
27
|
-
│ ├── container.ts # Dependency injection container
|
|
28
|
-
│ ├── errors.ts # Standard typed domain errors
|
|
29
|
-
│ ├── fs.ts # File system helper wrappers
|
|
30
|
-
│ └── logger.ts # Enterprise logging subsystem
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## ⚙️ Core Design Principles
|
|
36
|
-
|
|
37
|
-
### 1. Unified Domain Errors
|
|
38
|
-
All errors thrown by modules must inherit from `EnderunBaseError` in [src/shared/errors.ts](file:///Users/ybekar/Desktop/Projeler/agent-enderun/src/shared/errors.ts).
|
|
39
|
-
This ensures:
|
|
40
|
-
- Unique error codes (`CONFIGURATION_ERROR`, `VALIDATION_ERROR`, etc.)
|
|
41
|
-
- Metadata enrichment via the `details` field
|
|
42
|
-
- Structured JSON serialization in production environments
|
|
43
|
-
|
|
44
|
-
### 2. Zod-Validated Environments
|
|
45
|
-
Configuration options must never be read directly from raw environment variables (`process.env`). Instead, they are parsed and frozen inside [src/shared/config.ts](file:///Users/ybekar/Desktop/Projeler/agent-enderun/src/shared/config.ts) at initialization. If a required value is missing, the application crashes immediately with a clean explanation.
|
|
46
|
-
|
|
47
|
-
### 3. Service Container (Dependency Injection)
|
|
48
|
-
To write testable and decoupled code, singletons and factories are registered and resolved using the `ServiceContainer` defined in [src/shared/container.ts](file:///Users/ybekar/Desktop/Projeler/agent-enderun/src/shared/container.ts).
|
|
49
|
-
```typescript
|
|
50
|
-
import { container } from "./shared/container.js";
|
|
51
|
-
|
|
52
|
-
// Register
|
|
53
|
-
container.register("Logger", logger);
|
|
54
|
-
|
|
55
|
-
// Resolve
|
|
56
|
-
const logger = container.resolve<EnterpriseLogger>("Logger");
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### 4. Structured Observability
|
|
60
|
-
Use `EnterpriseLogger` in [src/shared/logger.ts](file:///Users/ybekar/Desktop/Projeler/agent-enderun/src/shared/logger.ts) for logging:
|
|
61
|
-
- In **development**, logs are colorized and formatted for human readability.
|
|
62
|
-
- In **production**, logs are structured as JSON for log aggregators (e.g. Datadog, ELK).
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## 🛡️ Code & Type Guidelines
|
|
67
|
-
- **Strict Typing:** Always keep `"strict": true` in `tsconfig.json`. Explicit return types are required on all exports.
|
|
68
|
-
- **Asynchronous Flow:** Use async/await over raw promise chains. Handle failures with localized try/catch blocks and wrap in domain errors.
|
|
69
|
-
- **Atomic Operations:** Always use transactional or surgical replacements when editing configuration/code files.
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Enterprise CRUD & Admin Governance Protocol (v1.0.0)
|
|
2
|
-
|
|
3
|
-
This protocol defines the strict operational boundaries, coding practices, and routing rules for High-Risk CRUD (Create, Read, Update, Delete) operations and Administrative actions within Agent Enderun projects.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 🔒 1. High-Risk Action Classification
|
|
8
|
-
|
|
9
|
-
To maintain security, database consistency, and prevent unauthorized system changes, actions are split into **Standard Operations** and **High-Risk Operations**.
|
|
10
|
-
|
|
11
|
-
### 🛑 High-Risk Administrative Operations (Requires @manager Sign-Off)
|
|
12
|
-
The following actions must **never** be performed by specialist agents (`@backend`, `@frontend`, `@database`, etc.) autonomously. They must halt execution and redirect the task to `@manager` via the Hermes Message Broker.
|
|
13
|
-
|
|
14
|
-
1. **User & Permission Management:** Modifying roles, assigning admin rights, creating api keys.
|
|
15
|
-
2. **Bulk Destructive Operations:** Truncating tables, purging databases, executing mass-deletions without strict tenant-isolation clauses.
|
|
16
|
-
3. **Database Schema Alterations:** Running database migrations, altering column constraints, deleting tables.
|
|
17
|
-
4. **PII & Data Export:** Bulk exporting personal user info, system settings, or database backups.
|
|
18
|
-
5. **System Config & CSP Policies:** Modifying environment variables, CORS origins, or content security policies.
|
|
19
|
-
6. **Billing & Financial Actions:** Integrating payment gateways, editing subscription rules.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 🛡️ 2. Specialist Redirection Policy
|
|
24
|
-
|
|
25
|
-
When a specialist agent receives a request containing any High-Risk Administrative Operation, it must immediately return the following standard refusal message and halt code output:
|
|
26
|
-
|
|
27
|
-
> **[REFUSAL - Corporate CRUD Governance Standard]**
|
|
28
|
-
> I am not authorized to perform administrative actions or bulk mutations.
|
|
29
|
-
> I have redirected this request to the Orchestrator (@manager) under Trace ID: {{TRACE_ID}}.
|
|
30
|
-
> Please execute the manager approval sequence to proceed.
|
|
31
|
-
|
|
32
|
-
### Action Flow:
|
|
33
|
-
1. **Detect** high-risk keyword or context in the task.
|
|
34
|
-
2. **Create** an approval request using the `send_agent_message` tool targeting `@manager` with category `ALERT` and priority `HIGH`.
|
|
35
|
-
3. **Update** state in `STATUS.md` to `WAITING` with note `BLOCKED_BY_CRUD_GOVERNANCE`.
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## 🧬 3. Safe Coding Standard (Read/Write Rules)
|
|
40
|
-
|
|
41
|
-
For permitted Standard CRUD operations, the following rules are strictly enforced:
|
|
42
|
-
|
|
43
|
-
1. **Isolated Repository Pattern:** All database reads and writes must be encapsulated in repository/service classes. Writing database queries directly inside fastify controllers or nextjs actions is **strictly forbidden**.
|
|
44
|
-
2. **No Raw SQL:** All database mutations must use typed query builders (e.g. `Kysely`). Direct string-concatenated SQL queries are **strictly forbidden** to prevent SQL injection.
|
|
45
|
-
3. **Branded Types:** Entities must use branded types (e.g. `UserId`, `ProjectId`) instead of primitive types (`string`, `number`) to avoid type mixing.
|
|
46
|
-
4. **Soft Deletes by Default:** All business-domain deletions must use a `deletedAt` timestamp instead of raw SQL `DELETE` mutations, unless explicitly designated by `@manager`.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Architecture Patterns & Data Fetching
|
|
2
|
-
|
|
3
|
-
## 1. UI Layout & Component Structure
|
|
4
|
-
- **Shared UI:** All atomic components (Button, Input, etc.) must be created in `apps/web/src/components/ui/` using **Panda CSS**.
|
|
5
|
-
- **Layouts:** Use wrapper layouts (`Shell`, `Workspace`) in `apps/web/src/components/layout/`. Every page must utilize these layouts to maintain consistency.
|
|
6
|
-
- **Procedural Continuity:** Never re-create an existing component. Search the `components/ui/` directory first.
|
|
7
|
-
|
|
8
|
-
## 2. Data Fetching & API (CRUD) Patterns
|
|
9
|
-
- **Repository Pattern:** Backend logic must be separated into service/repository layers. No direct DB calls in controllers.
|
|
10
|
-
- **Contract-First:** All API endpoints must use types imported from `apps/backend/src/types/`.
|
|
11
|
-
- **API Layer:** Frontend must use typed fetcher functions located in `apps/web/src/api/`.
|
|
12
|
-
- **Validation:** Use `zod` for request validation on the backend and response validation on the frontend.
|
|
13
|
-
- **Audit Logging:** Every mutation (POST/PUT/PATCH/DELETE) MUST trigger an audit log service call with the current Trace ID.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# Design System — Agent Enderun (Enterprise)
|
|
2
|
-
|
|
3
|
-
## 1. Design Philosophy
|
|
4
|
-
The Agent Enderun Design System focuses on **"Enterprise Clarity"**. Our interfaces are professional, minimalist tools designed to maximize data comprehension and operational speed.
|
|
5
|
-
|
|
6
|
-
- **Clarity:** Every pixel must serve a purpose. If it doesn't aid understanding or action, remove it.
|
|
7
|
-
- **Consistency:** Uniform visual language across all applications.
|
|
8
|
-
- **Responsiveness:** Fluid adaptation to any screen size, from mobile to ultra-wide monitors.
|
|
9
|
-
|
|
10
|
-
## 2. Technical Requirements
|
|
11
|
-
- **Styling:** Panda CSS is MANDATORY. Tailwind, CSS-in-JS, and raw CSS modules are FORBIDDEN.
|
|
12
|
-
- **Zero UI Library:** No external components (MUI, AntD, Shadcn). All UI components must be built from scratch in `apps/web/src/components/ui/`.
|
|
13
|
-
- **Tokenization:** All values (colors, spacing, typography) MUST use `panda.config.ts` tokens. NO hardcoded pixels.
|
|
14
|
-
- **Responsiveness:** Mobile-First design is MANDATORY.
|
|
15
|
-
|
|
16
|
-
## 3. Responsive Mandate (Mobile-First)
|
|
17
|
-
- **Design Strategy:** Design for 320px width first.
|
|
18
|
-
- **Breakpoints:**
|
|
19
|
-
- `sm`: 640px
|
|
20
|
-
- `md`: 768px
|
|
21
|
-
- `lg`: 1024px
|
|
22
|
-
- `xl`: 1280px
|
|
23
|
-
- `2xl`: 1536px
|
|
24
|
-
- **Layouts:** Use Flexbox and Grid. Fixed widths are FORBIDDEN. Use `clamp()` for fluid typography and spacing where applicable.
|
|
25
|
-
- **Reflow:** Content MUST gracefully wrap, stack, or collapse based on screen width without horizontal scrollbars.
|
|
26
|
-
|
|
27
|
-
## 4. UI/UX Interaction Standards
|
|
28
|
-
- **Interactions:** Hover, Active, and Disabled states are MANDATORY for all interactive elements.
|
|
29
|
-
- **Feedback:** Async operations MUST show Loading states and Toast notifications on completion/error.
|
|
30
|
-
- **Blocking Dialogues:** Native `alert()` and `confirm()` functions are **FORBIDDEN**. Use project-integrated `Modal` components for blocking user interactions and `Toaster` for non-blocking feedback.
|
|
31
|
-
- **Focus:** All interactive elements must have a visible `focus` state for accessibility.
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# 🎖️ Agent Enderun — Documentation Ownership & Memory Protocol
|
|
2
|
-
|
|
3
|
-
This document establishes the binding discipline for where project documentation is stored and how AI agents interact with it.
|
|
4
|
-
|
|
5
|
-
## 🏛️ Core Principles
|
|
6
|
-
|
|
7
|
-
1. **Human-AI Separation of Concerns:**
|
|
8
|
-
- **`docs/` (Root Directory):** Single Source of Truth (SSOT) for human intentions, business requirements, API specifications, and architectural standards.
|
|
9
|
-
- **`.gemini/` or `.agents/` (Framework Directory):** Operational workspace and memory of the AI agents. Contains state machines, task tracking, rules, and internal logs.
|
|
10
|
-
|
|
11
|
-
2. **The Documentation Discipline:**
|
|
12
|
-
- The user clarifies requirements in the chat.
|
|
13
|
-
- Once requirements are finalized, they are documented in the root `docs/` directory (e.g., `docs/project-docs.md`, `docs/api/`, etc.) by the user or the agent.
|
|
14
|
-
- When building features or validating code, the agent **reads** the documents from `docs/` and uses them as the blueprint.
|
|
15
|
-
- The agent **must not** duplicate requirements inside the internal memory (`PROJECT_MEMORY.md`). The internal memory only tracks *what has been done* and *what is currently running* (Trace ID, active phase, history of implemented steps referencing the doc files).
|
|
16
|
-
|
|
17
|
-
## 🛡️ Agent Rules
|
|
18
|
-
|
|
19
|
-
- **Do Not Pollute Internal Memory:** Never copy full requirement specifications or code files into `.gemini/memory/PROJECT_MEMORY.md`. Refer to the root `docs/` files instead.
|
|
20
|
-
- **Exclusivity:** All project-specific architectural records, API catalogs, database schemas, and user manuals must be created in the `docs/` folder.
|
|
21
|
-
- **Read Before Code:** Before writing any application code or generating files, the agent must check the root `docs/` directory for context and specifications.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Logging & Audit Standard
|
|
2
|
-
|
|
3
|
-
- **No Console.log:** Production code MUST NOT use `console.log`, `console.warn`, or `console.error`. These are FORBIDDEN in the codebase.
|
|
4
|
-
- **Structured Logging:** All logging MUST go through the centralized `Logger` service (`apps/backend/src/services/logger.ts`). Logs must be produced in JSON format.
|
|
5
|
-
- **Traceability:** Every log entry MUST include the active `traceId` context to ensure cross-agent and cross-service traceability.
|
|
6
|
-
- **Audit Logging:** Every state-mutating operation (POST, PUT, PATCH, DELETE) MUST trigger an `AuditService.log()` call, linking the action to the responsible agent, Trace ID, and entity ID.
|
|
7
|
-
- **Log Persistence:** Logs must be persisted in an structured manner suitable for downstream ingestion by log management systems.
|