CPAN/Maker/Bootstrapper.pm

filter: Statementstmt 100% 31 / 31 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 97.5% 39 / 40 CC 1 SCAR 0.0
CC
1
Cov
97%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« CPAN/Maker/Bootstrapper/Role/Version.pm ↑ Summary CPAN/Maker/Bootstrapper/Constants.pm »
1 package CPAN::Maker::Bootstrapper;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use CLI::Simple ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use CLI::Simple::Constants qw(:booleans);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use IO::Interactive qw(is_interactive);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use Role::Tiny::With;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 with 'CPAN::Maker::Role::ModuleUtils';
13  
14 2 CLI::Simple->import(qw(:roles));
15  
16 2 our $VERSION = '2.4.0';
17 2 our $GIT_SHA = 'e519f552246e10e89d8874636255522b8fdbe618';
18 2 our $GIT_DIRTY = '2.0.0-27-ge519f552246e10e89d8874636255522b8fdbe618-dirty';
19  
20 2 with 'CPAN::Maker::Bootstrapper::Role::Init';
21 2 with 'CPAN::Maker::Bootstrapper::Role::LLM::Utils';
22  
23 2 ▶use parent qw(CLI::Simple);
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 2 __PACKAGE__->use_log4perl( level => 'info', color => $TRUE, info_color => 'white' );
26  
27 2 ▶caller or exit __PACKAGE__->main;
Branch: 1 branch
BranchTrueFalseTotal
caller or exit __PACKAGE__->main 2 0 2
28  
29 2 1;
30  
31 ## no critic
32  
33 __END__
34  
35 =pod
36  
37 =encoding utf8
38  
39 =head1 NAME
40  
41 CPAN::Maker::Bootstrapper - A complete build, dependency, and release framework for CPAN distributions
42  
43 =head1 SYNOPSIS
44  
45 # Bootstrap an existing project
46 cd /path/to/Foo-Bar
47 cmb --import .
48  
49 # Create a configuration file (recommended first-time setup)
50 cmb create-config > ~/.cpan-makerrc
51 export CPAN_MAKER_CONFIG=$HOME/.cpan-makerrc
52  
53 # Create a new plain Perl module project
54 cmb --module My::New::Module
55  
56 # Create a CLI module project (inherits from CLI::Simple)
57 cmb --module My::New::CLI --stub cli
58  
59 # Use a custom stub
60 cmb --module My::Module --stub /path/to/mystub.pm
61  
62 # Import files from another project
63 mkdir My-Module
64 cd My-Module
65 cmb -I /path/to/my-module/lib -I /path/to/my-module/bin \
66 --installdir .
67  
68 # Install into a specific directory
69 cmb --module My::Module --installdir ~/git/My-Module
70  
71 # Override git identity
72 cmb --module My::Module --username "Rob Lauer" --email rob@example.org
73  
74 # Run a code review on a module (set API key in environment)
75 cmb code-review lib/My/Module.pm
76  
77 =head1 DESCRIPTION
78  
79 C<CPAN::Maker::Bootstrapper> provides a complete development framework
80 for building, testing, maintaining, and releasing CPAN distributions.
81  
82 It can scaffold a new Perl project or import an existing one, installing
83 a managed build framework that carries the project from source through
84 testing, dependency management, distribution, and release.
85  
86 Core features include:
87  
88 =over 4
89  
90 =item * Continuous dependency discovery and maintenance for runtime,
91 test, recommended, and suggested dependencies
92  
93 =item * Syntax checking, perltidy, perlcritic, POD checking, and other
94 build-time quality gates
95  
96 =item * Hermetic project-local dependency installation coupled with
97 syntax checking of modules and scripts to expose undeclared
98 dependencies
99  
100 =item * Extensible project-specific build logic through F<project.mk>
101 without modifying managed build files
102  
103 =item * Semantic versioning, release-note generation, CPAN publishing,
104 and CI workflow support
105  
106 =item * DarkPAN dependency manifests for distributions that depend on
107 modules published outside CPAN
108  
109 =item * Build-system update checks and managed-file drift detection,
110 with support for upgrading and refreshing the framework
111  
112 =item * AI-assisted code review, POD review and generation, structured
113 finding annotation, and release-note generation
114  
115 =back
116  
117 See L</LLM Commands> and L</THE REVIEW WORKFLOW> for details on the
118 AI-assisted development tools.
119  
120 I<NOTE: Check out the
121 L<release-notes|https://github.com/rlauer6/CPAN-Maker-Bootstrapper/tree/main/release-notes>
122 directory in the GitHub project for examples of release notes generated by
123 the LLM.>
124  
125 =head1 QUICK START
126  
127 Install the bootstrapper and its dependencies:
128  
129 cpanm CPAN::Maker::Bootstrapper
130  
131 I<Note: Before scaffolding your first project, consider running C<create-config>
132 to set up a personal configuration file - it pre-populates your git
133 identity, GitHub username, and preferred project directory so you never
134 have to pass them on the command line. See L</CONFIGURATION> for details.>
135  
136 =head2 Scaffolding a new project from the default stub
137  
138 cmb --module My::Module
139  
140 or
141  
142 # create a directory for the new CPAN distribution
143 mkdir My-Module
144  
145 # cd into the directory
146 cd My-Module
147  
148 # scaffold the project
149 cmb --installdir .
150  
151 The bootstrapper derives the primary module name from the directory
152 name (C<My::Module> in this example). It then installs the build
153 system, generates the stub source and test files, and runs C<make>
154 automatically to create the first distribution tarball.
155  
156 By default the final build step applies full linting: syntax
157 checking (C<perl -wc>), perltidy conformance, and perlcritic at its
158 default severity (5 - the most severe violations only).
159  
160 =head2 Bootstrapping an existing project
161  
162 If you already have a Perl project, run C<cmb> from the project root
163 and import the current directory:
164  
165 cd Foo-Bar
166 cmb --import .
167  
168 When exactly one import directory is supplied and neither C<--module>
169 nor C<--installdir> determines the module name, the bootstrapper derives
170 the primary module name from the import directory. In this example,
171 F<Foo-Bar> implies C<Foo::Bar>.
172  
173 Use C<--dry-run> first if you want to inspect the import plan without
174 creating files or running the generated build:
175  
176 cmb --import . --dry-run
177  
178 You may also import from multiple directories and specify the primary
179 module explicitly:
180  
181 cmb --module Foo::Bar
182 --import lib
183 --import bin
184 --installdir /tmp/Foo-Bar
185  
186 =head1 NEXT STEPS
187  
188 =over 4
189  
190 =item Review the project source
191  
192 For a newly scaffolded project, edit the generated source file:
193  
194 lib/My/Module.pm.in
195  
196 For an imported project, review the C<.pm.in> and C<.pl.in> files
197 created from the imported modules and scripts.
198  
199 Files ending in C<.in> are the editable project sources. The generated
200 C<.pm> and C<.pl> files are build artifacts and will be overwritten by
201 subsequent C<make> invocations.
202  
203 =item Review the framework's populated artifacts
204  
205 =over 8
206  
207 =item F<buildspec.yml> - controls how the distribution is built
208  
209 See L<CPAN::Maker> for details regarding F<buildspec.yml>.
210  
211 =item F<requires> - found dependencies
212  
213 =item F<test-requires> - test dependencies
214  
215 =item F<recommends> - recommended dependencies
216  
217 =item F<suggests> - optional dependencies
218  
219 =back
220  
221 =item Manage the project version
222  
223 The bootstrapper creates a F<VERSION> file containing the semantic
224 version number for the project. New projects begin at C<1.0.0>.
225  
226 Use the version targets to increment it:
227  
228 make release # 1.0.0 -> 1.0.1
229 make minor # 1.0.1 -> 1.1.0
230 make major # 1.1.0 -> 2.0.0
231  
232 If you imported the primary module rather than generating it from a
233 stub, make sure its version declaration uses the project version token:
234  
235 our $VERSION = C<E<64>PACKAGE_VERSIONE<64>>;
236  
237 When C<make> generates the F<.pm> file from its F<.pm.in> source,
238 C<E<64>PACKAGE_VERSIONE<64>> is replaced with the value from
239 F<VERSION>.
240  
241 =item Add More Modules, Scripts, and Tests
242  
243 As your project grows, add new modules beneath F<lib/> as F<.pm.in>
244 files and scripts beneath F<bin/> as F<.pl.in> files. The build system
245 discovers them automatically - no Makefile changes are required.
246  
247 Distribution tests belong beneath F<t/>.
248  
249 Additional test suites may use the conventional extended-test
250 directories:
251  
252 xt/author/
253 xt/release/
254 xt/smoke/
255  
256 These suites can be run explicitly with C<make test-author>,
257 C<make test-release>, and C<make test-smoke>, or together with
258 C<make test-all>.
259  
260 =item Add additional files to the distribution
261  
262 Edit F<buildspec.yml> to declare additional files that should be
263 included in the distribution.
264  
265 Files may be added at the distribution root or installed beneath the
266 distribution's share directory.
267  
268 For example:
269  
270 extra-files:
271 - ChangeLog
272 - share:
273 - config/example.ini
274 - defaults.json
275  
276 Use root-level entries for files that should be packaged but not
277 installed into the share directory.
278  
279 Use the C<share> section for files that should be installed as
280 distribution data.
281  
282 See L</How do I include additional files in the distribution?> for
283 more details.
284  
285 =item Rebuild Your Distribution
286  
287 When you are ready to rebuild the project:
288  
289 make
290  
291 The default build applies the project's dependency and quality gates,
292 regenerates derived source files and documentation as needed, and
293 produces the CPAN distribution tarball.
294  
295 When dependency scanning is enabled, changed source files are scanned
296 and the dependency artifacts are updated only when their contents have
297 changed:
298  
299 requires
300 test-requires
301 recommends
302 suggests
303  
304 The build also regenerates F<README.md> when required and rebuilds only
305 those derived artifacts whose prerequisites have changed.
306  
307 For a faster development build that skips dependency scanning and both
308 lint tools while retaining syntax checking, use:
309  
310 make quick
311  
312 =item Verify the Distribution Installs Cleanly
313  
314 After building the distribution, install the generated tarball with
315 C<cpanm> to verify that it can be consumed independently of the source
316 tree:
317  
318 cpanm --local-lib=$HOME My-Module-*.tar.gz
319  
320 This exercises the packaged distribution and its declared
321 dependencies through the normal CPAN installation path rather than
322 through the project's development build environment.
323  
324 =item Put Your Project Under Source Control
325  
326 Initialize the repository and stage the project files recommended by
327 the build system:
328  
329 make git
330  
331 By default, C<make git> creates the initial commit after staging the
332 managed build files, project configuration, editable source files, and
333 other tracked project artifacts.
334  
335 If you want to initialize and stage the project without creating the
336 commit yet, use:
337  
338 make git NO_COMMIT=1
339  
340 =item Learn More About C<CPAN::Maker::Bootstrapper>
341  
342 See L</EXTENDING THE BUILD SYSTEM> for adding project-specific build
343 logic and customizing the managed build framework.
344  
345 See L</Dependencies Management> for details on dependency discovery,
346 classification, filtering, and generated dependency artifacts.
347  
348 See L</FAQ> for common questions and practical recipes.
349  
350 =back
351  
352 =head1 WHY YOU SHOULD CONSIDER USING CPAN::Maker::Bootstrapper
353  
354 Many build systems place the build procedure inside the CI platform:
355 workflow files describe the steps, the CI runner executes them, and a
356 separate local workflow is needed to reproduce the same build.
357  
358 C<CPAN::Maker::Bootstrapper> takes the opposite approach.
359  
360 The build belongs to the project.
361  
362 The same dependency graph, quality gates, generated artifacts, tests,
363 and distribution rules run whether C<make> is invoked on your laptop,
364 on a remote host, inside C<make build-ci>, or from GitHub Actions.
365  
366 CI is therefore a caller of the build system rather than the place
367 where the build system lives.
368  
369 A fresh checkout remains directly buildable with:
370  
371 git clone <repository>
372 cd <project>
373 make
374  
375 The CI layer can add isolation and automation, but it does not define a
376 second build procedure that must be kept synchronized with local
377 development.
378  
379 =head2 The Stack
380  
381 The build system is built on three tools with deliberately different
382 responsibilities:
383  
384 =over 4
385  
386 =item * B<GNU make> - models causality.
387  
388 Targets, prerequisites, timestamps, pattern rules, and order-only
389 dependencies describe what must be rebuilt and why. Make decides what
390 work is necessary.
391  
392 =item * B<bash> - performs process orchestration.
393  
394 Shell recipes connect command-line tools, manage files and temporary
395 state, and express the small imperative steps needed to carry out a
396 build action.
397  
398 =item * B<Perl> - handles transformations that deserve a real
399 programming language.
400  
401 Dependency analysis, metadata generation, configuration processing,
402 distribution assembly, and other non-trivial transformations remain
403 readable and testable Perl rather than growing into increasingly
404 complex shell fragments.
405  
406 =back
407  
408 C<CPAN::Maker::Bootstrapper> provides the conventions that connect
409 those layers.
410  
411 GNU make owns the dependency graph, bash performs the orchestration,
412 and Perl implements the complex transformations. The result is a
413 build system that remains visible and auditable: C<make -n> shows what
414 would run, C<bash -x> exposes shell execution, C<make help> documents
415 the available targets, and F<project.mk> provides an upgrade-safe place
416 for project-specific behavior.
417  
418 =head2 Best Practices Out of the Box
419  
420 The installed build system makes several professional development
421 practices part of the project structure without forcing them on the
422 developer on every build:
423  
424 =over 4
425  
426 =item * B<Editable source and generated artifacts are distinct> -
427 F<.pm.in> and F<.pl.in> files are the project sources; the corresponding
428 F<.pm> and F<.pl> files are generated artifacts. Changes belong in the
429 F<.in> files and are propagated by C<make>.
430  
431 =item * B<Dependencies are derived from the source> -
432 C<scandeps-static.pl> maintains F<requires>, F<test-requires>,
433 F<recommends>, and F<suggests> as the source changes. Pinning, sticky
434 entries, and skip lists allow the generated dependency model to be
435 adjusted when necessary.
436  
437 =item * B<Quality checks are part of the dependency graph> -
438 syntax checking, C<perltidy>, C<perlcritic>, and POD validation are
439 build gates rather than separate release-time procedures. The gates
440 remain independently controllable when a project needs different
441 development or runtime behavior.
442  
443 =item * B<Managed build policy remains upgradeable> -
444 C<make update> refreshes the build framework installed beneath
445 F<.includes/>, while C<make upgrade> checks for and installs newer
446 versions of C<CPAN::Maker::Bootstrapper>.
447  
448 =item * B<Project-specific behavior stays outside managed files> -
449 F<project.mk> is the upgrade-safe extension point for custom targets,
450 additional dependencies, lifecycle hooks, and project-specific
451 variables. Projects extend the framework without modifying the files
452 maintained by the bootstrapper.
453  
454 =back
455  
456 =head2 Perl Quality Tools
457  
458 The build system supports syntax checking, perltidy, and perlcritic as
459 build-time quality gates.
460  
461 Syntax checking is controlled independently with C<SYNTAX_CHECKING>:
462  
463 make SYNTAX_CHECKING=OFF
464  
465 Perltidy and perlcritic are controlled by C<LINT>, which acts as the
466 master switch for both tools:
467  
468 make LINT=OFF
469  
470 The tools may also be disabled individually:
471  
472 make PERLTIDY=""
473 make PERLCRITIC=""
474  
475 This allows one linting tool to remain enabled while the other is
476 disabled.
477  
478 C<PERLTIDYRC> and C<PERLCRITICRC> configure the corresponding tools;
479 they do not enable or disable them.
480  
481 For example:
482  
483 make PERLTIDYRC=.perltidyrc
484 make PERLCRITICRC=.perlcriticrc
485  
486 If no profile is specified, the corresponding tool uses its default
487 configuration.
488  
489 If a profile variable names a file that does not exist, the operation
490 fails.
491  
492 Modules or scripts that cannot be syntax-checked outside their runtime
493 environment may be added to C<PERLWC_SKIP> in F<project.mk>:
494  
495 PERLWC_SKIP = bin/startup.pl
496  
497 Inter-module build dependencies may also be declared explicitly in
498 F<project.mk> when they cannot be inferred automatically:
499  
500 lib/Foo/Bar.pm: lib/Foo.pm
501  
502 C<make quick> provides a fast development build that disables
503 distribution dependency scanning and both lint tools while leaving
504 syntax checking enabled:
505  
506 make quick
507  
508 This is equivalent to:
509  
510 make SCAN=OFF LINT=OFF
511  
512 =head2 A GNU Make Tutorial in Disguise
513  
514 Because the build system is implemented with ordinary GNU make, the
515 managed files beneath F<.includes/> are also working examples of the
516 techniques used to model a non-trivial build.
517  
518 They include:
519  
520 =over 4
521  
522 =item * Pattern rules and sentinel files for incremental quality gates
523  
524 =item * C<define>/C<endef> blocks for reusable shell and Perl fragments
525  
526 =item * C<$(shell ...)>, C<$(eval ...)>, C<$(call ...)>,
527 C<$(filter-out ...)>, C<$(addprefix ...)>, and C<$(patsubst ...)> for
528 deriving and transforming build state
529  
530 =item * C<?=>, C<:=>, C<+=>, and C<=> with their distinct evaluation
531 semantics
532  
533 =item * Order-only prerequisites, C<.DEFAULT_GOAL>, C<-include>, and
534 C<.SHELLFLAGS := -ec>
535  
536 =item * C<mktemp>, shell traps, and bash conditionals inside recipes
537  
538 =item * Perl programs embedded in make variables when a transformation
539 is better expressed in Perl than in shell
540  
541 =back
542  
543 The build system is deliberately transparent to not only reveal I<how
544 the sausage is made> but to expose these techniques to the developer
545 so you can incorporate them in your recipes. However, the build sysetm
546 framework itself is read-only to discourage you from tampering with a
547 complex set of recipes that have been carefully crafted and can easily
548 be broken. Your extension point remains the F<project.mk> file and the
549 double-colon targets.
550  
551 =head1 IMPORTING FILES
552  
553 The C<--import|-I> option allows you to bring existing Perl source
554 files into a new Bootstrapper project. This is the primary mechanism
555 for migrating an existing project or consuming a scaffold tarball
556 generated by C<cli-simple -scaffold>.
557  
558 The C<--import> option may be specified multiple times to import from
559 several directories in a single operation:
560  
561 cmb --module My::Script \
562 --import /path/to/roles \
563 --import /path/to/bin \
564 --installdir .
565  
566 =head2 Determining the Primary Module
567  
568 The bootstrapper determines the primary module name in the following
569 order:
570  
571 =over 4
572  
573 =item 1. C<--module>
574  
575 If C<--module> is supplied, that value is used.
576  
577 =item 2. Custom stub
578  
579 If no module name was supplied and C<--stub> names a file, the first
580 package found in that file is used.
581  
582 =item 3. Installation directory
583  
584 If the module name is still unknown and C<--installdir> was supplied,
585 the bootstrapper derives the module name from the installation directory
586 name.
587  
588 =item 4. Single import directory
589  
590 If the module name is still unknown and exactly one C<--import> path was
591 supplied, the bootstrapper derives the module name from the basename of
592 that directory.
593  
594 For example:
595  
596 cd Foo-Bar
597 cmb --import .
598  
599 infers C<Foo::Bar>.
600  
601 =back
602  
603 When deriving a module name from a directory name, hyphens are converted
604 to C<::>, so F<Foo-Bar> implies C<Foo::Bar>.
605  
606 The resulting name must be a valid Perl module name.
607  
608 When importing an existing project, the corresponding module file must
609 also exist beneath one of the import paths. For example, C<Foo::Bar>
610 must be found as F<Foo/Bar.pm> somewhere beneath one of the directories
611 supplied with C<--import>.
612  
613 =head2 What Gets Imported
614  
615 When importing an existing project, the bootstrapper scans each
616 C<--import> directory and builds an explicit import plan.
617  
618 The following files are recognized:
619  
620 =over 4
621  
622 =item * Perl modules
623  
624 Files ending in F<.pm> are imported as distribution modules and placed
625 beneath F<lib/>.
626  
627 For example:
628  
629 lib/Foo/Bar.pm
630  
631 becomes:
632  
633 lib/Foo/Bar.pm.in
634  
635 The package declared by the module determines its destination beneath
636 F<lib/>.
637  
638 =item * Perl scripts
639  
640 Files ending in F<.pl> are imported beneath F<bin/> and converted to
641 generated source files ending in F<.in>.
642  
643 =item * Executable files
644  
645 Executable files not otherwise classified are imported beneath F<bin/>
646 and converted to generated source files ending in F<.in>.
647  
648 =item * Test files and test helpers
649  
650 Files beneath the following recognized test directories are preserved in
651 place:
652  
653 t/
654 xt/author/
655 xt/release/
656 xt/smoke/
657  
658 Within those directories, files with the following extensions are
659 treated as test material:
660  
661 .pm
662 .pl
663 .t
664 .sh
665 .dat
666  
667 The directory takes precedence over the file extension. For example:
668  
669 t/lib/TestHelper.pm
670  
671 remains:
672  
673 t/lib/TestHelper.pm
674  
675 and is not imported as:
676  
677 lib/TestHelper.pm.in
678  
679 Likewise:
680  
681 xt/author/check.pl
682  
683 remains beneath F<xt/author/>.
684  
685 =item * Change logs
686  
687 The following root-level change log files are preserved when present:
688  
689 ChangeLog
690 CHANGELOG
691 Changes
692 CHANGES
693  
694 Their original names are retained.
695  
696 =back
697  
698 Files not matching one of the recognized categories are not imported.
699  
700 =head2 Excluding Import Paths
701  
702 Use C<--exclude> to omit directories beneath an import root.
703  
704 The option may be supplied more than once:
705  
706 cmb --import .
707 --exclude local
708 --exclude Foo-Bar-1.2.3
709  
710 Each exclusion is interpreted relative to the import root and excludes
711 that directory and everything beneath it.
712  
713 For example:
714  
715 --exclude local
716  
717 excludes:
718  
719 local/
720 local/lib/
721 local/bin/
722  
723 but does not exclude an unrelated directory with the same name outside
724 the import root.
725  
726 The following source-control directories are always excluded and do not
727 need to be specified explicitly:
728  
729 .git
730 .hg
731 .svn
732  
733 These directories are pruned wherever they occur beneath an import
734 root.
735  
736 =head2 Previewing an Import
737  
738 Use C<--dry-run> to inspect the import plan without modifying the
739 filesystem or running the generated build.
740  
741 For example:
742  
743 cmb --import .
744 --exclude local
745 --dry-run
746  
747 The bootstrapper scans the import directories, applies exclusions,
748 classifies the recognized files, determines their destinations, and
749 prints the resulting import plan.
750  
751 No installation directory is created, no files are copied, and C<make>
752 is not run.
753  
754 This is useful when importing an existing project because it allows the
755 proposed mapping to be reviewed before any project files are generated.
756  
757 =head2 Creating a Project Tarball
758  
759 Use C<--project-tarball> to create an archive containing the complete
760 generated CPAN::Maker::Bootstrapper project instead of installing that
761 project into a directory.
762  
763 For example:
764  
765 cmb --import .
766 --exclude local
767 --project-tarball
768  
769 The bootstrapper performs the normal import and build process in a
770 temporary working directory and then writes a project archive to the
771 directory from which C<cmb> was invoked.
772  
773 For a module named C<Foo::Bar>, the resulting archive is named:
774  
775 Foo-Bar-cmb.tar.gz
776  
777 The archive contains a top-level project directory:
778  
779 Foo-Bar/
780  
781 and includes the generated CPAN::Maker::Bootstrapper project, including
782 the Makefile, build configuration, imported source files, test files,
783 build support files, logs, and the generated CPAN distribution tarball.
784  
785 This is different from the CPAN distribution tarball produced by the
786 build. The CPAN distribution contains the files intended for release to
787 CPAN; the project tarball contains the complete CPAN::Maker::Bootstrapper
788 development project used to build that distribution.
789  
790 The temporary dependency installation directory used during the import
791 build is not included in the project archive.
792  
793 =head2 Import Destination Safety
794  
795 When importing an existing project into a directory, the bootstrapper
796 refuses to create the generated project inside one of the directories
797 being imported.
798  
799 For example, this is not allowed:
800  
801 cmb --import . --installdir ./converted
802  
803 when F<converted/> would be created beneath the import root.
804  
805 The bootstrapper also refuses to use the import root itself as the
806 installation directory.
807  
808 These checks prevent the generated project from becoming part of the
809 source tree while that source tree is being scanned and imported.
810  
811 C<--force> does not override this safety check.
812  
813 The check applies only when installing the generated project into a
814 directory. C<--project-tarball> does not create an installation
815 directory and therefore does not require this restriction.
816  
817 =head2 Import Build Policy
818  
819 After constructing the imported project, the bootstrapper runs the
820 generated build to verify that the project can be built successfully.
821  
822 The import build uses the following defaults:
823  
824 SCAN=on
825 SYNTAX_CHECKING=on
826 LINT=off
827  
828 Dependency scanning and syntax validation therefore remain enabled
829 during import.
830  
831 Linting is disabled by default because importing an existing project
832 should not require that project to satisfy the bootstrapper's
833 perltidy or perlcritic policy before it can be converted.
834  
835 These defaults may be overridden through the corresponding environment
836 variables.
837  
838 For example:
839  
840 LINT=on cmb --import .
841  
842 enables linting during the import build.
843  
844 This setting applies only to the bootstrap import build. The generated
845 project retains its normal build configuration and may enable linting
846 for subsequent C<make> invocations.
847  
848 =head2 Next Steps After a Successful Import
849  
850 After a successful build you have a complete, buildable CPAN
851 distribution, although it may not reflect everything you need for your
852 project. Typical next steps:
853  
854 =over 4
855  
856 =item 1. Review and edit the generated F<buildspec.yml> - verify the
857 module name, author, and resource links are correct
858  
859 =item 2. Manually import files missed by the importer
860  
861 Your project may want to package additional files that are installed
862 into the distribution's share directory. Move them into an appropriate
863 directory or the root of the project and add them to the
864 F<buildspec.yml> file.
865  
866 extra_files:
867 - ChangeLog <= included in distribution tarball, but not installed
868 share:
869 - config/some-file.ini <= installs config/some-file.in into the distribution's share directory
870 - my-app.json <= installs my-app.json from the root of your project into the distribution's share directory
871  
872 =item 3. Initialize a git repository with C<make git>
873  
874 =item 4. Run C<make tidy> if you want to format the imported source
875  
876 make tidy
877  
878 Perltidy uses C<PERLTIDYRC> when configured and otherwise uses its
879 default configuration.
880  
881 =item 5. Run C<make> to produce the final distribution tarball
882  
883 By default the generated build performs syntax checking, dependency
884 scanning, perltidy, and perlcritic.
885  
886 Dependency scanning may be disabled with:
887  
888 make SCAN=OFF
889  
890 Perltidy may be disabled independently with:
891  
892 make PERLTIDY=""
893  
894 Perlcritic may be disabled independently with:
895  
896 make PERLCRITIC=""
897  
898 Both lint tools may be disabled together with:
899  
900 make LINT=OFF
901  
902 To disable dependency scanning and both lint tools while retaining
903 syntax checking, use:
904  
905 make quick
906  
907 =item 6. Test installation
908  
909 cpanm -n -v ./My-Script-1.0.0.tar.gz
910  
911 =back
912  
913 =head2 Limitations
914  
915 =over 4
916  
917 =item * C<--import> cannot be used with C<--stub> - they are mutually
918 exclusive ways to create the initial source
919  
920 =item * The importer uses the package declarations inside C<.pm> files
921 to determine where to place them under F<lib/>. If the importer cannot
922 match the filename with a package declaration inside the file, it will
923 warn and skip that file
924  
925 =item * Imported files are not tidied automatically.
926  
927 Run C<make tidy> after import if you want to format the imported source.
928  
929 If C<PERLTIDYRC> is configured, that profile is used. Otherwise
930 perltidy runs with its default configuration.
931  
932 =item * Inter-module dependencies are normally detected automatically.
933 The build generates F<deps.mk> from dependencies between modules in the
934 distribution so prerequisite modules are built before syntax checking
935 modules that depend on them.
936  
937 If a dependency cannot be inferred automatically, declare it explicitly
938 in F<project.mk>:
939  
940 lib/My/Script.pm: \
941 lib/My/Script/Role/Frobnicate.pm \
942 lib/My/Script/Role/List.pm
943  
944 See L</Inter-module dependencies> for details.
945  
946 =back
947  
948 =head2 Importing a CLI::Simple Scaffold Tarball
949  
950 Suppose you have a project that used C<CLI::Simple> as base class and
951 now want to use the C<CPAN::Maker::Bootstrapper> framework.
952  
953 The C<import-scaffold> command is a convenience wrapper around
954 C<--import> specifically designed to consume tarballs generated by
955 C<cli-simple -scaffold>:
956  
957 cmb import-scaffold my-script-roles.tar.gz --module My::Script --installdir .
958  
959 The tarball is extracted to a temporary directory and fed to the
960 importer automatically. See L<CLI::Simple> for details on generating
961 scaffold tarballs.
962  
963 =head1 CONFIGURATION
964  
965 C<cmb> can read configuration from your global F<.gitconfig> or from
966 a separate C<.ini> file. Configuration values are used when
967 scaffolding distributions and by the AI-assisted commands.
968  
969 git config --global user.github <your-username>
970  
971 If you typically create projects in one directory, add the C<basedir>
972 option:
973  
974 git config --global cpan-maker.basedir $HOME/git
975  
976 When C<--installdir> is not supplied, the bootstrapper uses C<basedir>
977 from the configuration when one is defined. Otherwise, it uses the
978 current working directory as the base directory for the new project.
979  
980 An explicit C<--installdir> always takes precedence.
981  
982 A separate configuration file may contain entries such as:
983  
984 [user]
985 email = your-email@somedomain
986 name = First Last
987 # use to construct GitHub resource URLs
988 github = github-user
989  
990 [cpan-maker]
991 basedir = /home/myhome/git
992 # indicates the resources section of Makefile.PL should contain github references
993 resources = github
994 llm-api-key-helper = cat ~/.ssh/anthropic-api-key
995  
996 =over 4
997  
998 =item C<llm-api-key-helper>
999  
1000 For LLM commands (code-review, pod-review), you can specify a
1001 shell command that outputs your API key without exposing it in shell
1002 history:
1003  
1004 llm-api-key-helper = cat ~/.ssh/anthropic-api-key
1005  
1006 When set, this command is executed to retrieve the API key, avoiding
1007 the need to pass it on the command line or set it in the environment
1008 manually. This is the recommended secure approach.
1009  
1010 See L<CPAN::Maker::ConfigReader> for a complete description of the
1011 configuration file.
1012  
1013 Use the C<--config> option to use your custom config.
1014  
1015 You can generate a starter configuration with:
1016  
1017 cmb create-config > ~/.cpan-makerrc
1018  
1019 Then point C<cmb> at it by setting the
1020 C<CPAN_MAKER_CONFIG> environment variable in your shell profile:
1021  
1022 export CPAN_MAKER_CONFIG=$HOME/.cpan-makerrc
1023  
1024 =back
1025  
1026 =head2 Environment
1027  
1028 =over 4
1029  
1030 =item LLM_API_KEY
1031  
1032 Your Anthropic Claude API key. Set this before running any LLM command
1033 (code-review, pod-review, release-notes).
1034  
1035 The key is removed from environment so it is not inherited by child
1036 processes such as 'make'. This does not protect against memory
1037 inspection of the current process - see L<LLM::API> for how the key is
1038 actually stored using a closure to prevent accidental serialization
1039 via Dumper.
1040  
1041 Avoid passing the key on the command line where it might be saved in
1042 history and can be seen in process lists.
1043  
1044 =item CPAN_MAKER_CONFIG
1045  
1046 Path to a configuration file (in .ini format) containing user settings
1047 such as name, email, GitHub username, and project base directory. If
1048 not set, the bootstrapper will attempt to read settings from
1049 ~/.gitconfig.
1050  
1051 =item SCAN
1052  
1053 Controls dependency scanning during C<make>. Set to C<OFF> to disable
1054 distribution dependency scanning. The default is C<ON>.
1055  
1056 =back
1057  
1058 =head1 INSTALLED PROJECT FILES
1059  
1060 The following files are installed into the project directory:
1061  
1062 =over 4
1063  
1064 =item * C<Makefile> - the complete build system. Derives project paths
1065 and names from C<MODULE_NAME>, the package name in a custom stub, or
1066 the project directory name. See L</THE PROJECT MAKEFILE>.
1067  
1068 =item * C<buildspec.yml> - generated from the template, pre-populated
1069 with your module name, git identity, GitHub username, and project URLs.
1070  
1071 =item * C<lib/E<lt>Module/PathE<gt>.pm.in> - stub module, populated from
1072 either C<class-module.pm.tmpl> or C<cli-module.pm.tmpl> when
1073 C<--stub cli> is used.
1074  
1075 I<Note: Files under F<lib/> and F<bin/> use C<.pm.in> and C<.pl.in>
1076 as editable sources. The generated C<.pm> and C<.pl> files are derived
1077 from them by the Makefile and will be overwritten by subsequent
1078 builds.>
1079  
1080 =item * C<t/00-E<lt>project-nameE<gt>.t> - minimal smoke test that calls
1081 C<use_ok> on your module.
1082  
1083 =item * F<.includes/> - the managed build system directory. Contains
1084 all C<.mk> files installed and maintained by the bootstrapper. These
1085 files are write-protected and should never be edited directly. Updated
1086 with C<make update>.
1087  
1088 .includes/bootstrap.mk - used internally by the bootstrapper
1089 .includes/bash-completion.mk - make bash-completion target
1090 .includes/modulino.mk - make modulino target
1091 .includes/git.mk - make git target
1092 .includes/help.mk - make help target
1093 .includes/local.mk - vendors dependencies for syntax checking
1094 .includes/perl.mk - pattern rules, syntax checking, tidy, critic
1095 .includes/publish.mk - publish to CPAN
1096 .includes/release-notes.mk - make release-notes target
1097 .includes/update.mk - make update target
1098 .includes/upgrade.mk - make upgrade/check-upgrade targets
1099 .includes/version.mk - make release/minor/major targets
1100  
1101 =item * F<project.mk> - your extension point for custom make rules,
1102 inter-module dependencies, and project-specific variables. Never
1103 touched by C<make update>. See L</EXTENDING THE BUILD SYSTEM>.
1104  
1105 =item * F<modulino.tmpl> - template used by C<make modulino> to
1106 generate bash wrapper scripts for modulino-style modules.
1107  
1108 =item * F<VERSION> - contains the current version string in
1109 C<major.minor.patch> format. Managed by C<make release>, C<make minor>,
1110 and C<make major>.
1111  
1112 =item * F<ChangeLog> - empty placeholder, required by the distribution.
1113  
1114 =item * F<.prompts/>
1115  
1116 The directory is created automatically the first time C<pod-review>
1117 or C<code-review> needs the default prompt files.
1118  
1119 =back
1120  
1121 =head1 THE PROJECT MAKEFILE
1122  
1123 The installed Makefile is self-configuring. It can derive the primary
1124 module from C<MODULE_NAME>, the package name inside a custom stub, or
1125 the project directory name.
1126  
1127 For example, a primary module of C<My::New::Module> produces:
1128  
1129 MODULE_PATH - lib/My/New/Module.pm (from MODULE_NAME)
1130 PROJECT_NAME - My-New-Module (from MODULE_NAME)
1131 TARBALL - My-New-Module-1.0.0.tar.gz (from PROJECT_NAME + VERSION)
1132  
1133 If C<MODULE_NAME> is not supplied on the command line, it is inferred
1134 from the project directory name.
1135  
1136 Key Makefile targets:
1137  
1138 =over 4
1139  
1140 =item C<make> / C<make all>
1141  
1142 Builds the distribution tarball. When dependency scanning is enabled,
1143 updates F<requires>, F<test-requires>, F<recommends>, and F<suggests>,
1144 and generates F<README.md> as prerequisites.
1145  
1146 =item C<make bash-completion>
1147  
1148 Generates and installs a bash completion function for your project's
1149 modulino, then prints the C<source> line to enable it. The function is
1150 produced by C<< <modulino> -generate-completion >> (available to any
1151 C<CLI::Simple>-based modulino) and written to
1152 F<~/.local/share/bash-completion/completions/E<lt>aliasE<gt>>.
1153  
1154 make bash-completion
1155 # then, as it instructs:
1156 source ~/.local/share/bash-completion/completions/<alias>
1157  
1158 The target depends on the modulino, so it will build F<bin/E<lt>aliasE<gt>>
1159 first if needed. Completion is only available for modulinos that
1160 subclass C<CLI::Simple>.
1161  
1162 =item C<make help>
1163  
1164 Lists the available build targets and commonly used build variables.
1165 Project-specific targets in F<project.mk> are included when their
1166 target definition contains a C<##> description.
1167  
1168 =item C<make requires> / C<make test-requires>
1169  
1170 Scans source files with C<scandeps-static.pl> and writes the dependency
1171 files specified in the C<buildspec.yml> file used by C<make-cpan-dist.pl>.
1172  
1173 Any change to your C<.pm.in> files will trigger a rescan of your
1174 modules for new dependencies. This can add a significant delay when
1175 you have many modules and a large number of dependencies. You can
1176 avoid the scan if you know that no new dependencies have been added by
1177 setting the environment variable C<SCAN> to C<OFF> (case insensitive).
1178  
1179 make SCAN=OFF
1180  
1181 You can make scanning deliberate by adding C<SCAN=OFF> to your
1182 F<config.mk> file. Then, to rescan:
1183  
1184 make SCAN=ON
1185  
1186 =item C<make recommends> / C<make suggests>
1187  
1188 Companion targets to C<make requires>. The dependency scanner classifies
1189 each discovered module into one of three tiers: hard C<requires>,
1190 C<recommends> (soft, non-eval conditional dependencies), and C<suggests>
1191 (eval-wrapped, optional dependencies).
1192  
1193 These files are consumed by L<CPAN::Maker> when it generates the
1194 distribution metadata, including the corresponding dependency sections
1195 in F<Makefile.PL>. See L</Dependencies Management>.
1196  
1197 =item C<DARKPAN_REQUIRES>
1198  
1199 Set C<DARKPAN_REQUIRES> to a true value (C<1>, C<yes>, C<on>, or
1200 C<si>) to generate dependency manifests for modules available from a
1201 configured DarkPAN.
1202  
1203 This is useful when a distribution published to CPAN has one or more runtime
1204 dependencies that are intentionally hosted on a separate CPAN-compatible
1205 repository. CPAN metadata can still declare those dependencies normally, but
1206 standard installers need additional information to locate distributions that
1207 should be obtained from the DarkPAN.
1208  
1209 The generated DarkPAN manifests provide that information without duplicating
1210 the dependency declarations maintained in F<requires>. They are included in
1211 the distribution as installation aids for the person or process installing
1212 the module. They are not automatically consulted by Perl installers during a
1213 normal installation; the installer must explicitly use the appropriate
1214 manifest or configure the DarkPAN repository.
1215  
1216 When enabled, C<DARKPAN_URL> must specify the base URL of the
1217 CPAN-compatible repository:
1218  
1219 DARKPAN_REQUIRES = yes
1220 DARKPAN_URL = https://cpan.example.com/repository
1221  
1222 C<make> examines F<requires> and generates:
1223  
1224 cpanfile.darkpan
1225 cpanm.darkpan
1226  
1227 When C<DARKPAN_REQUIRES> is enabled, F<cpanfile.darkpan> and F<cpanm.darkpan>
1228 are added to F<buildspec.yml> as extra files and are therefore included
1229 in the distribution. They are expected to be tracked by git unless the
1230 developer explicitly adds them to F<extra-files.skip>.
1231  
1232 For each module listed in F<requires>, the build checks whether the module
1233 is available from the configured DarkPAN. Modules found there are added to
1234 the generated DarkPAN manifests.
1235  
1236 For modules available from the DarkPAN, the build also checks MetaCPAN. If
1237 a module is available from both CPAN and the DarkPAN, the DarkPAN version is
1238 preferred and the module remains in the generated manifests. This allows the
1239 DarkPAN to provide a version of a module that is also published on CPAN.
1240  
1241 Modules that should not be obtained from the DarkPAN may be listed in
1242 F<darkpan.skip>, one module name per line. Those modules are omitted from
1243 both generated DarkPAN manifests.
1244  
1245 F<cpanfile.darkpan> contains dependencies selected for resolution from
1246 the DarkPAN in cpanfile syntax. F<cpanm.darkpan> contains the same
1247 dependencies in a form suitable for passing to
1248 L<cpanm|App::cpanminus>.
1249  
1250 The configured DarkPAN must publish:
1251  
1252 modules/02packages.details.txt.gz
1253  
1254 under C<DARKPAN_URL>.
1255  
1256 =item C<make package>
1257  
1258 Runs the quality and dependency gates together (C<lint> plus a
1259 dependency scan) - a convenience for pre-release verification.
1260  
1261 =item C<TARBALL_ORDER_ONLY_PREREQS>
1262  
1263 Additional order-only prerequisites for the distribution tarball.
1264  
1265 Set this in F<project.mk> when project-specific generated artifacts or
1266 other preparation steps must complete before the tarball is built but
1267 should not themselves determine whether the tarball is out of date.
1268  
1269 TARBALL_ORDER_ONLY_PREREQS += prepare-assets
1270  
1271 =item C<make release> / C<make minor> / C<make major>
1272  
1273 Bumps the patch, minor, or major version number in C<VERSION>.
1274  
1275 =item C<make release-notes>
1276  
1277 Generates a diff, file list, and tarball comparing the current version
1278 to the previous git tag.
1279  
1280 =item C<make clean>
1281  
1282 Removes build artifacts registered for cleaning. Does not affect
1283 F<buildspec.yml>, F<VERSION>, or any C<*.in> source files.
1284  
1285 If your project needs a project-specific clean recipe, use the
1286 C<clean-local> target with a double-colon.
1287  
1288 clean-local::
1289 rm -rf workdir
1290  
1291 =item C<make test>
1292  
1293 Runs the project's distribution unit tests under F<t/>:
1294  
1295 prove -I lib -I local/lib/perl5 -v t/
1296  
1297 C<make test> also runs any project-specific C<test-local::> recipes
1298 defined in F<project.mk>.
1299  
1300 Projects may have tests that exercise development infrastructure,
1301 external services, generated artifacts, or other behavior that should
1302 not be included in the CPAN distribution. These can be added through
1303 the C<test-local::> extension point:
1304  
1305 test-local::
1306 ./bin/test-integration
1307  
1308 The double-colon form allows F<project.mk> to extend the managed
1309 C<test-local> target without replacing it.
1310  
1311 C<make test> also recognizes the conventional extended-test
1312 directories F<xt/author/>, F<xt/release/>, and F<xt/smoke/>. These
1313 test suites are not run by default, but may be enabled through the
1314 corresponding environment or make variables:
1315  
1316 AUTHOR_TESTING=1 make test
1317 RELEASE_TESTING=1 make test
1318 AUTOMATED_TESTING=1 make test
1319  
1320 When enabled, C<make test> invokes the corresponding test target after
1321 the normal F<t/> test suite and C<test-local::> recipes have completed.
1322  
1323 =item C<make test-author>
1324  
1325 Runs tests under F<xt/author/>:
1326  
1327 prove -I lib -I local/lib/perl5 -r xt/author
1328  
1329 The F<xt/author/> directory is created automatically if it does not
1330 already exist.
1331  
1332 This target uses a double-colon rule and may therefore be extended in
1333 F<project.mk> without replacing the managed target:
1334  
1335 test-author::
1336 ./bin/check-generated-docs
1337  
1338 =item C<make test-release>
1339  
1340 Runs tests under F<xt/release/>:
1341  
1342 prove -I lib -I local/lib/perl5 -r xt/release
1343  
1344 The F<xt/release/> directory is created automatically if it does not
1345 already exist.
1346  
1347 The target may be extended in F<project.mk> using C<test-release::>.
1348  
1349 =item C<make test-smoke>
1350  
1351 Runs tests under F<xt/smoke/>:
1352  
1353 prove -I lib -I local/lib/perl5 -r xt/smoke
1354  
1355 The F<xt/smoke/> directory is created automatically if it does not
1356 already exist.
1357  
1358 The target may be extended in F<project.mk> using C<test-smoke::>.
1359  
1360 =item C<make test-all>
1361  
1362 Runs the complete test suite: distribution tests under F<t/>, any
1363 project-specific C<test-local::> recipes, and the author, release, and
1364 smoke test suites.
1365  
1366 It is equivalent to running:
1367  
1368 make test AUTHOR_TESTING=1 RELEASE_TESTING=1 AUTOMATED_TESTING=1
1369  
1370 The extended test directories follow established Perl distribution
1371 conventions. C<CPAN::Maker::Bootstrapper> preserves those conventions
1372 rather than requiring imported or existing projects to reorganize
1373 their tests.
1374  
1375 =item C<make tidy>
1376  
1377 Runs C<perltidy> on all C<.pm.in> and C<.pl.in> source files.
1378  
1379 If C<PERLTIDYRC> is set, the named profile is used:
1380  
1381 make tidy PERLTIDYRC=.perltidyrc
1382  
1383 If C<PERLTIDYRC> is not set, perltidy runs using its default
1384 configuration.
1385  
1386 If C<PERLTIDYRC> names a file that does not exist, the target fails.
1387  
1388 The target also performs syntax checking before modifying the source
1389 files.
1390  
1391 =item C<make critic>
1392  
1393 Runs C<perlcritic> on the project's Perl source files.
1394  
1395 If C<PERLCRITICRC> is set, the named profile is used:
1396  
1397 make critic PERLCRITICRC=.perlcriticrc
1398  
1399 If C<PERLCRITICRC> is not set, perlcritic runs using its default
1400 configuration.
1401  
1402 If C<PERLCRITICRC> names a file that does not exist, the target fails.
1403  
1404 The target also honors:
1405  
1406 PERLCRITIC_THEME
1407 PERLCRITIC_SEVERITY
1408  
1409 and performs syntax checking before running perlcritic.
1410  
1411 =item C<make lint>
1412  
1413 Runs both linting targets:
1414  
1415 make tidy
1416 make critic
1417  
1418 The perltidy and perlcritic configuration variables described above
1419 apply to their respective targets.
1420  
1421 =item C<make git>
1422  
1423 Initializes a git repository, stages all recommended project files
1424 including F<.includes/*>, and makes an initial C<BigBang> commit.
1425  
1426 =item C<make quick>
1427  
1428 Builds the distribution tarball with distribution dependency scanning
1429 and perltidy/perlcritic disabled. Syntax checking remains enabled.
1430  
1431 Useful during active development when you want fast iterative builds
1432 without updating F<requires>, F<test-requires>, F<recommends>, or
1433 F<suggests>.
1434  
1435 make quick
1436  
1437 Equivalent to:
1438  
1439 make SCAN=OFF LINT=OFF
1440  
1441 =item C<make workflow>
1442  
1443 Installs a CI build script (F<builder>), its default environment file
1444 (F<builder.env>), and a GitHub Actions workflow
1445 (F<.github/workflows/build.yml>) into your project, templated with your
1446 module and project name. Also merges any build-only dependencies
1447 C<builder> needs into F<build-requires>.
1448  
1449 make workflow
1450 git add build-requires builder builder.env .github/workflows/build.yml
1451  
1452 Commit these files - GitHub Actions will then run C<./builder> on
1453 every push to C<main> or C<dev>. See L</Continuous Integration> for
1454 what C<builder> does, how to customize its environment and build
1455 lifecycle, and how to run it outside of GitHub Actions.
1456  
1457 =item C<make build-ci>
1458  
1459 Runs F<builder> locally inside Docker, against your current working tree,
1460 to reproduce a CI build without pushing. Requires C<docker> and a
1461 F<builder> script (run C<make workflow> first if you don't have one).
1462  
1463 make build-ci
1464  
1465 See L</Continuous Integration> for the variables that control this
1466 target.
1467  
1468 =back
1469  
1470 =head2 README.md
1471  
1472 The F<Makefile> will automatically create a F<README.md> from your
1473 Perl module's pod. The stock F<buildspec.yml> will include that
1474 F<README.md> in the distribution's share directory. If you want the
1475 F<README.md> to be included in the distribution but not installed,
1476 edit the F<buildspec.yml> file.
1477  
1478 B<Before>
1479  
1480 extra-files:
1481 - ChangeLog
1482 - share:
1483 - README.md
1484  
1485 B<After>
1486 extra-files:
1487 - ChangeLog
1488 - README.md
1489  
1490 If you want to generate F<README.md> from a custom source, create a
1491 F<README.md.in> file. That file will be filtered through
1492 F<md-utils.pl> (from L<Markdown::Render>) to produce a C<.md> file.
1493  
1494 =head1 COMMANDS
1495  
1496 =over 4
1497  
1498 =item install (default)
1499  
1500 Scaffolds a new project. This is the default command, so:
1501  
1502 cmb -m My::Module
1503  
1504 ...is the same as:
1505  
1506 cmb -m My::Module install
1507  
1508 =item create-config
1509  
1510 Outputs a stub configuration file to STDOUT. Create and edit a new
1511 config to customize the behavior of C<cmb>.
1512  
1513 cmb create-config > ~/.cpan-makerrc
1514  
1515 Then set C<CPAN_MAKER_CONFIG> to point to it:
1516  
1517 export CPAN_MAKER_CONFIG=$HOME/.cpan-makerrc
1518  
1519 =item deps-filter
1520  
1521 cmb deps-filter requires
1522  
1523 Filters a dependency list so that modules already provided by another
1524 listed distribution are removed.
1525  
1526 The command consults the public CPAN package index and any repositories
1527 listed in F<build-mirrors>. Repository indexes are cached under the
1528 user's cache directory and conditionally refreshed on subsequent runs.
1529  
1530 This command is normally invoked automatically by the generated
1531 Makefile for C<requires>, C<recommends>, C<suggests>, and
1532 C<test-requires>.
1533  
1534 =item dist-file
1535  
1536 cmb dist-file distribution-name filename
1537  
1538 Copies a distribution file to STDOUT. Searches the root and F<share/>
1539 directories of the distribution for file. Throws and exception if
1540 either the file is not found or the distribution is invalid.
1541  
1542 Example:
1543  
1544 cmb dist-file CPAN-Maker-Bootstrapper builder.env
1545  
1546 =item extra-files
1547  
1548 cmb extra-files path file1 file2 ...
1549  
1550 Adds files to the distribution. Use C<.> for files that should appear
1551 at the root of the distribution tarball but not be installed into the
1552 share directory. Use C<share> for files that should be installed into
1553 the distribution share directory.
1554  
1555 I<NOTE: file should be the relative path within the project that points to the file.>
1556  
1557 Example:
1558  
1559 cmb extra-files . README.md
1560 cmb extra-files share share/config.json
1561  
1562 Entries may be removed by editing F<buildspec.yml> directly, which is
1563 usually the clearest approach.
1564  
1565 The C<cmb extra-files> command also supports removing an entry by
1566 prefixing the filename with C<->:
1567  
1568 cmb extra-files . -README.md
1569  
1570 This is primarily useful from scripts or other automated workflows.
1571  
1572 =item create-deps
1573  
1574 cmb create-deps [module.pm.in ...]
1575  
1576 Emits GNU make dependency rules (to STDOUT) capturing the
1577 B<inter-module> dependencies within your distribution -- i.e. which of
1578 your own C<.pm> files C<use> which others. Uses
1579 L<Module::ScanDeps::Static> to scan each source module, then prints
1580 C<target: prerequisite> lines (in F<deps.mk> form) for the internal
1581 packages only, so C<make> rebuilds a dependent module when a module it
1582 depends on changes. With no arguments every project module is scanned;
1583 name one or more modules to restrict the output.
1584  
1585 =item create-darkpan-requires
1586  
1587 cmb create-darkpan-requires [--filter file] [requires-file]
1588  
1589 Examines F<requires> (or C<requires-file>) and identifies dependencies
1590 available from the configured DarkPAN. Each dependency is checked
1591 against the DarkPAN F<02packages.details.txt.gz> index. Dependencies
1592 found on the DarkPAN are included in the generated manifests.
1593  
1594 For each dependency found on the DarkPAN, MetaCPAN is also checked. If the
1595 module is available from both CPAN and the DarkPAN, a warning is emitted and
1596 the DarkPAN is preferred.
1597  
1598 The optional C<--filter> argument names a file containing module names to
1599 exclude from the generated manifests, one module per line:
1600  
1601 cmb create-darkpan-requires --filter darkpan.skip requires
1602  
1603 This is useful when a module is available from both CPAN and the DarkPAN but
1604 the distribution author wants that dependency to be resolved from CPAN.
1605  
1606 When invoked through the generated Makefile, F<darkpan.skip> is used
1607 automatically when it exists.
1608  
1609 The presence of F<darkpan.skip> affects only which dependencies are
1610 written to the manifests; it does not change the distribution or
1611 source-control treatment of the generated files.
1612  
1613 The generated files are intended as installation aids and are included with
1614 the distribution. They do not alter normal Perl dependency resolution by
1615 themselves and are not automatically consulted during installation. Instead,
1616 they are intended to be consumed explicitly by your installation tool, such
1617 as C<cpm> or C<cpanm>.
1618  
1619 For distributions that include these files, the C<cpan-distfile> utility
1620 provided with L<DarkPAN::Resolver::SQLite> can be used to retrieve them
1621 directly from a CPAN distribution without manually downloading and unpacking
1622 the tarball.
1623  
1624 cpan-distfile Some::Module cpanm.darkpan > cpanm.darkpan
1625  
1626 See L<DarkPAN::Resolver::SQLite> for examples of using these manifests with
1627 C<cpm> and C<cpanm>.
1628  
1629 The command generates two representations of those dependencies:
1630  
1631 cpanfile.darkpan
1632 cpanm.darkpan
1633  
1634 F<cpanfile.darkpan> uses cpanfile syntax:
1635  
1636 requires 'Amazon::API::CloudWatchLogs', '1.43.90';
1637  
1638 F<cpanm.darkpan> contains one cpanm module requirement per line:
1639  
1640 Amazon::API::CloudWatchLogs~1.43.90
1641  
1642 The version constraints are taken from F<requires>; the DarkPAN index
1643 is used only to determine whether a module is available from a DarkPAN
1644 repository.
1645  
1646 This command is normally invoked automatically by C<make> when
1647 C<DARKPAN_REQUIRES> is enabled.
1648  
1649 =item critique
1650  
1651 cmb critique file ...
1652 cmb critique --file-list manifest
1653  
1654 Runs L<Perl::Critic> over the given files (or a newline-delimited
1655 C<--file-list>). Defaults to the C<pbp> theme at severity 5; override
1656 with the C<PERLCRITIC_THEME>, C<PERLCRITIC_SEVERITY>, and
1657 C<PERLCRITICRC> environment variables. Requires L<Perl::Critic> to be
1658 installed.
1659  
1660 =item publish-to-cpan
1661  
1662 cmb publish-to-cpan distribution.tar.gz [username [password]]
1663  
1664 Uploads a distribution tarball to PAUSE.
1665  
1666 The username and password may be supplied as arguments or through
1667 C<PAUSE_USER> and C<PAUSE_PASSWORD>. Normally this command is invoked
1668 by C<make publish>, which rebuilds and tests the distribution before
1669 uploading it.
1670  
1671 =item resolve-vars
1672  
1673 cmb resolve-vars [--vars-file FILE] [--no-strict] source-file
1674  
1675 Filters C<source-file> to STDOUT, substituting C<@TOKEN@> placeholders
1676 with values drawn from the environment (or from a C<--vars-file>). This
1677 is the mechanism the generated F<Makefile> uses to turn F<.pm.in> and
1678 F<.pl.in> sources into their built C<.pm>/C<.pl> counterparts -- for
1679 example filling C<2.4.0> from the F<VERSION> file or
1680 C<@BUILD_DATE@> at build time.
1681  
1682 A placeholder is required to have a value only when it appears in live
1683 code. Placeholders that occur solely inside POD or C<#> comments are
1684 treated as references, not substitutions: they never trigger a "no
1685 value present" error and are left untouched when no value is
1686 available. This lets you document a token in your POD (e.g. mention
1687 C<@BUILD_DATE@> in a description) without breaking the build.
1688  
1689 For placeholders that I<do> appear in code, behavior depends on
1690 C<--strict> (the default):
1691  
1692 =over 4
1693  
1694 =item * B<strict> (default) - a placeholder in code with no value is a
1695 fatal error; the build stops.
1696  
1697 =item * B<--no-strict> - a placeholder in code with no value produces a
1698 warning and is left in place literally (as C<@TOKEN@>) rather than being
1699 substituted to an empty string.
1700  
1701 =back
1702  
1703 See L</C<--vars-file>> and L</C<--strict, --no-strict>>.
1704  
1705 =back
1706  
1707 =head2 LLM Commands
1708  
1709 The following commands require L<LLM::API> to be installed and a valid
1710 Anthropic API key. Set it in the environment before running any LLM command:
1711  
1712 export LLM_API_KEY=$(cat ~/.ssh/anthropic-api-key)
1713  
1714 The key is deleted from the environment immediately after being read and
1715 is never passed to child processes. See L<CPAN::Maker::ConfigReader> for
1716 the C<llm-api-key-helper> option which avoids exposing the key in shell
1717 history entirely.
1718  
1719 I<SECURITY NOTE: Never pass your API key on the command line where it
1720 would be visible in shell history and process listings.>
1721  
1722 =over 4
1723  
1724 =item code-review
1725  
1726 Submits a Perl module or script to the LLM for a code review. POD is
1727 automatically stripped before submission so token costs reflect code
1728 only. The review is written as a JSON file to the current directory.
1729  
1730 cmb code-review [options] lib/My/Module.pm
1731  
1732 The review file is named:
1733  
1734 <module>-review-<timestamp>.code
1735  
1736 A token usage summary is printed to stderr after the review completes.
1737  
1738 If a review has been completed at least once the annotated review file
1739 is automatically sent with your code to re-focus the review. You must
1740 annotate the review file before resubmitting by running the
1741 C<annotate> command and marking each finding with a valid
1742 disposition. See L</THE REVIEW WORKFLOW> for details.
1743  
1744 Options specific to code-review:
1745  
1746 --prompt|-p PATH path to a custom review prompt file
1747 --prompt-profile|-P NAME additive prompt profile (repeatable)
1748 --context|-C PATH context file to submit alongside the review (repeatable)
1749  
1750 I<Note: The prompt profile list and the context file list are written
1751 to the review output file. On subsequent runs these will be read from
1752 the review. You do not need to provide them unless you want to update
1753 their values.>
1754  
1755 =item annotate
1756  
1757 Applies disposition tags to findings in the latest review file and
1758 displays the current annotation state. Must be run from a project
1759 directory (one containing F<.includes/>).
1760  
1761 cmb annotate [options] lib/My/Module.pm
1762  
1763 Without options, displays the current annotation state of the latest
1764 review file. With C<-a> options, applies the specified dispositions
1765 before displaying.
1766  
1767 cmb annotate lib/My/Module.pm
1768 cmb annotate -a 1:wrong -a 2:reject lib/My/Module.pm
1769  
1770 Options:
1771  
1772 --annotate|-a N:DISPOSITION apply disposition to finding N (repeatable)
1773 --auto-annotate|-A annotate and immediately submit the next review
1774 --finalize-annotations|-F create versioned release artifact
1775  
1776 Valid dispositions are C<accept>, C<reject>, C<wrong>,
1777 C<wrong-reconsider>, C<defer>, and C<confirmed> (case
1778 insensitive). See L</THE REVIEW WORKFLOW> for a description of each.
1779  
1780 =item pod-finding
1781  
1782 cmb pod-finding lib/CPAN/Maker/Bootstrapper.pm
1783  
1784 Run this after a C<pod-review> command to display a table of findings.
1785  
1786 =item pod-review
1787  
1788 Submits a Perl module or script to the LLM for a documentation review.
1789 The full file including code is submitted so the LLM can check
1790 consistency between implementation and documentation. If no POD
1791 exists, the LLM generates complete POD documentation suitable for
1792 placement after C<__END__>.
1793  
1794 cmb pod-review lib/My/Module.pm
1795  
1796 The review file is named:
1797  
1798 <module>-review-<timestamp>.pod
1799  
1800 =item release-notes
1801  
1802 Generates release notes for a given version using the LLM. Requires
1803 the release artifacts produced by C<make release-notes>:
1804  
1805 release-<version>.diffs
1806 release-<version>.lst
1807 release-<version>.tar.gz
1808  
1809 cmb release-notes <version>
1810  
1811 The generated release notes are written to C<release-notes-E<lt>versionE<gt>.md>.
1812 Binary files are automatically excluded. Use C<--max-diff-files> to
1813 cap token consumption on large distributions (default: 50, 0 = unlimited).
1814  
1815 =item code-finding
1816  
1817 Generates a table with the complete details of a finding.
1818  
1819 cmb code-finding lib/My/Module.pm 1
1820  
1821 =item show-defaults
1822  
1823 Prints the resolved default option values to STDOUT after applying
1824 configuration-file values and runtime defaults.
1825  
1826 =item update-annotations
1827  
1828 cmb update-annotations file
1829  
1830 Applies human-curated annotations to the most recent code review for
1831 C<file>. On first run it generates an F<.annotate> file alongside the
1832 review for you to edit; re-run it to apply your edited annotations back
1833 into the review. Pairs with C<code-review>/C<annotate> in the review
1834 workflow.
1835  
1836 =back
1837  
1838 =head1 OPTIONS
1839  
1840 =over 4
1841  
1842 =item C<--annotate|-a> N:DISPOSITION
1843  
1844 See L</THE REVIEW WORKFLOW>
1845  
1846 =item C<--auto-annotate|-A>
1847  
1848 See L</THE REVIEW WORKFLOW>
1849  
1850 =item C<--basedir|-b> DIR
1851  
1852 Base directory in which to create the project. Defaults to the
1853 current working directory when C<--installdir> and C<--basedir> are not
1854 provided. The directory must exist or the script will throw an
1855 exception.
1856  
1857 I<Note: If C<--installdir> is provided it takes precedence and
1858 C<--basedir> is ignored.>
1859  
1860 default: pwd
1861  
1862 =item C<--color|--no-color>
1863  
1864 default: color
1865  
1866 To turn color off use --no-color.
1867  
1868 =item C<--dry-run|-D>
1869  
1870 Dry run mode will abort after displaying a pre-submission token and
1871 cost estimation for the C<pod-review> and C<code-review> commands.
1872  
1873 =item C<--config|-c> configuration file
1874  
1875 The path to a C<.ini> file that contains configuration information
1876 used to scaffold your project.
1877  
1878 default: ~/.gitconfig
1879  
1880 =item C<--context|-C> PATH
1881  
1882 One or more files to submit with your code review file that provide
1883 additional context for the LLM during the review.
1884  
1885 =item C<--email|-e> EMAIL
1886  
1887 Override the author email. Defaults to C<user.email> from your global
1888 git config.
1889  
1890 =item C<--finalize-annotations|-F>
1891  
1892 See L</THE REVIEW WORKFLOW>
1893  
1894 =item C<--force|-f>
1895  
1896 Overwrite an existing project. Without this flag, the command dies if a
1897 C<Makefile> already exists in the target directory.
1898  
1899 =item C<--github-user|-g> USER
1900  
1901 Override the GitHub username used to construct repository URLs in
1902 C<buildspec.yml>. Defaults to C<user.github> from your global git config.
1903  
1904 =item C<--import|-I> path
1905  
1906 A path that contains C<.pm> or C<.pl> files for importing into the
1907 project. You can specify multiple paths. You cannot use C<--stub> and
1908 C<--import> together.
1909  
1910 Example:
1911  
1912 cmb --module Foo::Bar -I ~/foo-bar/lib -I ~/foo-bar/bin
1913  
1914 =over 8
1915  
1916 =item * The primary module must be determinable from either directory
1917 name or supplied using the C<--module> option. The corresponding
1918 module file must exist beneath one of the import paths. For example,
1919 C<Foo::Bar> must be found as F<Foo/Bar.pm>.
1920  
1921 =item * The F<Makefile> will automatically attempt to substitute the
1922 token C<E<64>PACKAGE_VERSIONE<64>> inside your C<.pl.in> or C<.pm.in>
1923 files with the current semantic version in the F<VERSION> file. If you
1924 want to use that for versioning your scripts and modules add the token
1925 as shown below:
1926  
1927 C<our $VERSION = 'E<64>PACKAGE_VERSIONE<64>';>
1928  
1929 =back
1930  
1931 =item C<--installdir|-i> DIR
1932  
1933 Directory in which to create the project. When supplied, this overrides
1934 the configured or command-line C<basedir>. The directory is created if
1935 it does not exist.
1936  
1937 Example:
1938  
1939 cmb --installdir ~/git/My-Module
1940  
1941 The install directory should include the project name.
1942  
1943 I<Note: C<--installdir> overrides C<--basedir>>.
1944  
1945 =item C<--max-diff-files> LIMIT
1946  
1947 The maximum number of changed files included in the release artifact
1948 that may be uploaded to the LLM when generating release notes. Set to
1949 C<0> for no limit.
1950  
1951 default: 50
1952  
1953 =item C<--max-tokens|-t> TOKENS
1954  
1955 Maximum number of tokens the LLM may return in a single response.
1956 Higher values reduce the risk of truncated reviews on large files.
1957  
1958 default: 4096 (set by L<LLM::API>)
1959  
1960 =item C<--model|-M> MODEL
1961  
1962 Specifies the model id to use for the C<pod-review> and C<code-review>
1963 commands.
1964  
1965 For C<pod-review> the default model is C<claude-haiku-4-5-20251001>.
1966  
1967 For C<code-review> the default model is C<claude-sonnet-4-6>.
1968  
1969 The Haiku model tends to be better at summarizing documentation and
1970 avoiding unnecessary analysis around edge cases that contribute to
1971 noise.
1972  
1973 I<Caution: Both models try hard to find issues to the point that you
1974 will almost never get a clean run when asking for a POD review. When
1975 your POD is complete, accurate and usable it's good enough. Avoid
1976 shaving the yak!>
1977  
1978 =item C<--module|-m> MODULE
1979  
1980 The Perl module name for the new project, e.g. C<My::New::Module>.
1981 Used to derive the project directory name, source file path, and
1982 tarball name.
1983  
1984 You may omit this option when the module name can be determined from
1985 a custom stub file or from the project directory name.
1986  
1987 =item C<--prompt|-p> PATH
1988  
1989 Path to a text file that will be used to prompt the LLM for a code or pod review.
1990  
1991 defaults:
1992  
1993 pod => .prompts/pod-review.prompt
1994 code => .prompts/code-review.prompt
1995  
1996 =item C<--prompt-profile|-P> NAME
1997  
1998 The name of a prompt profile located in the F<.prompts> directory. One
1999 or more profile names may be specified. You need only provide the name
2000 (e.g. cli-tool).
2001  
2002 See L</PROMPT PROFILES>
2003  
2004 =item C<--resources|-r> github
2005  
2006 Currently takes only a single value: 'github' that indicates that the
2007 resources section of F<Makefile.PL> should be populated with GitHub
2008 URL references. Future versions may support additional providers.
2009  
2010 =item C<--strict>, C<--no-strict>
2011  
2012 Controls how C<resolve-vars> treats an C<@TOKEN@> placeholder that
2013 appears in code but has no value in the environment or C<--vars-file>.
2014 C<--strict> (the default) makes this a fatal error. C<--no-strict>
2015 downgrades it to a warning and leaves the placeholder literal in the
2016 output.
2017  
2018 This affects code placeholders only. Placeholders that appear solely in
2019 POD or C<#> comments are always ignored by the missing-value check
2020 regardless of this flag, so C<--no-strict> is not needed merely to
2021 document a token.
2022  
2023 =item C<--stub|-s> TYPE|PATH
2024  
2025 Controls the module stub used to generate the initial C<.pm.in> source
2026 file. Three forms are accepted:
2027  
2028 =over 4
2029  
2030 =item * Omitted - uses the default plain class stub (C<class-module.pm.tmpl>).
2031  
2032 =item * C<cli> - uses the CLI stub (C<cli-module.pm.tmpl>), which
2033 inherits from L<CLI::Simple> and includes a skeleton C<main>, C<init>,
2034 and a placeholder command.
2035  
2036 =item * A file path - uses the specified file as the stub. The file
2037 must exist or the command will die with an error. This allows you to
2038 supply your own template or bootstrap a project around a module you
2039 have already started writing. You can omit the C<--module> option if
2040 you supply your own stub file. See the explanation for the
2041 C<--module> option for details.
2042  
2043 =back
2044  
2045 When specifying a stub you cannot use the C<--import> option.
2046  
2047 =item C<--username|-u> NAME
2048  
2049 Override the author name used in the module stub and C<buildspec.yml>.
2050 Defaults to C<user.name> from your global git config.
2051  
2052 =item C<--vars-file>
2053  
2054 The path to a file containing template variable values used by
2055 C<resolve-vars>.
2056  
2057 =back
2058  
2059 =head1 THE REVIEW WORKFLOW
2060  
2061 C<CPAN::Maker::Bootstrapper> allows you to implement a structured
2062 iterative code review workflow built around JSON review files and
2063 developer-applied disposition annotations. The workflow converges over
2064 several rounds, with each round potentially costing less as noise is
2065 suppressed and findings are resolved.
2066  
2067 =head2 Overview
2068  
2069 Each review round consists of three steps:
2070  
2071 =over 4
2072  
2073 =item 1. Run a review
2074  
2075 cmb code-review --prompt-profile cli-tool lib/My/Module.pm
2076  
2077 The review is written to a timestamped C<.code> file containing a JSON
2078 object with C<findings>, C<confirmations>, and C<deferred> arrays.
2079  
2080 =item 2. Annotate the findings
2081  
2082 An annotation is how you mark a finding with a disposition. The
2083 dispositions are used by the LLM during the next review. See L</Dispositions>.
2084  
2085 cmb annotate lib/My/Module.pm
2086  
2087 This displays the current annotation state. Apply dispositions with
2088 C<-a> options:
2089  
2090 cmb annotate -a 1:accept -a 2:wrong -a 3:reject -a 4:defer lib/My/Module.pm
2091  
2092 You can annotate incrementally across multiple invocations. Each call
2093 shows the updated state so you always know what remains.
2094  
2095 Alternatively, use C<update-annotations> to maintain dispositions in an
2096 annotation file rather than on the command line:
2097  
2098 cmb update-annotations lib/My/Module.pm
2099  
2100 The first invocation creates an F<.annotate> file for editing. Run the
2101 command again after editing the file to apply those dispositions to the
2102 review.
2103  
2104 =item 3. Submit the next review
2105  
2106 Once all findings are annotated and code updated if necessary, run the
2107 next review. The bootstrapper automatically finds and submits the
2108 latest annotated review file with your updated code:
2109  
2110 cmb code-review lib/My/Module.pm
2111  
2112 Alternatively, use C<--auto-annotate|-A> with the C<annotate> command
2113 to annotate and immediately resubmit in one step:
2114  
2115 cmb annotate -a 1:wrong -a 2:reject --auto-annotate \
2116 lib/My/Module.pm
2117  
2118 The LLM will honor all dispositions from the prior round, confirm
2119 fixes marked C<ACCEPT>, carry forward C<DEFER> items, and suppress
2120 C<REJECT> and C<WRONG> findings. New findings appear without noise
2121 from settled questions.
2122  
2123 =back
2124  
2125 =head2 Dry Run Mode
2126  
2127 Before the prompt and code are submitted for review, the script
2128 displays estimated token usage and cost. The input token count is
2129 obtained from the model's token-counting API using the message that
2130 will actually be submitted, so the input count is accurate. The
2131 output token count, and therefore the final cost, is an estimate.
2132  
2133 To stop before submitting the review, use C<--dry-run>. The command
2134 will abort immediately before the message is sent to the LLM.
2135  
2136 =head2 Dispositions
2137  
2138 Each finding in the annotations file must be given one of the
2139 dispositions described below before the next review can be
2140 submitted. The prompt sent to the LLM is designed around these
2141 dispositions. This helps successive reviews converge by carrying forward the
2142 developer's decisions from earlier rounds.
2143  
2144 =over 4
2145  
2146 =item ACCEPT
2147  
2148 The finding is valid and has been fixed. On the next review the LLM
2149 will confirm the fix is present. If the fix is not found the finding
2150 will be re-raised.
2151  
2152 =item REJECT
2153  
2154 The finding has been reviewed and dismissed as inapplicable to this
2155 codebase or context. It will not be raised again in subsequent reviews.
2156  
2157 =item WRONG
2158  
2159 The finding was based on faulty reasoning. The code is correct. The
2160 finding will not be re-raised. Use this when the LLM has misread the
2161 control flow, misunderstood the design intent, or applied an
2162 inappropriate threat model.
2163  
2164 =item WRONG-RECONSIDER
2165  
2166 Applied automatically at finalization to all findings marked WRONG.
2167 On the first review of the next version the LLM will re-examine the
2168 specific function and code excerpt carefully. If the prior analysis
2169 was still incorrect the finding reverts to WRONG. If the code has
2170 changed and the finding is now valid it is raised as a new finding.
2171 If the model understands specifically why its prior reasoning was
2172 wrong it may mark the finding CONFIRMED.
2173  
2174 =item DEFER
2175  
2176 The finding is known and acknowledged but not yet addressed. It is
2177 carried forward in the C<deferred> array of each subsequent review
2178 without being treated as a new finding.
2179  
2180 =item CONFIRMED
2181  
2182 Used for logic confirmations rather than defects. Marks that both the
2183 LLM and the developer agree the code is correct.
2184  
2185 =back
2186  
2187 =head2 Diminishing Returns and When to Stop
2188  
2189 Run the C<annotate> command after each review submission to view the
2190 findings. Each round tends to surface smaller and more obscure issues
2191 as obvious findings are resolved. Despite some fairly aggressive
2192 attempts to create prompts that prevent trivial or obscure findings
2193 you should stop when you see these signals:
2194  
2195 =over 4
2196  
2197 =item *
2198  
2199 All new findings are LOW severity.
2200  
2201 =item *
2202  
2203 The LLM is re-raising findings already marked WRONG or REJECT,
2204 possibly rephrased (LLMs can and do make mistakes!).
2205  
2206 =item *
2207  
2208 New findings describe edge cases that cannot occur in normal usage.
2209  
2210 =back
2211  
2212 When all findings have dispositions and no new substantive issues
2213 appear, the review should be considered complete.
2214  
2215 =head2 The Release Artifact
2216  
2217 When you are satisfied with the review state, finalize it with
2218 C<--finalize-annotations>:
2219  
2220 cmb annotate --finalize-annotations -a 1:wrong -a 2:reject lib/My/Module.pm
2221  
2222 This applies any remaining dispositions, validates that all findings
2223 are annotated, reads the version from the F<VERSION> file, and writes
2224 the versioned release artifact:
2225  
2226 CPAN-Maker-Bootstrapper-1.1.0-REVIEW.json
2227  
2228 This file serves as a code review certification for the release - a
2229 machine-readable record of every finding examined, every logic
2230 confirmation made, and every disposition applied before the version
2231 was published. Commit it to the repository alongside your ChangeLog.
2232  
2233 All findings marked WRONG are automatically converted to
2234 WRONG-RECONSIDER in the release artifact, prompting careful
2235 re-examination on the first review of the next version rather
2236 than permanent suppression.
2237  
2238 =head2 Cost Management
2239  
2240 Review cost depends on the selected model, source size, prompt
2241 profiles, and number of findings. Costs generally decrease over
2242 successive rounds as the model spends fewer output tokens
2243 re-explaining suppressed findings.
2244  
2245 Use your own prompt profiles (C<--prompt-profile>) to suppress entire
2246 classes of noise before they reach the annotation file. A well-tuned
2247 profile for your application type is the highest-leverage cost
2248 reduction available.
2249  
2250 =head2 See Also
2251  
2252 L</LLM Commands>, L</PROMPT PROFILES>, L<CPAN::Maker::ConfigReader>
2253  
2254 =head1 PROMPT PROFILES
2255  
2256 Prompt profiles are additive prompt fragments that customize the review
2257 behavior for specific application types. They are appended to the base
2258 review prompt before submission and are intended to focus the review on
2259 relevant concerns while suppressing noise that does not apply to the
2260 target context.
2261  
2262 I<NOTE: Prompts count toward your input token count. Be succinct and
2263 accurate.>
2264  
2265 =head2 Using Profiles
2266  
2267 Pass one or more profiles using the C<--prompt-profile> option:
2268  
2269 cmb code-review --prompt-profile cli-tool MyModule.pm
2270  
2271 Multiple profiles may be combined:
2272  
2273 cmb code-review --prompt-profile cli-tool --prompt-profile security MyModule.pm
2274  
2275 Profiles are resolved from the F<.prompts/> directory in the current
2276 project. A profile named C<cli-tool> resolves to
2277 F<.prompts/cli-tool.prompt>. Add project-specific prompt profiles to
2278 F<.prompts/> and commit them with your project.
2279  
2280 =head3 Built-in Profiles
2281  
2282 The following profile is installed with the distribution:
2283  
2284 =over 4
2285  
2286 =item cli-tool
2287  
2288 Appropriate for single-user developer CLI tools. Suppresses security
2289 findings that assume a multi-user or hostile environment, TOCTOU race
2290 condition findings that assume concurrent invocation, and concerns about
2291 C<qx{}> or C<system()> calls where input originates from the user's own
2292 configuration. Also assumes C<perlcritic> and C<perltidy> are enforced
2293 in the development environment.
2294  
2295 =back
2296  
2297 =head3 Creating Custom Profiles
2298  
2299 A profile is a plain text file in F<.prompts/> containing additional
2300 prompt instructions, one per line. Lines beginning with C<#> are
2301 treated as comments and stripped before submission. Profile
2302 instructions are appended verbatim to the base review prompt. The
2303 built-in profiles use one instruction per line, typically prefixed
2304 with C<->.
2305  
2306 Example F<.prompts/security.prompt>:
2307  
2308 # security profile - add to any review where input handling matters
2309 - Treat all caller-supplied input as untrusted regardless of source.
2310 - Flag any use of eval, system, or exec that incorporates external data.
2311 - Flag missing taint checks on data used in file or system operations.
2312  
2313 =head3 Additional Profile Ideas
2314  
2315 =over 4
2316  
2317 =item library
2318  
2319 Focuses on API contract correctness and caller assumptions. Appropriate
2320 for CPAN distributions intended for use by unknown callers.
2321  
2322 =item web-application
2323  
2324 Treats external input as untrusted. Flags injection risks, authentication
2325 gaps, and session handling concerns.
2326  
2327 =item mod-perl-handler
2328  
2329 Addresses Apache lifecycle concerns including global state, startup versus
2330 request time initialization, and child process behavior.
2331  
2332 =item lambda-function
2333  
2334 Focuses on cold start performance, statelessness, and environment variable
2335 handling appropriate for AWS Lambda deployments.
2336  
2337 =back
2338  
2339 Community contributions of additional profiles are welcome. See
2340 L<https://github.com/rlauer6/CPAN-Maker-Bootstrapper/issues>.
2341  
2342 =head1 EXTENDING THE BUILD SYSTEM
2343  
2344 The installed F<Makefile> and files under F<.includes/> are managed by
2345 C<CPAN::Maker::Bootstrapper>. They are intentionally write-protected and
2346 may be replaced by C<make update> when the bootstrapper is upgraded.
2347  
2348 Project-specific build logic belongs in F<project.mk>, which is always
2349 writable and is never touched by C<make update>. This provides an
2350 upgrade-safe extension point for project-specific targets, variables,
2351 and build ordering.
2352  
2353 The managed include files live in the F<.includes/> directory,
2354 where they are write-protected and clearly separated from project
2355 files. The F<Makefile> includes them automatically:
2356  
2357 include .includes/publish.mk
2358 include .includes/bootstrap.mk
2359 include .includes/perl.mk
2360 include .includes/local.mk
2361 include .includes/help.mk
2362 include .includes/version.mk
2363 include .includes/release-notes.mk
2364 include .includes/git.mk
2365 include .includes/update.mk
2366 include .includes/upgrade.mk
2367 include .includes/bash-completion.mk
2368 include .includes/modulino.mk
2369  
2370 These files are included if they exist:
2371  
2372 include config.mk
2373 include project.mk
2374 include extra-files.mk
2375  
2376 =head2 Immutability Is a Feature
2377  
2378 The managed build system is deliberately B<immutable>: the
2379 F<Makefile>, everything under F<.includes/>, and the generated
2380 F<.pm>/F<.pl> files are write-protected on purpose. This is a feature,
2381 not a restriction. It lets C<make update> replace those files with
2382 newer, better versions without clobbering anything of yours, and it
2383 guarantees that two projects on the same bootstrapper version use the
2384 same managed build rules -- there is no per-project drift hiding in a
2385 locally edited managed rule.
2386  
2387 You I<can> override any of it -- these are your files, and nothing stops you
2388 from C<chmod +w> and editing a generated module or a managed include. But
2389 you should not need to, and if you do, C<make update> will overwrite your
2390 change. Every legitimate customization has a sanctioned hook that survives
2391 C<make update>:
2392  
2393 =over 4
2394  
2395 =item * B<Project-specific targets, rules, and build ordering> --
2396 F<project.mk> (always writable; never touched by C<make update>).
2397  
2398 Reach for F<project.mk> when your project needs to do something the
2399 generic build system can't know about, for example:
2400  
2401 =over 4
2402  
2403 =item * B<Build a companion artifact> the managed build doesn't produce --
2404 generate a F<.pm.in> from a JSON/YAML schema, render documentation, compile
2405 assets, or (as C<Amazon::API> does) build a Storable data file consumed at
2406 runtime.
2407  
2408 =item * B<Declare inter-module build order> the scanner can't infer --
2409 C<lib/Foo/Bar.pm: lib/Foo.pm> when one module must be built before another.
2410  
2411 =item * B<Deploy or publish> -- an C<scp>/upload/notify target that runs
2412 after C<all>.
2413  
2414 =item * B<Extend cleanup> -- a C<clean-local::> double-colon rule to remove
2415 your own generated files, and C<CLEANFILES +=> for anything else.
2416  
2417 =back
2418  
2419 See L</What Belongs in F<project.mk>> for worked examples of each, and
2420 L</What Does NOT Belong in F<project.mk>> for the line between your extensions
2421 and the managed core.
2422  
2423 =item * B<Build-behavior toggles> (dependency scanning, linting, syntax
2424 checking, version-drift strictness) -- make variables set on the command
2425 line or in F<config.mk> (see L</CONFIGURATION> and the variable list below).
2426  
2427 =item * B<Template tokens in your source> -- declare them in
2428 C<TEMPLATE_VARS> and let C<cmb resolve-vars> fill them, rather than
2429 hand-editing a generated F<.pm> (see L</Custom Template Tokens>).
2430  
2431 =item * B<Extra distribution files> -- list them in F<buildspec.yml>;
2432 C<extra-files.mk> wires them into the tarball automatically.
2433  
2434 =item * B<Dependencies the scanner cannot see> -- the sticky C<+> prefix in
2435 F<requires> (see L</Dependencies Management>).
2436  
2437 =back
2438  
2439 If you find yourself wanting to edit a managed file, check this list first:
2440 the hook you need almost certainly exists, and using it keeps you on the
2441 upgrade path instead of forking the build system.
2442  
2443 I<Why the generated F<.pm>/F<.pl> files are read-only:> they are
2444 regenerated from their F<.pm.in>/F<.pl.in> sources when its
2445 prerequisites require regeneration, so any edit you make directly to a
2446 generated F<.pm> would be silently lost on the next C<make>. The
2447 C<chmod -w> is there to stop you from making that mistake. Edit the
2448 F<.pm.in> source, not the generated F<.pm>.
2449  
2450 =head2 How the Makefile Works
2451  
2452 The installed F<Makefile> is structured around a few key concepts:
2453  
2454 =over 4
2455  
2456 =item * B<Source files> live in F<lib/> as F<.pm.in> and in F<bin/> as
2457 F<.pl.in>. The build generates the final F<.pm> and F<.pl> files from
2458 these sources by substituting C<E<64>PACKAGE_VERSIONE<64>> and other
2459 tokens, running syntax checks, and optionally running perltidy and
2460 perlcritic.
2461  
2462 =item * B<Sentinel files> - the build uses sentinel files to track
2463 incremental quality-gate state. F<.checked> records successful syntax
2464 and validation checks, F<.tdy> records successful perltidy processing,
2465 and F<.crit> records successful perlcritic processing. Each sentinel is
2466 regenerated only when the source or the prerequisites for that gate
2467 change.
2468  
2469 =item * B<Dependency scanning> - C<scandeps-static.pl> scans your
2470 source files and maintains the dependency files used by L<CPAN::Maker>
2471 when generating distribution metadata, including F<requires>,
2472 F<test-requires>, F<recommends>, and F<suggests>. Controlled by
2473 C<SCAN=ON|OFF>.
2474  
2475 =item * B<The distribution tarball> is the final output of C<make>.
2476 It is built by C<make-cpan-dist.pl> using F<buildspec.yml>.
2477  
2478 =item * B<Inter-module dependency discovery> - the build scans modules
2479 within the distribution and generates F<deps.mk> so C<make> can build
2480 modules in dependency order before syntax checking them. Dependencies
2481 that cannot be inferred automatically may be added in F<project.mk>.
2482  
2483 =back
2484  
2485 Key build variables you can override on the make command line or in
2486 F<config.mk>:
2487  
2488 =over 4
2489  
2490 =item C<SCAN=OFF> - skip distribution dependency scanning
2491  
2492 =item C<LINT=OFF> - skip perltidy and perlcritic
2493  
2494 =item C<SYNTAX_CHECKING=OFF> - skip C<perl -wc> syntax checks
2495  
2496 =item C<MIN_PERL_VERSION=5.016> - minimum Perl version for Makefile.PL
2497  
2498 =item C<PERLTIDYRC=/path/to/rc> - path to perltidy configuration
2499  
2500 =item C<PERLCRITICRC=/path/to/rc> - path to perlcritic configuration
2501  
2502 =item C<SKIP_TESTS=1> - interpreted by L<CPAN::Maker>; skips running
2503 the test suite when building the distribution tarball
2504  
2505 =item C<PERLWC_SKIP="file1 file2"> - space-separated list of files
2506 to exclude from syntax and POD checks
2507  
2508 =item C<POD=extract|remove> - extract POD to a companion F<.pod> file
2509 or strip it entirely from the built F<.pm>
2510  
2511 =item C<PERLINCLUDE="-I path"> - additional include paths used during
2512 the C<perl -wc> syntax check. Defaults to C<-I lib -I local/lib/perl5>
2513 for hermetic checking; see L</The local dependency library>.
2514  
2515 =item C<CPAN_INSTALLER=cpm|carton> - selects the installer used to
2516 populate F<local/> for hermetic syntax checking. Auto-detected (C<cpm>
2517 preferred) if unset.
2518  
2519 =back
2520  
2521 Two further toggles, C<CMB_UPDATE_CHECK> and C<CMB_VERSION_DRIFT>, are set
2522 in F<config.mk> rather than on the command line; see L</Automatic Drift and
2523 Update Checks>. F<config.mk> is read on every invocation of C<make> and is
2524 the right place for durable, machine- or project-wide build settings such as
2525 C<SYNTAX_CHECKING=OFF> on a box without an installer.
2526  
2527 =head2 What Belongs in F<project.mk>
2528  
2529 =over 4
2530  
2531 =item Custom targets
2532  
2533 Any target specific to your project - generating assets, running
2534 linters, deploying, sending notifications:
2535  
2536 .PHONY: deploy
2537 deploy: all ## deploy the distribution
2538 scp $(TARBALL) user@myserver:/opt/cpan
2539  
2540 Add C<##> followed by a description to a target definition to include
2541 the target in the output from C<make help>. Because F<project.mk> is
2542 included in C<MAKEFILE_LIST>, project-specific targets are discovered
2543 automatically:
2544  
2545 make help
2546  
2547 There is no separate help table to maintain.
2548  
2549 =item Inter-module dependencies
2550  
2551 If your modules have build-time dependencies on each other, declare
2552 them here rather than modifying the Makefile:
2553  
2554 lib/Foo/Bar.pm: lib/Foo.pm
2555  
2556 =item Additional file generation
2557  
2558 If your project generates code or configuration from templates beyond
2559 what the standard Makefile handles:
2560  
2561 lib/Foo/Generated.pm.in: schema/foo.json
2562 perl bin/generate-module.pl $< > $@
2563  
2564 =item Project-specific variables
2565  
2566 DEPLOY_HOST = myserver.example.com
2567 DEPLOY_PATH = /opt/cpan/incoming
2568  
2569 =item Extending CLEANFILES
2570  
2571 Add project-specific generated files to the cleanup target by
2572 appending to C<CLEANFILES>:
2573  
2574 CLEANFILES += mygenerated.pm config/generated.yml
2575  
2576 =item Extending the clean target
2577  
2578 clean-local::
2579 rm -rf workdir
2580  
2581 =item Extending the test recipe
2582  
2583 Projects may have development or integration tests that should not be
2584 included in the CPAN distribution. Add them to C<make test> by
2585 extending C<test-local> with a double-colon rule:
2586  
2587 test-local::
2588 prove -I lib -v xt/
2589  
2590 =back
2591  
2592 =head2 What Does NOT Belong in F<project.mk>
2593  
2594 =over 4
2595  
2596 =item * Modifications to existing targets like C<all>, C<clean>, C<requires>
2597  
2598 =item * Replacing managed variables such as C<DEPS> or C<CLEANFILES>.
2599  
2600 Use documented extension points such as C<CLEANFILES +=> where
2601 provided rather than redefining the managed value.
2602  
2603 =item * Anything that duplicates logic already in the managed Makefile
2604  
2605 =back
2606  
2607 =head2 Custom Template Tokens
2608  
2609 The build generates each F<.pm>/F<.pl> from its F<.pm.in>/F<.pl.in> source
2610 by substituting C<E<64>TOKENE<64>> placeholders through C<cmb resolve-vars>.
2611 The standard tokens (C<E<64>PACKAGE_VERSIONE<64>>, C<E<64>MODULE_NAMEE<64>>,
2612 C<E<64>GIT_SHAE<64>>, and the other git-metadata variables) are always
2613 available, but the mechanism is extensible: a project can define its own
2614 tokens without editing any managed file.
2615  
2616 To add a token, declare its name in C<TEMPLATE_VARS> (in
2617 F<project.mk>) and provide a value -- as a make variable, an exported
2618 environment variable, or through the variables file passed to
2619 C<resolve-vars>. For example, to stamp a build timestamp:
2620  
2621 # in project.mk
2622 BUILD_DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
2623 TEMPLATE_VARS += BUILD_DATE
2624  
2625 # in a .pm.in source
2626 our $BUILD_DATE = 'E<64>BUILD_DATEE<64>';
2627  
2628 C<cmb resolve-vars> then fills C<E<64>BUILD_DATEE<64>> from the value
2629 when its prerequisites require regeneration. The token grammar is
2630 uppercase-only (C<E<64>[A-Z0-9_]+E<64>>), so placeholders never
2631 collide with real Perl such as C<@_> or C<@ISA>.
2632  
2633 By default, substitution is B<fail-loud> for placeholders that appear
2634 in live code: if a token has no value, the build stops and names the
2635 offending token rather than silently substituting an empty string.
2636  
2637 Placeholders that occur only in POD or comments do not require values.
2638 C<--no-strict> may be used to downgrade a missing live-code value to a
2639 warning and leave the placeholder unchanged.
2640  
2641 =head2 Keeping the build system up to date
2642  
2643 The following targets manage the lifecycle of the build system itself:
2644  
2645 =over 4
2646  
2647 =item C<make check-upgrade> / C<make upgrade-check>
2648  
2649 Checks MetaCPAN to see if a newer version of
2650 C<CPAN::Maker::Bootstrapper> is available.
2651  
2652 =item C<make publish>
2653  
2654 Builds the distribution tarball, unpacks it into a temporary directory,
2655 runs its normal C<Makefile.PL>, build, and test sequence, and uploads
2656 the tarball to PAUSE if all checks succeed.
2657  
2658 Set the PAUSE credentials with:
2659  
2660 make publish PAUSE_USER=username PAUSE_PASSWORD=password
2661  
2662 =item C<make upgrade>
2663  
2664 Checks MetaCPAN, installs the latest version via C<cpanm>, then
2665 automatically runs C<make update> to refresh the managed project
2666 files.
2667  
2668 =item C<make update>
2669  
2670 Copies the managed files from the currently installed bootstrapper
2671 distribution into your project directory. After running, use
2672 C<git diff> to review what changed.
2673  
2674 The following files are managed and may be updated:
2675  
2676 Makefile
2677 .includes/bootstrap.mk
2678 .includes/perl.mk
2679 .includes/local.mk
2680 .includes/git.mk
2681 .includes/help.mk
2682 .includes/update.mk
2683 .includes/upgrade.mk
2684 .includes/version.mk
2685 .includes/release-notes.mk
2686 .includes/bash-completion.mk
2687 .includes/modulino.mk
2688 .includes/publish.mk
2689  
2690 Your F<project.mk>, F<buildspec.yml>, F<requires>, F<VERSION>, source
2691 files and tests are B<never> touched by C<make update>.
2692  
2693 =item C<make cpanm>
2694  
2695 Installs C<cpanminus> if it is not already available on your
2696 C<PATH>. Required for C<make upgrade> to work:
2697  
2698 make cpanm && make upgrade
2699  
2700 =back
2701  
2702 =head2 Automatic Drift and Update Checks
2703  
2704 Every build runs two checks before proceeding, so you don't have to
2705 remember to run C<make check-upgrade> yourself:
2706  
2707 =over 4
2708  
2709 =item *
2710  
2711 Is a newer C<CPAN::Maker::Bootstrapper> published on CPAN than the
2712 one installed on this machine?
2713  
2714 =item *
2715  
2716 Do this project's managed files still match what the I<currently
2717 installed> C<CPAN::Maker::Bootstrapper> would produce?
2718  
2719 =back
2720  
2721 These are independent questions - your installed bootstrapper can be
2722 fully current while a given project has still drifted from it (most
2723 commonly because the project hasn't been through C<make update>
2724 since you last upgraded), or your bootstrapper itself can be behind
2725 CPAN while every project stays perfectly in sync with it.
2726  
2727 I<Drift> can happen for either of two reasons: your installed
2728 C<CPAN::Maker::Bootstrapper> was upgraded since this project last ran
2729 C<make update>, or a managed file was hand-edited despite the
2730 warnings not to (see L</What You Should Never Modify>). C<make>
2731 doesn't try to tell these apart - the fix is the same either way:
2732  
2733 make update
2734  
2735 Two variables, set in F<config.mk>, control how strict these checks
2736 are:
2737  
2738 =over 4
2739  
2740 =item C<CMB_UPDATE_CHECK> (C<ON>|C<OFF>, default C<ON>)
2741  
2742 Set to C<OFF> to skip the MetaCPAN lookup - useful in CI or offline
2743 environments where the network call would just fail or slow things
2744 down.
2745  
2746 =item C<CMB_VERSION_DRIFT> (C<FAIL>|C<WARN>|C<IGNORE>, default C<FAIL>)
2747  
2748 Controls what happens when a project's managed files no longer match
2749 the installed bootstrapper. C<FAIL> stops the build until you run
2750 C<make update>; C<WARN> prints a message and continues; C<IGNORE>
2751 skips the check entirely.
2752  
2753 =back
2754  
2755 =head2 What You Should Never Modify
2756  
2757 The files in F<.includes/> - F<perl.mk>, F<git.mk>, F<help.mk> etc. -
2758 are managed files that will be overwritten by C<make update>. Do not
2759 modify managed files directly. Use F<config.mk> for documented build
2760 variables and F<project.mk> for project-specific targets, rules, and
2761 build ordering.
2762  
2763 The F<Makefile> itself is also managed and will be overwritten by
2764 C<make update>. Use the documented project-level configuration and
2765 extension files instead.
2766  
2767 =head2 Dependencies Management
2768  
2769 The build system scans F<.pm.in> and F<.pl.in> source files and
2770 maintains the dependency files used by L<CPAN::Maker> when generating
2771 distribution metadata:
2772  
2773 F<requires>
2774 F<test-requires>
2775 F<recommends>
2776 F<suggests>
2777  
2778 Distribution dependency scanning is controlled by C<SCAN>. Set
2779 C<SCAN=OFF> to skip updates to F<requires>, F<test-requires>,
2780 F<recommends>, and F<suggests> for a build; the default is C<ON>.
2781  
2782 To prevent an entry from being removed by a rescan, prefix the module
2783 name with C<+>. These entries are sticky and survive all subsequent
2784 scans even if the scanner no longer detects them. To pin a specific
2785 version, simply edit the version number in the F<requires> file. If
2786 the scanner subsequently detects a different version, the Makefile
2787 will preserve your pinned version. Note that pinned versions are
2788 B<never> updated automatically - if you want to adopt a newer version
2789 you must edit the file manually.
2790  
2791 In your requires file:
2792  
2793 +Foo::Bar 1.0 # sticky - survives all rescans
2794 Baz::Qux 2.5 # version pinned - scanner won't override this version
2795  
2796 I<Note: These two mechanisms are independent - C<+> controls whether an entry
2797 survives rescans, while the version number controls what version is
2798 required.>
2799  
2800 =head3 The local dependency library
2801  
2802 Syntax checking is performed in a I<hermetic> environment: each
2803 generated F<.pm> is compiled with C<perl -wc> against C<lib> and a
2804 project-local library at F<local/lib/perl5> only, with C<PERL5LIB>
2805 explicitly cleared for the check. This ensures a module's dependencies
2806 are actually declared and installed, rather than being satisfied by
2807 chance from whatever happens to be in your C<PERL5LIB> or system
2808 C<@INC>. A dependency that compiles on your machine but is missing
2809 from the declared dependency set will fail the build here instead of
2810 surprising you on a clean install or CI box.
2811  
2812 To populate that library, the build installs your declared dependencies into
2813 F<local/> using C<cpm> (preferred) or C<carton>:
2814  
2815 make local # installs requires/recommends/suggests/test-requires into local/lib/perl5
2816  
2817 This runs automatically as a prerequisite of the module build, so a
2818 normal C<make> installs dependencies first, then syntax-checks against
2819 them.
2820  
2821 C<cpm> is preferred because it supports multiple resolvers directly
2822 from F<build-mirrors>. C<carton> is also supported; see
2823 L</build-mirrors> for its mirror behavior.
2824  
2825 The use of a F<build-mirrors> file versus specifying the mirrors in
2826 the dependency files determines the scope of their
2827 use. F<build-mirrors> (and F<cpanfile> mirror declarations) set the
2828 resolvers used for B<every> dependency in the build. To route a
2829 B<single> module to a specific mirror, URL, or distribution -- without
2830 affecting how anything else resolves -- annotate that module's entry
2831 in F<requires> with C<mirror=>, C<url=>, or C<dist=> (see
2832 L</build-mirrors>).
2833  
2834 The C<+> prefix has a second use beyond protecting mirror annotations.
2835 Because the check is hermetic, B<a module reached only at runtime will not
2836 be found unless it is declared>. Static scanning (C<scandeps-static.pl>)
2837 cannot see a dependency loaded dynamically -- for example a module pulled
2838 in through a method call rather than a C<use> statement -- so it will never
2839 add it to F<requires>. Declare such modules explicitly with C<+>, which
2840 makes the entry sticky and survives every rescan:
2841  
2842 +Log::Log4perl # loaded at runtime via a framework call; scanner can't see it
2843  
2844 =head3 F<build-mirrors>
2845  
2846 When using the preferred CPAN installer (C<cpm>), the build system
2847 reads mirror URLs, one per line, from a F<build-mirrors> file in the
2848 project root and passes each as a resolver. This allows the build to
2849 resolve dependencies against one or more configured CPAN-compatible
2850 repositories, including private DarkPAN repositories.
2851  
2852 When C<carton> is used, because it does not support multiple mirrors
2853 when setting the mirror using an environment variable, the build
2854 system will use the first mirror in your F<build-mirrors> file if
2855 present. C<carton> supports multiple mirrors only by specifying them
2856 in the F<cpanfile>.
2857  
2858 Entries in F<requires>, F<suggests>, and F<recommends> may carry optional
2859 qualifiers after the version to control where a module resolves from:
2860  
2861 +Foo::Bar 1.0 mirror=https://cpan.openbedrock.net/orepan2
2862 +Baz::Qux 2.5 url=https://example.com/authors/id/D/DU/DUMMY/Baz-Qux-2.5.tar.gz
2863 +Xyz::Abc 0.9 dist=Xyz-Distribution
2864  
2865 Only C<dist=>, C<url=>, and C<mirror=> are permitted after the version;
2866 anything else is an error. Prefix such entries with the sticky C<+> so the
2867 scanner does not strip the annotation on a later rescan. See L<CPAN::Maker>
2868 for the full format.
2869  
2870 =head1 MODULINOS
2871  
2872 A modulino is a Perl module that doubles as a runnable script by
2873 checking whether it was invoked directly or loaded as a library:
2874  
2875 package Foo::Bar;
2876  
2877 caller or __PACKAGE__->main;
2878  
2879 sub main {
2880 ...
2881 exit 0;
2882 }
2883  
2884 Modulinos are useful for CLI scripts because they encourage
2885 encapsulation, simplify unit testing, and keep logic organized
2886 in named methods rather than inline code.
2887  
2888 The C<Makefile> provides a C<modulino> target that generates a wrapper
2889 script for invoking your module. By default it uses C<MODULE_NAME>,
2890 producing a script named after the module:
2891  
2892 make modulino
2893  
2894 For a project named C<Foo::Bar> this creates C<bin/foo-bar.in>.
2895 C<make> then builds C<bin/foo-bar> from that source file via a
2896 pattern rule, and the executable ends up in the distribution.
2897  
2898 To create a modulino wrapper for a module other than the primary
2899 project module, override C<MODULE_NAME>:
2900  
2901 make modulino MODULE_NAME=Foo::Bar::Buz
2902  
2903 This creates C<bin/foo-bar-buz.in> invoking C<Foo::Bar::Buz>.
2904  
2905 To give the wrapper a short or memorable name independent of the
2906 module name, set C<ALIAS>:
2907  
2908 make modulino MODULE_NAME=Foo::Bar::Buz ALIAS=fbb
2909  
2910 This creates C<bin/fbb.in> which still invokes C<Foo::Bar::Buz>.
2911 C<ALIAS> accepts either a plain name (C<fbb>) or a module-style
2912 name (C<Foo::Bar::Buz>) - colons are converted to hyphens and
2913 the result is lowercased.
2914  
2915 The generated wrapper scripts (without the C<.in> suffix) are
2916 automatically added to F<.gitignore> since they are build artifacts.
2917 The C<.in> source files are tracked by git.
2918  
2919 =head2 Continuous Integration
2920  
2921 CPAN::Maker::Bootstrapper provides a clean-room build path that can be
2922 used locally or from a CI system.
2923  
2924 The CI design separates source acquisition from project build
2925 responsibilities:
2926  
2927 source acquisition caller or CI system
2928 build environment builder
2929 project build make
2930  
2931 A CI system such as GitHub Actions is responsible for checking out the
2932 project. F<builder> then operates on that existing project directory,
2933 installs the required build environment and dependencies, and runs the
2934 project build.
2935  
2936 C<make build-ci> provides the corresponding local clean-room build. It
2937 uses the current working tree as its source, copies that tree into a
2938 disposable container build directory, and invokes F<builder> there.
2939  
2940 This separation keeps F<builder> independent of repository hosting,
2941 branch selection, and source-control workflow while allowing the same
2942 build mechanism to be used both locally and in CI.
2943  
2944 The build lifecycle is:
2945  
2946 builder.env
2947 |
2948 v
2949 builder-pre
2950 |
2951 v
2952 make
2953 |
2954 v
2955 builder-post
2956  
2957 F<builder> can run unmodified in GitHub Actions, in another CI runner,
2958 or by hand from the command line.
2959  
2960 =head3 Running builder manually
2961  
2962 F<builder> operates on an existing project directory. Source acquisition
2963 is deliberately outside its responsibility; the caller must clone,
2964 check out, or otherwise provide the project before invoking F<builder>.
2965  
2966 Run it from the root of a project:
2967  
2968 ./builder
2969  
2970 or pass the project directory explicitly:
2971  
2972 /builder /path/to/project
2973  
2974 The project directory defaults to the current working directory.
2975  
2976 F<builder> changes to that directory, installs the build environment and
2977 declared dependencies, loads the project CI environment, and runs the
2978 configured build lifecycle.
2979  
2980 For the standard containerized clean-room build, use:
2981  
2982 make build-ci
2983  
2984 C<make build-ci> copies the current working tree into a disposable build
2985 environment and invokes F<builder> there. Because it operates on the
2986 current working tree rather than cloning the repository, the build may
2987 include uncommitted and untracked files present on disk.
2988  
2989 =head3 Environment variables
2990  
2991 F<builder> accepts environment variables that control dependency
2992 installation and build behavior.
2993  
2994 =over 4
2995  
2996 =item C<INSTALLER>
2997  
2998 The command used to install Perl dependencies.
2999  
3000 The default is:
3001  
3002 cpm install -g --show-build-log-on-failure --verbose
3003  
3004 =item C<NO_ECHO>
3005  
3006 Passed through to the generated Makefile when set.
3007  
3008 =item C<CMB_VERSION_DRIFT>
3009  
3010 Controls how F<builder> handles differences between the installed
3011 CPAN::Maker::Bootstrapper version and the version expected by the
3012 project.
3013  
3014 The generated F<builder.env> defaults this to:
3015  
3016 CMB_VERSION_DRIFT=ignore
3017  
3018 =back
3019  
3020 =head3 F<builder.env>
3021  
3022 Before running the project build, F<builder> loads F<builder.env> from
3023 the project root when that file exists.
3024  
3025 Variables defined there are exported to the build environment.
3026  
3027 A generated project includes:
3028  
3029 CMB_VERSION_DRIFT=ignore
3030 NO_ECHO=
3031  
3032 F<builder.env> provides a project-local place to customize CI build
3033 behavior without modifying F<builder> itself.
3034  
3035 =head3 Builder lifecycle hooks
3036  
3037 F<builder> exposes two Makefile hooks around the main project build:
3038  
3039 builder-pre
3040 builder-post
3041  
3042 The build lifecycle is:
3043  
3044 builder.env
3045 |
3046 builder-pre
3047 |
3048 make
3049 |
3050 builder-post
3051  
3052 C<builder-pre> runs after F<builder.env> has been loaded and before the
3053 main C<make> invocation.
3054  
3055 C<builder-post> runs only after the main build completes successfully.
3056  
3057 Generated projects define both targets as empty double-colon targets:
3058  
3059 builder-pre::
3060  
3061 builder-post::
3062  
3063 Projects may extend them in F<project.mk> without modifying the managed
3064 Makefile.
3065  
3066 For example:
3067  
3068 builder-pre::
3069 ./prepare-ci-environment
3070  
3071 builder-post::
3072 ./collect-build-artifacts
3073  
3074 These hooks are intended for project-specific CI setup and post-build
3075 work that should remain outside the managed build files.
3076  
3077 =head3 C<make build-ci>
3078  
3079 C<make build-ci> runs the current project in a disposable containerized
3080 build environment.
3081  
3082 Unlike a CI workflow that clones the repository, C<build-ci> uses the
3083 current working tree as its source. The project is mounted read-only,
3084 copied into the container build area, and then passed to F<builder>.
3085  
3086 This means the build reflects the files currently present on disk,
3087 including uncommitted changes and untracked files.
3088  
3089 The source tree itself is not modified by the container build.
3090  
3091 C<make build-ci> accepts the following variables:
3092  
3093 DOCKER_BUILD_IMAGE - container image used for the build
3094 DOCKER_CPAN_INSTALLER
3095 - dependency installer command used in the container
3096 BUILD_LOG - path used for captured build output
3097 MODULE_NAME - primary module name passed into the clean-room build
3098  
3099 For example:
3100  
3101 make build-ci
3102  
3103 or:
3104  
3105 make build-ci DOCKER_BUILD_IMAGE=debian:trixie
3106  
3107 The command exits with the status of the container build even though
3108 the output is also written to C<BUILD_LOG>.
3109  
3110 =head3 Builder input files
3111  
3112 F<builder> recognizes project files that supply additional build
3113 requirements without modifying F<builder> itself.
3114  
3115 =over 4
3116  
3117 =item F<build-apt-deps>
3118  
3119 A whitespace-separated list of additional Debian packages required by
3120 the project build.
3121  
3122 F<builder> installs these packages in addition to its standard build
3123 environment before installing Perl dependencies.
3124  
3125 For example:
3126  
3127 libxml2-dev
3128 libpq-dev
3129  
3130 =item F<build-mirrors>
3131  
3132 A list of CPAN mirror URLs, one per line.
3133  
3134 Use this file when the build requires a DarkPAN or another additional
3135 CPAN-compatible repository.
3136  
3137 For example:
3138  
3139 https://cpan.openbedrock.net
3140 https://cpan.metacpan.org
3141  
3142 The configured mirrors are used when resolving project dependencies.
3143  
3144 =back
3145  
3146 These files describe build inputs. For environment variables use
3147 F<builder.env>; for project-specific Makefile behavior use
3148 F<project.mk>.
3149  
3150 =head3 See Also
3151  
3152 L</make workflow>, L</make build-ci>
3153  
3154 =head1 PREREQUISITES
3155  
3156 The following tool(s) must be on your C<PATH>:
3157  
3158 =over 4
3159  
3160 =item * C<git> - used to read global identity config
3161  
3162 =item * C<make> - GNU make is required to build the project
3163  
3164 =item * C<curl> - used by C<make upgrade> to query MetaCPAN
3165  
3166 =item * C<cpm> or C<carton> - installs declared dependencies into a
3167 project-local library (F<local/lib/perl5>) for hermetic syntax checking
3168  
3169 =back
3170  
3171 You can set make variables like C<SYNTAX_CHECKING> in F<config.mk>, which
3172 is included on every invocation of C<make>, to alter build behavior -- for
3173 example C<SYNTAX_CHECKING=OFF> to skip the check when neither installer is
3174 present (undeclared dependencies then go undetected).
3175  
3176 I<Note: neither C<cpm> nor C<carton> is a hard prerequisite of
3177 C<CPAN::Maker::Bootstrapper> itself; they are needed only to populate the
3178 local library for hermetic checking. C<cpm> is preferred for its
3179 multi-mirror support (see L</build-mirrors>).>
3180  
3181 =head1 CAVEATS
3182  
3183 =over 4
3184  
3185 =item F<.pm> and F<.pl> Generation
3186  
3187 Generated F<.pm> and F<.pl> files are derived from their
3188 F<.pm.in>/F<.pl.in> sources through C<cmb resolve-vars> and are
3189 read-only. Always edit the F<.in> source.
3190  
3191 Use C<E<64>PACKAGE_VERSIONE<64>> like this:
3192  
3193 C<our $VERSION ='>C<E<64>PACKAGE_VERSIONE<64>>C<';>
3194  
3195 =item The import feature cannot be used with C<--stub>
3196  
3197 =item git
3198  
3199 C<git> is used throughout the framework. C<make git> initializes the
3200 repository and creates the initial commit, and the bootstrapper reads
3201 user identity and related defaults from F<.gitconfig> when no separate
3202 configuration file is supplied.
3203  
3204 =back
3205  
3206 =head1 FAQ
3207  
3208 =head2 My build is failing with a module not found error during syntax
3209 checking
3210  
3211 There are several common causes.
3212  
3213 One possible cause is an inter-module build-order dependency. The build
3214 system normally detects dependencies between modules in the distribution
3215 and writes them to F<deps.mk>, allowing C<make> to build prerequisite
3216 modules before syntax-checking modules that depend on them.
3217  
3218 For example, if C<lib/Foo/Bar.pm> uses C<lib/Foo.pm>, the generated
3219 dependency rules ensure that C<Foo.pm> is built first.
3220  
3221 If the dependency cannot be inferred automatically, declare it explicitly
3222 in F<project.mk>:
3223  
3224 lib/Foo/Bar.pm: lib/Foo.pm
3225  
3226 See L</Inter-module dependencies> for details.
3227  
3228 Another cause is a real dependency that is not installed in
3229 F<local/>. Because syntax checking runs against F<local/lib/perl5>
3230 with C<PERL5LIB> cleared, a dependency that is present elsewhere on
3231 your system but not declared will fail here.
3232  
3233 Confirm it is in F<requires> (add it with a sticky C<+> if the scanner
3234 can't see it -- see L</Dependencies Management>), then C<make local>
3235 to install it. This is the check working as intended: it catches a
3236 missing declaration on your machine instead of on someone else's.
3237  
3238 If the module genuinely cannot be loaded outside its runtime
3239 environment (an Apache handler, a mod_perl module, etc.), add it to
3240 C<PERLWC_SKIP> in F<project.mk>:
3241  
3242 PERLWC_SKIP = lib/My/Apache/Handler.pm
3243  
3244 Files listed in C<PERLWC_SKIP> are excluded from the C<perl -wc>
3245 syntax-checking and POD-checking stages. They are still built and
3246 included in the distribution; only those validation steps are skipped.
3247  
3248 =head2 How do I do a fast build during development?
3249  
3250 make quick
3251  
3252 This disables distribution dependency scanning and all linting
3253 (perltidy, perlcritic) for the current build. F<requires>,
3254 F<test-requires>, F<recommends>, and F<suggests> are not updated.
3255 Syntax checking remains enabled.
3256  
3257 Use C<make> without flags when you are
3258 ready to do a full build before committing or releasing.
3259  
3260 You can also disable individual features:
3261  
3262 make SCAN=OFF # skip distribution dependency scanning only
3263 make LINT=OFF # skip all linting only
3264 make SYNTAX_CHECKING=OFF # skip syntax checking only
3265  
3266 =head2 How do I add a new module or script to the project?
3267  
3268 Create the source file with the C<.pm.in> or C<.pl.in> extension in
3269 the appropriate directory:
3270  
3271 lib/My/New/Module.pm.in
3272 bin/my-script.pl.in
3273  
3274 The build system discovers them automatically via C<find-files> - no
3275 changes to the Makefile are required. The next C<make> will include
3276 them in the dependency scan and the distribution.
3277  
3278 =head2 How do I include additional files in the distribution?
3279  
3280 Edit F<buildspec.yml> and add entries to the C<extra-files> section:
3281  
3282 extra-files:
3283 - ChangeLog
3284 - README.md
3285 - share:
3286 - my-config-template.yml
3287 - my-data-file.json
3288  
3289 Files listed under C<share:> are installed into the distribution's
3290 share directory and can be accessed at runtime via
3291 L<File::ShareDir>.
3292  
3293 The build verifies that files listed in C<extra-files> are tracked by
3294 git. This helps catch files that have been added to the distribution
3295 but accidentally omitted from the project repository.
3296  
3297 Some extra files are generated build artifacts and therefore B<should
3298 not be committed> to the repository. Add those files to
3299 F<extra-files.skip>, one file per line:
3300  
3301 generated/service-data.dat
3302 share/generated-index.json
3303  
3304 Blank lines and lines beginning with C<#> are ignored.
3305  
3306 F<extra-files.skip> only disables the git tracking check for those
3307 files. The files remain part of the distribution and continue to be
3308 included as dependencies when determining whether the distribution
3309 tarball must be rebuilt.
3310  
3311 When C<DARKPAN_REQUIRES> is enabled, F<cpanfile.darkpan> and
3312 F<cpanm.darkpan> are automatically added to F<buildspec.yml> as extra
3313 files. They are therefore subject to the normal git tracking check. If
3314 the developer wants to include these generated manifests in the
3315 distribution without tracking them in the repository, they may be
3316 added explicitly to F<extra-files.skip>. See L</DARKPAN_REQUIRES>.
3317  
3318 =head2 I want to pin a version or add a module the scanner missed
3319  
3320 Edit F<requires> directly. Prefix the module name with C<+> to make
3321 the entry sticky - it will survive all subsequent rescans even if the
3322 scanner no longer detects it:
3323  
3324 +My::Required::Module 1.5
3325  
3326 To pin a version without making the entry sticky, just set the version
3327 number. The scanner will preserve your version if it detects a
3328 different one on subsequent builds:
3329  
3330 Some::Module 2.0
3331  
3332 These two mechanisms are independent - C<+> controls survivability,
3333 the version number controls what version is required. See L</Dependencies Management>
3334 for full details.
3335  
3336 =head2 I want to exclude a module the scanner found
3337  
3338 Create a F<requires.skip> file in the project root with one module
3339 name per line:
3340  
3341 My::Own::Module
3342 Some::Transitive::Dep
3343  
3344 The scanner will never add these to F<requires>. Use
3345 F<test-requires.skip> for the same effect on test dependencies.
3346  
3347 Note that on a clean first build neither skip file has any effect
3348 since there is no prior F<requires> file to compare against. The skip
3349 list takes effect from the second build onward.
3350  
3351 =head2 I edited a .pm file and my changes disappeared
3352  
3353 The C<.pm> files in F<lib/> are generated from the C<.pm.in> sources
3354 and are write-protected. Always edit the C<.pm.in> file - the C<.pm>
3355 is regenerated when its prerequisites require regeneration and your
3356 changes will be lost.
3357  
3358 If you are unsure which file to edit:
3359  
3360 ls -l lib/My/Module.pm lib/My/Module.pm.in
3361  
3362 The C<.pm.in> file is the one you own.
3363  
3364 =head2 Why does my build say it has drifted from the installed bootstrapper?
3365  
3366 This means your project's managed files (F<Makefile>,
3367 F<.includes/*.mk>) no longer match what your I<currently installed>
3368 C<CPAN::Maker::Bootstrapper> would generate. There are two ways this
3369 happens - upgrading your bootstrapper (e.g. via C<cpanm
3370 --upgrade-all>) instantly "drifts" every project you haven't yet
3371 updated, or a managed file was edited by hand. Both are fixed the
3372 same way:
3373  
3374 make update
3375  
3376 If you don't want a drifted project to fail the build outright, set
3377 C<CMB_VERSION_DRIFT=WARN> (or C<=IGNORE>) in that project's
3378 F<config.mk>. See L</Automatic Drift and Update Checks>.
3379  
3380 =head2 make update overwrote something I changed in a managed file
3381  
3382 The managed files in F<.includes/> should never be edited directly.
3383 Use F<config.mk>, F<project.mk>, or the other documented project-level
3384 extension points instead.
3385  
3386 This is why C<make git> and committing your F<.includes/> directory is
3387 strongly recommended - git is your safety net for the entire build
3388 system.
3389  
3390 =head2 C<make> says nothing to do but my source changed
3391  
3392 The most common cause is that the generated C<.pm> file is newer than
3393 the C<.pm.in> source. This can happen if you accidentally edited the
3394 C<.pm> directly or if file timestamps got out of sync. Force a rebuild:
3395  
3396 touch lib/My/Module.pm.in
3397  
3398 Or do a clean rebuild:
3399  
3400 make clean && make
3401  
3402 =head2 How do I disable dependency scanning temporarily?
3403  
3404 make SCAN=OFF
3405  
3406 This skips distribution dependency scanning for that run, so
3407 F<requires>, F<test-requires>, F<recommends>, and F<suggests> are not
3408 updated.
3409  
3410 Inter-module dependency discovery for F<deps.mk> is independent of
3411 C<SCAN> and may still run when syntax checking is enabled. The default
3412 is C<SCAN=ON>.
3413  
3414 =head2 How do I disable syntax checking temporarily?
3415  
3416 make SYNTAX_CHECKING=OFF
3417  
3418 Similarly you can disable individual quality gates:
3419  
3420 make PERLTIDY="" PERLCRITIC=""
3421  
3422 =head2 How do I upgrade the build system?
3423  
3424 make upgrade
3425  
3426 This checks MetaCPAN for a newer version of
3427 C<CPAN::Maker::Bootstrapper>, installs it via C<cpanm>, and
3428 automatically refreshes the managed files in F<.includes/> with
3429 C<make update>. Review the changes with C<git diff>.
3430  
3431 If C<cpanm> is not installed:
3432  
3433 make cpanm && make upgrade
3434  
3435 =head2 I want to add a bash script to my distribution
3436  
3437 Create the script in F<bin/> with a C<.sh.in> extension:
3438  
3439 bin/my-script.sh.in
3440  
3441 The build system will process it through the standard token
3442 substitution (replacing C<E<64>PACKAGE_VERSIONE<64>> and
3443 C<E<64>MODULE_NAMEE<64>>), make it executable, and include it in the
3444 distribution automatically.
3445  
3446 If your script is more than a few lines of bash, consider writing it
3447 as a I<modulino> instead - a Perl module that doubles as a runnable
3448 script. Modulinos are easier to test, encourage encapsulation, and
3449 give you the full power of Perl and CPAN. The build system has
3450 first-class support for them:
3451  
3452 make modulino
3453  
3454 This generates a bash wrapper in F<bin/> that invokes your module as
3455 a script if it uses the modulino pattern:
3456  
3457 caller or __PACKAGE__->main;
3458  
3459 See L</MODULINOS> for full details.
3460  
3461 =head2 What is C<make release-notes> used for?
3462  
3463 C<make release-notes> generates three artifacts comparing the current
3464 working state of your repository against the previous git tag:
3465  
3466 =over 4
3467  
3468 =item * F<release-E<lt>versionE<gt>.diffs> - a unified diff of all
3469 changed files
3470  
3471 =item * F<release-E<lt>versionE<gt>.lst> - a list of added, modified,
3472 and removed files
3473  
3474 =item * F<release-E<lt>versionE<gt>.tar.gz> - a tarball containing
3475 only the changed files
3476  
3477 =back
3478  
3479 These are primarily useful for generating release notes and changelogs,
3480 and for submitting targeted patches. Run it after bumping the version
3481 with C<make release>, C<make minor>, or C<make major> and before
3482 publishing to CPAN:
3483  
3484 make minor
3485 make release-notes
3486 # review release-1.1.0.diffs
3487 make
3488  
3489 The artifacts are all the clues needed for LLMs to produce accurate
3490 and well written release notes for your project.
3491  
3492 The release artifacts are cleaned up by C<make clean>.
3493  
3494 =head2 Can I distribute the POD in my modules separately?
3495  
3496 When you package your CPAN distribution you can strip the pod from
3497 your modules or you can extract the pod and provide them as separate
3498 C<.pod> files. The C<POD> make variable controls that behavior:
3499  
3500 =over 4
3501  
3502 =item C<make POD=extract>
3503  
3504 C<extract> will strip POD from your module and create a C<.pod> file
3505 containing the stripped POD that will be added to your distribution.
3506  
3507 =item C<make POD=remove>
3508  
3509 C<remove> will strip POD from your module. No POD will be included in
3510 the distribution.
3511  
3512 =back
3513  
3514 =head2 Something still doesn't work - how do I report an issue?
3515  
3516 First check the L</FAQ> sections above - your
3517 issue may already be covered.
3518  
3519 If you believe you have found a bug or want to request a feature,
3520 please open an issue on GitHub:
3521  
3522 https://github.com/rlauer6/CPAN-Maker-Bootstrapper/issues
3523  
3524 When reporting a bug please include:
3525  
3526 =over 4
3527  
3528 =item * The version of C<CPAN::Maker::Bootstrapper> (C<cmb --version>
3529 or C<perl -MCPAN::Maker::Bootstrapper -e 'print $CPAN::Maker::Bootstrapper::VERSION'>)
3530  
3531 =item * The output of C<make -n> or C<make --debug=v> if the issue is
3532 build-related
3533  
3534 =item * Your F<buildspec.yml> and F<project.mk> if relevant (redact
3535 any sensitive information)
3536  
3537 =item * The Perl and GNU make versions (C<perl --version>, C<make --version>)
3538  
3539 =item * B<MAKE SURE YOUR SUBMISSION DOES NOT CONTAIN SECRETS!>
3540  
3541 =back
3542  
3543 Pull requests are welcome. The project follows the standard GitHub
3544 fork-and-PR workflow.
3545  
3546 =head1 SEE ALSO
3547  
3548 L<CPAN::Maker> - the distribution builder driven by C<buildspec.yml>
3549 (includes C<make-cpan-dist.pl>)
3550  
3551 L<CLI::Simple> - the CLI framework used by the bootstrapper itself and
3552 optionally by generated CLI module stubs
3553  
3554 L<CPAN::Maker::ConfigReader> - the git config reader bundled with this
3555 distribution, available for use in your own
3556 tools.
3557  
3558 L<LLM::API> - client interface to Anthropic's Claude API
3559  
3560 L<Module::ScanDeps::Static> - the static scanner used for CPAN
3561 dependency discovery and for inter-module build-order discovery
3562 through F<deps.mk>.
3563  
3564 =head1 DEPENDENCIES
3565  
3566 The current runtime, build, test, recommended, and suggested
3567 dependencies are declared in the distribution metadata generated by
3568 L<CPAN::Maker>.
3569  
3570 See F<Makefile.PL>, F<META.json>, or F<META.yml> in the distribution
3571 for the authoritative dependency set.
3572  
3573 Some optional features require additional dependencies only when those
3574 features are used.
3575  
3576 =head1 VERSION
3577  
3578 This documentation refers to version 2.4.0
3579  
3580 =head1 AUTHOR
3581  
3582 Rob Lauer - E<lt>rlauer@treasurersbriefcase.comE<gt>
3583  
3584 =head1 LICENSE
3585  
3586 Copyright 2026, Robert C. Lauer All right reserved.
3587  
3588 This library is free software; you can redistribute it and/or modify it
3589 under the same terms as Perl itself.
3590  
3591 =cut
« CPAN/Maker/Bootstrapper/Role/Version.pm ↑ Summary CPAN/Maker/Bootstrapper/Constants.pm »