AgentSkillsCN

synapse-config-yaml-guide

讲解如何编写 Synapse 插件的 config.yaml 文件。当用户询问“config.yaml”、“插件配置”、“动作定义”、“执行方式”、“运行环境”,或需要帮助配置 Synapse 插件设置时,可选用此技能。

SKILL.md
--- frontmatter
name: synapse-config-yaml-guide
description: Explains how to write Synapse plugin config.yaml files. Use when the user asks about "config.yaml", "plugin configuration", "action definition", "execution method", "runtime environment", or needs help with synapse plugin settings.

Synapse Plugin config.yaml Guide

The config.yaml file (or synapse.yaml) defines your plugin's metadata, actions, and runtime configuration.

Minimal Example

yaml
name: "My Plugin"
code: my-plugin
version: 1.0.0
category: custom

actions:
  train:
    entrypoint: plugin.train:TrainAction
    method: job
    description: "Train a model"

Complete Structure

yaml
# Basic metadata
name: "YOLOv8 Object Detection"
code: yolov8
version: 1.0.0
category: neural_net
description: "Train and run YOLOv8 models"
readme: README.md

# Package management
package_manager: pip  # or 'uv'
package_manager_options: []
wheels_dir: wheels

# Environment variables
env:
  DEBUG: "false"
  BATCH_SIZE: "32"

# Runtime environment (Ray)
runtime_env: {}

# Data type configuration
data_type: image
tasks:
  - image.object_detection
  - image.segmentation

# Actions
actions:
  train:
    entrypoint: plugin.train:TrainAction
    method: job
    description: "Train YOLO model"
  inference:
    entrypoint: plugin.inference:run
    method: task
    description: "Run inference"

Action Configuration

FieldRequiredDescription
entrypointYesModule path (module.path:ClassName or module.path.function)
methodNoExecution method: job, task, or serve (default: task)
descriptionNoHuman-readable description

Config Sync (Recommended)

Sync entrypoints, input/output types, and hyperparameters from code:

bash
synapse plugin update-config

Execution Methods

MethodUse CaseCharacteristics
jobTraining, batch processingAsync, isolated, long-running (100s+)
taskInteractive operationsSync, fast startup (<1s), serial per actor
serveModel serving, inferenceREST API endpoint, auto-scaling

Entrypoint Formats

Both formats are supported:

  • Colon notation: plugin.train:TrainAction
  • Dot notation: plugin.train.TrainAction

Additional Resources

For detailed configuration options: