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
File renamed without changes.
30 changes: 30 additions & 0 deletions src/semble/agents/copilot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
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
---

Use `semble search` to find code by describing what it does or naming a symbol/identifier, instead of grep:

```bash
semble search "authentication flow" ./my-project
semble search "save_pretrained" ./my-project
semble search "save model to disk" ./my-project --top-k 10
```

Use `semble find-related` to discover code similar to a known location (pass `file_path` and `line` from a prior search result):

```bash
semble find-related src/auth.py 42 ./my-project
```

`path` defaults to the current directory when omitted; git URLs are accepted.

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.
2. Inspect full files only when the returned chunk is not enough context.
3. Optionally use `semble find-related` with a promising result's `file_path` and `line` to discover related implementations.
4. Use grep only when you need exhaustive literal matches or quick confirmation of an exact string.
29 changes: 29 additions & 0 deletions src/semble/agents/cursor.md
Original file line number Diff line number Diff line change
@@ -0,0 +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 Bash/Read for any semantic or exploratory question.
---

Use `semble search` to find code by describing what it does or naming a symbol/identifier, instead of grep:

```bash
semble search "authentication flow" ./my-project
semble search "save_pretrained" ./my-project
semble search "save model to disk" ./my-project --top-k 10
```

Use `semble find-related` to discover code similar to a known location (pass `file_path` and `line` from a prior search result):

```bash
semble find-related src/auth.py 42 ./my-project
```

`path` defaults to the current directory when omitted; git URLs are accepted.

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.
2. Inspect full files only when the returned chunk is not enough context.
3. Optionally use `semble find-related` with a promising result's `file_path` and `line` to discover related implementations.
4. Use grep only when you need exhaustive literal matches or quick confirmation of an exact string.
32 changes: 32 additions & 0 deletions src/semble/agents/gemini.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
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 run_shell_command/read_file for any semantic or exploratory question.
tools:
- run_shell_command
- read_file
---

Use `semble search` to find code by describing what it does or naming a symbol/identifier, instead of grep:

```bash
semble search "authentication flow" ./my-project
semble search "save_pretrained" ./my-project
semble search "save model to disk" ./my-project --top-k 10
```

Use `semble find-related` to discover code similar to a known location (pass `file_path` and `line` from a prior search result):

```bash
semble find-related src/auth.py 42 ./my-project
```

`path` defaults to the current directory when omitted; git URLs are accepted.

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.
2. Inspect full files only when the returned chunk is not enough context.
3. Optionally use `semble find-related` with a promising result's `file_path` and `line` to discover related implementations.
4. Use grep only when you need exhaustive literal matches or quick confirmation of an exact string.
32 changes: 32 additions & 0 deletions src/semble/agents/kiro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
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 shell/read tools for any semantic or exploratory question.
tools:
- shell
- read
---

Use `semble search` to find code by describing what it does or naming a symbol/identifier, instead of grep:

```bash
semble search "authentication flow" ./my-project
semble search "save_pretrained" ./my-project
semble search "save model to disk" ./my-project --top-k 10
```

Use `semble find-related` to discover code similar to a known location (pass `file_path` and `line` from a prior search result):

```bash
semble find-related src/auth.py 42 ./my-project
```

`path` defaults to the current directory when omitted; git URLs are accepted.

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.
2. Inspect full files only when the returned chunk is not enough context.
3. Optionally use `semble find-related` with a promising result's `file_path` and `line` to discover related implementations.
4. Use grep only when you need exhaustive literal matches or quick confirmation of an exact string.
33 changes: 33 additions & 0 deletions src/semble/agents/opencode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
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.
mode: subagent
permission:
bash: allow
read: allow
---

Use `semble search` to find code by describing what it does or naming a symbol/identifier, instead of grep:

```bash
semble search "authentication flow" ./my-project
semble search "save_pretrained" ./my-project
semble search "save model to disk" ./my-project --top-k 10
```

Use `semble find-related` to discover code similar to a known location (pass `file_path` and `line` from a prior search result):

```bash
semble find-related src/auth.py 42 ./my-project
```

`path` defaults to the current directory when omitted; git URLs are accepted.

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.
2. Inspect full files only when the returned chunk is not enough context.
3. Optionally use `semble find-related` with a promising result's `file_path` and `line` to discover related implementations.
4. Use grep only when you need exhaustive literal matches or quick confirmation of an exact string.
2 changes: 1 addition & 1 deletion src/semble/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _run_init(*, agent: Agent = _DEFAULT_AGENT, force: bool = False) -> None:
print(f"{dest} already exists. Run with --force to overwrite.", file=sys.stderr)
sys.exit(1)
dest.parent.mkdir(parents=True, exist_ok=True)
content = files("semble").joinpath("agents/semble-search.md").read_text(encoding="utf-8")
content = files("semble").joinpath(f"agents/{agent.value}.md").read_text(encoding="utf-8")
dest.write_text(content, encoding="utf-8")
print(f"Created {dest}")

Expand Down
2 changes: 1 addition & 1 deletion src/semble/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_triple__ = (0, 1, 10)
__version_triple__ = (0, 2, 0)
__version__ = ".".join(map(str, __version_triple__))
22 changes: 12 additions & 10 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

_CLAUDE_FILE_PATH = _agent_path(Agent.CLAUDE)

_CLAUDE_AGENT_FILE = files("semble").joinpath("agents/semble-search.md").read_text(encoding="utf-8")


@pytest.mark.parametrize(
"argv",
Expand Down Expand Up @@ -93,14 +91,18 @@ def test_cli_find_related(
assert expected_stderr in captured.err


def test_init_creates_file(tmp_path: Path, monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]) -> None:
"""_run_init writes the agent file and prints its path."""
@pytest.mark.parametrize("agent", list(Agent))
def test_init_creates_file(
agent: Agent, tmp_path: Path, monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
) -> None:
"""_run_init writes the correct agent file for every supported agent."""
monkeypatch.chdir(tmp_path)
_run_init()
dest = tmp_path / _CLAUDE_FILE_PATH
_run_init(agent=agent)
dest = tmp_path / _agent_path(agent)
expected = files("semble").joinpath(f"agents/{agent.value}.md").read_text(encoding="utf-8")
assert dest.exists()
assert dest.read_text(encoding="utf-8") == _CLAUDE_AGENT_FILE
assert str(_CLAUDE_FILE_PATH) in capsys.readouterr().out
assert dest.read_text(encoding="utf-8") == expected
assert str(_agent_path(agent)) in capsys.readouterr().out


def test_init_refuses_overwrite_without_force(
Expand All @@ -122,7 +124,7 @@ def test_init_overwrites_with_force(tmp_path: Path, monkeypatch: pytest.MonkeyPa
dest.parent.mkdir(parents=True, exist_ok=True)
dest.write_text("old content", encoding="utf-8")
_run_init(force=True)
assert dest.read_text(encoding="utf-8") == _CLAUDE_AGENT_FILE
assert dest.read_text(encoding="utf-8") == files("semble").joinpath("agents/claude.md").read_text(encoding="utf-8")


def test_init_via_cli(tmp_path: Path, monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]) -> None:
Expand Down Expand Up @@ -195,7 +197,7 @@ def test_mcp_main_exits_with_message_when_extras_missing(

def test_agent_file_tools_are_bash_only() -> None:
"""The agent file must list only Bash and Read — no MCP tools that require schema loading."""
frontmatter = _CLAUDE_AGENT_FILE.split("---")[1]
frontmatter = files("semble").joinpath("agents/claude.md").read_text(encoding="utf-8").split("---")[1]
tools_line = next(line for line in frontmatter.splitlines() if line.startswith("tools:"))
tools = [t.strip() for t in tools_line.removeprefix("tools:").split(",")]
assert set(tools) == {"Bash", "Read"}, f"Unexpected tools in agent file: {tools}"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading