Decision record for karr #143 (2026-10-19, Getty: "own Perl dist in the skilletor repo, same flow as TS, shared conformance fixtures against divergence").
langertha-raider, a Perl coding agent, should behave as much like Claude Code as it can. That means offering the same skills, agents and rules that skilletor installs, and loading a skill or agent straight from its source ("skill as include"). It should do this without Node and without plugins. So skilletor's resolution has to run in Perl, and it must not drift away from what the TypeScript engine does.
- The TypeScript engine stays the reference. The Perl port follows it, never the other way round. When the two disagree, TS wins unless TS has a bug. A TS bug gets its own commit with a TS test, and the Perl port then follows the fixed behaviour (for example the corrupt tar size check, 90d3842).
- Shared state, not just shared formats. Perl reads the same config files
(
~/.claude/skilletor.json,<proj>/.claude/skilletor.json,<proj>/.claude/skilletor.local.json). It fetches into the same cache dirs, which are named by the same identity hash asgitCacheName/urlCacheName. It writes the sametrust.jsonand state records and takes the same sync lock. A TS run and a Perl run on one machine share one fetch and never write at the same time. - Byte-identical JSON. Lock, state and config edits must come out with the same
bytes as
JSON.stringify(x, null, 2). That is why the port has its own JSON layer (Skilletor::JSON, which keeps key order and matches JS escaping and number output) instead of JSON::MaybeXS's pretty printer. For the same reason it ports TS's own tar reader, gzip handling and YAML subset (frontmatter, bundles) rather than using Archive::Tar or YAML::PP: the cache trees and error messages have to match. - Moo, so the dist stays lean. Moose consumers like raider take Moo classes as they are.
- Templates through Text::Nunjucks. A sync renders
.njkitems with Text::Nunjucks, a 1:1 Perl port of the Nunjucks 3.2.4 the reference uses, through a loader confined to the source root as the reference's is (Skilletor::Render::Loader). The port converts its JSON values at the boundary (null, booleans, key order), andt/53-parity-render.trenders the same templates with both engines. Render context is constructed only when an item actually renders a.njkfile, companions included, and reused within that build; plain copies do not require an OS passwd entry (k161). Text::Nunjucks (on CPAN since 0.001) needs Perl 5.40. - Claude Code, Codex and Hermes targets for sync/check/status (Codex since k184, Hermes since k185).
- Project-local target defaults (k229) match the reference: user
targetssets the machine allowlist and user-scope targets; explicit project/local targets select a subset. Otherwise genuine project-owned harness files choose it, never skilletor's own artifacts. A sole machine target bootstraps a new project; an ambiguous multi-target project is left unchanged with a warning. User-only operations do not read project evidence or its lock. Seesuperpowers/specs/2026-11-15-project-targets-design.md. Automatic Claude plugin settings are also guarded: a proposed write that would change inferred targets is skipped, with an explicit-targets-then-sync warning (k234). Both engines keep settings and inferred targets stable while synchronizing items normally; they record no provenance and do not turn the skipped settings update into perpetualcheckdrift.
The cases live in conformance/cases/<NN-slug>/ and are language-neutral: JSON plus
plain file trees, with the format given in conformance/README.md. Each case has a
config, source trees (git sources are built as real repos and reached offline through
insteadOf), steps (resolve, sync, check, status, and cli, which runs a whole
command line) and the expected results. test/conformance.test.ts and
t/60-conformance.t both run every case and compare the outputs as canonical data,
and the installed files byte for byte; a cli step's exit code, stdout and stderr are
compared as bytes. Each runner takes the CLI to run from SKILLETOR_CONFORMANCE_CLI (a
JSON argv prefix), so either runner can hold the other implementation's CLI to the same
cases. A case
expects a different outcome in Perl only where it says so explicitly under
engines.perl, with the reason given; no case does today.
The expectations are generated from TS (SKILLETOR_CONFORMANCE_UPDATE=1 npm test) and
then hand-reviewed against the design spec, because an expectation that only mirrors the
code proves nothing. Beside the cases, the Perl suite replays recorded TS outputs
("oracles", made by maint/*.mjs) and runs parity tests (t/5x-parity*.t) that
drive both engines live against the same remotes and cache.
Skilletor->new(home => …, project_dir => …) provides the following:
resolvereturns TSresolveItems, field for field.resolve_skill,resolve_agentandresolve_rulereturn a path into the source or cache, with nothing installed.resolve_itemanditemsreturn the item records.sync,checkandstatuswork for the Claude Code, Codex and Hermes targets.
Decisions that differ from the TS engine on purpose:
- No detected harness needed to resolve. TS
resolveItems, like sync, stops with "no agent harness detected". Resolving does not depend on a harness, and raider runs where neither Claude Code nor Codex is installed.require_harness => 1restores the TS behaviour, and the conformance runner uses it. - Fetch policy.
fetch => 'always'is the default and matches TS.'missing'fetches only sources that have no cache yet.'never'uses no network at all. raider resolves at startup, so it can choose not to wait on the network. - Precedence per type, as in Claude Code. TS installs an item in both scopes and
needs no lookup rule. A lookup by name does need one, and the rule follows Claude
Code's documented behaviour:
- skills: personal (user) over project;
- agents: project over user;
- rules: no shadowing, both load with user first.
resolve_rules($name)returns both, user first.resolve_rule($name)throwsSkilletor::Error::Ambiguouswhen both scopes declare the rule and no scope is given, because any single answer would hide a rule Claude Code does load.
.njkitems in a lookup.resolve_skilland its siblings serve files of the source tree, so they refuse a templated item withSkilletor::Error::Unsupportedrather than serve an unrendered template; a sync renders it. TS has no lookup to match.- Hermes as the CLI has it. Skills only, in the Hermes home's
skills($HERMES_HOME, else the recorded home, else~/.hermes) and<repo>/.hermes/skills, with no managed.gitignoreblock; never auto-detected as a machine target, enabled there only through the user config's"targets". Project selection follows the evidence, override and bootstrap rules above; in a project with Codex active, the Codex copy serves Hermes. One home per user-scope lock, recorded inhermes-home.json; a sync under another home moves the items first and warns.Skilletor::Enginetakeshermes_homeas the CLI takesHERMES_HOME. - Report text.
Skilletor::Reportports the CLI's sync, status and check text and exit codes, so raider can show the same lines the CLI prints.
A fixture tree must not hold a live .gitignore. Inside the repository git would apply
it to the fixture files next to it, and the expected lock and items would never get
committed. That happened to the first sync cases. So a path segment starting with
.git is stored as dot.git… (dot.gitignore). Both runners unescape these names when
they copy a tree in and escape them when they write or compare expectations, and they
fail a case that holds an unescaped name.
t/52-parity-sync.t syncs one machine from the same starting state with TS and with
Perl, and requires the following to come out byte-identical:
- the reports and the installed trees;
- the lock;
render-inputs.json,sources-read.jsonandunreached.json.
It also requires each engine's check to accept the other engine's sync.
t/54-parity-cli.t does the same for the two command lines (node dist/skilletor.js
and bin/skilletor): it restores one saved machine before each CLI runs, so both run in the
same paths, and compares exit codes, both streams and every file under the temp dir as raw
bytes – the lock, render-inputs.json, sources-read.json, unreached.json, trust and the
hooks' records included. It drives five conformance cases, git's failure wording, a template
rendered with the real host and user, and one sync lock that either CLI holds while the
other's sync and SessionStart wait or time out. It skips without node or the bundle.
- The Codex target is ported (k184): skills in
.agents/skills, agents as TOML, the rules file with itsAGENTS.mdpointer, its warnings and the migration of a first-design rules block, and the warning while Codex has not trusted skilletor's SessionStart hook; its conversion came with k183 (Skilletor::Convert,Skilletor::TOML). The Claude hooks are ported (Skilletor::Hooks, k181):hook session-start,hook user-prompt-submitand its detached background sync (hook __sync-background; a PAR-packed binary re-runs itself throughPAR_PROGNAME, plain perl re-runs$^Xwith the script), and the checkout-move hooks (hook cwd-changed,hook post-tool-use, k147; ported in k182). Under--harness codexa new session's context starts with the Codex rules files and the prompt hook follows a move (k184); under--harness hermesSessionStart ends with the line saying how to opt in whilehermesis no target, and the prompt hook follows a move, naminghermes skills trustonce a skill Hermes loads landed (k185). The Perl CLI (script/skilletor) runssync,check,status(k173),trust,source list,source remove(k175),addwith the probe of a generic host (k176:git ls-remote, then a HEAD on the tarball through HTTP::Tiny in the process, so a packed binary needs neither Node nor Perl for it),available(k177),install(k178),uninstall(k179), and the hooks. Shared cases 130–139 and 200–205 cover the two config-edit commands against both CLIs. The plugin's hooks runbin/skilletor-start(k191): a pinned, cached release binary, else Node, else this port fromlib/. No release pins binaries yet; they come from the house route (.github/workflows/binaries.yml, dzil-binary, k242), and the port moved fromperl/to the repository root with it (2026-11-16). - Windows is covered by the binary only. The process layer has a Windows path (k186:
run_commandthrough temp files on a no-wait spawn,spawn_detachedthrough Win32::Process, the sync lock refreshed by its holder instead of a forked child), exercised on Linux through an injected seam. The windows-x86_64 binary, packed with Strawberry Perl, passesscripts/binary-smoke.shon GitHub's windows-2022 runner: every ported command and hook, the background sync included, byte for byte the Linux transcript, and the https url source (first green on 2026-11-18, k242). The test suite undert/does not run on Windows (perl.ymlis Linux only). Known open points: k207 (a dead lock owner), k209 (non-ASCII paths), k216 (verify compares output on POSIX only). - There are no conformance cases for a
urlfetch (it needs TLS), for symlink conflicts, or for partial syncs.t/62-engine.tcovers partial syncs.
Known divergences are kept on karr #143. The TS oddities the port found (duplicate trust
requests, a \U escape above U+10FFFF aborting a source scan, a lost description with CRLF
or a BOM, an inherited object key such as constructor accepted as an install key or a forge,
a non-string install entry crashing removeInstallEntries) were fixed in the reference
(k144) and are pinned by cases 13 to 16 and the oracles in t/data/; the port mirrors
none of them any more.