App-Dapper
view release on metacpan or search on metacpan
lib/App/Dapper/Agents.pm view on Meta::CPAN
my $END = '<!-- dapper:end -->';
=head2 update
Takes a Dapper object (and optionally extra notes for a new file), and writes
or updates C<AGENTS.md> in the current directory, and a C<CLAUDE.md> if there
isn't one. Returns the list of files written.
=cut
sub update {
my ($dapper, $notes) = @_;
my $generated = "$BEGIN\n" . guide($dapper) . "$END\n";
my @written;
my $file = 'AGENTS.md';
if (-f $file) {
my $text = App::Dapper::Utils::read_file($file);
if ($text =~ s/\Q$BEGIN\E.*?\Q$END\E\n?/$generated/s) {
App::Dapper::Utils::write_file($file, $text);
( run in 1.125 second using v1.01-cache-2.11-cpan-145b269f2f3 )