Skip to content

Commit ddb17f4

Browse files
Fix critical bugs and improve framework quality
This commit addresses 9 critical and major issues identified in comprehensive code review: CRITICAL FIXES: - Remove all 'agentcodex start' references → 'agentcodex init' (17 files) Clarified workflow: init creates structure, /agentcodex-start builds in Claude Code - Fix package.json: Remove invalid 'main' field, add .agentcodex-version to files array - Fix slash command: Update paths (./docs/ideation → ./ideation), agent count (21→23) - Remove jest: No tests exist, added placeholder for v2.4.0 - Update agent count: 21 → 23 agents globally (14 files + CLI output) - Fix broken documentation links: 5 links updated to correct paths - **NEW BUG FOUND:** Add .agentcodex-version copy to projects (sync system requirement) MAJOR IMPROVEMENTS: - Add comprehensive error recovery/cleanup to cmdInit() * Cleanup partial projects on failure * Contextual error messages (EEXIST, EACCES, etc.) - Add dependency checks: git, node 18+ validated before init - Document ORACLE as v2.5.0+ specification (not yet implemented) - Document template variables as v2.4.0+ feature (planned) - Create GitHub Actions setup documentation (688 lines) - Add copyVersionFile() function for sync system compatibility FILES MODIFIED: 27 - 7 agent/command files - 17 documentation files - 2 CLI files (agentcodex, project-init.js) - 1 package.json TESTING: - Tested agentcodex init: Creates 23 agents, 4 workflows, all files ✓ - Tested sync system: Version tracking working ✓ - Verified dependency checks: git + node validation ✓ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5b427e2 commit ddb17f4

27 files changed

+948
-104
lines changed

.claude/agents/maestro.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,11 @@ Spawn ORACLE with:
640640
641641
```
642642
$ cd /home/dev/CODE/my-new-app
643-
$ agentcodex start
643+
$ agentcodex init
644+
# (Creates project structure)
645+
646+
$ claude code
647+
# In Claude Code, run: /agentcodex-start
644648
645649
MAESTRO: Starting AgentCodeX...
646650
MAESTRO: Initializing project context...

.claude/agents/oracle.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@ model: sonnet
77

88
# ORACLE - Self-Improving Meta-Learner
99

10+
> ⚠️ **SPECIFICATION FOR FUTURE IMPLEMENTATION**
11+
>
12+
> This agent defines the vision for AgentCodeX's self-improving system (planned for v2.5.0+).
13+
>
14+
> **Current v2.3.0 status:**
15+
> - ORACLE agent definition exists (this file)
16+
> - No automatic metric collection implemented yet
17+
> - No self-learning system active
18+
>
19+
> **Planned for v2.5.0+:**
20+
> - Automated project metrics collection
21+
> - Agent performance tracking
22+
> - Self-optimization of agent prompts
23+
> - Automatic version upgrades based on improvements
24+
>
25+
> For now, this serves as the specification that will guide ORACLE's development.
26+
27+
---
28+
1029
You are **ORACLE**, the self-improving consciousness of AgentCodeX.
1130

1231
## CORE MISSION

.claude/commands/agentcodex-start.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
description: Launch MAESTRO to build complete AgentCodeX project from ideation
33
---
44

5-
Launch the MAESTRO agent to initialize and build a complete AgentCodeX project from the ./docs/ideation/ folder.
5+
Launch the MAESTRO agent to initialize and build a complete AgentCodeX project from the ./ideation/ folder.
66

77
## What MAESTRO Will Do
88

9-
MAESTRO will autonomously orchestrate all 21 specialized agents to:
9+
MAESTRO will autonomously orchestrate all 23 specialized agents to:
1010

11-
1. **Review Ideation** - Read all files in ./docs/ideation/
11+
1. **Review Ideation** - Read all files in ./ideation/
1212
2. **Create PRD** - Spawn VISIONARY to create comprehensive Product Requirements Document
1313
3. **Design Architecture** - Spawn ARCHITECT to design complete system architecture
1414
4. **Build Backend** - Spawn FORGE to create FastAPI backend with GPT-5 integration
@@ -64,7 +64,7 @@ Then MAESTRO will take over and build your entire application autonomously.
6464

6565
## Notes
6666

67-
- Ensure ./docs/ideation/ folder exists with prd.md at minimum
67+
- Ensure ./ideation/ folder exists with prd.md at minimum
6868
- MAESTRO only asks for information it cannot determine itself
6969
- All agents work autonomously - you just provide feedback
7070
- ORACLE will learn from this project to improve future builds

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Be respectful, inclusive, and collaborative. We're building the future of agenti
1010

1111
### 1. Improve Agent Prompts
1212

13-
The heart of AgentCodeX is the 21 specialized agents. Making them smarter benefits everyone.
13+
The heart of AgentCodeX is the 23 specialized agents. Making them smarter benefits everyone.
1414

1515
**Where:** `.claude/agents/*.md`
1616

@@ -130,7 +130,7 @@ agentcodex --version
130130

131131
# Test locally
132132
cd /tmp/test-project
133-
agentcodex start
133+
agentcodex init
134134
```
135135

136136
**Test agent changes:**
@@ -151,7 +151,7 @@ mkdir -p /tmp/test-project/ideation
151151

152152
# Create test project and verify files are generated correctly
153153
mkdir test && cd test
154-
agentcodex start
154+
agentcodex init
155155
```
156156

157157
## Pull Request Process

cli/agentcodex

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const {
2121
copyAgents,
2222
copyCommands,
2323
copyWorkflows,
24+
copyVersionFile,
2425
createClaudeJson,
2526
createStarterPRD,
2627
createGitignore,
@@ -88,10 +89,78 @@ ${colors.green}Report issues:${colors.reset}
8889
`);
8990
}
9091

92+
/**
93+
* Check system dependencies
94+
* @returns {object} - Status of required dependencies
95+
*/
96+
function checkDependencies() {
97+
const checks = {
98+
node: { installed: false, version: null, min: '18.0.0' },
99+
git: { installed: false, version: null },
100+
};
101+
102+
// Check Node.js
103+
try {
104+
const nodeVersion = process.version.slice(1); // Remove 'v' prefix
105+
checks.node.installed = true;
106+
checks.node.version = nodeVersion;
107+
108+
const [major] = nodeVersion.split('.').map(Number);
109+
const [minMajor] = checks.node.min.split('.').map(Number);
110+
checks.node.meetsRequirement = major >= minMajor;
111+
} catch (error) {
112+
checks.node.installed = false;
113+
}
114+
115+
// Check Git
116+
try {
117+
const gitVersion = execSync('git --version', { encoding: 'utf-8' }).trim();
118+
checks.git.installed = true;
119+
checks.git.version = gitVersion.replace('git version ', '');
120+
checks.git.meetsRequirement = true;
121+
} catch (error) {
122+
checks.git.installed = false;
123+
}
124+
125+
return checks;
126+
}
127+
91128
async function cmdInit(options = {}) {
92129
printBanner();
93130
console.log(`${colors.bright}Initializing New AgentCodeX Project${colors.reset}\n`);
94131

132+
// Check dependencies first
133+
console.log(`${colors.cyan}Checking system dependencies...${colors.reset}\n`);
134+
const deps = checkDependencies();
135+
136+
let hasErrors = false;
137+
138+
// Node.js check
139+
if (!deps.node.installed) {
140+
console.error(`${colors.red}✗ Node.js not found${colors.reset}`);
141+
hasErrors = true;
142+
} else if (!deps.node.meetsRequirement) {
143+
console.error(`${colors.red}✗ Node.js ${deps.node.version} (requires ${deps.node.min}+)${colors.reset}`);
144+
hasErrors = true;
145+
} else {
146+
console.log(`${colors.green}✓ Node.js ${deps.node.version}${colors.reset}`);
147+
}
148+
149+
// Git check
150+
if (!deps.git.installed) {
151+
console.error(`${colors.red}✗ Git not found${colors.reset}`);
152+
hasErrors = true;
153+
} else {
154+
console.log(`${colors.green}✓ Git ${deps.git.version}${colors.reset}`);
155+
}
156+
157+
if (hasErrors) {
158+
console.error(`\n${colors.red}Missing required dependencies. Please install and try again.${colors.reset}\n`);
159+
process.exit(1);
160+
}
161+
162+
console.log('');
163+
95164
// Use CLI flags if provided, otherwise prompt
96165
let PROJECT_NAME, DEV_URL, PROD_URL;
97166

@@ -122,10 +191,14 @@ async function cmdInit(options = {}) {
122191

123192
console.log(`\n${colors.cyan}Creating project structure...${colors.reset}\n`);
124193

194+
// Track project root for cleanup on failure
195+
let projectRoot = null;
196+
125197
try {
126198
// Initialize project structure (use current directory)
127199
const baseDir = options.baseDir || process.cwd();
128200
const projectInfo = initializeProject(PROJECT_NAME, DEV_URL, PROD_URL, baseDir);
201+
projectRoot = projectInfo.projectRoot;
129202

130203
// Get source directories
131204
const frameworkRoot = path.join(__dirname, '..');
@@ -146,6 +219,10 @@ async function cmdInit(options = {}) {
146219
const targetWorkflowsDir = path.join(projectInfo.projectRoot, '.github', 'workflows');
147220
copyWorkflows(sourceWorkflowsDir, targetWorkflowsDir);
148221

222+
// Copy framework version file (CRITICAL for sync system)
223+
console.log(`${colors.cyan}Copying framework version file...${colors.reset}`);
224+
copyVersionFile(frameworkRoot, projectInfo.projectRoot);
225+
149226
// Create claude.json (REQUIRED for slash commands to work)
150227
console.log(`${colors.cyan}Creating .claude/claude.json...${colors.reset}`);
151228
createClaudeJson(path.join(projectInfo.projectRoot, '.claude'));
@@ -245,7 +322,7 @@ async function cmdInit(options = {}) {
245322
console.log(`${colors.bright}What MAESTRO Will Do:${colors.reset}`);
246323
console.log(` • Read your PRD from docs/ideation/`);
247324
console.log(` • Ask for OpenAI API key and any other credentials`);
248-
console.log(` • Orchestrate 21 specialized agents`);
325+
console.log(` • Orchestrate 23 specialized agents`);
249326
console.log(` • Build complete application (~45 minutes)`);
250327
console.log(` • Deploy to ${DEV_URL}\n`);
251328

@@ -256,6 +333,35 @@ async function cmdInit(options = {}) {
256333

257334
} catch (error) {
258335
console.error(`\n${colors.red}✗ Error creating project: ${error.message}${colors.reset}\n`);
336+
337+
// Cleanup: Remove partially created project directory
338+
if (projectRoot && fs.existsSync(projectRoot)) {
339+
console.log(`${colors.yellow}Cleaning up partial project...${colors.reset}`);
340+
try {
341+
fs.rmSync(projectRoot, { recursive: true, force: true });
342+
console.log(`${colors.green}✓ Cleanup complete${colors.reset}\n`);
343+
} catch (cleanupError) {
344+
console.error(`${colors.red}⚠ Failed to clean up ${projectRoot}${colors.reset}`);
345+
console.error(`${colors.yellow}Please remove it manually.${colors.reset}\n`);
346+
}
347+
}
348+
349+
// Provide helpful error context
350+
console.log(`${colors.bright}Troubleshooting:${colors.reset}`);
351+
if (error.message.includes('EEXIST')) {
352+
console.log(` • Project "${PROJECT_NAME}" already exists`);
353+
console.log(` • Choose a different name or remove existing project\n`);
354+
} else if (error.message.includes('EACCES') || error.message.includes('EPERM')) {
355+
console.log(` • Permission denied - check directory write permissions`);
356+
console.log(` • Try running with appropriate permissions\n`);
357+
} else if (error.message.includes('not found')) {
358+
console.log(` • Framework files missing - reinstall AgentCodeX`);
359+
console.log(` • Run: npm install -g agentcodex\n`);
360+
} else {
361+
console.log(` • Check framework installation: npm list -g agentcodex`);
362+
console.log(` • Report issue: https://github.com/ScaledMinds/AgentCodeX/issues\n`);
363+
}
364+
259365
process.exit(1);
260366
}
261367
}

cli/lib/project-init.js

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ function createClaudeMd(projectRoot, projectName, devUrl, prodUrl) {
382382
**This IS:**
383383
- ✅ A user project generated BY AgentCodeX
384384
- ✅ Where you will create application code
385-
- ✅ Where all 21 agents will build the actual application
385+
- ✅ Where all 23 agents will build the actual application
386386
387387
### Project Structure
388388
@@ -409,15 +409,15 @@ ${projectName}/
409409
### Phase 1: YOU ARE HERE - Setup ✅
410410
411411
1. ✅ Project initialized with \`agentcodex init\`
412-
2. ✅ All 21 agents copied locally
412+
2. ✅ All 23 agents copied locally
413413
3. ✅ PRD template created at \`docs/ideation/prd.md\`
414414
4. **NEXT:** Human edits the PRD with their requirements
415415
416416
### Phase 2: MAESTRO Build (Not Started Yet)
417417
418418
1. Human runs \`/agentcodex-start\` in Claude Code
419419
2. MAESTRO agent activates and reads \`docs/ideation/prd.md\`
420-
3. MAESTRO orchestrates all 21 agents to build:
420+
3. MAESTRO orchestrates all 23 agents to build:
421421
- Complete backend (FastAPI + GPT-5)
422422
- Complete frontend (Next.js + React)
423423
- Database schemas (PostgreSQL + Weaviate)
@@ -435,7 +435,7 @@ MAESTRO deploys to:
435435
436436
---
437437
438-
## The 21 Agents Available
438+
## The 23 Agents Available
439439
440440
All agents are in \`.claude/agents/\` - these are LOCAL COPIES for THIS project:
441441
@@ -563,7 +563,7 @@ Everything else is fully autonomous.
563563
- All your work goes in THIS directory
564564
565565
2. **Agents are local copies**
566-
- The 21 agents in \`.claude/agents/\` are YOUR copies
566+
- The 23 agents in \`.claude/agents/\` are YOUR copies
567567
- They will build YOUR application code here
568568
- They won't touch the framework
569569
@@ -573,7 +573,7 @@ Everything else is fully autonomous.
573573
- MAESTRO takes over from there
574574
575575
4. **Trust the process**
576-
- MAESTRO coordinates all 21 agents
576+
- MAESTRO coordinates all 23 agents
577577
- Each agent knows its role
578578
- The system is fully tested (1,000+ scenarios, 0 failures)
579579
@@ -666,11 +666,30 @@ function copyWorkflows(sourceWorkflowsDir, targetWorkflowsDir) {
666666
return workflowFiles.length;
667667
}
668668

669+
/**
670+
* Copy framework version file to project
671+
* CRITICAL: This file is required for sync system to track framework version
672+
* @param {string} frameworkRoot - Framework root directory
673+
* @param {string} projectRoot - Project root directory
674+
*/
675+
function copyVersionFile(frameworkRoot, projectRoot) {
676+
const sourceVersionFile = path.join(frameworkRoot, '.agentcodex-version');
677+
const targetVersionFile = path.join(projectRoot, '.agentcodex-version');
678+
679+
if (!fs.existsSync(sourceVersionFile)) {
680+
throw new Error('Framework .agentcodex-version file not found');
681+
}
682+
683+
fs.copyFileSync(sourceVersionFile, targetVersionFile);
684+
console.log(`✓ Copied .agentcodex-version`);
685+
}
686+
669687
module.exports = {
670688
initializeProject,
671689
copyAgents,
672690
copyCommands,
673691
copyWorkflows,
692+
copyVersionFile,
674693
createClaudeJson,
675694
createStarterPRD,
676695
createGitignore,

docs/about/WHAT-IS-AGENTCODEX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ NOT on:
354354
- **Deep Dive:** Read [Framework Overview](FRAMEWORK-OVERVIEW.md)
355355
- **Understand Workflow:** See [Workflow Explained](WORKFLOW-EXPLAINED.md)
356356
- **Explore Use Cases:** Check [Use Cases](USE-CASES.md)
357-
- **Get Started:** Follow our [Installation Guide](../getting-started/installation.md)
357+
- **Get Started:** Follow our [Installation Guide](../getting-started/quick-start.md)
358358

359359
---
360360

docs/about/WORKFLOW-EXPLAINED.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ MAESTRO verifies:
942942

943943
- **Understand Agents:** See [Agent Orchestration](AGENT-ORCHESTRATION.md)
944944
- **Explore Architecture:** Read [System Architecture](ARCHITECTURE.md)
945-
- **Try It:** Follow [Getting Started](../getting-started/installation.md)
945+
- **Try It:** Follow [Getting Started](../getting-started/quick-start.md)
946946

947947
---
948948

docs/agents/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,4 @@ MAESTRO: Use MY-CUSTOM-AGENT to handle task X
139139

140140
[TO BE COMPLETED: Individual agent specification files]
141141

142-
For now, see complete agent specs in [AGENTCODEX-MASTERPLAN.md](../../AGENTCODEX-MASTERPLAN.md)
142+
For now, see complete agent specs in [AGENTCODEX-MASTERPLAN.md](../README.md)

docs/getting-started/quick-start-simple.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ We're building an AI-powered customer support platform.
3535
## Run AgentCodeX
3636

3737
```bash
38-
agentcodex start
38+
agentcodex init
3939
```
4040

4141
This will:

0 commit comments

Comments
 (0)