bmad-method 6.0.0-alpha.14 → 6.0.0-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/.coderabbit.yaml +36 -0
  2. package/{CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md} +4 -4
  3. package/CHANGELOG.md +136 -408
  4. package/README.md +4 -1
  5. package/docs/custom-content-installation.md +245 -0
  6. package/docs/index.md +2 -2
  7. package/docs/installers-bundlers/installers-modules-platforms-reference.md +6 -5
  8. package/docs/web-bundles-gemini-gpt-guide.md +1 -1
  9. package/example-custom-content/README.md +4 -0
  10. package/example-custom-content/agents/commit-poet/commit-poet.agent.yaml +1 -1
  11. package/example-custom-content/agents/toolsmith/toolsmith-sidecar/instructions.md +1 -1
  12. package/example-custom-content/agents/toolsmith/toolsmith-sidecar/knowledge/docs.md +1 -1
  13. package/example-custom-content/agents/toolsmith/toolsmith-sidecar/knowledge/installers.md +1 -1
  14. package/example-custom-content/agents/toolsmith/toolsmith-sidecar/knowledge/modules.md +2 -2
  15. package/example-custom-content/agents/toolsmith/toolsmith.agent.yaml +1 -1
  16. package/example-custom-content/{custom.yaml → module.yaml} +1 -0
  17. package/example-custom-content/workflows/quiz-master/steps/step-01-init.md +2 -2
  18. package/example-custom-content/workflows/quiz-master/steps/step-02-q1.md +1 -1
  19. package/example-custom-content/workflows/quiz-master/steps/step-03-q2.md +1 -1
  20. package/example-custom-content/workflows/quiz-master/steps/step-04-q3.md +1 -1
  21. package/example-custom-content/workflows/quiz-master/steps/step-05-q4.md +1 -1
  22. package/example-custom-content/workflows/quiz-master/steps/step-06-q5.md +1 -1
  23. package/example-custom-content/workflows/quiz-master/steps/step-07-q6.md +1 -1
  24. package/example-custom-content/workflows/quiz-master/steps/step-08-q7.md +1 -1
  25. package/example-custom-content/workflows/quiz-master/steps/step-09-q8.md +1 -1
  26. package/example-custom-content/workflows/quiz-master/steps/step-10-q9.md +1 -1
  27. package/example-custom-content/workflows/quiz-master/steps/step-11-q10.md +1 -1
  28. package/example-custom-content/workflows/quiz-master/steps/step-12-results.md +1 -1
  29. package/example-custom-content/workflows/quiz-master/workflow.md +1 -1
  30. package/example-custom-module/mwm/README.md +5 -0
  31. package/example-custom-module/mwm/agents/cbt-coach/cbt-coach.agent.yaml +1 -0
  32. package/example-custom-module/mwm/agents/crisis-navigator.agent.yaml +3 -2
  33. package/example-custom-module/mwm/agents/meditation-guide.agent.yaml +3 -2
  34. package/example-custom-module/mwm/agents/wellness-companion/wellness-companion.agent.yaml +1 -0
  35. package/example-custom-module/mwm/{_module-installer/install-config.yaml → module.yaml} +1 -0
  36. package/package.json +1 -1
  37. package/src/core/_module-installer/installer.js +1 -1
  38. package/src/modules/bmb/_module-installer/installer.js +1 -1
  39. package/src/modules/bmb/docs/agents/index.md +1 -1
  40. package/src/modules/bmb/workflows/create-module/steps/step-04-structure.md +3 -3
  41. package/src/modules/bmb/workflows/create-module/steps/step-05-config.md +1 -1
  42. package/src/modules/bmb/workflows/create-module/steps/step-08-installer.md +8 -8
  43. package/src/modules/bmb/workflows/create-module/steps/step-09-documentation.md +2 -1
  44. package/src/modules/bmb/workflows/create-module/steps/step-10-roadmap.md +3 -2
  45. package/src/modules/bmb/workflows/create-module/steps/step-11-validate.md +3 -3
  46. package/src/modules/bmb/workflows/create-module/templates/installer.template.js +1 -1
  47. package/src/modules/bmb/workflows/create-module/validation.md +3 -3
  48. package/src/modules/bmb/workflows/create-workflow/steps/step-01-init.md +1 -1
  49. package/src/modules/bmb/workflows/create-workflow/steps/step-07-build.md +1 -1
  50. package/src/modules/bmgd/README.md +2 -1
  51. package/src/modules/bmm/_module-installer/installer.js +1 -1
  52. package/src/modules/bmm/_module-installer/platform-specifics/claude-code.js +1 -1
  53. package/src/modules/bmm/_module-installer/platform-specifics/windsurf.js +1 -1
  54. package/src/modules/cis/_module-installer/installer.js +1 -1
  55. package/tools/cli/README.md +4 -4
  56. package/tools/cli/installers/lib/core/config-collector.js +16 -8
  57. package/tools/cli/installers/lib/core/custom-module-cache.js +239 -0
  58. package/tools/cli/installers/lib/core/detector.js +8 -4
  59. package/tools/cli/installers/lib/core/installer.js +815 -23
  60. package/tools/cli/installers/lib/core/manifest-generator.js +176 -13
  61. package/tools/cli/installers/lib/core/manifest.js +47 -0
  62. package/tools/cli/installers/lib/custom/handler.js +150 -20
  63. package/tools/cli/installers/lib/modules/manager.js +78 -32
  64. package/tools/cli/lib/agent/compiler.js +3 -11
  65. package/tools/cli/lib/agent/installer.js +2 -1
  66. package/tools/cli/lib/cli-utils.js +21 -4
  67. package/tools/cli/lib/ui.js +499 -11
  68. package/tools/maintainer/review-pr-README.md +55 -0
  69. package/tools/maintainer/review-pr.md +242 -0
  70. package/tools/migrate-custom-module-paths.js +124 -0
  71. package/bmad-method-6.0.0-alpha.14.tgz +0 -0
  72. package/docs/custom-agent-installation.md +0 -137
  73. package/example-custom-content/workflows/quiz-master/workflow-plan-quiz-master.md +0 -269
  74. /package/src/core/{_module-installer/install-config.yaml → module.yaml} +0 -0
  75. /package/src/modules/bmb/{_module-installer/install-config.yaml → module.yaml} +0 -0
  76. /package/src/modules/bmb/workflows/create-module/templates/{install-config.template.yaml → module.template.yaml} +0 -0
  77. /package/src/modules/bmgd/{_module-installer/install-config.yaml → module.yaml} +0 -0
  78. /package/src/modules/bmm/{_module-installer/install-config.yaml → module.yaml} +0 -0
  79. /package/src/modules/cis/{_module-installer/install-config.yaml → module.yaml} +0 -0
@@ -59,6 +59,17 @@ class UI {
59
59
  const bmadDir = await installer.findBmadDir(confirmedDirectory);
60
60
  const hasExistingInstall = await fs.pathExists(bmadDir);
61
61
 
62
+ // Always ask for custom content, but we'll handle it differently for new installs
63
+ let customContentConfig = { hasCustomContent: false };
64
+ if (hasExistingInstall) {
65
+ // Existing installation - prompt to add/update custom content
66
+ customContentConfig = await this.promptCustomContentForExisting();
67
+ } else {
68
+ // New installation - we'll prompt after creating the directory structure
69
+ // For now, set a flag to indicate we should ask later
70
+ customContentConfig._shouldAsk = true;
71
+ }
72
+
62
73
  // Track action type (only set if there's an existing installation)
63
74
  let actionType;
64
75
 
@@ -85,9 +96,11 @@ class UI {
85
96
 
86
97
  // Handle quick update separately
87
98
  if (actionType === 'quick-update') {
99
+ // Quick update doesn't install custom content - just updates existing modules
88
100
  return {
89
101
  actionType: 'quick-update',
90
102
  directory: confirmedDirectory,
103
+ customContent: { hasCustomContent: false },
91
104
  };
92
105
  }
93
106
 
@@ -117,6 +130,64 @@ class UI {
117
130
  const { installedModuleIds } = await this.getExistingInstallation(confirmedDirectory);
118
131
  const coreConfig = await this.collectCoreConfig(confirmedDirectory);
119
132
 
133
+ // For new installations, create the directory structure first so we can cache custom content
134
+ if (!hasExistingInstall && customContentConfig._shouldAsk) {
135
+ // Create the bmad directory based on core config
136
+ const path = require('node:path');
137
+ const fs = require('fs-extra');
138
+ const bmadFolderName = coreConfig.bmad_folder || 'bmad';
139
+ const bmadDir = path.join(confirmedDirectory, bmadFolderName);
140
+
141
+ await fs.ensureDir(bmadDir);
142
+ await fs.ensureDir(path.join(bmadDir, '_cfg'));
143
+ await fs.ensureDir(path.join(bmadDir, '_cfg', 'custom'));
144
+
145
+ // Now prompt for custom content
146
+ customContentConfig = await this.promptCustomContentLocation();
147
+
148
+ // If custom content found, cache it
149
+ if (customContentConfig.hasCustomContent) {
150
+ const { CustomModuleCache } = require('../installers/lib/core/custom-module-cache');
151
+ const cache = new CustomModuleCache(bmadDir);
152
+
153
+ const { CustomHandler } = require('../installers/lib/custom/handler');
154
+ const customHandler = new CustomHandler();
155
+ const customFiles = await customHandler.findCustomContent(customContentConfig.customPath);
156
+
157
+ for (const customFile of customFiles) {
158
+ const customInfo = await customHandler.getCustomInfo(customFile);
159
+ if (customInfo && customInfo.id) {
160
+ // Cache the module source
161
+ await cache.cacheModule(customInfo.id, customInfo.path, {
162
+ name: customInfo.name,
163
+ type: 'custom',
164
+ });
165
+
166
+ console.log(chalk.dim(` Cached ${customInfo.name} to _cfg/custom/${customInfo.id}`));
167
+ }
168
+ }
169
+
170
+ // Update config to use cached modules
171
+ customContentConfig.cachedModules = [];
172
+ for (const customFile of customFiles) {
173
+ const customInfo = await customHandler.getCustomInfo(customFile);
174
+ if (customInfo && customInfo.id) {
175
+ customContentConfig.cachedModules.push({
176
+ id: customInfo.id,
177
+ cachePath: path.join(bmadDir, '_cfg', 'custom', customInfo.id),
178
+ // Store relative path from cache for the manifest
179
+ relativePath: path.join('_cfg', 'custom', customInfo.id),
180
+ });
181
+ }
182
+ }
183
+
184
+ console.log(chalk.green(`✓ Cached ${customFiles.length} custom module(s)`));
185
+ }
186
+
187
+ // Clear the flag
188
+ delete customContentConfig._shouldAsk;
189
+ }
190
+
120
191
  // Skip module selection during update/reinstall - keep existing modules
121
192
  let selectedModules;
122
193
  if (actionType === 'update' || actionType === 'reinstall') {
@@ -125,8 +196,52 @@ class UI {
125
196
  console.log(chalk.cyan('\n📦 Keeping existing modules: ') + selectedModules.join(', '));
126
197
  } else {
127
198
  // Only show module selection for new installs
128
- const moduleChoices = await this.getModuleChoices(installedModuleIds);
199
+ const moduleChoices = await this.getModuleChoices(installedModuleIds, customContentConfig);
129
200
  selectedModules = await this.selectModules(moduleChoices);
201
+
202
+ // Check which custom content items were selected
203
+ const selectedCustomContent = selectedModules.filter((mod) => mod.startsWith('__CUSTOM_CONTENT__'));
204
+
205
+ // For cached modules (new installs), check if any cached modules were selected
206
+ let selectedCachedModules = [];
207
+ if (customContentConfig.cachedModules) {
208
+ selectedCachedModules = selectedModules.filter(
209
+ (mod) => !mod.startsWith('__CUSTOM_CONTENT__') && customContentConfig.cachedModules.some((cm) => cm.id === mod),
210
+ );
211
+ }
212
+
213
+ if (selectedCustomContent.length > 0 || selectedCachedModules.length > 0) {
214
+ customContentConfig.selected = true;
215
+
216
+ // Handle directory-based custom content (existing installs)
217
+ if (selectedCustomContent.length > 0) {
218
+ customContentConfig.selectedFiles = selectedCustomContent.map((mod) => mod.replace('__CUSTOM_CONTENT__', ''));
219
+ // Convert custom content to module IDs for installation
220
+ const customContentModuleIds = [];
221
+ const { CustomHandler } = require('../installers/lib/custom/handler');
222
+ const customHandler = new CustomHandler();
223
+ for (const customFile of customContentConfig.selectedFiles) {
224
+ // Get the module info to extract the ID
225
+ const customInfo = await customHandler.getCustomInfo(customFile);
226
+ if (customInfo) {
227
+ customContentModuleIds.push(customInfo.id);
228
+ }
229
+ }
230
+ // Filter out custom content markers and add module IDs
231
+ selectedModules = [...selectedModules.filter((mod) => !mod.startsWith('__CUSTOM_CONTENT__')), ...customContentModuleIds];
232
+ }
233
+
234
+ // For cached modules, they're already module IDs, just mark as selected
235
+ if (selectedCachedModules.length > 0) {
236
+ customContentConfig.selectedCachedModules = selectedCachedModules;
237
+ // No need to filter since they're already proper module IDs
238
+ }
239
+ } else if (customContentConfig.hasCustomContent) {
240
+ // User provided custom content but didn't select any
241
+ customContentConfig.selected = false;
242
+ customContentConfig.selectedFiles = [];
243
+ customContentConfig.selectedCachedModules = [];
244
+ }
130
245
  }
131
246
 
132
247
  // Prompt for AgentVibes TTS integration
@@ -147,7 +262,9 @@ class UI {
147
262
  ides: toolSelection.ides,
148
263
  skipIde: toolSelection.skipIde,
149
264
  coreConfig: coreConfig, // Pass collected core config to installer
150
- enableAgentVibes: agentVibesConfig.enabled, // AgentVibes TTS integration
265
+ // Custom content configuration
266
+ customContent: customContentConfig,
267
+ enableAgentVibes: agentVibesConfig.enabled,
151
268
  agentVibesInstalled: agentVibesConfig.alreadyInstalled,
152
269
  };
153
270
  }
@@ -483,19 +600,142 @@ class UI {
483
600
  /**
484
601
  * Get module choices for selection
485
602
  * @param {Set} installedModuleIds - Currently installed module IDs
603
+ * @param {Object} customContentConfig - Custom content configuration
486
604
  * @returns {Array} Module choices for inquirer
487
605
  */
488
- async getModuleChoices(installedModuleIds) {
606
+ async getModuleChoices(installedModuleIds, customContentConfig = null) {
607
+ const moduleChoices = [];
608
+ const isNewInstallation = installedModuleIds.size === 0;
609
+
610
+ const customContentItems = [];
611
+ const hasCustomContentItems = false;
612
+
613
+ // Add custom content items
614
+ if (customContentConfig && customContentConfig.hasCustomContent) {
615
+ if (customContentConfig.cachedModules) {
616
+ // New installation - show cached modules
617
+ for (const cachedModule of customContentConfig.cachedModules) {
618
+ // Get the module info from cache
619
+ const yaml = require('js-yaml');
620
+ const fs = require('fs-extra');
621
+
622
+ // Try multiple possible config file locations
623
+ const possibleConfigPaths = [
624
+ path.join(cachedModule.cachePath, 'module.yaml'),
625
+ path.join(cachedModule.cachePath, 'custom.yaml'),
626
+ path.join(cachedModule.cachePath, '_module-installer', 'module.yaml'),
627
+ path.join(cachedModule.cachePath, '_module-installer', 'custom.yaml'),
628
+ ];
629
+
630
+ let moduleData = null;
631
+ let foundPath = null;
632
+
633
+ for (const configPath of possibleConfigPaths) {
634
+ if (await fs.pathExists(configPath)) {
635
+ try {
636
+ const yamlContent = await fs.readFile(configPath, 'utf8');
637
+ moduleData = yaml.load(yamlContent);
638
+ foundPath = configPath;
639
+ break;
640
+ } catch {
641
+ // Continue to next path
642
+ }
643
+ }
644
+ }
645
+
646
+ if (moduleData) {
647
+ // Use the name from the custom info if we have it
648
+ const moduleName = cachedModule.name || moduleData.name || cachedModule.id;
649
+
650
+ customContentItems.push({
651
+ name: `${chalk.cyan('✓')} ${moduleName} ${chalk.gray('(cached)')}`,
652
+ value: cachedModule.id, // Use module ID directly
653
+ checked: true, // Default to selected
654
+ cached: true,
655
+ });
656
+ } else {
657
+ // Debug: show what paths we tried to check
658
+ console.log(chalk.dim(`DEBUG: No module config found for ${cachedModule.id}`));
659
+ console.log(
660
+ chalk.dim(
661
+ `DEBUG: Tried paths:`,
662
+ possibleConfigPaths.map((p) => p.replace(cachedModule.cachePath, '.')),
663
+ ),
664
+ );
665
+ console.log(chalk.dim(`DEBUG: cachedModule:`, JSON.stringify(cachedModule, null, 2)));
666
+ }
667
+ }
668
+ } else if (customContentConfig.customPath) {
669
+ // Existing installation - show from directory
670
+ const { CustomHandler } = require('../installers/lib/custom/handler');
671
+ const customHandler = new CustomHandler();
672
+ const customFiles = await customHandler.findCustomContent(customContentConfig.customPath);
673
+
674
+ for (const customFile of customFiles) {
675
+ const customInfo = await customHandler.getCustomInfo(customFile);
676
+ if (customInfo) {
677
+ customContentItems.push({
678
+ name: `${chalk.cyan('✓')} ${customInfo.name} ${chalk.gray(`(${customInfo.relativePath})`)}`,
679
+ value: `__CUSTOM_CONTENT__${customFile}`, // Unique value for each custom content
680
+ checked: true, // Default to selected since user chose to provide custom content
681
+ path: customInfo.path, // Track path to avoid duplicates
682
+ });
683
+ }
684
+ }
685
+ }
686
+ }
687
+
688
+ // Add official modules
489
689
  const { ModuleManager } = require('../installers/lib/modules/manager');
490
- const moduleManager = new ModuleManager();
491
- const availableModules = await moduleManager.listAvailable();
690
+ // For new installations, don't scan project yet (will do after custom content is discovered)
691
+ // For existing installations, scan if user selected custom content
692
+ const shouldScanProject =
693
+ !isNewInstallation && customContentConfig && customContentConfig.hasCustomContent && customContentConfig.selected;
694
+ const moduleManager = new ModuleManager({
695
+ scanProjectForModules: shouldScanProject,
696
+ });
697
+ const { modules: availableModules, customModules: customModulesFromProject } = await moduleManager.listAvailable();
492
698
 
493
- const isNewInstallation = installedModuleIds.size === 0;
494
- const moduleChoices = availableModules.map((mod) => ({
495
- name: mod.isCustom ? `${mod.name} ${chalk.red('(Custom)')}` : mod.name,
496
- value: mod.id,
497
- checked: isNewInstallation ? mod.defaultSelected || false : installedModuleIds.has(mod.id),
498
- }));
699
+ // First, add all items to appropriate sections
700
+ const allCustomModules = [];
701
+
702
+ // Add custom content items from directory
703
+ allCustomModules.push(...customContentItems);
704
+
705
+ // Add custom modules from project scan (if scanning is enabled)
706
+ for (const mod of customModulesFromProject) {
707
+ // Skip if this module is already in customContentItems (by path)
708
+ const isDuplicate = allCustomModules.some((item) => item.path && mod.path && path.resolve(item.path) === path.resolve(mod.path));
709
+
710
+ if (!isDuplicate) {
711
+ allCustomModules.push({
712
+ name: `${chalk.cyan('✓')} ${mod.name} ${chalk.gray(`(${mod.source})`)}`,
713
+ value: mod.id,
714
+ checked: isNewInstallation ? mod.defaultSelected || false : installedModuleIds.has(mod.id),
715
+ });
716
+ }
717
+ }
718
+
719
+ // Add separators and modules in correct order
720
+ if (allCustomModules.length > 0) {
721
+ // Add separator for custom content, all custom modules, and official content separator
722
+ moduleChoices.push(
723
+ new inquirer.Separator('── Custom Content ──'),
724
+ ...allCustomModules,
725
+ new inquirer.Separator('── Official Content ──'),
726
+ );
727
+ }
728
+
729
+ // Add official modules (only non-custom ones)
730
+ for (const mod of availableModules) {
731
+ if (!mod.isCustom) {
732
+ moduleChoices.push({
733
+ name: mod.name,
734
+ value: mod.id,
735
+ checked: isNewInstallation ? mod.defaultSelected || false : installedModuleIds.has(mod.id),
736
+ });
737
+ }
738
+ }
499
739
 
500
740
  return moduleChoices;
501
741
  }
@@ -574,6 +814,116 @@ class UI {
574
814
  }
575
815
  }
576
816
 
817
+ /**
818
+ * Prompt for custom content location
819
+ * @returns {Object} Custom content configuration
820
+ */
821
+ async promptCustomContentLocation() {
822
+ try {
823
+ CLIUtils.displaySection('Custom Content', 'Optional: Add custom agents, workflows, and modules');
824
+
825
+ const { hasCustomContent } = await inquirer.prompt([
826
+ {
827
+ type: 'list',
828
+ name: 'hasCustomContent',
829
+ message: 'Do you have custom content to install?',
830
+ choices: [
831
+ { name: 'No (skip custom content)', value: 'none' },
832
+ { name: 'Enter a directory path', value: 'directory' },
833
+ { name: 'Enter a URL', value: 'url' },
834
+ ],
835
+ default: 'none',
836
+ },
837
+ ]);
838
+
839
+ if (hasCustomContent === 'none') {
840
+ return { hasCustomContent: false };
841
+ }
842
+
843
+ if (hasCustomContent === 'url') {
844
+ console.log(chalk.yellow('\nURL-based custom content installation is coming soon!'));
845
+ console.log(chalk.cyan('For now, please download your custom content and choose "Enter a directory path".\n'));
846
+ return { hasCustomContent: false };
847
+ }
848
+
849
+ if (hasCustomContent === 'directory') {
850
+ let customPath;
851
+ while (!customPath) {
852
+ let expandedPath;
853
+ const { directory } = await inquirer.prompt([
854
+ {
855
+ type: 'input',
856
+ name: 'directory',
857
+ message: 'Enter directory to search for custom content (will scan subfolders):',
858
+ default: process.cwd(), // Use actual current working directory
859
+ validate: async (input) => {
860
+ if (!input || input.trim() === '') {
861
+ return 'Please enter a directory path';
862
+ }
863
+
864
+ try {
865
+ expandedPath = this.expandUserPath(input.trim());
866
+ } catch (error) {
867
+ return error.message;
868
+ }
869
+
870
+ // Check if the path exists
871
+ const pathExists = await fs.pathExists(expandedPath);
872
+ if (!pathExists) {
873
+ return 'Directory does not exist';
874
+ }
875
+
876
+ return true;
877
+ },
878
+ },
879
+ ]);
880
+
881
+ // Now expand the path for use after the prompt
882
+ expandedPath = this.expandUserPath(directory.trim());
883
+
884
+ // Check if directory has custom content
885
+ const { CustomHandler } = require('../installers/lib/custom/handler');
886
+ const customHandler = new CustomHandler();
887
+ const customFiles = await customHandler.findCustomContent(expandedPath);
888
+
889
+ if (customFiles.length === 0) {
890
+ console.log(chalk.yellow(`\nNo custom content found in ${expandedPath}`));
891
+
892
+ const { tryAgain } = await inquirer.prompt([
893
+ {
894
+ type: 'confirm',
895
+ name: 'tryAgain',
896
+ message: 'Try a different directory?',
897
+ default: true,
898
+ },
899
+ ]);
900
+
901
+ if (tryAgain) {
902
+ continue;
903
+ } else {
904
+ return { hasCustomContent: false };
905
+ }
906
+ }
907
+
908
+ customPath = expandedPath;
909
+ console.log(chalk.green(`\n✓ Found ${customFiles.length} custom content item(s):`));
910
+ for (const file of customFiles) {
911
+ const relativePath = path.relative(expandedPath, path.dirname(file));
912
+ const folderName = path.dirname(file).split(path.sep).pop();
913
+ console.log(chalk.dim(` • ${folderName} ${chalk.gray(`(${relativePath})`)}`));
914
+ }
915
+ }
916
+
917
+ return { hasCustomContent: true, customPath };
918
+ }
919
+
920
+ return { hasCustomContent: false };
921
+ } catch (error) {
922
+ console.error(chalk.red('Error in custom content prompt:'), error);
923
+ return { hasCustomContent: false };
924
+ }
925
+ }
926
+
577
927
  /**
578
928
  * Confirm directory selection
579
929
  * @param {string} directory - The directory path
@@ -859,6 +1209,144 @@ class UI {
859
1209
 
860
1210
  return (await fs.pathExists(hookPath)) && (await fs.pathExists(playTtsPath));
861
1211
  }
1212
+
1213
+ /**
1214
+ * Prompt for custom content for existing installations
1215
+ * @returns {Object} Custom content configuration
1216
+ */
1217
+ async promptCustomContentForExisting() {
1218
+ try {
1219
+ CLIUtils.displaySection('Custom Content', 'Add new custom agents, workflows, or modules to your installation');
1220
+
1221
+ const { hasCustomContent } = await inquirer.prompt([
1222
+ {
1223
+ type: 'list',
1224
+ name: 'hasCustomContent',
1225
+ message: 'Do you want to add or update custom content?',
1226
+ choices: [
1227
+ {
1228
+ name: 'No, continue with current installation only',
1229
+ value: false,
1230
+ },
1231
+ {
1232
+ name: 'Yes, I have custom content to add or update',
1233
+ value: true,
1234
+ },
1235
+ ],
1236
+ default: false,
1237
+ },
1238
+ ]);
1239
+
1240
+ if (!hasCustomContent) {
1241
+ return { hasCustomContent: false };
1242
+ }
1243
+
1244
+ // Get directory path
1245
+ const { customPath } = await inquirer.prompt([
1246
+ {
1247
+ type: 'input',
1248
+ name: 'customPath',
1249
+ message: 'Enter directory to search for custom content (will scan subfolders):',
1250
+ default: process.cwd(),
1251
+ validate: async (input) => {
1252
+ if (!input || input.trim() === '') {
1253
+ return 'Please enter a directory path';
1254
+ }
1255
+
1256
+ // Normalize and check if path exists
1257
+ const expandedPath = CLIUtils.expandPath(input.trim());
1258
+ const pathExists = await fs.pathExists(expandedPath);
1259
+ if (!pathExists) {
1260
+ return 'Directory does not exist';
1261
+ }
1262
+
1263
+ // Check if it's actually a directory
1264
+ const stats = await fs.stat(expandedPath);
1265
+ if (!stats.isDirectory()) {
1266
+ return 'Path must be a directory';
1267
+ }
1268
+
1269
+ return true;
1270
+ },
1271
+ transformer: (input) => {
1272
+ return CLIUtils.expandPath(input);
1273
+ },
1274
+ },
1275
+ ]);
1276
+
1277
+ const resolvedPath = CLIUtils.expandPath(customPath);
1278
+
1279
+ // Find custom content
1280
+ const { CustomHandler } = require('../installers/lib/custom/handler');
1281
+ const customHandler = new CustomHandler();
1282
+ const customFiles = await customHandler.findCustomContent(resolvedPath);
1283
+
1284
+ if (customFiles.length === 0) {
1285
+ console.log(chalk.yellow(`\nNo custom content found in ${resolvedPath}`));
1286
+
1287
+ const { tryDifferent } = await inquirer.prompt([
1288
+ {
1289
+ type: 'confirm',
1290
+ name: 'tryDifferent',
1291
+ message: 'Try a different directory?',
1292
+ default: true,
1293
+ },
1294
+ ]);
1295
+
1296
+ if (tryDifferent) {
1297
+ return await this.promptCustomContentForExisting();
1298
+ }
1299
+
1300
+ return { hasCustomContent: false };
1301
+ }
1302
+
1303
+ // Display found items
1304
+ console.log(chalk.cyan(`\nFound ${customFiles.length} custom content file(s):`));
1305
+ const { CustomHandler: CustomHandler2 } = require('../installers/lib/custom/handler');
1306
+ const customHandler2 = new CustomHandler2();
1307
+ const customContentItems = [];
1308
+
1309
+ for (const customFile of customFiles) {
1310
+ const customInfo = await customHandler2.getCustomInfo(customFile);
1311
+ if (customInfo) {
1312
+ customContentItems.push({
1313
+ name: `${chalk.cyan('✓')} ${customInfo.name} ${chalk.gray(`(${customInfo.relativePath})`)}`,
1314
+ value: `__CUSTOM_CONTENT__${customFile}`,
1315
+ checked: true,
1316
+ });
1317
+ }
1318
+ }
1319
+
1320
+ // Add option to keep existing custom content
1321
+ console.log(chalk.yellow('\nExisting custom modules will be preserved unless you remove them'));
1322
+
1323
+ const { selectedFiles } = await inquirer.prompt([
1324
+ {
1325
+ type: 'checkbox',
1326
+ name: 'selectedFiles',
1327
+ message: 'Select custom content to add:',
1328
+ choices: customContentItems,
1329
+ pageSize: 15,
1330
+ validate: (answer) => {
1331
+ if (answer.length === 0) {
1332
+ return 'You must select at least one item';
1333
+ }
1334
+ return true;
1335
+ },
1336
+ },
1337
+ ]);
1338
+
1339
+ return {
1340
+ hasCustomContent: true,
1341
+ customPath: resolvedPath,
1342
+ selected: true,
1343
+ selectedFiles: selectedFiles,
1344
+ };
1345
+ } catch (error) {
1346
+ console.error(chalk.red('Error configuring custom content:'), error);
1347
+ return { hasCustomContent: false };
1348
+ }
1349
+ }
862
1350
  }
863
1351
 
864
1352
  module.exports = { UI };
@@ -0,0 +1,55 @@
1
+ # Raven's Verdict - Deep PR Review Tool
2
+
3
+ Adversarial code review for GitHub PRs. Works with any LLM agent.
4
+
5
+ > **Status: Experimental.** We're still figuring out how to use this effectively. Expect the workflow to evolve.
6
+
7
+ ## How It Works
8
+
9
+ Point your agent at `review-pr.md` and ask it to review a specific PR:
10
+
11
+ > "Read tools/maintainer/review-pr.md and apply it to PR #123"
12
+
13
+ The tool will:
14
+
15
+ 1. Check out the PR branch locally
16
+ 2. Run an adversarial review (find at least 5 issues)
17
+ 3. Transform findings into professional tone
18
+ 4. Preview the review and ask before posting
19
+
20
+ See `review-pr.md` for full prompt structure, severity ratings, and sandboxing rules.
21
+
22
+ ## When to Use
23
+
24
+ **Good candidates:**
25
+
26
+ - PRs with meaningful logic changes
27
+ - Refactors touching multiple files
28
+ - New features or architectural changes
29
+
30
+ **Skip it for:**
31
+
32
+ - Trivial PRs (typo fixes, version bumps, single-line changes)
33
+ - PRs you've already reviewed manually
34
+ - PRs where you haven't agreed on the approach yet — fix the direction before the implementation
35
+
36
+ ## Workflow Tips
37
+
38
+ **Always review before posting.** The preview step exists for a reason:
39
+
40
+ - **[y] Yes** — Post as-is (only if you're confident)
41
+ - **[e] Edit** — Modify findings before posting
42
+ - **[s] Save only** — Write to file, don't post
43
+
44
+ The save option is useful when you want to:
45
+
46
+ - Hand-edit the review before posting
47
+ - Use the findings as input for a second opinion ("Hey Claude, here's what Raven found — what do you think?")
48
+ - Cherry-pick specific findings
49
+
50
+ **Trust but verify.** LLM reviews can miss context or flag non-issues. Skim the findings before they hit the PR.
51
+
52
+ ## Prerequisites
53
+
54
+ - `gh` CLI installed and authenticated (`gh auth status`)
55
+ - Any LLM agent capable of running bash commands