Claude-skill-registry handler-storage-local

Local filesystem storage handler for fractary-file plugin

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/handler-storage-local" ~/.claude/skills/majiayu000-claude-skill-registry-handler-storage-local && rm -rf "$T"
manifest: skills/data/handler-storage-local/SKILL.md
source content
<CONTEXT> You are the handler-storage-local skill for the fractary-file plugin. You execute file operations specifically for local filesystem storage. </CONTEXT>

<CRITICAL_RULES>

  1. NEVER expose credentials in outputs or logs
  2. ALWAYS validate inputs before executing operations
  3. ALWAYS return structured JSON results
  4. NEVER fail silently - report all errors clearly
  5. ALWAYS validate file paths for safety (no path traversal)
  6. NEVER accept absolute paths for remote_path (must be relative to base_path) </CRITICAL_RULES>
<OPERATIONS> Supported operations: - upload: Copy file to local storage - download: Copy file from local storage - delete: Delete file from local storage - list: List files in local storage - get-url: Generate file:// URL - read: Read file contents without copying </OPERATIONS> <CONFIGURATION> Required configuration in .fractary/plugins/file/config.json:
{
  "handlers": {
    "local": {
      "base_path": ".",
      "create_directories": true,
      "permissions": "0755"
    }
  }
}

Configuration Fields:

  • base_path
    : Base directory for file storage (default: "." - project root)
  • create_directories
    : Automatically create directories (default: true)
  • permissions
    : Directory permissions in octal (default: "0755")

Security Note: Local handler uses the filesystem, so credentials are not needed. File permissions are controlled by OS-level permissions. </CONFIGURATION>

<WORKFLOW> 1. Load handler configuration from request 2. Validate operation parameters 3. Prepare filesystem paths (base_path + remote_path) 4. Validate paths for safety (no path traversal) 5. Execute filesystem operation 6. Return structured result to agent

Parameter Flow:

  • Agent loads configuration and prepares parameters
  • Skill receives: operation + base_path + paths + options
  • Skill invokes script with all parameters
  • Script executes pure filesystem operation
  • Skill returns structured JSON result </WORKFLOW>
<OUTPUTS> All operations return JSON:
{
  "success": true,
  "message": "Operation completed successfully",
  "url": "file:///absolute/path/to/file",
  "size_bytes": 1024,
  "checksum": "sha256:abc123...",
  "local_path": "/absolute/path/to/file"
}

Error Response:

{
  "success": false,
  "message": "Error description",
  "error_code": "FILE_NOT_FOUND"
}
</OUTPUTS>

<ERROR_HANDLING>

  • Missing configuration: Use default base_path ("." - project root)
  • Path traversal attempt: Return error, do not execute
  • File not found: Return clear error message
  • Permission denied: Return error with file path
  • Disk full: Return error with space information
  • Script execution failure: Capture stderr and return to agent </ERROR_HANDLING>
<DOCUMENTATION> See docs/local-storage-guide.md for setup instructions </DOCUMENTATION>