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.
Files changed (199) hide show
  1. robotframework_plugins/__init__.py +14 -0
  2. robotframework_plugins/_assets/catalog.json +143 -0
  3. robotframework_plugins/_assets/plugins/rf-agentskills/.claude-plugin/plugin.json +25 -0
  4. robotframework_plugins/_assets/plugins/rf-agentskills/CHANGELOG.md +198 -0
  5. robotframework_plugins/_assets/plugins/rf-agentskills/README.md +27 -0
  6. robotframework_plugins/_assets/plugins/rf-agentskills/catalog.yaml +25 -0
  7. robotframework_plugins/_assets/plugins/rf-api/.claude-plugin/plugin.json +25 -0
  8. robotframework_plugins/_assets/plugins/rf-api/CHANGELOG.md +9 -0
  9. robotframework_plugins/_assets/plugins/rf-api/README.md +27 -0
  10. robotframework_plugins/_assets/plugins/rf-api/catalog.yaml +27 -0
  11. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/SKILL.md +113 -0
  12. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/authentication-patterns.robot +39 -0
  13. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/basic-crud.robot +46 -0
  14. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/file-upload.robot +28 -0
  15. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/session-handling.robot +48 -0
  16. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/async-jobs.md +42 -0
  17. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/authentication.md +58 -0
  18. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/install.md +10 -0
  19. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/loose-assertions.md +20 -0
  20. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/request-options.md +90 -0
  21. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/response-validation.md +64 -0
  22. robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/troubleshooting.md +64 -0
  23. robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/SKILL.md +120 -0
  24. robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/assets/examples/basic-rest.robot +51 -0
  25. robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/assets/examples/schema-validation.robot +38 -0
  26. robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/assets/examples/schemas/user.json +10 -0
  27. robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/authentication.md +61 -0
  28. robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/install.md +11 -0
  29. robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/json-handling.md +89 -0
  30. robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/loose-assertions.md +18 -0
  31. robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/migrate-from-requests.md +15 -0
  32. robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/schema-validation.md +85 -0
  33. robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/troubleshooting.md +68 -0
  34. robotframework_plugins/_assets/plugins/rf-core/.claude-plugin/plugin.json +19 -0
  35. robotframework_plugins/_assets/plugins/rf-core/CHANGELOG.md +13 -0
  36. robotframework_plugins/_assets/plugins/rf-core/README.md +38 -0
  37. robotframework_plugins/_assets/plugins/rf-core/agents/rf-debug-expert.md +120 -0
  38. robotframework_plugins/_assets/plugins/rf-core/agents/rf-migration-guide.md +73 -0
  39. robotframework_plugins/_assets/plugins/rf-core/agents/rf-test-architect.md +98 -0
  40. robotframework_plugins/_assets/plugins/rf-core/catalog.yaml +19 -0
  41. robotframework_plugins/_assets/plugins/rf-core/hooks/README.md +445 -0
  42. robotframework_plugins/_assets/plugins/rf-core/hooks/hooks.json +70 -0
  43. robotframework_plugins/_assets/plugins/rf-core/scripts/_hook_input.mjs +101 -0
  44. robotframework_plugins/_assets/plugins/rf-core/scripts/_pending_errors.mjs +65 -0
  45. robotframework_plugins/_assets/plugins/rf-core/scripts/_python_env.mjs +181 -0
  46. robotframework_plugins/_assets/plugins/rf-core/scripts/check_rf_environment.mjs +181 -0
  47. robotframework_plugins/_assets/plugins/rf-core/scripts/maybe_inject_rf_context.mjs +74 -0
  48. robotframework_plugins/_assets/plugins/rf-core/scripts/maybe_remind_robot_tests.mjs +128 -0
  49. robotframework_plugins/_assets/plugins/rf-core/scripts/report_pending_errors.mjs +72 -0
  50. robotframework_plugins/_assets/plugins/rf-core/scripts/rf_error_hints.mjs +126 -0
  51. robotframework_plugins/_assets/plugins/rf-core/scripts/validate_robot.mjs +517 -0
  52. robotframework_plugins/_assets/plugins/rf-core/scripts/validate_robot_project.mjs +103 -0
  53. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/SKILL.md +313 -0
  54. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/api.resource +30 -0
  55. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/calc.resource +23 -0
  56. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/embedded.resource +20 -0
  57. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/keywords.resource +26 -0
  58. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/login.resource +10 -0
  59. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/01__keyword_driven.robot +15 -0
  60. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/02__data_driven.robot +10 -0
  61. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/03__templates.robot +17 -0
  62. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/04__bdd.robot +10 -0
  63. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/05__embedded.robot +13 -0
  64. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/__init__.robot +6 -0
  65. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/api/__init__.robot +7 -0
  66. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/api/users.robot +18 -0
  67. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/env.robot +15 -0
  68. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/variables/common.py +11 -0
  69. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/variables/dev.yaml +3 -0
  70. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/variables/staging.yaml +3 -0
  71. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/arguments.md +139 -0
  72. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/control-structures.md +175 -0
  73. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/embedded-arguments.md +135 -0
  74. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/migration.md +90 -0
  75. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/resources-and-variable-files.md +127 -0
  76. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/styles.md +92 -0
  77. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/suites-and-init.md +96 -0
  78. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/tags-and-selection.md +104 -0
  79. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/templates.md +124 -0
  80. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/variables-and-scopes.md +129 -0
  81. robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/scripts/rf_conventions.py +883 -0
  82. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/SKILL.md +216 -0
  83. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/ExampleLibrary.py +61 -0
  84. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/ResultListener.py +60 -0
  85. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/converters.py +48 -0
  86. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/converters.robot +20 -0
  87. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/example_library.robot +31 -0
  88. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/listener.robot +12 -0
  89. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/api-variants.md +291 -0
  90. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/communication.md +248 -0
  91. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/conversion.md +347 -0
  92. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/listeners.md +150 -0
  93. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/packaging-and-docs.md +155 -0
  94. robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/scripts/check_library.py +842 -0
  95. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/SKILL.md +159 -0
  96. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/github-actions-robot.yml +32 -0
  97. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/gitignore.txt +22 -0
  98. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/pyproject.poetry.toml +28 -0
  99. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/pyproject.uv.toml +20 -0
  100. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/requirements.txt +9 -0
  101. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/robot.toml +16 -0
  102. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/smoke.robot +22 -0
  103. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/ci.md +61 -0
  104. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/cli-tools.md +33 -0
  105. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/libraries.md +47 -0
  106. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/poetry.md +77 -0
  107. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/project-layout.md +86 -0
  108. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/troubleshooting.md +73 -0
  109. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/uv.md +108 -0
  110. robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/venv-pip.md +71 -0
  111. robotframework_plugins/_assets/plugins/rf-core/variants/codex/agents/rf-debug-expert.toml +119 -0
  112. robotframework_plugins/_assets/plugins/rf-core/variants/codex/agents/rf-migration-guide.toml +72 -0
  113. robotframework_plugins/_assets/plugins/rf-core/variants/codex/agents/rf-test-architect.toml +97 -0
  114. robotframework_plugins/_assets/plugins/rf-core/variants/opencode/agents/rf-debug-expert.md +123 -0
  115. robotframework_plugins/_assets/plugins/rf-core/variants/opencode/agents/rf-migration-guide.md +76 -0
  116. robotframework_plugins/_assets/plugins/rf-core/variants/opencode/agents/rf-test-architect.md +101 -0
  117. robotframework_plugins/_assets/plugins/rf-core/variants/opencode/plugins/rf-core.js +93 -0
  118. robotframework_plugins/_assets/plugins/rf-desktop/.claude-plugin/plugin.json +24 -0
  119. robotframework_plugins/_assets/plugins/rf-desktop/CHANGELOG.md +10 -0
  120. robotframework_plugins/_assets/plugins/rf-desktop/README.md +26 -0
  121. robotframework_plugins/_assets/plugins/rf-desktop/catalog.yaml +23 -0
  122. robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/SKILL.md +268 -0
  123. robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/assets/examples/calculator.robot +45 -0
  124. robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/assets/examples/mock-deterministic.robot +33 -0
  125. robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/cli-and-inspector.md +82 -0
  126. robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/install.md +14 -0
  127. robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/keywords-reference.md +102 -0
  128. robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/locators-and-queries.md +95 -0
  129. robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/platform-setup.md +65 -0
  130. robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/status-and-migration.md +41 -0
  131. robotframework_plugins/_assets/plugins/rf-mobile/.claude-plugin/plugin.json +24 -0
  132. robotframework_plugins/_assets/plugins/rf-mobile/CHANGELOG.md +9 -0
  133. robotframework_plugins/_assets/plugins/rf-mobile/README.md +26 -0
  134. robotframework_plugins/_assets/plugins/rf-mobile/catalog.yaml +23 -0
  135. robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/SKILL.md +134 -0
  136. robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/android-basic.robot +60 -0
  137. robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/gestures-example.robot +59 -0
  138. robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/hybrid-app.robot +54 -0
  139. robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/ios-basic.robot +48 -0
  140. robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/capabilities.md +117 -0
  141. robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/gestures-touch.md +84 -0
  142. robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/install.md +21 -0
  143. robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/locators-mobile.md +74 -0
  144. robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/platform-specific.md +105 -0
  145. robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/troubleshooting.md +70 -0
  146. robotframework_plugins/_assets/plugins/rf-web/.claude-plugin/plugin.json +25 -0
  147. robotframework_plugins/_assets/plugins/rf-web/CHANGELOG.md +9 -0
  148. robotframework_plugins/_assets/plugins/rf-web/README.md +27 -0
  149. robotframework_plugins/_assets/plugins/rf-web/catalog.yaml +27 -0
  150. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/SKILL.md +134 -0
  151. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/authentication-flow.robot +34 -0
  152. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/basic-web-test.robot +29 -0
  153. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/form-handling.robot +49 -0
  154. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/iframe-shadow-dom.robot +31 -0
  155. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/assertion-engine.md +79 -0
  156. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/authentication-storage.md +86 -0
  157. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/browser-context-page.md +110 -0
  158. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/downloads-uploads.md +51 -0
  159. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/iframes-shadow-dom.md +67 -0
  160. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/install.md +67 -0
  161. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/locators.md +83 -0
  162. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/migrate-from-selenium.md +22 -0
  163. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/selector-drift.md +29 -0
  164. robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/troubleshooting.md +100 -0
  165. robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/SKILL.md +123 -0
  166. robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/assets/examples/basic-web-test.robot +64 -0
  167. robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/assets/examples/multi-window.robot +55 -0
  168. robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/assets/examples/wait-patterns.robot +53 -0
  169. robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/browser-setup.md +103 -0
  170. robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/frames-windows.md +84 -0
  171. robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/install.md +12 -0
  172. robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/javascript-execution.md +65 -0
  173. robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/locators.md +86 -0
  174. robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/troubleshooting.md +122 -0
  175. robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/waiting-strategies.md +84 -0
  176. robotframework_plugins/_assets.py +120 -0
  177. robotframework_plugins/_catalog.py +123 -0
  178. robotframework_plugins/_snapshot.py +320 -0
  179. robotframework_plugins/adapters/__init__.py +53 -0
  180. robotframework_plugins/adapters/_base.py +400 -0
  181. robotframework_plugins/adapters/claude_code.py +312 -0
  182. robotframework_plugins/adapters/claude_desktop.py +129 -0
  183. robotframework_plugins/adapters/codex.py +276 -0
  184. robotframework_plugins/adapters/copilot.py +87 -0
  185. robotframework_plugins/adapters/cursor.py +295 -0
  186. robotframework_plugins/adapters/goose.py +240 -0
  187. robotframework_plugins/adapters/opencode.py +170 -0
  188. robotframework_plugins/bundle.py +85 -0
  189. robotframework_plugins/cli.py +1311 -0
  190. robotframework_plugins/detect.py +121 -0
  191. robotframework_plugins/manifest.py +338 -0
  192. robotframework_plugins/py.typed +0 -0
  193. robotframework_plugins/skillzip.py +39 -0
  194. robotframework_plugins/transforms.py +725 -0
  195. robotframework_plugins-2026.11.0.dist-info/METADATA +198 -0
  196. robotframework_plugins-2026.11.0.dist-info/RECORD +199 -0
  197. robotframework_plugins-2026.11.0.dist-info/WHEEL +4 -0
  198. robotframework_plugins-2026.11.0.dist-info/entry_points.txt +2 -0
  199. robotframework_plugins-2026.11.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,128 @@
1
+ #!/usr/bin/env node
2
+ // maybe_remind_robot_tests.mjs — Conditional Stop hook.
3
+ //
4
+ // Reads the Claude Code Stop event JSON on stdin, inspects the session
5
+ // transcript for any tool result that wrote a .robot or .resource file,
6
+ // and only emits an additionalContext reminder ("run robot, inspect
7
+ // report.html") when at least one such file was touched. Sessions that
8
+ // produced only non-RF artifacts get no injection, and neither do sessions
9
+ // that ran Robot Framework (`robot`, `python -m robot`, `robotcode robot`,
10
+ // dry runs included) after their last .robot/.resource write.
11
+ //
12
+ // Cross-platform port of maybe_remind_robot_tests.sh. Reads the
13
+ // transcript via streaming-ish chunking so very long sessions don't
14
+ // blow up memory.
15
+ //
16
+ // Schema:
17
+ // stdin — Claude Code Stop event JSON. Includes transcript_path.
18
+ // stdout — Either empty (no reminder) or one JSON object with
19
+ // hookSpecificOutput.additionalContext.
20
+ // exit — Always 0.
21
+ import { readFileSync, existsSync, statSync, openSync, readSync, closeSync, writeFileSync } from "node:fs";
22
+ import { tmpdir } from "node:os";
23
+ import { join } from "node:path";
24
+
25
+ let raw = "";
26
+ try { raw = readFileSync(0, "utf-8"); } catch { process.exit(0); }
27
+ if (!raw) process.exit(0);
28
+
29
+ let event;
30
+ try { event = JSON.parse(raw); } catch { process.exit(0); }
31
+
32
+ // Break the Stop-hook loop. Claude Code sets `stop_hook_active` when this
33
+ // Stop fires as a continuation of a previous Stop-hook block; emitting any
34
+ // model-facing output here would re-invoke the model and loop until the
35
+ // block cap. Always no-op in that state.
36
+ if (event?.stop_hook_active) process.exit(0);
37
+
38
+ const transcript = (event?.transcript_path ?? "").toString();
39
+ if (!transcript || !existsSync(transcript)) process.exit(0);
40
+
41
+ // Fire the reminder at most once per session. Without this, every later turn
42
+ // that touched a .robot file re-emits it (the noise the loop amplified). The
43
+ // marker is a tiny file in the OS temp dir keyed by session_id; all I/O is
44
+ // best-effort and must never break the (non-blocking) hook.
45
+ const sessionId = (event?.session_id ?? "").toString();
46
+ let marker = "";
47
+ if (sessionId) {
48
+ const safe = sessionId.replace(/[^A-Za-z0-9._-]/g, "_");
49
+ marker = join(tmpdir(), `rf-agentskills-reminded-${safe}`);
50
+ try {
51
+ if (existsSync(marker)) process.exit(0);
52
+ } catch {
53
+ // Can't stat the marker — fall through and emit (guard above prevents loops).
54
+ }
55
+ }
56
+
57
+ // Pattern: `"file_path" : "...path.robot"` (or .resource). Matches the
58
+ // `grep -E` regex from the bash original. Whitespace optional between
59
+ // quotes and colon.
60
+ const FILE_PATH_RE = /"file_path"\s*:\s*"[^"]*\.(?:robot|resource)"/gi;
61
+ // A Bash tool call's `"command": "…"` (JSON string, escapes kept).
62
+ const COMMAND_RE = /"command"\s*:\s*"((?:[^"\\]|\\.)*)"/g;
63
+ // Robot Framework run at a command position: start, after ; & | ( or a
64
+ // `uv/poetry/pipenv run`, optionally with a path (`.venv/bin/robot`).
65
+ const RF_RUN_RE = new RegExp(
66
+ String.raw`(?:^|[;&|(]\s*|\b(?:uv|poetry|pipenv)\s+run\s+)(?:[\w.~/\\-]*[/\\])?` +
67
+ String.raw`(?:python3?(?:\.exe)?\s+-m\s+robot(?=\s|$)|robotcode(?:\.exe)?(?:\s+\S+)*?\s+robot\b|robot(?:\.exe)?(?=\s|$))`,
68
+ );
69
+ const CARRY = 4096;
70
+
71
+ // Offsets of the last .robot/.resource file_path and the last Robot
72
+ // Framework run command in the transcript (-1 when absent).
73
+ function lastWriteAndRun(path) {
74
+ // The transcript is a JSONL file that can be tens of MB on long
75
+ // sessions. Read in 64 KB chunks rather than slurping it all.
76
+ const size = (() => { try { return statSync(path).size; } catch { return 0; } })();
77
+ const found = { write: -1, run: -1 };
78
+ if (!size) return found;
79
+ const BUF = Buffer.alloc(65536);
80
+ const fd = openSync(path, "r");
81
+ let pos = 0;
82
+ let carry = "";
83
+ try {
84
+ while (pos < size) {
85
+ const n = readSync(fd, BUF, 0, BUF.length, pos);
86
+ if (n <= 0) break;
87
+ // Stitch the boundary with the previous chunk so we don't miss a
88
+ // match split across the seam (offsets are approximate, in chars).
89
+ const chunk = carry + BUF.slice(0, n).toString("utf-8");
90
+ const base = pos - carry.length;
91
+ for (const m of chunk.matchAll(FILE_PATH_RE)) found.write = Math.max(found.write, base + m.index);
92
+ for (const m of chunk.matchAll(COMMAND_RE)) {
93
+ if (RF_RUN_RE.test(m[1])) found.run = Math.max(found.run, base + m.index);
94
+ }
95
+ carry = chunk.length > CARRY ? chunk.slice(-CARRY) : chunk;
96
+ pos += n;
97
+ }
98
+ } finally {
99
+ try { closeSync(fd); } catch {}
100
+ }
101
+ return found;
102
+ }
103
+
104
+ const { write: lastWrite, run: lastRun } = lastWriteAndRun(transcript);
105
+ if (lastWrite < 0) process.exit(0);
106
+ // The suite already ran (or dry-ran) after the last write: nothing to remind.
107
+ if (lastRun > lastWrite) process.exit(0);
108
+
109
+ const payload = {
110
+ hookSpecificOutput: {
111
+ hookEventName: "Stop",
112
+ additionalContext: [
113
+ "Robot Framework artifacts detected this session. Recommended next steps:",
114
+ '\n 1. Run the affected tests where they can run: uv run robotcode robot -bl "<Suite.Test>" (or a whole directory)',
115
+ "\n 2. Read the results: uv run robotcode results summary --failed, then robotcode results log --failed",
116
+ " (not using uv: run robotcode from the project's .venv; see rf-setup)",
117
+ "\n 3. Open results/report.html for the rendered report.",
118
+ ].join(""),
119
+ },
120
+ };
121
+
122
+ // Record that this session has been reminded (best-effort).
123
+ if (marker) {
124
+ try { writeFileSync(marker, ""); } catch { /* ignore — never break the hook */ }
125
+ }
126
+
127
+ process.stdout.write(JSON.stringify(payload) + "\n");
128
+ process.exit(0);
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env node
2
+ // report_pending_errors.mjs — Stop hook: re-validate the .robot/.resource
3
+ // files whose PostToolUse validation found errors or unresolved names this
4
+ // session and, if they still fail, block the stop so the agent gets one more
5
+ // turn to fix them. Unresolved keywords/variables (advisory on edit) block here.
6
+ //
7
+ // Needed for VS Code's Local agent mode, which does not wait for PostToolUse
8
+ // hooks before the next model request (the error only reaches the user as a
9
+ // banner). Agents that do deliver PostToolUse feedback normally fix the file
10
+ // first, which clears its entry, so this hook stays silent there.
11
+ //
12
+ // Output contract (same as validate_robot.mjs): stderr diagnostic + exit 2
13
+ // (Claude Code, Codex and VS Code Local continue with stderr as the reason),
14
+ // plus {"decision":"block","reason":…} on stdout for Copilot.
15
+ //
16
+ // Loop safety: no-op when stop_hook_active is set, and a file is reported at
17
+ // most once per content version (its sha1 is remembered), so an unfixable
18
+ // file can't block every later turn.
19
+ import { existsSync, readFileSync } from "node:fs";
20
+ import { spawnSync } from "node:child_process";
21
+ import { fileURLToPath } from "node:url";
22
+ import { dirname, join } from "node:path";
23
+ import { contentHash, loadPending, savePending } from "./_pending_errors.mjs";
24
+ import { spawnOptions } from "./_python_env.mjs";
25
+
26
+ let event = null;
27
+ try {
28
+ event = JSON.parse(readFileSync(0, "utf-8"));
29
+ } catch {
30
+ process.exit(0);
31
+ }
32
+ if (!event || event.stop_hook_active) process.exit(0);
33
+ const sessionId = (event.session_id ?? "").toString();
34
+ if (!sessionId) process.exit(0);
35
+
36
+ const VALIDATOR = join(dirname(fileURLToPath(import.meta.url)), "validate_robot.mjs");
37
+ const errors = [];
38
+ const stillPending = Object.entries(loadPending(sessionId));
39
+ if (!stillPending.length) process.exit(0);
40
+
41
+ for (const [file, info] of stillPending) {
42
+ if (!existsSync(file)) continue;
43
+ const hash = contentHash(file);
44
+ if (hash && info?.reported === hash) continue; // already reported this version
45
+ const child = { ...event, hook_event_name: "PostToolUse", tool_name: "Write", tool_input: { file_path: file } };
46
+ const r = spawnSync(
47
+ process.execPath,
48
+ [VALIDATOR],
49
+ spawnOptions(45000, {
50
+ input: JSON.stringify(child),
51
+ encoding: "utf-8",
52
+ // Stop mode: unresolved keywords/variables block too, advisory tiers are skipped.
53
+ env: { ...process.env, TOOL_INPUT: "", RF_AGENTSKILLS_STOP_RECHECK: "1" },
54
+ }),
55
+ );
56
+ if (r.status === 2 && (r.stderr ?? "").trim()) errors.push({ file, hash, text: r.stderr.trim() });
57
+ }
58
+
59
+ // The validator child runs updated the state (cleared fixed files); reload,
60
+ // drop deleted files and remember what we report now.
61
+ const state = loadPending(sessionId);
62
+ for (const file of Object.keys(state)) if (!existsSync(file)) delete state[file];
63
+ for (const e of errors) state[e.file] = { reported: e.hash };
64
+ savePending(sessionId, state);
65
+
66
+ if (!errors.length) process.exit(0);
67
+ const text = errors.map((e) => e.text).join("\n");
68
+ const reason =
69
+ "Robot Framework validation still reports errors in files you edited. Fix them before finishing:\n" + text;
70
+ process.stdout.write(JSON.stringify({ decision: "block", reason }) + "\n");
71
+ process.stderr.write(reason + "\n");
72
+ process.exit(2);
@@ -0,0 +1,126 @@
1
+ #!/usr/bin/env node
2
+ // rf_error_hints.mjs — PostToolUse hook (matcher: Bash).
3
+ //
4
+ // Scans a Bash command's output for Robot Framework error messages and, the
5
+ // first time each kind of error appears in a session, injects one short hint:
6
+ // which rf-agentskills skill to load and the concrete fix. Agents reliably read
7
+ // the error they just caused; that is where the pointer to the skill helps.
8
+ //
9
+ // Schema:
10
+ // stdin — PostToolUse event JSON for a shell tool, in any agent's shape
11
+ // (see _hook_input.mjs): Claude Code / Codex `Bash`, Cursor `Shell`,
12
+ // VS Code `run_in_terminal`. Output comes from `tool_response`
13
+ // (Copilot CLI: `tool_result`): .stdout / .stderr, or a plain string.
14
+ // Other tools exit silently (VS Code runs every hook for every tool).
15
+ // stdout — Either empty or one JSON object:
16
+ // {"hookSpecificOutput": {"hookEventName": "PostToolUse",
17
+ // "additionalContext": "..."}}.
18
+ // exit — Always 0. The hook never blocks.
19
+ import { readFileSync, writeFileSync } from "node:fs";
20
+ import { tmpdir } from "node:os";
21
+ import { join } from "node:path";
22
+ import { normalizeHookInput } from "./_hook_input.mjs";
23
+
24
+ const MAX_SCAN = 20000; // characters of output scanned
25
+ const MAX_HINT = 400; // characters per hint
26
+ const MAX_NAME = 80; // characters of an offending name quoted in a hint
27
+
28
+ // kind, pattern (first group = offending name, if any), hint builder
29
+ const SIGNATURES = [
30
+ {
31
+ kind: "no-keyword",
32
+ re: /No keyword with name '([^']*)' found/,
33
+ hint: (name) =>
34
+ `Robot Framework found no keyword '${name}'. If the call carries values inside the name ` +
35
+ "(e.g. 'Select team Los Angeles Lakers'), define an embedded-argument keyword such as " +
36
+ "`Select team ${city} ${team:\\S+}`; the text between arguments is literal, not a regex. " +
37
+ "Load rf-language. Library keyword names: `robotcode doc keywords <Library> <pattern>`.",
38
+ },
39
+ {
40
+ kind: "multiple-keywords",
41
+ re: /Multiple keywords with name '([^']*)' found/,
42
+ hint: (name) =>
43
+ `Keyword '${name}' is defined more than once. Call it qualified (resource.Keyword) or set ` +
44
+ "`Set Library Search Order`, or rename one. See the rf-language skill.",
45
+ },
46
+ {
47
+ kind: "argument-syntax",
48
+ re: /Invalid argument syntax '([^']*)'/,
49
+ hint: (name) =>
50
+ `Invalid argument syntax '${name}'. Typed user-keyword arguments are written \`\${count: int}\` ` +
51
+ "and need RF 7.3+; `${count}: int` is invalid. See the rf-language skill.",
52
+ },
53
+ {
54
+ kind: "variable",
55
+ re: /Resolving variable '([^']*)' failed/,
56
+ hint: (name) =>
57
+ `Variable '${name}' could not be resolved. Check its scope (VAR scope=TEST|SUITE|GLOBAL), ` +
58
+ "the import order of resource/variable files, and `$var` vs `${var}` in expressions. " +
59
+ "See the rf-language skill.",
60
+ },
61
+ {
62
+ kind: "library-import",
63
+ re: /Importing library '([^']*)' failed/,
64
+ hint: (name) =>
65
+ `Library '${name}' could not be imported. Install it into the project environment ` +
66
+ "(e.g. `uv add <package>`) and run robot from that environment. See the rf-setup skill.",
67
+ },
68
+ ];
69
+
70
+ function outputText(response) {
71
+ if (response == null) return "";
72
+ if (typeof response === "string") return response;
73
+ const parts = [];
74
+ for (const key of ["stdout", "stderr", "output", "content"]) {
75
+ const v = response[key];
76
+ if (typeof v === "string") parts.push(v);
77
+ }
78
+ // Unknown shapes (e.g. VS Code tool results): scan their JSON text.
79
+ return parts.length ? parts.join("\n") : JSON.stringify(response);
80
+ }
81
+
82
+ function main() {
83
+ let raw = "";
84
+ try { raw = readFileSync(0, "utf-8"); } catch { return; }
85
+ if (!raw) return;
86
+ let event;
87
+ try { event = JSON.parse(raw); } catch { return; }
88
+ if (!event || typeof event !== "object") return;
89
+ // Only shell output; a tool name of another kind (read_file, …) is skipped.
90
+ const input = normalizeHookInput(event);
91
+ if (input.tool && !input.isShell) return;
92
+
93
+ const text = outputText(event.tool_response ?? event.tool_result).slice(0, MAX_SCAN);
94
+ if (!text) return;
95
+
96
+ const sessionId = (event.session_id ?? "").toString();
97
+ const marker = sessionId
98
+ ? join(tmpdir(), `rf-agentskills-hints-${sessionId.replace(/[^A-Za-z0-9._-]/g, "_")}.json`)
99
+ : "";
100
+ let seen = new Set();
101
+ if (marker) {
102
+ try { seen = new Set(JSON.parse(readFileSync(marker, "utf-8")).map(String)); } catch { /* none yet */ }
103
+ }
104
+
105
+ const hints = [];
106
+ for (const sig of SIGNATURES) {
107
+ if (seen.has(sig.kind)) continue;
108
+ const m = sig.re.exec(text);
109
+ if (!m) continue;
110
+ const name = (m[1] ?? "").slice(0, MAX_NAME);
111
+ hints.push(sig.hint(name).slice(0, MAX_HINT));
112
+ seen.add(sig.kind);
113
+ }
114
+ if (!hints.length) return;
115
+
116
+ if (marker) {
117
+ try { writeFileSync(marker, JSON.stringify([...seen])); } catch { /* dedupe lost only */ }
118
+ }
119
+ const payload = {
120
+ hookSpecificOutput: { hookEventName: "PostToolUse", additionalContext: hints.join("\n\n") },
121
+ };
122
+ process.stdout.write(JSON.stringify(payload) + "\n");
123
+ }
124
+
125
+ try { main(); } catch { /* never block */ }
126
+ process.exit(0);