/component-search
Search the CODITECT component database with full-text search, type filters, and advanced query options.
Syntax
/component-search <query> [options]
Options
| Option | Description | Example |
|---|---|---|
--type <type> | Filter by component type | --type agent |
--category <cat> | Filter by category | --category security |
--model <model> | Filter by LLM model binding | --model sonnet |
--capability <cap> | Filter by capability | --capability review |
--limit <n> | Limit results (default: 20) | --limit 50 |
--format <fmt> | Output format: table, json, brief | --format json |
--semantic | Use semantic search (requires embeddings) | --semantic |
--related <id> | Find components related to given ID | --related agent/senior-architect |
--orchestrators | List only orchestrator components | --orchestrators |
--tools <list> | Filter by available tools | --tools "Read,Write,Bash" |
Examples
Basic Search
# Search for security-related components
/component-search security
# Search for database components
/component-search "database migration"
Filtered Search
# Find all agents related to testing
/component-search test --type agent
# Find security skills
/component-search security --type skill --category security
# Find components that use Sonnet model
/component-search review --model sonnet
Advanced Search
# Find orchestrators that can manage other agents
/component-search --orchestrators
# Find components similar to a known component
/component-search --related agent/migration-safety-specialist
# Semantic search for authentication patterns
/component-search "user authentication flow" --semantic
# Find components with specific tools
/component-search api --tools "WebFetch,Bash"
Output Formats
# Brief list (names only)
/component-search security --format brief
# JSON output for scripting
/component-search migration --format json
# Table format (default)
/component-search deploy --format table
Output Fields
| Field | Description |
|---|---|
id | Unique component identifier (type/name) |
type | Component type (agent, skill, command, etc.) |
name | Human-readable name |
description | Brief description |
category | Primary category |
confidence | Match confidence score |
llm_model | Bound LLM model (if any) |
path | File path |
Database Tables Queried
components- Core component metadatacomponent_search- FTS5 full-text indexcapabilities- Component capabilitiestriggers- When to use triggerscomponent_relationships- Related components
Implementation
# Underlying script
python3 scripts/component-db-cli.py search <query> [options]
# Direct database query
sqlite3 ~/PROJECTS/.coditect-data/context-storage/platform.db \
"SELECT * FROM component_search WHERE component_search MATCH 'query'"
MCP Integration
This command leverages the semantic search MCP when --semantic is used:
# Via MCP tool
mcp__coditect-semantic-search__hybrid_search(query="security audit")
Related Commands
| Command | Purpose |
|---|---|
/component-stats | Database statistics |
/component-index | Rebuild index |
/component-validate | Validate components |
/component-activate | Activate components |
/which | Find best agent for task |
Troubleshooting
Empty Results
# Rebuild FTS index
sqlite3 ~/PROJECTS/.coditect-data/context-storage/platform.db \
"INSERT INTO component_search(component_search) VALUES('rebuild');"
# Re-index all components
python3 scripts/component-indexer.py
Slow Queries
# Check database stats
/component-stats
# Analyze query plan
sqlite3 ~/PROJECTS/.coditect-data/context-storage/platform.db "EXPLAIN QUERY PLAN SELECT..."
Script: scripts/component-db-cli.py
Database: ~/PROJECTS/.coditect-data/context-storage/platform.db
Table: component_search (FTS5)