Skip to main content
This guide covers the coding standards, conventions, and best practices for contributing to Claude Code Templates.

Security Guidelines

CRITICAL: NEVER hardcode secrets or IDs in code. This is the most important rule.

Never Hardcode Secrets

NEVER write these in code:
  • API keys, tokens, passwords
  • Project IDs, organization IDs
  • Vercel project/org IDs
  • Supabase URLs
  • Discord IDs
  • Database connection strings
  • Any infrastructure identifier
ALL secrets must go in .env files.

Using Environment Variables

For Node.js:
For Python:

.env File Structure

Create .env.example with placeholder values:
Verify .env is in .gitignore:

If You Accidentally Commit a Secret

If you commit a secret, it’s compromised FOREVER (git history). Act immediately.
1

Revoke the Key

Immediately revoke the exposed key/token in the service.
2

Generate New Key

Create a new key/token in the service.
3

Update .env

Update your .env file with the new key.
4

Never Reuse

The old key is compromised forever. Never reuse it.

Path Handling

Always Use Relative Paths

Cross-Platform Compatibility

Use path.join() for cross-platform paths:

Path Constants

Define path constants for reusability:

Naming Conventions

File Names

Variables and Functions

Component Names

Code Style

JavaScript/Node.js

General Guidelines

Error Handling

Async Operations

Python

General Guidelines

Error Handling

Documentation Standards

Code Comments

JSDoc Comments

Python Docstrings

Testing Standards

Test Structure

Test Coverage Goals

  • Aim for 70%+ code coverage
  • Test all critical paths
  • Test error handling
  • Test edge cases
  • Test boundary conditions

Git Workflow

Commit Messages

Branch Naming

Performance Considerations

Caching

Async Optimization

Next Steps

Component Guidelines

Best practices for creating components

Testing Workflow

Complete testing guide

Architecture

Project architecture overview

Publishing Workflow

Publishing to npm