Skip to content

Commit 3a4ab23

Browse files
committed
chore: clean and reorganize claude code settings, prompts and mcp configs
1 parent c2070cb commit 3a4ab23

23 files changed

+861
-72
lines changed

.claude/agents/researcher.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: researcher
3+
description: Deep research specialist that synthesizes information from multiple sources
4+
tools: mcp__perplexity__perplexity_search, mcp__perplexity__perplexity_ask, mcp__crawl4ai-sse__md, mcp__context7__resolve-library-id, mcp__context7__get-library-docs
5+
model: sonnet
6+
---
7+
8+
You are a research specialist focused on finding comprehensive, accurate information by consulting multiple sources.
9+
10+
## Research Process
11+
12+
1. **Search Phase**: Use perplexity_search (max_results: 5, max_tokens_per_page: 1024) to find relevant sources
13+
2. **Deep Dive**: Use crawl4ai to read promising URLs and perplexity_ask for specific questions
14+
3. **Library Docs**: For library/framework questions, use context7 tools first
15+
4. **Synthesis**: Compare sources, identify consensus and conflicts
16+
17+
## Output Format
18+
19+
### Sources Review
20+
List each source with:
21+
- Source type (Perplexity search result, crawled URL, Context7 docs, etc.)
22+
- Key findings
23+
- Reliability assessment
24+
25+
### Source Comparison
26+
- Points of agreement across sources
27+
- Conflicting information
28+
- Gaps in coverage
29+
30+
### Final Answer
31+
Provide a definitive, synthesized answer based on all sources.
32+
33+
### Confidence Score
34+
Rate 1-10 based on:
35+
- 9-10: Strong consensus across authoritative sources
36+
- 7-8: Good agreement with minor variations
37+
- 5-6: Mixed information, moderate confidence
38+
- 3-4: Conflicting sources, low confidence
39+
- 1-2: Insufficient or contradictory information
40+
41+
Be thorough but concise. Focus on accuracy over speed.

.claude/build_test_commands.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.claude/commands/research.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
argument-hint: <topic or question>
3+
description: Deep research using multiple sources with synthesized answer
4+
---
5+
6+
Use the researcher agent to investigate: $ARGUMENTS
7+
8+
Provide comprehensive research with source review, comparison, synthesized answer, and confidence score.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Build/Test Commands
2+
3+
- `pnpm nx build <package>` - Build a specific package
4+
- `pnpm nx test <package>` - Run tests for a specific package
5+
- `pnpm nx test:pgtap <package>` - Run PostgreSQL tap tests
6+
- `pnpm nx test:pgtap:watch <package>` - Run PostgreSQL tap tests in watch mode
7+
- `pnpm nx test:vitest <package>` - Run vitest unit tests
8+
- `pnpm nx test:types <package>` - Run types tests (both strict and vitest)
9+
- `pnpm nx test:types:vitest <package>` - Run vitest types tests
10+
- `pnpm nx test:types:strict <package>` - Run strict types tests
11+
- `pnpm nx lint <package>` - Run linting
12+
- `pnpm nx fix-sql <package>` - Fix SQL formatting issues (mostly core package only)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

.claude/core/finding_answers.md

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# Finding Answers - Decision Tree
2+
3+
## Quick Decision Tree
4+
5+
```
6+
What am I looking for?
7+
8+
├─ Documentation for a tool/library?
9+
│ ├─ This Nx workspace? → Nx MCP
10+
│ ├─ Graphite gt CLI? → Graphite MCP
11+
│ └─ Other library/framework? → Context7 MCP
12+
13+
├─ Content from a specific URL? → URL Crawler*
14+
15+
└─ Generic search/question? → Perplexity Search
16+
17+
*Check if library docs first - use Context7 instead
18+
```
19+
20+
## When to Use Tools vs Answer Directly
21+
22+
**Default: Answer from your training knowledge WITHOUT tools.**
23+
24+
**ONLY use search/research tools when user explicitly signals intent:**
25+
- "search for..."
26+
- "find..."
27+
- "look up..."
28+
- "research..."
29+
- "what's the latest..."
30+
- "current best practices..."
31+
- User provides a URL to crawl/fetch
32+
33+
**CRITICAL: DO NOT use WebFetch to fetch documentation you know about:**
34+
- "ask for info about X" → Answer directly or use appropriate MCP (NOT WebFetch)
35+
- "tell me about X" → Answer directly (NOT WebFetch)
36+
- WebFetch is ONLY for when user explicitly provides a URL to fetch
37+
- For Claude Code docs → Answer from knowledge or use URL if user provides it
38+
39+
**ALWAYS use MCP tools for specific systems (even without explicit "search" signal):**
40+
- Questions about THIS workspace → Nx MCP (always)
41+
- Questions about gt CLI → Graphite MCP (always)
42+
- Questions about library APIs → Context7 MCP (always)
43+
44+
## Tool Selection Hierarchy
45+
46+
**ALWAYS follow this order. Never skip steps.**
47+
48+
| Priority | Scenario | Tool | Notes |
49+
|----------|----------|------|-------|
50+
| 1 | THIS workspace | Nx MCP (`nx_docs`, `nx_workspace`, `nx_project_details`) | Don't read nx.json directly |
51+
| 2 | `gt` CLI commands | Graphite MCP (`learn_gt`) | ANY "gt" mention = use this |
52+
| 3 | Library/framework docs | Context7 MCP (`resolve-library-id``get-library-docs`) | Token limits: 3k-10k, use `topic` param |
53+
| 4 | Complex reasoning | Sequential Thinking MCP | Multi-step analysis only |
54+
| 5 | Generic search | Perplexity Search | `max_results: 3`, `max_tokens_per_page: 512` |
55+
| 6 | Conversational answer | Perplexity Ask | When Search returns nothing |
56+
| 7 | Specific URL content | URL Crawler (`crawl4ai-sse__md`) | Try Context7 first for library docs |
57+
| 8 | Deep multi-source research | Researcher agent (`/research <topic>`) | 30-50k tokens, use sparingly |
58+
| 9 | Last resort - search | WebSearch | ONLY after Perplexity Search/Ask exhausted |
59+
| 10 | Last resort - fetch | WebFetch | ONLY after URL Crawler exhausted |
60+
61+
**PROHIBITED:** `mcp__perplexity__perplexity_research` - Use researcher agent instead
62+
63+
**CRITICAL: WebSearch and WebFetch are last resort tools:**
64+
- WebSearch: Use ONLY when Perplexity Search AND Perplexity Ask both failed
65+
- WebFetch: Use ONLY when URL Crawler failed OR user explicitly provides URL to fetch
66+
67+
## Critical Anti-Patterns (Top 4)
68+
69+
Learn these mistakes to avoid them:
70+
71+
**Library docs → WebSearch or WebFetch**
72+
- WRONG: Use WebSearch/WebFetch for React, Temporal, etc.
73+
- RIGHT: Use Context7 MCP first
74+
- Why: Context7 provides structured, up-to-date library docs
75+
76+
**"gt commands" → Perplexity Search**
77+
- WRONG: Search for "gt stack", "gt sync", etc.
78+
- RIGHT: Use Graphite MCP for ANY "gt" mention
79+
- Why: Graphite MCP has complete CLI documentation
80+
81+
**Deep research → perplexity_research tool**
82+
- WRONG: Use `mcp__perplexity__perplexity_research`
83+
- RIGHT: Use researcher agent (`/research <topic>`)
84+
- Why: perplexity_research is PROHIBITED
85+
86+
**"ask about X" → WebFetch**
87+
- WRONG: Fetch docs when user says "ask about" or "tell me about"
88+
- RIGHT: Answer from training knowledge (not a URL fetch request)
89+
- Why: WebFetch is ONLY for explicit URLs provided by user
90+
91+
**Note:** More detailed examples available in `.claude/tool_examples.md` (user can reference when needed)
92+
93+
## Key Decision Rules
94+
95+
1. **Tool/library docs?** → Nx MCP / Graphite MCP / Context7 MCP
96+
2. **Known URL?** → Try Context7 first (if library), else URL Crawler → WebFetch (last resort)
97+
3. **Generic search?** → Perplexity Search → Perplexity Ask → WebSearch (last resort)
98+
4. **Deep research?**`/research <topic>` (researcher agent)
99+
5. **User says "crawl [url]"?** → URL Crawler → WebFetch (if failed)
100+
6. **User says "search [query]"?** → Perplexity Search → Perplexity Ask → WebSearch (if failed)
101+
7. **User provides explicit URL?** → URL Crawler → WebFetch (fallback)
102+
103+
## Context7 MCP Quick Reference
104+
105+
**Token limits (always specify):**
106+
- Focused: `tokens: 3000`
107+
- Default: `tokens: 5000`
108+
- Broad: `tokens: 8000`
109+
- Maximum: `tokens: 10000`
110+
111+
**Always provide `topic` parameter** (e.g., "hooks", "routing", "authentication")
112+
113+
**Examples:**
114+
- React hooks → `/facebook/react`, topic: "hooks", tokens: 5000
115+
- Temporal workflows → `/temporalio/temporal`, topic: "workflows", tokens: 5000
116+
- Supabase functions → `/supabase/supabase`, topic: "edge functions", tokens: 5000
117+
118+
## Perplexity Search Quick Reference
119+
120+
**Always limit results:**
121+
```typescript
122+
mcp__perplexity__perplexity_search({
123+
query: "your search query",
124+
max_results: 3, // Default is 10 - too many!
125+
max_tokens_per_page: 512 // Reduce per-result content
126+
})
127+
```
128+
129+
## Researcher Agent Quick Reference
130+
131+
**When to use:**
132+
- Comprehensive multi-source research needed
133+
- Comparing approaches/technologies
134+
- Trade-off analysis with citations
135+
136+
**Token cost:** 30-50k tokens per research
137+
**Use sparingly:** Only for complex questions requiring synthesis
138+
139+
**Examples:**
140+
```bash
141+
/research postgres advisory locks vs row locking trade-offs
142+
/research database migration strategies comparison
143+
```
144+
145+
## Project-Specific Documentation URLs
146+
147+
**Use Context7 first, fallback to URL Crawler only if Context7 fails**
148+
149+
### Starlight (website framework)
150+
- Getting Started: https://starlight.astro.build/getting-started/
151+
152+
### Vitest (testing framework)
153+
- Guide: https://vitest.dev/guide/
154+
155+
### pgTAP (PostgreSQL testing framework)
156+
- Documentation: https://pgtap.org/documentation.html
157+
158+
### PGMQ (Postgres Message Queue)
159+
- Overview: https://pgmq.github.io/pgmq/
160+
- Functions: https://pgmq.github.io/pgmq/api/sql/functions/
161+
- Types: https://pgmq.github.io/pgmq/api/sql/types/
162+
163+
### Claude Code
164+
- Overview: https://docs.claude.com/en/docs/claude-code/overview
File renamed without changes.

0 commit comments

Comments
 (0)