claude-flow-novice 2.18.40 → 2.19.1
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/agents/AGENT_LIFECYCLE.md +1 -1
- package/.claude/agents/SHARED_PROTOCOL.md +33 -5
- package/.claude/agents/cfn-dev-team/analysts/analyst.md +4 -4
- package/.claude/agents/cfn-dev-team/analysts/root-cause-analyst.md +4 -4
- package/.claude/agents/cfn-dev-team/architecture/api-designer-persona.md +4 -4
- package/.claude/agents/cfn-dev-team/architecture/base-template-generator.md +4 -4
- package/.claude/agents/cfn-dev-team/architecture/goal-planner.md +4 -4
- package/.claude/agents/cfn-dev-team/architecture/system-architect.md +4 -4
- package/.claude/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +4 -4
- package/.claude/agents/cfn-dev-team/coordinators/handoff-coordinator.md +4 -4
- package/.claude/agents/cfn-dev-team/dev-ops/devops-engineer.md +4 -4
- package/.claude/agents/cfn-dev-team/dev-ops/docker-specialist.md +4 -4
- package/.claude/agents/cfn-dev-team/dev-ops/fly-io-specialist.md +418 -0
- package/.claude/agents/cfn-dev-team/dev-ops/github-commit-agent.md +4 -4
- package/.claude/agents/cfn-dev-team/developers/api-gateway-specialist.md +4 -4
- package/.claude/agents/cfn-dev-team/developers/backend-developer.md +4 -4
- package/.claude/agents/cfn-dev-team/developers/data/data-engineer.md +4 -4
- package/.claude/agents/cfn-dev-team/developers/database/database-architect.md +4 -4
- package/.claude/agents/cfn-dev-team/developers/database/mem0-specialist.md +579 -0
- package/.claude/agents/cfn-dev-team/developers/database/memgraph-specialist.md +722 -0
- package/.claude/agents/cfn-dev-team/developers/database/supabase-specialist.md +4 -4
- package/.claude/agents/cfn-dev-team/developers/frontend/mobile-dev.md +4 -4
- package/.claude/agents/cfn-dev-team/developers/frontend/react-frontend-engineer.md +4 -4
- package/.claude/agents/cfn-dev-team/developers/frontend/typescript-specialist.md +4 -4
- package/.claude/agents/cfn-dev-team/developers/frontend/ui-designer.md +4 -4
- package/.claude/agents/cfn-dev-team/developers/graphql-specialist.md +4 -4
- package/.claude/agents/cfn-dev-team/developers/rust-developer.md +4 -4
- package/.claude/agents/cfn-dev-team/documentation/agent-type-guidelines.md +4 -4
- package/.claude/agents/cfn-dev-team/documentation/api-documentation.md +4 -4
- package/.claude/agents/cfn-dev-team/documentation/pseudocode.md +5 -5
- package/.claude/agents/cfn-dev-team/documentation/specification-agent.md +5 -5
- package/.claude/agents/cfn-dev-team/product-owners/accessibility-advocate-persona.md +4 -4
- package/.claude/agents/cfn-dev-team/product-owners/cto-agent.md +4 -4
- package/.claude/agents/cfn-dev-team/product-owners/power-user-persona.md +4 -4
- package/.claude/agents/cfn-dev-team/product-owners/product-owner.md +4 -4
- package/.claude/agents/cfn-dev-team/reviewers/code-reviewer.md +4 -4
- package/.claude/agents/cfn-dev-team/reviewers/quality/code-quality-validator.md +4 -4
- package/.claude/agents/cfn-dev-team/reviewers/quality/cyclomatic-complexity-reducer.md +4 -4
- package/.claude/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +4 -4
- package/.claude/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +4 -4
- package/.claude/agents/cfn-dev-team/reviewers/quality/quality-metrics.md +4 -4
- package/.claude/agents/cfn-dev-team/testers/api-testing-specialist.md +4 -4
- package/.claude/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +4 -4
- package/.claude/agents/cfn-dev-team/testers/contract-tester.md +4 -4
- package/.claude/agents/cfn-dev-team/testers/e2e/playwright-tester.md +4 -4
- package/.claude/agents/cfn-dev-team/testers/integration-tester.md +4 -4
- package/.claude/agents/cfn-dev-team/testers/interaction-tester.md +4 -4
- package/.claude/agents/cfn-dev-team/testers/load-testing-specialist.md +4 -4
- package/.claude/agents/cfn-dev-team/testers/mutation-testing-specialist.md +4 -4
- package/.claude/agents/cfn-dev-team/testers/playwright-tester.md +4 -4
- package/.claude/agents/cfn-dev-team/{testing → testers}/test-validation-agent.md +4 -4
- package/.claude/agents/cfn-dev-team/testers/tester.md +39 -4
- package/.claude/agents/cfn-dev-team/testers/unit/tdd-london-unit-swarm.md +4 -4
- package/.claude/agents/cfn-dev-team/testers/validation/validation-production-validator.md +4 -4
- package/.claude/agents/cfn-dev-team/utility/agent-builder.md +7 -7
- package/.claude/agents/cfn-dev-team/utility/memory-leak-specialist.md +4 -4
- package/.claude/agents/cfn-dev-team/utility/researcher.md +4 -4
- package/.claude/agents/cfn-dev-team/utility/z-ai-specialist.md +4 -4
- package/.claude/agents/custom/claude-code-expert.md +1 -1
- package/.claude/agents/project-only-agents/npm-package-specialist.md +1 -1
- package/.claude/{agents/cfn-dev-team/utility → cfn-extras/agents}/context-curator.md +4 -4
- package/.claude/{agents/custom → cfn-extras/agents/custom-agents}/cfn-docker-expert.md +4 -4
- package/.claude/{agents/custom → cfn-extras/agents/custom-agents}/cfn-redis-operations.md +1 -1
- package/.claude/{agents/custom → cfn-extras/agents/custom-agents}/cfn-system-expert.md +4 -4
- package/.claude/{agents/custom → cfn-extras/agents/custom-agents}/trigger-dev-expert.md +4 -4
- package/.claude/{agents/cfn-dev-team/coordinators → cfn-extras/agents/deprecated-coordinators}/consensus-builder.md +4 -4
- package/.claude/{agents/cfn-dev-team/coordinators → cfn-extras/agents/deprecated-coordinators}/multi-sprint-coordinator.md +4 -4
- package/.claude/{agents → cfn-extras/agents/docker-team}/docker-coordinators/cfn-docker-v3-coordinator.md +1 -1
- package/.claude/{agents/cfn-dev-team/dev-ops → cfn-extras/agents}/kubernetes-specialist.md +4 -4
- package/.claude/{agents/cfn-dev-team/architecture → cfn-extras/agents}/planner.md +4 -4
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/QUICKSTART.md +1 -1
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/README.md +19 -19
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/SKILL.md +7 -7
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/TDD_COORDINATOR_OVERVIEW.md +3 -3
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/TEST_RESULTS.md +3 -3
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/coordinate-generation.sh +19 -19
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/example-fix-scenario.md +4 -4
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/example-usage.sh +1 -1
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/feedback-logger.sh +5 -5
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/fix-existing-code-v2.sh +2 -2
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/fix-existing-code.sh +10 -10
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/pattern-examples.md +3 -3
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/query-patterns.sh +9 -9
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/tdd-coordinator.sh +8 -8
- package/.claude/cfn-extras/skills/cfn-cerebras-coordinator/test-tdd-coordinator.sh +1 -1
- package/.claude/commands/README.md +1 -1
- package/.claude/commands/{cfn-ruvector → cfn-codesearch}/cfn-codebase-reindex.md +6 -6
- package/.claude/commands/{cfn-ruvector → cfn-codesearch}/cfn-codebase-search.md +8 -8
- package/.claude/commands/{cfn-ruvector → cfn-codesearch}/cfn-detect-stale-docs.md +3 -3
- package/.claude/commands/cfn-codesearch-search.md +36 -0
- package/.claude/commands/cfn-fix-errors.md +1 -1
- package/.claude/commands/cfn-loop-task.md +66 -2
- package/.claude/commands/cfn-update-search-index.md +2 -2
- package/.claude/hooks/cfn-SessionStart-cfn-build-codesearch.sh +24 -0
- package/.claude/hooks/cfn-bash-search-hook.sh +6 -6
- package/.claude/hooks/cfn-smart-search-hook.sh +15 -15
- package/.claude/hooks/cfn-subagent-stop.sh +9 -9
- package/.claude/hooks/post-commit-codebase-index +14 -14
- package/.claude/skills/{bulk-add-ruvector-instructions.sh → bulk-add-codesearch-instructions.sh} +14 -14
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/AGENT_INTEGRATION_PATTERNS.md +20 -20
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/AGENT_LIFECYCLE_INTEGRATION.md +12 -12
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/Cargo.toml +9 -4
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/EXTRACTION_EXAMPLES.md +6 -6
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/IMMEDIATE_ACTION_REQUIRED.md +9 -9
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/README.md +7 -7
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/SCHEMA_V2_IMPLEMENTATION.md +1 -1
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/SECURITY_FINDINGS_SUMMARY.txt +1 -1
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/SECURITY_IMPLEMENTATION.md +3 -3
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/SECURITY_TESTING_COMPLETION.md +5 -5
- package/.claude/skills/cfn-codesearch/SKILL.md +143 -0
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/analyze-agent-failures.sh +11 -11
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/cfn-integration.sh +29 -29
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/docs/EXECUTIVE_SUMMARY.txt +1 -1
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/docs/PHASE_4_QUERY_API.md +24 -24
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/docs/RUST_AST_EXTRACTOR_IMPLEMENTATION.md +7 -7
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/docs/TRANSACTION_MANAGEMENT.md +1 -1
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/docs/VALIDATION_FINDINGS.txt +1 -1
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/epic-ast-indexer.json +8 -8
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/index-code.sh +11 -11
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/index_all.sh +2 -2
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/ingest-agent-transcript.sh +10 -10
- package/.claude/skills/{cfn-local-ruvector-accelerator/init-local-ruvector.sh → cfn-codesearch/init-local-codesearch.sh} +16 -16
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/project-structure.md +10 -10
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/query-local.sh +6 -6
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/cleanup.rs +1 -1
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/index.rs +238 -9
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/index_ast.rs +3 -3
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/init.rs +19 -19
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/migration.rs +5 -5
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/query.rs +64 -3
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/reset.rs +5 -5
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/embeddings.rs +19 -5
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/lib.rs +6 -4
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/main.rs +37 -27
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/migration_v2.rs +1 -1
- package/.claude/skills/cfn-codesearch/src/paths.rs +37 -0
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/query_v2.rs +3 -4
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/search_engine.rs +3 -3
- package/.claude/skills/cfn-codesearch/src/store_pgvector.rs +301 -0
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/store_v2.rs +12 -1
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/test-agent-lifecycle-integration.sh +6 -6
- package/.claude/skills/{cfn-local-ruvector-accelerator/test-local-ruvector.sh → cfn-codesearch/test-local-codesearch.sh} +7 -7
- package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/test_query_api.sh +2 -2
- package/.claude/skills/cfn-epic-creator/SKILL.md +110 -2
- package/.claude/skills/cfn-epic-creator/invoke.sh +120 -1
- package/.claude/skills/cfn-knowledge-base/lib/playbook/SKILL.md +1 -1
- package/.claude/skills/cfn-mdap-context-injection/SKILL.md +2 -2
- package/.claude/skills/cfn-mdap-context-injection/inject.sh +23 -23
- package/CLAUDE.md +3 -3
- package/package.json +11 -11
- package/readme/feature-status.md +411 -0
- package/.claude/agents/docker-ts-fixer.md +0 -65
- package/.claude/commands/cfn-ruvector-search.md +0 -36
- package/.claude/hooks/cfn-SessionStart-cfn-build-ruvector.sh +0 -24
- package/.claude/skills/cfn-local-ruvector-accelerator/.claude/hooks/SessionStart-cfn-build-ruvector.sh +0 -13
- package/.claude/skills/cfn-local-ruvector-accelerator/SKILL.md +0 -143
- package/.claude/skills/cfn-local-ruvector-accelerator/src/paths.rs +0 -31
- /package/.claude/{agents/custom → cfn-extras/agents/custom-agents}/cfn-loops-cli-expert.md +0 -0
- /package/.claude/{agents/csuite → cfn-extras/agents/custom-agents}/cto-agent.md +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/Cargo.toml.backup +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/embeddings_manager.py.backup +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/index/index.bin +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/index/metadata.json +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/index-code.sh.backup +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/query-agent-patterns.sh +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/requirements.txt +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/search_engine_v2.py.backup +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/sqlite_store.py.backup +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/export.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/find.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/index_modified.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/mod.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/refs.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/cli/stats.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/extractors/mod.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/extractors/rust.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/extractors/rust_placeholder.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/extractors/text_fallback.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/extractors/typescript.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/extractors/typescript_full.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/main.rs.backup +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/migration.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/migration_backup.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/migration_tx.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/path_validator.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/query_api.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/schema_v2.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/security_tests.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/sqlite_store.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/store_v2_backup.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/store_v2_fixed.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/store_v2_tx.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/test_schema.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/src/transaction_tests.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/test_ast_indexing.rs +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/test_schema.sql +0 -0
- /package/.claude/skills/{cfn-local-ruvector-accelerator → cfn-codesearch}/test_schema_v2.sql +0 -0
|
@@ -6,14 +6,14 @@ Iterative Test-Driven Development with Cerebras LLM and conversation memory for
|
|
|
6
6
|
|
|
7
7
|
This coordinator implements a complete TDD workflow (Red-Green-Refactor) with:
|
|
8
8
|
- **Conversation Memory**: Full history tracked across iterations for context-aware fixes
|
|
9
|
-
- **Context Gathering**:
|
|
9
|
+
- **Context Gathering**: CodeSearch pattern queries + explicit context files
|
|
10
10
|
- **Iterative Refinement**: Failed tests trigger fix loops with error context
|
|
11
|
-
- **Success Logging**: Successful patterns indexed to
|
|
11
|
+
- **Success Logging**: Successful patterns indexed to CodeSearch for learning
|
|
12
12
|
|
|
13
13
|
## Workflow Phases
|
|
14
14
|
|
|
15
15
|
### Phase 1: Context Gathering
|
|
16
|
-
- Query
|
|
16
|
+
- Query CodeSearch for similar patterns in codebase
|
|
17
17
|
- Load explicit context files (types, utilities, related code)
|
|
18
18
|
- Store context in conversation metadata
|
|
19
19
|
|
|
@@ -34,7 +34,7 @@ This coordinator implements a complete TDD workflow (Red-Green-Refactor) with:
|
|
|
34
34
|
|
|
35
35
|
### Phase 5: GREEN - Verify Pass
|
|
36
36
|
- Run tests to check if implementation works
|
|
37
|
-
- If pass: success, log to
|
|
37
|
+
- If pass: success, log to CodeSearch
|
|
38
38
|
- If fail: enter fix loop
|
|
39
39
|
|
|
40
40
|
### Phase 6: FIX - Iterative Refinement
|
|
@@ -44,7 +44,7 @@ This coordinator implements a complete TDD workflow (Red-Green-Refactor) with:
|
|
|
44
44
|
- Repeat until tests pass or max iterations reached
|
|
45
45
|
|
|
46
46
|
### Phase 7: Success Logging
|
|
47
|
-
- Index successful pattern to
|
|
47
|
+
- Index successful pattern to CodeSearch
|
|
48
48
|
- Save full conversation JSON for learning
|
|
49
49
|
- Store in `conversations/` directory
|
|
50
50
|
|
|
@@ -129,7 +129,7 @@ This coordinator implements a complete TDD workflow (Red-Green-Refactor) with:
|
|
|
129
129
|
- Recommended: `zai-glm-4.6` for fast code generation
|
|
130
130
|
- Alternative: `llama3.1-70b` for complex reasoning
|
|
131
131
|
- `MAX_TDD_ITERATIONS` - Default max iterations (default: 5)
|
|
132
|
-
- `
|
|
132
|
+
- `CODESEARCH_INDEX_PATH` - CodeSearch index location (default: `./.claude/skills/cfn-codesearch`)
|
|
133
133
|
|
|
134
134
|
### SessionStart Hook Integration
|
|
135
135
|
|
|
@@ -205,12 +205,12 @@ The coordinator automatically determines test file paths based on language:
|
|
|
205
205
|
| Go | `pkg/handler.go` | `pkg/handler_test.go` |
|
|
206
206
|
| Other | `path/file.ext` | `path/file.test.ext` |
|
|
207
207
|
|
|
208
|
-
## Integration with
|
|
208
|
+
## Integration with CodeSearch
|
|
209
209
|
|
|
210
210
|
### Query Phase (Phase 1)
|
|
211
211
|
```bash
|
|
212
|
-
# Queries
|
|
213
|
-
./.claude/skills/cfn-
|
|
212
|
+
# Queries CodeSearch for similar patterns
|
|
213
|
+
./.claude/skills/cfn-codesearch/query-local.sh \
|
|
214
214
|
--pattern "Email validation function" \
|
|
215
215
|
--limit 3
|
|
216
216
|
```
|
|
@@ -218,7 +218,7 @@ The coordinator automatically determines test file paths based on language:
|
|
|
218
218
|
### Success Phase (Phase 7)
|
|
219
219
|
```bash
|
|
220
220
|
# Indexes successful implementation
|
|
221
|
-
./.claude/skills/cfn-
|
|
221
|
+
./.claude/skills/cfn-codesearch/index-code.sh \
|
|
222
222
|
--path ./src/validators/email.ts \
|
|
223
223
|
--source tdd-cerebras \
|
|
224
224
|
--success true
|
|
@@ -262,7 +262,7 @@ Tests failed:
|
|
|
262
262
|
|
|
263
263
|
### After Success
|
|
264
264
|
- `./.claude/skills/cfn-cerebras-coordinator/conversations/{date}-{agent-id}.json` - Saved conversation
|
|
265
|
-
-
|
|
265
|
+
- CodeSearch index updated with successful pattern
|
|
266
266
|
|
|
267
267
|
## Best Practices
|
|
268
268
|
|
|
@@ -384,24 +384,24 @@ cat /tmp/cerebras-tdd-*.json | jq '.messages[] | select(.role == "user") | .cont
|
|
|
384
384
|
--max-iterations 10 # May indicate deeper issues
|
|
385
385
|
```
|
|
386
386
|
|
|
387
|
-
###
|
|
387
|
+
### CodeSearch Integration Issues
|
|
388
388
|
**Symptom**: Context gathering or success logging fails
|
|
389
389
|
|
|
390
390
|
**Causes**:
|
|
391
|
-
-
|
|
392
|
-
- Incorrect `
|
|
391
|
+
- CodeSearch index not initialized
|
|
392
|
+
- Incorrect `CODESEARCH_INDEX_PATH`
|
|
393
393
|
- Permission issues
|
|
394
394
|
|
|
395
395
|
**Solutions**:
|
|
396
396
|
```bash
|
|
397
|
-
# Check
|
|
398
|
-
ls -la ./.claude/skills/cfn-
|
|
397
|
+
# Check CodeSearch installation
|
|
398
|
+
ls -la ./.claude/skills/cfn-codesearch/
|
|
399
399
|
|
|
400
400
|
# Initialize index if needed
|
|
401
|
-
./.claude/skills/cfn-
|
|
401
|
+
./.claude/skills/cfn-codesearch/initialize-index.sh
|
|
402
402
|
|
|
403
403
|
# Set custom path
|
|
404
|
-
export
|
|
404
|
+
export CODESEARCH_INDEX_PATH="/path/to/codesearch"
|
|
405
405
|
```
|
|
406
406
|
|
|
407
407
|
## Testing
|
|
@@ -516,7 +516,7 @@ export ZAI_MODEL="glm-4.6" # vs more expensive alternatives
|
|
|
516
516
|
|
|
517
517
|
- [Test-Driven Development](https://en.wikipedia.org/wiki/Test-driven_development)
|
|
518
518
|
- [Given-When-Then](https://martinfowler.com/bliki/GivenWhenThen.html)
|
|
519
|
-
- [
|
|
519
|
+
- [CodeSearch Semantic Search](..//cfn-codesearch/README.md)
|
|
520
520
|
- [CFN Agent Spawning](../cfn-agent-spawning/SKILL.md)
|
|
521
521
|
- [Project Tests Guide](../../../tests/CLAUDE.md)
|
|
522
522
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cfn-cerebras-coordinator
|
|
3
|
-
description: "Coordinates FAST code generation via Z.ai glm-4.6 with
|
|
3
|
+
description: "Coordinates FAST code generation via Z.ai glm-4.6 with CodeSearch 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
4
|
version: 2.0.0
|
|
5
5
|
tags: [coordination, code-generation, fast, zai, glm-4.6, pattern-learning, tests]
|
|
6
6
|
---
|
|
@@ -8,11 +8,11 @@ tags: [coordination, code-generation, fast, zai, glm-4.6, pattern-learning, test
|
|
|
8
8
|
# Cerebras Coordinator Skill
|
|
9
9
|
|
|
10
10
|
## Description
|
|
11
|
-
Coordinates **fast code generation** via Z.ai glm-4.6 model with
|
|
11
|
+
Coordinates **fast code generation** via Z.ai glm-4.6 model with CodeSearch pattern learning. Agents use this skill to offload rapid test generation and boilerplate code while building a searchable database of successful patterns.
|
|
12
12
|
|
|
13
13
|
## Key Features
|
|
14
14
|
- 🚀 **Fast Code Generation**: Uses Cerebras API for rapid code creation
|
|
15
|
-
- 📚 **Pattern Learning**: Tracks successful prompts and contexts in
|
|
15
|
+
- 📚 **Pattern Learning**: Tracks successful prompts and contexts in CodeSearch
|
|
16
16
|
- 🔄 **Feedback Loop**: Tests generated code and logs results
|
|
17
17
|
- 🎯 **Agent Coordination**: Provides simple interface for agents to coordinate generation tasks
|
|
18
18
|
- 📊 **Success Metrics**: Analyzes and ranks prompt effectiveness
|
|
@@ -59,7 +59,7 @@ Coordinates **fast code generation** via Z.ai glm-4.6 model with RuVector patter
|
|
|
59
59
|
## Architecture
|
|
60
60
|
|
|
61
61
|
```
|
|
62
|
-
Agent (Coordinator) Cerebras Coordinator Skill
|
|
62
|
+
Agent (Coordinator) Cerebras Coordinator Skill CodeSearch
|
|
63
63
|
| | |
|
|
64
64
|
|--- Request Generation --->| |
|
|
65
65
|
| |--- Store Prompt ------------->|
|
|
@@ -84,7 +84,7 @@ Agent (Coordinator) Cerebras Coordinator Skill RuVector
|
|
|
84
84
|
```bash
|
|
85
85
|
# Required
|
|
86
86
|
export ZAI_API_KEY="your-zai-api-key" # or CEREBRAS_API_KEY for legacy
|
|
87
|
-
export
|
|
87
|
+
export CODESEARCH_INDEX_PATH="./.claude/skills/cfn-codesearch/data"
|
|
88
88
|
|
|
89
89
|
# Optional
|
|
90
90
|
export ZAI_MODEL="glm-4.6" # Fast, cost-effective model (default)
|
|
@@ -96,12 +96,12 @@ export MAX_GENERATION_ATTEMPTS="3"
|
|
|
96
96
|
## Workflow
|
|
97
97
|
|
|
98
98
|
1. **Agent Request**: Agent calls coordinator with generation task
|
|
99
|
-
2. **Pattern Lookup**: Coordinator queries
|
|
99
|
+
2. **Pattern Lookup**: Coordinator queries CodeSearch for similar successful patterns
|
|
100
100
|
3. **Prompt Enhancement**: Enhances prompt with successful pattern examples
|
|
101
101
|
4. **Generation**: Sends to Cerebras for code generation
|
|
102
102
|
5. **Testing**: Automatically runs tests on generated code
|
|
103
103
|
6. **Validation**: Checks if tests pass and code compiles
|
|
104
|
-
7. **Logging**: Stores results in
|
|
104
|
+
7. **Logging**: Stores results in CodeSearch for future learning
|
|
105
105
|
8. **Feedback**: Returns result to agent with success metrics
|
|
106
106
|
|
|
107
107
|
## Success Metrics
|
|
@@ -9,7 +9,7 @@ This directory contains two TDD coordinators with different approaches:
|
|
|
9
9
|
1. Generate tests
|
|
10
10
|
2. Generate implementation
|
|
11
11
|
3. Run tests once
|
|
12
|
-
4. Log to
|
|
12
|
+
4. Log to CodeSearch
|
|
13
13
|
|
|
14
14
|
**Best For**:
|
|
15
15
|
- Simple, well-understood features
|
|
@@ -29,7 +29,7 @@ This directory contains two TDD coordinators with different approaches:
|
|
|
29
29
|
**Purpose**: Iterative TDD with intelligent error recovery
|
|
30
30
|
|
|
31
31
|
**Workflow**:
|
|
32
|
-
1. Gather context (
|
|
32
|
+
1. Gather context (CodeSearch + files)
|
|
33
33
|
2. Generate tests (RED phase)
|
|
34
34
|
3. Verify tests fail
|
|
35
35
|
4. Generate implementation (GREEN phase)
|
|
@@ -58,7 +58,7 @@ This directory contains two TDD coordinators with different approaches:
|
|
|
58
58
|
| Feature | Original | Conversation |
|
|
59
59
|
|---------|----------|--------------|
|
|
60
60
|
| Iterations | 1 | 1-N (configurable) |
|
|
61
|
-
| Context gathering | Basic |
|
|
61
|
+
| Context gathering | Basic | CodeSearch + files |
|
|
62
62
|
| Error recovery | None | Full conversation history |
|
|
63
63
|
| Red phase validation | No | Yes |
|
|
64
64
|
| Fix analysis | No | Yes (with history) |
|
|
@@ -71,7 +71,7 @@ cargo check
|
|
|
71
71
|
- Simplify error handling for better compatibility
|
|
72
72
|
- Test script on multiple shells (bash, zsh)
|
|
73
73
|
|
|
74
|
-
2. **Pattern to Store in
|
|
74
|
+
2. **Pattern to Store in CodeSearch**:
|
|
75
75
|
```json
|
|
76
76
|
{
|
|
77
77
|
"type": "rust_borrow_checker_fix",
|
|
@@ -84,12 +84,12 @@ cargo check
|
|
|
84
84
|
|
|
85
85
|
3. **Integration Notes**:
|
|
86
86
|
- The fix script concept works well
|
|
87
|
-
- Pattern matching from
|
|
87
|
+
- Pattern matching from CodeSearch would improve fixes
|
|
88
88
|
- Direct integration with Cerebras would enhance automation
|
|
89
89
|
|
|
90
90
|
## Conclusion
|
|
91
91
|
|
|
92
|
-
The approach of fixing existing code with TDD +
|
|
92
|
+
The approach of fixing existing code with TDD + CodeSearch patterns is viable. The main script needs minor fixes for shell compatibility, but the core concept of:
|
|
93
93
|
1. Analyzing errors
|
|
94
94
|
2. Querying fix patterns
|
|
95
95
|
3. Applying solutions
|
|
@@ -4,7 +4,7 @@ set -euo pipefail
|
|
|
4
4
|
# Default configuration
|
|
5
5
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
6
|
DB_PATH="${COORDINATION_DB_PATH:-$SCRIPT_DIR/generations.db}"
|
|
7
|
-
|
|
7
|
+
CODESEARCH_INDEX="${CODESEARCH_INDEX_PATH:-./.claude/skills/cfn-codesearch/data}"
|
|
8
8
|
MAX_ATTEMPTS="${MAX_GENERATION_ATTEMPTS:-3}"
|
|
9
9
|
TEST_TIMEOUT="${DEFAULT_TEST_TIMEOUT:-60}"
|
|
10
10
|
MODEL="${CEREBRAS_MODEL:-qwen2.5-coder-32b}"
|
|
@@ -76,7 +76,7 @@ CREATE TABLE IF NOT EXISTS generations (
|
|
|
76
76
|
error_message TEXT,
|
|
77
77
|
attempts INTEGER,
|
|
78
78
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
79
|
-
|
|
79
|
+
codesearch_id TEXT,
|
|
80
80
|
confidence_score REAL,
|
|
81
81
|
performance_ms REAL
|
|
82
82
|
);
|
|
@@ -87,29 +87,29 @@ CREATE INDEX IF NOT EXISTS idx_success ON generations(success);
|
|
|
87
87
|
CREATE INDEX IF NOT EXISTS idx_created_at ON generations(created_at);
|
|
88
88
|
EOF
|
|
89
89
|
|
|
90
|
-
# Function to query successful patterns from
|
|
91
|
-
|
|
90
|
+
# Function to query successful patterns from CodeSearch
|
|
91
|
+
query_codesearch_patterns() {
|
|
92
92
|
local file_ext="${FILE_PATH##*.}"
|
|
93
93
|
local prompt_keywords=$(echo "$PROMPT" | tr '[:upper:]' '[:lower:]' | grep -o '[a-z]\{3,\}' | tr '\n' ' ' | head -c 200)
|
|
94
94
|
|
|
95
|
-
log "Querying
|
|
95
|
+
log "Querying CodeSearch for patterns: file_type=$file_ext, keywords=$prompt_keywords"
|
|
96
96
|
|
|
97
|
-
# Use
|
|
98
|
-
if [[ -f "$
|
|
99
|
-
"$
|
|
97
|
+
# Use CodeSearch search to find similar successful patterns
|
|
98
|
+
if [[ -f "$CODESEARCH_INDEX/search.sh" ]]; then
|
|
99
|
+
"$CODESEARCH_INDEX/search.sh" "$file_ext $prompt_keywords" --top 5 2>/dev/null | \
|
|
100
100
|
jq -r '.[] | select(.success == true) | .prompt' 2>/dev/null | \
|
|
101
101
|
head -3 | \
|
|
102
102
|
sed 's/"/\\"/g' | \
|
|
103
103
|
awk '{printf "\"%s\"\\n", $0}' || \
|
|
104
104
|
echo ""
|
|
105
105
|
else
|
|
106
|
-
log "
|
|
106
|
+
log "CodeSearch not found at $CODESEARCH_INDEX, skipping pattern lookup"
|
|
107
107
|
echo ""
|
|
108
108
|
fi
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
# Function to store generation in
|
|
112
|
-
|
|
111
|
+
# Function to store generation in CodeSearch
|
|
112
|
+
store_in_codesearch() {
|
|
113
113
|
local success="$1"
|
|
114
114
|
local prompt="$2"
|
|
115
115
|
local generated_code="$3"
|
|
@@ -129,10 +129,10 @@ store_in_ruvector() {
|
|
|
129
129
|
EOF
|
|
130
130
|
)
|
|
131
131
|
|
|
132
|
-
# Use
|
|
133
|
-
if [[ -f "$
|
|
132
|
+
# Use CodeSearch to store the pattern
|
|
133
|
+
if [[ -f "$CODESEARCH_INDEX/store.sh" ]]; then
|
|
134
134
|
echo "$prompt" | \
|
|
135
|
-
"$
|
|
135
|
+
"$CODESEARCH_INDEX/store.sh" --metadata "$metadata" --type "prompt_pattern" 2>/dev/null || true
|
|
136
136
|
fi
|
|
137
137
|
}
|
|
138
138
|
|
|
@@ -240,8 +240,8 @@ log "File type: ${FILE_PATH##*.}"
|
|
|
240
240
|
# Extract file type
|
|
241
241
|
FILE_TYPE="${FILE_PATH##*.}"
|
|
242
242
|
|
|
243
|
-
# Query
|
|
244
|
-
PATTERNS=$(
|
|
243
|
+
# Query CodeSearch for successful patterns
|
|
244
|
+
PATTERNS=$(query_codesearch_patterns)
|
|
245
245
|
log "Found ${#PATTERNS} pattern examples"
|
|
246
246
|
|
|
247
247
|
# Build enhanced prompt with patterns
|
|
@@ -362,8 +362,8 @@ INSERT INTO generations (
|
|
|
362
362
|
);
|
|
363
363
|
EOF
|
|
364
364
|
|
|
365
|
-
# Store in
|
|
366
|
-
|
|
365
|
+
# Store in CodeSearch for future learning
|
|
366
|
+
store_in_codesearch "$FINAL_SUCCESS" "$PROMPT" "$FINAL_CODE" "$FILE_TYPE"
|
|
367
367
|
|
|
368
368
|
# Final result
|
|
369
369
|
if [[ "$FINAL_SUCCESS" == "true" ]]; then
|
|
@@ -371,7 +371,7 @@ if [[ "$FINAL_SUCCESS" == "true" ]]; then
|
|
|
371
371
|
echo "📁 File: $FILE_PATH"
|
|
372
372
|
echo "🔧 Attempts: $((ATTEMPT - 1))/$MAX_ATTEMPTS"
|
|
373
373
|
echo "📊 Confidence: $(printf '%.1f%%' $(echo "$CONFIDENCE * 100" | bc -l))"
|
|
374
|
-
echo "💾 Pattern stored in
|
|
374
|
+
echo "💾 Pattern stored in CodeSearch"
|
|
375
375
|
else
|
|
376
376
|
echo "❌ Code generation failed after $MAX_ATTEMPTS attempts"
|
|
377
377
|
echo "📁 File: $FILE_PATH"
|
|
@@ -42,7 +42,7 @@ error[E0596]: cannot borrow `self.users` as mutable more than once at a time
|
|
|
42
42
|
```
|
|
43
43
|
🔍 Querying fix patterns for: rs errors - borrow checker
|
|
44
44
|
|
|
45
|
-
📚 Fix patterns from
|
|
45
|
+
📚 Fix patterns from CodeSearch:
|
|
46
46
|
|
|
47
47
|
Pattern 1 (95% success rate):
|
|
48
48
|
// Rust Borrow Checker Fix:
|
|
@@ -165,10 +165,10 @@ test result: ok. 3 passed; 0 failed
|
|
|
165
165
|
--agent-id "$AGENT_ID" \
|
|
166
166
|
--file-path "src/services/user_service.rs" \
|
|
167
167
|
--success true \
|
|
168
|
-
--learnings "Fixed borrow checker using HashMap entry() API pattern from
|
|
168
|
+
--learnings "Fixed borrow checker using HashMap entry() API pattern from CodeSearch. Pattern had 95% success rate."
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
**Stored in
|
|
171
|
+
**Stored in CodeSearch for future:**
|
|
172
172
|
```json
|
|
173
173
|
{
|
|
174
174
|
"type": "code_fix",
|
|
@@ -251,4 +251,4 @@ The system would:
|
|
|
251
251
|
4. Apply fix with proper error handling
|
|
252
252
|
5. Validate with concurrent tests
|
|
253
253
|
|
|
254
|
-
This shows how the Cerebras backend developer can efficiently fix errors by learning from past successful fixes stored in
|
|
254
|
+
This shows how the Cerebras backend developer can efficiently fix errors by learning from past successful fixes stored in CodeSearch, while maintaining TDD discipline.
|
|
@@ -202,5 +202,5 @@ echo "Next steps:"
|
|
|
202
202
|
echo " 1. Review generated tests and implementation"
|
|
203
203
|
echo " 2. Run full test suite"
|
|
204
204
|
echo " 3. Check conversation file in conversations/"
|
|
205
|
-
echo " 4. Query
|
|
205
|
+
echo " 4. Query CodeSearch for learned patterns"
|
|
206
206
|
echo
|
|
@@ -4,7 +4,7 @@ set -euo pipefail
|
|
|
4
4
|
# Feedback logger for learning from generation results
|
|
5
5
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
6
|
DB_PATH="${COORDINATION_DB_PATH:-$SCRIPT_DIR/generations.db}"
|
|
7
|
-
|
|
7
|
+
CODESEARCH_INDEX="${CODESEARCH_INDEX_PATH:-./.claude/skills/cfn-codesearch/data}"
|
|
8
8
|
|
|
9
9
|
# Parse arguments
|
|
10
10
|
GENERATION_ID=""
|
|
@@ -110,7 +110,7 @@ INSERT INTO feedback (
|
|
|
110
110
|
);
|
|
111
111
|
EOF
|
|
112
112
|
|
|
113
|
-
# Extract learnings for
|
|
113
|
+
# Extract learnings for CodeSearch
|
|
114
114
|
extract_learnings() {
|
|
115
115
|
local pattern_type=""
|
|
116
116
|
local tags=""
|
|
@@ -146,8 +146,8 @@ extract_learnings() {
|
|
|
146
146
|
learning_content="Failed generation: $ERROR_MESSAGE"
|
|
147
147
|
fi
|
|
148
148
|
|
|
149
|
-
# Store in
|
|
150
|
-
if [[ -f "$
|
|
149
|
+
# Store in CodeSearch if available
|
|
150
|
+
if [[ -f "$CODESEARCH_INDEX/store.sh" ]]; then
|
|
151
151
|
local metadata=$(cat <<EOF
|
|
152
152
|
{
|
|
153
153
|
"type": "$pattern_type",
|
|
@@ -162,7 +162,7 @@ EOF
|
|
|
162
162
|
)
|
|
163
163
|
|
|
164
164
|
echo "$learning_content" | \
|
|
165
|
-
"$
|
|
165
|
+
"$CODESEARCH_INDEX/store.sh" \
|
|
166
166
|
--metadata "$metadata" \
|
|
167
167
|
--type "$pattern_type" \
|
|
168
168
|
--tags "$tags" \
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# Fix existing code with errors using TDD and
|
|
2
|
+
# Fix existing code with errors using TDD and CodeSearch patterns - Version 2
|
|
3
3
|
# Compatible with bash/shell environments
|
|
4
4
|
|
|
5
5
|
# Configuration
|
|
6
6
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
7
|
DB_PATH="${COORDINATION_DB_PATH:-$SCRIPT_DIR/generations.db}"
|
|
8
|
-
|
|
8
|
+
CODESEARCH_INDEX="${CODESEARCH_INDEX_PATH:-./.claude/skills/cfn-codesearch/data}"
|
|
9
9
|
|
|
10
10
|
# Parse arguments
|
|
11
11
|
AGENT_ID=""
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
-
# Fix existing code with errors using TDD and
|
|
4
|
+
# Fix existing code with errors using TDD and CodeSearch patterns
|
|
5
5
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
6
|
DB_PATH="${COORDINATION_DB_PATH:-$SCRIPT_DIR/generations.db}"
|
|
7
|
-
|
|
7
|
+
CODESEARCH_INDEX="${CODESEARCH_INDEX_PATH:-./.claude/skills/cfn-codesearch/data}"
|
|
8
8
|
|
|
9
9
|
# Parse arguments
|
|
10
10
|
AGENT_ID=""
|
|
@@ -79,16 +79,16 @@ analyze_errors() {
|
|
|
79
79
|
echo "$file_errors"
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
# Step 2: Query fix patterns from
|
|
82
|
+
# Step 2: Query fix patterns from CodeSearch
|
|
83
83
|
query_fix_patterns() {
|
|
84
84
|
local error_pattern="$1"
|
|
85
85
|
local file_type="${FILE_PATH##*.}"
|
|
86
86
|
|
|
87
87
|
log "Querying fix patterns for: $file_type errors - $error_pattern"
|
|
88
88
|
|
|
89
|
-
if [[ -f "$
|
|
89
|
+
if [[ -f "$CODESEARCH_INDEX/search.sh" ]]; then
|
|
90
90
|
# Search for similar fix patterns
|
|
91
|
-
"$
|
|
91
|
+
"$CODESEARCH_INDEX/search.sh" "fix $file_type $error_pattern" --top 5 2>/dev/null | \
|
|
92
92
|
jq -r '.[] | select(.success == true) | .prompt' 2>/dev/null || \
|
|
93
93
|
get_builtin_fix_patterns "$file_type" "$error_pattern"
|
|
94
94
|
else
|
|
@@ -96,7 +96,7 @@ query_fix_patterns() {
|
|
|
96
96
|
fi
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
# Built-in fix patterns when
|
|
99
|
+
# Built-in fix patterns when CodeSearch not available
|
|
100
100
|
get_builtin_fix_patterns() {
|
|
101
101
|
local file_type="$1"
|
|
102
102
|
local error_pattern="$2"
|
|
@@ -439,8 +439,8 @@ INSERT INTO code_fixes (
|
|
|
439
439
|
);
|
|
440
440
|
EOF
|
|
441
441
|
|
|
442
|
-
# Store pattern in
|
|
443
|
-
if [[ -f "$
|
|
442
|
+
# Store pattern in CodeSearch
|
|
443
|
+
if [[ -f "$CODESEARCH_INDEX/store.sh" ]]; then
|
|
444
444
|
local metadata=$(cat <<EOF
|
|
445
445
|
{
|
|
446
446
|
"type": "code_fix",
|
|
@@ -453,7 +453,7 @@ EOF
|
|
|
453
453
|
)
|
|
454
454
|
|
|
455
455
|
echo "$fix_applied" | \
|
|
456
|
-
"$
|
|
456
|
+
"$CODESEARCH_INDEX/store.sh" \
|
|
457
457
|
--metadata "$metadata" \
|
|
458
458
|
--type "code_fix" \
|
|
459
459
|
--tags "fix,${FILE_PATH##*.}" \
|
|
@@ -464,7 +464,7 @@ EOF
|
|
|
464
464
|
}
|
|
465
465
|
|
|
466
466
|
# Main execution
|
|
467
|
-
echo "🔧 Code Fix with Cerebras +
|
|
467
|
+
echo "🔧 Code Fix with Cerebras + CodeSearch"
|
|
468
468
|
echo "==================================="
|
|
469
469
|
echo "File: $FILE_PATH"
|
|
470
470
|
echo "Agent: $AGENT_ID"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# TDD Pattern Examples - What "Patterns" Means in Practice
|
|
2
2
|
|
|
3
|
-
These are actual examples of patterns that get stored in
|
|
3
|
+
These are actual examples of patterns that get stored in CodeSearch and reused. They're not just code snippets - they're successful approaches with context.
|
|
4
4
|
|
|
5
5
|
## Example 1: Rust API Handler Pattern
|
|
6
6
|
|
|
7
|
-
**Stored in
|
|
7
|
+
**Stored in CodeSearch after successful generation:**
|
|
8
8
|
|
|
9
9
|
```json
|
|
10
10
|
{
|
|
@@ -200,7 +200,7 @@ describe('UserProfile', () => {
|
|
|
200
200
|
|
|
201
201
|
## Example 3: Python Service Layer Pattern
|
|
202
202
|
|
|
203
|
-
**Pattern tracked in
|
|
203
|
+
**Pattern tracked in CodeSearch:**
|
|
204
204
|
```python
|
|
205
205
|
# Successful Pattern: Service Layer with Business Logic
|
|
206
206
|
# Key elements that made this successful:
|
|
@@ -4,7 +4,7 @@ set -euo pipefail
|
|
|
4
4
|
# Configuration
|
|
5
5
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
6
|
DB_PATH="${COORDINATION_DB_PATH:-$SCRIPT_DIR/generations.db}"
|
|
7
|
-
|
|
7
|
+
CODESEARCH_INDEX="${CODESEARCH_INDEX_PATH:-./.claude/skills/cfn-codesearch/data}"
|
|
8
8
|
|
|
9
9
|
# Parse arguments
|
|
10
10
|
FILE_TYPE=""
|
|
@@ -49,24 +49,24 @@ LIMIT $LIMIT;
|
|
|
49
49
|
EOF
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
# Query patterns from
|
|
53
|
-
|
|
52
|
+
# Query patterns from CodeSearch
|
|
53
|
+
query_codesearch_patterns() {
|
|
54
54
|
local query=""
|
|
55
55
|
|
|
56
56
|
[[ -n "$FILE_TYPE" ]] && query="$query $FILE_TYPE"
|
|
57
57
|
[[ -n "$PATTERN" ]] && query="$query $PATTERN"
|
|
58
58
|
|
|
59
59
|
if [[ -z "$query" ]]; then
|
|
60
|
-
echo "No query specified for
|
|
60
|
+
echo "No query specified for CodeSearch search"
|
|
61
61
|
return 1
|
|
62
62
|
fi
|
|
63
63
|
|
|
64
|
-
if [[ -f "$
|
|
65
|
-
echo "Querying
|
|
66
|
-
"$
|
|
67
|
-
echo "
|
|
64
|
+
if [[ -f "$CODESEARCH_INDEX/search.sh" ]]; then
|
|
65
|
+
echo "Querying CodeSearch for: $query"
|
|
66
|
+
"$CODESEARCH_INDEX/search.sh" "$query" --top "$LIMIT" 2>/dev/null || \
|
|
67
|
+
echo "CodeSearch search failed"
|
|
68
68
|
else
|
|
69
|
-
echo "
|
|
69
|
+
echo "CodeSearch not found at $CODESEARCH_INDEX"
|
|
70
70
|
fi
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -4,7 +4,7 @@ set -euo pipefail
|
|
|
4
4
|
# TDD-driven Cerebras coordinator - Tests first, then implementation
|
|
5
5
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
6
|
DB_PATH="${COORDINATION_DB_PATH:-$SCRIPT_DIR/generations.db}"
|
|
7
|
-
|
|
7
|
+
CODESEARCH_INDEX="${CODESEARCH_INDEX_PATH:-./.claude/skills/cfn-codesearch/data}"
|
|
8
8
|
|
|
9
9
|
# Parse arguments
|
|
10
10
|
AGENT_ID=""
|
|
@@ -87,7 +87,7 @@ detect_test_framework() {
|
|
|
87
87
|
esac
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
# Query TDD patterns from
|
|
90
|
+
# Query TDD patterns from CodeSearch
|
|
91
91
|
query_tdd_patterns() {
|
|
92
92
|
local file_ext="${FILE_PATH##*.}"
|
|
93
93
|
local framework=$(detect_test_framework)
|
|
@@ -95,17 +95,17 @@ query_tdd_patterns() {
|
|
|
95
95
|
log "Querying TDD patterns for: $file_ext with $framework framework"
|
|
96
96
|
|
|
97
97
|
# Search for TDD patterns
|
|
98
|
-
if [[ -f "$
|
|
99
|
-
"$
|
|
98
|
+
if [[ -f "$CODESEARCH_INDEX/search.sh" ]]; then
|
|
99
|
+
"$CODESEARCH_INDEX/search.sh" "TDD test-first $file_ext $framework" --top 3 2>/dev/null | \
|
|
100
100
|
jq -r '.[] | select(.success == true) | .prompt' 2>/dev/null || \
|
|
101
101
|
echo "No TDD patterns found"
|
|
102
102
|
else
|
|
103
|
-
log "
|
|
103
|
+
log "CodeSearch not found, using built-in TDD patterns"
|
|
104
104
|
get_builtin_tdd_patterns "$file_ext" "$framework"
|
|
105
105
|
fi
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
# Built-in TDD patterns when
|
|
108
|
+
# Built-in TDD patterns when CodeSearch is not available
|
|
109
109
|
get_builtin_tdd_patterns() {
|
|
110
110
|
local file_type="$1"
|
|
111
111
|
local framework="$2"
|
|
@@ -609,7 +609,7 @@ refactor_implementation
|
|
|
609
609
|
# Step 7: Store TDD pattern
|
|
610
610
|
echo
|
|
611
611
|
echo "Step 7: Storing TDD pattern for future learning..."
|
|
612
|
-
if [[ -f "$
|
|
612
|
+
if [[ -f "$CODESEARCH_INDEX/store.sh" ]]; then
|
|
613
613
|
metadata=$(cat <<EOF
|
|
614
614
|
{
|
|
615
615
|
"type": "tdd_pattern",
|
|
@@ -622,7 +622,7 @@ if [[ -f "$RUVECTOR_INDEX/store.sh" ]]; then
|
|
|
622
622
|
EOF
|
|
623
623
|
)
|
|
624
624
|
|
|
625
|
-
cat <<EOF | "$
|
|
625
|
+
cat <<EOF | "$CODESEARCH_INDEX/store.sh" --metadata "$metadata" --type "tdd_pattern" 2>/dev/null || true
|
|
626
626
|
TDD Pattern for $FEATURE:
|
|
627
627
|
|
|
628
628
|
Tests written first for $FILE_PATH
|
|
@@ -196,7 +196,7 @@ test_integration_mock() {
|
|
|
196
196
|
log_info "Full integration test requires:"
|
|
197
197
|
log_info " - Valid ZAI_API_KEY"
|
|
198
198
|
log_info " - Test project with runnable tests"
|
|
199
|
-
log_info " -
|
|
199
|
+
log_info " - CodeSearch index (optional)"
|
|
200
200
|
log_info ""
|
|
201
201
|
log_info "Example usage:"
|
|
202
202
|
log_info " $COORDINATOR \\"
|
|
@@ -152,7 +152,7 @@ Need to automate something?
|
|
|
152
152
|
- `/launch-web-dashboard` - Start web portal (http://localhost:3000)
|
|
153
153
|
- `/list-agents-rebuild` - Regenerate agent list from discovery
|
|
154
154
|
|
|
155
|
-
###
|
|
155
|
+
### CodeSearch Integration
|
|
156
156
|
- `/codebase-search` - Semantic search through codebase
|
|
157
157
|
- `/detect-stale-docs` - Find outdated documentation
|
|
158
158
|
- `/codebase-reindex` - Update codebase vector index
|