Contributing Templates
Relevant source files
The following files were used as context for generating this wiki page:
Templates within the Claude Code Templates project are comprehensive configurations designed to provide a complete development stack for Anthropic's Claude Code. They serve as pre-packaged environments that include CLAUDE.md files, specialized agents, custom slash commands, and Model Context Protocol (MCP) server configurations to optimize development workflows for specific languages, frameworks, or domains.
The project encourages community contributions to expand its library of high-priority templates, particularly for modern frameworks (Svelte, Astro), backend services (NestJS, Fastify), and industry-specific applications. Contributors are expected to maintain high quality standards, ensuring that templates are comprehensive, well-documented, and practically tested against real-world scenarios.
Sources: CONTRIBUTING.md:144-154, README.md:17-23
Template Architecture and Structure
A valid template is organized within its own directory under cli-tool/templates/ and must follow a specific file hierarchy to be recognized by the CLI tool.
File Hierarchy
The core of a template consists of the main configuration file and supporting automation directories:
| File/Directory | Purpose | Required |
|---|---|---|
CLAUDE.md | Primary configuration file containing project standards and commands. | Yes |
.claude/ | Directory for automation hooks and template-specific commands. | Yes |
.claude/settings.json | Configuration for automation hooks and triggers. | Yes |
.claude/commands/ | Storage for template-specific slash commands. | Yes |
.mcp.json | Configuration for external service integrations via MCP. | Yes |
README.md | Documentation explaining the template's purpose and usage. | Yes |
Sources: CONTRIBUTING.md:156-168, cli-tool/templates/common/README.md:7-14
Data Flow Diagram
This diagram illustrates how a template's components interact during installation and runtime within Claude Code.
Sources: CONTRIBUTING.md:156-176, README.md:38-46
Contribution Workflow
Contributing a new template involves creating a structured directory, defining standard configurations, and performing rigorous testing.
Creation Process
- Directory Initialization: Create a new folder in
cli-tool/templates/named after the framework or language (e.g.,react-vite). - Configuration Authoring: Develop the
CLAUDE.mdfile following project-specific guidelines, including development commands, security standards, and testing practices. - Command and Hook Definition: Populate the
.claude/directory with markdown files for custom slash commands and JSON for automation settings. - Integration Setup: Define necessary external tools in
.mcp.jsonif the template requires database or API access.
Sources: CONTRIBUTING.md:156-176
Quality Standards
Every submitted template must meet the following criteria:
- Comprehensive Configuration: Must include all necessary Claude Code setup files.
- Practical Commands: Should provide useful slash commands relevant to the template's domain.
- Documentation: The
CLAUDE.mdmust be well-documented with clear examples. - Proper MCPs: Relevant external integrations must be correctly configured.
Sources: CONTRIBUTING.md:178-183
Testing and Validation
Before submission, templates must be validated using the project's internal testing suite to ensure they install and function correctly.
Automated Test Suite
The project uses several test scripts and a Makefile to verify template integrity.
Manual Verification Steps
Contributors are encouraged to perform the following manual checks:
- Dry Run: Execute
npx claude-code-templates@latest --template your-template --dry-runto see intended changes without modifying files. - Isolated Environment: Install the template in a fresh directory (e.g.,
/tmp/test-claude) and verify file content withls -la .claude/commands/. - Functional Check: Verify that
CLAUDE.mdincludes correct build and test commands for the target technology.
Sources: cli-tool/TESTING.md:44-55, cli-tool/TESTING.md:105-115
Categorization and Priorities
The project organizes templates into categories to help users find the right tool for their stack.
| Category | Description | Priority |
|---|---|---|
| Modern Frameworks | Svelte, SvelteKit, Astro, Qwik | High |
| Backend Services | NestJS, Fastify, Hono, tRPC | High |
| Full-Stack | T3 Stack, Remix, Create-React-App | High |
| Mobile | React Native, Expo, Flutter | High |
| Language-Specific | Python, TypeScript, Go, Rust | Medium |
Sources: CONTRIBUTING.md:174-176, CONTRIBUTING.md:300-305
Conclusion
Contributing templates to Claude Code Templates is a structured process that ensures Anthropic's Claude Code can be utilized effectively across diverse technical stacks. By following the required directory structure, adhering to quality standards, and utilizing the provided testing tools, contributors help build a robust ecosystem of AI-ready development environments. Successful contributions are recognized in the project's release notes and community pages.