robotframework-plugins 2026.11.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- robotframework_plugins/__init__.py +14 -0
- robotframework_plugins/_assets/catalog.json +143 -0
- robotframework_plugins/_assets/plugins/rf-agentskills/.claude-plugin/plugin.json +25 -0
- robotframework_plugins/_assets/plugins/rf-agentskills/CHANGELOG.md +198 -0
- robotframework_plugins/_assets/plugins/rf-agentskills/README.md +27 -0
- robotframework_plugins/_assets/plugins/rf-agentskills/catalog.yaml +25 -0
- robotframework_plugins/_assets/plugins/rf-api/.claude-plugin/plugin.json +25 -0
- robotframework_plugins/_assets/plugins/rf-api/CHANGELOG.md +9 -0
- robotframework_plugins/_assets/plugins/rf-api/README.md +27 -0
- robotframework_plugins/_assets/plugins/rf-api/catalog.yaml +27 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/SKILL.md +113 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/authentication-patterns.robot +39 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/basic-crud.robot +46 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/file-upload.robot +28 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/session-handling.robot +48 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/async-jobs.md +42 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/authentication.md +58 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/install.md +10 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/loose-assertions.md +20 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/request-options.md +90 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/response-validation.md +64 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/troubleshooting.md +64 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/SKILL.md +120 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/assets/examples/basic-rest.robot +51 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/assets/examples/schema-validation.robot +38 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/assets/examples/schemas/user.json +10 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/authentication.md +61 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/install.md +11 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/json-handling.md +89 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/loose-assertions.md +18 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/migrate-from-requests.md +15 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/schema-validation.md +85 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/troubleshooting.md +68 -0
- robotframework_plugins/_assets/plugins/rf-core/.claude-plugin/plugin.json +19 -0
- robotframework_plugins/_assets/plugins/rf-core/CHANGELOG.md +13 -0
- robotframework_plugins/_assets/plugins/rf-core/README.md +38 -0
- robotframework_plugins/_assets/plugins/rf-core/agents/rf-debug-expert.md +120 -0
- robotframework_plugins/_assets/plugins/rf-core/agents/rf-migration-guide.md +73 -0
- robotframework_plugins/_assets/plugins/rf-core/agents/rf-test-architect.md +98 -0
- robotframework_plugins/_assets/plugins/rf-core/catalog.yaml +19 -0
- robotframework_plugins/_assets/plugins/rf-core/hooks/README.md +445 -0
- robotframework_plugins/_assets/plugins/rf-core/hooks/hooks.json +70 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/_hook_input.mjs +101 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/_pending_errors.mjs +65 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/_python_env.mjs +181 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/check_rf_environment.mjs +181 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/maybe_inject_rf_context.mjs +74 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/maybe_remind_robot_tests.mjs +128 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/report_pending_errors.mjs +72 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/rf_error_hints.mjs +126 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/validate_robot.mjs +517 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/validate_robot_project.mjs +103 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/SKILL.md +313 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/api.resource +30 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/calc.resource +23 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/embedded.resource +20 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/keywords.resource +26 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/login.resource +10 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/01__keyword_driven.robot +15 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/02__data_driven.robot +10 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/03__templates.robot +17 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/04__bdd.robot +10 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/05__embedded.robot +13 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/__init__.robot +6 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/api/__init__.robot +7 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/api/users.robot +18 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/env.robot +15 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/variables/common.py +11 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/variables/dev.yaml +3 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/variables/staging.yaml +3 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/arguments.md +139 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/control-structures.md +175 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/embedded-arguments.md +135 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/migration.md +90 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/resources-and-variable-files.md +127 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/styles.md +92 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/suites-and-init.md +96 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/tags-and-selection.md +104 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/templates.md +124 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/variables-and-scopes.md +129 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/scripts/rf_conventions.py +883 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/SKILL.md +216 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/ExampleLibrary.py +61 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/ResultListener.py +60 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/converters.py +48 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/converters.robot +20 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/example_library.robot +31 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/listener.robot +12 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/api-variants.md +291 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/communication.md +248 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/conversion.md +347 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/listeners.md +150 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/packaging-and-docs.md +155 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/scripts/check_library.py +842 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/SKILL.md +159 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/github-actions-robot.yml +32 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/gitignore.txt +22 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/pyproject.poetry.toml +28 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/pyproject.uv.toml +20 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/requirements.txt +9 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/robot.toml +16 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/smoke.robot +22 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/ci.md +61 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/cli-tools.md +33 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/libraries.md +47 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/poetry.md +77 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/project-layout.md +86 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/troubleshooting.md +73 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/uv.md +108 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/venv-pip.md +71 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/codex/agents/rf-debug-expert.toml +119 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/codex/agents/rf-migration-guide.toml +72 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/codex/agents/rf-test-architect.toml +97 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/opencode/agents/rf-debug-expert.md +123 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/opencode/agents/rf-migration-guide.md +76 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/opencode/agents/rf-test-architect.md +101 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/opencode/plugins/rf-core.js +93 -0
- robotframework_plugins/_assets/plugins/rf-desktop/.claude-plugin/plugin.json +24 -0
- robotframework_plugins/_assets/plugins/rf-desktop/CHANGELOG.md +10 -0
- robotframework_plugins/_assets/plugins/rf-desktop/README.md +26 -0
- robotframework_plugins/_assets/plugins/rf-desktop/catalog.yaml +23 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/SKILL.md +268 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/assets/examples/calculator.robot +45 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/assets/examples/mock-deterministic.robot +33 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/cli-and-inspector.md +82 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/install.md +14 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/keywords-reference.md +102 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/locators-and-queries.md +95 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/platform-setup.md +65 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/status-and-migration.md +41 -0
- robotframework_plugins/_assets/plugins/rf-mobile/.claude-plugin/plugin.json +24 -0
- robotframework_plugins/_assets/plugins/rf-mobile/CHANGELOG.md +9 -0
- robotframework_plugins/_assets/plugins/rf-mobile/README.md +26 -0
- robotframework_plugins/_assets/plugins/rf-mobile/catalog.yaml +23 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/SKILL.md +134 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/android-basic.robot +60 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/gestures-example.robot +59 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/hybrid-app.robot +54 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/ios-basic.robot +48 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/capabilities.md +117 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/gestures-touch.md +84 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/install.md +21 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/locators-mobile.md +74 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/platform-specific.md +105 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/troubleshooting.md +70 -0
- robotframework_plugins/_assets/plugins/rf-web/.claude-plugin/plugin.json +25 -0
- robotframework_plugins/_assets/plugins/rf-web/CHANGELOG.md +9 -0
- robotframework_plugins/_assets/plugins/rf-web/README.md +27 -0
- robotframework_plugins/_assets/plugins/rf-web/catalog.yaml +27 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/SKILL.md +134 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/authentication-flow.robot +34 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/basic-web-test.robot +29 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/form-handling.robot +49 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/iframe-shadow-dom.robot +31 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/assertion-engine.md +79 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/authentication-storage.md +86 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/browser-context-page.md +110 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/downloads-uploads.md +51 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/iframes-shadow-dom.md +67 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/install.md +67 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/locators.md +83 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/migrate-from-selenium.md +22 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/selector-drift.md +29 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/troubleshooting.md +100 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/SKILL.md +123 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/assets/examples/basic-web-test.robot +64 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/assets/examples/multi-window.robot +55 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/assets/examples/wait-patterns.robot +53 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/browser-setup.md +103 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/frames-windows.md +84 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/install.md +12 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/javascript-execution.md +65 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/locators.md +86 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/troubleshooting.md +122 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/waiting-strategies.md +84 -0
- robotframework_plugins/_assets.py +120 -0
- robotframework_plugins/_catalog.py +123 -0
- robotframework_plugins/_snapshot.py +320 -0
- robotframework_plugins/adapters/__init__.py +53 -0
- robotframework_plugins/adapters/_base.py +400 -0
- robotframework_plugins/adapters/claude_code.py +312 -0
- robotframework_plugins/adapters/claude_desktop.py +129 -0
- robotframework_plugins/adapters/codex.py +276 -0
- robotframework_plugins/adapters/copilot.py +87 -0
- robotframework_plugins/adapters/cursor.py +295 -0
- robotframework_plugins/adapters/goose.py +240 -0
- robotframework_plugins/adapters/opencode.py +170 -0
- robotframework_plugins/bundle.py +85 -0
- robotframework_plugins/cli.py +1311 -0
- robotframework_plugins/detect.py +121 -0
- robotframework_plugins/manifest.py +338 -0
- robotframework_plugins/py.typed +0 -0
- robotframework_plugins/skillzip.py +39 -0
- robotframework_plugins/transforms.py +725 -0
- robotframework_plugins-2026.11.0.dist-info/METADATA +198 -0
- robotframework_plugins-2026.11.0.dist-info/RECORD +199 -0
- robotframework_plugins-2026.11.0.dist-info/WHEEL +4 -0
- robotframework_plugins-2026.11.0.dist-info/entry_points.txt +2 -0
- robotframework_plugins-2026.11.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
"""Adapter for Claude Code (CLI ≥ 2.1).
|
|
2
|
+
|
|
3
|
+
Native install. We drop the bundled tree directly into the layouts
|
|
4
|
+
Claude Code reads:
|
|
5
|
+
|
|
6
|
+
* skills → ``~/.claude/skills/<name>/`` (or project ``.claude/skills/``)
|
|
7
|
+
* agents → ``~/.claude/agents/<name>.md`` (or project)
|
|
8
|
+
* hooks → ``hooks`` block of ``~/.claude/settings.json``
|
|
9
|
+
(or project ``.claude/settings.json``)
|
|
10
|
+
|
|
11
|
+
Plus a co-located copy of the plugin's ``scripts/`` (hook scripts) and
|
|
12
|
+
the skills' scripts under ``~/.claude/<plugin>-files/`` so
|
|
13
|
+
``${CLAUDE_PLUGIN_ROOT}`` references in hook commands resolve to a stable,
|
|
14
|
+
post-substitution path (the Stop hook runs ``skills/rf-results/scripts``).
|
|
15
|
+
|
|
16
|
+
Substitution happens *at install time*, per the proposal's
|
|
17
|
+
decision-point #2: the ``${CLAUDE_PLUGIN_ROOT}`` token is rewritten to
|
|
18
|
+
the absolute path of the staged copy, so the resulting files are
|
|
19
|
+
self-contained and don't require the env var to be set at runtime.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
import json
|
|
25
|
+
import shutil
|
|
26
|
+
import sys
|
|
27
|
+
from dataclasses import dataclass
|
|
28
|
+
from pathlib import Path
|
|
29
|
+
from typing import Iterable
|
|
30
|
+
|
|
31
|
+
from .. import _assets
|
|
32
|
+
from .. import transforms as _x
|
|
33
|
+
from ._base import (
|
|
34
|
+
needs_support_dir,
|
|
35
|
+
legacy_markers,
|
|
36
|
+
plugin_id,
|
|
37
|
+
AdapterBase,
|
|
38
|
+
ConfigMergeOp,
|
|
39
|
+
InstallOptions,
|
|
40
|
+
InstallPlan,
|
|
41
|
+
InstallTarget,
|
|
42
|
+
marketplace_settings_merges,
|
|
43
|
+
upgrade_plugins,
|
|
44
|
+
old_marketplace_note,
|
|
45
|
+
skill_script_files,
|
|
46
|
+
support_dir_name,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
HOOKS_KEY = "hooks"
|
|
51
|
+
SETTINGS_HOOKS_KEYS = ("PostToolUse", "UserPromptSubmit", "SessionStart", "Stop")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@dataclass
|
|
55
|
+
class ClaudeCodeAdapter(AdapterBase):
|
|
56
|
+
name: str = "claude-code"
|
|
57
|
+
pretty: str = "Claude Code"
|
|
58
|
+
user_root_subpath: tuple[str, ...] = (".claude",)
|
|
59
|
+
project_root_subpath: tuple[str, ...] = (".claude",)
|
|
60
|
+
# Claude Code substitutes ${CLAUDE_SKILL_DIR} in personal/project skills.
|
|
61
|
+
expands_skill_dir: bool = True
|
|
62
|
+
|
|
63
|
+
# ------------------------------------------------------------------
|
|
64
|
+
# detect
|
|
65
|
+
# ------------------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
def detect(self) -> bool:
|
|
68
|
+
"""True if either the CLI is on PATH or the user has a ``~/.claude``."""
|
|
69
|
+
if shutil.which("claude") is not None:
|
|
70
|
+
return True
|
|
71
|
+
return (Path.home() / ".claude").is_dir()
|
|
72
|
+
|
|
73
|
+
# ------------------------------------------------------------------
|
|
74
|
+
# plan
|
|
75
|
+
# ------------------------------------------------------------------
|
|
76
|
+
|
|
77
|
+
def plan(self, opts: InstallOptions) -> InstallPlan:
|
|
78
|
+
root = self.install_root(opts)
|
|
79
|
+
plugin_dst = root / support_dir_name(opts.plugin) # holds scripts/, hooks/, skills/*/scripts
|
|
80
|
+
plugin_root_abs = _x.to_native_path_string(plugin_dst.resolve())
|
|
81
|
+
|
|
82
|
+
# Hooks invoke `node "<…>.mjs"` (cross-platform). If Node isn't
|
|
83
|
+
# on PATH at install time we skip the hooks merge and surface a
|
|
84
|
+
# post_install note rather than write a settings.json that
|
|
85
|
+
# references an unrunnable command.
|
|
86
|
+
register_hooks = "hooks" in opts.what and _x.node_available()
|
|
87
|
+
|
|
88
|
+
with _assets.asset_root_path(opts.plugin) as src_root:
|
|
89
|
+
targets = list(self._collect_targets(
|
|
90
|
+
src_root=src_root,
|
|
91
|
+
root=root,
|
|
92
|
+
plugin_dst=plugin_dst,
|
|
93
|
+
plugin_root_abs=plugin_root_abs,
|
|
94
|
+
what=opts.what,
|
|
95
|
+
))
|
|
96
|
+
merges = list(self._collect_merges(
|
|
97
|
+
src_root=src_root,
|
|
98
|
+
root=root,
|
|
99
|
+
plugin_root_abs=plugin_root_abs,
|
|
100
|
+
what=opts.what,
|
|
101
|
+
opts=opts,
|
|
102
|
+
register_hooks=register_hooks,
|
|
103
|
+
))
|
|
104
|
+
|
|
105
|
+
notes: list[str] = []
|
|
106
|
+
if "hooks" in opts.what and not register_hooks:
|
|
107
|
+
notes.append(
|
|
108
|
+
"Node.js was not found on PATH; the hooks block was NOT written. "
|
|
109
|
+
"Install Node.js (e.g. `winget install OpenJS.NodeJS` on Windows, "
|
|
110
|
+
"`brew install node` on macOS, your distro's package manager on "
|
|
111
|
+
"Linux), then re-run `robotframework-plugins install --agent claude-code` "
|
|
112
|
+
"to enable the SessionStart / UserPromptSubmit / PostToolUse / Stop "
|
|
113
|
+
"hooks. Skills and subagents are installed normally."
|
|
114
|
+
)
|
|
115
|
+
return InstallPlan(targets=tuple(targets), merges=tuple(merges), notes=tuple(notes))
|
|
116
|
+
|
|
117
|
+
def plugin_plan(self, opts: InstallOptions) -> InstallPlan | None:
|
|
118
|
+
"""Point Claude Code at the marketplace via ``settings.json``.
|
|
119
|
+
|
|
120
|
+
Project scope writes the committed ``.claude/settings.json``: Claude Code
|
|
121
|
+
enables the plugin, Copilot CLI loads it and VS Code recommends it;
|
|
122
|
+
Cursor imports it once the plugin is installed in Claude Code.
|
|
123
|
+
"""
|
|
124
|
+
settings = self.install_root(opts) / "settings.json"
|
|
125
|
+
scope = "project" if opts.scope == "project" and opts.prefix is None else "user"
|
|
126
|
+
plugins = upgrade_plugins(settings, opts)
|
|
127
|
+
ids = [plugin_id(p) for p in plugins]
|
|
128
|
+
notes = [
|
|
129
|
+
f"{settings} now registers the robotframework-plugins marketplace and "
|
|
130
|
+
f"enables {', '.join(ids)}.",
|
|
131
|
+
"Claude Code: each collaborator installs it once with "
|
|
132
|
+
+ " ".join(f"`claude plugin install {i} --scope {scope}`" for i in ids) + " (Claude Code also "
|
|
133
|
+
"offers it when the marketplace is first trusted).",
|
|
134
|
+
]
|
|
135
|
+
if scope == "project":
|
|
136
|
+
notes.append(
|
|
137
|
+
"Commit .claude/settings.json. Copilot CLI loads the plugin from it in a "
|
|
138
|
+
"trusted folder; VS Code shows it as a workspace recommendation."
|
|
139
|
+
)
|
|
140
|
+
migrated = old_marketplace_note(settings)
|
|
141
|
+
if migrated:
|
|
142
|
+
notes.append(migrated)
|
|
143
|
+
return InstallPlan(merges=tuple(marketplace_settings_merges(settings, opts.ref, plugins)),
|
|
144
|
+
notes=tuple(notes))
|
|
145
|
+
|
|
146
|
+
def _collect_targets(
|
|
147
|
+
self,
|
|
148
|
+
*,
|
|
149
|
+
src_root: Path,
|
|
150
|
+
root: Path,
|
|
151
|
+
plugin_dst: Path,
|
|
152
|
+
plugin_root_abs: str,
|
|
153
|
+
what: frozenset[str],
|
|
154
|
+
) -> Iterable[InstallTarget]:
|
|
155
|
+
# 1. Skills — ~/.claude/skills/<name>/SKILL.md (+ subtree)
|
|
156
|
+
if "skills" in what:
|
|
157
|
+
skill_src = src_root / "skills"
|
|
158
|
+
if skill_src.is_dir():
|
|
159
|
+
for f in sorted(skill_src.rglob("*")):
|
|
160
|
+
if not f.is_file():
|
|
161
|
+
continue
|
|
162
|
+
rel = f.relative_to(src_root)
|
|
163
|
+
yield InstallTarget(
|
|
164
|
+
dst=root / rel,
|
|
165
|
+
payload=self.render_skill_dir(
|
|
166
|
+
self._read_with_substitution(f, plugin_root_abs),
|
|
167
|
+
f, root / "skills" / rel.parts[1],
|
|
168
|
+
),
|
|
169
|
+
transform_name="plugin_root_substitution",
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
# 2. Subagents — ~/.claude/agents/<name>.md
|
|
173
|
+
if "agents" in what:
|
|
174
|
+
agents_src = src_root / "agents"
|
|
175
|
+
if agents_src.is_dir():
|
|
176
|
+
for f in sorted(agents_src.glob("*.md")):
|
|
177
|
+
yield InstallTarget(
|
|
178
|
+
dst=root / "agents" / f.name,
|
|
179
|
+
payload=self._read_with_substitution(f, plugin_root_abs),
|
|
180
|
+
transform_name="plugin_root_substitution",
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
# 3. Plugin-co-located files: scripts/, hooks/, plus
|
|
184
|
+
# the .claude-plugin/ manifest. These live under
|
|
185
|
+
# <root>/<plugin>-files/ so the substituted
|
|
186
|
+
# ${CLAUDE_PLUGIN_ROOT} paths in skills/agents/hooks resolve.
|
|
187
|
+
#
|
|
188
|
+
# Staging the .claude-plugin/plugin.json manifest makes the
|
|
189
|
+
# resulting tree a valid Claude Code plugin: `claude plugin
|
|
190
|
+
# validate <plugin_dst>` succeeds, and a sufficiently bold
|
|
191
|
+
# user could `claude plugin install <local-path>` against
|
|
192
|
+
# it as an alternative entry point.
|
|
193
|
+
if {"hooks", "skills"} & what and needs_support_dir(src_root):
|
|
194
|
+
for category in ("scripts", "hooks", ".claude-plugin"):
|
|
195
|
+
cat_src = src_root / category
|
|
196
|
+
if not cat_src.is_dir():
|
|
197
|
+
continue
|
|
198
|
+
for f in sorted(cat_src.rglob("*")):
|
|
199
|
+
if not f.is_file():
|
|
200
|
+
continue
|
|
201
|
+
rel = f.relative_to(src_root)
|
|
202
|
+
yield InstallTarget(
|
|
203
|
+
dst=plugin_dst / rel,
|
|
204
|
+
payload=self._read_with_substitution(f, plugin_root_abs),
|
|
205
|
+
transform_name="plugin_root_substitution",
|
|
206
|
+
executable=f.suffix in (".sh", ".ps1") or f.name.endswith(".bash"),
|
|
207
|
+
)
|
|
208
|
+
# Per-skill scripts for the hooks (<plugin_dst>/skills/<skill>/scripts/;
|
|
209
|
+
# the Stop hook runs skills/rf-results/scripts/rf_results.py).
|
|
210
|
+
for f in skill_script_files(src_root):
|
|
211
|
+
rel = f.relative_to(src_root)
|
|
212
|
+
yield InstallTarget(
|
|
213
|
+
dst=plugin_dst / rel,
|
|
214
|
+
payload=f.read_bytes(),
|
|
215
|
+
transform_name="skill_script_for_hooks",
|
|
216
|
+
)
|
|
217
|
+
# Pin the install-time Python interpreter so hook .mjs scripts
|
|
218
|
+
# use the env that has robotframework, not whatever `python` is
|
|
219
|
+
# on PATH (matters for pipx / uv tool install / venv installs).
|
|
220
|
+
yield InstallTarget(
|
|
221
|
+
dst=plugin_dst / "scripts" / "python_runtime.json",
|
|
222
|
+
payload=_x.python_runtime_config_bytes(),
|
|
223
|
+
transform_name="python_runtime_pin",
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
def _collect_merges(
|
|
227
|
+
self,
|
|
228
|
+
*,
|
|
229
|
+
src_root: Path,
|
|
230
|
+
root: Path,
|
|
231
|
+
plugin_root_abs: str,
|
|
232
|
+
what: frozenset[str],
|
|
233
|
+
opts: InstallOptions,
|
|
234
|
+
register_hooks: bool = True,
|
|
235
|
+
) -> Iterable[ConfigMergeOp]:
|
|
236
|
+
# 4. Hooks → settings.json hooks block. Skipped when Node isn't
|
|
237
|
+
# on PATH at install time (caller passes register_hooks=False).
|
|
238
|
+
if register_hooks:
|
|
239
|
+
hooks_json_src = src_root / "hooks" / "hooks.json"
|
|
240
|
+
if hooks_json_src.is_file():
|
|
241
|
+
yield self._hooks_merge_op(
|
|
242
|
+
hooks_json_src=hooks_json_src,
|
|
243
|
+
settings_path=root / "settings.json",
|
|
244
|
+
plugin_root_abs=plugin_root_abs,
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
# ------------------------------------------------------------------
|
|
248
|
+
# post_install
|
|
249
|
+
# ------------------------------------------------------------------
|
|
250
|
+
|
|
251
|
+
def post_install(self, opts: InstallOptions) -> list[str]:
|
|
252
|
+
return [
|
|
253
|
+
"Claude Code will pick up skills, agents, and hooks on next session start.",
|
|
254
|
+
]
|
|
255
|
+
|
|
256
|
+
# ------------------------------------------------------------------
|
|
257
|
+
# internals
|
|
258
|
+
# ------------------------------------------------------------------
|
|
259
|
+
|
|
260
|
+
@staticmethod
|
|
261
|
+
def _read_with_substitution(src: Path, plugin_root_abs: str) -> bytes:
|
|
262
|
+
"""Read ``src`` and substitute ``${CLAUDE_PLUGIN_ROOT}``.
|
|
263
|
+
|
|
264
|
+
Files we don't recognise as text (binaries) are passed through.
|
|
265
|
+
"""
|
|
266
|
+
data = src.read_bytes()
|
|
267
|
+
if _x.is_substitution_candidate(src):
|
|
268
|
+
return _x.substitute_plugin_root_bytes(data, plugin_root_abs)
|
|
269
|
+
return data
|
|
270
|
+
|
|
271
|
+
def _hooks_merge_op(
|
|
272
|
+
self,
|
|
273
|
+
*,
|
|
274
|
+
hooks_json_src: Path,
|
|
275
|
+
settings_path: Path,
|
|
276
|
+
plugin_root_abs: str,
|
|
277
|
+
) -> ConfigMergeOp:
|
|
278
|
+
raw = _x.substitute_plugin_root(
|
|
279
|
+
hooks_json_src.read_text(encoding="utf-8"),
|
|
280
|
+
plugin_root_abs,
|
|
281
|
+
)
|
|
282
|
+
hooks_obj = json.loads(raw)
|
|
283
|
+
hooks_value = hooks_obj.get(HOOKS_KEY, hooks_obj)
|
|
284
|
+
# No per-OS rewrite needed: every hook command invokes Node
|
|
285
|
+
# (e.g. ``node "<…>.mjs"``), and Node is cross-platform. The
|
|
286
|
+
# previous v0.4.1 ``.sh→.ps1`` rewrite was the source of the
|
|
287
|
+
# broken Windows install — see docs/archive/issues/.
|
|
288
|
+
|
|
289
|
+
# Ownership marker: every rf-agentskills hook command references
|
|
290
|
+
# this install dir, so it uniquely identifies the groups we add.
|
|
291
|
+
marker = plugin_root_abs
|
|
292
|
+
|
|
293
|
+
def apply() -> list[str]:
|
|
294
|
+
# Granular, ownership-aware: append our matcher-groups per
|
|
295
|
+
# event without clobbering hooks added by the user or other
|
|
296
|
+
# tools (the old whole-`hooks`-key replace destroyed them).
|
|
297
|
+
return _x.merge_hooks_block(settings_path, hooks_value, marker=marker, legacy_markers=legacy_markers(plugin_root_abs))
|
|
298
|
+
|
|
299
|
+
def revert() -> None:
|
|
300
|
+
_x.remove_owned_hook_entries(
|
|
301
|
+
settings_path, marker=marker, events=list(hooks_value)
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
return ConfigMergeOp(
|
|
305
|
+
path=settings_path,
|
|
306
|
+
description=f"merge hooks block into {settings_path}",
|
|
307
|
+
apply=apply,
|
|
308
|
+
revert=revert,
|
|
309
|
+
kind="json_hooks",
|
|
310
|
+
key_path=(HOOKS_KEY,),
|
|
311
|
+
marker=marker,
|
|
312
|
+
)
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"""Adapter for Claude Desktop (macOS / Windows / unofficial Linux).
|
|
2
|
+
|
|
3
|
+
Claude Desktop (like claude.ai) loads custom Agent Skills that the user
|
|
4
|
+
uploads as one ZIP per skill under **Customize → Skills → + → Create skill
|
|
5
|
+
→ Upload a skill** (code execution must be enabled). Skills are stored
|
|
6
|
+
server-side with the account, so there is no folder to install into and no
|
|
7
|
+
config to merge. This adapter therefore writes upload-ready archives:
|
|
8
|
+
|
|
9
|
+
* ``<root>/<skill>.zip`` — one per skill, the skill folder at the archive
|
|
10
|
+
root (``rf-browser/SKILL.md``, ``rf-browser/references/…``), built by
|
|
11
|
+
:func:`skillzip.skill_zip_bytes`.
|
|
12
|
+
|
|
13
|
+
``<root>`` is ``~/rf-agentskills-claude-desktop/`` (or ``--prefix``).
|
|
14
|
+
Subagents and hooks have no Claude Desktop equivalent and are skipped with
|
|
15
|
+
notes. Installs made before content 2.0.0 merged an ``rf-tools`` MCP server
|
|
16
|
+
into ``claude_desktop_config.json``; re-installing removes it (see
|
|
17
|
+
``cli._retire_legacy_mcp``).
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
import os
|
|
23
|
+
import sys
|
|
24
|
+
from dataclasses import dataclass
|
|
25
|
+
from pathlib import Path
|
|
26
|
+
|
|
27
|
+
from .. import _assets
|
|
28
|
+
from ..skillzip import skill_zip_bytes
|
|
29
|
+
from ._base import AdapterBase, InstallOptions, InstallPlan, InstallTarget
|
|
30
|
+
|
|
31
|
+
CONFIG_FILENAME = "claude_desktop_config.json"
|
|
32
|
+
ZIP_DIR_NAME = "rf-agentskills-claude-desktop"
|
|
33
|
+
UPLOAD_PATH = "Customize → Skills → + → Create skill → Upload a skill"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@dataclass
|
|
37
|
+
class ClaudeDesktopAdapter(AdapterBase):
|
|
38
|
+
name: str = "claude-desktop"
|
|
39
|
+
pretty: str = "Claude Desktop"
|
|
40
|
+
user_root_subpath: tuple[str, ...] = ()
|
|
41
|
+
project_root_subpath: tuple[str, ...] = ()
|
|
42
|
+
|
|
43
|
+
# ------------------------------------------------------------------
|
|
44
|
+
# detect / paths
|
|
45
|
+
# ------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
def detect(self) -> bool:
|
|
48
|
+
return self._config_path().parent.is_dir()
|
|
49
|
+
|
|
50
|
+
@staticmethod
|
|
51
|
+
def _config_path() -> Path:
|
|
52
|
+
"""Per-OS path to ``claude_desktop_config.json`` (used for detection)."""
|
|
53
|
+
if sys.platform == "darwin":
|
|
54
|
+
return (
|
|
55
|
+
Path.home()
|
|
56
|
+
/ "Library"
|
|
57
|
+
/ "Application Support"
|
|
58
|
+
/ "Claude"
|
|
59
|
+
/ CONFIG_FILENAME
|
|
60
|
+
)
|
|
61
|
+
if sys.platform == "win32":
|
|
62
|
+
base = Path(
|
|
63
|
+
os.environ.get("APPDATA", str(Path.home() / "AppData" / "Roaming"))
|
|
64
|
+
)
|
|
65
|
+
return base / "Claude" / CONFIG_FILENAME
|
|
66
|
+
# Linux fallback (Claude Desktop is unofficial here)
|
|
67
|
+
return Path.home() / ".config" / "Claude" / CONFIG_FILENAME
|
|
68
|
+
|
|
69
|
+
def install_root(self, opts: InstallOptions) -> Path:
|
|
70
|
+
"""Folder for the upload archives: ``--prefix`` or ``~/rf-agentskills-claude-desktop``.
|
|
71
|
+
|
|
72
|
+
Skills live with the Claude account, not in a project, so the
|
|
73
|
+
scope does not change the location.
|
|
74
|
+
"""
|
|
75
|
+
if opts.prefix is not None:
|
|
76
|
+
return opts.prefix
|
|
77
|
+
return Path.home() / ZIP_DIR_NAME
|
|
78
|
+
|
|
79
|
+
# ------------------------------------------------------------------
|
|
80
|
+
# plan
|
|
81
|
+
# ------------------------------------------------------------------
|
|
82
|
+
|
|
83
|
+
def plan(self, opts: InstallOptions) -> InstallPlan:
|
|
84
|
+
root = self.install_root(opts)
|
|
85
|
+
targets: list[InstallTarget] = []
|
|
86
|
+
notes: list[str] = []
|
|
87
|
+
|
|
88
|
+
if "skills" in opts.what:
|
|
89
|
+
with _assets.asset_root_path(opts.plugin) as src_root:
|
|
90
|
+
skills_src = src_root / "skills"
|
|
91
|
+
for skill_dir in sorted(p for p in skills_src.iterdir() if p.is_dir()):
|
|
92
|
+
if not (skill_dir / "SKILL.md").is_file():
|
|
93
|
+
continue
|
|
94
|
+
targets.append(InstallTarget(
|
|
95
|
+
dst=root / f"{skill_dir.name}.zip",
|
|
96
|
+
payload=skill_zip_bytes(skill_dir),
|
|
97
|
+
transform_name="skill_upload_zip",
|
|
98
|
+
))
|
|
99
|
+
|
|
100
|
+
if "agents" in opts.what:
|
|
101
|
+
notes.append(
|
|
102
|
+
"Claude Desktop has no subagent system — subagents not installed."
|
|
103
|
+
)
|
|
104
|
+
if "hooks" in opts.what:
|
|
105
|
+
notes.append(
|
|
106
|
+
"Claude Desktop has no hook system — hooks not installed."
|
|
107
|
+
)
|
|
108
|
+
return InstallPlan(targets=tuple(targets), notes=tuple(notes))
|
|
109
|
+
|
|
110
|
+
# ------------------------------------------------------------------
|
|
111
|
+
# post_install
|
|
112
|
+
# ------------------------------------------------------------------
|
|
113
|
+
|
|
114
|
+
def post_install(self, opts: InstallOptions) -> list[str]:
|
|
115
|
+
root = self.install_root(opts)
|
|
116
|
+
notes = [
|
|
117
|
+
f"Skill archives written to {root} (one .zip per skill). Claude Desktop "
|
|
118
|
+
"cannot load skills from disk: upload each archive in Claude Desktop "
|
|
119
|
+
f"(or claude.ai) under {UPLOAD_PATH}, then start a new chat.",
|
|
120
|
+
"Skills need code execution: enable it under Settings → Capabilities. "
|
|
121
|
+
"Bundled scripts install robotframework / libraries with pip when needed.",
|
|
122
|
+
"After an update, upload the changed archives again (replace the old skill).",
|
|
123
|
+
]
|
|
124
|
+
if sys.platform.startswith("linux"):
|
|
125
|
+
notes.append(
|
|
126
|
+
"Note: Claude Desktop is officially supported on macOS and "
|
|
127
|
+
"Windows only; on Linux use claude.ai with the same archives."
|
|
128
|
+
)
|
|
129
|
+
return notes
|