Publishing Overview
The Claude Code Templates project publishes to npm asclaude-code-templates. The package provides the CLI tool that users run with npx claude-code-templates@latest.
Current version: Check package.json or run
npm view claude-code-templates versionPrerequisites
1. npm Account Setup
- Create account at npmjs.com
- Request access to the
claude-code-templatespackage (for maintainers)
2. npm Authentication
Create a granular access token:1
Generate Token
- Go to npmjs.com/settings/~/tokens
- Click “Generate New Token” → “Granular Access Token”
- Configure:
- Permissions: Read and Write
- Packages: Select
claude-code-templates - IP Allowlist: Optional (for security)
- Bypass 2FA: Enable (required for publishing)
2
Store Token Securely
Complete Publishing Workflow
Step 1: Update Component Catalog
Before publishing, regenerate the component catalog to include all changes:- Scans all components in
cli-tool/components/ - Validates format and structure
- Generates
docs/components.json(~2MB) - Runs security validation
Step 2: Run Tests
Ensure all tests pass before publishing:Step 3: Version Management
Determine and update the version number:Manual Version Update
Editpackage.json to bump the version:
Automated Version Bump
Or use npm version command:The local
package.json version may drift from npm if published from CI. Always check npm view claude-code-templates version first.Step 4: Commit Version Bump
Commit the version change:Step 5: Publish to npm
Step 6: Tag Release
Create a Git tag for the release:Step 7: Deploy Website
Deploy the updated website with new components:For production deployments, always use the deployer agent (
.claude/agents/deployer.md) which runs pre-deploy checks.Step 8: Verify Release
Verify the release was successful:Publishing Components Only
If you’re adding components without changing the CLI:Version Numbering Guidelines
Patch Version (x.x.X)
Increment for:- Bug fixes
- Documentation updates
- Minor component improvements
- Security patches
Minor Version (x.X.0)
Increment for:- New components added
- New features (backward compatible)
- Significant improvements
- New CLI options
Major Version (X.0.0)
Increment for:- Breaking changes
- Major architecture changes
- Incompatible API changes
- CLI breaking changes
Rollback Procedure
If a release has issues:1. Deprecate Bad Version
2. Publish Fixed Version
3. Rollback Website
Common Issues
”Version already exists"
"401 Unauthorized"
"403 Forbidden"
"EPUBLISHCONFLICT”
npm Publishing Notes
Granular Access Tokens
- Classic tokens were revoked December 2025
- Use granular access tokens from npmjs.com/settings/~/tokens
- Token must have:
- Read and Write permissions for
claude-code-templates - “Bypass 2FA” enabled (required for publishing)
- Read and Write permissions for
- Always remove token after publishing:
npm config delete
Package Scope
Package is unscoped (claude-code-templates not @org/claude-code-templates):
- Simpler installation:
npx claude-code-templates - No organization required
- Public package (not private)
.npmignore
Files excluded from npm package:Publishing Checklist
Before publishing:1
Component Catalog
2
Tests Pass
3
Version Updated
4
Changes Committed
5
Token Configured
6
Publish
7
Tag Release
8
Deploy Website
9
Clean Up
10
Verify
Post-Publishing
After successful publishing:1. Announce Release
- Update GitHub Discussions
- Post in Discord community
- Tweet about new features (if significant)
2. Monitor for Issues
3. Update Documentation
- Update CHANGELOG.md with release notes
- Update README.md if features changed
- Update docs site if needed
Next Steps
Component Guidelines
Best practices for creating components
Testing Workflow
Complete testing guide
Architecture
Project architecture overview
Code Standards
Coding conventions and style