synapse-action-development

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.

16 stars

Best use case

synapse-action-development is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using synapse-action-development should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/synapse-action-development/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/data-ai/synapse-action-development/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/synapse-action-development/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How synapse-action-development Compares

Feature / Agentsynapse-action-developmentStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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

```python
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

```python
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

| Criteria | Function-Based | Class-Based |
|----------|----------------|-------------|
| Complexity | Simple, single-purpose | Complex, multi-step |
| State | Stateless | Can use helper methods |
| Semantic types | Limited | Full support |

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

## @action Decorator Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `name` | No | Action name (defaults to function name) |
| `description` | No | Human-readable description |
| `params` | No | Pydantic model for parameter validation |
| `result` | No | Pydantic model for result validation |
| `category` | No | PluginCategory for grouping |

### Category Parameter Examples

```python
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

| Attribute | Description |
|-----------|-------------|
| `action_name` | Action name for invocation |
| `category` | PluginCategory |
| `input_type` | Semantic input type for pipelines |
| `output_type` | Semantic output type for pipelines |
| `params_model` | Auto-extracted from generic |
| `result_model` | Optional 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:
- **[references/patterns.md](references/patterns.md)** - Parameter validation, semantic types
- **[references/categories.md](references/categories.md)** - Available PluginCategory values
- **[references/types-hierarchy.md](references/types-hierarchy.md)** - Semantic type system (DataType, Dataset, Model)
- **[references/pipelines.md](references/pipelines.md)** - ActionPipeline for chaining actions

Related Skills

synapse

16
from diegosouzapw/awesome-omni-skill

Multi-AI Agent Orchestration System with configurable models and role-based workflows. Use when you need to coordinate multiple AI agents (Claude, Gemini, Codex) for complex tasks like planning, code generation, analysis, review, and execution. Supports agentic workflow patterns: parallel specialists, pipeline, and swarm orchestration. Compatible with Claude Code, Cursor, and OpenCode. Triggers: 'orchestrate agents', 'multi-agent workflow', 'plan and execute', 'code review pipeline', 'run synapse', 'agentic workflow'.

subagent-driven-development

16
from diegosouzapw/awesome-omni-skill

Use when executing implementation plans with independent tasks in the current session

PolicyPulse Development

16
from diegosouzapw/awesome-omni-skill

AI-powered synthetic population simulator with clean architecture, Python type safety, and professional dashboard design patterns

Command Development

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.

ai-development-governance

16
from diegosouzapw/awesome-omni-skill

AI-augmented development controls, GitHub Copilot governance, LLM security, AI-generated code review per Hack23 Secure Development Policy

Agent Development

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.

action_logger

16
from diegosouzapw/awesome-omni-skill

Keep an audit trail of changes, commands, and verification.

action-mailer-coder

16
from diegosouzapw/awesome-omni-skill

Use when creating or refactoring Action Mailer emails. Applies Rails 7.1+ conventions, parameterized mailers, preview workflows, background delivery, and email design best practices.

python-github-actions

16
from diegosouzapw/awesome-omni-skill

Complete Python GitHub Actions system. PROACTIVELY activate for: (1) uv-based CI workflows (10-100x faster), (2) Matrix testing across Python versions, (3) Dependency caching with setup-uv, (4) Parallel test execution, (5) Reusable workflows, (6) Publishing to PyPI with trusted publishing, (7) Code coverage with codecov, (8) Security scanning. Provides: Workflow templates, caching config, matrix strategies, composite actions. Ensures fast, reliable CI/CD pipelines.

wordpress-plugin-development

16
from diegosouzapw/awesome-omni-skill

WordPress plugin development workflow covering plugin architecture, hooks, admin interfaces, REST API, and security best practices.

voice-ai-development

16
from diegosouzapw/awesome-omni-skill

Expert in building voice AI applications - from real-time voice agents to voice-enabled apps. Covers OpenAI Realtime API, Vapi for voice agents, Deepgram for transcription, ElevenLabs for synthesis...

sql-development

16
from diegosouzapw/awesome-omni-skill

T-SQL, stored procedures, and MS SQL Server DBA practices. Use when writing SQL queries, designing schemas, tuning SQL Server performance, managing backups, configuring security, or using SQL Server 2025+ features.