Commit Graph

186 Commits

Author SHA1 Message Date
spartan bc4618b072 Merge commit from fork
* Fix unauthenticated command injection (RCE) in Studio server

The `--studio` server (cli-tool/src/sandbox-server.js) bound to 0.0.0.0
with wildcard CORS and no authentication, and passed request-body fields
into spawn(..., { shell: true }). Because shell:true makes Node join the
argv array into a single `sh -c` string, the fields were parsed by the
shell, allowing OS command injection (RCE) via POST /api/execute (prompt)
and POST /api/install-agent (agentName), reachable from the LAN or a
malicious web page (wildcard CORS).

- Remove shell:true from all three spawns so arguments stay discrete argv
  entries; shell metacharacters can no longer inject commands.
- Validate agentName against ^[A-Za-z0-9._/-]+$ before use.
- Bind the server to 127.0.0.1 only (removes the LAN vector).
- Restrict CORS to the local UI origin and reject cross-origin requests
  (removes the drive-by browser vector).

Fixes GHSA-79wm-x847-7cvg.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

* security: Windows-safe spawns + release bump on top of GHSA-79wm-x847-7cvg fix

Builds on @spartan8806's fix (advisory-fix-1). Adds the two pieces that fix
lacked:

- Resolve npx/claude via their .cmd shims on Windows (NPX_CMD/CLAUDE_CMD).
  Without shell:true, bare spawn('npx'/'claude') fails with ENOENT on win32,
  which would break agent install/local execution. This keeps the security fix
  cross-platform.
- Bump version to 1.29.4 (root + cli-tool package.json) and add the 1.29.4
  Security entry to CHANGELOG for the patched release.

Refs GHSA-79wm-x847-7cvg.

---------

Co-authored-by: spartan8806 <spartan8806@users.noreply.github.com>
Co-authored-by: Claude Opus <noreply@anthropic.com>
Co-authored-by: Dani <dan.avila7@gmail.com>
2026-07-14 19:25:34 -04:00
daniel 05a59271a4 feat: finish Sentry setup for dashboard and CLI, all 3 projects verified
Completes the error tracking rollout: aitmpl-dashboard and aitmpl-cli Sentry
projects now exist alongside aitmpl-workers, and all three are verified
end-to-end (manual test events returned HTTP 200 and appeared in each
project's Issues dashboard).

- Dashboard: SENTRY_DSN set as a Cloudflare Pages secret on aitmpl-dashboard
  (production). No code change needed — error-tracking.ts already read it.
- CLI: the aitmpl-cli DSN is public by design (send-only), so it ships as
  DEFAULT_SENTRY_DSN in error-reporting.js instead of requiring every user
  to configure their own Sentry project. Reporting itself stays opt-in
  (CCT_ERROR_REPORTING=true), unaffected by this change.
- .env.example and CLAUDE.md updated to match reality; removed a stale
  Vercel Deployment block left over from the Cloudflare Pages migration.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-04 17:31:49 -04:00
daniel 8a09d13800 feat: add Sentry error tracking to workers, dashboard, and CLI
Adds free-tier Sentry error reporting to close the biggest observability
gap: automated cron/worker failures were previously invisible (aitmpl-crons
had no error handling at all). Uses a dependency-free fetch()-based Sentry
envelope client (cloudflare-workers/*/sentry.js, dashboard error-tracking.ts,
cli-tool error-reporting.js) instead of the official SDKs, to keep the
zero-dependency worker style and avoid Cloudflare Pages SSR friction.

- Cloudflare Workers: report failures + Cron Monitor check-ins in crons,
  pulse, and docs-monitor (complementing, not replacing, existing Telegram
  alerts). Also drops the pulse Vercel collector (VERCEL_API/collectVercel),
  since the dashboard no longer deploys to Vercel.
- Dashboard: captureApiError() wired into claude-code-check, health-check,
  and the three track-* endpoints.
- CLI: opt-in only crash reporting (CCT_ERROR_REPORTING=true), always
  deferring to the existing CCT_NO_TRACKING/CCT_NO_ANALYTICS/CI opt-outs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-04 16:38:20 -04:00
Daniel Avila 7f890b1b3b feat: add Loops component type with referenced components (#643)
* feat: add Loops component type with referenced components

Introduce "loops" as a new first-class component type — autonomous
agentic workflows (goal + interval + stop condition) inspired by Loop
Engineering and the Forward Future Loop Library. A loop references other
components (agents, skills, hooks, commands) and the dashboard renders
those references as clickable cards on the loop detail page.

- Add 10 starter loops under cli-tool/components/loops/
  (engineering, evaluation, operations)
- Catalog generator: scan loops + write per-component content files
- Dashboard: new type in icons/types/data, /loops page, and a
  "Referenced Components" section on the loop detail page
- CLI: --loop flag installs the loop to .claude/loops/ and
  auto-installs its referenced components
- Docs: CLAUDE.md and cli-tool rule updated

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T9ynMiCHt8JwdMd8KjCkES

* feat: add 8 more loops (goal/loop/schedule patterns)

Expand the loops catalog to 18, drawing ideas from community "Loop
Engineering" patterns. Adds loops across the three trigger verbs
(/goal, /loop, /schedule) and emphasizes the verifier-in-the-loop and
budget / anti-spin guardrails:

- engineering/five-minute-maintainer-loop
- engineering/build-test-fix-loop
- engineering/anti-spin-build-loop
- engineering/completion-contract-loop (goal)
- engineering/goal-refiner-loop (goal)
- engineering/adversarial-review-loop (cross-model)
- operations/overnight-pr-routine-loop (schedule)
- evaluation/human-approval-loop (human-in-the-loop)

All referenced components verified to exist; catalog regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T9ynMiCHt8JwdMd8KjCkES

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-21 20:19:16 -04:00
daniel 119bb1d0f6 feat: migrate analytics dashboard to Astro + modernize TUI
Analytics Dashboard (Phase 1 + Phase 2):
- Replace 8663-line vanilla JS monolith with Astro static build
- New bento-grid layout with Geist design system (dark/light themes)
- ECharts (offline, tree-shaken) replaces Chart.js CDN dependency
- React island with KPI cards, token timeline, activity heatmap, agent BarList
- WebSocket client with reconnect backoff; polling fallback when WS disconnects
- API client with 30s cache; normalizes backend field names (inputTokens→totalInput)
- Build source in analytics-ui/, output committed to src/analytics-web/
- Fix: /api/activity now uses in-memory cache (was re-scanning all files on each request)
- Fix: remove duplicate /api/agents route (dead code since Express uses first match)
- Fix: /api/data and /api/fast-update no longer mutate this.data.conversations in place

TUI Modernization:
- Add src/tui.js with @clack/prompts-powered banner and helpers
- Replace inline showBanner() in bin/create-claude-config.js with tui.showBanner()
- Migrate showMainMenu() in src/index.js to @clack select() (replaces inquirer)
- Add @clack/prompts ^1.5.1 and gradient-string ^2.0.2 to dependencies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 13:20:08 -04:00
Param 119da71024 fix: apply date range filter to all dashboard charts (#487)
- Token Distribution by Type: compute totals from date-filtered
  conversations instead of pre-aggregated detailedTokenUsage which
  always contained all historical data regardless of the selected range
- Daily Productivity Trends: skip conversations outside the selected
  date range (was iterating all conversations unconditionally)
- Workflow Intelligence charts: re-fetch /api/agents with startDate
  and endDate query params on filter apply instead of reusing stale
  initial-load data

Fixes #382
2026-04-01 21:21:55 -04:00
eason 6a4fa8213c fix: recognize both "Task" and "Agent" tool names in analytics (#491)
Claude Code JSONL logs use `content.name === 'Agent'` but the
analytics code only checks for `'Task'`, causing Agent Usage
Distribution, Agent Activity Timeline, and Workflow Efficiency Score
charts to show empty data.

Accept both tool names in AgentAnalyzer, chats-mobile, and
teams-dashboard.

Fixes #488

Co-authored-by: easonysliu <easonysliu@tencent.com>
2026-04-01 13:38:01 -04:00
daniel cf7e008c59 feat: Add monitoring points P1-P5 (installation outcomes, website events, API health)
- Create 3 Neon tables: installation_outcomes, website_events, api_health_logs
- Add API endpoints: track-installation-outcome, track-website-events, health-check
- Track CLI installation success/failure with timing and error classification
- Add website event tracker (search, cart, component views) with batched sendBeacon
- Add health-check cron every 15min with Discord alerts on failure
- Integrate tracking in all 6 installIndividual* functions with batchId support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:08:34 -05:00
daniel 42dba8b3c9 feat: Add Agent Teams Dashboard (--teams) for reviewing multi-agent collaboration sessions
Adds a new local web dashboard to visualize Claude Code team sessions:
- Express server on port 3338 with JSONL parsing from ~/.claude/projects/
- SVG flow diagram showing agent hierarchy and communication edges
- Click-to-open detail panel with accordion sections (interactions, messages, tasks, tools)
- Smart agent name resolution from task assignment payloads
- Team session detection filtering (TeamCreate/SendMessage protocol only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:44:24 -05:00
Daniel Avila c7397fe493 Blog standardization, worktree commands, and .gitignore fix (#341)
* fix: improve Chats Mobile security, CSS quality, and desktop layout

- Sanitize error.message with escapeHtml() to prevent XSS in innerHTML
- Replace !important overrides in .back-btn with proper specificity (.header-btn.back-btn)
- Add desktop side-by-side layout at 769px+ (360px sidebar + flexible chat view)
- Extract 100+ inline styles from analytics modal into reusable CSS classes

https://claude.ai/code/session_01Cfg7GGRKxgJoWiNj1EjWSb

* chore: standardize all 15 blog posts for consistency

Apply unified style guide across all local blog posts:
- Fix copyright year 2025 -> 2026 in all footers
- Remove inline styles from explore-components-banner (use CSS classes)
- Standardize CTA text to "800+" and relative links
- Fix OG tag prefix og:article: -> article: (code-reviewer)
- Fix www.aitmpl.com -> aitmpl.com in OG/Twitter/structured data
- Fix cover image absolute URLs to relative paths (e2b, nextjs)
- Standardize Mermaid theme to orange #F97316 (heygen)
- Fix author name to "Claude Code Templates" (neon-complete)
- Add missing explore-components-banner (security-hooks, vercel-monitor, hackathon)
- Add missing callout boxes (info-box, success-box) where absent
- Standardize CodeCopy JS and MarkdownCopier across posts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add worktree commands and blog post for parallel development

Add 4 worktree slash commands for git worktree lifecycle management:
- /worktree-init: create parallel worktrees from task descriptions
- /worktree-check: show current worktree status and task
- /worktree-deliver: commit, push, and create PR
- /worktree-cleanup: remove merged worktrees and branches

Add blog post explaining the Skill + Commands architecture pattern
where a discoverable Skill (worktree-guide) orchestrates manual
Commands for execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: ignore settings.local.json in all subdirectories

Change .claude/settings.local.json to **/settings.local.json
to cover nested paths like docs/.claude/settings.local.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: add missing allowed-tools to worktree commands

- worktree-cleanup: add Bash(grep:*) for merge check commands
- worktree-init: add Bash(sed:*) for branch name detection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-07 20:11:17 -05:00
Dani e4c2275bf6 feat(hooks): Add LangSmith tracing integration
Add comprehensive LangSmith observability integration for Claude Code:

- Add langsmith-tracing hook in monitoring category
  - Runs in background with & to avoid blocking
  - Official LangSmith stop_hook.sh script (33KB)
  - Automatic trace upload to LangSmith API
  - Session grouping with thread_id for continuity

- Add langsmith-tracing setting in telemetry category
  - Environment variables with placeholders
  - Easy installation for users
  - Clear instructions for API key setup

- Add bash script support to CLI (index.js)
  - Auto-downloads .sh files with executable permissions
  - Mirrors existing Python file handling
  - Critical for hook functionality

- Update security (.gitignore)
  - Protect .claude/settings.local.json (may contain API keys)
  - Protect .claude/hooks/ directory
  - Remove settings.local.json from git tracking

- Update component catalog (62 settings, 41 hooks)

Installation:
  npx claude-code-templates@latest --hook monitoring/langsmith-tracing
  npx claude-code-templates@latest --setting telemetry/langsmith-tracing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-09 18:45:10 -05:00
Dani cc4f2ab5f9 feat: Enlarge HUD panel and add animated counters
- Increased HUD panel size (padding: 30px, min-width: 280px)
- Larger fonts (labels: 16px, values: 18px)
- Implemented smooth counter animation from 0 to target value
- Counters now gradually increment instead of jumping to final value
- Added statsTarget and statsDisplay for smooth interpolation
- All three counters animate: Conversations, Components, Tool Calls
2025-12-31 21:56:05 -05:00
Dani c9ac113e95 fix: Add component counter and remove Active Days
- Fixed Components counter showing 0 (now increments with component-layer2 events)
- Removed Active Days from HUD display
- Cleaned up stats.days calculation and references
- Components now properly tracked in stats.components
2025-12-30 12:37:37 -05:00
Dani 09c72b6d46 perf: Optimize beam rendering for better performance
- Increased beam speed 5x (0.02 → 0.1) for faster completion
- Implemented beam queue system with max 10 active beams
- Removed visual effects (shadows, labels, particles) for better FPS
- Fixed duplicate counter increments (now updates once before beam)
- Added beamQueue cleanup in restart function
- Significantly improves rendering performance with many tools
2025-12-30 12:18:32 -05:00
Dani adb9b5e8f2 fix: Restructure timeline for gradual tool loading
- Changed from bulk toolCounts processing to individual tool-use events
- Implemented sequential dayOfYear assignment for controlled loading order
- Tools now load one by one like components (no simultaneous loading)
- Models load first (day 0), then tools (day 10+), then components
- Increased toolIncrement to 3 for proper spacing between tool animations
- Components start immediately after tools (no delay)
- Fixes extreme lag when loading many tools at once
2025-12-29 22:19:22 -05:00
Dani 3574e36de0 perf: Reduce tool processing speed to 1 per 5 frames
- Change from 3 tools/frame to 1 tool every 5 frames
- Reduces processing speed from 180 tools/sec to ~12 tools/sec
- Matches component loading speed for smoother rendering
- Prevents lag on slower devices

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 22:02:39 -05:00
Dani d2f604e7ab perf: Add gradual tool processing queue to prevent lag
- Implement tool queue system to process tools gradually
- Process only 3 tools per frame instead of all at once
- Prevents browser freeze when loading many tools simultaneously
- Improves rendering performance on slower devices

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 21:56:41 -05:00
Dani fd20e9d663 feat: Improve Year in Review 2025 dashboard UI/UX
- Remove timeline bar and date display from visualization
- Remove numbers from right panel (Models, Tools, Components lists)
- Implement collision detection system to prevent nodes overlapping
- Add restart function to clear permanent connection beams
- Clean up token tracking (removed from frontend display)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-29 21:50:21 -05:00
Dani fb18b698f5 fix(2025): Group subagents by type to reduce node count
- Group Plan, Explore, Agent subagents by type instead of individual IDs
- Aggregate counts per day to reduce timeline events
- Prevents rendering issues with thousands of subagent nodes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 21:06:41 -05:00
Dani 218342d9a7 feat(2025): Add interactive controls and improve visualization
- Display percentages instead of absolute counts for tools, models, and components
- Position nodes randomly based on percentage (higher % = closer to center)
- Add zoom in/out with mouse wheel (30%-300%)
- Add pan canvas by dragging background
- Add drag & drop for tool and component nodes
- Double-click to reset zoom/pan
- Make connection beams permanent with subtle pulse animation
- One permanent connection per node for clean visualization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 20:10:06 -05:00
Dani 7c45c387b3 feat: Add --2025 CLI command for Year-in-Review dashboard
- Add --2025 option to launch Year-in-Review visualization
- Support --tunnel flag with --2025 for remote access
- Track analytics dashboard usage for 2025 page
- Update allowed bash commands in local settings

Usage: cct --2025 [--tunnel]

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 07:45:49 -05:00
Dani d56c68d0d5 feat: Add 2025 Year-in-Review visualization
- Gource-style 3-layer circular visualization (models/tools/components)
- Interactive tooltips with usage counts for all node types
- Real-time legend panels: Models Used, Tools Used, Components Used
- Multiple animated beams based on actual tool call counts
- Backend uses totalToolCalls for accurate activity metrics
- Optimized performance (~100ms for 86 conversations)

Technical Details:
- Center layer: Model pie chart with usage-based sizing
- Middle layer (250px): Tools with count badges
- Outer layer (400px): Commands, Skills, MCPs, Subagents
- YearInReview2025 backend analyzes conversations without overhead
- Tooltip system detects hover on pie slices, circles, and outer nodes
- Frontend processes toolCounts and modelCounts for precise visualization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 07:45:49 -05:00
Dani 1a92c41eaa fix: Update script references after reorganization
Updated all references to point to new script locations:
- generate_components_json.py → scripts/generate_components_json.py
- generate_trending_data.py → scripts/generate_trending_data.py

Files updated:
- .github/workflows/update-json-data.yml
- CLAUDE.md
- docs/CLAUDE.md
- docs/api/README.md
- docs/guides/growth-kit-pr.md
- cli-tool/src/validation/README.md

This ensures CI/CD workflows and documentation are in sync with the new project structure.

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 16:25:37 -05:00
Moritz Schmitz von Hülst 9400cc1fb9 fix: handle object-based plugin sources and directory marketplace type (#152)
- Fix #150: Check if pluginDef.source is a string before passing to path.join()
  Marketplace aggregators use object format {source: "url", url: "..."} to
  reference external repos, which caused path.join() to throw an error.

- Fix #151: Add support for "directory" source type in getMarketplaceType()
  Claude Code uses "directory" for filesystem-based marketplaces, but only
  "local" was being checked. Now both are recognized as Local type.
  Also added "url" type recognition.
2025-12-20 14:11:46 -05:00
Dani b69e56ae20 feat: Add plugin skills support to Skills Manager Dashboard
🎯 Skills Manager now detects skills from 3 sources:
- Personal: ~/.claude/skills/
- Project: .claude/skills/
- Plugin: ~/.claude/plugins/marketplaces/*/plugins/*/skills/*/

✨ Features:
- Added loadPluginSkills() to scan marketplace-installed skills
- Skills from /plugin install now appear in dashboard
- Detailed logging for debugging skill detection
- Fixed filter counts to show consistent totals

🔧 Improvements:
- Filter counts remain static regardless of active filter
- Shows total count for each category (All, Personal, Project, Plugin)
- Enhanced logging for better troubleshooting
- Supports skills installed via Claude Code plugin system

📦 Version: 1.28.3

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-15 15:40:19 -05:00
Dani 3f65d42373 feat: Add automatic port fallback for Skills Dashboard
When port 3337 is in use, the dashboard will automatically try the next available port
(3338, 3339, etc.) with a clear message to the user.

This prevents EADDRINUSE errors and improves user experience.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-15 11:21:15 -05:00
Dani 51db491ceb fix: Change --skills to --skills-manager to avoid conflict with component installation
The --skills flag was conflicting with the existing --skills component installation command,
causing EADDRINUSE errors on port 3337. Changed Skills Dashboard to use --skills-manager instead.

Changes:
- bin/create-claude-config.js: --skills → --skills-manager
- src/index.js: options.skills → options.skillsManager
- SKILLS_DASHBOARD.md: Updated usage examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-15 11:12:53 -05:00
Dani e071afb317 feat: Add Skills Dashboard with progressive context loading visualization
Implements a comprehensive Skills Dashboard accessible via `--skills` flag that visualizes
Claude Code's 3-level progressive context loading system according to official documentation.

Features:
- **Level 1: Metadata** - Always loaded (~100 tokens): name, description, allowed-tools from YAML
- **Level 2: Instructions** - When triggered (<5k tokens): SKILL.md body with workflows
- **Level 3+: Resources & Code** - As needed (unlimited): Additional markdown, scripts, templates
  - Instructions: Additional .md files with specialized guidance
  - Code: Executable scripts (.py, .js, .sh) run via bash without loading into context
  - Resources: Reference materials (schemas, API docs, templates, examples)

Technical Implementation:
- Express.js server on port 3337 with RESTful API
- Real-time skill scanning from ~/.claude/skills and .claude/skills
- Progressive file categorization: alwaysLoaded, onDemand, progressive
- Modern UI with level cards, flow arrows, and resource categorization
- File type detection and proper context for markdown references vs executable code

Dashboard shows:
- Grid/list view of all installed skills
- Filter by source (Personal, Project, Plugin)
- Sort by name, file count, last modified
- Modal detail view with 3-level loading visualization
- Visual flow arrows between levels showing loading triggers
- Category descriptions matching official Skills documentation

Fixes context preservation issue in scanSupportingFiles() where `this` context
was lost in nested function, now using `const self = this` pattern.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-15 10:29:46 -05:00
SangheeSon edb5bbe64f Fix Windows Python command compatibility (#118)
- Replace python3 with python in JSON configs on Windows
- Add cross-platform Python detection (py/python/python3)
- Update E2B sandbox to try multiple Python commands
- Follows PEP 397 Python launcher best practices
2025-11-15 09:41:25 -05:00
Dani 92e2d1184d feat: Add Docker Sandbox Provider for local Claude Code execution
🐳 New Docker Sandbox Provider - Execute Claude Code in isolated local containers

## Features
- ✅ Fully local execution with complete isolation
- ✅ Claude Agent SDK integration with async generator pattern
- ✅ Multi-directory file detection (/app and /tmp)
- ✅ Support for specialized agents
- ✅ Automated execution with --yes flag
- ✅ Custom Docker environments

## Files Added
- cli-tool/components/sandbox/docker/Dockerfile - Node.js 22 Alpine image
- cli-tool/components/sandbox/docker/docker-launcher.js - Container orchestration
- cli-tool/components/sandbox/docker/execute.js - Claude SDK execution script
- cli-tool/components/sandbox/docker/package.json - Dependencies
- cli-tool/components/sandbox/docker/README.md - Complete documentation

## Changes
- cli-tool/package.json: Bump version to 1.27.0, add docker files to npm package
- cli-tool/src/index.js: Add Docker sandbox execution logic and --yes flag support
- docs/component.html: Add Docker provider documentation and comparison table
- docs/css/component-page.css: Docker provider styling
- docs/js/component-page.js: Docker provider tab functionality

## Usage
npx claude-code-templates@latest --sandbox docker --agent example --prompt "task" --yes

## Requirements
- Docker Desktop installed and running
- Anthropic API key configured

🎉 Version 1.27.0 published to npm

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 16:34:49 -05:00
Dani 7cb214e083 feat: Add command usage tracking system to Neon Database
This update adds comprehensive tracking of CLI command executions
to understand community usage patterns of the npm package.

**What's New:**
- Command usage logging in Neon Database with PostgreSQL
- Tracks: --chats, --analytics, --health-check, --plugins, --sandbox, and more
- API endpoint: /api/track-command-usage with validation
- Comprehensive test suite (18/18 tests passing)
- Fire-and-forget tracking (non-blocking, respects privacy)
- Auto-aggregated statistics with PostgreSQL triggers
- Useful views: daily usage, platform distribution, popular commands

**Technical Details:**
- Database: Neon PostgreSQL (separate from Supabase component downloads)
- Endpoint: https://www.aitmpl.com/api/track-command-usage
- Privacy: Respects CCT_NO_TRACKING environment variable
- Metadata: Includes tunnel usage, platform, Node version, etc.

**Files Changed:**
- api/track-command-usage.js - New endpoint for command tracking
- database/migrations/002_create_command_usage_logs.sql - Database schema
- cli-tool/src/tracking-service.js - Added trackCommandExecution()
- cli-tool/src/index.js - Integrated tracking for 10+ commands
- api/__tests__/endpoints.test.js - Added comprehensive tests

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 15:21:28 -04:00
Dani f1fb361e4d fix: prevent duplicate shutdown handlers and memory leaks in chats server
Fixed multiple issues with server shutdown:
- Added flag to prevent multiple shutdown attempts
- Remove all SIGINT/SIGTERM listeners before adding new ones
- Added isStopped flag to prevent stop() from being called multiple times
- Improved logging during shutdown process
- Fixed MaxListenersExceededWarning by properly cleaning up event listeners

This resolves the issue where pressing Ctrl+C multiple times would create
duplicate shutdown handlers and cause memory leaks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 16:02:35 -04:00
Dani 03efc6752a feat: add comprehensive Session Analytics modal (Beta)
Added detailed analytics modal for each chat session including:
- Overview metrics (messages, tokens, tools, models, cache efficiency)
- Token usage breakdown with cost estimation
- Session timeline with duration tracking
- Time breakdown (Claude execution vs user conversing)
- Model information with usage percentages and message counts
- Tool usage statistics
- Components used (agents, slash commands, skills)

Key features:
- Real-time analytics calculation from JSONL conversation files
- Multi-model usage detection (Sonnet/Haiku switching)
- Intelligent time filtering (excludes long breaks)
- Cost estimation based on Claude API pricing
- Component detection from tool_use blocks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 15:44:14 -04:00
Dani d26911a758 fix: replace cat pipe option with interactive mode example
The 'cat | claude' command doesn't work with interactive mode
because pipe consumes stdin. Replaced with proper interactive
mode usage:

Option 1: claude "read @context-file.md and continue"
Option 2: claude (then > @context-file.md continue)

This fixes the 'Raw mode is not supported' error users were
experiencing.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 14:48:37 -04:00
Dani 482772b2bf feat: add command examples to download modal
Added two simple command options for loading context:

Option 1: Direct reference with @
claude "read @context-file.md and continue"

Option 2: Using cat (pipe)
cat context-file.md | claude

Changes:
- Replaced generic instructions with specific commands
- Added syntax-highlighted code blocks
- Clear visual separation between options
- Added tip about saving file in project directory

UI improvements:
- Dark code blocks for better readability
- Green headers for each option
- Concise, actionable instructions

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 14:32:10 -04:00
Dani a7385cddf5 improve: update context file format to be Claude Code-friendly
Changes:
- Header now directly addresses Claude Code instead of the user
- Clear note: "This file contains the complete conversation history"
- Removed user-facing instructions
- Simplified metadata format
- Updated modal text to reflect that file is FOR Claude Code to read

New header format:
```markdown
# Previous Conversation Context

> **Note to Claude Code**: This file contains the complete
> conversation history from a previous session. Read and
> understand this context to continue helping the user with
> their task.

**Project:** project-name
**Date:** 2025-10-29
**Messages in this export:** 100
```

Modal improvements:
- "Markdown context file that Claude Code can read"
- "Claude will read and understand the previous conversation"
- Clearer example of @ usage

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 11:17:20 -04:00
Dani cb890faecf feat: replace session sharing with context download
Complete overhaul of session sharing feature:

REMOVED:
- x0.at upload functionality
- Share command and QR code generation
- External file hosting dependencies
- Clone session command (--clone-session)

ADDED:
- Download conversation as Markdown file
- Context file optimized for Claude Code @ references
- Simple download modal with usage instructions
- Instructions for using @filename in Claude Code

Changes:
Backend:
- New exportSessionAsMarkdown() method in SessionSharing
- Convert conversations to readable Markdown format
- Include usage instructions in exported files
- Changed endpoint from /api/conversations/:id/share to /download

Frontend:
- Replaced "Share" button with "Download" button
- New download modal with clear instructions
- Removed QR code and upload functionality
- Direct browser download of .md files

User Experience:
- Download context file to local machine
- Add file to project repository
- Reference in Claude Code with @filename
- Continue conversation with full context

Example workflow:
1. Click Download button
2. Save claude-context-project-2025-10-27.md
3. Add to git repo
4. In Claude Code: "Read @claude-context-project-2025-10-27.md and continue"

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 11:00:28 -04:00
Dani 789bb2d81d fix: correct resume command and project name in session sharing
Fixes:
- Resume command now shows only conversation ID (claude --resume <id>)
  instead of including user path
- Changed default project name from 'Unknown' to 'shared-session'
  for consistency between export and import
- Updated default model fallback to 'claude-sonnet-4-5-20250929'

Issue: When cloning a session on another computer, the resume command
was showing the wrong format and the project was being saved as
'unknown' instead of using the correct project name.

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 20:05:04 -04:00
Daniel Avila 65156dda84 Session Sharing & Chats UI Improvements (#122)
* feat: add session sharing and cloning functionality

Implement complete session sharing system for Claude Code conversations:

Features:
- Share button in chats interface with QR code generation
- Upload sessions to x0.at (temporary file hosting)
- Clone sessions with --clone-session command
- Limit shared sessions to last 100 messages
- Security confirmation modal with service information
- Resume command display after cloning

Backend:
- New SessionSharing class for export/upload/download/install
- Integration with ConversationAnalyzer
- x0.at upload service (tested and working)
- JSONL format conversion for Claude Code compatibility

Frontend:
- Confirmation modal with x0.at security info
- Centered QR code display
- Improved button styling (Resume, Share, Search)
- Real-time upload progress indication

CLI:
- Added --clone-session <url> parameter
- Automatic session installation to ~/.claude/projects/
- Display resume command with conversation ID

Dependencies:
- Added qrcode package for QR generation

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: improve chats UI with project grouping and unified action buttons

Major improvements to chats interface:

Project Organization:
- Group conversations by project with collapsible sections
- Projects collapsed by default for cleaner interface
- Auto-expand projects during search with matching results
- Sticky project headers for better navigation
- Project avatars with gradients and conversation counts

Terminology Update:
- Changed "conversations" to "sessions" throughout UI
- Updated empty state messages
- Consistent terminology in headers and labels

Action Buttons Enhancement:
- Unified Resume, Share, and Search buttons in center header
- Replaced emojis with professional SVG icons
- Grouped design with orange accent border
- Individual hover states (green/blue/orange)
- Responsive button group with smooth transitions

Search Improvements:
- Fixed search to work with grouped project structure
- Search in both project names and session IDs
- Auto-collapse all projects when clearing search
- Proper filter clearing in advanced search
- Maintained state management across search operations

Visual Design:
- Orange accent border highlighting action buttons (2px)
- Subtle orange background for button group
- Consistent hover effects with color coding
- Enhanced visual hierarchy
- Better spacing and alignment

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-27 15:42:15 -04:00
Dani 449f68acc1 feat: Add advanced search functionality to chats interface
- Add advanced search panel with filters for directory, date range, and content
- Implement in-conversation search with navigation (↑↓ arrows)
- Add folder browser with conversation counts per directory
- Add search result highlighting with current match emphasis
- Implement 3-character minimum for search to prevent performance issues
- Add ID-based message navigation for reliable infinite scroll support
- Add visual feedback with flash animations and match counters

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 15:18:20 -04:00
Dani 9d6c10fce0 fix(cloudflare): Add missing component variables to function scope 2025-10-20 18:38:57 -04:00
Dani 9b2df6772b fix(cloudflare): Pass componentsToInstall correctly to launcher 2025-10-20 18:36:17 -04:00
Dani 3fa7ed13d4 fix(cloudflare): Remove problematic file filter in fs.copy 2025-10-20 17:55:22 -04:00
Dani d24a9902ff fix(cloudflare): Add debug logging for component file copy
Added detailed logging to help debug why Cloudflare component files
are not being copied to the sandbox directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 17:53:12 -04:00
Dani 40e5f66f85 fix(cloudflare): Align file download directory structure with E2B pattern
Fixed Cloudflare sandbox to save generated files in project root using
timestamp-based directories, matching E2B's sandbox-{id} pattern.

**Changes**:
- Modified launcher.ts to accept targetDir parameter (5th argument)
- Updated LauncherConfig interface with optional targetDir field
- Modified displayResults() to use targetDir instead of process.cwd()
- Fixed TypeScript errors (workerUrl undefined, unused language variable)
- Updated src/index.js to pass targetDir to launcher
- Added cloudflare-*/ and sandbox-*/ to .gitignore
- Updated IMPLEMENTATION_SUMMARY.md with file structure details

**Directory Structure**:
- Before: `.claude/sandbox/cloudflare/cloudflare-output/`
- After: `your-project/cloudflare-{timestamp}/`

**Pattern Comparison**:
- E2B: `your-project/sandbox-{id}/`
- Cloudflare: `your-project/cloudflare-{timestamp}/`

Files now download to clean, timestamped directories in the project root,
improving organization and matching user expectations from E2B behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 09:44:05 -04:00
Dani 2799202579 feat: Add Cloudflare Workers sandbox with AI code generation
Implemented complete Cloudflare sandbox integration for executing Claude Code with automatic file downloads.

Features:
- AI-powered code generation using Claude Sonnet 4.5
- Automatic extraction and download of HTML/CSS/JS files
- TypeScript launcher and monitoring tools
- Support for web development requests with file detection
- Integration with CLI (--sandbox cloudflare)
- Global edge deployment capability
- Comprehensive documentation and debugging guides

Files Added:
- Worker source (src/index.ts) with Claude AI integration
- TypeScript launcher with file extraction
- Real-time monitoring tool
- Complete documentation suite (4 MD files)
- Configuration files (wrangler.toml, package.json, tsconfig.json)

Integration:
- Modified src/index.js to support cloudflare sandbox provider
- Split E2B and Cloudflare logic into separate functions
- Added file download functionality similar to E2B

Tested:
- Successfully generates and downloads HTML/CSS/JS files
- Works with agents (e.g., frontend-developer)
- Proper error handling and user feedback

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 19:37:05 -04:00
Dani 3f874a12c0 fix: Download all skill files and directories recursively
Problem:
- Skills like docx require additional files (docx-js.md, ooxml.md, LICENSE.txt)
- Previous implementation only downloaded files matching specific patterns
- Skills with complex directory structures (ooxml/, scripts/) were incomplete

Solution:
- Replaced pattern-based file detection with GitHub API recursive download
- Downloads ALL files and directories in the skill directory
- Maintains executable permissions for .py and .sh files
- Simplifies code and ensures complete skill installation

Benefits:
- docx skill now includes all 59 files (SKILL.md, docx-js.md, ooxml/, scripts/, etc.)
- Works for all current and future skills without modification
- No need to maintain regex patterns or directory whitelists

Testing:
- Verified docx skill installation with all files present
- Confirmed executable permissions on Python scripts
- Total files downloaded: 59 for docx skill
2025-10-17 20:26:28 -04:00
Dani d6b27f48d6 feat: Add skills integration with categorization and web interface support
## Skills System
- Add 19 Anthropic skills to components/skills/ with proper categorization
- Create 4 skill categories: creative-design, development, document-processing, enterprise-communication
- Add ANTHROPIC_ATTRIBUTION.md with license information (Apache 2.0 and Source-Available)

## Data Generation
- Update generate_components_json.py to handle skills with category/skill-name structure
- Skills now use SKILL.md inside category directories
- Extract descriptions from skill frontmatter
- Support proper path generation: category/skill-name

## CLI Installation
- Update installIndividualSkill() to support category/skill-name format
- Handle both "skill-name" and "category/skill-name" installation paths
- Improve error messages with category suggestions
- Download additional files (scripts/, reference/, templates/) via GitHub API

## Web Interface
- Add skills filter chip with "NEW" label and 🎨 icon to docs/index.html
- Update JavaScript to support skills filtering and categorization
- Add skills support to shopping cart system
- Generate correct installation commands: --skill=category/skill-name
- Update data-loader.js, index-events.js, and cart-manager.js for skills

## Skills Included
### Creative & Design (4)
- algorithmic-art, canvas-design, slack-gif-creator, theme-factory

### Development (5)
- artifacts-builder, git-commit-helper, mcp-builder, skill-creator, webapp-testing

### Document Processing (6)
- docx, pdf-anthropic, pdf-processing, pdf-processing-pro, pptx, xlsx

### Enterprise Communication (4)
- brand-guidelines, email-composer, excel-analysis, internal-comms

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 17:27:34 -04:00
Dani 4e92c7abf6 feat: Add 19 official Anthropic skills to components library
🎨 Skills Added:
- Creative & Design: algorithmic-art, canvas-design, slack-gif-creator
- Development: mcp-builder, artifacts-builder, webapp-testing, skill-creator
- Documents: docx, pdf-anthropic, pptx, xlsx
- Enterprise: brand-guidelines, internal-comms, theme-factory

✨ Features:
- Progressive disclosure pattern (SKILL.md + reference files)
- Automatic download of scripts/, reference/, templates/ directories
- GitHub API integration for directory listing
- Executable permissions for .py and .sh files
- Complete license information (ANTHROPIC_ATTRIBUTION.md)

📝 Updates:
- Enhanced installIndividualSkill() with directory download support
- Updated README.md with Skills section
- Regenerated components.json (29 total skills)
- Added proper attribution to Anthropic

🔧 Technical:
- Skills follow Anthropic's standard structure
- All use SKILL.md as main file
- Includes LICENSE.txt files from original repository
- Total size: 9.1MB

Source: https://github.com/anthropics/skills

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 14:06:45 -04:00
Daniel Avila 5cba740dde Improve validation modal text display and UX enhancements (#112)
## Changes Made:

### 1. Modal Text Display Improvements
- Increased error/warning message font size from 14px to 16px for better readability
- Improved line height from 1.5 to 1.6 for better spacing
- Increased margin-bottom from 4px to 8px for better visual separation

### 2. Code Preview Text Wrapping
- Removed horizontal scroll (`overflow-x: auto`) from code previews
- Added `white-space: normal` to prevent excessive whitespace at line start
- Added `word-wrap: break-word` and `overflow-wrap: break-word` for proper text wrapping
- Applied to all code preview sections:
  - Error line text previews
  - Warning line text previews
  - Example line text in errors
  - Example line text in warnings

### 3. Line Number Scroll Synchronization
- Added `position: relative` to `.code-body` for better layout control
- Added `overflow: hidden` and `max-height: 600px` to `.code-line-numbers`
- Added `max-height: 600px` to `.code-content`
- Implemented JavaScript scroll sync between line numbers and code content
- Line numbers now scroll perfectly in sync with code content

### 4. Clickable Error Line Numbers
- Added `cursor: pointer` to error/warning line numbers
- Added "Click to see details" tooltip on error/warning lines
- Implemented click event listeners on all error/warning lines
- Click handler searches through validators to find matching error
- Opens validation modal with correct validator details when clicked
- Added hover effects with `transform: translateX(-2px)` and `cursor: help`

## User Experience Improvements:
- ✅ Error messages are now larger and easier to read (16px)
- ✅ Code snippets wrap naturally without horizontal scroll
- ✅ No excessive whitespace at the beginning of code lines
- ✅ Line numbers stay synchronized during scroll
- ✅ Error line numbers are interactive and open detailed validation modals
- ✅ Better visual hierarchy with improved spacing and sizing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-16 15:34:11 -04:00