What Input Formats Does SkillSpector Support? Git URLs, ZIP, and Local Directories Explained
SkillSpector accepts five input formats—Git repository URLs, raw file URLs, local ZIP archives, single Markdown files, and local directories—normalizing each into a local directory via the InputHandler.resolve() method in src/skillspector/input_handler.py.
NVIDIA's SkillSpector analyzes codebases to extract skills and build knowledge graphs. Understanding the SkillSpector input formats is essential for integrating the tool into various workflows, whether you're analyzing remote repositories or local project files. The InputHandler class in src/skillspector/input_handler.py serves as the entry point, automatically detecting and normalizing all supported formats into scan-ready local directories.
Supported Input Formats
SkillSpector recognizes five distinct source types through specific detection logic implemented in the resolve method (lines 55-84).
Git Repository URLs
SkillSpector clones both HTTPS and SSH Git URLs using the _is_git_url helper method (lines 105-117). When you provide a repository URL like https://github.com/example/project, the handler clones the repository to a temporary directory and returns the path with source type "git".
Raw File URLs
Direct HTTP/HTTPS links to individual files are handled via the _is_file_url logic (lines 119-124). This allows analysis of single scripts or documentation files hosted remotely. The file downloads to a temporary location and receives source type "url".
Local ZIP Archives
Any path ending in .zip triggers the archive handling workflow. The resolve method utilizes _download_file (lines 150-168) for remote ZIPs or direct extraction via _extract_zip (lines 173-188) for local files. Contents extract to a temporary directory with source type "zip".
Single Markdown Files
When the input path ends with .md, SkillSpector treats it as a single file input. The _wrap_single_file method (lines 191-199) prepares the file for processing, returning a temporary directory path and source type "file". This works for both local .md files and downloaded Markdown documents.
Local Directories
Existing directories are validated using Path(input_path).is_dir() within the resolve method. Unlike other formats, directories return as-is without copying to temporary storage, with source type "directory".
How Input Normalization Works
The InputHandler.resolve() method (lines 55-84 in src/skillspector/input_handler.py) implements a cascading detection logic. It checks inputs in order: Git URLs, file URLs, ZIP extensions, Markdown extensions, and finally directory existence. Each branch returns a tuple of (Path, str) representing the normalized directory and source type identifier.
Temporary files created during Git cloning, downloading, or ZIP extraction are tracked internally. Call handler.cleanup() after processing to remove these temporary directories.
Practical Code Examples
The following examples demonstrate how to process each supported input format:
from skillspector.input_handler import InputHandler
handler = InputHandler()
# 1️⃣ Git repository URL
repo_path, src_type = handler.resolve("https://github.com/example/project")
print(repo_path, src_type) # → <temp>/repo "git"
# 2️⃣ Raw file URL (markdown)
file_path, src_type = handler.resolve("https://raw.githubusercontent.com/example/project/main/README.md")
print(file_path, src_type) # → <temp> "url"
# 3️⃣ Local ZIP archive
zip_path, src_type = handler.resolve("/home/user/project.zip")
print(zip_path, src_type) # → <temp>/extracted "zip"
# 4️⃣ Single markdown file on disk
md_path, src_type = handler.resolve("/home/user/notes.md")
print(md_path, src_type) # → <temp> "file"
# 5️⃣ Local directory
dir_path, src_type = handler.resolve("/home/user/source-code")
print(dir_path, src_type) # → /home/user/source-code "directory"
# Clean up any temporary files created during the run
handler.cleanup()
All calls return a Path pointing to a directory ready for scanning and a string indicating the detected source type.
Summary
- SkillSpector input formats include Git URLs, raw file URLs, ZIP archives, Markdown files, and local directories
- The
InputHandlerclass insrc/skillspector/input_handler.pyautomatically detects input types using specific validation logic in theresolvemethod - All inputs normalize to local directory paths, with remote sources cached in temporary directories
- Source type strings (
"git","url","zip","file","directory") indicate how the input was processed - Always call
cleanup()on the handler instance to remove temporary files after analysis
Frequently Asked Questions
Does SkillSpector support SSH Git URLs?
Yes. The _is_git_url method in src/skillspector/input_handler.py (lines 105-117) recognizes both HTTPS and SSH formats, including git@github.com:user/repo.git. The handler clones these repositories to temporary directories for analysis.
Can SkillSpector analyze ZIP files downloaded from the internet?
Yes. When provided with a URL ending in .zip, the resolve method downloads the archive using _download_file (lines 150-168) and automatically extracts it using _extract_zip (lines 173-188). The extracted contents are then processed as a local directory.
What happens to temporary files after processing?
Temporary directories created for Git clones, downloads, and ZIP extractions persist until explicitly removed. The InputHandler provides a cleanup() method to delete all temporary resources created during the session.
Does SkillSpector preserve the original directory when analyzing local folders?
Yes. Unlike remote inputs that are copied to temporary directories, local directories are returned as-is with source type "directory", preserving the original filesystem structure and avoiding unnecessary copy operations.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →