Agent Skill
2/7/2026

prepare-extension-metadata

Prepare and generate all required metadata files for Extension Index submission

B
benzwick
0GitHub Stars
2Views
npx skills add benzwick/SlicerAdaptiveBrush

SKILL.md

Nameprepare-extension-metadata
DescriptionPrepare and generate all required metadata files for Extension Index submission

name: prepare-extension-metadata description: Prepare and generate all required metadata files for Extension Index submission allowed-tools:

  • WebFetch
  • Bash
  • Read
  • Write
  • Grep context: manual

Prepare Extension Metadata Skill

Prepare and generate all required metadata files for Extension Index submission.

When to Use

Use this skill when:

  • Ready to prepare extension for submission
  • Need to update CMakeLists.txt metadata
  • Need to generate the Extension Index JSON file
  • Need to verify metadata consistency

CRITICAL: Verify Latest Schema First

Before generating files, ALWAYS fetch the latest JSON schema:

# Fetch current schema to verify required/optional fields
curl -s "https://raw.githubusercontent.com/Slicer/Slicer/main/Schemas/slicer-extension-catalog-entry-schema-v1.0.1.json"

If schema version or fields have changed, the fetched schema is authoritative.

Official Sources


Step 1: Gather Required Information

Collect the following from the user or repository:

For CMakeLists.txt

FieldDescriptionExample
EXTENSION_HOMEPAGEURL to documentation/READMEhttps://github.com/user/repo#readme
EXTENSION_CONTRIBUTORSNames with affiliations"Jane Doe (University), John Smith (Company)"
EXTENSION_DESCRIPTION1-2 sentence summary"Adaptive brush for intelligent segmentation"
EXTENSION_ICONURLRaw PNG URL (128x128 recommended)https://raw.githubusercontent.com/user/repo/main/Icon.png
EXTENSION_SCREENSHOTURLSSpace-separated raw URLs"https://raw.githubusercontent.com/.../1.png https://...2.png"
EXTENSION_DEPENDSOther extensions required, or "NA""NA" or "SlicerIGT SlicerOpenIGTLink"

For Extension Index JSON

FieldRequiredDescription
$schemaYesSchema URL (use current version)
categoryYesExtension category (e.g., "Utilities", "Segmentation")
scm_urlYesGit clone URL ending in .git
scm_revisionNoBranch name (recommended) or commit hash
scm_typeNoDefault: "git"
build_dependenciesNoArray of extension names required to build
build_subdirectoryNoDefault: "." (use "inner-build" for superbuild)
enabledNoDefault: true
tierNoDefault: 1 (set based on checklist completion)

Step 2: Update CMakeLists.txt

Locate and update the extension metadata section:

#-----------------------------------------------------------------------------
# Extension meta-information
set(EXTENSION_HOMEPAGE "https://github.com/USERNAME/REPONAME#readme")
set(EXTENSION_CONTRIBUTORS "Contributor Name (Affiliation)")
set(EXTENSION_DESCRIPTION "Brief 1-2 sentence description of extension functionality")
set(EXTENSION_ICONURL "https://raw.githubusercontent.com/USERNAME/REPONAME/main/ExtensionIcon.png")
set(EXTENSION_SCREENSHOTURLS "https://raw.githubusercontent.com/USERNAME/REPONAME/main/Screenshots/screenshot1.png")
set(EXTENSION_DEPENDS "NA") # Or list of extension names

Validation Checks

  1. No placeholder URLs - Replace all example.com references
  2. Raw GitHub URLs for images - Must start with https://raw.githubusercontent.com/
  3. Description is concise - 1-2 sentences, no line breaks
  4. Contributors include affiliations - Format: "Name (Affiliation)"

Step 3: Generate Extension Index JSON File

Create ExtensionName.json for the ExtensionsIndex repository:

{
  "$schema": "https://raw.githubusercontent.com/Slicer/Slicer/main/Schemas/slicer-extension-catalog-entry-schema-v1.0.1.json#",
  "build_dependencies": [],
  "build_subdirectory": ".",
  "category": "CATEGORY_HERE",
  "scm_revision": "main",
  "scm_url": "https://github.com/USERNAME/REPONAME.git",
  "tier": 1
}

Category Options (Common)

  • Diffusion - Diffusion MRI processing
  • IGT - Image-guided therapy
  • Informatics - Data management, DICOM
  • Quantification - Measurements, analysis
  • Registration - Image registration
  • Segmentation - Image segmentation
  • Utilities - General utilities

Build Subdirectory

  • Use . for standard CMake extensions
  • Use inner-build for Superbuild extensions (those with external dependencies)

Step 4: Verify Metadata Consistency

Ensure CMakeLists.txt and JSON file are consistent:

# Extract dependencies from CMakeLists.txt
grep "EXTENSION_DEPENDS" CMakeLists.txt

# Compare with JSON build_dependencies
cat ExtensionName.json | jq '.build_dependencies'

Consistency Rules

CMakeLists.txtJSON File
EXTENSION_DEPENDS "NA"build_dependencies: []
EXTENSION_DEPENDS "ExtA ExtB"build_dependencies: ["ExtA", "ExtB"]

Step 5: Verify URLs Are Accessible

# Test icon URL
curl -sI "ICON_URL" | grep -E "^HTTP|^Content-Type"

# Test screenshot URLs
curl -sI "SCREENSHOT_URL" | grep -E "^HTTP|^Content-Type"

# Test homepage URL
curl -sI "HOMEPAGE_URL" | grep -E "^HTTP"

Expected results:

  • HTTP/2 200 or HTTP/1.1 200 OK
  • Content-Type: image/png for images

SlicerAdaptiveBrush Specific Values

For this extension, use:

set(EXTENSION_HOMEPAGE "https://github.com/benzwick/SlicerAdaptiveBrush#readme")
set(EXTENSION_CONTRIBUTORS "Ben Zwick (contributor)")
set(EXTENSION_DESCRIPTION "Adaptive brush segment editor effect that automatically segments regions based on image intensity similarity, adapting to image features rather than using a fixed geometric shape.")
set(EXTENSION_ICONURL "https://raw.githubusercontent.com/benzwick/SlicerAdaptiveBrush/main/AdaptiveBrush.png")
set(EXTENSION_SCREENSHOTURLS "https://raw.githubusercontent.com/benzwick/SlicerAdaptiveBrush/main/Screenshots/screenshot1.png")
set(EXTENSION_DEPENDS "NA")
{
  "$schema": "https://raw.githubusercontent.com/Slicer/Slicer/main/Schemas/slicer-extension-catalog-entry-schema-v1.0.1.json#",
  "build_dependencies": [],
  "build_subdirectory": ".",
  "category": "Segmentation",
  "scm_revision": "main",
  "scm_url": "https://github.com/benzwick/SlicerAdaptiveBrush.git",
  "tier": 1
}

Note: Verify the GitHub username and URLs match the actual repository before using.


Output Files

After running this skill, you should have:

  1. Updated CMakeLists.txt - In extension repository with correct metadata
  2. SlicerAdaptiveBrush.json - Ready to submit to ExtensionsIndex repository
  3. Verification output - Confirming all URLs are accessible

Next Steps

After preparing metadata:

  1. Commit CMakeLists.txt changes to extension repository
  2. Push to GitHub
  3. Run /validate-extension-submission to verify readiness
  4. Run /extension-submission-checklist to review all requirements
  5. Submit PR to ExtensionsIndex
Skills Info
Original Name:prepare-extension-metadataAuthor:benzwick