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