claude-flow-novice 2.18.17 → 2.18.19
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/.claude/commands/cfn-ruvector/cfn-codebase-reindex.md +17 -21
- package/.claude/commands/cfn-ruvector/cfn-codebase-search.md +9 -16
- package/.claude/commands/cfn-ruvector-search.md +16 -28
- package/.claude/skills/cfn-local-ruvector-accelerator/SKILL.md +26 -3
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/index.rs +10 -1
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/index_ast.rs +9 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/embeddings.rs +4 -7
- package/package.json +1 -1
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Update codebase index
|
|
2
|
+
description: Update codebase index (default incremental, --force for full rebuild)
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Codebase Reindex Command
|
|
6
6
|
|
|
7
|
-
**Default mode
|
|
7
|
+
**Default mode:** Incremental - only re-indexes files with changed hashes (fast).
|
|
8
8
|
|
|
9
9
|
**Use when:**
|
|
10
|
-
- After
|
|
11
|
-
- Regular
|
|
12
|
-
- Need to refresh index
|
|
10
|
+
- After code changes
|
|
11
|
+
- Regular development workflow
|
|
12
|
+
- Need to refresh index
|
|
13
13
|
|
|
14
|
-
**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
**For full rebuild:**
|
|
15
|
+
Add `--force` flag for complete reindex:
|
|
16
|
+
- First-time setup
|
|
17
|
+
- Major restructuring
|
|
18
|
+
- Index issues
|
|
19
19
|
|
|
20
|
-
**
|
|
20
|
+
**Prerequisites:**
|
|
21
|
+
- OPENAI_API_KEY must be set: `export OPENAI_API_KEY="sk-..."`
|
|
21
22
|
|
|
22
23
|
---
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
Add `--full` flag if you need to rebuild the entire index from scratch:
|
|
26
|
-
- First-time setup
|
|
27
|
-
- Major codebase restructuring
|
|
28
|
-
- Index corrupted or missing
|
|
29
|
-
- After config changes (extensions, ignore patterns)
|
|
25
|
+
Execute reindex:
|
|
30
26
|
|
|
31
27
|
```bash
|
|
32
|
-
#
|
|
33
|
-
./.claude/skills/cfn-ruvector-
|
|
28
|
+
# Incremental (default - only changed files)
|
|
29
|
+
./.claude/skills/cfn-local-ruvector-accelerator/target/release/local-ruvector index --path . --types rs,ts,js,py,sh,md
|
|
34
30
|
|
|
35
|
-
# Full rebuild (
|
|
36
|
-
./.claude/skills/cfn-ruvector-
|
|
31
|
+
# Full rebuild (when needed)
|
|
32
|
+
# ./.claude/skills/cfn-local-ruvector-accelerator/target/release/local-ruvector index --path . --types rs,ts,js,py,sh,md --force
|
|
37
33
|
```
|
|
@@ -1,38 +1,31 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Search codebase using
|
|
2
|
+
description: Search codebase using RuVector semantic index (400x faster than grep)
|
|
3
3
|
arguments:
|
|
4
4
|
query:
|
|
5
5
|
description: Natural language search query
|
|
6
6
|
required: true
|
|
7
7
|
--top:
|
|
8
|
-
description: Number of results to return (default
|
|
8
|
+
description: Number of results to return (default 10)
|
|
9
9
|
required: false
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# Codebase Search Command
|
|
13
13
|
|
|
14
|
-
Search your indexed codebase using
|
|
14
|
+
Search your indexed codebase using RuVector. Uses SQLite index for fast lookups.
|
|
15
15
|
|
|
16
16
|
**Examples:**
|
|
17
|
-
- `/codebase-search authentication logic`
|
|
18
|
-
- `/codebase-search React components
|
|
19
|
-
- `/codebase-search database migration
|
|
20
|
-
- `/codebase-search error handling patterns`
|
|
21
|
-
|
|
22
|
-
**Returns:**
|
|
23
|
-
- File paths ranked by relevance
|
|
24
|
-
- File purpose and exports
|
|
25
|
-
- Code metrics (lines, complexity)
|
|
26
|
-
- Relevance scores
|
|
17
|
+
- `/cfn-ruvector:cfn-codebase-search authentication logic`
|
|
18
|
+
- `/cfn-ruvector:cfn-codebase-search React components --top 20`
|
|
19
|
+
- `/cfn-ruvector:cfn-codebase-search database migration`
|
|
27
20
|
|
|
28
21
|
**Prerequisites:**
|
|
29
|
-
- Codebase must be indexed
|
|
30
|
-
- OPENAI_API_KEY
|
|
22
|
+
- Codebase must be indexed: `./local-ruvector index --path . --force`
|
|
23
|
+
- OPENAI_API_KEY must be set for indexing
|
|
31
24
|
|
|
32
25
|
---
|
|
33
26
|
|
|
34
27
|
Execute the search:
|
|
35
28
|
|
|
36
29
|
```bash
|
|
37
|
-
./.claude/skills/cfn-ruvector-
|
|
30
|
+
./.claude/skills/cfn-local-ruvector-accelerator/target/release/local-ruvector query "{{query}}" --max-results {{#if top}}{{top}}{{else}}10{{/if}}
|
|
38
31
|
```
|
|
@@ -1,46 +1,34 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Semantic code search with RuVector"
|
|
2
|
+
description: "Semantic code search with RuVector (400x faster than grep)"
|
|
3
3
|
argument-hint: "<query>"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# RuVector Search
|
|
7
7
|
|
|
8
|
-
Quick semantic search through your codebase
|
|
8
|
+
Quick semantic search through your indexed codebase.
|
|
9
9
|
|
|
10
10
|
## Usage
|
|
11
11
|
|
|
12
|
-
```
|
|
13
|
-
/search "authentication middleware"
|
|
14
|
-
/search "error handling pattern"
|
|
15
|
-
/search "database connection setup"
|
|
12
|
+
```
|
|
13
|
+
/cfn-ruvector-search "authentication middleware"
|
|
14
|
+
/cfn-ruvector-search "error handling pattern"
|
|
16
15
|
```
|
|
17
16
|
|
|
18
17
|
## What it does
|
|
19
18
|
|
|
20
|
-
-
|
|
21
|
-
- Returns
|
|
22
|
-
-
|
|
19
|
+
- Queries pre-built SQLite index (not filesystem scan)
|
|
20
|
+
- Returns file paths with line numbers
|
|
21
|
+
- 400x faster than grep for indexed projects
|
|
23
22
|
|
|
24
|
-
##
|
|
23
|
+
## Prerequisites
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/search "user login flow"
|
|
29
|
-
```
|
|
25
|
+
- Project must be indexed first
|
|
26
|
+
- Run: `./local-ruvector index --path . --force`
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
/search "timeout error handling"
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Find API patterns:
|
|
37
|
-
```bash
|
|
38
|
-
/search "REST API validation"
|
|
39
|
-
```
|
|
28
|
+
---
|
|
40
29
|
|
|
41
|
-
|
|
30
|
+
Execute search:
|
|
42
31
|
|
|
43
|
-
For more control, use the full command:
|
|
44
32
|
```bash
|
|
45
|
-
/
|
|
46
|
-
```
|
|
33
|
+
./.claude/skills/cfn-local-ruvector-accelerator/target/release/local-ruvector query "$ARGUMENTS" --max-results 10
|
|
34
|
+
```
|
|
@@ -29,8 +29,8 @@ sqlite3 ~/.local/share/ruvector/index_v2.db "SELECT file_path, line_number FROM
|
|
|
29
29
|
/codebase-search "authentication middleware pattern"
|
|
30
30
|
/cfn-ruvector-search "error handling in API routes"
|
|
31
31
|
|
|
32
|
-
# CLI direct
|
|
33
|
-
./.claude/skills/cfn-local-ruvector-accelerator/target/release/local-ruvector query
|
|
32
|
+
# CLI direct (note: query text is positional, use --max-results not --limit)
|
|
33
|
+
./.claude/skills/cfn-local-ruvector-accelerator/target/release/local-ruvector query "user login flow" --max-results 5
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
### Structural Search (V2 - SQL on AST)
|
|
@@ -48,6 +48,27 @@ sqlite3 ~/.local/share/ruvector/index_v2.db \
|
|
|
48
48
|
"SELECT COUNT(*) FROM entities WHERE project_root = '/path/to/project';"
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
## Prerequisites
|
|
52
|
+
|
|
53
|
+
**OPENAI_API_KEY is REQUIRED for indexing.** Indexing will fail without a valid key.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Option 1: Export before running
|
|
57
|
+
export OPENAI_API_KEY="sk-..."
|
|
58
|
+
|
|
59
|
+
# Option 2: Add to shell profile (~/.bashrc or ~/.zshrc)
|
|
60
|
+
echo 'export OPENAI_API_KEY="sk-..."' >> ~/.bashrc
|
|
61
|
+
source ~/.bashrc
|
|
62
|
+
|
|
63
|
+
# Option 3: Inline with command
|
|
64
|
+
OPENAI_API_KEY="sk-..." ./local-ruvector index --path /project
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Verify key is set:**
|
|
68
|
+
```bash
|
|
69
|
+
echo $OPENAI_API_KEY # Should show your key (not empty)
|
|
70
|
+
```
|
|
71
|
+
|
|
51
72
|
## Index Management
|
|
52
73
|
|
|
53
74
|
```bash
|
|
@@ -78,8 +99,10 @@ sqlite3 ~/.local/share/ruvector/index_v2.db "SELECT project_root, COUNT(*) FROM
|
|
|
78
99
|
|
|
79
100
|
Before implementing changes, ALWAYS query RuVector first:
|
|
80
101
|
```bash
|
|
81
|
-
# Find similar patterns
|
|
102
|
+
# Find similar patterns (slash command uses --top, CLI uses --max-results)
|
|
82
103
|
/codebase-search "relevant search terms" --top 5
|
|
104
|
+
# Or via CLI:
|
|
105
|
+
./local-ruvector query "relevant search terms" --max-results 5
|
|
83
106
|
|
|
84
107
|
# Query past errors
|
|
85
108
|
./.claude/skills/cfn-ruvector-codebase-index/query-error-patterns.sh --task-description "description"
|
|
@@ -46,7 +46,7 @@ use anyhow::{Result, Context, anyhow};
|
|
|
46
46
|
use std::fs;
|
|
47
47
|
use std::path::{Path, PathBuf};
|
|
48
48
|
use walkdir::{WalkDir, DirEntry};
|
|
49
|
-
use tracing::{info, debug, warn};
|
|
49
|
+
use tracing::{info, debug, warn, error};
|
|
50
50
|
use regex::Regex;
|
|
51
51
|
use std::sync::Arc;
|
|
52
52
|
use std::sync::RwLock;
|
|
@@ -286,6 +286,15 @@ impl IndexCommand {
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
pub fn execute(&mut self) -> Result<IndexStats> {
|
|
289
|
+
// Fail early if OPENAI_API_KEY is not set
|
|
290
|
+
if std::env::var("OPENAI_API_KEY").is_err() {
|
|
291
|
+
error!("OPENAI_API_KEY environment variable is required for indexing");
|
|
292
|
+
return Err(anyhow!(
|
|
293
|
+
"OPENAI_API_KEY not found. Set it with: export OPENAI_API_KEY=\"sk-...\"\n\
|
|
294
|
+
Indexing requires a valid OpenAI API key for generating embeddings."
|
|
295
|
+
));
|
|
296
|
+
}
|
|
297
|
+
|
|
289
298
|
info!("Starting index process");
|
|
290
299
|
info!("File types: {:?}", self.file_types);
|
|
291
300
|
if let Some(ref patterns) = self.patterns {
|
|
@@ -99,6 +99,15 @@ impl AstIndexCommand {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
pub fn execute(&mut self) -> Result<IndexStats> {
|
|
102
|
+
// Fail early if OPENAI_API_KEY is not set
|
|
103
|
+
if std::env::var("OPENAI_API_KEY").is_err() {
|
|
104
|
+
error!("OPENAI_API_KEY environment variable is required for indexing");
|
|
105
|
+
return Err(anyhow!(
|
|
106
|
+
"OPENAI_API_KEY not found. Set it with: export OPENAI_API_KEY=\"sk-...\"\n\
|
|
107
|
+
Indexing requires a valid OpenAI API key for generating embeddings."
|
|
108
|
+
));
|
|
109
|
+
}
|
|
110
|
+
|
|
102
111
|
let start_time = std::time::Instant::now();
|
|
103
112
|
|
|
104
113
|
info!("Starting AST-based index process");
|
|
@@ -101,13 +101,10 @@ impl EmbeddingsManager {
|
|
|
101
101
|
debug!("Generating embeddings for {} texts", texts.len());
|
|
102
102
|
|
|
103
103
|
if self.config.api_key.is_none() {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
info!("Generated {} dummy embeddings", embeddings.len());
|
|
110
|
-
return Ok(embeddings);
|
|
104
|
+
error!("OPENAI_API_KEY environment variable not set");
|
|
105
|
+
return Err(anyhow!(
|
|
106
|
+
"OPENAI_API_KEY not found. Set it with: export OPENAI_API_KEY=\"sk-...\""
|
|
107
|
+
));
|
|
111
108
|
}
|
|
112
109
|
|
|
113
110
|
let mut all_embeddings = Vec::with_capacity(texts.len());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow-novice",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.19",
|
|
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",
|