YakShave
NAME
YakShave - Parse and analyze yak shaving stories
SYNOPSIS
use YakShave;
my $story = q:to/END/;
I want to deploy my app.
But first I need to fix tests.
Which requires updating the test framework.
So now I'm reading about Jest internals.
END
# Simple visualization
say visualize-story($story);
# More control
my $actions = parse-story($story, debug => True);
say "Root task: ", $actions.root-task;
say "Current task: ", $actions.current-task;
say "All tasks: ", $actions.all-tasks;
say $actions.visualize;
DESCRIPTION
YakShave is a module for parsing and analyzing "yak shaving" stories - narratives that describe how a simple task spirals into a series of dependent subtasks.
The module uses Raku's grammar system to transform natural language stories into structured dependency trees, helping visualize how far you've strayed from your original goal.
EXPORTED FUNCTIONS
sub parse-story(Str $story, Bool :$debug = False)
Parses a yak shaving story and returns the YakShave::Actions object that contains the parsed information and dependency tree.
sub visualize-story(Str $story, Bool :$debug = False)
Parses a story and returns a string visualization of the dependency tree.
COMPONENTS
YakShave::Grammar - The grammar for parsing yak shaving stories
YakShave::Actions - Actions class that builds the dependency structure
YakShave::YakStack - Class for tracking and visualizing task dependencies
EXAMPLES
Creating a custom visualization:
my $actions = parse-story($story);
my $yakstack = $actions.yakstack;
for $yakstack.all-tasks -> $task {
say "$task depends on: ", $yakstack.dependencies-of($task).join(", ");
}