agentsclimarketplace

Action development

Skill datamaker-kr/synapse-claude-marketplace/dist/opencode/synapse-plugin-helper/.opencode/skills/action-development

시냅스 제품군 개발을 위한 공용 Claude Marketplace 입니다. 용도 및 목적 별 plugins 를 통해 claude plugins, agents, skills, commands 를 제공합니다.

Install
npx -y skills add datamaker-kr/synapse-claude-marketplace --skill action-development

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Explains how to create Synapse plugin actions. Use when the user asks to "create an action", "write an action", uses "@action decorator", "BaseAction class", "function-based action", "class-based action", "Pydantic params", "ActionPipeline", "DataType", "input_type", "output_type", "semantic types", "YOLODataset", "ModelWeights", "pipeline chaining", or needs help with synapse plugin action development.

SKILL.md

4.4 KB, as published. Nobody here has run it

Synapse Action Development

Synapse SDK provides two patterns for plugin actions: function-based (simple, stateless) and class-based (complex, stateful).

Quick Start: Function-Based Action

from pydantic import BaseModel
from synapse_sdk.plugins.decorators import action
from synapse_sdk.plugins.context import RuntimeContext

class TrainParams(BaseModel):
    epochs: int = 10
    learning_rate: float = 0.001

@action(name='train', description='Train a model', params=TrainParams)
def train(params: TrainParams, ctx: RuntimeContext) -> dict:
    for epoch in range(params.epochs):
        ctx.set_progress(epoch + 1, params.epochs)
    return {'status': 'completed'}

Quick Start: Class-Based Action

from pydantic import BaseModel
from synapse_sdk.plugins.action import BaseAction

class InferParams(BaseModel):
    model_path: str
    threshold: float = 0.5

class InferAction(BaseAction[InferParams]):
    action_name = 'inference'

    def execute(self) -> dict:
        self.set_progress(0, 100)
        # Implementation here
        return {'predictions': []}

When to Use Each Pattern

CriteriaFunction-BasedClass-Based
ComplexitySimple, single-purposeComplex, multi-step
StateStatelessCan use helper methods
Semantic typesLimitedFull support

Recommendation: Start with function-based. Use class-based when needing helper methods or semantic type declarations.

@action Decorator Parameters

ParameterRequiredDescription
nameNoAction name (defaults to function name)
descriptionNoHuman-readable description
paramsNoPydantic model for parameter validation
resultNoPydantic model for result validation
categoryNoPluginCategory for grouping

Category Parameter Examples

from synapse_sdk.plugins.decorators import action
from synapse_sdk.plugins.constants import PluginCategory

# Training action
@action(
    name='train',
    category=PluginCategory.NEURAL_NET,
    description='Train object detection model'
)
def train(params, ctx):
    ...

# Export action
@action(
    name='export_coco',
    category=PluginCategory.EXPORT,
    description='Export to COCO format'
)
def export_coco(params, ctx):
    ...

# Smart tool (AI-assisted annotation)
@action(
    name='auto_segment',
    category=PluginCategory.SMART_TOOL,
    description='Auto-segmentation tool'
)
def auto_segment(params, ctx):
    ...

# Pre-annotation
@action(
    name='pre_label',
    category=PluginCategory.PRE_ANNOTATION,
    description='Pre-label with model predictions'
)
def pre_label(params, ctx):
    ...

Available Categories: NEURAL_NET, EXPORT, UPLOAD, SMART_TOOL, PRE_ANNOTATION, POST_ANNOTATION, DATA_VALIDATION, CUSTOM

BaseAction Class Attributes

AttributeDescription
action_nameAction name for invocation
categoryPluginCategory
input_typeSemantic input type for pipelines
output_typeSemantic output type for pipelines
params_modelAuto-extracted from generic
result_modelOptional result schema

Available Methods in BaseAction

  • self.params - Validated parameters
  • self.ctx - RuntimeContext
  • self.logger - Logger shortcut
  • self.set_progress(current, total, category) - Progress tracking
  • self.set_metrics(value, category) - Metrics recording
  • self.log(event, data, file) - Event logging

Additional Resources

For detailed patterns and advanced techniques:

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.