claude-code-templates 1.16.1 → 1.17.0

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 (101) hide show
  1. package/README.md +7 -7
  2. package/bin/create-claude-config.js +17 -8
  3. package/package.json +2 -3
  4. package/src/analytics/core/AgentAnalyzer.js +17 -3
  5. package/src/analytics/core/ProcessDetector.js +23 -7
  6. package/src/analytics/core/StateCalculator.js +102 -33
  7. package/src/analytics/data/DataCache.js +7 -7
  8. package/src/analytics-web/chats_mobile.html +2590 -0
  9. package/src/analytics-web/components/App.js +10 -10
  10. package/src/analytics-web/components/SessionTimer.js +1 -1
  11. package/src/analytics-web/components/Sidebar.js +5 -14
  12. package/src/analytics-web/index.html +932 -78
  13. package/src/analytics.js +263 -5
  14. package/src/chats-mobile.js +682 -0
  15. package/src/claude-api-proxy.js +460 -0
  16. package/src/file-operations.js +239 -36
  17. package/src/health-check.js +310 -0
  18. package/src/index.js +1245 -36
  19. package/src/tracking-service.js +31 -34
  20. package/components/agents/api-security-audit.md +0 -92
  21. package/components/agents/database-optimization.md +0 -94
  22. package/components/agents/react-performance-optimization.md +0 -64
  23. package/components/commands/check-file.md +0 -53
  24. package/components/commands/generate-tests.md +0 -68
  25. package/components/mcps/deepgraph-nextjs.json +0 -12
  26. package/components/mcps/deepgraph-react.json +0 -12
  27. package/components/mcps/deepgraph-typescript.json +0 -12
  28. package/components/mcps/deepgraph-vue.json +0 -12
  29. package/components/mcps/filesystem-access.json +0 -12
  30. package/components/mcps/github-integration.json +0 -11
  31. package/components/mcps/memory-integration.json +0 -8
  32. package/components/mcps/mysql-integration.json +0 -11
  33. package/components/mcps/postgresql-integration.json +0 -11
  34. package/components/mcps/web-fetch.json +0 -8
  35. package/src/analytics-web/components/AgentsPage.js +0 -4761
  36. package/templates/common/.claude/commands/git-workflow.md +0 -239
  37. package/templates/common/.claude/commands/project-setup.md +0 -316
  38. package/templates/common/.mcp.json +0 -41
  39. package/templates/common/CLAUDE.md +0 -109
  40. package/templates/common/README.md +0 -96
  41. package/templates/go/.mcp.json +0 -78
  42. package/templates/go/README.md +0 -25
  43. package/templates/javascript-typescript/.claude/commands/api-endpoint.md +0 -51
  44. package/templates/javascript-typescript/.claude/commands/debug.md +0 -52
  45. package/templates/javascript-typescript/.claude/commands/lint.md +0 -48
  46. package/templates/javascript-typescript/.claude/commands/npm-scripts.md +0 -48
  47. package/templates/javascript-typescript/.claude/commands/refactor.md +0 -55
  48. package/templates/javascript-typescript/.claude/commands/test.md +0 -61
  49. package/templates/javascript-typescript/.claude/commands/typescript-migrate.md +0 -51
  50. package/templates/javascript-typescript/.claude/settings.json +0 -142
  51. package/templates/javascript-typescript/.mcp.json +0 -80
  52. package/templates/javascript-typescript/CLAUDE.md +0 -185
  53. package/templates/javascript-typescript/README.md +0 -259
  54. package/templates/javascript-typescript/examples/angular-app/.claude/commands/components.md +0 -63
  55. package/templates/javascript-typescript/examples/angular-app/.claude/commands/services.md +0 -62
  56. package/templates/javascript-typescript/examples/node-api/.claude/commands/api-endpoint.md +0 -46
  57. package/templates/javascript-typescript/examples/node-api/.claude/commands/database.md +0 -56
  58. package/templates/javascript-typescript/examples/node-api/.claude/commands/middleware.md +0 -61
  59. package/templates/javascript-typescript/examples/node-api/.claude/commands/route.md +0 -57
  60. package/templates/javascript-typescript/examples/node-api/CLAUDE.md +0 -102
  61. package/templates/javascript-typescript/examples/react-app/.claude/commands/component.md +0 -29
  62. package/templates/javascript-typescript/examples/react-app/.claude/commands/hooks.md +0 -44
  63. package/templates/javascript-typescript/examples/react-app/.claude/commands/state-management.md +0 -45
  64. package/templates/javascript-typescript/examples/react-app/CLAUDE.md +0 -81
  65. package/templates/javascript-typescript/examples/react-app/agents/react-performance-optimization.md +0 -530
  66. package/templates/javascript-typescript/examples/react-app/agents/react-state-management.md +0 -295
  67. package/templates/javascript-typescript/examples/vue-app/.claude/commands/components.md +0 -46
  68. package/templates/javascript-typescript/examples/vue-app/.claude/commands/composables.md +0 -51
  69. package/templates/python/.claude/commands/lint.md +0 -111
  70. package/templates/python/.claude/commands/test.md +0 -73
  71. package/templates/python/.claude/settings.json +0 -153
  72. package/templates/python/.mcp.json +0 -78
  73. package/templates/python/CLAUDE.md +0 -276
  74. package/templates/python/examples/django-app/.claude/commands/admin.md +0 -264
  75. package/templates/python/examples/django-app/.claude/commands/django-model.md +0 -124
  76. package/templates/python/examples/django-app/.claude/commands/views.md +0 -222
  77. package/templates/python/examples/django-app/CLAUDE.md +0 -313
  78. package/templates/python/examples/django-app/agents/django-api-security.md +0 -642
  79. package/templates/python/examples/django-app/agents/django-database-optimization.md +0 -752
  80. package/templates/python/examples/fastapi-app/.claude/commands/api-endpoints.md +0 -513
  81. package/templates/python/examples/fastapi-app/.claude/commands/auth.md +0 -775
  82. package/templates/python/examples/fastapi-app/.claude/commands/database.md +0 -657
  83. package/templates/python/examples/fastapi-app/.claude/commands/deployment.md +0 -160
  84. package/templates/python/examples/fastapi-app/.claude/commands/testing.md +0 -927
  85. package/templates/python/examples/fastapi-app/CLAUDE.md +0 -229
  86. package/templates/python/examples/flask-app/.claude/commands/app-factory.md +0 -384
  87. package/templates/python/examples/flask-app/.claude/commands/blueprint.md +0 -243
  88. package/templates/python/examples/flask-app/.claude/commands/database.md +0 -410
  89. package/templates/python/examples/flask-app/.claude/commands/deployment.md +0 -620
  90. package/templates/python/examples/flask-app/.claude/commands/flask-route.md +0 -217
  91. package/templates/python/examples/flask-app/.claude/commands/testing.md +0 -559
  92. package/templates/python/examples/flask-app/CLAUDE.md +0 -391
  93. package/templates/ruby/.claude/commands/model.md +0 -360
  94. package/templates/ruby/.claude/commands/test.md +0 -480
  95. package/templates/ruby/.claude/settings.json +0 -146
  96. package/templates/ruby/.mcp.json +0 -83
  97. package/templates/ruby/CLAUDE.md +0 -284
  98. package/templates/ruby/examples/rails-app/.claude/commands/authentication.md +0 -490
  99. package/templates/ruby/examples/rails-app/CLAUDE.md +0 -376
  100. package/templates/rust/.mcp.json +0 -78
  101. package/templates/rust/README.md +0 -26
@@ -16,7 +16,9 @@ class HealthChecker {
16
16
  system: [],
17
17
  claudeCode: [],
18
18
  project: [],
19
+ agents: [],
19
20
  commands: [],
21
+ mcps: [],
20
22
  hooks: []
21
23
  };
22
24
  this.totalChecks = 0;
@@ -42,6 +44,14 @@ class HealthChecker {
42
44
  await this.checkProjectSetupWithSpinner();
43
45
  await this.sleep(3000);
44
46
 
47
+ // Agents check
48
+ await this.checkAgentsWithSpinner();
49
+ await this.sleep(3000);
50
+
51
+ // MCP servers check
52
+ await this.checkMCPServersWithSpinner();
53
+ await this.sleep(3000);
54
+
45
55
  // Custom commands check
46
56
  await this.checkCustomCommandsWithSpinner();
47
57
  await this.sleep(3000);
@@ -165,6 +175,54 @@ class HealthChecker {
165
175
  localSettingsSpinner.succeed(`${this.getStatusIcon(localSettingsInfo.status)} Local Settings │ ${localSettingsInfo.message}`);
166
176
  }
167
177
 
178
+ /**
179
+ * Check agents with spinner and immediate results
180
+ */
181
+ async checkAgentsWithSpinner() {
182
+ console.log(chalk.cyan('\n┌──────────┐'));
183
+ console.log(chalk.cyan('│ AGENTS │'));
184
+ console.log(chalk.cyan('└──────────┘'));
185
+
186
+ // Project agents
187
+ const projectSpinner = ora('Scanning Project Agents...').start();
188
+ const projectAgents = this.checkProjectAgents();
189
+ this.addResult('agents', 'Project Agents', projectAgents.status, projectAgents.message);
190
+ projectSpinner.succeed(`${this.getStatusIcon(projectAgents.status)} Project Agents │ ${projectAgents.message}`);
191
+
192
+ // Personal agents
193
+ const personalSpinner = ora('Scanning Personal Agents...').start();
194
+ const personalAgents = this.checkPersonalAgents();
195
+ this.addResult('agents', 'Personal Agents', personalAgents.status, personalAgents.message);
196
+ personalSpinner.succeed(`${this.getStatusIcon(personalAgents.status)} Personal Agents │ ${personalAgents.message}`);
197
+
198
+ // Agent syntax validation
199
+ const syntaxSpinner = ora('Validating Agent Syntax...').start();
200
+ const syntaxInfo = this.checkAgentSyntax();
201
+ this.addResult('agents', 'Agent Syntax', syntaxInfo.status, syntaxInfo.message);
202
+ syntaxSpinner.succeed(`${this.getStatusIcon(syntaxInfo.status)} Agent Syntax │ ${syntaxInfo.message}`);
203
+ }
204
+
205
+ /**
206
+ * Check MCP servers with spinner and immediate results
207
+ */
208
+ async checkMCPServersWithSpinner() {
209
+ console.log(chalk.cyan('\n┌──────────────┐'));
210
+ console.log(chalk.cyan('│ MCP SERVERS │'));
211
+ console.log(chalk.cyan('└──────────────┘'));
212
+
213
+ // Project MCP configuration
214
+ const projectMCPSpinner = ora('Scanning Project MCP Configuration...').start();
215
+ const projectMCP = this.checkProjectMCPConfiguration();
216
+ this.addResult('mcps', 'Project MCP Config', projectMCP.status, projectMCP.message);
217
+ projectMCPSpinner.succeed(`${this.getStatusIcon(projectMCP.status)} Project MCP Config │ ${projectMCP.message}`);
218
+
219
+ // MCP configuration validation
220
+ const mcpValidationSpinner = ora('Validating MCP Configuration...').start();
221
+ const mcpValidation = this.checkMCPConfigurationSyntax();
222
+ this.addResult('mcps', 'MCP Config Syntax', mcpValidation.status, mcpValidation.message);
223
+ mcpValidationSpinner.succeed(`${this.getStatusIcon(mcpValidation.status)} MCP Config Syntax │ ${mcpValidation.message}`);
224
+ }
225
+
168
226
  /**
169
227
  * Check custom commands with spinner and immediate results
170
228
  */
@@ -552,6 +610,123 @@ class HealthChecker {
552
610
  }
553
611
  }
554
612
 
613
+ checkProjectMCPConfiguration() {
614
+ const currentDir = process.cwd();
615
+ const mcpConfigPath = path.join(currentDir, '.mcp.json');
616
+
617
+ if (fs.existsSync(mcpConfigPath)) {
618
+ try {
619
+ const mcpConfig = JSON.parse(fs.readFileSync(mcpConfigPath, 'utf8'));
620
+
621
+ if (mcpConfig.mcpServers && typeof mcpConfig.mcpServers === 'object') {
622
+ const serverCount = Object.keys(mcpConfig.mcpServers).length;
623
+ return {
624
+ status: 'pass',
625
+ message: `${serverCount} MCP servers configured in .mcp.json`
626
+ };
627
+ } else {
628
+ return {
629
+ status: 'warn',
630
+ message: 'No mcpServers found in .mcp.json'
631
+ };
632
+ }
633
+ } catch (error) {
634
+ return {
635
+ status: 'fail',
636
+ message: 'Invalid JSON syntax in .mcp.json'
637
+ };
638
+ }
639
+ } else {
640
+ return {
641
+ status: 'warn',
642
+ message: 'No project MCP configuration found (.mcp.json)'
643
+ };
644
+ }
645
+ }
646
+
647
+ checkMCPConfigurationSyntax() {
648
+ const configPaths = [
649
+ path.join(process.cwd(), '.mcp.json')
650
+ ];
651
+
652
+ let totalServers = 0;
653
+ let validServers = 0;
654
+ let invalidServers = 0;
655
+ const issues = [];
656
+
657
+ for (const configPath of configPaths) {
658
+ if (fs.existsSync(configPath)) {
659
+ try {
660
+ const mcpConfig = JSON.parse(fs.readFileSync(configPath, 'utf8'));
661
+
662
+ if (mcpConfig.mcpServers && typeof mcpConfig.mcpServers === 'object') {
663
+ const servers = mcpConfig.mcpServers;
664
+
665
+ for (const [serverName, serverConfig] of Object.entries(servers)) {
666
+ totalServers++;
667
+
668
+ // Validate server configuration structure
669
+ if (!serverConfig || typeof serverConfig !== 'object') {
670
+ invalidServers++;
671
+ issues.push(`Invalid server config for ${serverName} in ${path.basename(configPath)}`);
672
+ continue;
673
+ }
674
+
675
+ // Check required fields
676
+ if (!serverConfig.command) {
677
+ invalidServers++;
678
+ issues.push(`Missing command for ${serverName} in ${path.basename(configPath)}`);
679
+ continue;
680
+ }
681
+
682
+ // Optional: Check if args is array when present
683
+ if (serverConfig.args && !Array.isArray(serverConfig.args)) {
684
+ invalidServers++;
685
+ issues.push(`Invalid args format for ${serverName} in ${path.basename(configPath)} (should be array)`);
686
+ continue;
687
+ }
688
+
689
+ // Optional: Check if env is object when present
690
+ if (serverConfig.env && typeof serverConfig.env !== 'object') {
691
+ invalidServers++;
692
+ issues.push(`Invalid env format for ${serverName} in ${path.basename(configPath)} (should be object)`);
693
+ continue;
694
+ }
695
+
696
+ validServers++;
697
+ }
698
+ }
699
+ } catch (error) {
700
+ // JSON parsing error already handled in other checks
701
+ }
702
+ }
703
+ }
704
+
705
+ if (totalServers === 0) {
706
+ return {
707
+ status: 'warn',
708
+ message: 'No MCP servers configured'
709
+ };
710
+ }
711
+
712
+ if (invalidServers === 0) {
713
+ return {
714
+ status: 'pass',
715
+ message: `All ${totalServers} MCP server configurations are valid`
716
+ };
717
+ } else if (validServers > 0) {
718
+ return {
719
+ status: 'warn',
720
+ message: `${validServers}/${totalServers} MCP servers valid, ${invalidServers} issues found`
721
+ };
722
+ } else {
723
+ return {
724
+ status: 'fail',
725
+ message: `All ${totalServers} MCP server configurations have issues`
726
+ };
727
+ }
728
+ }
729
+
555
730
  checkProjectCommands() {
556
731
  const currentDir = process.cwd();
557
732
  const commandsDir = path.join(currentDir, '.claude', 'commands');
@@ -625,6 +800,129 @@ class HealthChecker {
625
800
  }
626
801
  }
627
802
 
803
+ checkProjectAgents() {
804
+ const currentDir = process.cwd();
805
+ const agentsDir = path.join(currentDir, '.claude', 'agents');
806
+
807
+ if (fs.existsSync(agentsDir)) {
808
+ const agents = this.countAgentsRecursively(agentsDir);
809
+ return {
810
+ status: 'pass',
811
+ message: `${agents} agents found in .claude/agents/`
812
+ };
813
+ } else {
814
+ return {
815
+ status: 'warn',
816
+ message: 'No project agents directory found'
817
+ };
818
+ }
819
+ }
820
+
821
+ checkPersonalAgents() {
822
+ const homeDir = os.homedir();
823
+ const agentsDir = path.join(homeDir, '.claude', 'agents');
824
+
825
+ if (fs.existsSync(agentsDir)) {
826
+ const agents = this.countAgentsRecursively(agentsDir);
827
+ return {
828
+ status: 'pass',
829
+ message: `${agents} agents found in ~/.claude/agents/`
830
+ };
831
+ } else {
832
+ return {
833
+ status: 'warn',
834
+ message: 'No personal agents directory found'
835
+ };
836
+ }
837
+ }
838
+
839
+ countAgentsRecursively(dir) {
840
+ let count = 0;
841
+ try {
842
+ const items = fs.readdirSync(dir);
843
+ for (const item of items) {
844
+ const itemPath = path.join(dir, item);
845
+ const stat = fs.statSync(itemPath);
846
+ if (stat.isDirectory()) {
847
+ count += this.countAgentsRecursively(itemPath);
848
+ } else if (item.endsWith('.md')) {
849
+ count++;
850
+ }
851
+ }
852
+ } catch (error) {
853
+ // Handle permission or access errors
854
+ }
855
+ return count;
856
+ }
857
+
858
+ checkAgentSyntax() {
859
+ const currentDir = process.cwd();
860
+ const agentsDir = path.join(currentDir, '.claude', 'agents');
861
+
862
+ if (!fs.existsSync(agentsDir)) {
863
+ return {
864
+ status: 'warn',
865
+ message: 'No agents to validate'
866
+ };
867
+ }
868
+
869
+ const agents = this.getAgentFilesRecursively(agentsDir);
870
+ let issuesFound = 0;
871
+ let agentsChecked = 0;
872
+
873
+ for (const agentPath of agents) {
874
+ try {
875
+ const content = fs.readFileSync(agentPath, 'utf8');
876
+ agentsChecked++;
877
+
878
+ // Check for frontmatter (agent metadata)
879
+ if (!content.includes('---') || !content.includes('name:') || !content.includes('description:')) {
880
+ issuesFound++;
881
+ }
882
+ } catch (error) {
883
+ issuesFound++;
884
+ }
885
+ }
886
+
887
+ if (agentsChecked === 0) {
888
+ return {
889
+ status: 'warn',
890
+ message: 'No agents to validate'
891
+ };
892
+ }
893
+
894
+ if (issuesFound === 0) {
895
+ return {
896
+ status: 'pass',
897
+ message: `All ${agentsChecked} agents have proper syntax`
898
+ };
899
+ } else {
900
+ return {
901
+ status: 'warn',
902
+ message: `${issuesFound}/${agentsChecked} agents missing proper frontmatter`
903
+ };
904
+ }
905
+ }
906
+
907
+ getAgentFilesRecursively(dir) {
908
+ let files = [];
909
+ try {
910
+ const items = fs.readdirSync(dir);
911
+ for (const item of items) {
912
+ const itemPath = path.join(dir, item);
913
+ const stat = fs.statSync(itemPath);
914
+ if (stat.isDirectory()) {
915
+ files = files.concat(this.getAgentFilesRecursively(itemPath));
916
+ } else if (item.endsWith('.md')) {
917
+ files.push(itemPath);
918
+ }
919
+ }
920
+ } catch (error) {
921
+ // Handle permission or access errors
922
+ }
923
+ return files;
924
+ }
925
+
628
926
  checkUserHooks() {
629
927
  const homeDir = os.homedir();
630
928
  const settingsPath = path.join(homeDir, '.claude', 'settings.json');
@@ -1041,7 +1339,9 @@ class HealthChecker {
1041
1339
  ...this.results.system,
1042
1340
  ...this.results.claudeCode,
1043
1341
  ...this.results.project,
1342
+ ...this.results.agents,
1044
1343
  ...this.results.commands,
1344
+ ...this.results.mcps,
1045
1345
  ...this.results.hooks
1046
1346
  ];
1047
1347
 
@@ -1052,6 +1352,16 @@ class HealthChecker {
1052
1352
  recommendations.push('Consider switching to Zsh for better autocompletion and features');
1053
1353
  } else if (result.check === 'Command Syntax' && result.message.includes('$ARGUMENTS')) {
1054
1354
  recommendations.push('Add $ARGUMENTS placeholder to command files for proper parameter handling');
1355
+ } else if (result.check === 'Agent Syntax' && result.message.includes('frontmatter')) {
1356
+ recommendations.push('Add proper frontmatter (name, description) to agent files');
1357
+ } else if (result.check === 'Project Agents' && result.message.includes('No project agents directory')) {
1358
+ recommendations.push('Create .claude/agents/ directory to organize your custom agents');
1359
+ } else if (result.check === 'Project MCP Config' && result.message.includes('No project MCP configuration')) {
1360
+ recommendations.push('Create .mcp.json file to configure MCP servers for your project');
1361
+ } else if (result.check === 'MCP Config Syntax' && result.message.includes('Invalid JSON')) {
1362
+ recommendations.push('Fix JSON syntax errors in MCP configuration files');
1363
+ } else if (result.check === 'MCP Config Syntax' && result.message.includes('Missing command')) {
1364
+ recommendations.push('Add missing command fields to MCP server configurations');
1055
1365
  } else if (result.check === 'Local Hooks' && result.message.includes('Invalid JSON')) {
1056
1366
  recommendations.push('Fix JSON syntax error in .claude/settings.local.json');
1057
1367
  }