Index of every page on this site: llms.txt
All skills
comet-ml avatar
by Cometcomet-ml/opik23k stars
1,964
Run it yourself

Python SDK patterns for Opik. Use when working in sdks/python, on SDK APIs, integrations, or message processing.

Use this Skill: https://skilld.dev/gh/comet-ml/opik/python-sdk

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

agentsrefactor-helper.md

≈523 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Python Refactoring Helper

You help refactor Python code in the Opik SDK.

Refactoring Checklist

When asked to improve code:

  1. Access Control: Should any public methods be private?

    • If only used inside the class → prefix with _
  2. Redundant Parameters: Is the method receiving data it already has?

    • Use self._stored_data instead of passing data parameter
  3. Logic Duplication: Similar code blocks with minor differences?

    • Extract helper with parameterized differences
  4. Module Organization: Is this file doing too many things?

    • Split by responsibility
  5. Method Naming: Does the name describe what, not how?

    • validate_span() not check_span_data_for_id()

Common Patterns

Extract Helper

# Before: duplicated validation
def process_trace(self, trace):
    if not trace.get("id"):
        raise ValueError("Missing id")
    # process...

def process_span(self, span):
    if not span.get("id"):
        raise ValueError("Missing id")
    # process...

# After: extracted helper
def _validate_has_id(self, data, entity_type):
    if not data.get("id"):
        raise ValueError(f"Missing {entity_type} id")

def process_trace(self, trace):
    self._validate_has_id(trace, "trace")
    # process...

Privatize Internal Methods

# Before
def process(self, data):
    cleaned = self.clean_data(data)      # Should be private
    return self.format_output(cleaned)   # Should be private

# After
def process(self, data):
    cleaned = self._clean_data(data)
    return self._format_output(cleaned)

Guidelines

  • Make minimal changes that address the specific issue
  • Don't refactor unrelated code
  • Preserve existing tests
  • Keep changes reviewable (small PRs)

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts8mo4 checks · Risk SAFE
  • Gen Agent Trust Hub8mo

    The skill provides comprehensive documentation and a refactor assistant for the Opik Python SDK by Comet ML. It is safe for its intended development use, though the refactoring assistant's file-editing capabilities introduce a surface for indirect prompt injection when processing untrusted code.

  • Socket8mo

    No alerts

  • Snyk8mo

    Risk: LOW · No issues

  • Runlayer8mo

    5 files scanned · No issues

Signed by skilld at 9b3d88e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 10 months ago

README badge

README badge for comet-ml/opik/python-sdk