NAME

Langertha::Raider::Instructions - Internal resolver of the project instructions file

VERSION

version 0.503

SYNOPSIS

# Internal to Langertha-Raider -- no API promise.
my $instructions = Langertha::Raider::Instructions->new(root => $root);
my $text  = $instructions->text;     # undef when absent or empty
my $label = $instructions->label;    # '.raider/instructions.md' or '.raider.md'

DESCRIPTION

Internal module. Its interface may change without notice.

Knows which file holds the project instructions of "root" (ADR 0011): .raider/instructions.md when it exists, else the legacy .raider.md. When both exist, only .raider/instructions.md is used and the legacy file is reported by "ignored_files". The same rule as Langertha::Raider::Config for .raider/config.yml.

Unlike "file" in Langertha::Raider::Config, "file" is decided on every call, so a file created during a session (/prompt, by hand before /reload) is seen on the next reload.

root

The project directory. Required.

native_file

Path::Tiny of .raider/instructions.md in "root", present or not.

legacy_file

Path::Tiny of .raider.md in "root", present or not.

file

Path::Tiny of the file in use: "native_file" when it exists, else "legacy_file". Writers (the prompt-builder) write here, so without any file they create the legacy .raider.md, never .raider/instructions.md.

is_native

True when "file" is .raider/instructions.md.

label

The file in use relative to "root", .raider/instructions.md or .raider.md: how reports name it as a source.

file_exists

True when "file" exists.

text

The content of "file", or undef when it is absent, unreadable or empty.

ignored_files

for my $ign ($instructions->ignored_files) {
  warn 'ignoring '.$ign->{file}.': '.$ign->{reason}."\n";
}

The instructions files that are present but not used, each as file (absolute path) and reason: the legacy .raider.md while .raider/instructions.md is in use. Empty otherwise.

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha-raider/issues.

IRC

Join #langertha on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.