agent-enderun 0.8.8 → 0.9.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 (164) hide show
  1. package/.enderun/BRAIN_DASHBOARD.md +5 -5
  2. package/{ENDERUN.md → .enderun/ENDERUN.md} +4 -2
  3. package/.enderun/PROJECT_MEMORY.md +32 -43
  4. package/.enderun/STATUS.md +25 -28
  5. package/.enderun/agents/agent_army_schema.json +29 -7
  6. package/.enderun/agents/backend.md +48 -39
  7. package/.enderun/agents/database.md +55 -0
  8. package/.enderun/agents/devops.md +30 -17
  9. package/.enderun/agents/explorer.md +5 -5
  10. package/.enderun/agents/frontend.md +97 -76
  11. package/.enderun/agents/git.md +4 -4
  12. package/.enderun/agents/manager.md +68 -59
  13. package/.enderun/agents/mobile.md +4 -4
  14. package/.enderun/agents/native.md +106 -0
  15. package/.enderun/agents/quality.md +122 -0
  16. package/.enderun/agents/schema/agent-lifecycle-schema.json +29 -8
  17. package/.enderun/cli-commands.json +7 -3
  18. package/.enderun/config.json +8 -2
  19. package/.enderun/knowledge/SHIM_TEMPLATE.md +25 -0
  20. package/.enderun/knowledge/context_boundary_rules.md +57 -0
  21. package/.enderun/knowledge/corporate-governance/high-risk-action-approval-flow.md +29 -0
  22. package/.enderun/knowledge/documentation_ownership.md +53 -0
  23. package/.enderun/knowledge/eslint-standards.md +63 -0
  24. package/.enderun/knowledge/frontend_professionalization_guidelines.md +7 -7
  25. package/.enderun/knowledge/hermes_live_test_guidelines.md +5 -5
  26. package/.enderun/knowledge/hermes_protocol.md +1 -1
  27. package/.enderun/knowledge/lessons-learned.md +14 -0
  28. package/.enderun/knowledge/manager_authority_audit_enforcement.md +10 -10
  29. package/.enderun/knowledge/project_scaffold_guidelines.md +4 -4
  30. package/.enderun/knowledge/reference_application_guidelines.md +6 -6
  31. package/.enderun/mcp_config.json +9 -0
  32. package/.enderun/memory-graph/agent-contexts/backend.json +1 -1
  33. package/.enderun/memory-graph/agent-contexts/devops.json +1 -1
  34. package/.enderun/memory-graph/agent-contexts/explorer.json +1 -1
  35. package/.enderun/memory-graph/agent-contexts/frontend.json +1 -1
  36. package/.enderun/memory-graph/agent-contexts/git.json +1 -1
  37. package/.enderun/memory-graph/agent-contexts/manager.json +1 -1
  38. package/.enderun/memory-graph/agent-contexts/mobile.json +1 -1
  39. package/.enderun/memory-graph/agent-contexts/native.json +1 -0
  40. package/.enderun/memory-graph/agent-contexts/quality.json +1 -0
  41. package/.enderun/memory-graph/graph.json +123 -15
  42. package/.enderun/memory-graph/shared-facts.json +26 -31
  43. package/.enderun/queue/README.md +13 -13
  44. package/README.md +171 -393
  45. package/agent.md +25 -0
  46. package/bin/cli.js +10 -10
  47. package/bin/init-check.js +69 -0
  48. package/bin/update-contract.js +57 -38
  49. package/bin/validate-agent-army.js +38 -13
  50. package/claude.md +14 -8
  51. package/docs/README.md +24 -16
  52. package/docs/architecture/README.md +9 -0
  53. package/docs/architecture/standards/data-fetching-patterns.md +13 -0
  54. package/docs/architecture/standards/design-system.md +31 -0
  55. package/docs/architecture/standards/logging.md +7 -0
  56. package/docs/architecture/standards/tech-stack.md +9 -0
  57. package/docs/getting-started.md +9 -259
  58. package/docs/user/README.md +35 -0
  59. package/docs/user/action-plan-2026.md +9 -0
  60. package/docs/user/getting-started.md +13 -0
  61. package/docs/user/roadmap.md +13 -0
  62. package/eslint.config.js +68 -0
  63. package/framework-mcp/dist/index.js +178 -24
  64. package/framework-mcp/package.json +6 -33
  65. package/framework-mcp/tsconfig.json +3 -6
  66. package/gemini.md +12 -6
  67. package/grok.md +25 -0
  68. package/package.json +13 -5
  69. package/panda.config.ts +86 -86
  70. package/src/cli/adapters.ts +208 -0
  71. package/src/cli/commands/app.ts +38 -0
  72. package/src/cli/commands/check.ts +87 -0
  73. package/src/cli/commands/compliance.ts +55 -0
  74. package/src/cli/commands/contract.ts +45 -0
  75. package/src/cli/commands/explorer.ts +45 -0
  76. package/src/cli/commands/git.ts +39 -0
  77. package/src/cli/commands/init.ts +272 -0
  78. package/src/cli/commands/knowledge.ts +44 -0
  79. package/src/cli/commands/lint.ts +25 -0
  80. package/src/cli/commands/log.ts +37 -0
  81. package/src/cli/commands/memory.ts +78 -0
  82. package/src/cli/commands/orchestrate.ts +111 -0
  83. package/src/cli/commands/script.ts +20 -0
  84. package/src/cli/commands/security.ts +38 -0
  85. package/src/cli/commands/status.ts +59 -0
  86. package/src/cli/commands/trace.ts +46 -0
  87. package/src/cli/index.ts +74 -2155
  88. package/src/cli/utils/app.ts +764 -0
  89. package/src/cli/utils/claude.ts +56 -0
  90. package/src/cli/utils/fs.ts +139 -0
  91. package/src/cli/utils/memory.ts +141 -0
  92. package/src/cli/utils/pkg.ts +215 -0
  93. package/src/cli/utils/string.ts +48 -0
  94. package/src/cli/utils/time.ts +27 -0
  95. package/tsconfig.json +9 -0
  96. package/.enderun/agents/analyst.md +0 -238
  97. package/.enderun/agents/orchestrator.md +0 -172
  98. package/.enderun/agents/qa.md +0 -124
  99. package/.enderun/agents/security.md +0 -202
  100. package/.enderun/knowledge/api_design_rules.md +0 -6
  101. package/.enderun/knowledge/branded_types_pattern.md +0 -8
  102. package/.enderun/knowledge/code_review_checklist.md +0 -7
  103. package/.enderun/knowledge/contract_versioning.md +0 -7
  104. package/.enderun/knowledge/database_migration.md +0 -6
  105. package/.enderun/knowledge/deployment_checklist.md +0 -7
  106. package/.enderun/knowledge/git_commit_strategy.md +0 -10
  107. package/.enderun/knowledge/monitoring_setup.md +0 -5
  108. package/.enderun/knowledge/performance_guidelines.md +0 -11
  109. package/.enderun/knowledge/repository_patterns.md +0 -9
  110. package/.enderun/knowledge/security_scanning.md +0 -6
  111. package/.enderun/knowledge/testing_standards.md +0 -7
  112. package/.enderun/knowledge/troubleshooting_guide.md +0 -5
  113. package/.enderun/logs/analyst.json +0 -1
  114. package/.enderun/logs/backend.json +0 -1
  115. package/.enderun/logs/devops.json +0 -1
  116. package/.enderun/logs/explorer.json +0 -1
  117. package/.enderun/logs/frontend.json +0 -1
  118. package/.enderun/logs/git.json +0 -1
  119. package/.enderun/logs/manager.json +0 -1
  120. package/.enderun/logs/mobile.json +0 -1
  121. package/.enderun/logs/native.json +0 -1
  122. package/.enderun/logs/orchestrator.json +0 -1
  123. package/.enderun/logs/qa.json +0 -1
  124. package/.enderun/logs/security.json +0 -1
  125. package/.enderun/memory-graph/agent-contexts/analyst.json +0 -1
  126. package/.enderun/memory-graph/agent-contexts/orchestrator.json +0 -1
  127. package/.enderun/memory-graph/agent-contexts/qa.json +0 -1
  128. package/.enderun/memory-graph/agent-contexts/security.json +0 -1
  129. package/.env.example +0 -10
  130. package/cursor.md +0 -19
  131. package/docs/action-plan-2026.md +0 -119
  132. package/docs/roadmap.md +0 -142
  133. package/framework-mcp/README.md +0 -55
  134. package/framework-mcp/dist/schemas.js +0 -84
  135. package/framework-mcp/dist/tools/codebase.js +0 -294
  136. package/framework-mcp/dist/tools/contract.js +0 -197
  137. package/framework-mcp/dist/tools/framework.js +0 -225
  138. package/framework-mcp/dist/tools/git.js +0 -51
  139. package/framework-mcp/dist/tools/governance.js +0 -696
  140. package/framework-mcp/dist/tools/index.js +0 -47
  141. package/framework-mcp/dist/tools/knowledge.js +0 -133
  142. package/framework-mcp/dist/tools/memory.js +0 -217
  143. package/framework-mcp/dist/tools/messages.js +0 -193
  144. package/framework-mcp/dist/tools/monitoring.js +0 -294
  145. package/framework-mcp/dist/tools/orchestration.js +0 -369
  146. package/framework-mcp/dist/tools/pipeline.js +0 -267
  147. package/framework-mcp/dist/tools/security.js +0 -137
  148. package/framework-mcp/dist/utils.js +0 -121
  149. package/framework-mcp/src/index.ts +0 -49
  150. package/framework-mcp/src/schemas.ts +0 -106
  151. package/framework-mcp/src/tools/codebase.ts +0 -284
  152. package/framework-mcp/src/tools/contract.ts +0 -221
  153. package/framework-mcp/src/tools/framework.ts +0 -223
  154. package/framework-mcp/src/tools/git.ts +0 -42
  155. package/framework-mcp/src/tools/governance.ts +0 -891
  156. package/framework-mcp/src/tools/index.ts +0 -50
  157. package/framework-mcp/src/tools/knowledge.ts +0 -141
  158. package/framework-mcp/src/tools/memory.ts +0 -207
  159. package/framework-mcp/src/tools/messages.ts +0 -213
  160. package/framework-mcp/src/tools/monitoring.ts +0 -351
  161. package/framework-mcp/src/tools/orchestration.ts +0 -440
  162. package/framework-mcp/src/tools/pipeline.ts +0 -353
  163. package/framework-mcp/src/tools/security.ts +0 -143
  164. package/framework-mcp/src/utils.ts +0 -130
package/agent.md ADDED
@@ -0,0 +1,25 @@
1
+ # Agent Enderun — Antigravity Adapter
2
+
3
+ This is the primary entry point when using Agent Enderun within the Antigravity (IDE & CLI) ecosystem.
4
+
5
+ The framework operates under a unified governance structure located in the `.enderun/` directory.
6
+
7
+ ### Primary Constitution
8
+ All governance rules, agent checklists, and project memory live here:
9
+
10
+ 👉 **[.enderun/ENDERUN.md](.enderun/ENDERUN.md)**
11
+
12
+ ### 🤖 Agent Directive
13
+ You are operating under the Agent Enderun governance framework.
14
+
15
+ At the **start of every session**, before any work:
16
+ 1. **Restore Memory:** Read `.enderun/PROJECT_MEMORY.md` to restore state, active Trace ID, and history.
17
+ 2. **Load Identity:** Read the relevant agent definition under `.enderun/agents/{agent}.md` (default to `@manager`).
18
+ 3. **Internalize Knowledge:** Reference the `.enderun/knowledge/` base for architectural and coding standards.
19
+
20
+ ### 🛡️ Core Mandates
21
+ - **Surgical Edits:** Use `replace_text` or `patch_file` via MCP for precise changes.
22
+ - **Traceability:** Every action must inherit the active Trace ID from memory.
23
+ - **Contract First:** No implementation without verified types.
24
+
25
+ All paths and references inside the project must comply with the Supreme Constitution located at `.enderun/ENDERUN.md`.
package/bin/cli.js CHANGED
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
- import { spawn } from 'node:child_process';
3
- import { fileURLToPath } from 'node:url';
4
- import { dirname, join } from 'node:path';
2
+ import { spawn } from "node:child_process";
3
+ import { fileURLToPath } from "node:url";
4
+ import { dirname, join } from "node:path";
5
5
 
6
6
  const __filename = fileURLToPath(import.meta.url);
7
7
  const __dirname = dirname(__filename);
8
8
 
9
- const cliPath = join(__dirname, '../src/cli/index.ts');
9
+ const cliPath = join(__dirname, "../src/cli/index.ts");
10
10
 
11
- // shell: false kullanarak argümanların (tırnakların) bozulmasını önle
12
- const child = spawn('npx', ['tsx', cliPath, ...process.argv.slice(2)], {
13
- stdio: 'inherit',
14
- shell: false
11
+ // use shell: false to prevent argument (quote) corruption
12
+ const child = spawn("npx", ["tsx", cliPath, ...process.argv.slice(2)], {
13
+ stdio: "inherit",
14
+ shell: false
15
15
  });
16
16
 
17
- child.on('exit', (code) => {
18
- process.exit(code ?? 0);
17
+ child.on("exit", (code) => {
18
+ process.exit(code ?? 0);
19
19
  });
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "fs";
4
+ import path from "path";
5
+
6
+ const targetDir = process.cwd();
7
+
8
+ const candidates = [".gemini", ".claude", ".agent", ".enderun"];
9
+ let frameworkDir = ".enderun";
10
+ for (const dir of candidates) {
11
+ if (fs.existsSync(path.join(targetDir, dir))) {
12
+ frameworkDir = dir;
13
+ break;
14
+ }
15
+ }
16
+
17
+ let backend = "apps/backend";
18
+ let docs = "docs";
19
+
20
+ try {
21
+ const configPath = path.join(targetDir, frameworkDir, "config.json");
22
+ if (fs.existsSync(configPath)) {
23
+ const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
24
+ if (config.paths) {
25
+ if (config.paths.backend) backend = config.paths.backend;
26
+ if (config.paths.docs) docs = config.paths.docs;
27
+ }
28
+ }
29
+ } catch (e) {
30
+ // ignore
31
+ }
32
+
33
+ const CRITICAL_STRUCTURE = [
34
+ `${frameworkDir}/agents`,
35
+ `${frameworkDir}/knowledge`,
36
+ `${frameworkDir}/memory-graph/agent-contexts`,
37
+ `${frameworkDir}/logs`,
38
+ `${frameworkDir}/queue`,
39
+ `${frameworkDir}/PROJECT_MEMORY.md`,
40
+ `${docs}/architecture/standards`,
41
+ `${backend}/src/database`,
42
+ `${backend}/src/seeds`,
43
+ `${backend}/migrations`
44
+ ];
45
+
46
+ function checkIntegrity() {
47
+ console.warn("🔍 Running Agent Enderun Framework Integrity Check...");
48
+ let isHealthy = true;
49
+
50
+ for (const item of CRITICAL_STRUCTURE) {
51
+ const fullPath = path.join(targetDir, item);
52
+ if (!fs.existsSync(fullPath)) {
53
+ console.error(`❌ Missing critical component: ${item}`);
54
+ isHealthy = false;
55
+ } else {
56
+ console.warn(`✅ Verified: ${item}`);
57
+ }
58
+ }
59
+
60
+ if (isHealthy) {
61
+ console.warn("\n✨ Framework integrity verified. System is healthy.");
62
+ process.exit(0);
63
+ } else {
64
+ console.error("\n❌ Framework integrity check FAILED. Some components are missing.");
65
+ process.exit(1);
66
+ }
67
+ }
68
+
69
+ checkIntegrity();
@@ -1,8 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- /* global console, process */
4
- /* eslint-disable no-console */
5
-
6
3
  import fs from "fs";
7
4
  import path from "path";
8
5
  import crypto from "crypto";
@@ -12,55 +9,77 @@ const __filename = fileURLToPath(import.meta.url);
12
9
  const __dirname = path.dirname(__filename);
13
10
  const projectRoot = path.join(__dirname, "..");
14
11
 
15
- const contractPath = path.join(projectRoot, "apps/backend/contract.version.json");
16
- const sharedTypesDir = path.join(projectRoot, "apps/backend/src/types");
12
+ const candidates = [".gemini", ".claude", ".agent", ".enderun"];
13
+ let frameworkDir = ".enderun";
14
+ for (const dir of candidates) {
15
+ if (fs.existsSync(path.join(projectRoot, dir))) {
16
+ frameworkDir = dir;
17
+ break;
18
+ }
19
+ }
20
+
21
+ let backend = "apps/backend";
22
+ try {
23
+ const configPath = path.join(projectRoot, frameworkDir, "config.json");
24
+ if (fs.existsSync(configPath)) {
25
+ const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
26
+ if (config.paths && config.paths.backend) {
27
+ backend = config.paths.backend;
28
+ }
29
+ }
30
+ } catch (e) {
31
+ // ignore
32
+ }
33
+
34
+ const contractPath = path.join(projectRoot, backend, "contract.version.json");
35
+ const sharedTypesDir = path.join(projectRoot, backend, "src/types");
17
36
 
18
37
  function collectTypeFiles(dir) {
19
- const entries = fs.readdirSync(dir, { withFileTypes: true });
20
- const files = [];
38
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
39
+ const files = [];
21
40
 
22
- for (const entry of entries) {
23
- const fullPath = path.join(dir, entry.name);
24
- if (entry.isDirectory()) {
25
- files.push(...collectTypeFiles(fullPath));
26
- } else if (entry.name.endsWith(".ts")) {
27
- files.push(fullPath);
41
+ for (const entry of entries) {
42
+ const fullPath = path.join(dir, entry.name);
43
+ if (entry.isDirectory()) {
44
+ files.push(...collectTypeFiles(fullPath));
45
+ } else if (entry.name.endsWith(".ts")) {
46
+ files.push(fullPath);
47
+ }
28
48
  }
29
- }
30
49
 
31
- return files;
50
+ return files;
32
51
  }
33
52
 
34
53
  function calculateHash(dir) {
35
- const hash = crypto.createHash("sha256");
36
- const files = collectTypeFiles(dir).sort();
54
+ const hash = crypto.createHash("sha256");
55
+ const files = collectTypeFiles(dir).sort();
37
56
 
38
- files.forEach(file => {
39
- const content = fs.readFileSync(file);
40
- hash.update(path.relative(projectRoot, file));
41
- hash.update("\0");
42
- hash.update(content);
43
- hash.update("\0");
44
- });
57
+ files.forEach(file => {
58
+ const content = fs.readFileSync(file);
59
+ hash.update(path.relative(projectRoot, file));
60
+ hash.update("\0");
61
+ hash.update(content);
62
+ hash.update("\0");
63
+ });
45
64
 
46
- return hash.digest("hex");
65
+ return hash.digest("hex");
47
66
  }
48
67
 
49
68
  try {
50
- console.log("🔍 Calculating shared-types contract hash...");
51
- const newHash = calculateHash(sharedTypesDir);
69
+ console.log("🔍 Calculating shared-types contract hash...");
70
+ const newHash = calculateHash(sharedTypesDir);
52
71
 
53
- const contract = JSON.parse(fs.readFileSync(contractPath, "utf-8"));
72
+ const contract = JSON.parse(fs.readFileSync(contractPath, "utf-8"));
54
73
 
55
- if (contract.contract_hash === newHash) {
56
- console.log("✅ Contract hash is already up to date.");
57
- } else {
58
- contract.contract_hash = newHash;
59
- contract.last_updated = new Date().toISOString();
60
- fs.writeFileSync(contractPath, JSON.stringify(contract, null, 2));
61
- console.log(`🚀 Contract updated with new hash: ${newHash.slice(0, 10)}...`);
62
- }
74
+ if (contract.contract_hash === newHash) {
75
+ console.log("✅ Contract hash is already up to date.");
76
+ } else {
77
+ contract.contract_hash = newHash;
78
+ contract.last_updated = new Date().toISOString();
79
+ fs.writeFileSync(contractPath, JSON.stringify(contract, null, 2));
80
+ console.log(`🚀 Contract updated with new hash: ${newHash.slice(0, 10)}...`);
81
+ }
63
82
  } catch (error) {
64
- console.error("❌ Failed to update contract hash:", error.message);
65
- process.exit(1);
83
+ console.error("❌ Failed to update contract hash:", error.message);
84
+ process.exit(1);
66
85
  }
@@ -3,16 +3,39 @@
3
3
  import fs from "fs";
4
4
  import path from "path";
5
5
 
6
- const frameworkDir = fs.existsSync("./.enderun") ? "./.enderun" : "./.gemini";
7
- const AGENTS_DIR = path.resolve(frameworkDir, "agents");
8
- const SCHEMA_PATH = path.resolve(frameworkDir, "agents/agent_army_schema.json");
6
+ const FRAMEWORK_CANDIDATES = [".gemini", ".claude", ".agent", ".enderun"];
7
+
8
+ function detectFrameworkDir() {
9
+ for (const dir of FRAMEWORK_CANDIDATES) {
10
+ const agentsPath = path.resolve(dir, "agents");
11
+ const schemaPath = path.resolve(dir, "agents/agent_army_schema.json");
12
+ if (fs.existsSync(agentsPath)) {
13
+ return { frameworkDir: dir, agentsDir: agentsPath, schemaPath };
14
+ }
15
+ }
16
+ return null;
17
+ }
18
+
19
+ const detected = detectFrameworkDir();
20
+ if (!detected) {
21
+ console.error("❌ No framework agents/ directory found. Run: agent-enderun init <adapter>");
22
+ console.error(` Looked for: ${FRAMEWORK_CANDIDATES.map((d) => `${d}/agents`).join(", ")}`);
23
+ process.exit(1);
24
+ }
25
+
26
+ const { frameworkDir, agentsDir, schemaPath } = detected;
9
27
 
10
28
  console.log(`🛡️ STARTING AUTOMATED AGENT ARMY VALIDATION (${frameworkDir})...`);
11
29
 
12
30
  try {
13
- const schema = JSON.parse(fs.readFileSync(SCHEMA_PATH, "utf8"));
31
+ if (!fs.existsSync(schemaPath)) {
32
+ console.error(`❌ Schema missing: ${schemaPath}`);
33
+ process.exit(1);
34
+ }
35
+
36
+ const schema = JSON.parse(fs.readFileSync(schemaPath, "utf8"));
14
37
  const requiredKeys = schema.required;
15
- const files = fs.readdirSync(AGENTS_DIR);
38
+ const files = fs.readdirSync(agentsDir);
16
39
  let totalFailed = 0;
17
40
 
18
41
  console.log("--------------------------------------------------");
@@ -21,10 +44,9 @@ try {
21
44
 
22
45
  for (const fileName of files) {
23
46
  if (!fileName.endsWith(".md")) continue;
24
- const filePath = path.join(AGENTS_DIR, fileName);
47
+ const filePath = path.join(agentsDir, fileName);
25
48
  const content = fs.readFileSync(filePath, "utf8");
26
49
 
27
- // Simple YAML frontmatter parser
28
50
  const match = content.match(/^---\n([\s\S]*?)\n---/);
29
51
  if (!match) {
30
52
  console.log(`| ${fileName.padEnd(9)} | ❌ NO YAML | ----- | ---------------- |`);
@@ -34,11 +56,10 @@ try {
34
56
 
35
57
  const yamlContent = match[1];
36
58
  const agent = {};
37
- yamlContent.split("\n").forEach(line => {
59
+ yamlContent.split("\n").forEach((line) => {
38
60
  const [key, ...valParts] = line.split(":");
39
61
  if (key && valParts.length > 0) {
40
62
  let val = valParts.join(":").trim();
41
- // Clean quotes and handle numbers
42
63
  val = val.replace(/^['"]|['"]$/g, "");
43
64
  if (!isNaN(val) && val !== "") {
44
65
  agent[key.trim()] = Number(val);
@@ -48,13 +69,17 @@ try {
48
69
  }
49
70
  });
50
71
 
51
- const missing = requiredKeys.filter(k => agent[k] === undefined);
72
+ const missing = requiredKeys.filter((k) => agent[k] === undefined);
52
73
 
53
74
  if (missing.length > 0) {
54
- console.log(`| ${fileName.replace(".md", "").padEnd(9)} | ❌ FAILED | ----- | ${`Missing: ${missing.join(",")}`.slice(0, 16)} |`);
75
+ console.log(
76
+ `| ${fileName.replace(".md", "").padEnd(9)} | ❌ FAILED | ----- | ${`Missing: ${missing.join(",")}`.slice(0, 16)} |`,
77
+ );
55
78
  totalFailed++;
56
79
  } else {
57
- console.log(`| ${agent.name.padEnd(9)} | ✅ PASSED | ${String(agent.capability).padEnd(5)} | ${agent.role.substring(0,14).padEnd(14)} |`);
80
+ console.log(
81
+ `| ${agent.name.padEnd(9)} | ✅ PASSED | ${String(agent.capability).padEnd(5)} | ${agent.role.substring(0, 14).padEnd(14)} |`,
82
+ );
58
83
  }
59
84
  }
60
85
 
@@ -63,7 +88,7 @@ try {
63
88
  console.error(`❌ Validation failed! Detected ${totalFailed} invalid agent configurations.`);
64
89
  process.exit(1);
65
90
  } else {
66
- console.log("🎉 SUCCESS: All 8 core agents comply 100% with the Master Agent Army Schema!");
91
+ console.log("🎉 SUCCESS: All core agents comply with the Master Agent Army Schema!");
67
92
  }
68
93
  } catch (e) {
69
94
  console.error("❌ Critical error during schema validation:", e);
package/claude.md CHANGED
@@ -1,19 +1,25 @@
1
- # Agent Enderun — Claude Code CLI Adapter
1
+ # Agent Enderun — Claude Code Adapter
2
2
 
3
- This file is the entry point when using Agent Enderun with Claude Code CLI.
3
+ This is the primary entry point when using Agent Enderun within the Claude Code (CLI & Desktop) ecosystem.
4
4
 
5
- The framework installs into the `.claude/` folder for Claude users.
5
+ The framework operates under a unified governance structure located in the `.enderun/` directory.
6
6
 
7
7
  ### Primary Constitution
8
8
  All governance rules, agent checklists, and project memory live here:
9
9
 
10
- 👉 **[.claude/ENDERUN.md](.claude/ENDERUN.md)**
10
+ 👉 **[.enderun/ENDERUN.md](.enderun/ENDERUN.md)**
11
11
 
12
- ### 🤖 Agent Directive (Claude Code CLI users)
12
+ ### 🤖 Agent Directive
13
13
  You are operating under the Agent Enderun governance framework.
14
14
 
15
15
  At the **start of every session**, before any work:
16
- 1. Read `.claude/PROJECT_MEMORY.md` to restore state, active Trace ID, and history.
17
- 2. Read the relevant agent definition under `.claude/agents/{agent}.md` (especially `@manager`).
16
+ 1. **Restore Memory:** Read `.enderun/PROJECT_MEMORY.md` to restore state, active Trace ID, and history.
17
+ 2. **Load Identity:** Read the relevant agent definition under `.enderun/agents/{agent}.md` (default to `@manager`).
18
+ 3. **Internalize Knowledge:** Reference the `.enderun/knowledge/` base for architectural and coding standards.
18
19
 
19
- All paths and references inside `.claude/` use the Claude adapter structure. No migration to other CLIs is required.
20
+ ### 🛡️ Core Mandates
21
+ - **Surgical Edits:** Use `replace_text` or `patch_file` via MCP for precise changes.
22
+ - **Traceability:** Every action must inherit the active Trace ID from memory.
23
+ - **Contract First:** No implementation without verified types.
24
+
25
+ All paths and references inside the project must comply with the Supreme Constitution located at `.enderun/ENDERUN.md`.
package/docs/README.md CHANGED
@@ -1,26 +1,34 @@
1
- # Agent Enderun — Corporate Project Portal
1
+ # Agent Enderun — Governance and Architecture Portal
2
2
 
3
- Welcome to the central documentation portal for your corporate project. This portal is designed to provide your **Agent Army** and human developers with a structured, clean, and unambiguous framework for software design, architecture, and governance.
3
+ This portal is the **Central Knowledge Source** for enterprise projects developed under the Agent Enderun framework. The project's architectural decisions, standards, and governance protocols are sealed here.
4
+
5
+ Unlike ordinary projects, Agent Enderun projects are built on a structure where AI agents operate autonomously but are bound by a rigid, human-authored constitution. This documentation is the **Immutable Guide** for both AI agents (Army) and human developers.
4
6
 
5
7
  ---
6
8
 
7
- ## 📂 Documentation Directory
9
+ ### 📋 Documentation Guide
8
10
 
9
- ### [1. Architecture & Governance](architecture/)
10
- - **[Architecture Decisions (ADRs)](architecture/decisions/)**: Log of key architectural choices and design patterns.
11
- - **[Approval & High-Risk Workflows](architecture/approval-flows.md)**: Detailed contracts and state machines for `managerApproval` tokens.
12
- - **[Notification Strategy](architecture/notification-strategy.md)**: Dynamic notification patterns and toaster integrations.
11
+ #### [1. Architecture & Governance](architecture/)
12
+ * **[Approval & High-Risk Workflows](architecture/approval-flows.md)**: Explains how tokens are generated, audited, and how high-risk actions (e.g., database deletion, privilege escalation) are sealed.
13
13
 
14
- ### [2. Frontend Standards](frontend/)
15
- - **[Component Patterns](frontend/component-patterns.md)**: Guidelines for custom, Zero-UI-Library React components styled with Panda CSS.
16
- - **[Form Validations](frontend/forms.md)**: Type-safe form states using Zod and React hooks.
17
- - **[Toaster Notifications](frontend/notifications.md)**: Integration guides for Sonner toast configurations.
14
+ #### [2. Frontend Standards](frontend/)
15
+ * **[Component Patterns](frontend/component-patterns.md)**: Zero-UI-Library policy, guide on how all components are hand-crafted and type-safe using Panda CSS.
18
16
 
19
- ### [3. Backend Standards](backend/)
20
- - **[Error Handling](backend/error-handling.md)**: Standardized `DomainError` class hierarchies and Fastify error maps.
21
- - **[Audit Logging](backend/audit-logging.md)**: Database auditing schemes and transaction log contracts.
17
+ #### [3. Backend Standards](backend/)
18
+ * **[Error Handling](backend/error-handling.md)**: Professional error management hierarchy that does not leak to the front-end and is traceable in logs.
22
19
 
23
20
  ---
24
21
 
25
- > [!TIP]
26
- > **Enforcement Rule:** All agents in the army are mandated to read these guidelines before writing any code, ensuring 100% architectural alignment and clean, modular codebase organization.
22
+ ## 🛰️ Phase-Based Development Life Cycle
23
+ All projects must pass the following 5 phases sequentially and completely:
24
+
25
+ 1. **PHASE_0 (Discovery):** Tech-stack (`tech-stack.md`) sealed, risk analysis performed.
26
+ 2. **PHASE_1 (Architecture & Contract):** First, types and API contracts are written. Contracts must be approved before a single line of application code is written.
27
+ 3. **PHASE_2 (Core Development):** Backend and Frontend are built in parallel. Branded Types usage is mandatory.
28
+ 4. **PHASE_3 (Integration & Test):** @quality agent takes over. 80% Test Coverage threshold must be met before proceeding to the next phase.
29
+ 5. **PHASE_4 (Optimization & Deployment):** Security scans and performance tests are completed.
30
+
31
+ > **Agent Directive:** The documents under this folder define the operational boundaries of the agents. An agent cannot deviate from a rule defined here. If a rule needs to be updated, this can only be done with @manager approval and ADR registration.
32
+
33
+ **Version:** v0.9.1
34
+ **Status:** Active Governance
@@ -0,0 +1,9 @@
1
+ # Architecture Patterns — Agent Enderun
2
+
3
+ This directory contains the non-negotiable technical standards and architectural patterns for the Agent Enderun framework.
4
+
5
+ ## Directory Structure
6
+ - `standards/`: Technical SOPs, design systems, and compliance mandates.
7
+
8
+ ## Core Mandate
9
+ All agents MUST read and adhere to these documents before initiating any implementation task.
@@ -0,0 +1,13 @@
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.
@@ -0,0 +1,31 @@
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.
@@ -0,0 +1,7 @@
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.
@@ -0,0 +1,9 @@
1
+ # Tech Stack — Agent Enderun (Enterprise)
2
+
3
+ - **Execution Profile:** Full (Enterprise)
4
+ - **Frontend:** React (Vite), Panda CSS (Zero UI Library)
5
+ - **Backend:** Fastify API, Kysely (Query Builder)
6
+ - **Database:** PostgreSQL
7
+ - **Testing:** Vitest (Integration + Unit)
8
+ - **Auth:** Contract-first (Type definitions)
9
+ - **Versioning:** API-path versioning (/api/v1/...)