Project Structure
CLI Tool Architecture
Main Entry Point
Location:cli-tool/src/index.js
The CLI tool is a Node.js application that:
- Parses command-line arguments using
commander - Fetches component files from GitHub
- Installs components to the user’s project
- Tracks downloads via API
- Provides interactive installation mode
Installation Flow
Component System
Component Types
Agents (cli-tool/components/agents/)
- Format: Markdown with YAML frontmatter
- Installation:
.claude/agents/{name}.md - Purpose: AI specialists for specific domains
cli-tool/components/commands/)
- Format: Markdown with YAML frontmatter
- Installation:
.claude/commands/{name}.md - Purpose: Custom slash commands for workflows
cli-tool/components/mcps/)
- Format: JSON
- Installation:
.mcp.json(merged) - Purpose: External service integrations
cli-tool/components/settings/)
- Format: JSON
- Installation:
.claude/settings.json(merged) - Purpose: Claude Code configuration
cli-tool/components/hooks/)
- Format: JSON + optional scripts
- Installation:
.claude/settings.json+.claude/hooks/ - Purpose: Automation triggers for events
cli-tool/components/skills/)
- Format: Markdown + references + scripts
- Installation:
.claude/skills/{name}/ - Purpose: Modular capabilities (Anthropic format)
Component Categories
Components are organized by category:Analytics Dashboard
Location:cli-tool/src/analytics/
Real-time monitoring dashboard for Claude Code sessions.
Architecture
Features
- Real-time conversation monitoring
- State detection (active, idle, stopped)
- Process detection (running commands)
- Performance metrics
- WebSocket-based live updates
- Multi-level caching for performance
Usage
Website Architecture
Location:docs/
Static website at aitmpl.com for browsing components.
Data Flow
- Component Scanning:
scripts/generate_components_json.pyscanscli-tool/components/ - Catalog Generation: Generates
docs/components.jsonwith embedded content - Website Loading: Browser loads JSON and renders component cards
- Download Tracking: Installation tracked via
/api/track-download-supabase
Component Catalog Format
API Architecture
Location:api/
Vercel Serverless Functions for backend operations.
Critical Endpoints
/api/track-download-supabase
- Tracks component downloads for analytics
- Used by CLI on every installation
- Database: Supabase (
component_downloadstable)
/api/discord/interactions
- Discord bot slash commands
- Features:
/search,/info,/install,/popular
/api/claude-code-check
- Monitors Claude Code releases
- Vercel Cron: every 30 minutes
- Database: Neon (version tracking)
Dashboard Architecture
Location:dashboard/
Astro + React + Tailwind dashboard at app.aitmpl.com.
Architecture
- Framework: Astro 5 with React islands
- Auth: Clerk (user collections)
- Styling: Tailwind v4
- Data: Fetches from
https://www.aitmpl.com/components.json - API Proxy: Proxies to main site API
Directory Structure
Cloudflare Workers
Location:cloudflare-workers/
Independent serverless functions on Cloudflare.
docs-monitor
Monitors code.claude.com/docs for changes:- Runs every hour
- Sends Telegram notifications
- Tracks documentation updates
pulse
Weekly KPI reports:- Runs Sundays at 14:00 UTC
- Collects metrics from multiple sources:
- GitHub (stars, forks, commits)
- Discord (members, messages)
- Supabase (downloads)
- Vercel (deployments)
- Google Analytics (traffic)
- Sends consolidated Telegram report
Deployment Architecture
Vercel Projects
Two separate Vercel projects:| Project | Domain | Root Directory | Purpose |
|---|---|---|---|
aitmpl | www.aitmpl.com | / | Main site + API |
aitmpl-dashboard | app.aitmpl.com | dashboard | Dashboard app |
CI/CD Pipeline
GitHub Actions (.github/workflows/deploy.yml):
- Changes in
docs/,api/, orvercel.json→ Deploy main site - Changes in
dashboard/→ Deploy dashboard - Auto-deploy on push to
mainbranch
Deployment Commands
Database Architecture
Supabase
Purpose: Download tracking and analytics Tables:component_downloads- Track component installationsid,component_type,component_name,component_categoryinstalled_at,user_id,project_id
Neon (PostgreSQL)
Purpose: Claude Code release monitoring Tables:claude_code_versions- Version historyclaude_code_changes- Change trackingdiscord_notifications_log- Notification historymonitoring_metadata- Monitoring state
Security Architecture
Environment Variables
All secrets stored in environment variables:Path Security
- Use relative paths only
- No absolute paths in components
- No hardcoded home directories
- Use
$CLAUDE_PROJECT_DIRfor dynamic paths
Performance Considerations
Component Catalog
- Generated catalog is ~2MB (compressed)
- Loaded once and cached in browser
- Components filtered client-side for speed
Analytics Dashboard
- Multi-level caching (memory + disk)
- WebSocket for real-time updates (not polling)
- Efficient file watching (chokidar)
- Performance monitoring built-in
API Endpoints
- Serverless functions (fast cold starts)
- Database connection pooling
- Response caching where appropriate
Monitoring and Observability
Vercel Logs
Health Checks
- Analytics dashboard:
GET /api/health - API endpoints: Built-in error logging
- Cloudflare Workers: Error tracking
Metrics Tracking
- Component downloads (Supabase)
- Website traffic (Google Analytics)
- API usage (Vercel analytics)
- GitHub activity (pulse worker)
Next Steps
Component Guidelines
Best practices for creating components
Code Standards
Coding conventions and style guide
Testing Workflow
How to test your contributions
Publishing Workflow
Complete publishing process