Skip to content

[Enhancement] Create a Claude skill from the InSituPy MCP server #430

Description

@jwrth

Summary

The InSituPy MCP server currently provides Claude with dynamic, on-demand access to API documentation, source code, and workflows at runtime. A complementary Claude skill (a SKILL.md file) would make this knowledge available upfront - without requiring tool calls - improving response quality and reducing latency for common coding tasks.

Motivation

  • The MCP server requires a running process and tool calls for every lookup
  • A skill bakes in the most important patterns so Claude "knows" them before writing any code
  • Skills and the MCP server are complementary: skill for common patterns, MCP for deep/dynamic introspection
  • Reduces the need to re-explain InSituPy conventions in every chat session

Proposed Strategy

Phase 1 - Content extraction

Use the MCP server's own tools to generate the skill content:

get_workflow_guide       → Standard workflows section
get_public_api           → API overview and submodule structure
get_plotting_api         → Plotting conventions
get_preprocessing_api    → Preprocessing conventions
get_tools_api            → Analysis tools
get_data_model           → InSituData/InSituExperiment structure
get_io_formats           → Supported input formats
get_result_types         → Output object patterns
get_spatialdata_api      → SpatialData interoperability
get_interactive_guide    → napari viewer usage
get_datasets_guide       → Sample datasets for examples

Phase 2 - Distillation

Condense the raw output into a concise SKILL.md with these sections:

  1. When to use this skill - trigger description for Claude's routing
  2. Core data model - InSituData, InSituExperiment, key attributes (cells.table, images, annotations)
  3. Common workflows - read → preprocess → cluster → visualize, multi-sample DGE, image registration
  4. API conventions - submodule shorthands (ispy.pl, ispy.pp, ispy.tl, ispy.io, ispy.im), parameter naming patterns
  5. Key gotchas - lazy loading behavior, pixel size requirements, segmentation layer switching, AnnData access patterns
  6. SpatialData interoperability - conversion patterns
  7. Code examples - one representative snippet per major workflow

Phase 3 - Integration and testing

  • Place SKILL.md in /mnt/skills/user/insitupy/ (or repo equivalent)
  • Test by prompting Claude with typical InSituPy tasks and verifying it applies patterns correctly without needing MCP tool calls
  • Iterate: add gotchas and examples discovered during testing

Notes

  • The skill should be kept concise - ideally under ~500 lines - to avoid bloating Claude's context
  • The MCP server remains valuable for deep lookups (source code, full docstrings, test files) that don't belong in a skill
  • The skill can be regenerated periodically as the API evolves, using the same MCP-based extraction approach

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions