Claude-skill-registry file-reference-skill
Example skill demonstrating secure file reference resolution with supporting files
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/file-reference-skill" ~/.claude/skills/majiayu000-claude-skill-registry-file-reference-skill && rm -rf "$T"
manifest:
skills/data/file-reference-skill/SKILL.mdsource content
File Reference Skill
This skill demonstrates how to use supporting files (scripts, templates, documentation) within a skill directory.
Overview
This skill uses helper scripts and templates for data processing. All supporting files are accessible via relative paths from the skill's base directory.
Available Supporting Files
Scripts
- Main data processing scriptscripts/data_processor.py
- Input validation utilitiesscripts/validator.py
- Shell helper scriptscripts/helper.sh
Templates
- Configuration templatetemplates/config.yaml
- Report generation templatetemplates/report.md
Documentation
- Detailed usage instructionsdocs/usage.md
- Example use casesdocs/examples.md
Usage
When this skill is invoked with arguments, it can access supporting files using the FilePathResolver:
from pathlib import Path from skillkit.core.path_resolver import FilePathResolver # Get the skill's base directory (injected by BaseDirectoryProcessor) base_dir = Path("<base_directory_from_context>") # Resolve supporting files securely processor_script = FilePathResolver.resolve_path(base_dir, "scripts/data_processor.py") config_template = FilePathResolver.resolve_path(base_dir, "templates/config.yaml") usage_docs = FilePathResolver.resolve_path(base_dir, "docs/usage.md") # Read file contents with open(processor_script) as f: script_code = f.read()
Processing Arguments
The skill expects data file paths as arguments:
Example invocation:
file-reference-skill data/input.csv data/output.csv
Processing steps:
- Validate input using
scripts/validator.py - Process data using
scripts/data_processor.py - Generate report using
templates/report.md - Output results to specified location
Security Notes
- All file paths are validated to prevent directory traversal attacks
- Symlinks are resolved and verified to stay within skill directory
- Absolute paths and path traversal patterns (../) are blocked
- Any security violation raises PathSecurityError with detailed logging