Skip to main content

/component-search

Search the CODITECT component database with full-text search, type filters, and advanced query options.

Syntax

/component-search <query> [options]

Options

OptionDescriptionExample
--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
--semanticUse semantic search (requires embeddings)--semantic
--related <id>Find components related to given ID--related agent/senior-architect
--orchestratorsList only orchestrator components--orchestrators
--tools <list>Filter by available tools--tools "Read,Write,Bash"

Examples

# Search for security-related components
/component-search security

# Search for database components
/component-search "database migration"
# 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
# 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

FieldDescription
idUnique component identifier (type/name)
typeComponent type (agent, skill, command, etc.)
nameHuman-readable name
descriptionBrief description
categoryPrimary category
confidenceMatch confidence score
llm_modelBound LLM model (if any)
pathFile path

Database Tables Queried

  • components - Core component metadata
  • component_search - FTS5 full-text index
  • capabilities - Component capabilities
  • triggers - When to use triggers
  • component_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")
CommandPurpose
/component-statsDatabase statistics
/component-indexRebuild index
/component-validateValidate components
/component-activateActivate components
/whichFind 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)