Agent skill
search
Searches knowledge base by title, tags, or content across all knowledge artifacts.
Install this agent skill to your Project
npx add-skill https://github.com/goffity/claude-km-skill/tree/main/skills/search
SKILL.md
Search - Knowledge Search
Search across learnings, knowledge base, retrospectives, and examples.
Usage
/search [query]
/search --tag [tag-name]
/search --type [learning|knowledge|retrospective|example]
/search --reindex
Instructions
If --reindex flag is present
Rebuild the index:
bash scripts/build-index.sh "$PROJECT_ROOT"
Otherwise: Search
- Check if index exists, rebuild if not:
if [[ ! -f .knowledge-index.json ]]; then
bash scripts/build-index.sh "$PROJECT_ROOT"
fi
- Search the index based on query type:
By text query (default)
Search title, summary, and tags for matching terms:
jq --arg q "$QUERY" '
.entries[] |
select(
(.title | ascii_downcase | contains($q | ascii_downcase)) or
(.summary | ascii_downcase | contains($q | ascii_downcase)) or
(.tags[] | ascii_downcase | contains($q | ascii_downcase))
)
' .knowledge-index.json
By tag (--tag)
jq --arg tag "$TAG" '
.entries[] | select(.tags[] == $tag)
' .knowledge-index.json
By type (--type)
jq --arg type "$TYPE" '
.entries[] | select(.type == $type)
' .knowledge-index.json
- Present results in a readable format:
## Search Results for "[query]"
Found [N] results:
| # | Title | Type | Tags | Path |
|---|-------|------|------|------|
| 1 | [title] | [type] | [tags] | [path] |
### [1] [Title]
> [summary snippet]
Path: `[path]`
Tags: [tag1], [tag2]
- If no results: Suggest related tags or broader search terms.
Index Stats
Show index statistics:
jq '{total: .total, types: .types, generated: .generated}' .knowledge-index.json
Related Commands
| Command | Purpose |
|---|---|
/mem |
Capture learnings (indexed) |
/distill |
Create knowledge entries (indexed) |
/example |
Save code examples (indexed) |
/search |
Search all knowledge (you are here) |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
commit
Creates atomic commits by invoking TDG and commenting on related GitHub issues.
distill
Synthesizes related learnings into reusable knowledge base patterns.
security-auditor
Audits code for security vulnerabilities including OWASP Top 10 and authentication issues.
code-reviewer
Reviews code changes for bugs, security vulnerabilities, and performance issues.
example
Saves reusable code examples to the examples library with metadata and tags.
flow
Documents workflow diagrams and process flows with Mermaid diagram support.
Didn't find tool you were looking for?