Execute this plan using the superpowers:subagent-driven-development skill.
Building a CLI tool that generates ASCII fractals. See design.md for full specification.
Create the Go module and directory structure.
Do:
go.mod with module name github.com/superpowers-test/fractalscmd/fractals/, internal/sierpinski/, internal/mandelbrot/, internal/cli/cmd/fractals/main.go that prints "fractals cli"github.com/spf13/cobra dependencyVerify:
go build ./cmd/fractals succeeds./fractals prints "fractals cli"Set up Cobra root command with help output.
Do:
internal/cli/root.go with root commandmain.goVerify:
./fractals --help shows usage with "sierpinski" and "mandelbrot" listed as available commands./fractals (no args) shows helpImplement the Sierpinski triangle generation algorithm.
Do:
internal/sierpinski/sierpinski.goGenerate(size, depth int, char rune) []string that returns lines of the triangleinternal/sierpinski/sierpinski_test.go with tests:
Verify:
go test ./internal/sierpinski/... passesWire the Sierpinski algorithm to a CLI subcommand.
Do:
internal/cli/sierpinski.go with sierpinski subcommand--size (default 32), --depth (default 5), --char (default '*')sierpinski.Generate() and print result to stdoutVerify:
./fractals sierpinski outputs a triangle./fractals sierpinski --size 16 --depth 3 outputs smaller triangle./fractals sierpinski --help shows flag documentationImplement the Mandelbrot set ASCII renderer.
Do:
internal/mandelbrot/mandelbrot.goRender(width, height, maxIter int, char string) []stringinternal/mandelbrot/mandelbrot_test.go with tests:
Verify:
go test ./internal/mandelbrot/... passesWire the Mandelbrot algorithm to a CLI subcommand.
Do:
internal/cli/mandelbrot.go with mandelbrot subcommand--width (default 80), --height (default 24), --iterations (default 100), --char (default "")mandelbrot.Render() and print result to stdoutVerify:
./fractals mandelbrot outputs recognizable Mandelbrot set./fractals mandelbrot --width 40 --height 12 outputs smaller version./fractals mandelbrot --help shows flag documentationEnsure --char flag works consistently across both commands.
Do:
--char flag passes character to algorithm--char should use single character instead of gradientVerify:
./fractals sierpinski --char '#' uses '#' character./fractals mandelbrot --char '.' uses '.' for all filled pointsAdd validation for invalid inputs.
Do:
Verify:
./fractals sierpinski --size 0 prints error, exits non-zero./fractals mandelbrot --width -1 prints error, exits non-zeroAdd integration tests that invoke the CLI.
Do:
cmd/fractals/main_test.go or test/integration_test.goVerify:
go test ./... passes all tests including integration testsDocument usage and examples.
Do:
README.md with:
go install ./cmd/fractalsVerify: