Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ No complicated path setup - Context-Engine automatically handles the mapping bet
| Windsurf | SSE / RMCP |
| Cline | SSE / RMCP |
| Roo | SSE / RMCP |
| OpenCode | RMCP |
| Augment | SSE |
| Codex | RMCP |
| Copilot | RMCP |
Expand Down
57 changes: 57 additions & 0 deletions docs/IDE_CLIENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Replace `localhost` with server IP/hostname for remote setups.
| Kiro | SSE | Uses mcp-remote bridge |
| Qodo | RMCP | Direct HTTP endpoints |
| OpenAI Codex | RMCP | TOML config |
| OpenCode | RMCP | JSON config at `~/.config/opencode/opencode.json` |
| Augment | SSE | Simple JSON configs |
| AmpCode | SSE | Simple URL for SSE endpoints |
| Claude Code CLI | SSE / HTTP (RMCP) | Simple JSON configs via .mcp.json |
Expand Down Expand Up @@ -215,6 +216,62 @@ url = "http://127.0.0.1:8002/mcp"
url = "http://127.0.0.1:8003/mcp"
```

### OpenCode

OpenCode is a CLI-based AI coding assistant that supports MCP servers. Configuration file is at `~/.config/opencode/opencode.json`.

**Option 1: MCP Bridge** (recommended - unified server with workspace awareness):

```json
{
"mcp": {
"context-engine": {
"command": [
"npx",
"-y",
"@context-engine-bridge/context-engine-mcp-bridge",
"mcp-serve",
"--workspace",
"/path/to/your/project",
"--indexer-url",
"http://localhost:8003/mcp",
"--memory-url",
"http://localhost:8002/mcp"
],
"environment": {
"COLLECTION_NAME": "your-collection-name"
},
"enabled": true
}
}
}
```

**Option 2: Direct HTTP endpoints** (simpler, no bridge):

```json
{
"mcp": {
"memory": {
"url": "http://localhost:8002/mcp",
"enabled": true
},
"qdrant-indexer": {
"url": "http://localhost:8003/mcp",
"enabled": true
}
}
}
```

**Notes:**
- Replace `/path/to/your/project` with your actual workspace path
- Replace `your-collection-name` with your Qdrant collection name (e.g., `codebase` or use `qdrant_list` to find it)
- OpenCode uses `"mcp"` as the top-level key, NOT `"mcpServers"`
- The `"command"` field must be an array of strings, not a single string
- Use `"environment"` for environment variables, NOT `"env"`
- Include `"enabled": true` to activate each server

---

## Mixed Transport (stdio + SSE)
Expand Down
7 changes: 5 additions & 2 deletions plugins/neo4j_graph/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1144,20 +1144,23 @@ def compute_pagerank(
# Ensures ALL nodes get a base rank, not just those with incoming edges
with session.begin_transaction(timeout=timeout) as tx:
if repo and repo != "*":
# Scope relationships to same collection AND repo
result = tx.run("""
MATCH (n:Symbol {collection: $collection})
WHERE n.repo = $repo
OPTIONAL MATCH (n)<-[r:CALLS|IMPORTS]-()
OPTIONAL MATCH (n)<-[r:CALLS|IMPORTS {collection: $collection}]-(caller)
WHERE caller.repo = $repo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this WHERE caller.repo = $repo is applied after an OPTIONAL MATCH, rows where no caller exists will be filtered out (since caller is null), so symbols with zero incoming edges may not get the intended base pagerank. Consider making the repo predicate null-safe or pushing it into the OPTIONAL MATCH pattern so unmatched rows are preserved.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

WITH n, count(r) AS in_degree
SET n.pagerank = CASE WHEN in_degree > 0
THEN toFloat(in_degree) / 100.0
ELSE 0.001 END
RETURN count(n) AS cnt
""", collection=collection, repo=repo)
else:
# Scope relationships to same collection
result = tx.run("""
MATCH (n:Symbol {collection: $collection})
OPTIONAL MATCH (n)<-[r:CALLS|IMPORTS]-()
OPTIONAL MATCH (n)<-[r:CALLS|IMPORTS {collection: $collection}]-()
WITH n, count(r) AS in_degree
SET n.pagerank = CASE WHEN in_degree > 0
THEN toFloat(in_degree) / 100.0
Expand Down
4 changes: 3 additions & 1 deletion plugins/neo4j_graph/knowledge_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,14 @@ def compute_pagerank(
except Exception:
# Fallback: simple in-degree approximation with timeout
# Uses OPTIONAL MATCH to give base rank to ALL nodes, not just those with incoming edges
# Scopes relationships to same repo to keep PageRank isolated per graph
with session.begin_transaction(timeout=timeout) as tx:
if repo:
result = tx.run("""
MATCH (n:Symbol)
WHERE n.repo = $repo
OPTIONAL MATCH (n)<-[r:CALLS|IMPORTS]-()
OPTIONAL MATCH (n)<-[r:CALLS|IMPORTS]-(caller)
WHERE caller.repo = $repo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same OPTIONAL MATCH + WHERE caller.repo = $repo interaction here: nodes with no incoming CALLS/IMPORTS will be dropped, which contradicts the comment about giving all nodes a base rank. This could cause some symbols in the repo to never have pagerank set in the fallback path.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

WITH n, count(r) AS in_degree
SET n.pagerank = CASE WHEN in_degree > 0
THEN toFloat(in_degree) / 100.0
Expand Down
118 changes: 118 additions & 0 deletions sisyphus-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Sisyphus Agent Configurations with Context-Engine Tools

Pre-configured [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) Sisyphus agents enhanced with Context-Engine MCP tools for semantic code search, symbol graph navigation, and memory storage.

## Installation

Copy the agent files to your Claude config directory:

```bash
cp -r agents/* ~/.claude/agents/
```

## Requirements

- [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) installed
- [Context-Engine](https://github.com/m1rl0k/Context-Engine) stack running
- MCP configured in `~/.config/opencode/opencode.json`:

```json
{
"mcp": {
"context-engine": {
"type": "local",
"command": [
"npx", "-y", "@context-engine-bridge/context-engine-mcp-bridge",
"mcp-serve",
"--workspace", "/path/to/your/project",
"--indexer-url", "http://localhost:8003/mcp",
"--memory-url", "http://localhost:8002/mcp"
],
"enabled": true
}
}
}
```

## Agent Tool Matrix

| Agent | Primary Focus | Context-Engine Tools |
|-------|---------------|---------------------|
| **explore** | Fast codebase search | `repo_search`, `code_search`, `info_request`, `symbol_graph`, `pattern_search` |
| **explore-medium** | Deep pattern discovery | + `context_search`, `search_callers_for`, `search_importers_for` |
| **librarian** | Documentation & research | `repo_search`, `context_answer`, `context_search`, `info_request`, `search_tests_for`, `search_config_for`, `memory_find`, `memory_store` |
| **librarian-low** | Quick lookups | `repo_search`, `info_request`, `search_config_for` |
| **oracle** | Architecture & debugging | `repo_search`, `context_answer`, `symbol_graph`, `neo4j_graph_query`, `pattern_search`, `search_callers_for`, `change_history_for_path` |
| **oracle-medium** | Standard analysis | `repo_search`, `context_answer`, `symbol_graph`, `search_callers_for`, `pattern_search` |
| **oracle-low** | Quick questions | `repo_search`, `info_request`, `symbol_graph` |
| **sisyphus-junior** | Task execution | `repo_search`, `code_search`, `info_request`, `symbol_graph`, `search_tests_for` |
| **sisyphus-junior-high** | Complex execution | `repo_search`, `code_search`, `symbol_graph`, `pattern_search`, `search_callers_for` |
| **sisyphus-junior-low** | Simple tasks | `repo_search`, `info_request` |
| **metis** | Pre-planning analysis | `repo_search`, `context_answer`, `info_request`, `symbol_graph`, `search_tests_for`, `search_config_for` |
| **momus** | Plan review | `repo_search`, `symbol_graph`, `info_request` |
| **prometheus** | Strategic planning | `repo_search`, `context_answer`, `info_request`, `symbol_graph`, `search_tests_for`, `search_config_for` |
| **document-writer** | Documentation | `repo_search`, `context_answer`, `info_request`, `search_tests_for` |
| **frontend-engineer** | UI/UX | `repo_search`, `info_request`, `pattern_search`, `search_tests_for` |
| **frontend-engineer-high** | Complex UI | + `symbol_graph` |
| **frontend-engineer-low** | Simple styling | `repo_search`, `info_request` |
| **qa-tester** | Testing | `repo_search`, `search_tests_for`, `search_config_for`, `info_request` |
| **multimodal-looker** | Visual analysis | `repo_search`, `info_request` |

## Context-Engine Tools Reference

### Search Tools
| Tool | Use Case |
|------|----------|
| `repo_search` | Hybrid semantic + lexical code search with reranking |
| `code_search` | Alias for repo_search |
| `context_search` | Blend code + memory/docs results |
| `context_answer` | LLM-generated explanations with citations |
| `info_request` | Simple natural language queries |
| `pattern_search` | AST-aware structural pattern matching |

### Navigation Tools
| Tool | Use Case |
|------|----------|
| `symbol_graph` | Find callers, callees, definitions, importers |
| `neo4j_graph_query` | Advanced traversals (impact, transitive, cycles) |
| `search_callers_for` | Find symbol usages |
| `search_importers_for` | Find import references |

### Specialized Search
| Tool | Use Case |
|------|----------|
| `search_tests_for` | Find test files |
| `search_config_for` | Find config files (yaml/json/toml) |
| `change_history_for_path` | File change history |

### Memory Tools
| Tool | Use Case |
|------|----------|
| `memory_store` | Store knowledge with metadata |
| `memory_find` | Search stored memories |

## Key Behavior Changes

All agents are configured to:

1. **PREFER semantic search over grep** for concept-based queries
2. Use `symbol_graph` for call chain analysis before refactoring
3. Use `pattern_search` for finding similar code across languages
4. Use grep **ONLY** for exact literals (e.g., `"REDIS_HOST"`, `"UserAlreadyExists"`)

## Examples

```bash
# Agent uses repo_search instead of grep
"Find authentication handling" → repo_search(query="authentication mechanisms")

# Agent uses symbol_graph for impact analysis
"What calls this function?" → symbol_graph(symbol="authenticate", query_type="callers")

# Agent uses neo4j for advanced traversal
"What breaks if I change this?" → neo4j_graph_query(symbol="User", query_type="impact", depth=2)
```

## License

Same as Context-Engine (BUSL-1.1)
33 changes: 33 additions & 0 deletions sisyphus-config/agents/document-writer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: document-writer
description: Technical documentation specialist. Use for README files, API docs, and code comments.
tools: Read, Write, Edit, Glob, Grep, mcp_context-engine_repo_search, mcp_context-engine_context_answer, mcp_context-engine_info_request, mcp_context-engine_search_tests_for
model: haiku
---

You are Document Writer, a technical writing specialist.

Your responsibilities:

1. **README Creation**: Write clear, comprehensive README files
2. **API Documentation**: Document APIs with examples and usage
3. **Code Comments**: Add meaningful inline documentation
4. **Tutorials**: Create step-by-step guides for complex features
5. **Changelogs**: Maintain clear version history

Context-Engine Tools (USE THESE for research):

- `mcp_context-engine_repo_search` - Find code to document
- `mcp_context-engine_context_answer` - Get explanations to base docs on
- `mcp_context-engine_info_request` - Quick overviews with `include_explanation=true`
- `mcp_context-engine_search_tests_for` - Find tests as usage examples

Guidelines:

- Use `context_answer` to understand code before documenting
- Use `search_tests_for` to find real usage examples
- Write for the target audience (developers, users, etc.)
- Use clear, concise language
- Include practical examples
- Structure documents logically
- Keep documentation up-to-date with code changes
32 changes: 32 additions & 0 deletions sisyphus-config/agents/explore-medium.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: explore-medium
description: Thorough codebase search with reasoning (Sonnet)
tools: Read, Glob, Grep, mcp_context-engine_repo_search, mcp_context-engine_code_search, mcp_context-engine_info_request, mcp_context-engine_symbol_graph, mcp_context-engine_pattern_search, mcp_context-engine_context_search, mcp_context-engine_search_callers_for, mcp_context-engine_search_importers_for
model: sonnet
---

Explore (Medium Tier) - Thorough Search with Context-Engine

Use when deeper analysis is needed:

- Cross-module pattern discovery
- Architecture understanding
- Complex dependency tracing
- Multi-file relationship mapping

Context-Engine Tools:

- `repo_search` / `code_search` - Hybrid semantic + lexical search
- `info_request` - Simple natural language queries with explanations
- `symbol_graph` - Navigate call graphs, find definitions, trace imports
- `pattern_search` - Find structurally similar code across languages
- `context_search` - Blend code search with memory/docs
- `search_callers_for` - Find all usages of a symbol
- `search_importers_for` - Find files importing a module

Guidelines:

- Start with `info_request(include_explanation=true)` for architecture overviews
- Use `symbol_graph(query_type="callers", depth=2)` for multi-hop caller chains
- Use `pattern_search` for "retry with backoff" or similar structural patterns
- PREFER semantic search over grep for concept-based queries
33 changes: 33 additions & 0 deletions sisyphus-config/agents/explore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: explore
description: Fast pattern matching and code search specialist. Use for quick file searches and codebase exploration.
tools: Glob, Grep, Read, mcp_context-engine_repo_search, mcp_context-engine_code_search, mcp_context-engine_info_request, mcp_context-engine_symbol_graph, mcp_context-engine_pattern_search
model: haiku
---

You are Explore, a fast and efficient codebase exploration specialist.

Your responsibilities:

1. **Rapid Search**: Quickly locate files, functions, and patterns
2. **Structure Mapping**: Understand and report on project organization
3. **Pattern Matching**: Find all occurrences of specific patterns
4. **Reconnaissance**: Perform initial exploration of unfamiliar codebases

Context-Engine Tools (PREFER these for semantic search):

- `mcp_context-engine_repo_search` - Hybrid semantic + lexical search with reranking
- `mcp_context-engine_code_search` - Alias for repo_search
- `mcp_context-engine_info_request` - Simple natural language search
- `mcp_context-engine_symbol_graph` - Find callers, definitions, importers
- `mcp_context-engine_pattern_search` - AST-aware structural pattern matching

Guidelines:

- **PREFER** `repo_search` over grep for concept searches ("authentication", "error handling")
- Use `symbol_graph(query_type="callers")` to find who calls a function
- Use `pattern_search` for cross-language structural similarity
- Use grep ONLY for exact literals (e.g., "REDIS_HOST", "UserAlreadyExists")
- Prioritize speed over exhaustive analysis
- Report findings immediately as you find them
- Keep responses focused and actionable
25 changes: 25 additions & 0 deletions sisyphus-config/agents/frontend-engineer-high.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: frontend-engineer-high
description: Complex UI architecture and design systems (Opus)
tools: Read, Glob, Grep, Edit, Write, Bash, mcp_context-engine_repo_search, mcp_context-engine_info_request, mcp_context-engine_pattern_search, mcp_context-engine_symbol_graph, mcp_context-engine_search_tests_for
model: opus
---

Frontend-Engineer (High Tier) - Complex UI Architecture

Use for sophisticated frontend work:

- Design system creation
- Complex component architecture
- Advanced state management
- Performance optimization

Context-Engine Tools:

- `repo_search` - Find existing patterns and components
- `info_request` - Architecture overviews
- `pattern_search` - Find similar UI patterns
- `symbol_graph` - Trace component dependencies
- `search_tests_for` - Find component tests

PREFER semantic search to understand existing patterns before designing new architecture.
21 changes: 21 additions & 0 deletions sisyphus-config/agents/frontend-engineer-low.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: frontend-engineer-low
description: Simple styling and minor UI tweaks (Haiku)
tools: Read, Glob, Grep, Edit, Write, Bash, mcp_context-engine_repo_search, mcp_context-engine_info_request
model: haiku
---

Frontend-Engineer (Low Tier) - Simple UI Tasks

Use for trivial frontend work:

- Simple CSS changes
- Minor styling tweaks
- Basic component edits

Context-Engine Tools:

- `repo_search` - Find existing styles and patterns
- `info_request` - Quick component lookups

PREFER `repo_search` over grep for finding style patterns.
Loading
Loading