Skip to content

Commit 630de09

Browse files
jwaldripclaude
andcommitted
feat(planner): add relevance-ranked learning search with multi-signal ranking
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent abe4a5a commit 630de09

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

plugin/hats/planner.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,32 @@ The Planner reviews the current Unit and creates a tactical execution plan for t
2929
- `han keep --branch active-intent` set
3030
- Unit file exists with criteria defined
3131

32+
### Relevance-Ranked Learning Search
33+
34+
When searching `docs/solutions/` for relevant learnings, use a multi-signal ranking approach:
35+
36+
1. **Frontmatter match (highest signal)** — Exact matches on `tags`, `module`, `component` fields
37+
2. **Title match (high signal)** — Keywords from the current unit appear in the learning title
38+
3. **Category match (medium signal)** — Learning category matches the unit's discipline (e.g., `debugging` category for a bug fix unit)
39+
4. **Content match (lower signal)** — Keywords appear in the body text
40+
41+
**Search strategy:**
42+
```bash
43+
# Phase 1: Frontmatter-first (high precision)
44+
grep -rl "tags:.*${TECHNOLOGY}" docs/solutions/ | head -5
45+
grep -rl "module: ${MODULE}" docs/solutions/ | head -5
46+
47+
# Phase 2: Category narrowing
48+
ls docs/solutions/${CATEGORY}/ 2>/dev/null | head -10
49+
50+
# Phase 3: Content search (if Phase 1-2 yield <3 results)
51+
grep -rl "${KEYWORD}" docs/solutions/ | head -5
52+
```
53+
54+
**Always read:** `docs/solutions/patterns/critical-patterns.md` (if it exists) — this file contains patterns that apply to ALL work, regardless of search results.
55+
56+
**Read strategy:** Read only frontmatter (~30 lines) first to assess relevance. Full-read only files where frontmatter signals strong relevance. Never bulk-read all learnings.
57+
3258
## Steps
3359

3460
1. Review current state

0 commit comments

Comments
 (0)