NAME
Skilletor::Cache - Where a git or url source is cached – the reference's cache naming
VERSION
version 0.001
SYNOPSIS
use Skilletor::Cache qw( cache_root git_cache_dir url_cache_dir );
my $root = cache_root( $ENV{HOME} ); # ~/.claude/skilletor/cache
my $dir = git_cache_dir( $root, 'https://github.com/Getty/skills', 'main' );
my $tgz = url_cache_dir( $root, 'https://skills.example.com/skills.tar.gz' );
DESCRIPTION
Both implementations fetch into one cache, so they must name every cache directory alike. A git source's identity is its URL alone when it has no ref (the cache layout before skilletor 0.3.1, kept for unpinned sources), else JSON.stringify([url, ref]); a url source's identity is its URL. The directory is the first 16 hex digits of the sha256 of the identity's UTF-8 bytes, beneath the cache root.
cache_root
cache_root($home);
<home>/.claude/skilletor/cache, the cache root of a CLI run.
cache_name
The 16-hex-digit directory name of an identity.
git_identity
git_identity( $url, $ref );
git_cache_dir
git_cache_dir( $root, $url, $ref );
url_cache_dir
url_cache_dir( $root, $url );
CACHE_NAME_RE
The pattern a cache directory's name matches; the sweeps touch nothing else.
SUPPORT
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.