A comprehensive CLI tool that sets up optimized Claude Code configurations for different programming languages and frameworks. Features interactive setup, automation hooks, MCP server integration, and framework-specific commands.
ββββββββββ ββββββ βββ ββββββββββ ββββββββ
βββββββββββ βββββββββββ βββββββββββββββββββ
βββ βββ βββββββββββ ββββββ βββββββββ
βββ βββ βββββββββββ ββββββ βββββββββ
βββββββββββββββββββ ββββββββββββββββββββββββββββ
ββββββββββββββββββ βββ βββββββ βββββββ ββββββββ
βββββββ βββββββ βββββββ ββββββββ
βββββββββββββββββββββββββββββββββ
βββ βββ ββββββ βββββββββ
βββ βββ ββββββ βββββββββ
βββββββββββββββββββββββββββββββββ
βββββββ βββββββ βββββββ ββββββββ
βββββββββββββββββββββ βββββββββββ βββ ββββββ βββββββββββββββββββββββββ
ββββββββββββββββββββββ ββββββββββββββββ βββββββββββββββββββββββββββββββββ
βββ ββββββ ββββββββββββββββββββββ ββββββββ βββ ββββββ ββββββββ
βββ ββββββ ββββββββββββββββββ βββ ββββββββ βββ ββββββ ββββββββ
βββ βββββββββββ βββ ββββββ βββββββββββ βββ βββ ββββββββββββββββ
βββ βββββββββββ ββββββ βββββββββββ βββ βββ ββββββββββββββββ
π Setup Claude Code for any project language π
cd your-project-directory
npx claude-code-templates@latest
The installer will:
- π Auto-detect your project type (JavaScript, Python, etc.)
- π― Ask about frameworks (React, Django, Flask, etc.)
- π Let you choose commands (testing, linting, debugging)
- π§ Let you select automation hooks (formatting, type checking, etc.)
- β Confirm before installing
claude
This repository contains a comprehensive CLI tool and template system for Claude Code configurations:
claude-code-templates/
βββ cli-tool/ # π¦ NPM Package
β βββ src/ # Core CLI implementation
β βββ templates/ # Language and framework templates
β βββ bin/ # Executable scripts
β βββ README.md # π User documentation
βββ common/ # π Universal templates
βββ javascript-typescript/ # β‘ JS/TS templates
βββ python/ # π Python templates
βββ go/ # π§ Go templates (coming soon)
βββ rust/ # π¦ Rust templates (coming soon)
βββ README.md # π This file (development docs)
Each language directory contains:
- CLAUDE.md - Language-specific configuration
- .claude/settings.json - Automation hooks
- .claude/commands/ - Language-specific commands
- .mcp.json - Model Context Protocol servers
- examples/ - Framework-specific variations
Language | Frameworks | Status | Commands | Hooks | MCP |
---|---|---|---|---|---|
JavaScript/TypeScript | React, Vue, Angular, Node.js | β Ready | 7+ | 9+ | 4+ |
Python | Django, Flask, FastAPI | β Ready | 5+ | 8+ | 4+ |
Common | Universal | β Ready | 2+ | 1+ | 4+ |
Go | Gin, Echo, Fiber | π§ Coming Soon | - | - | - |
Rust | Axum, Warp, Actix | π§ Coming Soon | - | - | - |
π See detailed examples and usage β
Framework-specific commands for:
- Testing
- Linting
- Building
- Debugging
- Deployment
- PreToolUse: Code quality checks before actions
- PostToolUse: Auto-formatting and validation after edits
- Stop: Final checks before session ends
- Notification: Activity logging and monitoring
- IDE Integration: VS Code diagnostics & Jupyter execution
- Web Search: Real-time information retrieval
- Filesystem Tools: Advanced file operations
- Database Tools: Connection and query capabilities
- Node.js 14+
- npm or yarn
git clone https://github.com/davila7/claude-code-templates.git
cd claude-code-templates
cd cli-tool
npm install
npm link # Link for local testing
npm test # Run test suite
npm start -- --dry-run # Test locally
The CLI tool is built with a modular architecture:
cli-tool/src/
βββ index.js # Main entry point & CLI setup
βββ prompts.js # Interactive prompts & navigation
βββ command-scanner.js # Scans and loads command templates
βββ hook-scanner.js # Manages automation hooks
βββ file-operations.js # File copying and template processing
βββ templates.js # Template configuration & metadata
βββ utils.js # Project detection utilities
- Create
templates/language-name/
directory - Add base files:
CLAUDE.md
,.claude/settings.json
,.mcp.json
- Create commands in
.claude/commands/
- Add framework examples in
examples/
- Update
src/templates.js
configuration - Add tests and documentation
- Create
templates/language/examples/framework-name/
- Add framework-specific
CLAUDE.md
and commands - Test with various project configurations
- Update detection logic in
src/utils.js
if needed
# Run comprehensive test suite
npm test
# Test specific scenarios
npm start -- --language python --framework django --dry-run
npm start -- --language javascript-typescript --framework react --dry-run
# Test interactive mode
npm start
When you select automation hooks during setup, Claude Code will automatically execute scripts at key moments to improve your development workflow. Here are the available hooks:
ποΈ Bash Command Logging
- When: Before any bash command execution
- What: Logs all bash commands to
~/.claude/bash-command-log.txt
- Purpose: Track command history for debugging and auditing
π« Console.log Detection
- When: Before writing JavaScript/TypeScript files
- What: Prevents files containing
console.log
statements from being saved - Purpose: Enforces clean code practices by blocking debug statements
π‘οΈ NPM Security Audit
- When: Before writing
package.json
files - What: Runs
npm audit --audit-level=moderate
to check for vulnerabilities - Purpose: Automatically scans for security issues in dependencies
β¨ Auto-formatting with Prettier
- When: After writing/editing JavaScript/TypeScript files
- What: Runs
npx prettier --write
on the modified file - Purpose: Ensures consistent code formatting across your project
π TypeScript Type Checking
- When: After writing/editing TypeScript files
- What: Runs
npx tsc --noEmit
to verify type correctness - Purpose: Catches type errors immediately after code changes
- When: After writing/editing JavaScript/TypeScript files
- What: Warns about
import * from
statements - Purpose: Promotes better tree-shaking and bundle optimization
π§ͺ Automatic Test Execution
- When: After modifying JavaScript/TypeScript files
- What: Automatically runs corresponding test files (
.test.
or.spec.
) - Purpose: Ensures tests run immediately after code changes
π’ General Notification Logging
- When: On any Claude Code notification
- What: Logs notification events to
~/.claude/notifications.log
- Purpose: Track system events and debugging information
π ESLint on Changed Files
- When: At the end of a coding session
- What: Runs ESLint on all modified JavaScript/TypeScript files
- Purpose: Final code quality check before committing
π Bundle Size Analysis
- When: At the end of a coding session
- What: Analyzes bundle size impact using bundlesize or webpack-bundle-analyzer
- Purpose: Monitor performance impact of code changes
- ποΈ Bash Command Logging - Track all bash commands
- π« Print Statement Detection - Prevent files with
print()
statements - π‘οΈ pip Security Check - Audit dependencies when requirements.txt changes
- β¨ Auto-formatting with Black - Format Python code automatically
- π Type Checking with MyPy - Verify type hints
- π§ͺ Automatic Test Execution - Run pytest on modified files
- ποΈ Bash Command Logging - Track all bash commands
- π« Debug Statement Detection - Prevent files with
fmt.Print
statements - π‘οΈ go mod Security Check - Audit dependencies when go.mod changes
- β¨ Auto-formatting with gofmt - Format Go code automatically
- π§ͺ Automatic Test Execution - Run go test on modified files
- ποΈ Bash Command Logging - Track all bash commands
- π« Debug Statement Detection - Prevent files with
println!
statements - π‘οΈ cargo Security Check - Audit dependencies when Cargo.toml changes
- β¨ Auto-formatting with rustfmt - Format Rust code automatically
- π§ͺ Automatic Test Execution - Run cargo test on modified files
Hooks are automatic events that execute at specific moments in Claude Code's workflow:
- PreToolUse: Before Claude uses a tool (Write, Edit, Bash, etc.)
- PostToolUse: After Claude uses a tool
- Stop: At the end of a coding session
- Notification: When a system notification occurs
When you select the "PostToolUse: Auto-format JS/TS files with Prettier" hook, here's what happens:
# 1. Claude modifies a TypeScript file
βοΈ Claude edits: src/components/Button.tsx
# 2. The PostToolUse hook triggers automatically
π§ PostToolUse Hook triggered:
β Detecting file: src/components/Button.tsx
β File is .tsx (TypeScript React) β
β Running: npx prettier --write "src/components/Button.tsx"
β Code formatted successfully β
# 3. The file is automatically formatted
π Result: Button.tsx is now properly formatted
Without the hook, you'd need to manually run:
npx prettier --write src/components/Button.tsx
During the interactive setup, you can choose which hooks to enable:
π§ Select automation hooks to include (use space to select):
β― β PreToolUse: Block console.log statements in JS/TS files
β PostToolUse: Auto-format JS/TS files with Prettier
β PostToolUse: Run TypeScript type checking
β― PostToolUse: Warn about wildcard imports
β― PostToolUse: Run tests automatically for modified files
β― Stop: Run ESLint on changed files
β― Stop: Analyze bundle size impact
β― Notification: Log Claude Code notifications
Controls:
- Space - Toggle specific hook on/off
- Enter - Confirm selection
- β Back - Return to previous step
- π Automatic Quality Assurance - Code formatting, linting, and type checking happen automatically
- β‘ Faster Development - No need to manually run formatting or testing commands
- π‘οΈ Security - Automatic dependency auditing and vulnerability detection
- π Performance Monitoring - Bundle size analysis and optimization warnings
- π§ͺ Test Coverage - Automatic test execution ensures code quality
MCP (Model Context Protocol) servers extend Claude Code with additional capabilities. During setup, you can select which MCP servers to include in your project:
MCP servers are external tools that Claude Code can communicate with to access specialized functionality like databases, APIs, file systems, and more. Each server provides specific tools and resources that enhance Claude's capabilities.
π οΈ TypeScript SDK
- Purpose: Official Anthropic SDK for building MCP servers and clients
- Use Case: Develop custom MCP servers or integrate with existing ones
π GitHub MCP
- Purpose: Integration with GitHub API for managing repos, issues, and PRs
- Use Case: Automate GitHub workflows, manage issues, create PRs
π€ Puppeteer MCP
- Purpose: Browser automation using Google Puppeteer
- Use Case: Web scraping, automated testing, screenshot generation
π¬ Slack MCP
- Purpose: Access to real-time Slack conversations and workflows
- Use Case: Automate Slack messaging, monitor channels, workflow integration
π File System MCP
- Purpose: Local file management compatible with any language
- Use Case: Advanced file operations, directory management, file monitoring
π Python SDK
- Purpose: Official Python SDK with FastMCP for rapid development
- Use Case: Build Python-based MCP servers quickly
π³ Docker MCP
- Purpose: Isolated code execution via Docker containers
- Use Case: Safe code execution, environment isolation, container management
π Jupyter MCP
- Purpose: Integration with interactive Jupyter notebooks
- Use Case: Data analysis, machine learning workflows, interactive computing
ποΈ PostgreSQL MCP
- Purpose: Natural language queries to PostgreSQL databases
- Use Case: Database operations, data analysis, SQL query generation
π Opik MCP
- Purpose: Observability for LLM apps with tracing and metrics
- Use Case: Monitor AI applications, performance tracking, debugging
β‘ Rust MCP SDK
- Purpose: High-performance asynchronous SDK for Rust
- Use Case: Build fast, concurrent MCP servers
π₯οΈ HT MCP
- Purpose: Pure Rust implementation for headless terminal interaction
- Use Case: Terminal automation, CLI tool integration
π Rust Docs MCP
- Purpose: Prevents outdated code suggestions with updated Rust documentation
- Use Case: Always current Rust API documentation and examples
βοΈ Substrate MCP
- Purpose: Interact with Substrate-based blockchains
- Use Case: Blockchain development, smart contract interaction
π MCP Proxy
- Purpose: Fast proxy between stdio and SSE protocols
- Use Case: Protocol bridging, performance optimization
π’ Go SDK
- Purpose: Official SDK maintained with Google for Go development
- Use Case: Build Go-based MCP servers with official support
π MCP Language Server
- Purpose: Semantic tools for Go: definitions, references, diagnostics
- Use Case: Code analysis, refactoring assistance, symbol navigation
π Gin MCP
- Purpose: Expose Gin APIs automatically as MCP tools
- Use Case: Web API development, REST service integration
ποΈ Go MySQL MCP
- Purpose: Easy-to-use MySQL server built in Go
- Use Case: Database operations, MySQL integration
πΉ Go Archer
- Purpose: Visual dependency analysis for Go packages
- Use Case: Code architecture visualization, dependency management
π§ Memory Bank MCP
- Purpose: Centralized memory system for AI agents
- Use Case: Persistent context, session management, knowledge retention
π€ Sequential Thinking MCP
- Purpose: Helps LLMs decompose complex tasks into logical steps
- Use Case: Problem-solving assistance, task planning, workflow optimization
π Brave Search MCP
- Purpose: Privacy-focused web search tool
- Use Case: Web research, information gathering, search automation
πΊοΈ Google Maps MCP
- Purpose: Integrates Google Maps for geolocation and directions
- Use Case: Location services, mapping, geographic data
πΈοΈ Deep Graph MCP (Code Graph)
- Purpose: Transforms source code into semantic graphs via DeepGraph
- Use Case: Code analysis, dependency visualization, architecture understanding
During the interactive setup, you can choose which MCP servers to enable:
π§ Select MCP servers to include (use space to select):
β― β TypeScript SDK - Official Anthropic SDK for building MCP servers and clients in JS/TS
β File System MCP - Local file management; compatible with any language
β Memory Bank MCP - Centralized memory system for AI agents
β― GitHub MCP - Integration with GitHub API for managing repos, issues, and PRs
β― Puppeteer MCP - Browser automation using Google Puppeteer
β― Slack MCP - Access to real-time Slack conversations and workflows
β― Sequential Thinking MCP - Helps LLMs decompose complex tasks into logical steps
β― Brave Search MCP - Privacy-focused web search tool
β― Google Maps MCP - Integrates Google Maps for geolocation and directions
β― Deep Graph MCP (Code Graph) - Transforms source code into semantic graphs via DeepGraph
Controls:
- Space - Toggle specific MCP server on/off
- Enter - Confirm selection
- β Back - Return to previous step
Selected MCP servers are configured in the .mcp.json
file:
{
"mcpServers": {
"typescript-sdk": {
"name": "TypeScript SDK",
"description": "Official Anthropic SDK for building MCP servers and clients in JS/TS",
"command": "node",
"args": ["path/to/ts-sdk-server.js"],
"env": {}
},
"github": {
"name": "GitHub MCP",
"description": "Integration with GitHub API for managing repos, issues, and PRs",
"command": "node",
"args": ["path/to/server-github"],
"env": {
"GITHUB_TOKEN": "..."
}
}
}
}
- π Extended Capabilities - Access specialized tools and services beyond Claude's base functionality
- ποΈ Custom Integrations - Connect Claude to your existing tools and workflows
- π Data Access - Query databases, APIs, and external services directly
- π€ Automation - Automate complex workflows that require multiple systems
- π‘οΈ Controlled Environment - Each MCP server runs in its own controlled context
cd my-react-app
npx claude-code-templates
# The installer detects React and suggests optimal configuration
# Use β Back to modify selections during setup
# React + TypeScript project with all React-specific commands
npx claude-code-templates --language javascript-typescript --framework react --yes
# Node.js API with database and middleware commands
npx claude-code-templates --language javascript-typescript --framework node --yes
# Vue.js project with composables and component commands
npx claude-code-templates --language javascript-typescript --framework vue --yes
# Angular project with services and component commands
npx claude-code-templates --language javascript-typescript --framework angular --yes
# Preview what would be installed
npx claude-code-templates --dry-run
# Skip prompts and use defaults
npx claude-code-templates --yes
# Install to different directory
npx claude-code-templates --directory /path/to/project
# Specific language without framework
npx claude-code-templates --language javascript-typescript --framework none --yes
This repository contains optimized templates for different languages and use cases:
claude-code-templates/
βββ π¦ cli-tool/ # NPM package for automated installation
βββ π common/ # Universal templates for any language
βββ π javascript-typescript/ # JS/TS templates with framework support
β βββ examples/
β β βββ react-app/ # React-specific commands
β β βββ vue-app/ # Vue.js-specific commands
β β βββ angular-app/ # Angular-specific commands
β β βββ node-api/ # Node.js-specific commands
β βββ CLAUDE.md
β βββ .claude/
βββ π python/ # Python templates (coming soon)
βββ π rust/ # Rust templates (coming soon)
βββ π go/ # Go templates (coming soon)
Each language folder includes:
CLAUDE.md
- Language-specific configuration and best practicesREADME.md
- Detailed setup and usage instructions.claude/
- Base commands and settingsexamples/
- Framework-specific configurations and commands
- Automatic Backups - Existing
CLAUDE.md
and.claude/
files are backed up - Confirmation Required - Always asks before making changes (unless
--yes
flag is used) - Dry Run Mode - Preview what will be installed with
--dry-run
- Cancel Anytime - Press Ctrl+C or answer 'No' to cancel installation
- Back Navigation - Go back to modify previous selections during interactive setup
# Create CLAUDE.md manually
# Research best practices for your language and framework
# Set up custom commands for React/Vue/Angular/Node.js/Django/Flask/FastAPI
# Configure linting and formatting for each framework
# Add testing workflows for different frameworks
# Set up automation hooks for code quality
# ... hours of configuration research
# JavaScript/TypeScript + React
npx claude-code-templates --language javascript-typescript --framework react --yes
# Python + Django
npx claude-code-templates --language python --framework django --yes
# β
Done in 30 seconds with framework-specific commands and automation!
- Save Time - Skip hours of configuration research and setup
- Framework-Aware - Get commands tailored to your specific framework (React hooks, Django models, FastAPI endpoints, etc.)
- Best Practices - Use proven configurations optimized for each framework
- Automation Ready - Pre-configured hooks for code formatting, linting, testing, and type checking
- Stay Updated - Always get the latest templates with
npx
- Consistency - Use the same configuration patterns across all your projects
- Enhanced UX - Navigate back and forth during setup to perfect your configuration
- Node.js 14+ (for the installer)
- Claude Code installed
npm install -g @anthropic-ai/claude-code
cd your-project
npx claude-code-templates
claude
If you prefer manual setup, you can copy templates directly:
# Clone the repository
git clone https://github.com/davila7/claude-code-templates.git
# Copy templates for JavaScript/TypeScript + React
cp -r claude-code-templates/javascript-typescript/CLAUDE.md your-project/
cp -r claude-code-templates/javascript-typescript/.claude/ your-project/
cp -r claude-code-templates/javascript-typescript/examples/react-app/.claude/commands/* your-project/.claude/commands/
# Or copy Node.js API templates
cp -r claude-code-templates/javascript-typescript/CLAUDE.md your-project/
cp -r claude-code-templates/javascript-typescript/.claude/ your-project/
cp -r claude-code-templates/javascript-typescript/examples/node-api/.claude/commands/* your-project/.claude/commands/
We welcome contributions! Help us make Claude Code even better for everyone.
- Fork this repository
- Create a feature branch (
git checkout -b feature/amazing-template
) - Add your improvements or new language support
- Test your templates with real projects
- Submit a pull request
- New Language Support - Rust, Go, Java, C#, PHP, etc.
- Framework Templates - Svelte, Next.js, Nuxt.js, NestJS, Laravel, Spring Boot, etc.
- Improved Commands - Better testing, deployment, debugging workflows
- Documentation - Clearer guides and examples
- Bug Fixes - Improvements to existing templates
- Follow the established folder structure
- Include comprehensive
CLAUDE.md
andREADME.md
files - Add practical custom commands in
.claude/commands/
- Provide real-world examples
- Test with actual projects before submitting
This project is licensed under the MIT License - see the LICENSE file for details.
- Anthropic for creating Claude Code
- The Community - All contributors who help improve these templates
- Open Source Projects - Inspiration from create-react-app, vue-cli, and similar tools
- Issues - Report bugs or request features
- Discussions - Join community discussions
- Documentation - Claude Code Official Docs
β Found this useful? Give us a star on GitHub!
π Ready to supercharge your development with Claude Code? Run npx claude-code-templates
now!