NAME

Skilletor::Lock - A scope's lock file (skilletor.lock.json) – reading, writing, its keys

VERSION

version 0.001

SYNOPSIS

use Skilletor::Lock qw( read_lock key_to_type_name );

my $lock = read_lock("$project/.claude/skilletor.lock.json");
for my $key ( keys %$lock ) {
  my $it = key_to_type_name($key);    # { type => 'skill', name => 'perl-moo' }
  print "$it->{type} $it->{name} from $lock->{$key}{source}\n";
}

DESCRIPTION

The reference's lock.ts (spec §6.2): one lock per scope, <scope>/.claude/skilletor.lock.json, the ownership boundary of what skilletor installed. A resolve reads it to keep offering what an unreachable source or an unexpandable bundle installed before (spec §3, §15.4); a sync writes it (Skilletor::Apply), byte for byte as the reference: keys and files sorted, two-space indent, a final newline – a lock without entries is no file at all.

read_lock

read_lock($path);

The entries, in file order; {} when there is no file. Throws Skilletor::Error::Lock on a file it cannot read or that holds no JSON object, worded as the reference.

serialize_lock

my $text = serialize_lock($lock);

The lock file's text: entries and their files sorted (UTF-16 order), each entry source, version, files and, when set, skipped, block (true), via, partial (true).

write_lock

write_lock( $path, $lock );

Writes "serialize_lock" atomically; an empty lock deletes the file.

parse_lock_key

parse_lock_key('codex:skills/foo');   # { harness => 'codex', target => 'skills/foo', type => 'skill', name => 'foo' }

key_to_type_name

key_to_type_name('agents/reviewer');   # { type => 'agent', name => 'reviewer' }

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.