/discover - Component Discovery and Self-Awareness
Purpose: Query CODITECT's component capability index to find the right tool for any task.
Version: 1.0.0 Status: Operational Last Updated: 2025-12-20
Usage
# Natural language search
/discover "security code review"
/discover "deploy to GCP"
/discover "database migration"
# Search by component type
/discover --type agent "orchestration"
/discover --type command "git"
/discover --type skill "testing"
# Compare alternatives
/discover --compare council-orchestrator code-reviewer
/discover --compare devops-engineer cloud-architect
# Show relationships
/discover --relationships council-orchestrator
/discover --invokes orchestrator
/discover --invoked-by use-case-analyzer
# Filter by capability
/discover --capability security
/discover --domain compliance
/discover --action review
# Show component details
/discover --show council-orchestrator
/discover --show devops-engineer --verbose
# List by category
/discover --list agents
/discover --list commands --limit 20
# Statistics
/discover --stats
System Prompt
System Prompt
⚠️ EXECUTION DIRECTIVE: When the user invokes this command, you MUST:
- IMMEDIATELY execute - no questions, no explanations first
- ALWAYS show full output from script/tool execution
- ALWAYS provide summary after execution completes
DO NOT:
- Say "I don't need to take action" - you ALWAYS execute when invoked
- Ask for confirmation unless
requires_confirmation: truein frontmatter - Skip execution even if it seems redundant - run it anyway
The user invoking the command IS the confirmation.
You are executing the CODITECT component discovery system for self-awareness queries.
Database: context-storage/component-index.db
Statistics: 522 components, 11,412 capabilities, 4,190 triggers, 3,421 relationships
Execute the component discovery script:
python3 scripts/component-discover.py $ARGS
Options
| Option | Description |
|---|---|
QUERY | Natural language search query |
--type TYPE | Filter by component type (agent, command, skill, script, hook, workflow) |
--compare A B | Compare two components side-by-side |
--relationships ID | Show all relationships for a component |
--invokes ID | Show what a component invokes |
--invoked-by ID | Show what invokes a component |
--capability CAP | Filter by capability tag |
--domain DOM | Filter by domain |
--action ACT | Filter by action verb |
--show ID | Show detailed info for a component |
--verbose | Include full details |
--list TYPE | List all components of a type |
--limit N | Limit results (default: 10) |
--stats | Show database statistics |
--json | Output as JSON |
Examples
Find Components for a Task
/discover "I need to review code for HIPAA compliance"
Output:
Found 3 components for "HIPAA compliance code review":
1. council-orchestrator (agent) - confidence: 0.85
Multi-agent code review with consensus and audit trails
Use when: compliance audit required, multi-perspective needed
Avoid when: quick feedback needed
2. compliance-checker-agent (agent) - confidence: 0.80
Regulatory compliance validation
Use when: HIPAA, SOC2, FDA compliance required
3. code-reviewer (agent) - confidence: 0.70
Single-agent code review
Use when: quick feedback needed
Avoid when: compliance requirements
Recommendation: Use council-orchestrator with compliance-checker-agent
Compare Alternatives
/discover --compare council-orchestrator code-reviewer
Output:
Comparison: council-orchestrator vs code-reviewer
| Aspect | council-orchestrator | code-reviewer |
|--------|---------------------|---------------|
| Type | agent | agent |
| Complexity | high | low |
| Use When | compliance, multi-perspective | quick feedback |
| Avoid When | quick feedback needed | compliance required |
| Invokes | 5 agents | 0 agents |
| Confidence | 0.85 | 0.70 |
Recommendation:
- Use council-orchestrator for: compliance-critical, high-stakes reviews
- Use code-reviewer for: quick feedback, simple changes
Show Relationships
/discover --relationships council-orchestrator
Output:
Relationships for council-orchestrator:
Invokes (5):
- security-specialist (agent) - security review
- compliance-checker-agent (agent) - compliance validation
- application-performance (agent) - performance review
- testing-specialist (agent) - test coverage review
- council-chairman (agent) - verdict synthesis
Invoked By (3):
- orchestrator (agent)
- use-case-analyzer (agent)
- /council-review (command)
Alternatives (2):
- code-reviewer - Single agent, faster, less thorough
- orchestrator-code-review - ADR compliance focus
Complements (1):
- council-review (skill) - Provides core patterns
Database Statistics
/discover --stats
Output:
CODITECT Component Index Statistics
====================================
Components by Type:
agents: 122
commands: 134
skills: 81
scripts: 167
hooks: 11
workflows: 26
─────────────
Total: 541
Capabilities: 11,412 (avg 21 per component)
Triggers: 4,190 (avg 8 per component)
Relationships: 3,421 (avg 6 per component)
Top Domains:
1. software-development (312)
2. automation (198)
3. quality-assurance (145)
4. security (89)
5. deployment (76)
Database: context-storage/component-index.db (2.2 MB)
Last indexed: 2025-12-20
Integration with Orchestrators
The /discover command enables orchestrators to be self-aware:
# In an orchestrator agent
result = discover("security code review for healthcare")
best_match = result[0] # council-orchestrator
# Get what it needs
relationships = discover_relationships(best_match.id)
supporting_agents = relationships.invokes # [security-specialist, ...]
# Build execution plan
plan = {
"primary": best_match,
"supporting": supporting_agents,
"confidence": best_match.confidence
}
Related Documentation
- ADR-010-component-capability-schema.md
- ADR-011-self-awareness-framework.md
- DATABASE-ARCHITECTURE-UNIFIED.md
- COMPONENT-CAPABILITY-SCHEMA.md
Success Output
When component discovery completes:
✅ COMMAND COMPLETE: /discover
Query: <search-query>
Results: N components found
Types: <agents|commands|skills>
Top Match: <component-name> (confidence: X.XX)
Alternatives: N
Completion Checklist
Before marking complete:
- Query parsed
- Database searched
- Results ranked
- Recommendations provided
Failure Indicators
This command has FAILED if:
- ❌ Database not found
- ❌ No query provided
- ❌ No results returned
- ❌ Search failed
When NOT to Use
Do NOT use when:
- Know exact component name
- Component index not built
- Simple lookup (use /which)
Anti-Patterns (Avoid)
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Vague query | Too many results | Be specific |
| Ignore alternatives | Missed options | Review all results |
| Skip comparison | Wrong choice | Use --compare |
Principles
This command embodies:
- #2 Search Before Create - Find existing components
- #9 Based on Facts - Confidence-based ranking
- #6 Clear, Understandable - Clear recommendations
Full Standard: CODITECT-STANDARD-AUTOMATION.md
Script: scripts/component-discover.py
Database: context-storage/component-index.db
Last Updated: 2025-12-20