claude-cli-advanced-starter-pack 1.0.4 → 1.0.5

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.
@@ -10,13 +10,27 @@ import chalk from 'chalk';
10
10
  import ora from 'ora';
11
11
  import boxen from 'boxen';
12
12
  import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, rmSync, renameSync, copyFileSync } from 'fs';
13
- import { join, basename } from 'path';
13
+ import { join, basename, dirname } from 'path';
14
+ import { fileURLToPath } from 'url';
14
15
  import { runInit } from './init.js';
15
16
  import { detectTechStack } from './detect-tech-stack.js';
16
- import { runClaudeAudit, runEnhancement } from './claude-audit.js';
17
+ import { runEnhancement } from './claude-audit.js';
17
18
  import { runSetup as runGitHubSetup } from './setup.js';
18
19
  import { runList } from './list.js';
19
- import { showProjectSettingsMenu } from '../cli/menu.js';
20
+ import {
21
+ performVersionCheck,
22
+ formatUpdateBanner,
23
+ loadReleaseNotes,
24
+ getReleasesSince,
25
+ getAvailableFeatures,
26
+ markFeatureInstalled,
27
+ markFeatureSkipped,
28
+ dismissUpdateNotification,
29
+ getCurrentVersion,
30
+ } from '../utils/version-check.js';
31
+
32
+ const __filename = fileURLToPath(import.meta.url);
33
+ const __dirname = dirname(__filename);
20
34
 
21
35
  /**
22
36
  * Create backup of a file before overwriting
@@ -321,32 +335,17 @@ const SETUP_OPTIONS = [
321
335
  short: 'GitHub',
322
336
  },
323
337
  {
324
- name: `${chalk.yellow('4.')} Audit CLAUDE.md ${chalk.dim('- Check existing config')}`,
325
- value: 'audit',
326
- short: 'Audit',
327
- },
328
- {
329
- name: `${chalk.yellow('5.')} Enhance CLAUDE.md ${chalk.dim('- Generate/improve docs')}`,
330
- value: 'enhance',
331
- short: 'Enhance',
332
- },
333
- {
334
- name: `${chalk.yellow('6.')} Detect Tech Stack ${chalk.dim('- Auto-detect project')}`,
335
- value: 'detect',
336
- short: 'Detect',
337
- },
338
- {
339
- name: `${chalk.yellow('7.')} View Templates ${chalk.dim('- Browse available items')}`,
338
+ name: `${chalk.yellow('4.')} View Templates ${chalk.dim('- Browse available items')}`,
340
339
  value: 'templates',
341
340
  short: 'Templates',
342
341
  },
343
342
  {
344
- name: `${chalk.yellow('8.')} Project Settings ${chalk.dim('- Configure deployment, tunnels, etc.')}`,
345
- value: 'settings',
346
- short: 'Settings',
343
+ name: `${chalk.yellow('5.')} Prior Releases ${chalk.dim('- Review & add features from past versions')}`,
344
+ value: 'releases',
345
+ short: 'Releases',
347
346
  },
348
347
  {
349
- name: `${chalk.yellow('9.')} Remove CCASP ${chalk.dim('- Uninstall from this project')}`,
348
+ name: `${chalk.yellow('6.')} Remove CCASP ${chalk.dim('- Uninstall from this project')}`,
350
349
  value: 'remove',
351
350
  short: 'Remove',
352
351
  },
@@ -618,12 +617,407 @@ async function showTemplates() {
618
617
  }
619
618
  }
620
619
 
620
+ /**
621
+ * Show prior releases and allow adding features
622
+ */
623
+ async function showPriorReleases() {
624
+ console.log(chalk.bold('\nšŸ“œ Prior Releases\n'));
625
+
626
+ const { releases } = loadReleaseNotes();
627
+ const currentVersion = getCurrentVersion();
628
+
629
+ if (!releases || releases.length === 0) {
630
+ console.log(chalk.yellow(' No release history available.\n'));
631
+ return;
632
+ }
633
+
634
+ // Show release list
635
+ console.log(chalk.dim(' Select a release to view details and available features:\n'));
636
+
637
+ releases.forEach((release, i) => {
638
+ const isCurrent = release.version === currentVersion;
639
+ const marker = isCurrent ? chalk.green('ā—') : chalk.dim('ā—‹');
640
+ const currentLabel = isCurrent ? chalk.green(' (current)') : '';
641
+ console.log(` ${chalk.yellow(i + 1 + '.')} ${marker} v${release.version}${currentLabel} ${chalk.dim(`(${release.date})`)}`);
642
+ console.log(` ${chalk.dim(release.summary)}`);
643
+ });
644
+
645
+ console.log('');
646
+
647
+ const { releaseChoice } = await inquirer.prompt([
648
+ {
649
+ type: 'list',
650
+ name: 'releaseChoice',
651
+ message: 'Select a release to view details:',
652
+ choices: [
653
+ ...releases.map((r, i) => ({
654
+ name: `${i + 1}. v${r.version} - ${r.summary}`,
655
+ value: i,
656
+ short: `v${r.version}`,
657
+ })),
658
+ {
659
+ name: `${chalk.cyan('A.')} Add available features to project`,
660
+ value: 'add',
661
+ short: 'Add Features',
662
+ },
663
+ {
664
+ name: `${chalk.dim('0.')} Back to menu`,
665
+ value: 'back',
666
+ short: 'Back',
667
+ },
668
+ ],
669
+ pageSize: 12,
670
+ },
671
+ ]);
672
+
673
+ if (releaseChoice === 'back') {
674
+ return;
675
+ }
676
+
677
+ if (releaseChoice === 'add') {
678
+ await showAddFeaturesMenu();
679
+ return;
680
+ }
681
+
682
+ // Show release details
683
+ const release = releases[releaseChoice];
684
+ await showReleaseDetails(release);
685
+ }
686
+
687
+ /**
688
+ * Show detailed release information
689
+ */
690
+ async function showReleaseDetails(release) {
691
+ console.log(
692
+ boxen(
693
+ chalk.bold.cyan(`v${release.version}\n`) +
694
+ chalk.dim(`Released: ${release.date}\n\n`) +
695
+ chalk.white(release.summary),
696
+ {
697
+ padding: 1,
698
+ borderStyle: 'round',
699
+ borderColor: 'cyan',
700
+ title: 'šŸ“¦ Release Details',
701
+ titleAlignment: 'center',
702
+ }
703
+ )
704
+ );
705
+
706
+ // Show highlights
707
+ if (release.highlights && release.highlights.length > 0) {
708
+ console.log(chalk.bold('\n✨ Highlights:\n'));
709
+ release.highlights.forEach((h) => {
710
+ console.log(` • ${h}`);
711
+ });
712
+ }
713
+
714
+ // Show new features
715
+ if (release.newFeatures) {
716
+ const { commands, agents, skills, hooks, other } = release.newFeatures;
717
+
718
+ if (commands && commands.length > 0) {
719
+ console.log(chalk.bold('\nšŸ“ New Commands:\n'));
720
+ commands.forEach((cmd) => {
721
+ console.log(` ${chalk.cyan(`/${cmd.name}`)} - ${cmd.description}`);
722
+ });
723
+ }
724
+
725
+ if (agents && agents.length > 0) {
726
+ console.log(chalk.bold('\nšŸ¤– New Agents:\n'));
727
+ agents.forEach((agent) => {
728
+ console.log(` ${chalk.cyan(agent.name)} - ${agent.description}`);
729
+ });
730
+ }
731
+
732
+ if (skills && skills.length > 0) {
733
+ console.log(chalk.bold('\nšŸŽÆ New Skills:\n'));
734
+ skills.forEach((skill) => {
735
+ console.log(` ${chalk.cyan(skill.name)} - ${skill.description}`);
736
+ });
737
+ }
738
+
739
+ if (hooks && hooks.length > 0) {
740
+ console.log(chalk.bold('\nšŸŖ New Hooks:\n'));
741
+ hooks.forEach((hook) => {
742
+ console.log(` ${chalk.cyan(hook.name)} - ${hook.description}`);
743
+ });
744
+ }
745
+
746
+ if (other && other.length > 0) {
747
+ console.log(chalk.bold('\nšŸ”§ Other Improvements:\n'));
748
+ other.forEach((item) => {
749
+ console.log(` ${chalk.cyan(item.name)} - ${item.description}`);
750
+ });
751
+ }
752
+ }
753
+
754
+ // Show breaking changes
755
+ if (release.breaking && release.breaking.length > 0) {
756
+ console.log(chalk.bold.red('\nāš ļø Breaking Changes:\n'));
757
+ release.breaking.forEach((b) => {
758
+ console.log(` ${chalk.red('!')} ${b}`);
759
+ });
760
+ }
761
+
762
+ console.log('');
763
+
764
+ // Offer to add features from this release
765
+ const hasNewFeatures =
766
+ release.newFeatures &&
767
+ (release.newFeatures.commands?.length > 0 ||
768
+ release.newFeatures.agents?.length > 0 ||
769
+ release.newFeatures.skills?.length > 0 ||
770
+ release.newFeatures.hooks?.length > 0);
771
+
772
+ if (hasNewFeatures) {
773
+ const { addFeatures } = await inquirer.prompt([
774
+ {
775
+ type: 'confirm',
776
+ name: 'addFeatures',
777
+ message: 'Would you like to add features from this release to your project?',
778
+ default: false,
779
+ },
780
+ ]);
781
+
782
+ if (addFeatures) {
783
+ await addFeaturesFromRelease(release);
784
+ }
785
+ }
786
+ }
787
+
788
+ /**
789
+ * Show menu to add available features
790
+ */
791
+ async function showAddFeaturesMenu() {
792
+ const claudeDir = join(process.cwd(), '.claude');
793
+ const commandsDir = join(claudeDir, 'commands');
794
+
795
+ if (!existsSync(claudeDir)) {
796
+ console.log(chalk.yellow('\nāš ļø No .claude folder found. Run Quick Start (1) or Full Setup (2) first.\n'));
797
+ return;
798
+ }
799
+
800
+ // Get existing commands
801
+ const existingCommands = existsSync(commandsDir)
802
+ ? readdirSync(commandsDir).filter((f) => f.endsWith('.md') && f !== 'INDEX.md' && f !== 'README.md').map((f) => f.replace('.md', ''))
803
+ : [];
804
+
805
+ // Get all available features from releases
806
+ const { releases, featureRegistry } = loadReleaseNotes();
807
+
808
+ if (!featureRegistry || !featureRegistry.commands) {
809
+ console.log(chalk.yellow('\n No feature registry available.\n'));
810
+ return;
811
+ }
812
+
813
+ // Find commands not yet installed
814
+ const availableCommands = Object.entries(featureRegistry.commands)
815
+ .filter(([name, info]) => !existingCommands.includes(name) && !info.required)
816
+ .map(([name, info]) => {
817
+ // Find description from releases
818
+ let description = 'No description available';
819
+ for (const release of releases) {
820
+ const cmd = release.newFeatures?.commands?.find((c) => c.name === name);
821
+ if (cmd) {
822
+ description = cmd.description;
823
+ break;
824
+ }
825
+ }
826
+ return { name, description, addedIn: info.addedIn };
827
+ });
828
+
829
+ if (availableCommands.length === 0) {
830
+ console.log(chalk.green('\nāœ“ All available commands are already installed!\n'));
831
+ return;
832
+ }
833
+
834
+ console.log(chalk.bold('\nšŸ“¦ Available Commands to Add:\n'));
835
+ console.log(chalk.dim(' Select commands to add to your project:\n'));
836
+
837
+ const { selectedCommands } = await inquirer.prompt([
838
+ {
839
+ type: 'checkbox',
840
+ name: 'selectedCommands',
841
+ message: 'Select commands to install:',
842
+ choices: availableCommands.map((cmd) => ({
843
+ name: `/${cmd.name} - ${cmd.description} ${chalk.dim(`(v${cmd.addedIn})`)}`,
844
+ value: cmd.name,
845
+ checked: false,
846
+ })),
847
+ pageSize: 15,
848
+ },
849
+ ]);
850
+
851
+ if (selectedCommands.length === 0) {
852
+ console.log(chalk.dim('\n No commands selected.\n'));
853
+ return;
854
+ }
855
+
856
+ // Install selected commands
857
+ const spinner = ora('Installing commands...').start();
858
+ const installed = [];
859
+ const failed = [];
860
+
861
+ for (const cmdName of selectedCommands) {
862
+ try {
863
+ // Look for template file
864
+ const templatePath = join(__dirname, '..', '..', 'templates', 'commands', `${cmdName}.template.md`);
865
+
866
+ if (existsSync(templatePath)) {
867
+ const content = readFileSync(templatePath, 'utf8');
868
+ const cmdPath = join(commandsDir, `${cmdName}.md`);
869
+ writeFileSync(cmdPath, content, 'utf8');
870
+ installed.push(cmdName);
871
+ markFeatureInstalled(cmdName);
872
+ } else {
873
+ failed.push({ name: cmdName, error: 'Template not found' });
874
+ }
875
+ } catch (error) {
876
+ failed.push({ name: cmdName, error: error.message });
877
+ }
878
+ }
879
+
880
+ spinner.stop();
881
+
882
+ if (installed.length > 0) {
883
+ console.log(chalk.green(`\nāœ“ Installed ${installed.length} command(s):`));
884
+ installed.forEach((cmd) => {
885
+ console.log(` ${chalk.cyan(`/${cmd}`)}`);
886
+ });
887
+ }
888
+
889
+ if (failed.length > 0) {
890
+ console.log(chalk.red(`\nāœ— Failed to install ${failed.length} command(s):`));
891
+ failed.forEach((f) => {
892
+ console.log(` ${chalk.red(`/${f.name}`)}: ${f.error}`);
893
+ });
894
+ }
895
+
896
+ if (installed.length > 0) {
897
+ showRestartReminder();
898
+ }
899
+ }
900
+
901
+ /**
902
+ * Add features from a specific release
903
+ */
904
+ async function addFeaturesFromRelease(release) {
905
+ const claudeDir = join(process.cwd(), '.claude');
906
+ const commandsDir = join(claudeDir, 'commands');
907
+
908
+ if (!existsSync(claudeDir)) {
909
+ console.log(chalk.yellow('\nāš ļø No .claude folder found. Run Quick Start (1) or Full Setup (2) first.\n'));
910
+ return;
911
+ }
912
+
913
+ if (!release.newFeatures?.commands || release.newFeatures.commands.length === 0) {
914
+ console.log(chalk.yellow('\n No commands to add from this release.\n'));
915
+ return;
916
+ }
917
+
918
+ // Get existing commands
919
+ const existingCommands = existsSync(commandsDir)
920
+ ? readdirSync(commandsDir).filter((f) => f.endsWith('.md')).map((f) => f.replace('.md', ''))
921
+ : [];
922
+
923
+ // Filter to commands not yet installed
924
+ const availableCommands = release.newFeatures.commands.filter((cmd) => !existingCommands.includes(cmd.name));
925
+
926
+ if (availableCommands.length === 0) {
927
+ console.log(chalk.green('\nāœ“ All commands from this release are already installed!\n'));
928
+ return;
929
+ }
930
+
931
+ const { selectedCommands } = await inquirer.prompt([
932
+ {
933
+ type: 'checkbox',
934
+ name: 'selectedCommands',
935
+ message: 'Select commands to install:',
936
+ choices: availableCommands.map((cmd) => ({
937
+ name: `/${cmd.name} - ${cmd.description}`,
938
+ value: cmd.name,
939
+ checked: true,
940
+ })),
941
+ pageSize: 10,
942
+ },
943
+ ]);
944
+
945
+ if (selectedCommands.length === 0) {
946
+ console.log(chalk.dim('\n No commands selected.\n'));
947
+ return;
948
+ }
949
+
950
+ // Install selected commands
951
+ const spinner = ora('Installing commands...').start();
952
+ const installed = [];
953
+ const failed = [];
954
+
955
+ for (const cmdName of selectedCommands) {
956
+ try {
957
+ const templatePath = join(__dirname, '..', '..', 'templates', 'commands', `${cmdName}.template.md`);
958
+
959
+ if (existsSync(templatePath)) {
960
+ const content = readFileSync(templatePath, 'utf8');
961
+ const cmdPath = join(commandsDir, `${cmdName}.md`);
962
+ writeFileSync(cmdPath, content, 'utf8');
963
+ installed.push(cmdName);
964
+ markFeatureInstalled(cmdName);
965
+ } else {
966
+ failed.push({ name: cmdName, error: 'Template not found' });
967
+ }
968
+ } catch (error) {
969
+ failed.push({ name: cmdName, error: error.message });
970
+ }
971
+ }
972
+
973
+ spinner.stop();
974
+
975
+ if (installed.length > 0) {
976
+ console.log(chalk.green(`\nāœ“ Installed ${installed.length} command(s):`));
977
+ installed.forEach((cmd) => {
978
+ console.log(` ${chalk.cyan(`/${cmd}`)}`);
979
+ });
980
+ showRestartReminder();
981
+ }
982
+
983
+ if (failed.length > 0) {
984
+ console.log(chalk.red(`\nāœ— Failed to install ${failed.length} command(s):`));
985
+ failed.forEach((f) => {
986
+ console.log(` ${chalk.red(`/${f.name}`)}: ${f.error}`);
987
+ });
988
+ }
989
+ }
990
+
991
+ /**
992
+ * Check for updates and show banner if available
993
+ */
994
+ async function checkAndShowUpdateBanner() {
995
+ try {
996
+ const checkResult = await performVersionCheck(process.cwd(), false);
997
+
998
+ if (checkResult.updateAvailable && checkResult.shouldNotify) {
999
+ const banner = formatUpdateBanner(checkResult);
1000
+ if (banner) {
1001
+ console.log(chalk.yellow(banner));
1002
+ }
1003
+ }
1004
+
1005
+ return checkResult;
1006
+ } catch {
1007
+ // Silently fail - network might be unavailable
1008
+ return null;
1009
+ }
1010
+ }
1011
+
621
1012
  /**
622
1013
  * Main setup wizard - entry point
623
1014
  */
624
1015
  export async function runSetupWizard(options = {}) {
625
1016
  showSetupHeader();
626
1017
 
1018
+ // Check for updates in background (non-blocking display)
1019
+ await checkAndShowUpdateBanner();
1020
+
627
1021
  // Check if .claude already exists
628
1022
  const claudeDir = join(process.cwd(), '.claude');
629
1023
  const claudeMd = join(process.cwd(), 'CLAUDE.md');
@@ -644,7 +1038,7 @@ export async function runSetupWizard(options = {}) {
644
1038
  name: 'action',
645
1039
  message: 'What would you like to do?',
646
1040
  choices: SETUP_OPTIONS,
647
- pageSize: 10,
1041
+ pageSize: 12,
648
1042
  },
649
1043
  ]);
650
1044
 
@@ -666,44 +1060,12 @@ export async function runSetupWizard(options = {}) {
666
1060
  showRestartReminder();
667
1061
  break;
668
1062
 
669
- case 'audit':
670
- await runClaudeAudit();
671
- // Audit doesn't modify files, no restart needed
672
- break;
673
-
674
- case 'enhance':
675
- await runEnhancement();
676
- // Enhancement modifies CLAUDE.md which requires restart
677
- showRestartReminder();
678
- break;
679
-
680
- case 'detect':
681
- const spinner = ora('Detecting tech stack...').start();
682
- try {
683
- const techStack = await detectTechStack(process.cwd());
684
- spinner.succeed('Detection complete!');
685
- console.log(chalk.bold('\nDetected Tech Stack:'));
686
- console.log(JSON.stringify(techStack, null, 2));
687
- } catch (error) {
688
- spinner.fail('Detection failed');
689
- console.error(chalk.red(error.message));
690
- }
691
- console.log('');
692
- break;
693
-
694
1063
  case 'templates':
695
1064
  await showTemplates();
696
1065
  break;
697
1066
 
698
- case 'settings':
699
- // Check if .claude folder exists first
700
- if (!existsSync(join(process.cwd(), '.claude'))) {
701
- console.log(chalk.yellow('\nāš ļø No .claude folder found. Run Quick Start (1) or Full Setup (2) first.\n'));
702
- } else {
703
- await showProjectSettingsMenu();
704
- // Settings modify tech-stack.json which may require restart
705
- showRestartReminder();
706
- }
1067
+ case 'releases':
1068
+ await showPriorReleases();
707
1069
  break;
708
1070
 
709
1071
  case 'remove':
@@ -733,8 +1095,6 @@ Run the Claude CLI Advanced Starter Pack setup wizard.
733
1095
 
734
1096
  This command launches the interactive setup wizard for configuring:
735
1097
  - .claude folder structure
736
- - CLAUDE.md generation
737
- - Tech stack detection
738
1098
  - GitHub project integration
739
1099
  - Agents, hooks, and skills
740
1100
 
@@ -744,10 +1104,14 @@ Reply with a number to jump to that option:
744
1104
  1. Quick Start - Auto-detect and initialize
745
1105
  2. Full Setup - All features with customization
746
1106
  3. GitHub Setup - Connect to project board
747
- 4. Audit - Check existing CLAUDE.md
748
- 5. Enhance - Generate/improve CLAUDE.md
749
- 6. Detect - Show detected tech stack
750
- 7. Templates - Browse available templates
1107
+ 4. View Templates - Browse available templates
1108
+ 5. Prior Releases - Review & add features from past versions
1109
+ 6. Remove CCASP - Uninstall from this project
1110
+
1111
+ ## Related Commands
1112
+
1113
+ - \`/project-impl\` - Agent-powered project implementation (audit, enhance, detect, configure)
1114
+ - \`/update-check\` - Check for updates and add new features
751
1115
 
752
1116
  ## From Terminal
753
1117