Prompt file imported from mt-osiris-tools/ai-use-case-cli (
.github/prompts/use-case/search-usecases.prompt.md). Fill in{{AI_USECASES_DIR}},{{arg1}}before use. Copyright stays with the author.
Search AI Use Cases
You are helping the user search through their documented AI use cases to find relevant examples and patterns.
Your Task
Help the user search, filter, and analyze their AI use case documentation across all projects.
Quick Search
Use the search script for simple keyword searches:
ai-use-case search <search-term>
Available Search Methods
1. Search by Topic/Keyword
# Use the search script (recommended)
ai-use-case search authentication
# Or search manually. The following commands use shell parameter expansion: {{AI_USECASES_DIR}} will use the AI_USECASES_DIR environment variable if set, or default to ~/.local/share/ai-use-case-cli/hub.
# Search filenames
find {{AI_USECASES_DIR}}/by-project -name "*keyword*" -type f
# Search content
grep -r "search term" {{AI_USECASES_DIR}}/by-project --include="*.md" -l
# Search with context
grep -r "search term" {{AI_USECASES_DIR}}/by-project --include="*.md" -B 2 -A 2
2. Search by Date Range
# Use cases from October 2025
find {{AI_USECASES_DIR}}/by-date/2025/10 -name "*.md" -type l
# Recent (last 30 days)
find {{AI_USECASES_DIR}}/by-date -name "*.md" -type f -mtime -30
3. Search by Project
# List all projects
ls {{AI_USECASES_DIR}}/by-project/
# Use cases for specific project
ls -lh {{AI_USECASES_DIR}}/by-project/PROJECT_NAME/
4. Search by Topic Tag
# All authentication-related use cases
ls {{AI_USECASES_DIR}}/by-topic/ | grep -i auth
# Use cases in a specific topic
ls -lh {{AI_USECASES_DIR}}/by-topic/TOPIC_NAME/
Analysis Queries
Count use cases per project:
for dir in {{AI_USECASES_DIR}}/by-project/*/; do
count=$(find "$dir" -name "*.md" -type f | wc -l)
echo "$(basename "$dir"): $count"
done | sort -t: -k2 -rn
Find most common AI tools used:
grep -h "Agent Used:" {{AI_USECASES_DIR}}/by-project/*/*.md 2>/dev/null | sort | uniq -c | sort -rn
Total time saved:
grep -h "Time Saved:" {{AI_USECASES_DIR}}/by-project/*/*.md 2>/dev/null | grep -oP '\d+(\.\d+)?' | awk '{sum+={{arg1}}} END {print "Total hours saved: " sum}'
Interaction Flow
-
Ask the user what they're looking for:
- Specific topic/technology?
- Recent work?
- Specific project?
- Pattern/approach they used before?
-
Run appropriate search commands
-
Display results in a readable format
-
Offer to:
- Read full content of matching files
- Compare similar use cases
- Extract patterns or best practices
- Generate a summary report
Examples
User asks: "Show me all authentication use cases"
- Search filenames:
find {{AI_USECASES_DIR}}/by-project -name "*auth*" -type f - Search content:
grep -r "authentication" {{AI_USECASES_DIR}}/by-project --include="*.md" -l
User asks: "What did I work on last week?"
find {{AI_USECASES_DIR}}/by-date -name "*.md" -type f -mtime -7 -printf '%TY-%Tm-%Td %p\n' | sort -r
User asks: "How many hours have I saved using Claude Code?"
- Extract and sum time saved metrics from all use cases