一键导入
scholar
Self-Evolving Research Agent — scans web for relevant tech, evaluates findings, proposes improvements. Uses Perplexity Sonar API via MCP.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Self-Evolving Research Agent — scans web for relevant tech, evaluates findings, proposes improvements. Uses Perplexity Sonar API via MCP.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Trinity Bridge manual — architecture, endpoints, commands, patterns for Perplexity-Railway-Mac-Claude Code channel. Reference for all AI agents.
Generate Zig or Verilog code from VIBEE specifications. Use when creating or updating .tri specs and regenerating code.
GOD MODE — Agent monitoring dashboard. Shows swarm status, task queue, pipeline compliance, circuit breakers, git activity, and rule violations.
Generate Zig or Verilog code from VIBEE specifications. Use when creating or updating .tri specs and regenerating code.
HEALER — diagnose, heal, commit dirty files, monitor junk & docs & duplicates, report honestly. Every loop = action + proof.
Agent swarm development dashboard — live Railway containers, issue queue, PR pipeline, JSONL events, pool utilization, and queue drain status. Use when checking agent dev tasks, spawning status, or monitoring issues #315-#319.
| name | scholar |
| description | Self-Evolving Research Agent — scans web for relevant tech, evaluates findings, proposes improvements. Uses Perplexity Sonar API via MCP. |
| argument-hint | ["scan|eval|apply|full|report|topic:\"query\""] |
| allowed-tools | Bash(gh *), Bash(cat *), Bash(grep *), Bash(find *), Bash(python3 *), Bash(echo *), Bash(date *), Bash(wc *), Bash(git *), Bash(test *), Bash(ls *), Read, Edit, Write, mcp__perplexity__perplexity_search, mcp__perplexity__perplexity_ask, mcp__perplexity__perplexity_research, mcp__perplexity__perplexity_reason |
| model | opus |
| context | fork |
For output formatting conventions, follow .claude/skills/_shared/output_format.md.
Scholar — autonomous research agent for Trinity. Scans the web for relevant technologies, evaluates findings against project context, and proposes improvements via GitHub issues or MU Learning DB entries.
Uses Perplexity Sonar API via MCP (4 tools: search, ask, research, reason).
Parse $ARGUMENTS to determine mode:
scan — Run SCAN phase only (search for new findings)eval — Run EVAL phase on last scan resultsapply — Run APPLY phase (create issues / enrich MU)full — Run all 3 phases sequentially (default if no args)report — Show last scan results without running new scan (for bridge/Perplexity)topic:"<query>" — Deep research on a specific topicerrors — Scan for solutions to current broken specs/compilation errorszig — Scan for Zig 0.15 updates and best practicesfpga — Scan for FPGA/edge AI optimization techniquesagents — Scan for self-evolving agent architectures# Current project state — feeds into search queries
OPEN_ISSUES=$(gh issue list --state open --json number,title,labels --limit 20 2>/dev/null || echo "[]")
BROKEN_SPECS=$(grep -c "❌" specs/REGENERATION_REPORT.md 2>/dev/null || echo "0")
TOTAL_SPECS=$(grep -c "✅\|❌" specs/REGENERATION_REPORT.md 2>/dev/null || echo "0")
COMPILE_RATE=$((TOTAL_SPECS > 0 ? (TOTAL_SPECS - BROKEN_SPECS) * 100 / TOTAL_SPECS : 0))
RECENT_ERRORS=$(grep -r "TODO\|FIXME\|HACK" src/ --include="*.zig" 2>/dev/null | head -10)
LAST_COMMITS=$(git log --oneline -5)
ZIG_VERSION=$(zig version 2>/dev/null || echo "0.15.x")
# MU patterns — what errors keep recurring?
MU_PATTERNS=$(cat .ralph/memory/REGRESSION_PATTERNS.md 2>/dev/null | head -30 || echo "none")
# Current priorities from issues
P0_ISSUES=$(echo "$OPEN_ISSUES" | python3 -c "import json,sys; issues=json.load(sys.stdin); p0=[i for i in issues if any('P0' in l.get('name','') for l in i.get('labels',[]))]; [print(f'#{i[\"number\"]}: {i[\"title\"]}') for i in p0]" 2>/dev/null || echo "none")
Based on mode and context, call Perplexity MCP tools.
scan or full):Zig ecosystem — use perplexity_search:
Query: "Zig 0.15 {ZIG_VERSION} new features best practices memory allocator patterns 2025 2026"
FPGA + edge AI — use perplexity_search:
Query: "FPGA edge AI optimization ternary computing open source synthesis 2025 2026"
Agent architectures — use perplexity_research (deep):
Query: "self-evolving AI agent architectures autonomous code generation self-improvement loop 2025 2026"
Error-specific (only if BROKEN_SPECS > 0) — use perplexity_ask:
Query: "Zig {ZIG_VERSION} compilation error {first error from REGRESSION_PATTERNS} fix solution"
MCP extensions — use perplexity_search:
Query: "Model Context Protocol MCP new servers tools 2025 anthropic"
errors — Focus all queries on current broken specs and compilation errors.
Read REGENERATION_REPORT.md, extract error messages, search for fixes.zig — Deep research on Zig language updates.fpga — Deep research on FPGA synthesis techniques.agents — Deep research on agent architectures.topic:"<query>" — Use perplexity_research with the exact user query.Save raw findings to .trinity/scholar/:
mkdir -p .trinity/scholar
Write findings to .trinity/scholar/scan_YYYYMMDD.json:
{
"date": "2026-03-11",
"mode": "full",
"context": {
"compile_rate": 85,
"broken_specs": 3,
"open_issues": 8,
"p0_count": 1
},
"findings": [
{
"id": 1,
"domain": "zig",
"query": "...",
"summary": "...",
"citations": ["url1", "url2"],
"raw_response": "..."
}
]
}
Read the latest scan file from .trinity/scholar/.
For each finding, evaluate relevance to Trinity:
| Factor | Weight | How to measure |
|---|---|---|
| Addresses open issue | 0.3 | Finding matches an open issue title/description |
| Fixes broken spec | 0.3 | Finding addresses a known compilation error |
| Novel technique | 0.2 | Not already known in project (check REGRESSION_PATTERNS) |
| Actionable | 0.2 | Contains specific code/command/approach to implement |
Use perplexity_reason to evaluate complex findings:
Query: "Given this Trinity project context: {context}. Rate the relevance of this finding: {summary}. Score 0-1 and explain."
| Score | Action | Label |
|---|---|---|
| > 0.8 | Create GitHub issue | research:high |
| 0.5 - 0.8 | Add to MU Learning DB | research:medium |
| < 0.5 | Archive (log only) | research:low |
Update scan file with scores:
{
"findings": [
{
"id": 1,
"relevance": 0.85,
"classification": "high",
"reason": "Directly addresses broken specs issue...",
"action": "create_issue"
}
]
}
Read evaluated scan file. For each finding based on classification:
gh issue create \
--title "research: {concise finding title}" \
--label "research:high,agent:scholar" \
--body "## Scholar Finding
**Source:** {citations}
**Relevance:** {score}/1.0
**Domain:** {domain}
### Summary
{finding summary}
### Proposed Action
{specific steps to apply this finding to Trinity}
### Context
- Compile rate: {rate}%
- Related issues: {matching issues}
---
*Auto-generated by Scholar Agent via Perplexity Sonar API*"
Add to project board:
gh project item-add 6 --owner gHashTag --url "https://github.com/gHashTag/trinity/issues/$ISSUE_NUM"
Append to .trinity/mu/learning_db.json:
python3 -c "
import json, time
db_path = '.trinity/mu/learning_db.json'
try:
db = json.load(open(db_path))
except: db = {'entries': []}
db['entries'].append({
'timestamp': int(time.time()),
'source': 'scholar',
'domain': '${DOMAIN}',
'summary': '${SUMMARY}',
'relevance': ${SCORE},
'citations': ${CITATIONS},
'applied': False
})
with open(db_path, 'w') as f:
json.dump(db, f, indent=2)
print(f'Added to MU Learning DB: {len(db[\"entries\"])} entries')
"
Just log to .trinity/scholar/archive.log:
echo "$(date -Iseconds) | score=${SCORE} | ${DOMAIN} | ${SUMMARY}" >> .trinity/scholar/archive.log
Render a report after each run:
═══════════════════════════════════════════════════
🔍 SCHOLAR RESEARCH REPORT — {date}
═══════════════════════════════════════════════════
📡 SCAN CONTEXT
┌──────────────────┬───────────────┐
│ Compile rate │ {rate}% │
│ Broken specs │ {N} │
│ Open issues │ {N} │
│ MU patterns │ {N} │
│ Mode │ {mode} │
└──────────────────┴───────────────┘
🔬 FINDINGS ({N} total)
┌────┬─────────┬───────┬────────────────────────────────────┐
│ # │ Domain │ Score │ Summary │
├────┼─────────┼───────┼────────────────────────────────────┤
│ 1 │ {dom} │ {S} │ {one-line summary} │
│ 2 │ {dom} │ {S} │ {one-line summary} │
└────┴─────────┴───────┴────────────────────────────────────┘
📋 ACTIONS TAKEN
┌────────────┬─────────────────────────────────────────────┐
│ Action │ Details │
├────────────┼─────────────────────────────────────────────┤
│ Issues │ Created #{N}: {title} │
│ MU entries │ {N} findings added to Learning DB │
│ Archived │ {N} low-relevance findings logged │
└────────────┴─────────────────────────────────────────────┘
📚 CITATIONS
1. {url} — {what it's about}
2. {url} — {what it's about}
✨ Scholar says: "{contextual insight about findings}"
If $ARGUMENTS is report, do NOT run any scan. Instead:
.trinity/scholar/ (most recent scan_*.json)This mode is optimized for bridge-agent / Perplexity queries — fast, no API calls.
Scholar can be triggered remotely via bridge-agent:
claude:Run /scholar full
claude:Run /scholar errors
claude:Run /scholar report
claude:Run /scholar topic:"ternary neural network quantization"
claude:Run /scholar full (morning: full scan + eval + apply)claude:Run /scholar errors (evening: fix broken specs)The bridge-agent checks UTC hour and auto-submits scholar jobs.
For language detection and translations, follow .claude/skills/_shared/language.md.