davila7--claude-code-templates
1.8 KiB
1.8 KiB
paths
| paths | ||
|---|---|---|
|
CLI Tool — Component System
This is the npm package claude-code-templates. A Node.js CLI for installing Claude Code components.
Architecture
- Entry point:
src/index.js - Components live in
cli-tool/components/{type}/{category}/{name}.md - Types: agents, commands, mcps, hooks, settings, skills, loops, templates
- Loops live at
cli-tool/components/loops/{category}/{name}.md(markdown + frontmatter), install to.claude/loops/, and auto-install the components listed in theircomponents:frontmatter field - Catalog generated by
python scripts/generate_components_json.py
Component Files
- Format: Markdown with YAML frontmatter
- Names: kebab-case only (e.g.,
react-performance-expert.md) - No hardcoded secrets, API keys, or absolute paths
- Include clear description, usage examples, and tags
- Always validate with the
component-revieweragent before committing
After Adding/Modifying Components
- Run
python scripts/generate_components_json.pyto regenerate catalog - Copy
docs/components.jsontodashboard/public/components.json - Deploy dashboard
Error Reporting (opt-in)
cli-tool/src/error-reporting.js— crash reporting to Sentry, off by default. Requires explicitCCT_ERROR_REPORTING=truefrom the end user; always respects the existing opt-out flags (CCT_NO_TRACKING,CCT_NO_ANALYTICS,CI), which win over the opt-in.- Distinct from
tracking-service.js(anonymous usage analytics, on by default) — never conflate the two or default error reporting to on. - Wired into the top-level catch in
cli-tool/bin/create-claude-config.js.
Testing
npm test # Run all tests
npm run test:watch
Publishing
Always check npm view claude-code-templates version before publishing to avoid version conflicts.