claude-code-templates 1.14.12 → 1.14.14

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 (70) hide show
  1. package/bin/create-claude-config.js +1 -0
  2. package/package.json +1 -2
  3. package/src/file-operations.js +239 -36
  4. package/src/index.js +347 -9
  5. package/templates/common/.claude/commands/git-workflow.md +0 -239
  6. package/templates/common/.claude/commands/project-setup.md +0 -316
  7. package/templates/common/.mcp.json +0 -41
  8. package/templates/common/CLAUDE.md +0 -109
  9. package/templates/common/README.md +0 -96
  10. package/templates/go/.mcp.json +0 -78
  11. package/templates/go/README.md +0 -25
  12. package/templates/javascript-typescript/.claude/commands/api-endpoint.md +0 -51
  13. package/templates/javascript-typescript/.claude/commands/debug.md +0 -52
  14. package/templates/javascript-typescript/.claude/commands/lint.md +0 -48
  15. package/templates/javascript-typescript/.claude/commands/npm-scripts.md +0 -48
  16. package/templates/javascript-typescript/.claude/commands/refactor.md +0 -55
  17. package/templates/javascript-typescript/.claude/commands/test.md +0 -61
  18. package/templates/javascript-typescript/.claude/commands/typescript-migrate.md +0 -51
  19. package/templates/javascript-typescript/.claude/settings.json +0 -142
  20. package/templates/javascript-typescript/.mcp.json +0 -80
  21. package/templates/javascript-typescript/CLAUDE.md +0 -185
  22. package/templates/javascript-typescript/README.md +0 -259
  23. package/templates/javascript-typescript/examples/angular-app/.claude/commands/components.md +0 -63
  24. package/templates/javascript-typescript/examples/angular-app/.claude/commands/services.md +0 -62
  25. package/templates/javascript-typescript/examples/node-api/.claude/commands/api-endpoint.md +0 -46
  26. package/templates/javascript-typescript/examples/node-api/.claude/commands/database.md +0 -56
  27. package/templates/javascript-typescript/examples/node-api/.claude/commands/middleware.md +0 -61
  28. package/templates/javascript-typescript/examples/node-api/.claude/commands/route.md +0 -57
  29. package/templates/javascript-typescript/examples/node-api/CLAUDE.md +0 -102
  30. package/templates/javascript-typescript/examples/react-app/.claude/commands/component.md +0 -29
  31. package/templates/javascript-typescript/examples/react-app/.claude/commands/hooks.md +0 -44
  32. package/templates/javascript-typescript/examples/react-app/.claude/commands/state-management.md +0 -45
  33. package/templates/javascript-typescript/examples/react-app/CLAUDE.md +0 -81
  34. package/templates/javascript-typescript/examples/react-app/agents/react-performance-optimization.md +0 -530
  35. package/templates/javascript-typescript/examples/react-app/agents/react-state-management.md +0 -295
  36. package/templates/javascript-typescript/examples/vue-app/.claude/commands/components.md +0 -46
  37. package/templates/javascript-typescript/examples/vue-app/.claude/commands/composables.md +0 -51
  38. package/templates/python/.claude/commands/lint.md +0 -111
  39. package/templates/python/.claude/commands/test.md +0 -73
  40. package/templates/python/.claude/settings.json +0 -153
  41. package/templates/python/.mcp.json +0 -78
  42. package/templates/python/CLAUDE.md +0 -276
  43. package/templates/python/examples/django-app/.claude/commands/admin.md +0 -264
  44. package/templates/python/examples/django-app/.claude/commands/django-model.md +0 -124
  45. package/templates/python/examples/django-app/.claude/commands/views.md +0 -222
  46. package/templates/python/examples/django-app/CLAUDE.md +0 -313
  47. package/templates/python/examples/django-app/agents/django-api-security.md +0 -642
  48. package/templates/python/examples/django-app/agents/django-database-optimization.md +0 -752
  49. package/templates/python/examples/fastapi-app/.claude/commands/api-endpoints.md +0 -513
  50. package/templates/python/examples/fastapi-app/.claude/commands/auth.md +0 -775
  51. package/templates/python/examples/fastapi-app/.claude/commands/database.md +0 -657
  52. package/templates/python/examples/fastapi-app/.claude/commands/deployment.md +0 -160
  53. package/templates/python/examples/fastapi-app/.claude/commands/testing.md +0 -927
  54. package/templates/python/examples/fastapi-app/CLAUDE.md +0 -229
  55. package/templates/python/examples/flask-app/.claude/commands/app-factory.md +0 -384
  56. package/templates/python/examples/flask-app/.claude/commands/blueprint.md +0 -243
  57. package/templates/python/examples/flask-app/.claude/commands/database.md +0 -410
  58. package/templates/python/examples/flask-app/.claude/commands/deployment.md +0 -620
  59. package/templates/python/examples/flask-app/.claude/commands/flask-route.md +0 -217
  60. package/templates/python/examples/flask-app/.claude/commands/testing.md +0 -559
  61. package/templates/python/examples/flask-app/CLAUDE.md +0 -391
  62. package/templates/ruby/.claude/commands/model.md +0 -360
  63. package/templates/ruby/.claude/commands/test.md +0 -480
  64. package/templates/ruby/.claude/settings.json +0 -146
  65. package/templates/ruby/.mcp.json +0 -83
  66. package/templates/ruby/CLAUDE.md +0 -284
  67. package/templates/ruby/examples/rails-app/.claude/commands/authentication.md +0 -490
  68. package/templates/ruby/examples/rails-app/CLAUDE.md +0 -376
  69. package/templates/rust/.mcp.json +0 -78
  70. package/templates/rust/README.md +0 -26
package/src/index.js CHANGED
@@ -106,6 +106,12 @@ async function createClaudeConfig(options = {}) {
106
106
  return;
107
107
  }
108
108
 
109
+ // Handle workflow installation
110
+ if (options.workflow) {
111
+ await installWorkflow(options.workflow, targetDir, options);
112
+ return;
113
+ }
114
+
109
115
  // Handle command stats analysis (both singular and plural)
110
116
  if (options.commandStats || options.commandsStats) {
111
117
  await runCommandStats(options);
@@ -345,9 +351,11 @@ async function installIndividualAgent(agentName, targetDir, options) {
345
351
  const targetFile = path.join(agentsDir, `${fileName}.md`);
346
352
  await fs.writeFile(targetFile, agentContent, 'utf8');
347
353
 
348
- console.log(chalk.green(`✅ Agent "${agentName}" installed successfully!`));
349
- console.log(chalk.cyan(`📁 Installed to: ${path.relative(targetDir, targetFile)}`));
350
- console.log(chalk.cyan(`📦 Downloaded from: ${githubUrl}`));
354
+ if (!options.silent) {
355
+ console.log(chalk.green(`✅ Agent "${agentName}" installed successfully!`));
356
+ console.log(chalk.cyan(`📁 Installed to: ${path.relative(targetDir, targetFile)}`));
357
+ console.log(chalk.cyan(`📦 Downloaded from: ${githubUrl}`));
358
+ }
351
359
 
352
360
  // Track successful agent installation
353
361
  trackingService.trackDownload('agent', agentName, {
@@ -406,9 +414,11 @@ async function installIndividualCommand(commandName, targetDir, options) {
406
414
 
407
415
  await fs.writeFile(targetFile, commandContent, 'utf8');
408
416
 
409
- console.log(chalk.green(`✅ Command "${commandName}" installed successfully!`));
410
- console.log(chalk.cyan(`📁 Installed to: ${path.relative(targetDir, targetFile)}`));
411
- console.log(chalk.cyan(`📦 Downloaded from: ${githubUrl}`));
417
+ if (!options.silent) {
418
+ console.log(chalk.green(`✅ Command "${commandName}" installed successfully!`));
419
+ console.log(chalk.cyan(`📁 Installed to: ${path.relative(targetDir, targetFile)}`));
420
+ console.log(chalk.cyan(`📦 Downloaded from: ${githubUrl}`));
421
+ }
412
422
 
413
423
  // Track successful command installation
414
424
  trackingService.trackDownload('command', commandName, {
@@ -450,6 +460,15 @@ async function installIndividualMCP(mcpName, targetDir, options) {
450
460
 
451
461
  const mcpConfigText = await response.text();
452
462
  const mcpConfig = JSON.parse(mcpConfigText);
463
+
464
+ // Remove description field from each MCP server before merging
465
+ if (mcpConfig.mcpServers) {
466
+ for (const serverName in mcpConfig.mcpServers) {
467
+ if (mcpConfig.mcpServers[serverName] && typeof mcpConfig.mcpServers[serverName] === 'object') {
468
+ delete mcpConfig.mcpServers[serverName].description;
469
+ }
470
+ }
471
+ }
453
472
 
454
473
  // Check if .mcp.json exists in target directory
455
474
  const targetMcpFile = path.join(targetDir, '.mcp.json');
@@ -477,9 +496,11 @@ async function installIndividualMCP(mcpName, targetDir, options) {
477
496
  // Write the merged configuration
478
497
  await fs.writeJson(targetMcpFile, mergedConfig, { spaces: 2 });
479
498
 
480
- console.log(chalk.green(`✅ MCP "${mcpName}" installed successfully!`));
481
- console.log(chalk.cyan(`📁 Configuration merged into: ${path.relative(targetDir, targetMcpFile)}`));
482
- console.log(chalk.cyan(`📦 Downloaded from: ${githubUrl}`));
499
+ if (!options.silent) {
500
+ console.log(chalk.green(`✅ MCP "${mcpName}" installed successfully!`));
501
+ console.log(chalk.cyan(`📁 Configuration merged into: ${path.relative(targetDir, targetMcpFile)}`));
502
+ console.log(chalk.cyan(`📦 Downloaded from: ${githubUrl}`));
503
+ }
483
504
 
484
505
  // Track successful MCP installation
485
506
  trackingService.trackDownload('mcp', mcpName, {
@@ -609,4 +630,321 @@ async function showAvailableAgents() {
609
630
  console.log('');
610
631
  }
611
632
 
633
+ /**
634
+ * Install workflow from hash
635
+ */
636
+ async function installWorkflow(workflowHash, targetDir, options) {
637
+ console.log(chalk.blue(`🔧 Installing workflow from hash: ${workflowHash}`));
638
+
639
+ try {
640
+ // Extract hash from format #hash
641
+ const hash = workflowHash.startsWith('#') ? workflowHash.substring(1) : workflowHash;
642
+
643
+ if (!hash || hash.length < 3) {
644
+ throw new Error('Invalid workflow hash format. Expected format: #hash');
645
+ }
646
+
647
+ console.log(chalk.gray(`📥 Fetching workflow configuration...`));
648
+
649
+ // Fetch workflow configuration from a remote service
650
+ // For now, we'll simulate this by using a local storage approach
651
+ // In production, this would fetch from a workflow registry
652
+ const workflowData = await fetchWorkflowData(hash);
653
+
654
+ if (!workflowData) {
655
+ throw new Error(`Workflow with hash "${hash}" not found. Please check the hash and try again.`);
656
+ }
657
+
658
+ console.log(chalk.green(`✅ Workflow found: ${workflowData.name}`));
659
+ console.log(chalk.cyan(`📝 Description: ${workflowData.description}`));
660
+ console.log(chalk.cyan(`🏷️ Tags: ${workflowData.tags.join(', ')}`));
661
+ console.log(chalk.cyan(`📊 Steps: ${workflowData.steps.length}`));
662
+
663
+ // Install all required components
664
+ const installPromises = [];
665
+
666
+ // Group components by type
667
+ const agents = workflowData.steps.filter(step => step.type === 'agent');
668
+ const commands = workflowData.steps.filter(step => step.type === 'command');
669
+ const mcps = workflowData.steps.filter(step => step.type === 'mcp');
670
+
671
+ console.log(chalk.blue(`\n📦 Installing workflow components...`));
672
+ console.log(chalk.gray(` Agents: ${agents.length}`));
673
+ console.log(chalk.gray(` Commands: ${commands.length}`));
674
+ console.log(chalk.gray(` MCPs: ${mcps.length}`));
675
+
676
+ // Install agents
677
+ for (const agent of agents) {
678
+ console.log(chalk.gray(` Installing agent: ${agent.name}`));
679
+ await installIndividualAgent(agent.path, targetDir, { ...options, silent: true });
680
+ }
681
+
682
+ // Install commands
683
+ for (const command of commands) {
684
+ console.log(chalk.gray(` Installing command: ${command.name}`));
685
+ await installIndividualCommand(command.path, targetDir, { ...options, silent: true });
686
+ }
687
+
688
+ // Install MCPs
689
+ for (const mcp of mcps) {
690
+ console.log(chalk.gray(` Installing MCP: ${mcp.name}`));
691
+ await installIndividualMCP(mcp.path, targetDir, { ...options, silent: true });
692
+ }
693
+
694
+ // Generate and save workflow YAML
695
+ const yamlContent = generateWorkflowYAML(workflowData);
696
+ const workflowsDir = path.join(targetDir, '.claude', 'workflows');
697
+ const workflowFile = path.join(workflowsDir, `${workflowData.name.replace(/[^a-z0-9]/gi, '_').toLowerCase()}.yaml`);
698
+
699
+ // Ensure .claude/workflows directory exists
700
+ await fs.ensureDir(workflowsDir);
701
+ await fs.writeFile(workflowFile, yamlContent, 'utf8');
702
+
703
+ console.log(chalk.green(`\n✅ Workflow "${workflowData.name}" installed successfully!`));
704
+ console.log(chalk.cyan(`📁 Components installed to: .claude/`));
705
+ console.log(chalk.cyan(`📄 Workflow file: ${path.relative(targetDir, workflowFile)}`));
706
+ console.log(chalk.cyan(`🚀 Use the workflow file with Claude Code to execute the complete workflow`));
707
+
708
+ // Track successful workflow installation
709
+ trackingService.trackDownload('workflow', hash, {
710
+ installation_type: 'workflow',
711
+ workflow_name: workflowData.name,
712
+ components_count: workflowData.steps.length,
713
+ agents_count: agents.length,
714
+ commands_count: commands.length,
715
+ mcps_count: mcps.length,
716
+ target_directory: path.relative(process.cwd(), targetDir)
717
+ });
718
+
719
+ } catch (error) {
720
+ console.log(chalk.red(`❌ Error installing workflow: ${error.message}`));
721
+
722
+ if (error.message.includes('not found')) {
723
+ console.log(chalk.yellow('\n💡 Possible solutions:'));
724
+ console.log(chalk.gray(' • Check that the workflow hash is correct'));
725
+ console.log(chalk.gray(' • Verify the workflow was generated successfully'));
726
+ console.log(chalk.gray(' • Try generating a new workflow from the builder'));
727
+ }
728
+ }
729
+ }
730
+
731
+ /**
732
+ * Fetch workflow data from hash
733
+ * In production, this would fetch from a remote workflow registry
734
+ * For now, we'll simulate this functionality
735
+ */
736
+ async function fetchWorkflowData(hash) {
737
+ // Simulate fetching workflow data
738
+ // In production, this would make an API call to a workflow registry
739
+ // For demo purposes, we'll return a sample workflow if hash matches demo
740
+
741
+ // Demo workflow for testing
742
+ if (hash === 'demo123' || hash === 'abc123test') {
743
+ console.log(chalk.green('🎯 Demo workflow found! Using sample configuration...'));
744
+ return {
745
+ name: 'Full Stack Development Workflow',
746
+ description: 'Complete workflow for setting up a full-stack development environment with React frontend, Node.js backend, and security auditing',
747
+ tags: ['development', 'fullstack', 'react', 'security'],
748
+ version: '1.0.0',
749
+ hash: hash,
750
+ steps: [
751
+ {
752
+ type: 'agent',
753
+ name: 'frontend-developer',
754
+ path: 'development-team/frontend-developer',
755
+ category: 'development-team',
756
+ description: 'Setup React frontend development environment'
757
+ },
758
+ {
759
+ type: 'agent',
760
+ name: 'backend-architect',
761
+ path: 'development-team/backend-architect',
762
+ category: 'development-team',
763
+ description: 'Configure Node.js backend architecture'
764
+ },
765
+ {
766
+ type: 'command',
767
+ name: 'generate-tests',
768
+ path: 'testing/generate-tests',
769
+ category: 'testing',
770
+ description: 'Generate comprehensive test suite'
771
+ },
772
+ {
773
+ type: 'agent',
774
+ name: 'api-security-audit',
775
+ path: 'security/api-security-audit',
776
+ category: 'security',
777
+ description: 'Perform security audit on APIs'
778
+ },
779
+ {
780
+ type: 'mcp',
781
+ name: 'github-integration',
782
+ path: 'integration/github-integration',
783
+ category: 'integration',
784
+ description: 'Setup GitHub integration for repository management'
785
+ }
786
+ ]
787
+ };
788
+ }
789
+
790
+ // This is where we would integrate with a workflow registry API
791
+ // For now, return null to indicate workflow not found for other hashes
792
+ console.log(chalk.yellow('\n⚠️ Workflow registry not yet implemented.'));
793
+ console.log(chalk.gray('To test with demo workflow, use hash: demo123'));
794
+ console.log(chalk.gray('Example: --workflow "#demo123"'));
795
+
796
+ return null;
797
+ }
798
+
799
+ /**
800
+ * Generate workflow YAML from workflow data
801
+ */
802
+ function generateWorkflowYAML(workflowData) {
803
+ const yaml = `#═══════════════════════════════════════════════════════════════════════════════
804
+ # 🤖 CLAUDE CODE WORKFLOW CONFIGURATION
805
+ #═══════════════════════════════════════════════════════════════════════════════
806
+ #
807
+ # WORKFLOW: ${workflowData.name}
808
+ # DESCRIPTION: ${workflowData.description}
809
+ # GENERATED: ${new Date().toISOString()}
810
+ # HASH: ${workflowData.hash || 'generated'}
811
+ #
812
+ #═══════════════════════════════════════════════════════════════════════════════
813
+ # 📋 INSTRUCTIONS FOR CLAUDE CODE
814
+ #═══════════════════════════════════════════════════════════════════════════════
815
+ #
816
+ # This is a WORKFLOW EXECUTION FILE for Claude Code. When you encounter this file,
817
+ # you should execute it as a complete automated workflow. Here's how:
818
+ #
819
+ # 🎯 EXECUTION BEHAVIOR:
820
+ # 1. READ this entire YAML file to understand the workflow structure
821
+ # 2. EXECUTE each step in the exact order listed below (sequential mode)
822
+ # 3. For AGENTS: Use the agent specified to perform the task described
823
+ # 4. For COMMANDS: Execute the Claude Code command as specified
824
+ # 5. For MCPs: Ensure the MCP server is available and use it as needed
825
+ # 6. STOP if any step fails (on_error: stop)
826
+ # 7. PROVIDE progress updates after each step completion
827
+ #
828
+ # 🔧 STEP EXECUTION PATTERN:
829
+ # - Announce: "Executing Step X: [step.name]"
830
+ # - Action: Perform the task using the specified component
831
+ # - Confirm: "✅ Step X completed successfully"
832
+ # - Continue to next step
833
+ #
834
+ # 💡 IMPORTANT NOTES:
835
+ # - All components are already installed in .claude/ directories
836
+ # - Each step builds upon the previous ones
837
+ # - Follow the descriptions exactly as specified
838
+ # - Use confirmation_required: true for user approval before starting
839
+ # - Maintain context and outputs between steps for workflow continuity
840
+ #
841
+ #═══════════════════════════════════════════════════════════════════════════════
842
+
843
+ name: "${workflowData.name}"
844
+ description: "${workflowData.description}"
845
+ tags: [${workflowData.tags.map(tag => `"${tag}"`).join(', ')}]
846
+ version: "${workflowData.version || '1.0.0'}"
847
+
848
+ #═══════════════════════════════════════════════════════════════════════════════
849
+ # 🚀 WORKFLOW STEPS - EXECUTE IN ORDER
850
+ #═══════════════════════════════════════════════════════════════════════════════
851
+
852
+ steps:
853
+ ${workflowData.steps.map((step, index) => ` - step: ${index + 1}
854
+ type: ${step.type}
855
+ name: "${step.name}"
856
+ path: "${step.path}"
857
+ category: "${step.category}"
858
+ description: "${step.description}"
859
+
860
+ # CLAUDE CODE INSTRUCTIONS FOR THIS STEP:
861
+ claude_instructions: |
862
+ Execute this step using the ${step.type} located at .claude/${step.type}s/${step.name}.${step.type === 'mcp' ? 'json' : 'md'}
863
+ Task: ${step.description}
864
+ ${step.type === 'agent' ? 'Use this agent to perform the specified task with full context from previous steps.' : ''}
865
+ ${step.type === 'command' ? 'Execute this command with appropriate parameters based on workflow context.' : ''}
866
+ ${step.type === 'mcp' ? 'Ensure MCP server is running and utilize its capabilities for the task.' : ''}
867
+
868
+ action_template: |
869
+ echo "🔄 Executing Step ${index + 1}: ${step.name}"
870
+ echo "📝 Task: ${step.description}"
871
+ echo "🎯 Using ${step.type}: ${step.path}"
872
+ # [CLAUDE CODE WILL REPLACE THIS WITH ACTUAL EXECUTION]
873
+ echo "✅ Step ${index + 1} completed successfully"
874
+ `).join('\n')}
875
+
876
+ #═══════════════════════════════════════════════════════════════════════════════
877
+ # ⚙️ EXECUTION CONFIGURATION
878
+ #═══════════════════════════════════════════════════════════════════════════════
879
+
880
+ execution:
881
+ mode: "sequential" # Execute steps one by one, in order
882
+ on_error: "stop" # Stop workflow if any step fails
883
+ timeout: 300 # Maximum time per step (5 minutes)
884
+ continue_on_warning: true # Continue if warnings occur
885
+ save_outputs: true # Save outputs between steps for context
886
+
887
+ #═══════════════════════════════════════════════════════════════════════════════
888
+ # 📦 INSTALLED COMPONENTS REFERENCE
889
+ #═══════════════════════════════════════════════════════════════════════════════
890
+
891
+ components:
892
+ agents: [${workflowData.steps.filter(s => s.type === 'agent').map(s => `"${s.path}"`).join(', ')}]
893
+ commands: [${workflowData.steps.filter(s => s.type === 'command').map(s => `"${s.path}"`).join(', ')}]
894
+ mcps: [${workflowData.steps.filter(s => s.type === 'mcp').map(s => `"${s.path}"`).join(', ')}]
895
+
896
+ #═══════════════════════════════════════════════════════════════════════════════
897
+ # 🤖 CLAUDE CODE INTEGRATION SETTINGS
898
+ #═══════════════════════════════════════════════════════════════════════════════
899
+
900
+ claudecode:
901
+ workflow_mode: true # Enable workflow execution mode
902
+ auto_execute: false # Require user confirmation before starting
903
+ confirmation_required: true # Ask user before each step
904
+ show_progress: true # Display progress indicators
905
+ save_context: true # Maintain context between steps
906
+
907
+ # WORKFLOW EXECUTION INSTRUCTIONS FOR CLAUDE:
908
+ execution_instructions: |
909
+ When executing this workflow:
910
+
911
+ 1. 🎯 PREPARATION PHASE:
912
+ - Confirm all components are installed in .claude/ directories
913
+ - Verify user wants to execute this workflow
914
+ - Explain what will happen in each step
915
+
916
+ 2. 🚀 EXECUTION PHASE:
917
+ - Execute each step sequentially
918
+ - Use the exact agent/command/mcp specified for each step
919
+ - Maintain outputs and context between steps
920
+ - Provide clear progress updates
921
+
922
+ 3. ✅ COMPLETION PHASE:
923
+ - Summarize what was accomplished
924
+ - Highlight any outputs or files created
925
+ - Suggest next steps if applicable
926
+
927
+ 4. ❌ ERROR HANDLING:
928
+ - If a step fails, stop execution immediately
929
+ - Provide clear error message and suggested fixes
930
+ - Offer to retry the failed step after fixes
931
+
932
+ Remember: This workflow was designed to work as a complete automation.
933
+ Each step builds upon the previous ones. Execute with confidence!
934
+
935
+ #═══════════════════════════════════════════════════════════════════════════════
936
+ # 📋 WORKFLOW SUMMARY
937
+ #═══════════════════════════════════════════════════════════════════════════════
938
+ #
939
+ # This workflow will execute ${workflowData.steps.length} steps in sequence:
940
+ ${workflowData.steps.map((step, index) => `# ${index + 1}. ${step.description} (${step.type}: ${step.name})`).join('\n')}
941
+ #
942
+ # Total estimated time: ${Math.ceil(workflowData.steps.length * 2)} minutes
943
+ # Components required: ${workflowData.steps.filter(s => s.type === 'agent').length} agents, ${workflowData.steps.filter(s => s.type === 'command').length} commands, ${workflowData.steps.filter(s => s.type === 'mcp').length} MCPs
944
+ #═══════════════════════════════════════════════════════════════════════════════
945
+ `;
946
+
947
+ return yaml;
948
+ }
949
+
612
950
  module.exports = { createClaudeConfig, showMainMenu };
@@ -1,239 +0,0 @@
1
- # Git Workflow Helper
2
-
3
- Manage Git workflows with best practices and common operations.
4
-
5
- ## Purpose
6
-
7
- This command helps you perform common Git operations following best practices for collaborative development.
8
-
9
- ## Usage
10
-
11
- ```
12
- /git-workflow
13
- ```
14
-
15
- ## What this command does
16
-
17
- 1. **Guides through Git operations** with proper workflow
18
- 2. **Suggests best practices** for commits and branches
19
- 3. **Helps with conflict resolution** and merging
20
- 4. **Provides templates** for commit messages
21
- 5. **Manages branching strategies** (Git Flow, GitHub Flow)
22
-
23
- ## Common Workflows
24
-
25
- ### Feature Development
26
- ```bash
27
- # Create and switch to feature branch
28
- git checkout -b feature/user-authentication
29
-
30
- # Work on your feature
31
- # ... make changes ...
32
-
33
- # Stage and commit changes
34
- git add .
35
- git commit -m "feat: add user authentication system
36
-
37
- - Implement login/logout functionality
38
- - Add password validation
39
- - Create user session management
40
- - Add authentication middleware"
41
-
42
- # Push feature branch
43
- git push -u origin feature/user-authentication
44
-
45
- # Create pull request (via GitHub/GitLab interface)
46
- ```
47
-
48
- ### Hotfix Workflow
49
- ```bash
50
- # Create hotfix branch from main
51
- git checkout main
52
- git checkout -b hotfix/security-patch
53
-
54
- # Fix the issue
55
- # ... make changes ...
56
-
57
- # Commit the fix
58
- git commit -m "fix: resolve security vulnerability in auth module
59
-
60
- - Patch XSS vulnerability in login form
61
- - Update input validation
62
- - Add CSRF protection"
63
-
64
- # Push and create urgent PR
65
- git push -u origin hotfix/security-patch
66
- ```
67
-
68
- ### Sync with Remote
69
- ```bash
70
- # Update main branch
71
- git checkout main
72
- git pull origin main
73
-
74
- # Update feature branch with latest main
75
- git checkout feature/your-feature
76
- git rebase main
77
- # OR
78
- git merge main
79
- ```
80
-
81
- ## Commit Message Conventions
82
-
83
- ### Conventional Commits Format
84
- ```
85
- <type>[optional scope]: <description>
86
-
87
- [optional body]
88
-
89
- [optional footer(s)]
90
- ```
91
-
92
- ### Common Types
93
- - **feat**: New feature
94
- - **fix**: Bug fix
95
- - **docs**: Documentation changes
96
- - **style**: Code style changes (formatting, etc.)
97
- - **refactor**: Code refactoring
98
- - **test**: Adding or updating tests
99
- - **chore**: Maintenance tasks
100
-
101
- ### Examples
102
- ```bash
103
- # Feature
104
- git commit -m "feat(auth): add OAuth2 integration"
105
-
106
- # Bug fix
107
- git commit -m "fix(api): handle null response in user endpoint"
108
-
109
- # Documentation
110
- git commit -m "docs: update API documentation for v2.0"
111
-
112
- # Breaking change
113
- git commit -m "feat!: change API response format
114
-
115
- BREAKING CHANGE: API responses now use 'data' wrapper"
116
- ```
117
-
118
- ## Branch Management
119
-
120
- ### Git Flow Strategy
121
- ```bash
122
- # Main branches
123
- main # Production-ready code
124
- develop # Integration branch
125
-
126
- # Supporting branches
127
- feature/* # New features
128
- release/* # Release preparation
129
- hotfix/* # Quick fixes to production
130
- ```
131
-
132
- ### GitHub Flow (Simplified)
133
- ```bash
134
- # Only main branch + feature branches
135
- main # Production-ready code
136
- feature/* # All new work
137
- ```
138
-
139
- ## Conflict Resolution
140
-
141
- ### When Conflicts Occur
142
- ```bash
143
- # Start merge/rebase
144
- git merge feature-branch
145
- # OR
146
- git rebase main
147
-
148
- # If conflicts occur, Git will list conflicted files
149
- # Edit each file to resolve conflicts
150
-
151
- # Mark conflicts as resolved
152
- git add conflicted-file.js
153
-
154
- # Continue the merge/rebase
155
- git merge --continue
156
- # OR
157
- git rebase --continue
158
- ```
159
-
160
- ### Conflict Markers
161
- ```javascript
162
- <<<<<<< HEAD
163
- // Your current branch code
164
- const user = getCurrentUser();
165
- =======
166
- // Incoming branch code
167
- const user = getAuthenticatedUser();
168
- >>>>>>> feature-branch
169
- ```
170
-
171
- ## Useful Git Commands
172
-
173
- ### Status and Information
174
- ```bash
175
- git status # Check working directory status
176
- git log --oneline # View commit history
177
- git branch -a # List all branches
178
- git remote -v # List remote repositories
179
- ```
180
-
181
- ### Undoing Changes
182
- ```bash
183
- git checkout -- file.js # Discard changes to file
184
- git reset HEAD file.js # Unstage file
185
- git reset --soft HEAD~1 # Undo last commit (keep changes)
186
- git reset --hard HEAD~1 # Undo last commit (discard changes)
187
- ```
188
-
189
- ### Stashing Work
190
- ```bash
191
- git stash # Save current work
192
- git stash pop # Apply and remove latest stash
193
- git stash list # List all stashes
194
- git stash apply stash@{1} # Apply specific stash
195
- ```
196
-
197
- ## Best Practices
198
-
199
- 1. **Commit Often** - Make small, focused commits
200
- 2. **Write Clear Messages** - Use conventional commit format
201
- 3. **Test Before Committing** - Ensure code works
202
- 4. **Pull Before Push** - Keep history clean
203
- 5. **Use Branches** - Don't work directly on main
204
- 6. **Review Code** - Use pull requests for collaboration
205
- 7. **Keep History Clean** - Rebase feature branches when appropriate
206
-
207
- ## Git Hooks (Optional)
208
-
209
- ### Pre-commit Hook
210
- ```bash
211
- #!/bin/sh
212
- # .git/hooks/pre-commit
213
-
214
- # Run linter
215
- npm run lint
216
- if [ $? -ne 0 ]; then
217
- echo "Linting failed. Please fix errors before committing."
218
- exit 1
219
- fi
220
-
221
- # Run tests
222
- npm test
223
- if [ $? -ne 0 ]; then
224
- echo "Tests failed. Please fix tests before committing."
225
- exit 1
226
- fi
227
- ```
228
-
229
- ### Commit Message Hook
230
- ```bash
231
- #!/bin/sh
232
- # .git/hooks/commit-msg
233
-
234
- # Check commit message format
235
- if ! grep -qE "^(feat|fix|docs|style|refactor|test|chore)(\(.+\))?: .{1,50}" "$1"; then
236
- echo "Invalid commit message format. Use conventional commits."
237
- exit 1
238
- fi
239
- ```