prepare-extension-metadata
Prepare and generate all required metadata files for Extension Index submission
SKILL.md
| Name | prepare-extension-metadata |
| Description | Prepare 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
- JSON Schema: https://github.com/Slicer/Slicer/blob/main/Schemas/slicer-extension-catalog-entry-schema-v1.0.1.json
- Example Extensions: https://github.com/Slicer/ExtensionsIndex (browse .json files)
Step 1: Gather Required Information
Collect the following from the user or repository:
For CMakeLists.txt
| Field | Description | Example |
|---|---|---|
| EXTENSION_HOMEPAGE | URL to documentation/README | https://github.com/user/repo#readme |
| EXTENSION_CONTRIBUTORS | Names with affiliations | "Jane Doe (University), John Smith (Company)" |
| EXTENSION_DESCRIPTION | 1-2 sentence summary | "Adaptive brush for intelligent segmentation" |
| EXTENSION_ICONURL | Raw PNG URL (128x128 recommended) | https://raw.githubusercontent.com/user/repo/main/Icon.png |
| EXTENSION_SCREENSHOTURLS | Space-separated raw URLs | "https://raw.githubusercontent.com/.../1.png https://...2.png" |
| EXTENSION_DEPENDS | Other extensions required, or "NA" | "NA" or "SlicerIGT SlicerOpenIGTLink" |
For Extension Index JSON
| Field | Required | Description |
|---|---|---|
| $schema | Yes | Schema URL (use current version) |
| category | Yes | Extension category (e.g., "Utilities", "Segmentation") |
| scm_url | Yes | Git clone URL ending in .git |
| scm_revision | No | Branch name (recommended) or commit hash |
| scm_type | No | Default: "git" |
| build_dependencies | No | Array of extension names required to build |
| build_subdirectory | No | Default: "." (use "inner-build" for superbuild) |
| enabled | No | Default: true |
| tier | No | Default: 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
- No placeholder URLs - Replace all
example.comreferences - Raw GitHub URLs for images - Must start with
https://raw.githubusercontent.com/ - Description is concise - 1-2 sentences, no line breaks
- 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 processingIGT- Image-guided therapyInformatics- Data management, DICOMQuantification- Measurements, analysisRegistration- Image registrationSegmentation- Image segmentationUtilities- General utilities
Build Subdirectory
- Use
.for standard CMake extensions - Use
inner-buildfor 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.txt | JSON 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 200orHTTP/1.1 200 OKContent-Type: image/pngfor 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:
- Updated
CMakeLists.txt- In extension repository with correct metadata SlicerAdaptiveBrush.json- Ready to submit to ExtensionsIndex repository- Verification output - Confirming all URLs are accessible
Next Steps
After preparing metadata:
- Commit CMakeLists.txt changes to extension repository
- Push to GitHub
- Run
/validate-extension-submissionto verify readiness - Run
/extension-submission-checklistto review all requirements - Submit PR to ExtensionsIndex