feat(agents): add learnings-researcher for institutional knowledge (#106)

* fix(compound-docs): correct severity enum in validation example

The example error message referenced [critical, moderate, minor] but
the yaml-schema.md defines severity as [critical, high, medium, low].

* refactor(agents): standardize search tool recommendations

- Update repo-research-analyst to recommend built-in Grep tool instead
  of CLI rg (Grep uses ripgrep under the hood)
- Add TypeScript example for ast-grep alongside Ruby
- Update pattern-recognition-specialist to use built-in Grep tool
- Keep ast-grep for AST-based structural matching (language-specific)

* feat(agents): add learnings-researcher for institutional knowledge

Add new research agent that efficiently searches docs/solutions/ for
relevant past solutions before implementing features or fixing bugs.

Key features:
- Grep-first filtering strategy for efficiency with 100+ files
- Category-based narrowing to reduce search scope
- Parallel Grep calls with synonym support (OR patterns)
- Frontmatter-only reads before full document reads
- Always checks critical patterns file
- Uses haiku model for speed (structured task, recipe-based)

Integrates with /workflows:plan to run in parallel with
repo-research-analyst during local research phase.

Closes the loop on compound engineering: solutions documented via
/workflows:compound are now discoverable during planning.
This commit is contained in:
Trevin Chow
2026-01-21 20:01:34 -08:00
committed by GitHub
parent ad1a72ae66
commit ebbf43db62
5 changed files with 260 additions and 10 deletions

View File

@@ -66,17 +66,22 @@ Refine the idea through collaborative dialogue using the **AskUserQuestion tool*
## Main Tasks
### 1. Repository Research (Always Runs)
### 1. Local Research (Always Runs - Parallel)
<thinking>
First, I need to understand the project's conventions and existing patterns. This is fast and local - it informs whether external research is needed.
First, I need to understand the project's conventions, existing patterns, and any documented learnings. This is fast and local - it informs whether external research is needed.
</thinking>
Run repo research to understand the codebase:
Run these agents **in parallel** to gather local context:
- Task repo-research-analyst(feature_description)
- Task learnings-researcher(feature_description)
**What to look for:** existing patterns, CLAUDE.md guidance, technology familiarity, pattern consistency. These findings inform the next step.
**What to look for:**
- **Repo research:** existing patterns, CLAUDE.md guidance, technology familiarity, pattern consistency
- **Learnings:** documented solutions in `docs/solutions/` that might apply (gotchas, patterns, lessons learned)
These findings inform the next step.
### 1.5. Research Decision
@@ -108,6 +113,7 @@ Run these agents in parallel:
After all research steps complete, consolidate findings:
- Document relevant file paths from repo research (e.g., `app/services/example_service.rb:42`)
- **Include relevant institutional learnings** from `docs/solutions/` (key insights, gotchas to avoid)
- Note external documentation URLs and best practices (if external research was done)
- List related issues or PRs discovered
- Capture CLAUDE.md conventions