claude-flow-novice 2.14.29 → 2.14.30

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 (124) hide show
  1. package/.claude/cfn-agents-ignore/cfn-seo-team/AGENT_CREATION_REPORT.md +4 -14
  2. package/.claude/cfn-agents-ignore/cfn-seo-team/AGENT_CREATION_REPORT.md.backup +481 -0
  3. package/.claude/cfn-agents-ignore/cfn-seo-team/DELEGATION_MATRIX.md +3 -4
  4. package/.claude/cfn-agents-ignore/cfn-seo-team/DELEGATION_MATRIX.md.backup +371 -0
  5. package/.claude/cfn-agents-ignore/cfn-seo-team/INTEGRATION_REQUIREMENTS.md +20 -26
  6. package/.claude/cfn-agents-ignore/cfn-seo-team/INTEGRATION_REQUIREMENTS.md.backup +637 -0
  7. package/.claude/cfn-agents-ignore/cfn-seo-team/cfn-seo-coordinator.md +295 -50
  8. package/.claude/cfn-agents-ignore/cfn-seo-team/cfn-seo-coordinator.md.backup +398 -0
  9. package/.claude/cfn-agents-ignore/cfn-seo-team/competitive-seo-analyst.md +27 -25
  10. package/.claude/cfn-agents-ignore/cfn-seo-team/competitive-seo-analyst.md.backup +401 -0
  11. package/.claude/cfn-agents-ignore/cfn-seo-team/content-atomization-specialist.md +5 -106
  12. package/.claude/cfn-agents-ignore/cfn-seo-team/content-atomization-specialist.md.backup +552 -0
  13. package/.claude/cfn-agents-ignore/cfn-seo-team/content-seo-strategist.md +5 -25
  14. package/.claude/cfn-agents-ignore/cfn-seo-team/content-seo-strategist.md.backup +223 -0
  15. package/.claude/cfn-agents-ignore/cfn-seo-team/eeat-content-auditor.md +5 -27
  16. package/.claude/cfn-agents-ignore/cfn-seo-team/eeat-content-auditor.md.backup +367 -0
  17. package/.claude/cfn-agents-ignore/cfn-seo-team/geo-optimization-expert.md +5 -27
  18. package/.claude/cfn-agents-ignore/cfn-seo-team/geo-optimization-expert.md.backup +247 -0
  19. package/.claude/cfn-agents-ignore/cfn-seo-team/link-building-specialist.md +5 -27
  20. package/.claude/cfn-agents-ignore/cfn-seo-team/link-building-specialist.md.backup +269 -0
  21. package/.claude/cfn-agents-ignore/cfn-seo-team/local-seo-optimizer.md +5 -25
  22. package/.claude/cfn-agents-ignore/cfn-seo-team/local-seo-optimizer.md.backup +311 -0
  23. package/.claude/cfn-agents-ignore/cfn-seo-team/programmatic-seo-engineer.md +6 -26
  24. package/.claude/cfn-agents-ignore/cfn-seo-team/programmatic-seo-engineer.md.backup +222 -0
  25. package/.claude/cfn-agents-ignore/cfn-seo-team/schema-markup-engineer.md +5 -25
  26. package/.claude/cfn-agents-ignore/cfn-seo-team/schema-markup-engineer.md.backup +408 -0
  27. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-analytics-specialist.md +6 -26
  28. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-analytics-specialist.md.backup +354 -0
  29. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/accessibility-validator.md +4 -4
  30. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/accessibility-validator.md.backup +561 -0
  31. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/audience-validator.md +2 -2
  32. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/audience-validator.md.backup +480 -0
  33. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/branding-validator.md +1 -1
  34. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/branding-validator.md.backup +448 -0
  35. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/humanizer-validator.md +2 -2
  36. package/.claude/cfn-agents-ignore/cfn-seo-team/seo-validators/humanizer-validator.md.backup +329 -0
  37. package/.claude/cfn-agents-ignore/cfn-seo-team/technical-seo-specialist.md +361 -199
  38. package/.claude/cfn-agents-ignore/cfn-seo-team/technical-seo-specialist.md.backup +208 -0
  39. package/.claude/commands/CFN_LOOP_TASK_MODE.md +2 -32
  40. package/.claude/commands/cfn-mode.md +2 -2
  41. package/claude-assets/agents/cfn-dev-team/CLAUDE.md +24 -14
  42. package/claude-assets/agents/cfn-dev-team/architecture/api-designer-persona.md +0 -7
  43. package/claude-assets/agents/cfn-dev-team/architecture/base-template-generator.md +5 -5
  44. package/claude-assets/agents/cfn-dev-team/architecture/goal-planner.md +0 -10
  45. package/claude-assets/agents/cfn-dev-team/architecture/planner.md +0 -10
  46. package/claude-assets/agents/cfn-dev-team/architecture/system-architect.md +1 -12
  47. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +337 -62
  48. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +504 -484
  49. package/claude-assets/agents/cfn-dev-team/coordinators/consensus-builder.md +428 -171
  50. package/claude-assets/agents/cfn-dev-team/coordinators/multi-sprint-coordinator.md +454 -66
  51. package/claude-assets/agents/cfn-dev-team/dev-ops/devops-engineer.md +5 -5
  52. package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +5 -7
  53. package/claude-assets/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +0 -6
  54. package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +3 -3
  55. package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +13 -14
  56. package/claude-assets/agents/cfn-dev-team/developers/data/data-engineer.md +0 -6
  57. package/claude-assets/agents/cfn-dev-team/developers/database/database-architect.md +2 -2
  58. package/claude-assets/agents/cfn-dev-team/developers/frontend/mobile-dev.md +4 -10
  59. package/claude-assets/agents/cfn-dev-team/developers/frontend/typescript-specialist.md +1 -1
  60. package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +2 -2
  61. package/claude-assets/agents/cfn-dev-team/documentation/api-documentation.md +1 -1
  62. package/claude-assets/agents/cfn-dev-team/documentation/pseudocode.md +3 -11
  63. package/claude-assets/agents/cfn-dev-team/documentation/specification-agent.md +6 -16
  64. package/claude-assets/agents/cfn-dev-team/product-owners/product-owner.md +56 -236
  65. package/claude-assets/agents/cfn-dev-team/reviewers/quality/code-quality-validator.md +2 -15
  66. package/claude-assets/agents/cfn-dev-team/reviewers/quality/cyclomatic-complexity-reducer.md +4 -64
  67. package/claude-assets/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +0 -11
  68. package/claude-assets/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +0 -10
  69. package/claude-assets/agents/cfn-dev-team/reviewers/quality/security-specialist.md +4 -63
  70. package/claude-assets/agents/cfn-dev-team/reviewers/reviewer.md +231 -209
  71. package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +0 -6
  72. package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +0 -6
  73. package/claude-assets/agents/cfn-dev-team/testers/e2e/playwright-tester.md +0 -14
  74. package/claude-assets/agents/cfn-dev-team/testers/interaction-tester.md +2 -29
  75. package/claude-assets/agents/cfn-dev-team/testers/load-testing-specialist.md +0 -6
  76. package/claude-assets/agents/cfn-dev-team/testers/playwright-tester.md +12 -28
  77. package/claude-assets/agents/cfn-dev-team/testers/tester.md +167 -166
  78. package/claude-assets/agents/cfn-dev-team/testers/unit/tdd-london-unit-swarm.md +0 -9
  79. package/claude-assets/agents/cfn-dev-team/testing/test-validation-agent.md +3 -3
  80. package/claude-assets/agents/cfn-dev-team/utility/agent-builder.md +5 -5
  81. package/claude-assets/agents/cfn-dev-team/{coordinators → utility}/epic-creator.md +18 -58
  82. package/claude-assets/cfn-agents-ignore/cfn-seo-team/AGENT_CREATION_REPORT.md +4 -14
  83. package/claude-assets/cfn-agents-ignore/cfn-seo-team/AGENT_CREATION_REPORT.md.backup +481 -0
  84. package/claude-assets/cfn-agents-ignore/cfn-seo-team/DELEGATION_MATRIX.md +3 -4
  85. package/claude-assets/cfn-agents-ignore/cfn-seo-team/DELEGATION_MATRIX.md.backup +371 -0
  86. package/claude-assets/cfn-agents-ignore/cfn-seo-team/INTEGRATION_REQUIREMENTS.md +20 -26
  87. package/claude-assets/cfn-agents-ignore/cfn-seo-team/INTEGRATION_REQUIREMENTS.md.backup +637 -0
  88. package/claude-assets/cfn-agents-ignore/cfn-seo-team/cfn-seo-coordinator.md +295 -50
  89. package/claude-assets/cfn-agents-ignore/cfn-seo-team/cfn-seo-coordinator.md.backup +398 -0
  90. package/claude-assets/cfn-agents-ignore/cfn-seo-team/competitive-seo-analyst.md +27 -25
  91. package/claude-assets/cfn-agents-ignore/cfn-seo-team/competitive-seo-analyst.md.backup +401 -0
  92. package/claude-assets/cfn-agents-ignore/cfn-seo-team/content-atomization-specialist.md +5 -106
  93. package/claude-assets/cfn-agents-ignore/cfn-seo-team/content-atomization-specialist.md.backup +552 -0
  94. package/claude-assets/cfn-agents-ignore/cfn-seo-team/content-seo-strategist.md +5 -25
  95. package/claude-assets/cfn-agents-ignore/cfn-seo-team/content-seo-strategist.md.backup +223 -0
  96. package/claude-assets/cfn-agents-ignore/cfn-seo-team/eeat-content-auditor.md +5 -27
  97. package/claude-assets/cfn-agents-ignore/cfn-seo-team/eeat-content-auditor.md.backup +367 -0
  98. package/claude-assets/cfn-agents-ignore/cfn-seo-team/geo-optimization-expert.md +5 -27
  99. package/claude-assets/cfn-agents-ignore/cfn-seo-team/geo-optimization-expert.md.backup +247 -0
  100. package/claude-assets/cfn-agents-ignore/cfn-seo-team/link-building-specialist.md +5 -27
  101. package/claude-assets/cfn-agents-ignore/cfn-seo-team/link-building-specialist.md.backup +269 -0
  102. package/claude-assets/cfn-agents-ignore/cfn-seo-team/local-seo-optimizer.md +5 -25
  103. package/claude-assets/cfn-agents-ignore/cfn-seo-team/local-seo-optimizer.md.backup +311 -0
  104. package/claude-assets/cfn-agents-ignore/cfn-seo-team/programmatic-seo-engineer.md +6 -26
  105. package/claude-assets/cfn-agents-ignore/cfn-seo-team/programmatic-seo-engineer.md.backup +222 -0
  106. package/claude-assets/cfn-agents-ignore/cfn-seo-team/schema-markup-engineer.md +5 -25
  107. package/claude-assets/cfn-agents-ignore/cfn-seo-team/schema-markup-engineer.md.backup +408 -0
  108. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-analytics-specialist.md +6 -26
  109. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-analytics-specialist.md.backup +354 -0
  110. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/accessibility-validator.md +4 -4
  111. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/accessibility-validator.md.backup +561 -0
  112. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/audience-validator.md +2 -2
  113. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/audience-validator.md.backup +480 -0
  114. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/branding-validator.md +1 -1
  115. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/branding-validator.md.backup +448 -0
  116. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/humanizer-validator.md +2 -2
  117. package/claude-assets/cfn-agents-ignore/cfn-seo-team/seo-validators/humanizer-validator.md.backup +329 -0
  118. package/claude-assets/cfn-agents-ignore/cfn-seo-team/technical-seo-specialist.md +361 -199
  119. package/claude-assets/cfn-agents-ignore/cfn-seo-team/technical-seo-specialist.md.backup +208 -0
  120. package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +2 -32
  121. package/claude-assets/commands/cfn-mode.md +2 -2
  122. package/dist/agents/agent-loader.js +146 -165
  123. package/dist/agents/agent-loader.js.map +1 -1
  124. package/package.json +1 -1
@@ -0,0 +1,208 @@
1
+ ---
2
+ name: technical-seo-specialist
3
+ description: SEO-ONLY AGENT - MUST BE USED for technical SEO tasks exclusively. NO general coding or development work. Focuses on search engine optimization: audits, crawl errors, Core Web Vitals, schema markup, sitemaps, robots.txt. Use PROACTIVELY for site performance optimization (SEO-related), structured data validation, crawl budget optimization. Keywords - technical SEO audit, crawl errors, Core Web Vitals, schema markup, XML sitemap, robots.txt, page speed SEO, site architecture SEO
4
+ tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite]
5
+ model: haiku
6
+ type: specialist
7
+ acl_level: 1
8
+ capabilities: [technical-seo, performance-optimization, schema-markup, crawl-management, site-architecture]
9
+ ---
10
+
11
+ # Technical SEO Specialist
12
+
13
+ You are a **technical SEO expert** focused exclusively on search engine optimization. Your role is to improve website visibility and ranking through technical optimization, NOT general web development or coding. You specialize in site infrastructure for SEO, performance optimization for search rankings, and crawlability for search engines.
14
+
15
+ ## Core Responsibilities
16
+
17
+ 1. **Site Audits**
18
+ - Crawl site using Screaming Frog data
19
+ - Identify broken links, redirect chains, 404 errors
20
+ - Analyze page load times and Core Web Vitals
21
+ - Check mobile usability and responsive design
22
+
23
+ 2. **Performance Optimization**
24
+ - Optimize images (compression, lazy loading, WebP conversion)
25
+ - Implement caching strategies
26
+ - Minimize JavaScript/CSS bloat
27
+ - Improve Largest Contentful Paint (LCP), First Input Delay (FID), Cumulative Layout Shift (CLS)
28
+
29
+ 3. **Schema Markup Implementation**
30
+ - Generate JSON-LD structured data
31
+ - Validate schema using Google Rich Results Test
32
+ - Implement VideoObject, HowTo, Dataset, FAQ schemas
33
+ - Ensure schema aligns with Schema.org specifications
34
+
35
+ 4. **Crawl Management**
36
+ - Configure robots.txt for optimal crawl budget
37
+ - Generate and validate XML sitemaps
38
+ - Implement canonical tags to prevent duplicate content
39
+ - Fix crawl errors reported in Google Search Console
40
+
41
+ 5. **Site Architecture**
42
+ - Optimize URL structure (clean, descriptive URLs)
43
+ - Implement breadcrumb navigation
44
+ - Ensure logical internal linking hierarchy
45
+ - Validate hreflang tags for international SEO
46
+
47
+ ## Trigger Keywords
48
+ - technical audit
49
+ - crawl errors
50
+ - Core Web Vitals
51
+ - schema markup
52
+ - sitemap generation
53
+ - robots.txt
54
+ - page speed optimization
55
+ - 404 errors
56
+ - redirect chains
57
+ - canonical tags
58
+ - site architecture
59
+
60
+ ## Specialization Areas
61
+
62
+ ### Screaming Frog Analysis
63
+ - Parse Screaming Frog CSV exports
64
+ - Identify critical technical issues (5xx errors, orphaned pages, thin content)
65
+ - Generate prioritized fix lists based on impact
66
+
67
+ ### PageSpeed Insights Integration
68
+ - Query PageSpeed Insights API for performance metrics
69
+ - Analyze field data (CrUX) vs lab data (Lighthouse)
70
+ - Generate actionable recommendations with confidence scores
71
+
72
+ ### Google Search Console Integration
73
+ - Parse GSC API responses for crawl errors
74
+ - Monitor index coverage issues
75
+ - Track Core Web Vitals trends
76
+
77
+ ### n8n Workflow Automation
78
+ - Trigger automated audits via n8n webhooks
79
+ - Schedule weekly performance checks
80
+ - Alert on critical issues (sudden traffic drops, crawl errors)
81
+
82
+ ## Integration Points
83
+
84
+ **APIs:**
85
+ - PageSpeed Insights API (Core Web Vitals, performance scores)
86
+ - Google Search Console API (crawl errors, index coverage)
87
+ - Schema.org validation API
88
+
89
+ **Services:**
90
+ - n8n workflows (automated audit triggers)
91
+ - PostgreSQL (store audit history)
92
+ - Performance metrics caching
93
+
94
+ **External Tools:**
95
+ - Screaming Frog (crawl data exports)
96
+ - Google Rich Results Test (schema validation)
97
+ - WebPageTest (advanced performance analysis)
98
+
99
+ ## Workflow
100
+
101
+ 1. **Audit Initiation** (TodoWrite)
102
+ - Define audit scope (full site vs specific sections)
103
+ - Identify critical pages (high traffic, conversion paths)
104
+
105
+ 2. **Data Collection** (Bash, Grep)
106
+ - Parse Screaming Frog exports
107
+ - Query PageSpeed Insights API
108
+ - Fetch GSC crawl error reports
109
+
110
+ 3. **Issue Analysis** (Read, Grep, Glob)
111
+ - Categorize issues by severity (critical, high, medium, low)
112
+ - Identify patterns (e.g., all blog posts missing schema)
113
+
114
+ 4. **Implementation** (Write, Edit)
115
+ - Fix robots.txt blocking issues
116
+ - Generate XML sitemaps
117
+ - Implement schema markup
118
+ - Optimize images and scripts
119
+
120
+ 5. **Validation** (Bash)
121
+ - Re-run PageSpeed Insights
122
+ - Validate schema using Google Rich Results Test
123
+ - Verify sitemap accessibility
124
+
125
+ ## Success Criteria
126
+
127
+ - Core Web Vitals pass thresholds (LCP <2.5s, FID <100ms, CLS <0.1)
128
+ - Zero critical crawl errors (5xx, orphaned pages)
129
+ - All priority pages have valid schema markup
130
+ - Page speed score improvement ≥20 points
131
+ - Sitemap coverage ≥95% of indexable pages
132
+ - Confidence score ≥0.85
133
+
134
+ ## Output Format
135
+
136
+ **Technical Audit Report:**
137
+ ```markdown
138
+ # Technical SEO Audit - [Site/Section Name]
139
+
140
+ ## Executive Summary
141
+ - Overall Health Score: [0-100]
142
+ - Critical Issues: [count]
143
+ - High Priority Issues: [count]
144
+ - Confidence Score: [0.0-1.0]
145
+
146
+ ## Core Web Vitals
147
+ | Metric | Current | Target | Status |
148
+ |--------|---------|--------|--------|
149
+ | LCP | 2.8s | <2.5s | ⚠️ Needs Work |
150
+ | FID | 45ms | <100ms | ✅ Pass |
151
+ | CLS | 0.15 | <0.1 | ⚠️ Needs Work |
152
+
153
+ ## Critical Issues (Fix Immediately)
154
+ 1. [Issue description]
155
+ - Impact: [traffic/rankings/user experience]
156
+ - Location: [URL or file path]
157
+ - Fix: [specific action]
158
+ - Priority: CRITICAL
159
+
160
+ ## High Priority Issues
161
+ 1. [Issue description]
162
+ - Impact: [impact assessment]
163
+ - Fix: [specific action]
164
+ - Priority: HIGH
165
+
166
+ ## Schema Markup Status
167
+ - Pages with schema: [count / total]
168
+ - Schema types implemented: [VideoObject, HowTo, etc.]
169
+ - Validation errors: [count]
170
+
171
+ ## Recommendations
172
+ 1. [Recommendation with implementation steps]
173
+ 2. [Recommendation with implementation steps]
174
+
175
+ ## Next Steps
176
+ - [Action item 1]
177
+ - [Action item 2]
178
+ ```
179
+
180
+ ## Example Prompts
181
+
182
+ 1. "Conduct technical SEO audit for OurStories homepage and identify top 5 critical issues"
183
+ 2. "Optimize Core Web Vitals for /stories/* pages - target LCP <2.5s"
184
+ 3. "Generate XML sitemap for all published stories and memory pages"
185
+ 4. "Implement VideoObject schema markup for story video pages"
186
+ 5. "Fix robots.txt to allow crawling of /api/stories endpoint"
187
+ 6. "Analyze Screaming Frog export and prioritize technical fixes"
188
+
189
+ ## Constraints
190
+
191
+ - **SEO-ONLY ROLE** - NO general web development, backend coding, or feature implementation
192
+ - Focus ONLY on technical infrastructure for SEO and search engine crawlability
193
+ - Delegate content optimization to content-seo-strategist
194
+ - Delegate programmatic page generation to programmatic-seo-engineer
195
+ - Delegate schema design (complex multi-type) to schema-markup-engineer
196
+ - Delegate general coding tasks to backend-developer or frontend-engineer
197
+ - Maximum audit scope: 10,000 pages per run (use sampling for larger sites)
198
+ - Always provide confidence score with technical SEO recommendations
199
+
200
+ ## CFN Loop Completion Protocol
201
+
202
+ When participating in CFN Loop workflows, complete your work and report confidence score. Coordination will be handled automatically by the orchestrator.
203
+
204
+ **Confidence Scoring Criteria:**
205
+ - 0.90+: All Core Web Vitals pass, zero critical errors, schema validated
206
+ - 0.75-0.89: Minor performance issues remain, schema implementation incomplete
207
+ - 0.60-0.74: Significant technical debt identified, complex fixes required
208
+ - <0.60: Critical infrastructure issues blocking indexing or user experience
@@ -6,17 +6,6 @@
6
6
 
7
7
  ## Overview
8
8
 
9
- Task Mode: Main Chat coordinates directly and spawns agents via Task() tool with full context injection and visibility. NO coordinator agent is used.
10
-
11
- | Aspect | Task Mode | CLI Mode |
12
- |--------|-----------|----------|
13
- | **Spawning** | Main Chat directly via Task() | Coordinator via npx CLI |
14
- | **Visibility** | Full transparency in Main Chat | Background, Redis logs |
15
- | **Provider** | All Anthropic | CLI uses Z.ai routing |
16
- | **Cost** | ~$0.150/iteration | ~$0.054/iteration (64% savings) |
17
- | **Use Case** | Debugging, prototyping, learning | Production, cost optimization |
18
- | **ACE Reflection** | Optional via `--ace-reflect` flag | Always enabled |
19
-
20
9
  ### ACE Reflection Flag
21
10
 
22
11
  ```bash
@@ -39,7 +28,7 @@ Task Mode: Main Chat coordinates directly and spawns agents via Task() tool with
39
28
 
40
29
  **Critical Fix**: Prevents Task Mode agents from executing CLI coordination scripts that cause memory leaks.
41
30
 
42
- ### Three-Layer Defense System
31
+ ### Defense System
43
32
 
44
33
  #### Layer 1: Agent Documentation
45
34
  **Task Mode agents use mode-specific completion protocols:**
@@ -56,26 +45,7 @@ Task Mode: Main Chat coordinates directly and spawns agents via Task() tool with
56
45
  - ✅ CLI coordination allowed
57
46
  ```
58
47
 
59
- #### Layer 2: Agent-Level Detection
60
- **Automatic detection functions prevent CLI usage:**
61
- ```bash
62
- detect_task_mode_and_exit() {
63
- if [[ -z "${TASK_ID:-}" || -z "${AGENT_ID:-}" ]]; then
64
- echo "❌ TASK MODE DETECTED - CLI commands forbidden"
65
- exit 1
66
- fi
67
- }
68
- ```
69
-
70
- #### Layer 3: Code-Level Runtime Blocking
71
- **Coordination scripts include early exit checks:**
72
- ```bash
73
- # ⚠️ ANTI-023 MEMORY LEAK PROTECTION
74
- if [[ -z "${TASK_ID:-}" || -z "${AGENT_ID:-}" ]]; then
75
- echo "❌ TASK MODE DETECTED - Redis coordination forbidden"
76
- exit 1
77
- fi
78
- ```
48
+ `
79
49
 
80
50
  ### Memory Impact Resolution
81
51
  - **Before Fix**: Up to 23GB memory consumption per hanging agent
@@ -15,6 +15,6 @@ Check `.cfn-mode.json` or run `/cfn-mode status`
15
15
 
16
16
  **Mode Details:**
17
17
  - **CLI Mode**: Coordinator → orchestrator → CLI agents (Z.ai routing)
18
- - **Task Mode**: Coordinator → JSON → Main Chat spawns Task() agents (Anthropic)
18
+ - **Task Mode**: main chat is Coordinator → JSON → Main Chat spawns Task() agents (Anthropic)
19
19
 
20
- Both modes use Redis context storage for swarm recovery.
20
+ Only CLI mode use Redis context storage for swarm recovery.
@@ -1,145 +1,12 @@
1
- "use strict";
2
1
  /**
3
2
  * Dynamic Agent Loader - Reads agent definitions from .claude/agents/ directory
4
3
  * Single source of truth for agent types in the system
5
- */ var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
6
- function adopt(value) {
7
- return value instanceof P ? value : new P(function(resolve) {
8
- resolve(value);
9
- });
10
- }
11
- return new (P || (P = Promise))(function(resolve, reject) {
12
- function fulfilled(value) {
13
- try {
14
- step(generator.next(value));
15
- } catch (e) {
16
- reject(e);
17
- }
18
- }
19
- function rejected(value) {
20
- try {
21
- step(generator["throw"](value));
22
- } catch (e) {
23
- reject(e);
24
- }
25
- }
26
- function step(result) {
27
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
28
- }
29
- step((generator = generator.apply(thisArg, _arguments || [])).next());
30
- });
31
- };
32
- var __generator = this && this.__generator || function(thisArg, body) {
33
- var _ = {
34
- label: 0,
35
- sent: function() {
36
- if (t[0] & 1) throw t[1];
37
- return t[1];
38
- },
39
- trys: [],
40
- ops: []
41
- }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
42
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
43
- return this;
44
- }), g;
45
- function verb(n) {
46
- return function(v) {
47
- return step([
48
- n,
49
- v
50
- ]);
51
- };
52
- }
53
- function step(op) {
54
- if (f) throw new TypeError("Generator is already executing.");
55
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
56
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
57
- if (y = 0, t) op = [
58
- op[0] & 2,
59
- t.value
60
- ];
61
- switch(op[0]){
62
- case 0:
63
- case 1:
64
- t = op;
65
- break;
66
- case 4:
67
- _.label++;
68
- return {
69
- value: op[1],
70
- done: false
71
- };
72
- case 5:
73
- _.label++;
74
- y = op[1];
75
- op = [
76
- 0
77
- ];
78
- continue;
79
- case 7:
80
- op = _.ops.pop();
81
- _.trys.pop();
82
- continue;
83
- default:
84
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
85
- _ = 0;
86
- continue;
87
- }
88
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
89
- _.label = op[1];
90
- break;
91
- }
92
- if (op[0] === 6 && _.label < t[1]) {
93
- _.label = t[1];
94
- t = op;
95
- break;
96
- }
97
- if (t && _.label < t[2]) {
98
- _.label = t[2];
99
- _.ops.push(op);
100
- break;
101
- }
102
- if (t[2]) _.ops.pop();
103
- _.trys.pop();
104
- continue;
105
- }
106
- op = body.call(thisArg, _);
107
- } catch (e) {
108
- op = [
109
- 6,
110
- e
111
- ];
112
- y = 0;
113
- } finally{
114
- f = t = 0;
115
- }
116
- if (op[0] & 5) throw op[1];
117
- return {
118
- value: op[0] ? op[1] : void 0,
119
- done: true
120
- };
121
- }
122
- };
123
- var __spreadArray = this && this.__spreadArray || function(to, from, pack) {
124
- if (pack || arguments.length === 2) for(var i = 0, l = from.length, ar; i < l; i++){
125
- if (ar || !(i in from)) {
126
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
127
- ar[i] = from[i];
128
- }
129
- }
130
- return to.concat(ar || Array.prototype.slice.call(from));
131
- };
132
- Object.defineProperty(exports, "__esModule", {
133
- value: true
134
- });
135
- exports.refreshAgents = exports.getAgentsByCategory = exports.isValidAgentType = exports.searchAgents = exports.getAgentCategories = exports.getAllAgents = exports.getAgent = exports.getAvailableAgentTypes = exports.agentLoader = exports.AgentLoader = void 0;
136
- exports.resolveLegacyAgentType = resolveLegacyAgentType;
137
- var node_fs_1 = require("node:fs");
138
- var glob_1 = require("glob");
139
- var node_path_1 = require("node:path");
140
- var yaml_1 = require("yaml");
4
+ */ import { readFileSync, existsSync } from 'node:fs';
5
+ import { glob } from 'glob';
6
+ import { resolve, dirname } from 'node:path';
7
+ import { parse as parseYaml } from 'yaml';
141
8
  // Legacy agent type mapping for backward compatibility
142
- var LEGACY_AGENT_MAPPING = {
9
+ const LEGACY_AGENT_MAPPING = {
143
10
  analyst: 'code-analyzer',
144
11
  coordinator: 'hierarchical-coordinator',
145
12
  optimizer: 'perf-analyzer',
@@ -150,40 +17,38 @@ var LEGACY_AGENT_MAPPING = {
150
17
  };
151
18
  /**
152
19
  * Resolve legacy agent types to current equivalents
153
- */ function resolveLegacyAgentType(legacyType) {
20
+ */ export function resolveLegacyAgentType(legacyType) {
154
21
  return LEGACY_AGENT_MAPPING[legacyType] || legacyType;
155
22
  }
156
- var AgentLoader = /** @class */ function() {
157
- function AgentLoader() {
158
- this.agentCache = new Map();
159
- this.categoriesCache = [];
160
- this.lastLoadTime = 0;
161
- this.CACHE_EXPIRY = 60000; // 1 minute cache
162
- }
163
- AgentLoader.prototype.getAgentsDirectory = function() {
164
- var currentDir = process.cwd();
23
+ export class AgentLoader {
24
+ agentCache = new Map();
25
+ categoriesCache = [];
26
+ lastLoadTime = 0;
27
+ CACHE_EXPIRY = 60_000;
28
+ getAgentsDirectory() {
29
+ let currentDir = process.cwd();
165
30
  while(currentDir !== '/'){
166
- var claudeAgentsPath = (0, node_path_1.resolve)(currentDir, '.claude', 'agents');
167
- if ((0, node_fs_1.existsSync)(claudeAgentsPath)) {
31
+ const claudeAgentsPath = resolve(currentDir, '.claude', 'agents');
32
+ if (existsSync(claudeAgentsPath)) {
168
33
  return claudeAgentsPath;
169
34
  }
170
- currentDir = (0, node_path_1.dirname)(currentDir);
35
+ currentDir = dirname(currentDir);
171
36
  }
172
- return (0, node_path_1.resolve)(process.cwd(), '.claude', 'agents');
173
- };
174
- AgentLoader.prototype.parseAgentFile = function(filePath) {
37
+ return resolve(process.cwd(), '.claude', 'agents');
38
+ }
39
+ parseAgentFile(filePath) {
175
40
  try {
176
- var content = (0, node_fs_1.readFileSync)(filePath, 'utf-8');
177
- var frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);
41
+ const content = readFileSync(filePath, 'utf-8');
42
+ const frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);
178
43
  if (!frontmatterMatch) {
179
- console.warn("No frontmatter found in ".concat(filePath));
44
+ console.warn(`No frontmatter found in ${filePath}`);
180
45
  return null;
181
46
  }
182
- var yamlContent = frontmatterMatch[1], markdownContent = frontmatterMatch[2];
183
- var frontmatter = (0, yaml_1.parse)(yamlContent);
184
- var description = frontmatter.description;
47
+ const [, yamlContent, markdownContent] = frontmatterMatch;
48
+ const frontmatter = parseYaml(yamlContent);
49
+ const description = frontmatter.description;
185
50
  if (!frontmatter.name || !description) {
186
- console.warn("Missing required fields (name, description) in ".concat(filePath));
51
+ console.warn(`Missing required fields (name, description) in ${filePath}`);
187
52
  return null;
188
53
  }
189
54
  return {
@@ -204,13 +69,129 @@ var AgentLoader = /** @class */ function() {
204
69
  content: markdownContent.trim()
205
70
  };
206
71
  } catch (error) {
207
- console.error("Error parsing agent file ".concat(filePath, ":"), error);
72
+ console.error(`Error parsing agent file ${filePath}:`, error);
208
73
  return null;
209
74
  }
210
- };
211
- AgentLoader.prototype.parseTools = function(frontmatter) {
212
- var extractTools = function(input) {
75
+ }
76
+ parseTools(frontmatter) {
77
+ const extractTools = (input)=>{
213
78
  if (Array.isArray(input)) return input.map(String);
79
+ if (typeof input === 'string') {
80
+ return input.split(/[,\s]+/).map((t)=>t.trim()).filter((t)=>t.length > 0);
81
+ }
82
+ return [];
83
+ };
84
+ // Safely handle tools and capabilities.tools
85
+ const toolsFromFrontmatter = frontmatter.tools ? extractTools(frontmatter.tools) : [];
86
+ const toolsFromCapabilities = frontmatter.capabilities && typeof frontmatter.capabilities === 'object' ? extractTools(Object(frontmatter.capabilities).tools) : [];
87
+ return [
88
+ ...toolsFromFrontmatter,
89
+ ...toolsFromCapabilities
90
+ ];
91
+ }
92
+ async loadAgents() {
93
+ const agentsDir = this.getAgentsDirectory();
94
+ if (!existsSync(agentsDir)) {
95
+ console.warn(`Agents directory not found: ${agentsDir}`);
96
+ return;
97
+ }
98
+ const agentFiles = await new Promise((resolve, reject)=>{
99
+ glob('**/*.md', {
100
+ cwd: agentsDir,
101
+ ignore: [
102
+ '**/README.md',
103
+ '**/MIGRATION_SUMMARY.md'
104
+ ],
105
+ absolute: true
106
+ }, (err, matches)=>{
107
+ if (err) reject(err);
108
+ else resolve(matches);
109
+ });
110
+ });
111
+ this.agentCache.clear();
112
+ this.categoriesCache = [];
113
+ const categoryMap = new Map();
114
+ for (const filePath of agentFiles){
115
+ const agent = this.parseAgentFile(filePath);
116
+ if (agent) {
117
+ this.agentCache.set(agent.name, agent);
118
+ const relativePath = filePath.replace(agentsDir, '');
119
+ const pathParts = relativePath.split('/');
120
+ const category = pathParts[1] || 'uncategorized';
121
+ if (!categoryMap.has(category)) {
122
+ categoryMap.set(category, []);
123
+ }
124
+ categoryMap.get(category).push(agent);
125
+ }
126
+ }
127
+ this.categoriesCache = Array.from(categoryMap.entries()).map(([name, agents])=>({
128
+ name,
129
+ agents: agents.sort((a, b)=>a.name.localeCompare(b.name))
130
+ }));
131
+ this.lastLoadTime = Date.now();
132
+ }
133
+ // Rest of the methods remain similar to the original implementation
134
+ needsRefresh() {
135
+ return Date.now() - this.lastLoadTime > this.CACHE_EXPIRY;
136
+ }
137
+ async ensureLoaded() {
138
+ if (this.agentCache.size === 0 || this.needsRefresh()) {
139
+ await this.loadAgents();
140
+ }
141
+ }
142
+ async getAvailableAgentTypes() {
143
+ await this.ensureLoaded();
144
+ const currentTypes = Array.from(this.agentCache.keys());
145
+ const legacyTypes = Object.keys(LEGACY_AGENT_MAPPING);
146
+ return Array.from(new Set([
147
+ ...currentTypes,
148
+ ...legacyTypes
149
+ ])).sort();
150
+ }
151
+ async getAgent(name) {
152
+ await this.ensureLoaded();
153
+ return this.agentCache.get(name) || this.agentCache.get(resolveLegacyAgentType(name)) || null;
154
+ }
155
+ async getAllAgents() {
156
+ await this.ensureLoaded();
157
+ return Array.from(this.agentCache.values()).sort((a, b)=>a.name.localeCompare(b.name));
158
+ }
159
+ async getAgentCategories() {
160
+ await this.ensureLoaded();
161
+ return this.categoriesCache;
162
+ }
163
+ async searchAgents(query) {
164
+ await this.ensureLoaded();
165
+ const lowerQuery = query.toLowerCase();
166
+ return Array.from(this.agentCache.values()).filter((agent)=>agent.name.toLowerCase().includes(lowerQuery) || agent.description.toLowerCase().includes(lowerQuery) || agent.capabilities?.some((cap)=>cap.toLowerCase().includes(lowerQuery)));
167
+ }
168
+ async isValidAgentType(name) {
169
+ await this.ensureLoaded();
170
+ return this.agentCache.has(name) || this.agentCache.has(resolveLegacyAgentType(name));
171
+ }
172
+ async getAgentsByCategory(category) {
173
+ const categories = await this.getAgentCategories();
174
+ const found = categories.find((cat)=>cat.name === category);
175
+ return found?.agents || [];
176
+ }
177
+ async refresh() {
178
+ this.lastLoadTime = 0;
179
+ await this.loadAgents();
180
+ }
181
+ }
182
+ // Singleton instance
183
+ export const agentLoader = new AgentLoader();
184
+ // Convenience exports for use in other modules
185
+ export const getAvailableAgentTypes = ()=>agentLoader.getAvailableAgentTypes();
186
+ export const getAgent = (name)=>agentLoader.getAgent(name);
187
+ export const getAllAgents = ()=>agentLoader.getAllAgents();
188
+ export const getAgentCategories = ()=>agentLoader.getAgentCategories();
189
+ export const searchAgents = (query)=>agentLoader.searchAgents(query);
190
+ export const isValidAgentType = (name)=>agentLoader.isValidAgentType(name);
191
+ export const getAgentsByCategory = (category)=>agentLoader.getAgentsByCategory(category);
192
+ export const refreshAgents = ()=>agentLoader.refresh();
193
+
194
+ //# sourceMappingURL=agent-loader.js.map.isArray(input)) return input.map(String);
214
195
  if (typeof input === 'string') {
215
196
  return input.split(/[,\s]+/).map(function(t) {
216
197
  return t.trim();