Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

synapse-runtime-context-api

verified

Explains how to use Synapse RuntimeContext API. Use when the user asks about "RuntimeContext", "ctx.", "logging", "progress tracking", "set_progress", "set_metrics", "log_message", "BaseStepContext", "TrainContext", "ExportContext", "UploadContext", "InferenceContext", "AddTaskDataContext", or needs help with synapse plugin context and logging.

View on GitHub

Marketplace

synapse-marketplace

datamaker-kr/synapse-claude-marketplace

Plugin

synapse-plugin-helper

development

Repository

datamaker-kr/synapse-claude-marketplace
1stars

plugins/synapse-plugin-helper/skills/runtime-context-api/SKILL.md

Last Verified

February 5, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/datamaker-kr/synapse-claude-marketplace/blob/main/plugins/synapse-plugin-helper/skills/runtime-context-api/SKILL.md -a claude-code --skill synapse-runtime-context-api

Installation paths:

Claude
.claude/skills/synapse-runtime-context-api/
Powered by add-skill CLI

Instructions

# Synapse RuntimeContext API

RuntimeContext provides logging, progress tracking, and client access for plugin actions.

## Quick Reference

```python
from synapse_sdk.plugins.context import RuntimeContext

def train(params: TrainParams, ctx: RuntimeContext) -> dict:
    # Progress tracking
    ctx.set_progress(0, 100)

    # Metrics recording
    ctx.set_metrics({'loss': 0.05}, 'training')

    # User-facing message
    ctx.log_message('Training started', 'info')

    # Event logging
    ctx.log('checkpoint', {'epoch': 5}, '/path/to/file')

    # Debug logging
    ctx.log_dev_event('Debug info', {'data': 'value'})

    # Signal completion
    ctx.end_log()

    return {'status': 'completed'}
```

## Context Attributes

| Attribute | Type | Description |
|-----------|------|-------------|
| `ctx.logger` | BaseLogger | Logger instance |
| `ctx.env` | PluginEnvironment | Environment variables |
| `ctx.job_id` | str \| None | Job tracking ID |
| `ctx.client` | BackendClient \| None | API client |
| `ctx.agent_client` | AgentClient \| None | Ray operations client |
| `ctx.checkpoint` | dict \| None | Pretrained model info |

## Progress Tracking

```python
# Basic progress
ctx.set_progress(current=50, total=100)

# Progress with category (multi-phase)
ctx.set_progress(5, 10, category='download')
ctx.set_progress(3, 100, category='training')
```

## Metrics Recording

```python
ctx.set_metrics(
    value={'loss': 0.05, 'accuracy': 0.95},
    category='training'
)
```

## Logging Methods

| Method | Description |
|--------|-------------|
| `log(event, data, file)` | Log event with data |
| `log_message(message, context)` | User-facing message |
| `log_dev_event(message, data)` | Debug/dev event |
| `end_log()` | Signal completion |

## Message Contexts

```python
ctx.log_message('Success!', 'success')   # Green
ctx.log_message('Warning', 'warning')    # Yellow
ctx.log_message('Error', 'danger')       # Red
ctx.log_message('Info', 'info')          # Blue (default)
```

## 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3699 chars

Issues Found:

  • name_directory_mismatch