claude-code-templates 1.1.0 → 1.1.1
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.
- package/package.json +7 -2
- package/scripts/sync-templates.js +182 -0
- package/templates/go/README.md +25 -0
- package/templates/javascript-typescript/.claude/commands/api-endpoint.md +51 -1
- package/templates/javascript-typescript/.claude/commands/debug.md +52 -1
- package/templates/javascript-typescript/.claude/commands/lint.md +48 -1
- package/templates/javascript-typescript/.claude/commands/npm-scripts.md +48 -1
- package/templates/javascript-typescript/.claude/commands/react-component.md +54 -1
- package/templates/javascript-typescript/.claude/commands/refactor.md +55 -1
- package/templates/javascript-typescript/.claude/commands/test.md +61 -1
- package/templates/javascript-typescript/.claude/commands/typescript-migrate.md +51 -1
- package/templates/javascript-typescript/.claude/settings.json +41 -2
- package/templates/javascript-typescript/.mcp.json +13 -0
- package/templates/javascript-typescript/README.md +213 -187
- package/templates/rust/README.md +26 -0
- package/templates/javascript-typescript/.claude/hooks/format-on-save.json +0 -1
- package/templates/javascript-typescript/.claude/hooks/lint-on-save.json +0 -1
- package/templates/javascript-typescript/.claude/hooks/typescript-check.json +0 -1
- package/templates/javascript-typescript/examples/node-api/.claude/commands/middleware.md +0 -1
- package/templates/javascript-typescript/examples/node-api/.claude/commands/route.md +0 -1
- package/templates/javascript-typescript/examples/node-api/CLAUDE.md +0 -1
- package/templates/javascript-typescript/examples/react-app/.claude/commands/component.md +0 -1
- package/templates/javascript-typescript/examples/react-app/.claude/commands/hooks.md +0 -1
- package/templates/javascript-typescript/examples/react-app/CLAUDE.md +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-templates",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "CLI tool to setup Claude Code configurations for different programming languages",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,11 @@
|
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"start": "node bin/create-claude-config.js",
|
|
14
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
14
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
15
|
+
"sync": "node scripts/sync-templates.js",
|
|
16
|
+
"presync": "echo \"🔄 Iniciando sincronización de plantillas...\"",
|
|
17
|
+
"postsync": "echo \"✅ Sincronización completada. Listo para publicar!\"",
|
|
18
|
+
"prepublishOnly": "npm run sync"
|
|
15
19
|
},
|
|
16
20
|
"keywords": [
|
|
17
21
|
"claude",
|
|
@@ -46,6 +50,7 @@
|
|
|
46
50
|
"files": [
|
|
47
51
|
"bin/",
|
|
48
52
|
"src/",
|
|
53
|
+
"scripts/",
|
|
49
54
|
"templates/",
|
|
50
55
|
"README.md"
|
|
51
56
|
]
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs-extra');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const chalk = require('chalk');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Script para sincronizar las plantillas desde las carpetas root
|
|
9
|
+
* hacia cli-tool/templates/
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
async function syncTemplates() {
|
|
13
|
+
console.log(chalk.blue('🔄 Sincronizando plantillas...'));
|
|
14
|
+
|
|
15
|
+
const rootDir = path.join(__dirname, '..', '..');
|
|
16
|
+
const templatesDir = path.join(__dirname, '..', 'templates');
|
|
17
|
+
|
|
18
|
+
// Lenguajes a sincronizar
|
|
19
|
+
const languages = ['common', 'javascript-typescript', 'python', 'rust', 'go'];
|
|
20
|
+
|
|
21
|
+
let totalCopied = 0;
|
|
22
|
+
let totalSkipped = 0;
|
|
23
|
+
|
|
24
|
+
for (const language of languages) {
|
|
25
|
+
const sourceDir = path.join(rootDir, language);
|
|
26
|
+
const targetDir = path.join(templatesDir, language);
|
|
27
|
+
|
|
28
|
+
if (!await fs.pathExists(sourceDir)) {
|
|
29
|
+
console.log(chalk.yellow(`⚠️ Carpeta source no existe: ${language}`));
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
console.log(chalk.cyan(`\n📂 Sincronizando ${language}...`));
|
|
34
|
+
|
|
35
|
+
// Limpiar directorio destino
|
|
36
|
+
if (await fs.pathExists(targetDir)) {
|
|
37
|
+
await fs.remove(targetDir);
|
|
38
|
+
console.log(chalk.gray(` 🗑️ Directorio anterior eliminado`));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Copiar todo desde source
|
|
42
|
+
try {
|
|
43
|
+
await fs.copy(sourceDir, targetDir, {
|
|
44
|
+
filter: (src, dest) => {
|
|
45
|
+
// Filtrar archivos que no queremos copiar
|
|
46
|
+
const relativePath = path.relative(sourceDir, src);
|
|
47
|
+
|
|
48
|
+
// Excluir directorios y archivos específicos
|
|
49
|
+
if (relativePath.includes('node_modules')) return false;
|
|
50
|
+
if (relativePath.includes('.git')) return false;
|
|
51
|
+
if (relativePath.includes('package-lock.json')) return false;
|
|
52
|
+
if (relativePath.endsWith('.log')) return false;
|
|
53
|
+
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Contar archivos copiados
|
|
59
|
+
const stats = await getDirectoryStats(targetDir);
|
|
60
|
+
totalCopied += stats.files;
|
|
61
|
+
|
|
62
|
+
console.log(chalk.green(` ✅ ${stats.files} archivos copiados`));
|
|
63
|
+
|
|
64
|
+
// Mostrar estructura copiada
|
|
65
|
+
if (stats.files > 0) {
|
|
66
|
+
await showDirectoryStructure(targetDir, ' ');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
} catch (error) {
|
|
70
|
+
console.error(chalk.red(` ❌ Error copiando ${language}:`), error.message);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
console.log(chalk.green(`\n🎉 Sincronización completada!`));
|
|
75
|
+
console.log(chalk.white(`📊 Total de archivos sincronizados: ${totalCopied}`));
|
|
76
|
+
|
|
77
|
+
// Verificar que no existan archivos hooks
|
|
78
|
+
await cleanupOldReferences();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function getDirectoryStats(dir) {
|
|
82
|
+
let files = 0;
|
|
83
|
+
let dirs = 0;
|
|
84
|
+
|
|
85
|
+
if (!await fs.pathExists(dir)) {
|
|
86
|
+
return { files: 0, dirs: 0 };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const items = await fs.readdir(dir);
|
|
90
|
+
|
|
91
|
+
for (const item of items) {
|
|
92
|
+
const itemPath = path.join(dir, item);
|
|
93
|
+
const stat = await fs.stat(itemPath);
|
|
94
|
+
|
|
95
|
+
if (stat.isDirectory()) {
|
|
96
|
+
dirs++;
|
|
97
|
+
const subStats = await getDirectoryStats(itemPath);
|
|
98
|
+
files += subStats.files;
|
|
99
|
+
dirs += subStats.dirs;
|
|
100
|
+
} else {
|
|
101
|
+
files++;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return { files, dirs };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async function showDirectoryStructure(dir, prefix = '') {
|
|
109
|
+
const items = await fs.readdir(dir);
|
|
110
|
+
|
|
111
|
+
for (let i = 0; i < items.length; i++) {
|
|
112
|
+
const item = items[i];
|
|
113
|
+
const itemPath = path.join(dir, item);
|
|
114
|
+
const stat = await fs.stat(itemPath);
|
|
115
|
+
const isLast = i === items.length - 1;
|
|
116
|
+
const connector = isLast ? '└── ' : '├── ';
|
|
117
|
+
|
|
118
|
+
if (stat.isDirectory()) {
|
|
119
|
+
console.log(chalk.blue(`${prefix}${connector}${item}/`));
|
|
120
|
+
if (item === '.claude' || item === 'commands') {
|
|
121
|
+
// Mostrar solo un nivel más para .claude y commands
|
|
122
|
+
const subItems = await fs.readdir(itemPath);
|
|
123
|
+
const newPrefix = prefix + (isLast ? ' ' : '│ ');
|
|
124
|
+
for (let j = 0; j < Math.min(subItems.length, 3); j++) {
|
|
125
|
+
const subItem = subItems[j];
|
|
126
|
+
const subConnector = j === Math.min(subItems.length, 3) - 1 ? '└── ' : '├── ';
|
|
127
|
+
console.log(chalk.gray(`${newPrefix}${subConnector}${subItem}`));
|
|
128
|
+
}
|
|
129
|
+
if (subItems.length > 3) {
|
|
130
|
+
console.log(chalk.gray(`${newPrefix}└── ... y ${subItems.length - 3} más`));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
console.log(chalk.gray(`${prefix}${connector}${item}`));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async function cleanupOldReferences() {
|
|
140
|
+
console.log(chalk.yellow('\n🧹 Limpiando referencias obsoletas...'));
|
|
141
|
+
|
|
142
|
+
const templatesDir = path.join(__dirname, '..', 'templates');
|
|
143
|
+
|
|
144
|
+
// Buscar y eliminar directorios hooks
|
|
145
|
+
const languages = ['javascript-typescript', 'python', 'common'];
|
|
146
|
+
|
|
147
|
+
for (const language of languages) {
|
|
148
|
+
const hooksDir = path.join(templatesDir, language, '.claude', 'hooks');
|
|
149
|
+
if (await fs.pathExists(hooksDir)) {
|
|
150
|
+
await fs.remove(hooksDir);
|
|
151
|
+
console.log(chalk.yellow(` 🗑️ Eliminado: ${language}/.claude/hooks/`));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Verificar archivos vacíos en commands
|
|
156
|
+
for (const language of languages) {
|
|
157
|
+
const commandsDir = path.join(templatesDir, language, '.claude', 'commands');
|
|
158
|
+
if (await fs.pathExists(commandsDir)) {
|
|
159
|
+
const files = await fs.readdir(commandsDir);
|
|
160
|
+
for (const file of files) {
|
|
161
|
+
const filePath = path.join(commandsDir, file);
|
|
162
|
+
const stat = await fs.stat(filePath);
|
|
163
|
+
if (stat.size < 50) { // Archivos muy pequeños probablemente estén vacíos
|
|
164
|
+
const content = await fs.readFile(filePath, 'utf8');
|
|
165
|
+
if (content.trim().length < 10) {
|
|
166
|
+
console.log(chalk.yellow(` ⚠️ Archivo posiblemente vacío: ${language}/.claude/commands/${file} (${stat.size} bytes)`));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Función para ejecutar la sincronización
|
|
175
|
+
if (require.main === module) {
|
|
176
|
+
syncTemplates().catch(error => {
|
|
177
|
+
console.error(chalk.red('❌ Error durante la sincronización:'), error);
|
|
178
|
+
process.exit(1);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
module.exports = { syncTemplates };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Go Claude Code Templates
|
|
2
|
+
|
|
3
|
+
## Coming Soon! 🚧
|
|
4
|
+
|
|
5
|
+
We're actively working on creating comprehensive Claude Code templates for Go development.
|
|
6
|
+
|
|
7
|
+
### What to Expect
|
|
8
|
+
- Best practices for Go project structure
|
|
9
|
+
- Integration with popular Go tools and frameworks
|
|
10
|
+
- Workflow optimizations for Go development
|
|
11
|
+
- Testing and benchmarking configurations
|
|
12
|
+
- Deployment and build automation
|
|
13
|
+
|
|
14
|
+
### Meanwhile...
|
|
15
|
+
You can use the [common templates](../common/README.md) as a starting point for your Go projects. The universal guidelines and git workflows will work well with Go development.
|
|
16
|
+
|
|
17
|
+
### Stay Updated
|
|
18
|
+
⭐ Star this repository to get notified when the Go templates are released!
|
|
19
|
+
|
|
20
|
+
### Contributing
|
|
21
|
+
Interested in helping build these templates? We welcome contributions! Please check the main repository's contribution guidelines and feel free to open an issue or pull request.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
*Expected release: Coming soon*
|
|
@@ -1 +1,51 @@
|
|
|
1
|
-
# API Endpoint
|
|
1
|
+
# API Endpoint Generator
|
|
2
|
+
|
|
3
|
+
Generate a complete API endpoint for $ARGUMENTS following project conventions.
|
|
4
|
+
|
|
5
|
+
## Task
|
|
6
|
+
|
|
7
|
+
I'll analyze the project structure and create a new API endpoint with:
|
|
8
|
+
|
|
9
|
+
1. Route definition
|
|
10
|
+
2. Controller/handler function
|
|
11
|
+
3. Input validation
|
|
12
|
+
4. Service layer logic (if applicable)
|
|
13
|
+
5. Data access layer (if applicable)
|
|
14
|
+
6. Unit tests
|
|
15
|
+
7. Documentation
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
|
|
19
|
+
I'll follow these steps:
|
|
20
|
+
|
|
21
|
+
1. Examine the project structure to understand the architecture pattern
|
|
22
|
+
2. Identify existing patterns for routes, controllers, and validation
|
|
23
|
+
3. Create all necessary files following project conventions
|
|
24
|
+
4. Implement the endpoint with proper error handling
|
|
25
|
+
5. Add appropriate tests
|
|
26
|
+
6. Document the new endpoint
|
|
27
|
+
|
|
28
|
+
## Best Practices
|
|
29
|
+
|
|
30
|
+
I'll ensure the implementation includes:
|
|
31
|
+
|
|
32
|
+
- Strong typing with TypeScript
|
|
33
|
+
- Comprehensive error handling
|
|
34
|
+
- Input validation
|
|
35
|
+
- Security considerations (authentication/authorization)
|
|
36
|
+
- Proper logging
|
|
37
|
+
- Performance considerations
|
|
38
|
+
- Test coverage
|
|
39
|
+
|
|
40
|
+
## Adaptability
|
|
41
|
+
|
|
42
|
+
I'll adapt to various API architectures:
|
|
43
|
+
|
|
44
|
+
- Express/Koa/Fastify REST APIs
|
|
45
|
+
- GraphQL resolvers
|
|
46
|
+
- Next.js/Nuxt.js API routes
|
|
47
|
+
- Serverless functions
|
|
48
|
+
- tRPC endpoints
|
|
49
|
+
- NestJS controllers
|
|
50
|
+
|
|
51
|
+
I'll examine your project first to determine which pattern to follow.
|
|
@@ -1 +1,52 @@
|
|
|
1
|
-
# Debug
|
|
1
|
+
# Debug Assistant
|
|
2
|
+
|
|
3
|
+
Help me debug the issue with $ARGUMENTS in this project.
|
|
4
|
+
|
|
5
|
+
## Task
|
|
6
|
+
|
|
7
|
+
I'll help you identify and fix the problem by:
|
|
8
|
+
|
|
9
|
+
1. Understanding the issue description
|
|
10
|
+
2. Analyzing relevant code
|
|
11
|
+
3. Identifying potential causes
|
|
12
|
+
4. Suggesting and implementing fixes
|
|
13
|
+
5. Verifying the solution works
|
|
14
|
+
|
|
15
|
+
## Process
|
|
16
|
+
|
|
17
|
+
I'll follow these steps:
|
|
18
|
+
|
|
19
|
+
1. Examine error messages, logs, or unexpected behaviors
|
|
20
|
+
2. Locate relevant files and code sections
|
|
21
|
+
3. Analyze the code flow and potential failure points
|
|
22
|
+
4. Identify common JavaScript/TypeScript pitfalls that might apply
|
|
23
|
+
5. Suggest specific fixes with explanations
|
|
24
|
+
6. Help implement and test the solution
|
|
25
|
+
|
|
26
|
+
## Debugging Techniques
|
|
27
|
+
|
|
28
|
+
I'll apply appropriate debugging techniques such as:
|
|
29
|
+
|
|
30
|
+
- Static code analysis to find syntax or type errors
|
|
31
|
+
- Runtime error analysis from logs or stack traces
|
|
32
|
+
- Control flow tracing to understand execution paths
|
|
33
|
+
- State inspection to identify incorrect values
|
|
34
|
+
- Dependency analysis to find version conflicts
|
|
35
|
+
- Network request inspection for API issues
|
|
36
|
+
- Browser console analysis for frontend problems
|
|
37
|
+
- Database query inspection for data issues
|
|
38
|
+
|
|
39
|
+
## Common Issues I Can Help With
|
|
40
|
+
|
|
41
|
+
- Type errors and null/undefined issues
|
|
42
|
+
- Asynchronous code problems (Promises, async/await)
|
|
43
|
+
- React/Vue/Angular component lifecycle issues
|
|
44
|
+
- API integration problems
|
|
45
|
+
- State management bugs
|
|
46
|
+
- Performance bottlenecks
|
|
47
|
+
- Memory leaks
|
|
48
|
+
- Build/compilation errors
|
|
49
|
+
- Testing failures
|
|
50
|
+
- Environment configuration issues
|
|
51
|
+
|
|
52
|
+
I'll adapt my approach based on your specific project structure, frameworks, and the nature of the problem.
|
|
@@ -1 +1,48 @@
|
|
|
1
|
-
# Lint
|
|
1
|
+
# Lint Assistant
|
|
2
|
+
|
|
3
|
+
Analyze and fix linting issues in $ARGUMENTS following project conventions.
|
|
4
|
+
|
|
5
|
+
## Task
|
|
6
|
+
|
|
7
|
+
I'll help you identify and fix code style and quality issues by:
|
|
8
|
+
|
|
9
|
+
1. Running appropriate linters for the project
|
|
10
|
+
2. Analyzing linting errors and warnings
|
|
11
|
+
3. Fixing issues automatically when possible
|
|
12
|
+
4. Explaining complex issues that require manual intervention
|
|
13
|
+
5. Ensuring code follows project style guidelines
|
|
14
|
+
|
|
15
|
+
## Process
|
|
16
|
+
|
|
17
|
+
I'll follow these steps:
|
|
18
|
+
|
|
19
|
+
1. Identify the linting tools used in the project (ESLint, Prettier, TSLint, etc.)
|
|
20
|
+
2. Run the appropriate linting commands
|
|
21
|
+
3. Parse and categorize the results
|
|
22
|
+
4. Apply automatic fixes for common issues
|
|
23
|
+
5. Provide explanations and suggestions for more complex problems
|
|
24
|
+
6. Verify fixes don't introduce new issues
|
|
25
|
+
|
|
26
|
+
## Common Linting Issues I Can Fix
|
|
27
|
+
|
|
28
|
+
- Code style inconsistencies (spacing, indentation, quotes, etc.)
|
|
29
|
+
- Unused variables and imports
|
|
30
|
+
- Missing type annotations in TypeScript
|
|
31
|
+
- Accessibility (a11y) issues in UI components
|
|
32
|
+
- Potential bugs flagged by static analysis
|
|
33
|
+
- Performance issues in React/Vue components
|
|
34
|
+
- Security vulnerabilities detected by linters
|
|
35
|
+
- Deprecated API usage
|
|
36
|
+
- Import ordering problems
|
|
37
|
+
- Missing documentation
|
|
38
|
+
|
|
39
|
+
## Linting Tools I Can Work With
|
|
40
|
+
|
|
41
|
+
- ESLint (with various plugins and configs)
|
|
42
|
+
- Prettier
|
|
43
|
+
- TSLint (legacy)
|
|
44
|
+
- stylelint (for CSS/SCSS)
|
|
45
|
+
- commitlint (for commit messages)
|
|
46
|
+
- Custom lint rules specific to your project
|
|
47
|
+
|
|
48
|
+
I'll adapt my approach based on your project's specific linting configuration and style guide requirements.
|
|
@@ -1 +1,48 @@
|
|
|
1
|
-
# NPM Scripts
|
|
1
|
+
# NPM Scripts Assistant
|
|
2
|
+
|
|
3
|
+
Help me with NPM scripts: $ARGUMENTS
|
|
4
|
+
|
|
5
|
+
## Task
|
|
6
|
+
|
|
7
|
+
I'll help you work with package.json scripts by:
|
|
8
|
+
|
|
9
|
+
1. Analyzing existing npm scripts in your project
|
|
10
|
+
2. Creating new scripts or modifying existing ones
|
|
11
|
+
3. Explaining what specific scripts do
|
|
12
|
+
4. Suggesting improvements or optimizations
|
|
13
|
+
5. Troubleshooting script execution issues
|
|
14
|
+
|
|
15
|
+
## Process
|
|
16
|
+
|
|
17
|
+
I'll follow these steps:
|
|
18
|
+
|
|
19
|
+
1. Examine your package.json file to understand current scripts
|
|
20
|
+
2. Analyze dependencies and devDependencies for available tools
|
|
21
|
+
3. Identify common patterns and conventions in your scripts
|
|
22
|
+
4. Implement requested changes or create new scripts
|
|
23
|
+
5. Provide explanations of how the scripts work
|
|
24
|
+
6. Test scripts when possible to verify functionality
|
|
25
|
+
|
|
26
|
+
## Common Script Types I Can Help With
|
|
27
|
+
|
|
28
|
+
- Build processes (webpack, rollup, esbuild, etc.)
|
|
29
|
+
- Development servers and hot reloading
|
|
30
|
+
- Testing (unit, integration, e2e)
|
|
31
|
+
- Linting and code formatting
|
|
32
|
+
- Type checking
|
|
33
|
+
- Deployment and CI/CD
|
|
34
|
+
- Database migrations
|
|
35
|
+
- Code generation
|
|
36
|
+
- Environment setup
|
|
37
|
+
- Pre/post hooks for git operations
|
|
38
|
+
|
|
39
|
+
## Script Optimization Techniques
|
|
40
|
+
|
|
41
|
+
- Parallelizing tasks for faster execution
|
|
42
|
+
- Adding cross-platform compatibility
|
|
43
|
+
- Improving error reporting and logging
|
|
44
|
+
- Implementing watch modes for development
|
|
45
|
+
- Creating composite scripts for common workflows
|
|
46
|
+
- Adding appropriate exit codes for CI/CD pipelines
|
|
47
|
+
|
|
48
|
+
I'll adapt my approach based on your project's specific needs, dependencies, and build tools.
|
|
@@ -1 +1,54 @@
|
|
|
1
|
-
# React Component
|
|
1
|
+
# React Component Generator
|
|
2
|
+
|
|
3
|
+
Create a React component for $ARGUMENTS following project conventions.
|
|
4
|
+
|
|
5
|
+
## Task
|
|
6
|
+
|
|
7
|
+
I'll help you create a complete React component by:
|
|
8
|
+
|
|
9
|
+
1. Analyzing your project structure and conventions
|
|
10
|
+
2. Creating component files with appropriate organization
|
|
11
|
+
3. Implementing the component with proper TypeScript types
|
|
12
|
+
4. Adding styles according to your project's styling approach
|
|
13
|
+
5. Creating tests for the component
|
|
14
|
+
6. Adding documentation and usage examples
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
|
|
18
|
+
I'll follow these steps:
|
|
19
|
+
|
|
20
|
+
1. Examine your project to understand component patterns and conventions
|
|
21
|
+
2. Identify the styling approach (CSS/SCSS modules, styled-components, Tailwind, etc.)
|
|
22
|
+
3. Determine testing frameworks and patterns
|
|
23
|
+
4. Create the component with appropriate file structure
|
|
24
|
+
5. Implement component logic, props interface, and styling
|
|
25
|
+
6. Add comprehensive tests
|
|
26
|
+
7. Document the component's usage and props
|
|
27
|
+
|
|
28
|
+
## Component Features
|
|
29
|
+
|
|
30
|
+
I can implement various component types and features:
|
|
31
|
+
|
|
32
|
+
- Functional components with hooks
|
|
33
|
+
- TypeScript interfaces for props and state
|
|
34
|
+
- Proper prop validation and defaults
|
|
35
|
+
- Responsive design considerations
|
|
36
|
+
- Accessibility (a11y) best practices
|
|
37
|
+
- Performance optimizations (memoization, etc.)
|
|
38
|
+
- Error boundaries when appropriate
|
|
39
|
+
- Loading and error states
|
|
40
|
+
- Animation and transition effects
|
|
41
|
+
|
|
42
|
+
## Component Architecture Patterns
|
|
43
|
+
|
|
44
|
+
I'll adapt to your project's component architecture:
|
|
45
|
+
|
|
46
|
+
- Atomic Design methodology (atoms, molecules, organisms)
|
|
47
|
+
- Feature-based organization
|
|
48
|
+
- Container/Presentational pattern
|
|
49
|
+
- Compound components
|
|
50
|
+
- Render props pattern
|
|
51
|
+
- Higher-Order Components (HOCs)
|
|
52
|
+
- Custom hooks for logic extraction
|
|
53
|
+
|
|
54
|
+
I'll analyze your existing components to match your project's specific patterns and conventions.
|
|
@@ -1 +1,55 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Code Refactoring Assistant
|
|
2
|
+
|
|
3
|
+
Refactor $ARGUMENTS following modern JavaScript/TypeScript best practices.
|
|
4
|
+
|
|
5
|
+
## Task
|
|
6
|
+
|
|
7
|
+
I'll help you refactor code by:
|
|
8
|
+
|
|
9
|
+
1. Analyzing the current implementation
|
|
10
|
+
2. Identifying improvement opportunities
|
|
11
|
+
3. Applying modern patterns and practices
|
|
12
|
+
4. Maintaining existing functionality
|
|
13
|
+
5. Ensuring type safety and test coverage
|
|
14
|
+
6. Documenting the changes made
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
|
|
18
|
+
I'll follow these steps:
|
|
19
|
+
|
|
20
|
+
1. Examine the code to understand its purpose and structure
|
|
21
|
+
2. Identify code smells, anti-patterns, or outdated approaches
|
|
22
|
+
3. Plan the refactoring strategy with clear goals
|
|
23
|
+
4. Implement changes incrementally while maintaining behavior
|
|
24
|
+
5. Verify refactored code with tests
|
|
25
|
+
6. Document improvements and benefits
|
|
26
|
+
|
|
27
|
+
## Refactoring Techniques
|
|
28
|
+
|
|
29
|
+
I can apply various refactoring techniques:
|
|
30
|
+
|
|
31
|
+
- Converting to modern JavaScript/TypeScript features
|
|
32
|
+
- Improving type definitions and type safety
|
|
33
|
+
- Extracting reusable functions and components
|
|
34
|
+
- Applying design patterns appropriately
|
|
35
|
+
- Converting callbacks to Promises or async/await
|
|
36
|
+
- Simplifying complex conditionals and loops
|
|
37
|
+
- Removing duplicate code
|
|
38
|
+
- Improving naming and readability
|
|
39
|
+
- Optimizing performance
|
|
40
|
+
- Enhancing error handling
|
|
41
|
+
|
|
42
|
+
## Modern Practices I Can Apply
|
|
43
|
+
|
|
44
|
+
- ES modules and import/export syntax
|
|
45
|
+
- Optional chaining and nullish coalescing
|
|
46
|
+
- Array and object destructuring
|
|
47
|
+
- Spread and rest operators
|
|
48
|
+
- Template literals
|
|
49
|
+
- Arrow functions
|
|
50
|
+
- Class fields and private methods
|
|
51
|
+
- TypeScript utility types
|
|
52
|
+
- Functional programming patterns
|
|
53
|
+
- React hooks (for React components)
|
|
54
|
+
|
|
55
|
+
I'll ensure the refactored code maintains compatibility with your project's requirements while improving quality and maintainability.
|
|
@@ -1 +1,61 @@
|
|
|
1
|
-
# Test
|
|
1
|
+
# Test Assistant
|
|
2
|
+
|
|
3
|
+
Help with tests for $ARGUMENTS following project conventions and testing best practices.
|
|
4
|
+
|
|
5
|
+
## Task
|
|
6
|
+
|
|
7
|
+
I'll help you with testing by:
|
|
8
|
+
|
|
9
|
+
1. Creating comprehensive test suites for your code
|
|
10
|
+
2. Implementing different types of tests (unit, integration, e2e)
|
|
11
|
+
3. Mocking dependencies and external services
|
|
12
|
+
4. Improving test coverage for existing code
|
|
13
|
+
5. Troubleshooting failing tests
|
|
14
|
+
6. Setting up testing infrastructure
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
|
|
18
|
+
I'll follow these steps:
|
|
19
|
+
|
|
20
|
+
1. Examine your project to understand testing frameworks and patterns
|
|
21
|
+
2. Analyze the code to be tested to understand its functionality
|
|
22
|
+
3. Identify appropriate testing strategies and edge cases
|
|
23
|
+
4. Implement tests with proper structure and assertions
|
|
24
|
+
5. Ensure tests are maintainable and follow best practices
|
|
25
|
+
6. Run tests to verify they pass and provide adequate coverage
|
|
26
|
+
|
|
27
|
+
## Testing Frameworks I Can Work With
|
|
28
|
+
|
|
29
|
+
- Jest, Vitest, Mocha, Jasmine for JavaScript/TypeScript
|
|
30
|
+
- React Testing Library, Enzyme for React components
|
|
31
|
+
- Cypress, Playwright, Puppeteer for E2E testing
|
|
32
|
+
- Supertest, Pactum for API testing
|
|
33
|
+
- Storybook for component testing
|
|
34
|
+
- Testing-library family for various frameworks
|
|
35
|
+
|
|
36
|
+
## Testing Techniques
|
|
37
|
+
|
|
38
|
+
I can implement various testing approaches:
|
|
39
|
+
|
|
40
|
+
- TDD (Test-Driven Development)
|
|
41
|
+
- BDD (Behavior-Driven Development)
|
|
42
|
+
- Snapshot testing
|
|
43
|
+
- Property-based testing
|
|
44
|
+
- Parameterized tests
|
|
45
|
+
- Contract testing
|
|
46
|
+
- Visual regression testing
|
|
47
|
+
- Performance testing
|
|
48
|
+
|
|
49
|
+
## Mocking Strategies
|
|
50
|
+
|
|
51
|
+
I can help with different mocking approaches:
|
|
52
|
+
|
|
53
|
+
- Function mocks and spies
|
|
54
|
+
- Module mocks
|
|
55
|
+
- HTTP request mocking
|
|
56
|
+
- Browser API mocking
|
|
57
|
+
- Timer mocking
|
|
58
|
+
- Database mocking
|
|
59
|
+
- Service worker mocking
|
|
60
|
+
|
|
61
|
+
I'll adapt to your project's specific testing frameworks, patterns, and conventions to ensure consistency with your existing codebase.
|
|
@@ -1 +1,51 @@
|
|
|
1
|
-
# TypeScript
|
|
1
|
+
# TypeScript Migration Assistant
|
|
2
|
+
|
|
3
|
+
Migrate $ARGUMENTS from JavaScript to TypeScript with proper typing and modern practices.
|
|
4
|
+
|
|
5
|
+
## Task
|
|
6
|
+
|
|
7
|
+
I'll help you migrate JavaScript code to TypeScript by:
|
|
8
|
+
|
|
9
|
+
1. Converting JavaScript files to TypeScript (.js/.jsx to .ts/.tsx)
|
|
10
|
+
2. Adding appropriate type definitions and interfaces
|
|
11
|
+
3. Configuring TypeScript settings for your project
|
|
12
|
+
4. Resolving type errors and compatibility issues
|
|
13
|
+
5. Implementing modern TypeScript patterns and features
|
|
14
|
+
6. Ensuring backward compatibility with existing code
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
|
|
18
|
+
I'll follow these steps:
|
|
19
|
+
|
|
20
|
+
1. Examine your project structure and dependencies
|
|
21
|
+
2. Analyze the JavaScript code to understand its functionality
|
|
22
|
+
3. Create or update tsconfig.json with appropriate settings
|
|
23
|
+
4. Convert files to TypeScript with proper type annotations
|
|
24
|
+
5. Add necessary type definitions for libraries
|
|
25
|
+
6. Fix type errors and implement type safety
|
|
26
|
+
7. Refactor code to leverage TypeScript features
|
|
27
|
+
|
|
28
|
+
## TypeScript Features I Can Implement
|
|
29
|
+
|
|
30
|
+
- Interfaces and type aliases for complex data structures
|
|
31
|
+
- Generics for reusable, type-safe components and functions
|
|
32
|
+
- Union and intersection types for flexible typing
|
|
33
|
+
- Enums for related constants
|
|
34
|
+
- Utility types (Partial, Pick, Omit, etc.)
|
|
35
|
+
- Type guards and type narrowing
|
|
36
|
+
- Mapped and conditional types
|
|
37
|
+
- Function overloading
|
|
38
|
+
- Readonly properties and immutability
|
|
39
|
+
- Module augmentation for extending third-party types
|
|
40
|
+
|
|
41
|
+
## Migration Strategies
|
|
42
|
+
|
|
43
|
+
I can apply different migration approaches based on your needs:
|
|
44
|
+
|
|
45
|
+
- Gradual migration with allowJs and incremental adoption
|
|
46
|
+
- File-by-file conversion while maintaining functionality
|
|
47
|
+
- Comprehensive migration with full type safety
|
|
48
|
+
- Hybrid approach with .d.ts files for complex modules
|
|
49
|
+
- Integration with existing type definitions (@types packages)
|
|
50
|
+
|
|
51
|
+
I'll adapt to your project's specific requirements and ensure a smooth transition to TypeScript while maintaining existing functionality.
|
|
@@ -49,7 +49,17 @@
|
|
|
49
49
|
"hooks": [
|
|
50
50
|
{
|
|
51
51
|
"type": "command",
|
|
52
|
-
"command": "if [[ \"$(jq -r '.tool_input.file_path' | grep -E '\\.js$|\\.jsx$|\\.ts$|\\.tsx$')\" != \"\" && $(jq -r '.tool_input.content' | grep -E 'console\\.log') != \"\" ]]; then echo 'Warning: console.log statements should be removed before committing' >&2; fi"
|
|
52
|
+
"command": "if [[ \"$(echo $STDIN_JSON | jq -r '.tool_input.file_path' | grep -E '\\.js$|\\.jsx$|\\.ts$|\\.tsx$')\" != \"\" && $(echo $STDIN_JSON | jq -r '.tool_input.content' | grep -E 'console\\.log') != \"\" ]]; then echo 'Warning: console.log statements should be removed before committing' >&2; exit 2; fi"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"matcher": "Write",
|
|
58
|
+
"hooks": [
|
|
59
|
+
{
|
|
60
|
+
"type": "command",
|
|
61
|
+
"command": "FILE=$(echo $STDIN_JSON | jq -r '.tool_input.file_path // \"\"'); if [[ \"$FILE\" == \"package.json\" ]]; then echo 'Checking for vulnerable dependencies...'; npx audit-ci --moderate; fi",
|
|
62
|
+
"timeout": 60
|
|
53
63
|
}
|
|
54
64
|
]
|
|
55
65
|
}
|
|
@@ -70,10 +80,29 @@
|
|
|
70
80
|
"hooks": [
|
|
71
81
|
{
|
|
72
82
|
"type": "command",
|
|
73
|
-
"command": "FILE=$(echo $STDIN_JSON | jq -r '.tool_input.file_path // \"\"'); if [[ \"$FILE\" =~ \\.(ts|tsx)$ ]]; then npx tsc --noEmit; fi",
|
|
83
|
+
"command": "FILE=$(echo $STDIN_JSON | jq -r '.tool_input.file_path // \"\"'); if [[ \"$FILE\" =~ \\.(ts|tsx)$ ]]; then RESULT=$(npx tsc --noEmit 2>&1); if [ $? -ne 0 ]; then echo \"TypeScript errors found: $RESULT\" >&2; exit 2; fi; fi",
|
|
74
84
|
"timeout": 30
|
|
75
85
|
}
|
|
76
86
|
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
90
|
+
"hooks": [
|
|
91
|
+
{
|
|
92
|
+
"type": "command",
|
|
93
|
+
"command": "FILE=$(echo $STDIN_JSON | jq -r '.tool_input.file_path // \"\"'); if [[ \"$FILE\" =~ \\.(ts|tsx)$ ]] && grep -q 'import.*from.*\\*' \"$FILE\"; then echo 'Warning: Avoid wildcard imports for better tree-shaking' >&2; exit 2; fi"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
99
|
+
"hooks": [
|
|
100
|
+
{
|
|
101
|
+
"type": "command",
|
|
102
|
+
"command": "FILE=$(echo $STDIN_JSON | jq -r '.tool_input.file_path // \"\"'); if [[ \"$FILE\" =~ \\.(js|jsx|ts|tsx)$ && \"$FILE\" != *\".test.\"* && \"$FILE\" != *\".spec.\"* ]]; then TEST_FILE=$(echo \"$FILE\" | sed -E 's/\\.(js|jsx|ts|tsx)$/.test.\\1/'); if [ -f \"$TEST_FILE\" ]; then echo \"Running tests for modified file...\"; npx jest \"$TEST_FILE\" --passWithNoTests; fi; fi",
|
|
103
|
+
"timeout": 60
|
|
104
|
+
}
|
|
105
|
+
]
|
|
77
106
|
}
|
|
78
107
|
],
|
|
79
108
|
"Notification": [
|
|
@@ -97,6 +126,16 @@
|
|
|
97
126
|
"timeout": 60
|
|
98
127
|
}
|
|
99
128
|
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"matcher": "",
|
|
132
|
+
"hooks": [
|
|
133
|
+
{
|
|
134
|
+
"type": "command",
|
|
135
|
+
"command": "if [[ -f package.json && $(git status --porcelain | grep -E '\\.js$|\\.jsx$|\\.ts$|\\.tsx$') ]]; then echo 'Analyzing bundle size impact...'; npx bundlesize; fi",
|
|
136
|
+
"timeout": 60
|
|
137
|
+
}
|
|
138
|
+
]
|
|
100
139
|
}
|
|
101
140
|
]
|
|
102
141
|
}
|
|
@@ -1,233 +1,259 @@
|
|
|
1
|
-
# JavaScript/TypeScript
|
|
1
|
+
# JavaScript/TypeScript Templates
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Claude Code configuration template optimized for modern JavaScript and TypeScript development**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This folder contains a comprehensive Claude Code template specifically designed for JavaScript and TypeScript projects, supporting popular frameworks like React, Vue.js, Angular, and Node.js.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
Copy the template files to your JavaScript/TypeScript project:
|
|
7
|
+
## 📁 What's in This Folder
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
# Copy all template files
|
|
12
|
-
cp -r claude-code-templates/javascript-typescript/* your-project/
|
|
9
|
+
This template provides the foundation for JavaScript/TypeScript development with Claude Code:
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```
|
|
11
|
+
### 📄 Files Included
|
|
12
|
+
- **`CLAUDE.md`** - Complete JavaScript/TypeScript development guidance for Claude Code
|
|
13
|
+
- **`README.md`** - This documentation file
|
|
18
14
|
|
|
19
|
-
###
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
cd your-project
|
|
24
|
-
claude
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Use the included custom commands:
|
|
28
|
-
```bash
|
|
29
|
-
# Run tests
|
|
30
|
-
/test
|
|
31
|
-
|
|
32
|
-
# Run linting
|
|
33
|
-
/lint
|
|
34
|
-
|
|
35
|
-
# Create React component
|
|
36
|
-
/react-component
|
|
15
|
+
### 🎯 Template Features
|
|
16
|
+
When you use this template with the installer, it automatically creates:
|
|
17
|
+
- **`.claude/settings.json`** - Optimized settings for JS/TS projects
|
|
18
|
+
- **`.claude/commands/`** - Ready-to-use commands for common tasks
|
|
37
19
|
|
|
38
|
-
|
|
39
|
-
/debug
|
|
40
|
-
```
|
|
20
|
+
## 🚀 How to Use This Template
|
|
41
21
|
|
|
42
|
-
|
|
22
|
+
### Option 1: Automated Installation (Recommended)
|
|
23
|
+
Use the CLI installer to automatically set up this template in your project:
|
|
43
24
|
|
|
44
|
-
### Core Configuration
|
|
45
|
-
- **`CLAUDE.md`** - Comprehensive guidance for JavaScript/TypeScript development
|
|
46
|
-
- **`.claude/settings.json`** - Optimized settings for JS/TS projects
|
|
47
|
-
- **Custom Commands** - Pre-configured commands for common development tasks
|
|
48
|
-
|
|
49
|
-
### Development Hooks
|
|
50
|
-
- **`format-on-save.json`** - Automatically format code with Prettier
|
|
51
|
-
- **`lint-on-save.json`** - Run ESLint on file changes
|
|
52
|
-
- **`typescript-check.json`** - Verify TypeScript types on save
|
|
53
|
-
|
|
54
|
-
### Custom Commands
|
|
55
|
-
- **`test.md`** - Execute tests with Jest, Vitest, or other frameworks
|
|
56
|
-
- **`lint.md`** - Run ESLint with customizable rules
|
|
57
|
-
- **`debug.md`** - Debug Node.js applications and browser code
|
|
58
|
-
- **`refactor.md`** - Refactor code with AI assistance
|
|
59
|
-
- **`typescript-migrate.md`** - Migrate JavaScript files to TypeScript
|
|
60
|
-
- **`npm-scripts.md`** - Manage and execute npm scripts
|
|
61
|
-
- **`react-component.md`** - Generate React components with best practices
|
|
62
|
-
- **`api-endpoint.md`** - Create API endpoints for Node.js applications
|
|
63
|
-
|
|
64
|
-
### Project Examples
|
|
65
|
-
- **React App** - Configuration for React applications
|
|
66
|
-
- **Node.js API** - Configuration for backend API development
|
|
67
|
-
|
|
68
|
-
## Framework-Specific Setup
|
|
69
|
-
|
|
70
|
-
### React Projects
|
|
71
25
|
```bash
|
|
72
|
-
|
|
73
|
-
|
|
26
|
+
cd your-javascript-project
|
|
27
|
+
npx claude-code-templates --language javascript-typescript
|
|
74
28
|
```
|
|
75
29
|
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
# Copy Node.js-specific configuration
|
|
83
|
-
cp -r claude-code-templates/javascript-typescript/examples/node-api/.claude/ your-api-project/
|
|
84
|
-
```
|
|
30
|
+
The installer will:
|
|
31
|
+
- Copy the `CLAUDE.md` file to your project
|
|
32
|
+
- Auto-detect your framework (React, Vue, Node.js, etc.)
|
|
33
|
+
- Create appropriate `.claude/` configuration files
|
|
34
|
+
- Set up framework-specific commands
|
|
35
|
+
- Configure development workflows
|
|
85
36
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
- `/middleware` - Generate middleware functions
|
|
37
|
+
### Option 2: Manual Installation
|
|
38
|
+
Copy the template manually for more control:
|
|
89
39
|
|
|
90
|
-
|
|
40
|
+
```bash
|
|
41
|
+
# Clone the repository
|
|
42
|
+
git clone https://github.com/danipower/claude-code-templates.git
|
|
91
43
|
|
|
92
|
-
|
|
93
|
-
-
|
|
94
|
-
- **yarn** - Fast, reliable package manager
|
|
95
|
-
- **pnpm** - Efficient package manager
|
|
44
|
+
# Copy the JavaScript/TypeScript template
|
|
45
|
+
cp claude-code-templates/javascript-typescript/CLAUDE.md your-project/
|
|
96
46
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
- **esbuild** - Extremely fast JavaScript bundler
|
|
47
|
+
# Then use the CLI to complete the setup
|
|
48
|
+
cd your-project
|
|
49
|
+
npx claude-code-templates --language javascript-typescript
|
|
50
|
+
```
|
|
102
51
|
|
|
103
|
-
|
|
104
|
-
- **Jest** - JavaScript testing framework
|
|
105
|
-
- **Vitest** - Fast unit test framework
|
|
106
|
-
- **Testing Library** - Testing utilities
|
|
107
|
-
- **Cypress** - End-to-end testing
|
|
108
|
-
- **Playwright** - Cross-browser testing
|
|
52
|
+
## 🎨 Framework Support
|
|
109
53
|
|
|
110
|
-
|
|
111
|
-
- **ESLint** - JavaScript/TypeScript linter
|
|
112
|
-
- **Prettier** - Code formatter
|
|
113
|
-
- **TypeScript** - Static type checking
|
|
114
|
-
- **Husky** - Git hooks
|
|
54
|
+
This template automatically configures Claude Code for:
|
|
115
55
|
|
|
116
56
|
### Frontend Frameworks
|
|
117
|
-
- **React** -
|
|
118
|
-
- **Vue.js** -
|
|
119
|
-
- **Angular** -
|
|
120
|
-
- **Svelte** - Compile-time
|
|
57
|
+
- **React** - Components, hooks, JSX, testing with React Testing Library
|
|
58
|
+
- **Vue.js** - Composition API, single-file components, state management
|
|
59
|
+
- **Angular** - TypeScript-first development, RxJS patterns, CLI integration
|
|
60
|
+
- **Svelte** - Compile-time optimizations, modern JavaScript patterns
|
|
121
61
|
|
|
122
62
|
### Backend Frameworks
|
|
123
|
-
- **Express.js** -
|
|
124
|
-
- **Fastify** -
|
|
125
|
-
- **
|
|
126
|
-
- **
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
63
|
+
- **Express.js** - RESTful APIs, middleware, error handling
|
|
64
|
+
- **Fastify** - High-performance Node.js applications
|
|
65
|
+
- **NestJS** - Enterprise-grade TypeScript framework
|
|
66
|
+
- **Next.js** - Full-stack React applications with SSR/SSG
|
|
67
|
+
|
|
68
|
+
### Build Tools & Testing
|
|
69
|
+
- **Vite, Webpack, esbuild** - Modern build tool configurations
|
|
70
|
+
- **Jest, Vitest, Cypress** - Testing framework optimization
|
|
71
|
+
- **ESLint, Prettier, TypeScript** - Code quality and formatting
|
|
72
|
+
|
|
73
|
+
## 🛠️ Commands Created by the Template
|
|
74
|
+
|
|
75
|
+
When installed, this template provides commands for:
|
|
76
|
+
|
|
77
|
+
### 🧪 Testing & Quality
|
|
78
|
+
- **`/test`** - Run tests with Jest, Vitest, or other frameworks
|
|
79
|
+
- **`/lint`** - ESLint with auto-fix capabilities
|
|
80
|
+
- **`/typescript-migrate`** - Convert JavaScript files to TypeScript
|
|
81
|
+
|
|
82
|
+
### 🔧 Development Tools
|
|
83
|
+
- **`/debug`** - Debug Node.js applications and browser code
|
|
84
|
+
- **`/refactor`** - AI-assisted code refactoring
|
|
85
|
+
- **`/npm-scripts`** - Manage and execute npm/yarn scripts
|
|
86
|
+
|
|
87
|
+
### ⚡ Framework-Specific Commands
|
|
88
|
+
- **`/react-component`** - Generate React components (React projects)
|
|
89
|
+
- **`/api-endpoint`** - Create Express.js endpoints (Node.js projects)
|
|
90
|
+
- **`/route`** - Create API routes (Node.js projects)
|
|
91
|
+
- **`/component`** - Create components (React/Vue projects)
|
|
92
|
+
|
|
93
|
+
## 🎯 What Happens When You Install
|
|
94
|
+
|
|
95
|
+
### Step 1: Framework Detection
|
|
96
|
+
The installer analyzes your project to detect:
|
|
97
|
+
- Package.json dependencies
|
|
98
|
+
- Project structure
|
|
99
|
+
- Framework type (React, Vue, Angular, Node.js)
|
|
100
|
+
|
|
101
|
+
### Step 2: Template Configuration
|
|
102
|
+
Based on detection, it creates:
|
|
103
|
+
```
|
|
104
|
+
your-project/
|
|
105
|
+
├── CLAUDE.md # Copied from this template
|
|
106
|
+
├── .claude/
|
|
107
|
+
│ ├── settings.json # Framework-specific settings
|
|
108
|
+
│ └── commands/ # Commands for your framework
|
|
109
|
+
│ ├── test.md
|
|
110
|
+
│ ├── lint.md
|
|
111
|
+
│ ├── debug.md
|
|
112
|
+
│ └── [framework-specific commands]
|
|
113
|
+
```
|
|
155
114
|
|
|
115
|
+
### Step 3: Framework Customization
|
|
116
|
+
For specific frameworks, additional commands are added:
|
|
117
|
+
|
|
118
|
+
**React Projects:**
|
|
119
|
+
- Component generation with TypeScript support
|
|
120
|
+
- React hooks creation and management
|
|
121
|
+
- Testing with React Testing Library patterns
|
|
122
|
+
|
|
123
|
+
**Node.js Projects:**
|
|
124
|
+
- RESTful API endpoint creation
|
|
125
|
+
- Middleware development patterns
|
|
126
|
+
- Database integration helpers
|
|
127
|
+
|
|
128
|
+
**Vue.js Projects:**
|
|
129
|
+
- Single-file component templates
|
|
130
|
+
- Composition API patterns
|
|
131
|
+
- Vue 3 best practices
|
|
132
|
+
|
|
133
|
+
## 📚 What's in the CLAUDE.md File
|
|
134
|
+
|
|
135
|
+
The `CLAUDE.md` file in this folder contains comprehensive guidance for:
|
|
136
|
+
|
|
137
|
+
### Development Commands
|
|
138
|
+
- Package management (npm, yarn, pnpm)
|
|
139
|
+
- Build commands (dev, build, preview)
|
|
140
|
+
- Testing commands (unit, integration, e2e)
|
|
141
|
+
- Code quality commands (lint, format, typecheck)
|
|
142
|
+
|
|
143
|
+
### Technology Stack Guidelines
|
|
144
|
+
- JavaScript/TypeScript best practices
|
|
145
|
+
- Framework-specific patterns (React, Vue, Angular, Node.js)
|
|
146
|
+
- Build tools configuration (Vite, Webpack, esbuild)
|
|
147
|
+
- Testing frameworks (Jest, Vitest, Cypress, Playwright)
|
|
148
|
+
|
|
149
|
+
### Project Structure Recommendations
|
|
150
|
+
- File organization patterns
|
|
151
|
+
- Naming conventions
|
|
152
|
+
- TypeScript configuration
|
|
153
|
+
- Code quality standards
|
|
154
|
+
|
|
155
|
+
### Performance & Security
|
|
156
|
+
- Bundle optimization strategies
|
|
157
|
+
- Runtime performance tips
|
|
158
|
+
- Security best practices
|
|
159
|
+
- Dependency management
|
|
160
|
+
|
|
161
|
+
## 🚀 Getting Started
|
|
162
|
+
|
|
163
|
+
1. **Navigate to your JavaScript/TypeScript project:**
|
|
164
|
+
```bash
|
|
165
|
+
cd your-project
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
2. **Run the installer:**
|
|
169
|
+
```bash
|
|
170
|
+
npx claude-code-templates --language javascript-typescript
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
3. **Start Claude Code:**
|
|
174
|
+
```bash
|
|
175
|
+
claude
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
4. **Try the commands:**
|
|
179
|
+
```bash
|
|
180
|
+
/test # Run your tests
|
|
181
|
+
/lint # Check code quality
|
|
182
|
+
/component # Create components (React/Vue)
|
|
183
|
+
/route # Create API routes (Node.js)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## 🔧 Customization
|
|
187
|
+
|
|
188
|
+
After installation, you can customize the setup:
|
|
189
|
+
|
|
190
|
+
### Modify Commands
|
|
191
|
+
Edit files in `.claude/commands/` to match your workflow:
|
|
156
192
|
```bash
|
|
157
|
-
# Edit test command
|
|
193
|
+
# Edit the test command
|
|
158
194
|
vim .claude/commands/test.md
|
|
159
195
|
|
|
160
|
-
# Add
|
|
161
|
-
echo "#
|
|
196
|
+
# Add a custom command
|
|
197
|
+
echo "# Deploy Command" > .claude/commands/deploy.md
|
|
162
198
|
```
|
|
163
199
|
|
|
164
|
-
###
|
|
165
|
-
|
|
166
|
-
|
|
200
|
+
### Adjust Settings
|
|
201
|
+
Update `.claude/settings.json` for your project:
|
|
167
202
|
```json
|
|
168
203
|
{
|
|
169
|
-
"language": "typescript",
|
|
170
204
|
"framework": "react",
|
|
171
|
-
"testFramework": "jest",
|
|
172
|
-
"packageManager": "npm"
|
|
205
|
+
"testFramework": "jest",
|
|
206
|
+
"packageManager": "npm",
|
|
207
|
+
"buildTool": "vite"
|
|
173
208
|
}
|
|
174
209
|
```
|
|
175
210
|
|
|
176
|
-
###
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
```json
|
|
180
|
-
{
|
|
181
|
-
"trigger": "on_file_save",
|
|
182
|
-
"pattern": "*.ts,*.tsx",
|
|
183
|
-
"command": "npm run typecheck"
|
|
184
|
-
}
|
|
185
|
-
```
|
|
211
|
+
### Add Framework Features
|
|
212
|
+
The template adapts to your specific framework needs automatically.
|
|
186
213
|
|
|
187
|
-
##
|
|
214
|
+
## 📖 Learn More
|
|
188
215
|
|
|
189
|
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
- Keep configuration files in project root
|
|
216
|
+
- **Main Project**: [Claude Code Templates](../README.md)
|
|
217
|
+
- **Common Templates**: [Universal patterns](../common/README.md)
|
|
218
|
+
- **Python Templates**: [Python development](../python/README.md)
|
|
219
|
+
- **CLI Tool**: [Automated installer](../cli-tool/README.md)
|
|
194
220
|
|
|
195
|
-
|
|
196
|
-
- Enable TypeScript strict mode
|
|
197
|
-
- Use ESLint with recommended rules
|
|
198
|
-
- Format code consistently with Prettier
|
|
199
|
-
- Write comprehensive tests
|
|
221
|
+
## 💡 Why Use This Template?
|
|
200
222
|
|
|
201
|
-
###
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
223
|
+
### Before (Manual Setup)
|
|
224
|
+
```bash
|
|
225
|
+
# Create CLAUDE.md from scratch
|
|
226
|
+
# Research JS/TS best practices
|
|
227
|
+
# Configure commands manually
|
|
228
|
+
# Set up linting and testing
|
|
229
|
+
# Configure TypeScript
|
|
230
|
+
# ... hours of setup
|
|
231
|
+
```
|
|
206
232
|
|
|
207
|
-
|
|
233
|
+
### After (With This Template)
|
|
234
|
+
```bash
|
|
235
|
+
npx claude-code-templates --language javascript-typescript
|
|
236
|
+
# ✅ Everything configured in 30 seconds!
|
|
237
|
+
```
|
|
208
238
|
|
|
209
|
-
###
|
|
210
|
-
- **
|
|
211
|
-
- **
|
|
212
|
-
- **
|
|
213
|
-
- **
|
|
239
|
+
### Benefits
|
|
240
|
+
- **Instant Setup** - Get started immediately with proven configurations
|
|
241
|
+
- **Framework-Aware** - Automatically adapts to React, Vue, Node.js, etc.
|
|
242
|
+
- **Best Practices** - Uses industry-standard patterns and tools
|
|
243
|
+
- **TypeScript Ready** - Full TypeScript support out of the box
|
|
244
|
+
- **Testing Included** - Pre-configured for Jest, Vitest, and more
|
|
214
245
|
|
|
215
|
-
|
|
216
|
-
- Check the main repository documentation
|
|
217
|
-
- Review framework-specific guides
|
|
218
|
-
- Use Claude Code's built-in help: `/help`
|
|
219
|
-
- Consult community resources and documentation
|
|
246
|
+
## 🤝 Contributing
|
|
220
247
|
|
|
221
|
-
|
|
248
|
+
Help improve this JavaScript/TypeScript template:
|
|
222
249
|
|
|
223
|
-
|
|
250
|
+
1. Test the template with different JS/TS projects
|
|
251
|
+
2. Report issues or suggest improvements
|
|
252
|
+
3. Add support for new frameworks or tools
|
|
253
|
+
4. Share your customizations and best practices
|
|
224
254
|
|
|
225
|
-
|
|
226
|
-
2. Create a feature branch
|
|
227
|
-
3. Add your improvements
|
|
228
|
-
4. Test with real projects
|
|
229
|
-
5. Submit a pull request
|
|
255
|
+
Your contributions make this template better for the entire JavaScript/TypeScript community!
|
|
230
256
|
|
|
231
|
-
|
|
257
|
+
---
|
|
232
258
|
|
|
233
|
-
|
|
259
|
+
**Ready to supercharge your JavaScript/TypeScript development?** Run `npx claude-code-templates --language javascript-typescript` in your project now!
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Rust Claude Code Templates
|
|
2
|
+
|
|
3
|
+
## Coming Soon! 🚧
|
|
4
|
+
|
|
5
|
+
We're actively working on creating comprehensive Claude Code templates for Rust development.
|
|
6
|
+
|
|
7
|
+
### What to Expect
|
|
8
|
+
- Best practices for Rust project structure
|
|
9
|
+
- Integration with popular Rust tools and frameworks
|
|
10
|
+
- Workflow optimizations for Rust development
|
|
11
|
+
- Testing and benchmarking configurations
|
|
12
|
+
- Cross-compilation and deployment setups
|
|
13
|
+
- Memory safety and performance guidelines
|
|
14
|
+
|
|
15
|
+
### Meanwhile...
|
|
16
|
+
You can use the [common templates](../common/README.md) as a starting point for your Rust projects. The universal guidelines and git workflows will work well with Rust development.
|
|
17
|
+
|
|
18
|
+
### Stay Updated
|
|
19
|
+
⭐ Star this repository to get notified when the Rust templates are released!
|
|
20
|
+
|
|
21
|
+
### Contributing
|
|
22
|
+
Interested in helping build these templates? We welcome contributions! Please check the main repository's contribution guidelines and feel free to open an issue or pull request.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
*Expected release: Coming soon*
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Middleware Command
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# API Route Command
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Node.js API CLAUDE.md
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# React Component Command
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# React Hooks Command
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# React App CLAUDE.md
|