Explains result schema classes for Synapse plugin actions. Use when the user mentions "TrainResult", "InferenceResult", "ExportResult", "UploadResult", "WeightsResult", "MetricsResult", "result_model", "result schema", or needs help with action return type validation.
View on GitHubdatamaker-kr/synapse-claude-marketplace
synapse-plugin-helper
plugins/synapse-plugin-helper/skills/result-schemas/SKILL.md
February 5, 2026
Select agents to install to:
npx add-skill https://github.com/datamaker-kr/synapse-claude-marketplace/blob/main/plugins/synapse-plugin-helper/skills/result-schemas/SKILL.md -a claude-code --skill synapse-result-schemasInstallation paths:
.claude/skills/synapse-result-schemas/# Result Schemas
Synapse SDK provides standardized result schema classes for common action outputs. These provide type-safe, validated return types for actions.
## Available Result Schemas
```python
from synapse_sdk.plugins.schemas import (
TrainResult,
InferenceResult,
ExportResult,
UploadResult,
WeightsResult,
MetricsResult,
)
```
| Schema | Purpose |
|--------|---------|
| `TrainResult` | Training output with weights and metrics |
| `InferenceResult` | Inference predictions |
| `ExportResult` | Data export output |
| `UploadResult` | File upload results |
| `WeightsResult` | Model weights only |
| `MetricsResult` | Evaluation metrics only |
## Quick Usage
### With Class-Based Actions
```python
from synapse_sdk.plugins.actions.train import BaseTrainAction
from synapse_sdk.plugins.schemas import TrainResult
class MyTrainAction(BaseTrainAction[TrainParams]):
result_model = TrainResult # Enable result validation
def execute(self) -> TrainResult:
# ... training ...
return TrainResult(
weights_path='/models/best.pt',
final_epoch=100,
train_metrics={'loss': 0.05},
val_metrics={'mAP50': 0.85},
)
```
### With Function-Based Actions
```python
from synapse_sdk.plugins.decorators import action
from synapse_sdk.plugins.schemas import InferenceResult
@action(name='infer', result=InferenceResult)
def infer(params: InferParams, ctx: RuntimeContext) -> InferenceResult:
return InferenceResult(
predictions=[{'class': 'dog', 'confidence': 0.95}],
processed_count=100,
)
```
## Schema Details
### TrainResult
```python
class TrainResult(BaseModel):
weights_path: str # Path to trained model
final_epoch: int # Last completed epoch
best_epoch: int | None # Best epoch by val metric
train_metrics: dict = {} # Final training metrics
val_metrics: dict = {} # Final validation metrics
```
### IIssues Found: