Command Palette

Search for a command to run...

Назад к скиллам
скилл № 39734

scistudio-write-block

Use when the user needs a new block: a Python class in `blocks/<name>.py` with typed ports, a config schema, and run logic (process, IO, app, code, or…

БесплатноБез исполняемых скриптов
jiazhenz026от jiazhenz026★ 30 звёзд на GitHub

Установить scistudio-write-block в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

scistudio-write-block

1. What a block is

A block is one typed step of a workflow: a Python class with named input and output ports, a config_schema for its parameters, and a run that turns input collections into output collections. Every port carries a Collection. A block in blocks/<name>.py belongs to this project; moved to My Library, it is available in every project.

A block can take several shapes. None is preferred; pick the one that fits, and reach for a richer one only when it genuinely helps the user:

  • Process block — computes outputs from inputs (ProcessBlock, or Block for full control of run).
  • IO block — reads or writes a file format (SimpleLoader, SimpleSaver). Workflows never use it as a node: core load_data / save_data route to it.
  • App block — hands the step to a desktop application (AppBlock). To run a project script, add the built-in Code Block to the workflow and configure it; do not write a block for it.
  • Interactive block — pauses the run so the user makes a data-dependent decision in a window, then computes outputs from that decision.

2. Steps to write a block

  1. Check for reuse. Call list_blocks; if a block's ports and config already match, use it and stop. Build new only when nothing fits, and say why in the new block's docstring.
  2. Choose types and shape. Call list_types and give every input and output port the most fitting registered type (Image over Array, DataFrame over DataObject). Using DataObject as a port type is forbidden. Decide the shape (§1).
  3. Scaffold. Call scaffold_block(name=..., category=..., input_ports=..., output_ports=..., description=...) and read every entry in warnings.
  4. Write the logic. Study a similar real block with list_block_examples and read_block_source, then fill in run or process_item in blocks/<name>.py. Fill every EDIT THIS section and replace every Describe ... placeholder the scaffold left.
  5. Make it usable. Label everything the user sees (see the table below), and give the block a look of its own if you like (see below).
  6. For an interactive block, follow "Use interactive blocks" below.
  7. Load and test. Call reload_blocks, confirm the block appears in list_blocks, then run_block_tests type_name="<registered name>" and read the output verbatim.
  8. Use it. Add the block to a workflow with scistudio-build-workflow (an IO block through core load_data / save_data), run it, and confirm its outputs before telling the user it works.

Make it usable — label everything the user sees

The user drives your block from the GUI, where the only thing they see is the text you put on these fields. Fill all of them with short, clear, human language — a non-programmer must be able to tell ports and parameters apart (three ports all typed Image with no names/descriptions are unusable):

Where users see it Field(s) to write
Palette + node header block name (a real label, not MyBlock) and one-line description
Each input/output port a distinct name and a description (what flows here, e.g. "raw image" vs "binary mask" vs "overlay")
Each parameter panel field the config_schema property's title (the label) and description (what it does / units / when to change it)
In the code short, plain comments explaining the why, not the obvious

Distinct names + a one-line description per port and per parameter is the bar. A value the user may reasonably want to change usually belongs in config_schema (with a title/description and a sane default) rather than buried as an unreachable constant — though a hard-coded value is fine when it is intrinsic or a convenient default. Read each parameter in run with config.get("<name>").

Give it a look (optional). If you like, choose an icon and color that make the block easy to recognise on the canvas: ui_icon takes a Lucide icon name that fits what the block does (an unknown name falls back to the category icon), and ui_color takes a CSS hex color. Leaving both unset uses the category default.

Use interactive blocks

An interactive block pauses the workflow at its step, shows the user a window built from the step's data, takes one decision, and computes its outputs from that decision. Use it when a value can only be judged by looking at the specific data — which items go where, where a threshold falls, which region to keep. The decision is recorded with the run, so the step stays reproducible. For example, when the user wants to manually pick the peak when doing spectral peak picking, or when the user wants to edit segmentation labels manually after cell segmentation, it's time to use interactive blocks.

The block runs in two phases, each in its own process:

  1. Prepare the view. prepare_prompt(inputs, config) turns the real inputs into the plain-JSON
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл scistudio-write-block?

Use when the user needs a new block: a Python class in `blocks/<name>.py` with typed ports, a config schema, and run logic (process, IO, app, code, or interactive). Call list_blocks first and reuse a block that already fits. Not for adding an existing block to a workflow (scistudio-build-workflow) or changing a node's config (update_block_config).

Как установить скилл scistudio-write-block?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл scistudio-write-block запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить scistudio-write-block с