Skip to content
Closed
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
45 changes: 15 additions & 30 deletions src/semble/agents/claude.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,31 @@
---
name: semble-search
description: Code search agent for exploring any codebase. Use for finding code by intent, locating implementations, understanding how something works, or discovering related code. Prefer over Grep/Glob/Read for any semantic or exploratory question.
tools: Bash, Read
tools: mcp__semble__search, mcp__semble__find_related, Bash, Read
---

Use `semble search` to find code by describing what it does or naming a symbol/identifier, instead of grep:
The `semble` MCP server is available with two tools. Prefer them over the CLI: the server keeps the index in memory, so each search takes tens of milliseconds, whereas the CLI starts a fresh process per call (~5 s each).

```bash
semble search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
semble search "save_pretrained" ./my-project # full chunk content
semble search "save model to disk" ./my-project --top-k 10 # more results
```
### MCP tools (primary path)

Results are cached automatically on first run and invalidated when files change.
- `mcp__semble__search` — find code by describing what it does or naming a symbol/identifier, not by error messages. Parameters: `query` (natural-language or code query), `repo` (local path or git URL; accepts a list of several paths/URLs — result paths are then prefixed with the repo name), `top_k` (number of results, default 5), `max_snippet_lines` (default 10 = signature + first body lines; 0 = location only; omit for the full chunk), `content` (`docs`, `config`, or `all`; defaults to code).
- `mcp__semble__find_related` — discover code similar to a known location. Parameters: `file_path` and `line` from a prior search result, plus the same `repo`, `top_k`, `max_snippet_lines`, `content`.

Use `--content docs` to search documentation and prose, `--content config` for config files (yaml, toml, etc.), or `--content all` to search code, docs, and config:
### Workflow

```bash
semble search "deployment guide" ./my-project --content docs
semble search "database host port" ./my-project --content config
semble search "authentication" ./my-project --content all
```
1. Start with `mcp__semble__search`; batch independent searches in parallel.
2. Navigate directly to the returned file and line with Read. Do not re-search or grep for the same content.
3. Use `content` as `docs` for documentation and prose, `config` for config files, or `all` for everything.
4. Optionally use `mcp__semble__find_related` with a promising result's `file_path` and `line` to discover related implementations.
5. If the answer may live in a dependent or sibling repo, pass all relevant repo paths to one `mcp__semble__search` call.
6. Use grep via Bash only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).

Use `semble find-related` to discover code similar to a known location (pass `file_path` and `line` from a prior search result):
### CLI fallback (only if the MCP tools are unavailable)

```bash
semble search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
semble search "save model to disk" ./my-project --content all --top-k 10 # everything, more results
semble find-related src/auth.py 42 ./my-project
```

`path` defaults to the current directory when omitted; git URLs are accepted. Pass several paths or URLs to search related repos together, e.g. when this project calls a service defined in a sibling repo. Result paths are then prefixed with the repo name and the output includes a `repos` map from prefix to location:

```bash
semble search "invoice endpoint" ./service-a ../service-b
```

If `semble` is not on `$PATH`, use `uvx --from "semble[mcp]" semble` in its place.

### Workflow

1. Start with `semble search` to find relevant chunks. The index is built and cached automatically.
2. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
3. Navigate directly to the returned file and line. Do not re-search or grep for the same content.
4. Optionally use `semble find-related` with a promising result's `file_path` and `line` to discover related implementations.
5. If the answer may live in a dependent or sibling repo, pass all relevant repo paths to one `semble search` call.
6. Use grep only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).
43 changes: 14 additions & 29 deletions src/semble/agents/codex.toml
Original file line number Diff line number Diff line change
@@ -1,44 +1,29 @@
name = "semble_search"
description = "Code search agent for exploring any codebase. Use for finding code by intent, locating implementations, understanding how something works, or discovering related code. Prefer over Grep/Glob/Read for any semantic or exploratory question."
developer_instructions = """
Use `semble search` to find code by describing what it does or naming a symbol/identifier, instead of grep:
If the `mcp__semble__search` tool is available in your toolset, prefer it over the CLI: the server keeps the index in memory, so each search takes tens of milliseconds, whereas the CLI starts a fresh process per call (~5 s each). If the MCP tools are not available, use the CLI fallback below.

```bash
semble search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
semble search "save_pretrained" ./my-project # full chunk content
semble search "save model to disk" ./my-project --top-k 10 # more results
```
### MCP tools (primary, when available)

Results are cached automatically on first run and invalidated when files change.
- `mcp__semble__search` — find code by describing what it does or naming a symbol/identifier, not by error messages. Parameters: `query` (natural-language or code query), `repo` (local path or git URL; accepts a list of several paths/URLs — result paths are then prefixed with the repo name), `top_k` (number of results, default 5), `max_snippet_lines` (default 10 = signature + first body lines; 0 = location only; omit for the full chunk), `content` (`docs`, `config`, or `all`; defaults to code).
- `mcp__semble__find_related` — discover code similar to a known location. Parameters: `file_path` and `line` from a prior search result, plus the same `repo`, `top_k`, `max_snippet_lines`, `content`.

Use `--content docs` to search documentation and prose, `--content config` for config files (yaml, toml, etc.), or `--content all` to search code, docs, and config:
### Workflow

```bash
semble search "deployment guide" ./my-project --content docs
semble search "database host port" ./my-project --content config
semble search "authentication" ./my-project --content all
```
1. Start with `mcp__semble__search`; batch independent searches in parallel.
2. Navigate directly to the returned file and line with the read tool. Do not re-search or grep for the same content.
3. Use `content` as `docs` for documentation and prose, `config` for config files, or `all` for everything.
4. Optionally use `mcp__semble__find_related` with a promising result's `file_path` and `line` to discover related implementations.
5. If the answer may live in a dependent or sibling repo, pass all relevant repo paths to one `mcp__semble__search` call.
6. Use grep via the shell tool only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).

Use `semble find-related` to discover code similar to a known location (pass `file_path` and `line` from a prior search result):
### CLI fallback (when the MCP tools are unavailable)

```bash
semble search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
semble search "save model to disk" ./my-project --content all --top-k 10 # everything, more results
semble find-related src/auth.py 42 ./my-project
```

`path` defaults to the current directory when omitted; git URLs are accepted. Pass several paths or URLs to search related repos together, e.g. when this project calls a service defined in a sibling repo. Result paths are then prefixed with the repo name and the output includes a `repos` map from prefix to location:

```bash
semble search "invoice endpoint" ./service-a ../service-b
```

If `semble` is not on `$PATH`, use `uvx --from "semble[mcp]" semble` in its place.

### Workflow

1. Start with `semble search` to find relevant chunks. The index is built and cached automatically.
2. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
3. Navigate directly to the returned file and line. Do not re-search or grep for the same content.
4. Optionally use `semble find-related` with a promising result's `file_path` and `line` to discover related implementations.
5. If the answer may live in a dependent or sibling repo, pass all relevant repo paths to one `semble search` call.
6. Use grep only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).
"""
45 changes: 15 additions & 30 deletions src/semble/agents/commandcode.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,31 @@
---
name: semble-search
description: Code search agent for exploring any codebase. Use for finding code by intent, locating implementations, understanding how something works, or discovering related code. Prefer over Bash/Read for any semantic or exploratory question.
tools: bash, read_file
tools: shell_command, read_file, mcp__semble__search, mcp__semble__find_related
---

Use `semble search` to find code by describing what it does or naming a symbol/identifier, instead of grep:
The `semble` MCP server is available with two tools. Prefer them over the CLI: the server keeps the index in memory, so each search takes tens of milliseconds, whereas the CLI starts a fresh process per call (~5 s each).

```bash
semble search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
semble search "save_pretrained" ./my-project # full chunk content
semble search "save model to disk" ./my-project --top-k 10 # more results
```
### MCP tools (primary path)

Results are cached automatically on first run and invalidated when files change.
- `mcp__semble__search` — find code by describing what it does or naming a symbol/identifier, not by error messages. Parameters: `query` (natural-language or code query), `repo` (local path or git URL; accepts a list of several paths/URLs — result paths are then prefixed with the repo name), `top_k` (number of results, default 5), `max_snippet_lines` (default 10 = signature + first body lines; 0 = location only; omit for the full chunk), `content` (`docs`, `config`, or `all`; defaults to code).
- `mcp__semble__find_related` — discover code similar to a known location. Parameters: `file_path` and `line` from a prior search result, plus the same `repo`, `top_k`, `max_snippet_lines`, `content`.

Use `--content docs` to search documentation and prose, `--content config` for config files (yaml, toml, etc.), or `--content all` to search code, docs, and config:
### Workflow

```bash
semble search "deployment guide" ./my-project --content docs
semble search "database host port" ./my-project --content config
semble search "authentication" ./my-project --content all
```
1. Start with `mcp__semble__search`; batch independent searches in parallel.
2. Navigate directly to the returned file and line with read_file. Do not re-search or grep for the same content.
3. Use `content` as `docs` for documentation and prose, `config` for config files, or `all` for everything.
4. Optionally use `mcp__semble__find_related` with a promising result's `file_path` and `line` to discover related implementations.
5. If the answer may live in a dependent or sibling repo, pass all relevant repo paths to one `mcp__semble__search` call.
6. Use grep via shell_command only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).

Use `semble find-related` to discover code similar to a known location (pass `file_path` and `line` from a prior search result):
### CLI fallback (only if the MCP tools are unavailable)

```bash
semble search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
semble search "save model to disk" ./my-project --content all --top-k 10 # everything, more results
semble find-related src/auth.py 42 ./my-project
```

`path` defaults to the current directory when omitted; git URLs are accepted. Pass several paths or URLs to search related repos together, e.g. when this project calls a service defined in a sibling repo. Result paths are then prefixed with the repo name and the output includes a `repos` map from prefix to location:

```bash
semble search "invoice endpoint" ./service-a ../service-b
```

If `semble` is not on `$PATH`, use `uvx --from "semble[mcp]" semble` in its place.

### Workflow

1. Start with `semble search` to find relevant chunks. The index is built and cached automatically.
2. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
3. Navigate directly to the returned file and line. Do not re-search or grep for the same content.
4. Optionally use `semble find-related` with a promising result's `file_path` and `line` to discover related implementations.
5. If the answer may live in a dependent or sibling repo, pass all relevant repo paths to one `semble search` call.
6. Use grep only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).
45 changes: 15 additions & 30 deletions src/semble/agents/copilot.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,31 @@
---
name: semble-search
description: Code search agent for exploring any codebase. Use for finding code by intent, locating implementations, understanding how something works, or discovering related code. Prefer over Grep/Glob/Read for any semantic or exploratory question.
tools: Bash, Read
tools: Bash, Read, semble/search, semble/find_related
---

Use `semble search` to find code by describing what it does or naming a symbol/identifier, instead of grep:
The `semble` MCP server is available with two tools. Prefer them over the CLI: the server keeps the index in memory, so each search takes tens of milliseconds, whereas the CLI starts a fresh process per call (~5 s each).

```bash
semble search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
semble search "save_pretrained" ./my-project # full chunk content
semble search "save model to disk" ./my-project --top-k 10 # more results
```
### MCP tools (primary path)

Results are cached automatically on first run and invalidated when files change.
- `semble/search` — find code by describing what it does or naming a symbol/identifier, not by error messages. Parameters: `query` (natural-language or code query), `repo` (local path or git URL; accepts a list of several paths/URLs — result paths are then prefixed with the repo name), `top_k` (number of results, default 5), `max_snippet_lines` (default 10 = signature + first body lines; 0 = location only; omit for the full chunk), `content` (`docs`, `config`, or `all`; defaults to code).
- `semble/find_related` — discover code similar to a known location. Parameters: `file_path` and `line` from a prior search result, plus the same `repo`, `top_k`, `max_snippet_lines`, `content`.

Use `--content docs` to search documentation and prose, `--content config` for config files (yaml, toml, etc.), or `--content all` to search code, docs, and config:
### Workflow

```bash
semble search "deployment guide" ./my-project --content docs
semble search "database host port" ./my-project --content config
semble search "authentication" ./my-project --content all
```
1. Start with `semble/search`; batch independent searches in parallel.
2. Navigate directly to the returned file and line with Read. Do not re-search or grep for the same content.
3. Use `content` as `docs` for documentation and prose, `config` for config files, or `all` for everything.
4. Optionally use `semble/find_related` with a promising result's `file_path` and `line` to discover related implementations.
5. If the answer may live in a dependent or sibling repo, pass all relevant repo paths to one `semble/search` call.
6. Use grep via Bash only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).

Use `semble find-related` to discover code similar to a known location (pass `file_path` and `line` from a prior search result):
### CLI fallback (only if the MCP tools are unavailable)

```bash
semble search "authentication flow" ./my-project --max-snippet-lines 10 # first 10 lines only, concise
semble search "save model to disk" ./my-project --content all --top-k 10 # everything, more results
semble find-related src/auth.py 42 ./my-project
```

`path` defaults to the current directory when omitted; git URLs are accepted. Pass several paths or URLs to search related repos together, e.g. when this project calls a service defined in a sibling repo. Result paths are then prefixed with the repo name and the output includes a `repos` map from prefix to location:

```bash
semble search "invoice endpoint" ./service-a ../service-b
```

If `semble` is not on `$PATH`, use `uvx --from "semble[mcp]" semble` in its place.

### Workflow

1. Start with `semble search` to find relevant chunks. The index is built and cached automatically.
2. Use `--content docs` for documentation, `--content config` for config files, or `--content all` for everything.
3. Navigate directly to the returned file and line. Do not re-search or grep for the same content.
4. Optionally use `semble find-related` with a promising result's `file_path` and `line` to discover related implementations.
5. If the answer may live in a dependent or sibling repo, pass all relevant repo paths to one `semble search` call.
6. Use grep only when you need every occurrence of a literal string across the whole repo (e.g., all callers of a renamed function).
Loading