agent-enderun 1.0.4 → 1.0.5

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.
@@ -21,3 +21,11 @@
21
21
 
22
22
  - **Framework Scaffolding:** Initialized using Agent Enderun templates.
23
23
  - **Stable Release v1.0.3:** Promoted and mühürlendi with Unified Brain Architecture, conditional clean scaffolds, Grok army resolution, and 100% passing integration tests.
24
+ - **Antigravity Cross-Compatibility Fix:** Resolved issue where custom agents were not showing up in the Antigravity CLI/IDE. Scaffolded the `.agents/agents/...` directory with 12 agent specifications and updated the `init` command to automatically scaffold it for the `gemini` adapter.
25
+ - **Architectural Guidance:** Answered user inquiry regarding MCP agent definition structure, explaining the role of `agent.json` vs `.md` files.
26
+ - **Framework Directory Resolution Fix:** Removed `.agents` from `FRAMEWORK_DIR_CANDIDATES` to avoid false positive directory detection when `.agents` is created solely for Antigravity/Cursor custom agent registration. Verified health check is 100% green.
27
+ - **Automated Scaffolding Geliştirmesi:** `init` komutu güncellendi. Kurulum sırasında hem `.agents/agents/...` klasörlerinin hem de `.cursorrules` dosyasının otomatik olarak oluşturulması sağlandı, böylece hem Antigravity hem de Cursor IDE destekleri tamamen otonom ve otomatik hale getirildi.
28
+ - **Antigravity Konfigürasyon Entegrasyonu:** `agent-settings`, `cli-settings` ve `ide-settings` kılavuzlarındaki standartlara uygun olarak `.agents/skills`, `.agents/rules`, `.agents/workflows` dizinleri, `.agents/mcp_config.json` lokal MCP tanımları ve kök dizindeki `AGENTS.md` otonom talimat dosyası oluşturuldu ve `init` akışına entegre edildi.
29
+ - **AI Compatibility Audit:** Documented and verified active readiness for Gemini/Antigravity CLI, Cursor IDE, Claude Code/Desktop, and Grok environments.
30
+ - **Kalite Kapısı Kontrolleri:** ESLint otomatik kod formatlama ve hizalama düzeltmeleri uygulandı, TS derleme build'i sıfır hata ile tamamlandı ve vitest birim testlerinin tümü (%100 başarı) başarıyla geçti.
31
+ - **Monorepo Sürüm Senkronizasyonu:** Tüm monorepo paketlerinin (\`@agent-enderun/mcp\`, \`@agent-enderun/backend\`, \`@agent-enderun/web\`) sürümleri ana sürüm olan \`1.0.5\` ile senkronize edildi.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🏛️ Agent Enderun — Enterprise AI Governance & Autonomous Orchestration Framework
2
2
 
3
- > **Stable Release:** v1.0.4 (Singularity - Patch 1)
3
+ > **Stable Release:** v1.0.5 (Universal AI Synergy)
4
4
  > **Author:** Yusuf BEKAR
5
5
  > **Trace ID:** `01HGT8J5E2N0W0W0W0W0W0W0W5`
6
6
  > **System Status:** 🟢 All Systems Operational | Build Compile: Clean | Type-Safety: 100% Verified
@@ -11,7 +11,7 @@
11
11
 
12
12
  **Agent Enderun**, sıradan bir kod şablon üreteci veya basit bir AI asistanı değildir; karmaşık, ölçeklenebilir ve kurumsal (enterprise) düzeydeki yazılım projeleri için özel olarak tasarlanmış bir **Yapay Zeka Yönetişimi ve Otonom Ordu Komuta Sistemidir**.
13
13
 
14
- Sürüm **v1.0.4** itibarıyla sistem; kendi hafızasını yönetebilen, monorepo proje yollarını dinamik olarak haritalayan, tüm ajan seanslarını güvenli şekilde günlükleyen, farklı yapay zeka ekosistemlerini anayasal bir disiplin altında birleştiren ve **macOS & Windows çapraz platform standartlarına tam uyum sağlayan** yaşayan bir mühendislik organizmasıdır.
14
+ Sürüm **v1.0.5** itibarıyla sistem; kendi hafızasını yönetebilen, monorepo proje yollarını dinamik olarak haritalayan, tüm ajan seanslarını güvenli şekilde günlükleyen, farklı yapay zeka ekosistemlerini anayasal bir disiplin altında birleştiren ve **macOS & Windows çapraz platform standartlarına tam uyum sağlayan** yaşayan bir mühendislik organizmasıdır.
15
15
 
16
16
  ---
17
17
 
@@ -27,6 +27,15 @@ Yapay zeka kodlama yardımcıları (Claude Code, Gemini CLI, Grok Build vb.) gel
27
27
 
28
28
  ---
29
29
 
30
+ ### 🚀 Sürüm v1.0.5 Universal AI Synergy Kararlı Sürüm Devrimsel Özellikleri
31
+
32
+ 1. **🛸 Antigravity Custom Agent, CLI & IDE Entegrasyonu:**
33
+ * `.agents/` dizini altında `skills`, `rules` ve `workflows` dizinleri ile yerel `mcp_config.json` dosyasının otonom oluşturulması sağlandı. Kök dizine global `AGENTS.md` dosyasının otomatik yazılması eklenerek Antigravity CLI (`agy`) ve IDE'sinin özel agent'ları pürüzsüz tanıması sağlandı.
34
+ 2. **🚀 Cursor IDE `.cursorrules` Desteği:**
35
+ * Kök dizinde `.cursorrules` dosyası otomatik oluşturularak Cursor AI asistanının (Chat & Composer) Agent Enderun anayasası ve bellek sistemlerine tam uyumlu çalışması sağlandı.
36
+ 3. **🩺 Akıllı Framework Dizin Çözümlemesi:**
37
+ * `.agents/` konfigürasyon dizini ile ana framework çalışma dizinlerinin (`.enderun` vb.) çakışmasını önleyen ve `check` taramasını 100% başarılı kılan dizin çözümleme düzeltmesi uygulandı.
38
+
30
39
  ### 🚀 Sürüm v1.0.4 Singularity Kararlı Sürüm Devrimsel Özellikleri
31
40
 
32
41
  1. **🧠 Pürüzsüz ve Klasör Kalabalığından Arındırılmış Birleşik Beyin Mimarisi (Unified Brain):**
@@ -177,7 +186,7 @@ npx agent-enderun init gemini --unified
177
186
 
178
187
  **Agent Enderun** is not a generic boilerplate generator or a simple AI wrapper; it is an elite, state-of-the-art **AI Governance and Autonomous Army Command System** designed for complex, scalable, and highly auditable enterprise software projects.
179
188
 
180
- As of **v1.0.4**, the system operates as a **"Living Engineering Organism"** capable of managing its own persistent memory, dynamically mapping project directory scopes, secure-logging expert agent activities, and **fully complying with cross-platform (macOS & Windows) scripting and standard setups**.
189
+ As of **v1.0.5**, the system operates as a **"Living Engineering Organism"** capable of managing its own persistent memory, dynamically mapping project directory scopes, secure-logging expert agent activities, and **fully complying with cross-platform (macOS & Windows) scripting and standard setups**.
181
190
 
182
191
  ---
183
192
 
@@ -193,6 +202,15 @@ As AI coding assistants (Claude Code, Gemini CLI, Grok Build, etc.) become incre
193
202
 
194
203
  ---
195
204
 
205
+ ### 🚀 Key Improvements in Version v1.0.5 (Universal AI Synergy) Stable Release
206
+
207
+ 1. **🛸 Antigravity Custom Agent, CLI & IDE Integration:**
208
+ * Autonomously scaffolds `.agents/skills`, `.agents/rules`, and `.agents/workflows` directories along with local `mcp_config.json`. Generates the root `AGENTS.md` file automatically, ensuring full cross-platform compatibility and seamless custom agent discovery in the Antigravity CLI (`agy`) and IDE.
209
+ 2. **🚀 Cursor IDE `.cursorrules` Support:**
210
+ * Automatically scaffolds the root `.cursorrules` file to direct Cursor's AI Chat and Composer to comply fully with the Agent Enderun Constitution (`ENDERUN.md`) and persistant memory patterns.
211
+ 3. **🩺 Smart Framework Directory Resolution:**
212
+ * Fixed framework resolution candidates to dynamically prevent folder name collisions between the Antigravity config `.agents` and framework directories, ensuring `check` audits are 100% green.
213
+
196
214
  ### 🚀 Key Improvements in Version v1.0.4 Stable Release
197
215
 
198
216
  1. **🧠 Clutter-Free Unified Brain Architecture:**
@@ -338,4 +356,4 @@ npx agent-enderun init gemini --unified
338
356
 
339
357
  ---
340
358
 
341
- Developed with absolute discipline | Developer **Yusuf BEKAR** | Framework Version **v1.0.4**
359
+ Developed with absolute discipline | Developer **Yusuf BEKAR** | Framework Version **v1.0.5**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-enderun/mcp",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "description": "Agent Enderun Model Context Protocol (MCP) Server",
5
5
  "type": "module",
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-enderun",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "The Supreme AI Governance & Orchestration Framework for Enterprise Development",
5
5
  "author": "Yusuf BEKAR",
6
6
  "license": "MIT",
@@ -82,7 +82,7 @@
82
82
  "zod": "^3.24.2"
83
83
  },
84
84
  "enderun": {
85
- "version": "1.0.4",
85
+ "version": "1.0.5",
86
86
  "initializedAt": "2026-05-31T09:58:25.773Z"
87
87
  },
88
88
  "dependencies": {}
@@ -63,7 +63,6 @@ export const ADAPTERS: Record<AdapterId, AdapterConfig> = {
63
63
  */
64
64
  export const FRAMEWORK_DIR_CANDIDATES = [
65
65
  ".agent",
66
- ".agents",
67
66
  ".gemini",
68
67
  ".claude",
69
68
  ".grok",
@@ -287,6 +287,45 @@ describe("Initial Setup", () => {
287
287
  );
288
288
  }
289
289
 
290
+ const cursorRulesPath = path.join(targetDir, ".cursorrules");
291
+ if (!fs.existsSync(cursorRulesPath)) {
292
+ writeTextFile(
293
+ cursorRulesPath,
294
+ `# Agent Enderun — Cursor IDE Rules
295
+
296
+ This is the primary entry point when using Agent Enderun within the Cursor IDE (Chat & Composer).
297
+
298
+ The framework operates under a unified governance structure located in the ${frameworkDir}/ directory.
299
+
300
+ ### Primary Constitution
301
+ All governance rules, agent checklists, and project memory live here:
302
+
303
+ 👉 **[${frameworkDir}/ENDERUN.md](${frameworkDir}/ENDERUN.md)**
304
+
305
+ ### 🤖 Agent Directive
306
+ You are operating under the Agent Enderun governance framework.
307
+
308
+ At the **start of every session**, before any work:
309
+ 1. **Restore Memory:** Read ${frameworkDir}/PROJECT_MEMORY.md to restore state, active Trace ID, and history.
310
+ 2. **Load Identity:** Read the relevant agent definition under ${frameworkDir}/agents/{agent}.md (default to @manager).
311
+ 3. **Internalize Knowledge:** Reference the ${frameworkDir}/knowledge/ base for architectural and coding standards.
312
+
313
+ ### 💾 Memory Tiers
314
+ - **Project Memory (Shared):** ${frameworkDir}/PROJECT_MEMORY.md is the source of truth for task history, Trace IDs, and architectural decisions. **Update this at the end of every turn.**
315
+ - **Private Memory (User-Specific):** Use the local .gitignored memory directory (e.g. ${frameworkDir}/memory/) for personal workflows or user-specific notes that should not be committed to Git. Never use the system's /tmp directory.
316
+ - **Project Instructions:** This .cursorrules file contains the "Supreme Law" and coding standards.
317
+
318
+ ### 🛡️ Core Mandates
319
+ - **Surgical Edits:** Use replace_text or patch_file via MCP for precise changes.
320
+ - **Traceability:** Every action must inherit the active Trace ID from memory.
321
+ - **Contract First:** No implementation without verified types.
322
+ - **NEVER FORGET:** @manager MUST update ${frameworkDir}/PROJECT_MEMORY.md at the end of EVERY session without exception. This is a non-negotiable process integrity rule.
323
+
324
+ All paths and references inside the project must comply with the Supreme Constitution located at ${frameworkDir}/ENDERUN.md`.trim() + "\n",
325
+ dryRun,
326
+ );
327
+ }
328
+
290
329
  if (!fs.existsSync(path.join(targetDir, ".git"))) {
291
330
  try {
292
331
  if (dryRun) {
@@ -308,131 +347,175 @@ describe("Initial Setup", () => {
308
347
  }
309
348
 
310
349
  // Always scaffold Antigravity (.agents/) workspace directory for cross-compatibility with agy CLI
311
- if (adapter.id === "antigravity" || adapter.id === "antigravity-cli") {
350
+ if (adapter.id === "antigravity" || adapter.id === "antigravity-cli" || adapter.id === "gemini") {
312
351
  const agentsFrameworkDir = path.join(targetDir, ".agents");
313
352
  if (!dryRun) {
314
353
  try {
315
354
  fs.mkdirSync(agentsFrameworkDir, { recursive: true });
316
355
  const agentsSubdir = path.join(agentsFrameworkDir, "agents");
317
356
  fs.mkdirSync(agentsSubdir, { recursive: true });
318
-
319
- // Write the 12 agent folders and agent.json files
320
- const allAgents = [
321
- {
322
- name: "manager",
323
- displayName: "Orchestration & Governance (Team-Lead)",
324
- description: "CTO, Lead Architect, and Orchestrator for Agent Enderun.",
325
- instructions: "You are the manager agent. Orchestrate workspace tasks, manage DAG dependency graphs, handle phase transitions, and enforce architectural standards.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Single Point of Authority: You are the sole entry point. No specialist acts without your briefing.\n- Traceability: Every action MUST inherit the active Trace ID.\n- Memory Discipline: MUST update PROJECT_MEMORY.md and log actions at the end of EVERY turn."
326
- },
327
- {
328
- name: "backend",
329
- displayName: "Domain Logic & Databases Specialist",
330
- description: "Responsible for core business logic, database migrations, security standards, API contracts, and server architecture.",
331
- instructions: "You are the backend agent. Build secure, high-performance, and consistent server architecture.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- No UI: Never implement UI or frontend logic.\n- Contract-First: Define shared contracts/branded types BEFORE any consumer code.\n- Branded Types Law: ALL IDs must use branded types (e.g., UserID). Plain strings are forbidden.\n- Zero Mock Policy: Use real endpoints/contracts only.\n- Surgical Edits: Use replace_text for all code changes."
332
- },
333
- {
334
- name: "frontend",
335
- displayName: "Fluid Responsive UI Specialist",
336
- description: "Builds responsive fluid user interfaces, manages styling tokens with Panda CSS, and implements state machines.",
337
- instructions: "You are the frontend agent. Build original, high-performance, and responsive user interfaces.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Responsive-First: Mobile-First (320px) is mandatory. Fixed-width is forbidden.\n- Zero UI Library Policy: No shadcn/ui, MUI, etc. Build everything with Panda CSS.\n- Zero Mock Policy: Use real endpoints/contracts only.\n- Contract-First: Use branded types from apps/backend/src/types.\n- No Native Alerts: Use integrated Toaster/Modal components."
338
- },
339
- {
340
- name: "quality",
341
- displayName: "Automated Testing & Quality Specialist",
342
- description: "Verifies test coverage, audits compliance with the constitution, conducts AST scanning, and verifies CI/CD status.",
343
- instructions: "You are the quality agent. Ensure no code is merged or deployed without meeting standards.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Final Gate: No code merges or deploys proceed without quality sign-off.\n- Verification-First: Audit lint, typecheck, contract drift, and branded types before sign-off.\n- Never Implement: Audit and assess only. Never write application features.\n- Zero Mock Policy: Integration tests must use real/service-compatible backends.\n- Coverage Gate: Reject approvals if coverage falls below >80% threshold in core."
344
- },
345
- {
346
- name: "database",
347
- displayName: "Database Migrations & Tuning Specialist",
348
- description: "Designs SQL schemas, manages migration scripts via Kysely, optimizes queries, indexes, and seeding logic.",
349
- instructions: "You are the database agent. Build secure, optimized, and scalable data layers.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Self-Contained DB: Every backend application MUST manage its own schema/migrations/seeds in its own src/database/ directory.\n- Contract-First: All schemas MUST be derived from branded types.\n- Kysely Standard: Use Kysely for application queries. Raw SQL is forbidden.\n- Zero Mock Policy: Realistic, contract-aware seed data only.\n- Surgical Edits: Use replace_text for all schema/migration changes."
350
- },
351
- {
352
- name: "devops",
353
- displayName: "Infrastructure & CI/CD Specialist",
354
- description: "Handles deployment pipelines, environment variables, system containerization, logging & telemetry integrations.",
355
- instructions: "You are the devops agent. Ensure reliable execution in every environment with strict quality gates.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Gate Approvals: NEVER deploy to production without quality gate approval.\n- No Docker Policy: Prefer native Node.js unless explicitly overridden by manager.\n- Environment Parity: Identical configs across dev/staging/prod (except secrets).\n- Secrets Security: NEVER hardcode secrets. Use environment variables.\n- Rollback First: Deployment is BLOCKED if no documented rollback plan exists."
356
- },
357
- {
358
- name: "explorer",
359
- displayName: "Codebase Discovery Specialist",
360
- description: "Maps code dependencies, performs project scans, identifies architectural gaps, and supports legacy onboarding.",
361
- instructions: "You are the explorer agent. Map project structure and provide deep context to other agents.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Read-Only: Never write production code. Only discover, map, and report.\n- Search-First: Always use search_codebase before reading large files.\n- Surgical Discovery: Focus on entry points and core domain logic.\n- Zero Mock Policy: Analyze real system state only.\n- Traceability: All findings must be linked to a Trace ID."
362
- },
363
- {
364
- name: "git",
365
- displayName: "Version Control Specialist",
366
- description: "Manages commit histories, branches, Trace ID alignment, semantic tagging, and merge conflicts.",
367
- instructions: "You are the git agent. Ensure a clean, atomic, and traceable repository history.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Trace ID Tagging: EVERY commit must include the active Trace ID in the message.\n- Atomic Integrity: Every commit must represent exactly one logical change.\n- Health-First: Never commit code that fails build or basic tests.\n- No Push: Do not run git push without explicit USER approval.\n- No Force: Never use git push --force on public branches."
368
- },
369
- {
370
- name: "mobile",
371
- displayName: "Mobile App Specialist",
372
- description: "Develops cross-platform mobile apps using React Native and Expo with clean component states.",
373
- instructions: "You are the mobile agent. Build high-performance, responsive mobile apps (React Native/Expo).\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Zero UI Library: Same discipline as web. Build UI from scratch.\n- Contract-First: Use shared types from apps/backend/src/types.\n- Responsive-First: Mobile-First approach is mandatory.\n- Safe Area: Handle iOS/Android safe area insets on every screen.\n- Performance: Target 60 FPS."
374
- },
375
- {
376
- name: "native",
377
- displayName: "Native OS Integration Specialist",
378
- description: "Builds lightweight desktop wrappers and system integrations using Tauri or Electron.",
379
- instructions: "You are the native agent. Build secure, efficient desktop apps (Tauri/Electron).\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Security-First: No remote code execution. Mandatory sandboxing and strict CSP.\n- Secure Storage: Use Keychain/Credential Manager for sensitive data.\n- IPC Contract: All communication between frontend and native MUST be typed.\n- Contract-First: Define IPC and data contracts before implementation.\n- Surgical Edits: Use replace_text for all code changes."
380
- },
381
- {
382
- name: "security",
383
- displayName: "Security & Cryptography Specialist",
384
- description: "Enforces authentication flows, CSP policies, credential rotation, RLS constraints, and cryptographic safety.",
385
- instructions: "You are the security agent. Ensure all endpoints, database connections, and authentication flows satisfy strict enterprise compliance policies.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Sandboxed Security First: Enforce Row Level Security (RLS) on all database tables.\n- Credential Rotation Policy: Credentials, keys, and tokens must never be hardcoded. Use vault/env variables.\n- CSP & CORS Strictness: Never open wildcards (*) for CORS or CSP policies.\n- Surgical Edits: Use replace_text for all security patches."
386
- },
387
- {
388
- name: "analyst",
389
- displayName: "Contract Verification & Business Analyst",
390
- description: "Validates business specifications, tests database contract integrity, and audits constitutional compliance.",
391
- instructions: "You are the analyst agent. Independently verify compliance with contracts and specifications between frontend, backend, and the constitution.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Independent Stance: Act as an objective verification gate.\n- Contract-First Law: Ensure contract.version.json perfectly matches types.\n- Escalation Priority: Report all contract drift to manager immediately.\n- Surgical Edits: Use replace_text for all document updates."
392
- }
393
- ];
394
357
 
395
- for (const ag of allAgents) {
396
- const agentDir = path.join(agentsSubdir, ag.name);
397
- fs.mkdirSync(agentDir, { recursive: true });
398
-
399
- const payload = {
400
- name: ag.name,
401
- displayName: ag.displayName,
402
- description: ag.description,
403
- hidden: false,
404
- customAgentSpec: {
405
- customAgent: {
406
- systemPromptSections: [
407
- {
408
- title: "Instructions",
409
- content: ag.instructions
410
- }
411
- ],
412
- toolNames: [
413
- "view_file",
414
- "replace_file_content",
415
- "write_to_file",
416
- "run_command",
417
- "grep_search",
418
- "list_dir"
419
- ]
358
+ // Create other standard Antigravity directories for custom workspace customizations
359
+ fs.mkdirSync(path.join(agentsFrameworkDir, "skills"), { recursive: true });
360
+ fs.mkdirSync(path.join(agentsFrameworkDir, "rules"), { recursive: true });
361
+ fs.mkdirSync(path.join(agentsFrameworkDir, "workflows"), { recursive: true });
362
+
363
+ // Write workspace-specific MCP config
364
+ const mcpBlock = {
365
+ mcpServers: {
366
+ "agent-enderun": {
367
+ command: "node",
368
+ args: [path.join(targetDir, "framework-mcp/dist/index.js")],
369
+ env: {
370
+ "ENDERUN_PROJECT_ROOT": targetDir
371
+ }
420
372
  }
421
373
  }
422
374
  };
423
-
424
375
  fs.writeFileSync(
425
- path.join(agentDir, "agent.json"),
426
- JSON.stringify(payload, null, 2),
376
+ path.join(agentsFrameworkDir, "mcp_config.json"),
377
+ JSON.stringify(mcpBlock, null, 2),
427
378
  "utf8"
428
379
  );
429
- }
430
- console.warn(`✅ Scaffolding ${allAgents.length} Antigravity agents under .agents/agents/...`);
431
- } catch (e) {
380
+
381
+ // Write AGENTS.md at the project root for prepended global rules
382
+ const agentsMdPath = path.join(targetDir, "AGENTS.md");
383
+ if (!fs.existsSync(agentsMdPath)) {
384
+ fs.writeFileSync(
385
+ agentsMdPath,
386
+ `# Agent Enderun Workspace Instructions
387
+
388
+ You are operating under the Agent Enderun AI governance and orchestration framework.
389
+
390
+ ### 🛡️ Critical Guidelines
391
+ 1. **Traceability First:** Every action or execution MUST inherit the active Trace ID from \`${frameworkDir}/PROJECT_MEMORY.md\`.
392
+ 2. **Surgical Operations:** Use precise file replacements or patches. NEVER rewrite entire source files unnecessarily.
393
+ 3. **Contract-First Design:** Backend models and type contracts must be locked and verified before frontend components are created.
394
+ 4. **Memory Synchronization:** All agent runs must update the project memory logs before concluding the session.
395
+
396
+ All rules and constraints defined in \`${frameworkDir}/ENDERUN.md\` are strictly binding.
397
+ `.trim() + "\n",
398
+ "utf8"
399
+ );
400
+ }
401
+
402
+ // Write the 12 agent folders and agent.json files
403
+ const allAgents = [
404
+ {
405
+ name: "manager",
406
+ displayName: "Orchestration & Governance (Team-Lead)",
407
+ description: "CTO, Lead Architect, and Orchestrator for Agent Enderun.",
408
+ instructions: "You are the manager agent. Orchestrate workspace tasks, manage DAG dependency graphs, handle phase transitions, and enforce architectural standards.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Single Point of Authority: You are the sole entry point. No specialist acts without your briefing.\n- Traceability: Every action MUST inherit the active Trace ID.\n- Memory Discipline: MUST update PROJECT_MEMORY.md and log actions at the end of EVERY turn."
409
+ },
410
+ {
411
+ name: "backend",
412
+ displayName: "Domain Logic & Databases Specialist",
413
+ description: "Responsible for core business logic, database migrations, security standards, API contracts, and server architecture.",
414
+ instructions: "You are the backend agent. Build secure, high-performance, and consistent server architecture.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- No UI: Never implement UI or frontend logic.\n- Contract-First: Define shared contracts/branded types BEFORE any consumer code.\n- Branded Types Law: ALL IDs must use branded types (e.g., UserID). Plain strings are forbidden.\n- Zero Mock Policy: Use real endpoints/contracts only.\n- Surgical Edits: Use replace_text for all code changes."
415
+ },
416
+ {
417
+ name: "frontend",
418
+ displayName: "Fluid Responsive UI Specialist",
419
+ description: "Builds responsive fluid user interfaces, manages styling tokens with Panda CSS, and implements state machines.",
420
+ instructions: "You are the frontend agent. Build original, high-performance, and responsive user interfaces.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Responsive-First: Mobile-First (320px) is mandatory. Fixed-width is forbidden.\n- Zero UI Library Policy: No shadcn/ui, MUI, etc. Build everything with Panda CSS.\n- Zero Mock Policy: Use real endpoints/contracts only.\n- Contract-First: Use branded types from apps/backend/src/types.\n- No Native Alerts: Use integrated Toaster/Modal components."
421
+ },
422
+ {
423
+ name: "quality",
424
+ displayName: "Automated Testing & Quality Specialist",
425
+ description: "Verifies test coverage, audits compliance with the constitution, conducts AST scanning, and verifies CI/CD status.",
426
+ instructions: "You are the quality agent. Ensure no code is merged or deployed without meeting standards.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Final Gate: No code merges or deploys proceed without quality sign-off.\n- Verification-First: Audit lint, typecheck, contract drift, and branded types before sign-off.\n- Never Implement: Audit and assess only. Never write application features.\n- Zero Mock Policy: Integration tests must use real/service-compatible backends.\n- Coverage Gate: Reject approvals if coverage falls below >80% threshold in core."
427
+ },
428
+ {
429
+ name: "database",
430
+ displayName: "Database Migrations & Tuning Specialist",
431
+ description: "Designs SQL schemas, manages migration scripts via Kysely, optimizes queries, indexes, and seeding logic.",
432
+ instructions: "You are the database agent. Build secure, optimized, and scalable data layers.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Self-Contained DB: Every backend application MUST manage its own schema/migrations/seeds in its own src/database/ directory.\n- Contract-First: All schemas MUST be derived from branded types.\n- Kysely Standard: Use Kysely for application queries. Raw SQL is forbidden.\n- Zero Mock Policy: Realistic, contract-aware seed data only.\n- Surgical Edits: Use replace_text for all schema/migration changes."
433
+ },
434
+ {
435
+ name: "devops",
436
+ displayName: "Infrastructure & CI/CD Specialist",
437
+ description: "Handles deployment pipelines, environment variables, system containerization, logging & telemetry integrations.",
438
+ instructions: "You are the devops agent. Ensure reliable execution in every environment with strict quality gates.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Gate Approvals: NEVER deploy to production without quality gate approval.\n- No Docker Policy: Prefer native Node.js unless explicitly overridden by manager.\n- Environment Parity: Identical configs across dev/staging/prod (except secrets).\n- Secrets Security: NEVER hardcode secrets. Use environment variables.\n- Rollback First: Deployment is BLOCKED if no documented rollback plan exists."
439
+ },
440
+ {
441
+ name: "explorer",
442
+ displayName: "Codebase Discovery Specialist",
443
+ description: "Maps code dependencies, performs project scans, identifies architectural gaps, and supports legacy onboarding.",
444
+ instructions: "You are the explorer agent. Map project structure and provide deep context to other agents.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Read-Only: Never write production code. Only discover, map, and report.\n- Search-First: Always use search_codebase before reading large files.\n- Surgical Discovery: Focus on entry points and core domain logic.\n- Zero Mock Policy: Analyze real system state only.\n- Traceability: All findings must be linked to a Trace ID."
445
+ },
446
+ {
447
+ name: "git",
448
+ displayName: "Version Control Specialist",
449
+ description: "Manages commit histories, branches, Trace ID alignment, semantic tagging, and merge conflicts.",
450
+ instructions: "You are the git agent. Ensure a clean, atomic, and traceable repository history.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Trace ID Tagging: EVERY commit must include the active Trace ID in the message.\n- Atomic Integrity: Every commit must represent exactly one logical change.\n- Health-First: Never commit code that fails build or basic tests.\n- No Push: Do not run git push without explicit USER approval.\n- No Force: Never use git push --force on public branches."
451
+ },
452
+ {
453
+ name: "mobile",
454
+ displayName: "Mobile App Specialist",
455
+ description: "Develops cross-platform mobile apps using React Native and Expo with clean component states.",
456
+ instructions: "You are the mobile agent. Build high-performance, responsive mobile apps (React Native/Expo).\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Zero UI Library: Same discipline as web. Build UI from scratch.\n- Contract-First: Use shared types from apps/backend/src/types.\n- Responsive-First: Mobile-First approach is mandatory.\n- Safe Area: Handle iOS/Android safe area insets on every screen.\n- Performance: Target 60 FPS."
457
+ },
458
+ {
459
+ name: "native",
460
+ displayName: "Native OS Integration Specialist",
461
+ description: "Builds lightweight desktop wrappers and system integrations using Tauri or Electron.",
462
+ instructions: "You are the native agent. Build secure, efficient desktop apps (Tauri/Electron).\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Security-First: No remote code execution. Mandatory sandboxing and strict CSP.\n- Secure Storage: Use Keychain/Credential Manager for sensitive data.\n- IPC Contract: All communication between frontend and native MUST be typed.\n- Contract-First: Define IPC and data contracts before implementation.\n- Surgical Edits: Use replace_text for all code changes."
463
+ },
464
+ {
465
+ name: "security",
466
+ displayName: "Security & Cryptography Specialist",
467
+ description: "Enforces authentication flows, CSP policies, credential rotation, RLS constraints, and cryptographic safety.",
468
+ instructions: "You are the security agent. Ensure all endpoints, database connections, and authentication flows satisfy strict enterprise compliance policies.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Sandboxed Security First: Enforce Row Level Security (RLS) on all database tables.\n- Credential Rotation Policy: Credentials, keys, and tokens must never be hardcoded. Use vault/env variables.\n- CSP & CORS Strictness: Never open wildcards (*) for CORS or CSP policies.\n- Surgical Edits: Use replace_text for all security patches."
469
+ },
470
+ {
471
+ name: "analyst",
472
+ displayName: "Contract Verification & Business Analyst",
473
+ description: "Validates business specifications, tests database contract integrity, and audits constitutional compliance.",
474
+ instructions: "You are the analyst agent. Independently verify compliance with contracts and specifications between frontend, backend, and the constitution.\n\n🛑 NON-NEGOTIABLE CORE RULES:\n- Independent Stance: Act as an objective verification gate.\n- Contract-First Law: Ensure contract.version.json perfectly matches types.\n- Escalation Priority: Report all contract drift to manager immediately.\n- Surgical Edits: Use replace_text for all document updates."
475
+ }
476
+ ];
477
+
478
+ for (const ag of allAgents) {
479
+ const agentDir = path.join(agentsSubdir, ag.name);
480
+ fs.mkdirSync(agentDir, { recursive: true });
481
+
482
+ const payload = {
483
+ name: ag.name,
484
+ displayName: ag.displayName,
485
+ description: ag.description,
486
+ hidden: false,
487
+ customAgentSpec: {
488
+ customAgent: {
489
+ systemPromptSections: [
490
+ {
491
+ title: "Instructions",
492
+ content: ag.instructions
493
+ }
494
+ ],
495
+ toolNames: [
496
+ "view_file",
497
+ "replace_file_content",
498
+ "write_to_file",
499
+ "run_command",
500
+ "grep_search",
501
+ "list_dir"
502
+ ]
503
+ }
504
+ }
505
+ };
506
+
507
+ fs.writeFileSync(
508
+ path.join(agentDir, "agent.json"),
509
+ JSON.stringify(payload, null, 2),
510
+ "utf8"
511
+ );
512
+ }
513
+ console.warn(`✅ Scaffolding ${allAgents.length} Antigravity agents under .agents/agents/...`);
514
+ } catch {
432
515
  // fallback
516
+ }
433
517
  }
434
518
  }
435
- }
436
519
 
437
520
  console.warn(`\n♊ ${adapter.id.toUpperCase()}: Setup complete.`);
438
521
  console.warn(` • Framework runtime: ${frameworkDir}/`);