claude-flow-novice 2.18.10 → 2.18.12

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.
@@ -1,13 +1,27 @@
1
+ ---
2
+ name: cfn-cerebras-code-generator
3
+ description: "FAST code generation via Z.ai glm-4.6 model. Use for rapid test generation, boilerplate code, repetitive patterns, and bulk file creation. Ideal when speed matters more than nuance. Do NOT use for complex architectural decisions or security-critical code."
4
+ version: 2.0.0
5
+ tags: [code-generation, fast, zai, glm-4.6, tests, boilerplate]
6
+ ---
7
+
1
8
  # Cerebras Code Generator Skill
2
9
 
3
10
  ## Description
4
- Generates code using Cerebras API with context tracking and history management. Acts as an OpenAI-compatible wrapper for Cerebras API.
11
+ Generates code using Z.ai glm-4.6 model for **fast test and code generation**. Use this for rapid iteration when generating tests, boilerplate, and repetitive code patterns.
12
+
13
+ ## When to Use
14
+ - ✅ **Test generation** - unit tests, integration tests, test fixtures
15
+ - ✅ **Boilerplate code** - CRUD operations, API endpoints, data models
16
+ - ✅ **Repetitive patterns** - similar components, migration scripts
17
+ - ✅ **Bulk file creation** - generating multiple similar files quickly
18
+ - ❌ **NOT for** complex architecture, security-critical code, or nuanced logic
5
19
 
6
20
  ## Configuration
7
21
  ```bash
8
22
  # Required environment variables
9
- export CEREBRAS_API_KEY="your-api-key"
10
- export CEREBRAS_MODEL="qwen2.5-coder-32b" # or other Cerebras model
23
+ export ZAI_API_KEY="your-api-key" # or CEREBRAS_API_KEY for legacy
24
+ export ZAI_MODEL="glm-4.6" # Fast, cost-effective model
11
25
 
12
26
  # Optional settings
13
27
  export CEREBRAS_BASE_URL="https://api.cerebras.ai/v1"
@@ -1,7 +1,14 @@
1
+ ---
2
+ name: cfn-cerebras-coordinator
3
+ description: "Coordinates FAST code generation via Z.ai glm-4.6 with RuVector pattern learning. Use when agents need rapid test generation, bulk code creation, or repetitive boilerplate. Tracks successful prompts for continuous improvement. Ideal for high-volume, low-complexity code tasks."
4
+ version: 2.0.0
5
+ tags: [coordination, code-generation, fast, zai, glm-4.6, pattern-learning, tests]
6
+ ---
7
+
1
8
  # Cerebras Coordinator Skill
2
9
 
3
10
  ## Description
4
- Integrates Cerebras code generation with RuVector for prompt tracking, success pattern learning, and agent coordination. Agents use this skill to offload code generation to Cerebras while maintaining a searchable database of what works.
11
+ Coordinates **fast code generation** via Z.ai glm-4.6 model with RuVector pattern learning. Agents use this skill to offload rapid test generation and boilerplate code while building a searchable database of successful patterns.
5
12
 
6
13
  ## Key Features
7
14
  - 🚀 **Fast Code Generation**: Uses Cerebras API for rapid code creation
@@ -65,15 +72,22 @@ Agent (Coordinator) Cerebras Coordinator Skill RuVector
65
72
  | | |
66
73
  ```
67
74
 
75
+ ## When to Use
76
+ - ✅ **Bulk test generation** - generating many test files quickly
77
+ - ✅ **Boilerplate with patterns** - learning from previous successful generations
78
+ - ✅ **Agent code offloading** - when agents need fast, simple code generation
79
+ - ✅ **Repetitive tasks** - migrations, similar components, data models
80
+ - ❌ **NOT for** complex logic, security code, or architectural decisions
81
+
68
82
  ## Configuration
69
83
 
70
84
  ```bash
71
85
  # Required
72
- export CEREBRAS_API_KEY="your-cerebras-api-key"
86
+ export ZAI_API_KEY="your-zai-api-key" # or CEREBRAS_API_KEY for legacy
73
87
  export RUVECTOR_INDEX_PATH="./.claude/skills/cfn-ruvector-codebase-index/data"
74
88
 
75
89
  # Optional
76
- export CEREBRAS_MODEL="qwen2.5-coder-32b"
90
+ export ZAI_MODEL="glm-4.6" # Fast, cost-effective model (default)
77
91
  export COORDINATION_DB_PATH="./.claude/skills/cfn-cerebras-coordinator/generations.db"
78
92
  export DEFAULT_TEST_TIMEOUT="60"
79
93
  export MAX_GENERATION_ATTEMPTS="3"
@@ -1,10 +1,24 @@
1
+ ---
2
+ name: cfn-cerebras-mcp
3
+ description: "FAST code generation via mcp__cerebras-mcp__write tool using Z.ai glm-4.6. Use for rapid test generation, boilerplate creation, and bulk code tasks in main chat. Prompt must be SHORTER than output. Ideal for tests, CRUD, migrations, and repetitive patterns."
4
+ version: 2.0.0
5
+ tags: [mcp, code-generation, fast, zai, glm-4.6, tests, main-chat]
6
+ ---
7
+
1
8
  # Cerebras MCP Code Generation
2
9
 
3
- Fast code generation via `mcp__cerebras-mcp__write` tool.
10
+ **FAST** code generation via `mcp__cerebras-mcp__write` tool using Z.ai glm-4.6 model.
4
11
 
5
12
  ## When to Use
6
13
 
7
- Use for generating or modifying code files when speed matters. Prompt must be SHORTER than expected output.
14
+ Use for **rapid test and code generation** when speed matters more than nuance:
15
+ - ✅ **Test files** - unit tests, integration tests, test fixtures
16
+ - ✅ **Boilerplate** - CRUD endpoints, data models, components
17
+ - ✅ **Bulk creation** - multiple similar files quickly
18
+ - ✅ **Migrations** - database migrations, schema updates
19
+ - ❌ **NOT for** complex architecture, security code, nuanced logic
20
+
21
+ **Rule**: Prompt must be SHORTER than expected output (blueprint style).
8
22
 
9
23
  ## Usage
10
24
 
@@ -25,11 +25,9 @@
25
25
  "prepare": "chmod +x bin/fix-errors.sh",
26
26
  "postinstall": "echo 'CFN Compilation Error Fixer installed successfully! Run: npm run fix:rust or npm run fix:ts'"
27
27
  },
28
- "dependencies": {},
29
28
  "optionalDependencies": {
30
- "@cerebras/cerebras_cloud_sdk": "^1.0.0"
29
+ "@cerebras/cerebras_cloud_sdk": "^1.59.0"
31
30
  },
32
- "devDependencies": {},
33
31
  "engines": {
34
32
  "node": ">=18.0.0"
35
33
  },
@@ -44,4 +42,4 @@
44
42
  ],
45
43
  "author": "CFN Team",
46
44
  "license": "MIT"
47
- }
45
+ }
@@ -89,6 +89,9 @@ fi
89
89
  # Convert to absolute path
90
90
  PATH_TO_INDEX="$(cd "$PATH_TO_INDEX" && pwd)"
91
91
 
92
+ # Convert array to comma-separated string for Python
93
+ FILE_TYPES_STR=$(IFS=','; echo "${FILE_TYPES[*]}")
94
+
92
95
  echo "🔍 Indexing code patterns in: $PATH_TO_INDEX"
93
96
  echo "📄 File types: ${FILE_TYPES[*]}"
94
97
  if [[ -n "$PATTERNS" ]]; then
@@ -113,7 +116,7 @@ def generate_pattern_id(file_path, content):
113
116
  def extract_functions(content, file_type):
114
117
  \"\"\"Extract functions/classes from code\"\"\"
115
118
  patterns = []
116
-
119
+
117
120
  # Simple extraction based on language
118
121
  if file_type == 'rs':
119
122
  # Rust functions, structs, impls
@@ -121,10 +124,10 @@ def extract_functions(content, file_type):
121
124
  fn_pattern = r'^(pub\s+)?(async\s+)?(unsafe\s+)?fn\s+(\w+)'
122
125
  struct_pattern = r'^(pub\s+)?struct\s+(\w+)'
123
126
  impl_pattern = r'^impl\s+(\w+)\s*(for\s+(\w+))?'
124
-
127
+
125
128
  for i, line in enumerate(content.split('\\n')):
126
- for pattern, type_name in [(fn_pattern, 'function'),
127
- (struct_pattern, 'struct'),
129
+ for pattern, type_name in [(fn_pattern, 'function'),
130
+ (struct_pattern, 'struct'),
128
131
  (impl_pattern, 'impl')]:
129
132
  match = re.match(pattern, line)
130
133
  if match:
@@ -134,13 +137,13 @@ def extract_functions(content, file_type):
134
137
  'line': i + 1,
135
138
  'signature': line.strip()
136
139
  })
137
-
140
+
138
141
  elif file_type == 'py':
139
142
  # Python functions, classes
140
143
  import re
141
144
  fn_pattern = r'^\s*def\s+(\w+)'
142
145
  class_pattern = r'^\s*class\s+(\w+)'
143
-
146
+
144
147
  for i, line in enumerate(content.split('\\n')):
145
148
  if re.match(fn_pattern, line):
146
149
  patterns.append({
@@ -151,41 +154,53 @@ def extract_functions(content, file_type):
151
154
  })
152
155
  elif re.match(class_pattern, line):
153
156
  patterns.append({
154
- 'type': 'class',
157
+ 'type': 'class',
155
158
  'name': re.match(class_pattern, line).group(1),
156
159
  'line': i + 1,
157
160
  'signature': line.strip()
158
161
  })
159
-
162
+
160
163
  return patterns
161
164
 
162
165
  # Initialize engine
163
166
  engine = SearchEngine('${STORAGE_PATH}/storage')
164
167
 
168
+ # Parse file types from shell
169
+ file_types = '${FILE_TYPES_STR}'.split(',')
170
+ verbose = '${VERBOSE}' == 'true'
171
+
165
172
  # Index files
166
173
  indexed_count = 0
167
174
  pattern_count = 0
168
175
 
169
176
  print('📂 Scanning files...')
170
- for file_type in ${FILE_TYPES[@]}:
177
+ for file_type in file_types:
178
+ file_type = file_type.strip()
179
+ if not file_type:
180
+ continue
171
181
  pattern = f'**/*.{file_type}'
172
182
  files = list(Path('${PATH_TO_INDEX}').rglob(pattern))
173
-
183
+
174
184
  for file_path in files:
185
+ # Skip node_modules, .git, dist, build directories
186
+ path_str = str(file_path)
187
+ if any(skip in path_str for skip in ['node_modules', '.git', '/dist/', '/build/', '/target/']):
188
+ continue
189
+
175
190
  if file_path.is_file():
176
191
  try:
177
192
  with open(file_path, 'r', encoding='utf-8') as f:
178
193
  content = f.read()
179
-
194
+
180
195
  if len(content) < 50: # Skip very small files
181
196
  continue
182
-
197
+
183
198
  # Generate pattern ID
184
199
  pattern_id = generate_pattern_id(str(file_path), content)
185
-
200
+
186
201
  # Extract functions/classes
187
202
  patterns = extract_functions(content, file_type)
188
-
203
+
189
204
  # Prepare metadata
190
205
  metadata = {
191
206
  'file_size': len(content),
@@ -193,7 +208,7 @@ for file_type in ${FILE_TYPES[@]}:
193
208
  'patterns': patterns,
194
209
  'last_modified': os.path.getmtime(file_path)
195
210
  }
196
-
211
+
197
212
  # Store pattern
198
213
  engine.add_pattern(
199
214
  pattern_id=pattern_id,
@@ -202,15 +217,15 @@ for file_type in ${FILE_TYPES[@]}:
202
217
  content=content,
203
218
  metadata=metadata
204
219
  )
205
-
220
+
206
221
  indexed_count += 1
207
222
  pattern_count += len(patterns)
208
-
209
- if ${VERBOSE}:
223
+
224
+ if verbose:
210
225
  print(f' ✅ {file_path} ({len(patterns)} patterns)')
211
-
226
+
212
227
  except Exception as e:
213
- if ${VERBOSE}:
228
+ if verbose:
214
229
  print(f' ⚠️ Skipped {file_path}: {e}')
215
230
  continue
216
231
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow-novice",
3
- "version": "2.18.10",
3
+ "version": "2.18.12",
4
4
  "description": "Claude Flow Novice - Advanced orchestration platform for multi-agent AI workflows with CFN Loop architecture\n\nIncludes Local RuVector Accelerator and all CFN skills for complete functionality.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -138,7 +138,9 @@ function main() {
138
138
  }
139
139
 
140
140
  // Run the script
141
- main().catch(error => {
141
+ try {
142
+ main();
143
+ } catch (error) {
142
144
  console.error('CFN post-install failed:', error);
143
145
  process.exit(1);
144
- });
146
+ }