Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

Detect marketplace-installed pair skills (#10385)

Trevor Manz630fd2866f5d
diff --git a/marimo/_cli/pair/commands.py b/marimo/_cli/pair/commands.py
index fe468b9972..59f84b0aaa 100644
--- a/marimo/_cli/pair/commands.py
+++ b/marimo/_cli/pair/commands.py
@@ -41,12 +41,41 @@ class AgentConfig:
def _claude_skill_dirs() -> list[Path]:
"""Return all directories where a Claude Code skill may be installed.
- Skills can live under skills/, plugins/, or plugins/marketplaces/ in
- both the global (~/.claude) and local (.claude) config directories.
+ Skills can be installed directly or bundled in a marketplace plugin in
+ both the global (`~/.claude`) and local (`.claude`) config directories.
"""
roots = [Path.home() / ".claude", Path.cwd() / ".claude"]
subdirs = ["skills", "plugins", str(Path("plugins") / "marketplaces")]
- return [root / sub for root in roots for sub in subdirs]
+ return [
+ *[root / sub for root in roots for sub in subdirs],
+ *[
+ skill_dir
+ for root in roots
+ for skill_dir in _plugin_skill_dirs(root)
+ ],
+ ]
+
+
+def _plugin_skill_dirs(root: Path) -> list[Path]:
+ """Return skill directories from marketplace and cached plugins."""
+ plugins = root / "plugins"
+ return [
+ *plugins.glob("marketplaces/*/skills"),
+ *plugins.glob(f"cache/*/{SKILL_NAME}/*/skills"),
+ ]
+
+
+def _codex_skill_dirs() -> list[Path]:
+ """Return directories where a Codex skill may be installed."""
+ roots = [Path.home() / ".codex", Path.cwd() / ".codex"]
+ return [
+ *[root / "skills" for root in roots],
+ *[
+ skill_dir
+ for root in roots
+ for skill_dir in _plugin_skill_dirs(root)
+ ],
+ ]
def _opencode_skill_dirs() -> list[Path]:
@@ -76,8 +105,6 @@ def _opencode_skill_dirs() -> list[Path]:
def pair_agents() -> dict[str, AgentConfig]:
"""Return agent configs; paths use `Path.cwd()` at call time."""
- cwd = Path.cwd()
- home = Path.home()
return {
"claude": AgentConfig(
name="Claude Code",
@@ -85,10 +112,7 @@ def pair_agents() -> dict[str, AgentConfig]:
),
"codex": AgentConfig(
name="Codex",
- skill_dirs=[
- home / ".codex" / "skills",
- cwd / ".codex" / "skills",
- ],
+ skill_dirs=_codex_skill_dirs(),
),
"opencode": AgentConfig(
name="opencode",
diff --git a/tests/_cli/test_cli_pair.py b/tests/_cli/test_cli_pair.py
index e0be29de42..e5354c9f05 100644
--- a/tests/_cli/test_cli_pair.py
+++ b/tests/_cli/test_cli_pair.py
@@ -9,7 +9,12 @@ from unittest.mock import patch
from click.testing import CliRunner
from marimo._cli.cli import main as cli_main
-from marimo._cli.pair.commands import AgentConfig, _opencode_skill_dirs
+from marimo._cli.pair.commands import (
+ AgentConfig,
+ _opencode_skill_dirs,
+ _plugin_skill_dirs,
+ pair_agents,
+)
_runner = CliRunner()
@@ -296,3 +301,72 @@ class TestAgentConfig:
agent = AgentConfig(name="test", skill_dirs=[dir1, dir2])
assert agent.has_skill() is True
+
+
+class TestPluginSkillDirs:
+ def test_pair_agents_discovers_plugin_skills(self, tmp_path: Path) -> None:
+ claude_skill_dir = (
+ tmp_path
+ / ".claude"
+ / "plugins"
+ / "marketplaces"
+ / "marimo-pair"
+ / "skills"
+ / "marimo-pair"
+ )
+ codex_skill_dir = (
+ tmp_path
+ / ".codex"
+ / "plugins"
+ / "cache"
+ / "marimo-pair"
+ / "marimo-pair"
+ / "0.0.18"
+ / "skills"
+ / "marimo-pair"
+ )
+ claude_skill_dir.mkdir(parents=True)
+ codex_skill_dir.mkdir(parents=True)
+ (claude_skill_dir / "SKILL.md").write_text("test")
+ (codex_skill_dir / "SKILL.md").write_text("test")
+
+ with (
+ patch.object(Path, "home", return_value=tmp_path),
+ patch.object(Path, "cwd", return_value=tmp_path),
+ ):
+ agents = pair_agents()
+
+ assert agents["claude"].has_skill() is True
+ assert agents["codex"].has_skill() is True
+
+ def test_claude_marketplace_layout(self, tmp_path: Path) -> None:
+ skill_dir = (
+ tmp_path / "plugins" / "marketplaces" / "marimo-pair" / "skills"
+ )
+ (skill_dir / "marimo-pair").mkdir(parents=True)
+ (skill_dir / "marimo-pair" / "SKILL.md").write_text("test")
+
+ agent = AgentConfig(
+ name="Claude Code",
+ skill_dirs=_plugin_skill_dirs(tmp_path),
+ )
+ assert agent.has_skill() is True
+
+ def test_plugin_cache_layout(self, tmp_path: Path) -> None:
+ skill_dir = (
+ tmp_path
+ / "plugins"
+ / "cache"
+ / "marimo-pair"
+ / "marimo-pair"
+ / "0.0.18"
+ / "skills"
+ )
+ (skill_dir / "marimo-pair").mkdir(parents=True)
+ (skill_dir / "marimo-pair" / "SKILL.md").write_text("test")
+
+ agent = AgentConfig(
+ name="Codex",
+ skill_dirs=_plugin_skill_dirs(tmp_path),
+ )
+ assert agent.has_skill() is True