Λογότυπο Rf Python Library

Rf Python Library

Κοινότητα
manykarim
rf-python-library

Use first, before answering, to write or fix Robot Framework keyword libraries or listeners in Python.

Επισκόπηση

Εκδότηςmanykarim
Αποθετήριοrobotframework-agentskills
Όνομα δεξιότηταςrf-python-library
Αστέρια
40
Forks
2
Συνοδευτικά αρχεία
12
Άδεια χρήσηςApache-2.0
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • 12 συνοδευτικά αρχεία

    Σενάρια, πρότυπα και υλικό αναφοράς που μπορεί να διαβάζει το μοντέλο καθώς εργάζεται. Τα αρχεία είναι μόνο για ανάγνωση και δεν εκτελούνται ποτέ.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε από manykarim στο GitHub. Διαβάστε το πηγαίο περιεχόμενο πριν εγκαταστήσετε τη δεξιότητα.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Rf Python Library στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/manykarim/robotframework-agentskills/tree/main/plugins/rf-agentskills/skills/rf-python-library
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Νέα δεξιότητα → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που διαβάζει τη μορφή Agent Skills μπορεί να χρησιμοποιήσει αυτή τη δεξιότητα — αντιγράψτε τον φάκελο στον κατάλογο δεξιοτήτων του.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/manykarim/robotframework-agentskills.git /tmp/robotframework-agentskills
mkdir -p .claude/skills
cp -r /tmp/robotframework-agentskills/plugins/rf-agentskills/skills/rf-python-library .claude/skills/rf-python-library
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Rf Python Library σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Rf Python Library μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Rf Python Library δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλα κατά τη συνομιλία

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

Robot Framework Python Library

Writing and fixing keyword libraries and listeners in Python: the default library shape, scope, argument conversion, failures, logging and the checks that catch Robot Framework-specific defects before a test runs. Tests, user keywords and .resource files belong to rf-language; using an existing library (Browser, RequestsLibrary, …) belongs to that library's skill. Rule of thumb: logic goes into Python, composition of existing keywords into a user keyword.

When to use

Load this skill first, before exploring the project, reading or creating .py files, or answering from memory, when Robot Framework keywords, libraries or listeners are written in Python:

  • a new keyword library (around an API, database or device client), @keyword and @library decorators;
  • ROBOT_LIBRARY_SCOPE and state kept between tests (a library that loses its state, a connection scope);
  • argument conversion from type hints (Enum, Literal, custom converters), failures and logging via robot.api, libdoc docs;
  • a library that "contains no keywords";
  • a listener that reacts to or reports results (chat, dashboards).

Not this skill: keywords in .robot/.resource files use rf-language; using an existing library such as Browser or RequestsLibrary uses its library skill.

Quick reference and version gate

Check the version in the project environment first (robot --version exits 251 even on success):

bash
uv run python -c "import robot; print(robot.__version__)"
FeatureMin RF
async def keywords, BuiltIn().dry_run_active6.1
Literal conversion, embedded plus normal arguments in one library keyword, listener API v3 as the default7.0
ROBOT_LISTENER_PRIORITY7.1
@library selects the decorated class in a module whose name differs7.2
robot.errors.TimeoutExceeded (named TimeoutError before 7.3)7.3
Secret (robot.api.types) and object type hints7.4
Markdown doc format (doc_format="MARKDOWN"); RF timeouts no longer derive from Exception7.5

Default library template

Save it as libraries/<Name>.py; the class name equals the file name.

python
# file: MyLibrary.py
"""Keywords for <what the library does>."""

from enum import Enum

from robot.api import logger
from robot.api.deco import keyword, library


class Mode(Enum):
    ON = "ON"
    OFF = "OFF"


# scope: pick it by how long the library state must live (scope table below).
@library(scope="TEST", version="0.1.0")
class MyLibrary:
    """One-line summary: libdoc shows it as the library introduction.

    Import: ``Library    MyLibrary    timeout=5``.
    """

    def __init__(self, timeout: float = 5.0) -> None:
        self._timeout = timeout  # state is set here only

    @keyword
    def set_mode(self, mode: Mode) -> str:
        """Switch the mode; ``on`` and ``off`` are accepted case-insensitively.

        Args:
            mode: ``ON`` or ``OFF``.
        """
        logger.info(f"mode {mode.name}, timeout {self._timeout}")
        return mode.name

    @keyword
    def value_should_be(self, actual: int, expected: int) -> None:
        """Fail unless ``actual`` equals ``expected``."""
        if actual != expected:
            raise AssertionError(f"expected {expected}, got {actual}")

Why each part: @library turns off automatic discovery, so only @keyword methods become keywords; type hints drive argument conversion and libdoc; the docstring's first line is the short doc; AssertionError marks a verification failure; robot.api.logger writes to the log.

Decisions

Module or class

Library needsUse
A few stateless functionsModule library; set ROBOT_AUTO_KEYWORDS = False and decorate keywords with @keyword, so imported names do not become keywords
State, init arguments, converters or a listenerClass library with @library (the template)

Library scope (Robot Framework User Guide, "Creating test libraries" → "Library scope"). Choose by how long the state must live:

State must live …ScopeNote
per test, or must not leak between testsTEST (default)a new instance for every test keeps tests independent; suite setup and teardown share another instance
across the tests of one suite (client, connection, accumulated data)SUITEa new instance per suite; add a cleanup keyword (Clear …) for a suite setup or teardown
across suites for the whole run (one browser or session)GLOBALone instance for the run; add a cleanup keyword (Close All …); module libraries are always global
no state at allany; GLOBAL avoids needless instancesa stateless library does not need new instances

Importing the same library with different arguments creates a new instance regardless of scope; give each import a name with AS.

Static, hybrid or dynamic API

SituationAPI
Normal libraryStatic: methods are keywords (the template)
Keyword names computed at runtime, implementations are real methodsHybrid: get_keyword_names
Proxy to another tool or process, or keywords generated from a specDynamic: get_keyword_names + run_keyword; PythonLibCore helps compose large libraries

Failures and logging

WantUse
Verification failedAssertionError (or robot.api.Failure)
Fail but continue the testrobot.api.ContinuableFailure
Mark the test skippedrobot.api.SkipExecution
Stop the whole runrobot.api.FatalError
Keyword used incorrectlyValueError / robot.api.Error
Log for the reportlogger.info / logger.debug; html=True for HTML; logger.warn for warnings
Show progress on the consolelogger.console

Placement and import

Project libraries live in libraries/ on the python-path that rf-setup's project layout defines, and are imported by name:

toml
# robot.toml
python-path = ["resources", "libraries"]
robotframework
*** Settings ***
Library    MyLibrary    timeout=10
Library    MyLibrary    timeout=60    AS    SlowLibrary

Plain robot needs --pythonpath libraries. Import by name, not by a relative ../libraries/X.py path, so the same import works from every suite. Add third-party runtime dependencies with the project's tool (uv add <package>; see rf-setup).

Agent workflow

  1. Check the version: uv run python -c "import robot; print(robot.__version__)", then use only features from the gate table.

  2. Write or edit libraries/<Name>.py from the template; pick the scope from the scope table.

  3. Run the checker and fix every error and warning finding (or state why one stays). It runs the library's import and __init__ code, so use it on your own project libraries only:

    bash
    uv run python "${CLAUDE_SKILL_DIR}/scripts/check_library.py" libraries/<Name>.py
  4. List the keyword names the tests will call: uv run robotcode doc keywords libraries/<Name>.py (one keyword in full: uv run robotcode doc keyword libraries/<Name>.py "<Keyword>").

  5. Pure Python logic with branches gets pytest unit tests.

  6. uv run robotcode analyze code tests/ on the suites that import the library (with libraries on the python-path in robot.toml). It finds unknown keywords and wrong argument counts without running anything, so it misses variables set at run time, named-argument typos, embedded-argument mismatches and str in unions; the real run in step 7 catches them.

  7. uv run robot --pythonpath libraries --outputdir results tests/ (or uv run robotcode robot with the robot.toml python-path); on failure rerun with --loglevel DEBUG for tracebacks and read the results with uv run robotcode results show --failed and uv run robotcode results log --failed.

  8. Fix and go back to step 3.

The script path is relative to this skill's directory; library paths are relative to the project root. More checker calls:

bash
uv run python "${CLAUDE_SKILL_DIR}/scripts/check_library.py" libraries/*.py --pretty
uv run python "${CLAUDE_SKILL_DIR}/scripts/check_library.py" Client --init-arg https://staging.example.com --pythonpath libraries
uv run python "${CLAUDE_SKILL_DIR}/scripts/check_library.py" libraries/Inventory.py --json-out results/check_library.json

Not using uv? Run the same commands with .venv/bin/python or poetry run python instead of uv run python; see rf-setup.

The JSON lists per library the scope, API style and keywords with arguments, plus findings (id, severity, keyword, message, hint), errors first. Exit 0 means checked (findings do not change it); 4 means the input is outside the project root or no library loaded (stderr has the error line and a hint); 3 means Robot Framework is missing from the interpreter.

Gotchas

  • @library disables automatic keyword discovery: a public method without @keyword is silently not a keyword (→ public_method_not_keyword); mark helpers @not_keyword or prefix them with _.
  • Functions imported into a module library, and public base-class methods, become keywords: from os.path import join adds Join (→ leaked_keyword). Import modules (import os) or use ROBOT_AUTO_KEYWORDS = False.
  • The default TEST scope creates a new instance for every test, by design, so tests stay independent: a counter or cache set in one test is gone in the next (→ state_in_test_scope). State that must span tests needs SUITE or GLOBAL plus a cleanup keyword. __init__ also runs during libdoc and --dryrun, so it must not connect anywhere unguarded (→ output_during_import).
  • An inline type in a library embedded-argument name, @keyword("Take ${qty: int} pears"), makes RF 7.3+ reject the keyword, and the library then "contains no keywords" (→ keyword_creation_failed, no_keywords; before 7.3, : int is read as a regex and the keyword never matches). Put the type on the Python argument: def take(self, qty: int).
  • A union that contains str, such as int | str, never converts a string argument: "10" stays a string (→ union_with_str). Drop str or convert explicitly.
  • Implicit typing from defaults is lenient: def kw(n=3) passes abc through as a string (not detected). Use real type hints.
  • bool conversion passes unknown strings through: flag: bool with maybe gives the string maybe (not detected). Use Literal or an Enum when only fixed values are valid.
  • Positional-only arguments (def kw(a, /)) cannot be passed by name: a=1 arrives as the string a=1 (→ positional_only_argument).
  • A broad except Exception: swallows Robot Framework timeouts before RF 7.5 (they derive from Exception until then) (→ broad_except). Catch specific exceptions, or re-raise robot.errors.TimeoutExceeded.
  • Logging or raising from a non-main thread is silently dropped from the log (not detected). Collect results in the thread and log them from the keyword's own thread.
  • A decorator without functools.wraps hides the signature: the keyword takes only *args, **kwargs and loses conversion (→ signature_lost). Add @functools.wraps(func) to the wrapper.
  • Listener methods (end_test, close, …) on a class that is also a library become keywords unless the class uses @library(listener="SELF") (→ listener_method_exposed).
  • Importing the same library twice with different arguments needs AS names, otherwise the second import is ignored with a warning (not detected; it lives in .robot data).

When to read the references

ReadWhen
references/conversion.mdChoosing argument types: built-ins, Enum, Literal, TypedDict, containers, unions, Secret, custom converters
references/api-variants.mdModule vs class details, scope and init arguments, embedded arguments, async, hybrid and dynamic APIs, PythonLibCore, Remote
references/listeners.mdWriting a listener (API v3), a library that is also a listener, listener priority, changing results
references/communication.mdExceptions, HTML messages, logging levels, threads, timeouts, calling BuiltIn from a library
references/packaging-and-docs.mdlibdoc output, doc formats, versioning, packaging a library with resources, tests for a library

The runnable examples in assets/examples/ (ExampleLibrary.py, converters.py, ResultListener.py and their suites) pass with uv run robot --pythonpath assets/examples --listener ResultListener assets/examples.

Companion Skills

NeedSkill
Write tests, suites, user keywords, resources and variables in Robot Framework syntaxrf-language
Install Robot Framework or a library, fix the environmentrf-setup

For running, discovering, keyword documentation, result analysis and debugging with the robotcode CLI, use the robotcode skill of the robotcode plugin (robotcode@robotframework-agent-plugins); the commands above work without it.

Συνοδευτικά αρχεία

Το μοντέλο τα διαβάζει όποτε χρειάζεται, όσο η δεξιότητα είναι φορτωμένη. Διατίθενται ως αρχεία για ανάγνωση και δεν εκτελούνται ποτέ.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Rf Python Library;

Use first, before answering, to write or fix Robot Framework keyword libraries or listeners in Python.

Γιατί να χρησιμοποιήσετε τη δεξιότητα Rf Python Library στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Rf Python Library είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη Rf Python Library στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε το https://github.com/manykarim/robotframework-agentskills/tree/main/plugins/rf-agentskills/skills/rf-python-library. Το TypingMind διαβάζει το αρχείο SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Rf Python Library;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη Rf Python Library;

Με όσα θέλετε. Εφόσον ένα μοντέλο υποστηρίζει δεξιότητες, μπορείτε να χρησιμοποιήσετε τη Rf Python Library με αυτό — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama και άλλα — όλα στο TypingMind με τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Rf Python Library;

Ναι. Δημοσιεύεται στο GitHub από τον χρήστη manykarim με την άδεια χρήσης Apache-2.0. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων

Στήστε δικό σας χώρο εργασίας AI τώρα

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇