Robot Framework
Use this skill for general Robot Framework authoring, refactoring, execution,
and Python library work.
This is the broad Robot Framework skill. It is not wise-rpa-bdd, which is
for browser-extraction-oriented BDD/RPA suites with a fixed generic-keyword
contract.
Start Here
Classify the task first:
- Suite work: write or refactor
.robot suites
- Keyword design: extract or reshape user keywords and resources
- Execution: run
robot, --dryrun, tags, Rebot, pabot
- Library work: create or edit Python libraries
- Framework extension: listeners, remote libraries, dynamic APIs
Pick the narrowest layer that solves the problem.
Strong Defaults
- Prefer
.robot suites plus resource files before Python libraries.
- Prefer high-level user keywords over repeated low-level calls.
- Prefer
*** Test Cases *** unless the work is genuinely task/RPA shaped.
- Prefer
Test Template when many rows share one interaction shape.
- Prefer
robot --dryrun as the first validation step.
- Prefer Python libraries when suite logic starts hiding business intent.
Core Model
Choose the right layer:
- suite file: scenario intent and visible assertions
- resource file: shared domain flows, imports, and reusable keywords
- Python library: external-system mechanics, parsing, retries, heavy logic
If the suite starts reading like general-purpose program code, move logic down
into Python.
What Good Looks Like
Good Robot Framework code usually has:
- short test/task bodies
- intention-revealing user keywords
- shared flows in resources instead of copy-paste
- variables in the right place for their scope
- clear execution commands
Bad Robot Framework code usually has:
- giant inline test cases
- one keyword that hides the whole scenario
- duplicated low-level steps across files
- nested control flow doing data shaping in
.robot
- environment values hardcoded in the suite
Fast Heuristics
- If a test repeats the same 4-8 steps with different values, use a template or
shared keyword.
- If multiple suites share the same vocabulary, move it into a resource file.
- If you need nested loops, conditionals, retries, or parsing, use Python.
- If a value varies by environment, do not hardcode it in the suite.
- If the keyword name tries to describe an entire workflow, split it.
Decision Table
| Need |
Default |
Reusable flow in .robot |
user keyword or resource file |
| Shared imports / variables / keywords |
resource file |
| Same-shape tests with different rows |
Test Template |
| Heavy data logic or external APIs |
Python library |
| Fast structure validation |
robot --dryrun |
| Merge or regenerate reports |
rebot |
| Parallel runs |
pabot |
| Library docs |
libdoc |
Working Pattern
When implementing:
- choose suite vs resource vs library
- shape the suite body around behavior, not mechanics
- factor repeated flows into keywords
- validate with
robot --dryrun
- run the narrowest real selection possible
Read Next
references/syntax.md for exact grammar, variables, control structures,
RETURN, BDD prefixes, continuation rows, and __init__.robot
references/authoring.md for suite layout, templates, resources, BDD style,
variable placement, and refactor boundaries
references/execution.md for robot, tag selection, reserved tags,
argument files, pabot, output files, and Rebot
references/library-authoring.md for Python libraries, decorators, type
conversion, listeners, dynamic/hybrid APIs, remote libraries, and Libdoc
1---2name: robotframework3description: Use this skill for general Robot Framework work: authoring `.robot` suites, tasks, keywords, variables, resource files, execution, dry runs, tags, Rebot/Libdoc usage, and Python test-library patterns. Trigger when the user mentions Robot Framework, `.robot` files, keywords, libraries, resource files, tasks, listeners, Libdoc, Rebot, or Robot Framework syntax and execution.4---5
6# Robot Framework
7
8Use this skill for general Robot Framework authoring, refactoring, execution,
9and Python library work.
10
11This is the broad Robot Framework skill. It is not `wise-rpa-bdd`, which is
12for browser-extraction-oriented BDD/RPA suites with a fixed generic-keyword
13contract.
14
15## Start Here
16
17Classify the task first:
18
191. **Suite work**: write or refactor `.robot` suites
202. **Keyword design**: extract or reshape user keywords and resources
213. **Execution**: run `robot`, `--dryrun`, tags, Rebot, pabot
224. **Library work**: create or edit Python libraries
235. **Framework extension**: listeners, remote libraries, dynamic APIs
24
25Pick the narrowest layer that solves the problem.
26
27## Strong Defaults
28
29- Prefer `.robot` suites plus resource files before Python libraries.
30- Prefer high-level user keywords over repeated low-level calls.
31- Prefer `*** Test Cases ***` unless the work is genuinely task/RPA shaped.
32- Prefer `Test Template` when many rows share one interaction shape.
33- Prefer `robot --dryrun` as the first validation step.
34- Prefer Python libraries when suite logic starts hiding business intent.
35
36## Core Model
37
38Choose the right layer:
39
40- **suite file**: scenario intent and visible assertions
41- **resource file**: shared domain flows, imports, and reusable keywords
42- **Python library**: external-system mechanics, parsing, retries, heavy logic
43
44If the suite starts reading like general-purpose program code, move logic down
45into Python.
46
47## What Good Looks Like
48
49Good Robot Framework code usually has:
50
51- short test/task bodies
52- intention-revealing user keywords
53- shared flows in resources instead of copy-paste
54- variables in the right place for their scope
55- clear execution commands
56
57Bad Robot Framework code usually has:
58
59- giant inline test cases
60- one keyword that hides the whole scenario
61- duplicated low-level steps across files
62- nested control flow doing data shaping in `.robot`
63- environment values hardcoded in the suite
64
65## Fast Heuristics
66
67- If a test repeats the same 4-8 steps with different values, use a template or
68 shared keyword.
69- If multiple suites share the same vocabulary, move it into a resource file.
70- If you need nested loops, conditionals, retries, or parsing, use Python.
71- If a value varies by environment, do not hardcode it in the suite.
72- If the keyword name tries to describe an entire workflow, split it.
73
74## Decision Table
75
76| Need | Default |
77|---|---|
78| Reusable flow in `.robot` | user keyword or resource file |
79| Shared imports / variables / keywords | resource file |
80| Same-shape tests with different rows | `Test Template` |
81| Heavy data logic or external APIs | Python library |
82| Fast structure validation | `robot --dryrun` |
83| Merge or regenerate reports | `rebot` |
84| Parallel runs | `pabot` |
85| Library docs | `libdoc` |
86
87## Working Pattern
88
89When implementing:
90
911. choose suite vs resource vs library
922. shape the suite body around behavior, not mechanics
933. factor repeated flows into keywords
944. validate with `robot --dryrun`
955. run the narrowest real selection possible
96
97## Read Next
98
99- `references/syntax.md` for exact grammar, variables, control structures,
100 `RETURN`, BDD prefixes, continuation rows, and `__init__.robot`
101- `references/authoring.md` for suite layout, templates, resources, BDD style,
102 variable placement, and refactor boundaries
103- `references/execution.md` for `robot`, tag selection, reserved tags,
104 argument files, pabot, output files, and Rebot
105- `references/library-authoring.md` for Python libraries, decorators, type
106 conversion, listeners, dynamic/hybrid APIs, remote libraries, and Libdoc