@defai.digital/automatosx 5.3.1 → 5.3.4

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/CHANGELOG.md CHANGED
@@ -5,6 +5,185 @@ All notable changes to AutomatosX will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [5.3.4] - 2025-10-14
9
+
10
+ ### 🚀 Enhanced Delegation Depth for Coordinators (Phase 2 Pilot)
11
+
12
+ **This release implements Phase 2 of the user-requested delegation enhancements, increasing delegation depth from 1-2 to 3 layers for coordinator agents while maintaining robust safety mechanisms.**
13
+
14
+ #### Added
15
+
16
+ - **3-Layer Delegation Support**:
17
+ - **CTO (Tony)**: Strategic coordinator (`maxDelegationDepth: 3`) - orchestrate multi-phase technical initiatives
18
+ - Layer 1: Direct delegation to implementation teams
19
+ - Layer 2: Coordinated cross-team initiatives
20
+ - Layer 3: Strategic multi-phase projects with sub-coordination
21
+ - **DevOps (Oliver)**: Infrastructure coordinator (`maxDelegationDepth: 3`) - manage complex deployment pipelines
22
+ - Layer 1: Direct delegation to development teams
23
+ - Layer 2: Cross-team infrastructure initiatives
24
+ - Layer 3: Complex deployment pipelines with multiple coordination points
25
+ - **Data Scientist (Dana)**: Data science coordinator (`maxDelegationDepth: 3`) - orchestrate end-to-end ML workflows
26
+ - Layer 1: Direct delegation to data engineer, backend, quality
27
+ - Layer 2: Cross-functional analytics initiatives
28
+ - Layer 3: End-to-end ML pipelines with multiple coordination points
29
+
30
+ - **Improved Depth Enforcement Logic** (`src/agents/executor.ts:755-757`):
31
+ - Changed depth checking from `fromAgent` to delegation chain `initiator`
32
+ - Allows coordinators to delegate through implementers without hitting depth limits
33
+ - Example: CTO (depth 3) → Backend (depth 1) → Frontend (depth 1) → Done ✅
34
+ - Previously would fail at 2nd delegation due to Backend's depth 1 limit ❌
35
+
36
+ - **Comprehensive Test Coverage**:
37
+ - Created `tests/unit/executor-delegation-depth-3.test.ts` with 15 new tests
38
+ - 5 tests for 3-layer success scenarios
39
+ - 3 tests for 4-layer rejection (exceeds limit)
40
+ - 3 tests for backward compatibility
41
+ - 2 tests for cycle detection at 3 layers
42
+ - 2 tests for delegation chain tracking
43
+ - **All 1,717 tests passing** (100% pass rate)
44
+
45
+ #### Changed
46
+
47
+ - **Agent Configuration Updates**:
48
+ - `.automatosx/agents/cto.yaml`: `maxDelegationDepth: 1 → 3` (strategic coordinator)
49
+ - `.automatosx/agents/devops.yaml`: `maxDelegationDepth: 0 → 3` (infrastructure coordinator)
50
+ - `.automatosx/agents/data-scientist.yaml`: `maxDelegationDepth: 1 → 3` (data science coordinator)
51
+ - Updated system prompts to reflect new coordinator roles
52
+
53
+ - **Delegation Safety**:
54
+ - Existing cycle detection continues to work at all depth levels
55
+ - 4-layer delegation attempts are rejected with clear error messages
56
+ - Implementer agents (Backend, Frontend, etc.) remain at `maxDelegationDepth: 1`
57
+
58
+ #### Fixed
59
+
60
+ - **Windows Provider Detection** (`src/providers/base-provider.ts`):
61
+ - Fixed provider CLI detection on Windows by using cross-platform `findOnPath()` from `cli-provider-detector`
62
+ - Previously, `spawn('claude', ['--version'])` would fail on Windows because Node.js doesn't auto-append `.cmd` extension
63
+ - Now uses `where.exe` + PATH×PATHEXT fallback for proper Windows detection
64
+ - **Impact**: Providers installed via npm on Windows (e.g., `claude.cmd`) are now correctly detected
65
+ - **Issue**: Users could run `claude` in terminal but AutomatosX showed "provider unavailable"
66
+
67
+ #### Documentation
68
+
69
+ - **CLAUDE.md**: Updated Agent Directory & Governance section with v5.3.4 enhancements
70
+ - **CHANGELOG.md**: This entry documenting all Phase 2 changes
71
+
72
+ #### Technical Details
73
+
74
+ **Depth Enforcement Change** (Breaking for test implementations, not user-facing):
75
+
76
+ ```typescript
77
+ // Before (v5.3.3 and earlier):
78
+ const maxDepth = fromAgentProfile.orchestration?.maxDelegationDepth ?? 2;
79
+
80
+ // After (v5.3.4):
81
+ const initiatorName = delegationChain.length > 0 ? delegationChain[0] : request.fromAgent;
82
+ const initiatorProfile = await this.profileLoader.loadProfile(initiatorName);
83
+ const maxDepth = initiatorProfile.orchestration?.maxDelegationDepth ?? 2;
84
+ ```
85
+
86
+ **Impact**: Allows coordinators to orchestrate deep delegation chains through implementers without hitting depth limits. Implementers can still only delegate once, but coordinator's depth limit applies to the entire chain.
87
+
88
+ #### Performance
89
+
90
+ - No performance impact: Logic change is O(1) (single profile lookup)
91
+ - All existing tests passing (1,717 tests, 100% pass rate)
92
+ - Test execution time: ~50s (no regression)
93
+
94
+ #### Migration
95
+
96
+ **100% Backward Compatible** - No action required for existing deployments:
97
+
98
+ - Default `maxDelegationDepth` remains 2 for agents without orchestration config
99
+ - Implementer agents (Backend, Frontend, etc.) remain at depth 1
100
+ - Only 3 coordinator agents updated to depth 3 (CTO, DevOps, Data Scientist)
101
+ - Existing delegation logic fully preserved
102
+
103
+ ## [5.3.3] - 2025-10-14
104
+
105
+ ### 🏗️ Foundation for Agent Optimization
106
+
107
+ **This release establishes the infrastructure and comprehensive analysis for intelligent ability loading, setting the stage for 50-90% token savings in v5.4.0.**
108
+
109
+ #### Added
110
+
111
+ - **Ability Metadata Infrastructure**:
112
+ - Created `schema/ability-metadata.json` with tier framework (core/advanced/specialized)
113
+ - Established foundation for intelligent ability loading system
114
+ - Defined tier constraints: core ≤250 words, advanced ≤600 words, specialized unlimited
115
+ - Infrastructure ready for task complexity-based loading (v5.4.0)
116
+
117
+ - **Comprehensive Optimization Analysis**:
118
+ - Complete analysis of all 16 agents and 63 abilities (`automatosx/PRD/v5.3-agent-optimization.md`)
119
+ - Token waste analysis identifying 50-92% savings potential
120
+ - Ability classification matrix (core/advanced/specialized)
121
+ - Per-agent optimization recommendations
122
+ - 4-phase implementation roadmap
123
+
124
+ - **User Feedback Integration** (`automatosx/PRD/v5.4.0_Recommendations_and_Roadmap.md`):
125
+ - Agent role expansion strategy (community-driven framework for 50+ roles)
126
+ - Delegation Guard architecture (cycle detection, deadlock prevention)
127
+ - Configurable timeout system (25→35-45 minutes)
128
+ - Delegation depth increase plan (2→3 levels with safety guards)
129
+ - Prioritized implementation roadmap (P0-P3)
130
+
131
+ - **Technical Implementation Specifications** (`automatosx/PRD/v5.4.0_Implementation_Guide.md`):
132
+ - Detailed architecture diagrams for Delegation Guard
133
+ - Graph-based cycle detection algorithm
134
+ - Role similarity scoring mechanism
135
+ - Context preservation for deep delegation chains
136
+ - Complete code examples and integration points
137
+
138
+ - **Feature Roadmap** (`automatosx/PRD/FEATURE-ROADMAP-v5.4.md`):
139
+ - Agent interaction visualizer
140
+ - Public agent/ability registry
141
+ - Interactive debugger
142
+ - Provider response caching
143
+ - Git and CI/CD integrations
144
+ - Enterprise features (RBAC, audit logging, secrets management)
145
+
146
+ #### Documentation
147
+
148
+ - **v5.3-agent-optimization.md**: Complete optimization analysis with ability classification matrix, intelligent loading strategy, and success metrics
149
+ - **v5.3.3-implementation-plan.md**: Foundation release plan and roadmap for v5.4.0
150
+ - **v5.4.0_Recommendations_and_Roadmap.md**: User feedback analysis with prioritized P0-P3 recommendations
151
+ - **v5.4.0_Implementation_Guide.md**: Technical specifications with pseudocode and implementation details
152
+ - **FEATURE-ROADMAP-v5.4.md**: General feature roadmap for future releases
153
+
154
+ #### Performance Impact (Foundation for v5.4.0)
155
+
156
+ No immediate performance changes in v5.3.3. This release establishes infrastructure for v5.4.0 optimizations:
157
+
158
+ | Agent | Current Avg Tokens | v5.4.0 Target | Savings | Use Case |
159
+ |-------|-------------------|---------------|---------|----------|
160
+ | Creative marketer | 5,242 | 400-800 | **85-92%** | Simple social media |
161
+ | Design | 1,468 | 250-600 | **59-83%** | Quick wireframes |
162
+ | Mobile | 1,732 | 250-500 | **71-86%** | Basic UI questions |
163
+ | Data scientist | 992 | 250-500 | **50-75%** | Simple data queries |
164
+ | Backend | 1,185 | 350-600 | **41-70%** | Simple CRUD |
165
+ | Frontend | 846 | 250-450 | **47-70%** | Component questions |
166
+
167
+ **Overall**: 50-90% token reduction for simple tasks while maintaining full power for complex workflows (v5.4.0).
168
+
169
+ #### Changed
170
+
171
+ None (infrastructure-only release)
172
+
173
+ #### Fixed
174
+
175
+ None (infrastructure-only release)
176
+
177
+ #### Notes
178
+
179
+ - **Zero breaking changes** - This is a pure infrastructure and documentation release
180
+ - **All tests passing** - 1,702 tests (99.59% pass rate)
181
+ - **TypeScript strict mode** - 0 errors
182
+ - **Foundation complete** - Ready for v5.4.0 implementation
183
+ - **Estimated v5.4.0 timeline** - 8-10 weeks for full optimization
184
+
185
+ ---
186
+
8
187
  ## [5.3.1] - 2025-10-14
9
188
 
10
189
  ### 🪟 Windows CLI Provider Detection & Enhanced Robustness
package/README.md CHANGED
@@ -7,9 +7,9 @@
7
7
  [![npm version](https://img.shields.io/npm/v/@defai.digital/automatosx.svg)](https://www.npmjs.com/package/@defai.digital/automatosx)
8
8
  [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
9
9
  [![TypeScript](https://img.shields.io/badge/TypeScript-100%25-blue.svg)](https://www.typescriptlang.org/)
10
- [![Tests](https://img.shields.io/badge/tests-1,657%20passing-brightgreen.svg)](#)
10
+ [![Tests](https://img.shields.io/badge/tests-1,717%20passing-brightgreen.svg)](#)
11
11
 
12
- **Status**: ✅ Production Ready · v5.3.0 · October 2025
12
+ **Status**: ✅ Production Ready · v5.3.4 · October 2025
13
13
 
14
14
  Looking for answers? See the [FAQ](FAQ.md).
15
15
 
@@ -19,13 +19,42 @@ Looking for answers? See the [FAQ](FAQ.md).
19
19
 
20
20
  **AutomatosX extends Claude Code with specialized AI agents that remember context, delegate tasks, and collaborate autonomously.**
21
21
 
22
- ```bash
23
- # In Claude Code, simply use /ax:agent
24
- /ax:agent Paris, design authentication system with JWT
25
- /ax:agent Bob, implement the auth design # Bob auto-receives Paris's design from memory
22
+ ### 💡 Best Way to Use: Natural Language Collaboration (Recommended)
23
+
24
+ Instead of directly commanding agents, **let Claude Code think and coordinate**:
25
+
26
+ ```
27
+ ✅ RECOMMENDED: Natural language collaboration
28
+ "please work with ax agent to implement user authentication with JWT"
29
+
30
+ What happens:
31
+ 1. Claude Code analyzes your project structure
32
+ 2. AutomatosX selects the most suitable agent automatically
33
+ 3. Provides full context to the agent
34
+ 4. Validates the results
35
+ 5. Helps you understand and iterate
36
+ ```
37
+
38
+ **vs.**
39
+
26
40
  ```
41
+ ⚡ EXPRESS: Direct slash command (for simple tasks)
42
+ /ax:agent backend, implement JWT auth
43
+
44
+ What happens:
45
+ 1. Backend agent executes directly
46
+ 2. Limited project context
47
+ 3. No validation or planning
48
+ ```
49
+
50
+ ### 🎓 Think of it This Way
27
51
 
28
- **The result**: Claude Code becomes a **learning, coordinated team** instead of a stateless assistant.
52
+ - **Natural Collaboration** = Having a conversation with an intelligent coordinator who summons experts
53
+ - **Slash Commands** = Directly commanding the experts without coordination
54
+
55
+ **Recommendation**: Use natural language for 80% of tasks, slash commands for quick 20%.
56
+
57
+ 📖 **[Complete Best Practices Guide](docs/BEST-PRACTICES.md)**
29
58
 
30
59
  ---
31
60
 
@@ -150,6 +179,7 @@ Product response:
150
179
  ## 🎭 12 Specialized Agents with Clear Governance
151
180
 
152
181
  **v5.0.12 introduces strict role ownership and delegation controls to eliminate cycles**:
182
+ **v5.3.4 Phase 2 Pilot**: 3 coordinator agents now support 3-layer delegation for complex multi-phase workflows
153
183
 
154
184
  ### 💻 Engineering Team (Implementers)
155
185
  **maxDelegationDepth: 1** - Can delegate once for cross-domain needs, no re-delegation
@@ -157,12 +187,16 @@ Product response:
157
187
  - Can delegate to: frontend, data, security, quality, devops
158
188
  - **Frank** (frontend) - Component architecture, state management, accessibility
159
189
  - Can delegate to: backend, design, security, quality, devops
160
- - **Oliver** (devops) - Infrastructure as code, CI/CD pipelines, observability
190
+ - **Oliver** (devops) - **🆕 v5.3.4: Infrastructure Coordinator (depth 3)** - Orchestrate complex deployment pipelines
161
191
  - Can delegate to: backend, frontend, security, quality
192
+ - 3-layer capability for multi-phase infrastructure workflows
162
193
  - **Daisy** (data) - Data modeling, ETL pipelines, SQL optimization
163
194
  - Can delegate to: backend, security, quality
164
195
  - **Steve** (security) - **Sole owner** of security-audit, threat modeling, secure coding review
165
196
  - Can delegate to: backend, frontend, devops, quality
197
+ - **Dana** (data-scientist) - **🆕 v5.3.4: Data Science Coordinator (depth 3)** - End-to-end ML pipelines
198
+ - Can delegate to: data, backend, quality
199
+ - 3-layer capability for complex data science workflows
166
200
 
167
201
  ### 🎯 Quality Team (Coordinator Role)
168
202
  **maxDelegationDepth: 1** - Can delegate fixes back to implementers, no re-delegation
@@ -177,13 +211,16 @@ Product response:
177
211
  - Can delegate to: backend, frontend, design, quality
178
212
 
179
213
  ### 📊 Leadership Team (Coordinators)
180
- **maxDelegationDepth: 1** - Delegate to implementers, focus on strategy, no re-delegation
214
+ **maxDelegationDepth: 1-3** - Delegate to implementers, focus on strategy
181
215
  - **Paris** (product) - Product strategy, feature planning, roadmap
182
216
  - Can delegate to: backend, frontend, design, writer, quality
217
+ - maxDelegationDepth: 1
183
218
  - **Eric** (ceo) - Business strategy, organizational leadership
184
219
  - Can delegate to: paris, tony, all agents
185
- - **Tony** (cto) - Technology strategy, technical leadership
220
+ - maxDelegationDepth: 1
221
+ - **Tony** (cto) - **🆕 v5.3.4: Strategic Coordinator (depth 3)** - Multi-phase technical initiatives
186
222
  - Can delegate to: backend, frontend, devops, security, quality
223
+ - 3-layer capability for strategic technology projects with sub-coordination
187
224
 
188
225
  ### 🔬 Research Team (Specialist)
189
226
  **maxDelegationDepth: 0** - Execute research work directly, no delegation
@@ -193,6 +230,8 @@ Product response:
193
230
 
194
231
  **New in v5.0.12**: Each agent has role-specific workflow stages, smart ability loading (abilitySelection), and explicit delegation scopes. Most agents have `maxDelegationDepth: 1` to allow cross-domain collaboration while preventing delegation cycles.
195
232
 
233
+ **New in v5.3.4 (Phase 2 Pilot)**: 3 coordinator agents (Tony/CTO, Oliver/DevOps, Dana/Data Scientist) now support `maxDelegationDepth: 3` for orchestrating complex multi-layer workflows. This enables strategic coordination of multi-phase projects while maintaining safety through depth limits and cycle detection.
234
+
196
235
  [📖 Complete Agent Directory](examples/AGENTS_INFO.md)
197
236
 
198
237
  ---
@@ -203,22 +242,45 @@ AutomatosX offers **two powerful modes** to fit your workflow:
203
242
 
204
243
  ### 1️⃣ Claude Code Integration (Recommended)
205
244
 
206
- **Use AutomatosX agents directly inside Claude Code conversations** with the `/ax:agent` slash command.
245
+ **The best way**: Use **natural language collaboration** to let Claude Code coordinate agents intelligently.
246
+
247
+ #### Natural Language Collaboration (Primary Method - 80% of tasks)
248
+
249
+ ```
250
+ # Let Claude Code think, plan, and coordinate
251
+ "please work with ax agent to implement user authentication"
252
+ "please work with ax agent to design a secure API for our application"
253
+ "please work with ax agent to refactor this module with best practices"
254
+ ```
255
+
256
+ **Why this is better**:
257
+ - 🧠 Claude Code analyzes your project first
258
+ - 🎯 Automatically selects the best agents
259
+ - 📚 Provides full context from your codebase
260
+ - ✅ Validates results and handles errors
261
+ - 🔄 Easy to iterate and refine
262
+
263
+ #### Slash Commands (Express Method - 20% of tasks)
207
264
 
208
265
  ```bash
209
- # In Claude Code, use the slash command
266
+ # Direct execution for simple, well-defined tasks
210
267
  /ax:agent Paris, design a REST API for user authentication
211
- /ax:agent Bob, implement the auth API from Paris's design
212
- /ax:agent Steve, security audit the authentication code
268
+ /ax:agent Bob, write a function to validate emails
269
+ /ax:agent Steve, review this code snippet
213
270
  ```
214
271
 
272
+ **Use slash commands when**:
273
+ - ⚡ Task is simple and well-defined
274
+ - 🎯 You know exactly which agent to use
275
+ - 🚀 Speed matters more than planning
276
+
215
277
  **Perfect for**:
216
- - 💬 Interactive development workflows
217
- - 🔄 Seamless context switching within Claude Code
218
- - 🤝 Collaborative coding sessions
219
- - 🎯 Quick agent delegation while coding
278
+ - 💬 All types of development workflows
279
+ - 🔄 Both simple and complex tasks
280
+ - 🤝 Single and multi-agent coordination
281
+ - 🎯 Interactive and automated workflows
220
282
 
221
- **How it works**: Claude Code executes AutomatosX commands behind the scenes, brings results back into your conversation, and maintains full context.
283
+ **How it works**: Claude Code acts as an intelligent coordinator, analyzing context, selecting agents, and orchestrating their work seamlessly.
222
284
 
223
285
  ### 2️⃣ Terminal/CLI Mode (Power Users)
224
286
 
@@ -278,7 +340,7 @@ npm install -g @defai.digital/automatosx
278
340
 
279
341
  ```bash
280
342
  ax --version
281
- # Should show: 5.3.0 (or later)
343
+ # Should show: 5.3.3 (or later)
282
344
  ```
283
345
 
284
346
  > **Windows Users**: If `ax` command not found, see [Windows Troubleshooting](docs/troubleshooting/windows-troubleshooting.md)
@@ -390,7 +452,36 @@ Having issues on Windows? See our comprehensive guides:
390
452
 
391
453
  ### Step 3: Run Your First Agent
392
454
 
393
- **Terminal Mode** (any platform):
455
+ #### Option A: Claude Code Integration (Recommended)
456
+
457
+ **Best Practice: Natural Language Collaboration**
458
+
459
+ Open Claude Code and try these prompts:
460
+
461
+ ```
462
+ ✅ "please work with ax agent to create a simple calculator function"
463
+ ✅ "please work with ax agent to design a REST API for user management"
464
+ ✅ "please work with ax agent to implement secure authentication"
465
+ ```
466
+
467
+ **What happens**:
468
+ 1. Claude Code analyzes your project context
469
+ 2. Selects and coordinates the best agents
470
+ 3. Agents execute with full context
471
+ 4. Results are validated and explained
472
+ 5. Easy to iterate: "please improve the error handling"
473
+
474
+ **Express Option: Slash Commands** (for simple tasks)
475
+
476
+ ```bash
477
+ # Quick, direct execution
478
+ /ax:agent backend, write a function to validate email
479
+ /ax:agent quality, review this code snippet
480
+ ```
481
+
482
+ 📖 **Learn more**: [Best Practices Guide](docs/BEST-PRACTICES.md)
483
+
484
+ #### Option B: Terminal Mode (Power Users)
394
485
 
395
486
  ```bash
396
487
  # Test with backend agent
@@ -402,22 +493,6 @@ ax run Bob "Implement the API" # Auto-receives Paris's design
402
493
  ax run Queenie "Write tests for the API" # Auto-receives design + implementation
403
494
  ```
404
495
 
405
- **Claude Code Integration**:
406
-
407
- ```bash
408
- # In Claude Code, use the slash command
409
- /ax:agent Paris, design REST API for users
410
- /ax:agent Bob, implement the API
411
- /ax:agent Queenie, write tests for the API
412
- ```
413
-
414
- **What happens**:
415
- 1. Claude Code executes AutomatosX behind the scenes
416
- 2. Paris designs the API → Saved to memory
417
- 3. Bob reads Paris's design from memory → Implements code
418
- 4. Queenie reads everything → Writes comprehensive tests
419
- 5. Results flow back into your Claude Code conversation
420
-
421
496
  ---
422
497
 
423
498
  ### Common Issues