Skip to content

Commit 0d0a17c

Browse files
authored
feat(#132): strengthen Context7 MCP integration to improve agent adoption (#133)
1 parent 3fe8fd8 commit 0d0a17c

11 files changed

Lines changed: 54 additions & 10 deletions

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Every development issue MUST include these checkboxes:
138138

139139
## Context7 - Library Documentation (Mandatory)
140140

141-
All programming agents MUST use Context7 for current library/framework documentation before implementing code. Provides up-to-date docs for 1000+ libraries including React, Python, Rust, Go, Ruby, Rails, and more. Tools: `resolve-library-id` (search library), `get-library-docs` (fetch docs). Rate limit: 10,000 calls/month. See: instructions/context7-library-documentation.md
141+
All programming agents MUST use Context7 for current library/framework documentation before implementing code. When ANY library name is encountered → Context7 FIRST → then implement. Training data may be outdated for library APIs. Tools: `resolve-library-id` (search library), `get-library-docs` (fetch docs). See: instructions/context7-library-documentation.md
142142

143143
## Remory Memory Integration
144144
All agents integrate with Remory, an advanced memory server that provides:

‎instructions/context7-library-documentation.md‎

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,55 @@ Context7 is a Model Context Protocol (MCP) server that provides up-to-date docum
1010

1111
## When to Use Context7 (Explicit Triggers)
1212

13-
**MANDATORY in these situations:**
13+
**🚨 MANDATORY in these situations - NO EXCEPTIONS:**
1414

15-
1. **Library Name Encountered**: Issue or codebase mentions ANY library/framework
16-
- Trigger: BEFORE reading existing code using that library
17-
- Example: "Create Maestro test" → resolve-library-id for Maestro BEFORE reading .yaml files
15+
1. **ANY Library/Framework Name Encountered**: Issue or codebase mentions ANY library/framework
16+
- **Trigger IMMEDIATELY**: BEFORE reading existing code using that library
17+
- **Example**: "Create Maestro test" → resolve-library-id for Maestro BEFORE reading .yaml files
1818

1919
2. **Implementation Starting**: Beginning code that imports/uses a third-party tool
20-
- Even if familiar with the library
21-
- Your training data may be 1+ years old
20+
- **Even if familiar** with the library
21+
- **Your training data may be 1+ years old**
2222

2323
3. **Version Uncertainty**: When library version is unclear
24-
- Check package.json → Get docs for that exact version
24+
- **Check package.json** → Get docs for that exact version
2525

26-
**Workflow:** Encounter library name → resolve-library-id → get-library-docs → Read docs → THEN read existing code → THEN implement
26+
**🔥 DECISION WORKFLOW (Non-negotiable):**
27+
```
28+
Library name encountered → resolve-library-id → get-library-docs → Read docs → THEN read existing code → THEN implement
29+
```
30+
31+
**⚠️ WHY THIS IS CRITICAL - FAILURE EXAMPLES:**
32+
33+
❌ **OUTDATED TRAINING DATA CONSEQUENCES:**
34+
- React 18: `ReactDOM.render` deprecated → `ReactDOM.createRoot` required
35+
- Python 3.11+: `asyncio.create_task()` behavior changed
36+
- Rust 1.65+: `IntoFuture` trait affects async patterns
37+
- Your training data has 1-2 year old APIs!
38+
39+
❌ **ANTI-PATTERN (What NOT to Do):**
40+
- Read existing Maestro YAML → Create test based on pattern → Miss current API
41+
- "I know React" → Skip Context7 → Use deprecated patterns
42+
- grep codebase → Replicate pattern → Pattern uses outdated API
43+
44+
✅ **CORRECT PATTERN (What to Do):**
45+
- See library name → Context7 → Read CURRENT docs → Understand current API → THEN implement
46+
47+
## Tool Hierarchy: Context7 > Perplexity > Training Data
48+
49+
**Context7 (FIRST):** Library/framework documentation and APIs
50+
- Official documentation for 1000+ libraries
51+
- Always current, version-specific when available
52+
- Use BEFORE implementing with ANY library
53+
54+
**Perplexity (SECOND):** General research and understanding
55+
- Concepts, comparisons, explanations
56+
- "Why use React vs Vue?"
57+
- Debugging strategies when docs unclear
58+
59+
**Training Data (LAST):** Only for general patterns without library-specific APIs
60+
- Language fundamentals, design patterns
61+
- NEVER for library APIs or versions
2762

2863
## How to Use Context7
2964

‎prompts/api-design.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ Your bash permissions enforce separation of concerns:
4343
- **CONTEXT7 FIRST**: When you encounter ANY library/framework name in issue or codebase:
4444
1. `resolve-library-id` to find the library
4545
2. `get-library-docs` to fetch current documentation
46-
3. Do this BEFORE reading existing code patterns for that library
46+
3. Do this BEFORE reading code patterns for that library
4747
4. Your training data may be outdated - Context7 has current docs
48+
5. See: instructions/context7-library-documentation.md for triggers and workflow
4849
- **CHALLENGE**: Before creating anything, ask "Is this truly needed for the requirement?"
4950
- **MINIMAL**: Build the simplest solution that fully solves the problem
5051
- **COMPLETE**: ALL issue checkboxes exactly as specified (TDD, coverage, linting, docs, verification)

‎prompts/go-tdd-architect.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Your bash permissions enforce separation of concerns:
6464
2. `get-library-docs` to fetch current documentation
6565
3. Do this BEFORE reading existing code patterns for that library
6666
4. Your training data may be outdated - Context7 has current docs
67+
5. See: instructions/context7-library-documentation.md for triggers and workflow
6768
- **CHALLENGE**: Before creating anything, ask "Is this truly needed for the requirement?"
6869
- **MINIMAL**: Build the simplest solution that fully solves the problem
6970
- **COMPLETE**: ALL issue checkboxes exactly as specified (TDD, coverage, linting, docs, verification)

‎prompts/postgres-specialist.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Your bash permissions enforce separation of concerns:
9797
2. `get-library-docs` to fetch current documentation
9898
3. Do this BEFORE reading existing code patterns for that library
9999
4. Your training data may be outdated - Context7 has current docs
100+
5. See: instructions/context7-library-documentation.md for triggers and workflow
100101
- **CHALLENGE**: Before creating anything, ask "Is this truly needed for the requirement?"
101102
- **MINIMAL**: Build the simplest solution that fully solves the problem
102103
- **COMPLETE**: ALL issue checkboxes exactly as specified (TDD, coverage, linting, docs, verification)

‎prompts/python-best-practices.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Your bash permissions enforce separation of concerns:
5555
2. `get-library-docs` to fetch current documentation
5656
3. Do this BEFORE reading existing code patterns for that library
5757
4. Your training data may be outdated - Context7 has current docs
58+
5. See: instructions/context7-library-documentation.md for triggers and workflow
5859
- **CHALLENGE**: Before creating anything, ask "Is this truly needed for the requirement?"
5960
- **MINIMAL**: Build the simplest solution that fully solves the problem
6061
- **COMPLETE**: ALL issue checkboxes exactly as specified (TDD, coverage, linting, docs, verification)

‎prompts/rails-architect.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Your bash permissions enforce separation of concerns:
5151
2. `get-library-docs` to fetch current documentation
5252
3. Do this BEFORE reading existing code patterns for that library
5353
4. Your training data may be outdated - Context7 has current docs
54+
5. See: instructions/context7-library-documentation.md for triggers and workflow
5455
- **CHALLENGE**: Before creating anything, ask "Is this truly needed for the requirement?"
5556
- **MINIMAL**: Build the simplest solution that fully solves the problem
5657
- **COMPLETE**: ALL issue checkboxes exactly as specified (TDD, coverage, linting, docs, verification)

‎prompts/react-native-mobile-specialist.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Your bash permissions enforce separation of concerns:
4747
2. `get-library-docs` to fetch current documentation
4848
3. Do this BEFORE reading existing code patterns for that library
4949
4. Your training data may be outdated - Context7 has current docs
50+
5. See: instructions/context7-library-documentation.md for triggers and workflow
5051
- **CHALLENGE**: Before creating anything, ask "Is this truly needed for the requirement?"
5152
- **MINIMAL**: Build the simplest solution that fully solves the problem
5253
- **COMPLETE**: ALL issue checkboxes exactly as specified (TDD, coverage, linting, docs, verification)

‎prompts/react-web-specialist.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Your bash permissions enforce separation of concerns:
5151
2. `get-library-docs` to fetch current documentation
5252
3. Do this BEFORE reading existing code patterns for that library
5353
4. Your training data may be outdated - Context7 has current docs
54+
5. See: instructions/context7-library-documentation.md for triggers and workflow
5455
- **CHALLENGE**: Before creating anything, ask "Is this truly needed for the requirement?"
5556
- **MINIMAL**: Build the simplest solution that fully solves the problem
5657
- **COMPLETE**: ALL issue checkboxes exactly as specified (TDD, coverage, linting, docs, verification)

‎prompts/rust-tdd-architect.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Your bash permissions enforce separation of concerns:
6868
2. `get-library-docs` to fetch current documentation
6969
3. Do this BEFORE reading existing code patterns for that library
7070
4. Your training data may be outdated - Context7 has current docs
71+
5. See: instructions/context7-library-documentation.md for triggers and workflow
7172
- **CHALLENGE**: Before creating anything, ask "Is this truly needed for the requirement?"
7273
- **MINIMAL**: Build the simplest solution that fully solves the problem
7374
- **COMPLETE**: ALL issue checkboxes exactly as specified (TDD, coverage, linting, docs, verification)

0 commit comments

Comments
 (0)