Utilities for searching, indexing, and optimizing the playbook content.
From the repository root:
# Search for prompts
python tools/search-prompts.py "code review"
python tools/search-prompts.py -t optimization debugging
python tools/search-prompts.py -r "I need to analyze data"
# Rebuild search index after changes
python tools/index-prompts.pyTransforms any prompt into a context-optimized version using ADHD principles:
- 40-60% token reduction while maintaining information fidelity
- Multiple interfaces: Web UI, Python CLI, batch script
- Auto-detects style: technical, debug, learning, creative
- Provides metrics: token counts, clarity scores, structure analysis
- Identifies implicit needs in prompts
Quick usage:
# Command line
python tools/adhd-optimizer/optimize.py "Your long prompt here"
# Interactive mode
python tools/adhd-optimizer/optimize.py -i
# Web interface
open tools/adhd-optimizer/optimizer.htmlThe main search engine with multiple search modes:
- Keyword search:
./search "your query" - Tag search:
./search -t tag1 tag2 - Category filter:
./search -c "tasks/coding" - Archetype search:
./search -a "Clarity Architect" - Similarity:
./search -s "article writer" - Recommendations:
./search -r "analyze customer feedback"
Creates and updates the searchable index of all prompts:
- Extracts metadata from YAML frontmatter
- Builds searchable descriptions
- Tracks tags, categories, and archetypes
- Outputs to
prompt-index.json
Analyzes prompts for context engineering optimization opportunities:
- Calculates token usage and redundancy
- Identifies optimization patterns
- Suggests context engineering techniques
- Generates optimization reports
Usage:
# Analyze all prompts
python3 tools/context-analyzer.py
# Analyze specific category
python3 tools/context-analyzer.py -c tasks/writing
# Export detailed JSON report
python3 tools/context-analyzer.py -j analysis.json
# Save report to file
python3 tools/context-analyzer.py -o optimization-report.mdprompt-index.json: Searchable metadata for all promptsprompt-dashboard.md: Quick reference guide
# Find code-related prompts
./search "code"
./search -t coding optimization
# Get writing help
./search "article"
./search -c "tasks/writing"
# Explore vibecoding
./search --list-archetypes
./search -a "Truth Builder"
# Find similar prompts
./search -s "data analysis"
# Get task recommendations
./search -r "I need to debug Python code"
# Detailed results with descriptions
./search -v "machine learning"Use the search results to build prompt combinations:
- Find base prompt:
./search "code review" - Add framework:
./search "METRICS" - Enhance with archetype:
./search -a "Truth Builder"
- Run
./update-indexafter adding/modifying prompts - Check
prompt-index.jsonfor indexing issues - Use
-vflag to verify descriptions are being extracted correctly
| Mode | Flag | Purpose | Example |
|---|---|---|---|
| Keyword | (default) | Full-text search | ./search "optimization" |
| Tags | -t |
Match specific tags | ./search -t debugging performance |
| Category | -c |
Filter by directory | ./search -c "frameworks" |
| Archetype | -a |
Vibecoding search | ./search -a "Clarity" |
| Similar | -s |
Find related prompts | ./search -s "article writer" |
| Recommend | -r |
Task-based suggestions | ./search -r "analyze logs" |
Consider adding these to your git hooks:
# .git/hooks/post-merge
#!/bin/bash
./update-index
# .git/hooks/post-checkout
#!/bin/bash
./update-indexThis ensures the search index stays current with repository changes.