574 Commits

Author SHA1 Message Date
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>
v1.26.4
2025-11-01 15:21:28 -04:00
Dani 598aac0e6b test: Add comprehensive API testing and deployment documentation
Critical Infrastructure Protection:
- Comprehensive test suite for all API endpoints
- Pre-deployment validation script
- Detailed API architecture documentation in CLAUDE.md

Test Suite (__tests__/endpoints.test.js):
- Critical endpoint availability checks
- Component download tracking validation
- Discord bot integration tests
- Claude Code changelog monitor tests
- Security & CORS validation
- Response time validation

Pre-Deployment Script (scripts/predeploy-check.sh):
- Git status validation
- Node.js & npm version checks
- Automatic dependency installation
- API test execution
- File structure validation
- Environment variable checklist
- Vercel configuration validation

Documentation Updates:
- API Architecture & Deployment section in CLAUDE.md
- Endpoint specifications and usage
- Testing procedures
- Deployment workflow
- Troubleshooting guides
- Emergency rollback procedures
- api/README.md with quick reference

This ensures the critical /api/track-download-supabase endpoint
(used by ALL component installations) never breaks during deployments.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 14:22:13 -04:00
Dani 4cc03122b9 feat: Add Claude Code changelog monitor with Discord notifications
- Database schema for tracking Claude Code versions in Neon
- Automated parser for CHANGELOG.md with change classification
- Discord webhook integration with formatted embeds
- Vercel Cron job running every 4 hours
- Supports detection of features, fixes, improvements, and breaking changes

Endpoints:
- /api/claude-code-check - Main endpoint for version checking and notification

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 14:11:23 -04:00
Dani 4c8a8383ae chore: bump version to 1.26.3
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 16:03:01 -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 6a2322a697 fix: move gtag config to preset options for Docusaurus
Moved Google Analytics (gtag) configuration from themeConfig to preset options
to comply with Docusaurus v3+ requirements. This fixes the Vercel build error
for docs.aitmpl.com deployment.

Resolves: The "gtag" field in themeConfig should now be specified as option
for plugin-google-gtag.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 15:54:03 -04:00
Dani 1b831afe95 chore: bump version to 1.26.2
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
v1.26.2
2025-10-31 15:46:09 -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
Luqman 562773ca08 Update deployment-engineer.md (#123)
Add AskUserQuestion to tools used by the aagent
2025-10-30 17:24:40 -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 f49b05d8fc chore: bump version to 1.26.0 v1.26.0 2025-10-30 14:36:33 -04:00
Dani be432a1661 docs: update README 2025-10-30 14:35:59 -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
Dani 8b25e94998 fix: include category in component URLs 2025-10-28 12:22:34 -04:00
Dani 69079cb037 fix: improve code block formatting and add URLs to all commands 2025-10-28 12:20:08 -04:00
Dani 69d26b9cc7 fix: improve link format in search results 2025-10-28 12:05:59 -04:00
Dani 60dfab2260 feat: add clickable links to all Discord bot responses 2025-10-28 11:50:26 -04:00
Dani 8234194ce3 fix: use pure ES modules for Discord bot 2025-10-28 08:01:47 -04:00
Dani f8812b6331 fix: add Discord bot dependencies to api/package.json 2025-10-28 07:57:05 -04:00
Dani 65fa873c2e fix: consolidate Discord bot into single ES module file 2025-10-28 07:54:12 -04:00
Dani db095849e9 fix: add ES module wrapper for interactions endpoint 2025-10-28 07:50:08 -04:00
Dani c95a9e214a fix: convert Discord bot files to CommonJS (.cjs) 2025-10-28 07:48:07 -04:00
Dani b572cb14db feat: add Discord bot with Vercel Functions
- Add 5 slash commands: /search, /info, /install, /popular, /random
- Serverless implementation using Vercel Functions
- Component search and discovery functionality
- Smart caching for components.json
- Setup documentation
2025-10-28 07:39:10 -04:00
Dani eef6c5dfb6 upgrade npm version 2025-10-28 05:17:25 -04:00
Dani 4087d5505c fix: use env variable for release body to prevent execution
- Move RELEASE_BODY to environment variable
- Prevents GitHub Actions from interpreting release body content as bash commands
- Safer handling of user-provided content
2025-10-27 16:45:10 -04:00
Dani b9c515105e fix: prevent command execution in Discord webhook release body
- Replace echo with printf to safely handle release body content
- Prevents bash command interpretation in release notes
- Fixes TRUNCATED_BODY escaping to avoid command injection
2025-10-27 16:42:43 -04:00
Dani ee32f94540 refactor: optimize GitHub Actions workflows
- Remove Docusaurus deployment workflow (unused)
- Remove Vercel deployment workflow (handled separately)
- Update publish-package workflow to avoid conflicts with manual releases
  - No longer bumps version (uses existing version)
  - No longer creates commits, tags, or releases
  - Only publishes to GitHub Packages registry
  - Prevents duplicate releases when publishing manually to npm
2025-10-27 16:36:42 -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>
v1.25.0
2025-10-27 15:42:15 -04:00
Dani 072197cbde discord release notification 2025-10-27 09:19:58 -04:00
Dani 0dad0cf0b3 sitemap and blogs 2025-10-26 12:14:07 -04:00
Dani 936101a70c readme center 2025-10-26 11:48:33 -04:00
Dani 7e85dffd11 README.md: add repository of the day 2025-10-25 13:30:30 -04:00
Dani 8b788dfc9a fix skill modal and add analytics 2025-10-24 17:05:21 -04:00
Dani 576bcc1c00 update nia server 2025-10-24 11:42:44 -04:00
Dani 5af0b5b957 update download data 2025-10-23 17:57:14 -04:00
Dani 22a3f99e4d add testsprite mcp and update download data 2025-10-23 17:50:35 -04:00
Dani a467d114e1 chore: Bump version to 1.24.17 for npm release 2025-10-23 15:19:19 -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 404bbfe538 feat: Add 'skill' as valid component type in tracking API
- Add 'skill' to validTypes array in track-download-supabase.js
- Allows tracking of skill component downloads in Supabase

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 18:58:16 -04:00
Dani f3242ea11c docs: Clean up /docs/api and update documentation
- Remove redundant serverless function files from /docs/api
- Update README to clarify two-directory architecture
- /api/ for serverless functions (Vercel requirement)
- /docs/api/ for static JSON files only

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 18:55:52 -04:00
Dani eef88f88a4 Revert: Restore /api directory - Vercel requires it for serverless functions
This reverts commit b082254. Vercel requires serverless functions in /api/
regardless of outputDirectory. Both directories are needed:
- /api/ for serverless functions (Vercel auto-detects here)
- /docs/api/ can be removed as it's redundant

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 18:55:12 -04:00
Dani b0822549a1 refactor: Remove redundant /api directory and consolidate to /docs/api
- Eliminated duplicate /api directory (not used by Vercel)
- Updated /docs/api/README.md to reflect single source of truth
- /docs/api/track-download-supabase.js already includes 'skill' type support
- Simplified maintenance workflow (no more file syncing needed)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 18:48:25 -04:00
Dani 9fda1f8a98 fix(api): Add @supabase/supabase-js dependency to root package.json for Vercel functions 2025-10-21 14:42:40 -04:00
Dani 054c0e56e9 fix(commands): Remove deprecated 'model: sonnet' field from 142 command files
Removed the deprecated 'model: sonnet' field from command frontmatter to fix
compatibility issues with Claude Code. Commands will now inherit the model from
the active conversation instead of using a hardcoded deprecated model identifier.

Changes:
- Removed 'model: sonnet' from 142 command files across all categories
- Commands now use default model inheritance behavior
- Preserved 'model: claude-sonnet-4-5-20250929' in gemini-review.md (valid model)
- 67 commands without model field remain unchanged

This resolves the "model: sonnet not found" error reported in GitHub issues
and aligns with Claude Code's recommended practice of letting commands inherit
the conversation model.

Affected categories:
- Database/Supabase commands (8 files)
- Documentation commands (8 files)
- Deployment commands (11 files)
- Setup commands (14 files)
- Performance commands (8 files)
- Team commands (14 files)
- Security commands (6 files)
- NextJS/Vercel commands (10 files)
- Sync commands (14 files)
- And more across other categories

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 10:08:58 -04:00
Dani 43c9d86a85 refactor(cloudflare): Clean up unnecessary logs and code output
- Removed full code output from console (code is saved to files anyway)
- Simplified file download logs to show only filenames
- Removed redundant separators and verbose output
- Keep only essential progress indicators:
  - Agent installation
  - Code generation progress
  - File extraction and save location

Users now see only the essential progress without code dumps.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 19:46:26 -04:00
Dani 0d73e0b498 feat(cloudflare): Upgrade to claude-agent-sdk v0.1.23 with settingSources support
- Updated @anthropic-ai/claude-agent-sdk from ^0.1.0 to ^0.1.23
- Replaced manual agent loading with automatic settingSources: ['project']
- Removed temporary workaround for agent loading (SDK now properly supports it)
- Added gitignore entries for local test directories
- Verified settingSources functionality works with SDK v0.1.23

The latest SDK version properly supports automatic agent loading from .claude/ directory,
eliminating the need for manual file reading and systemPrompt manipulation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 19:44:32 -04:00
Dani dbdea302a5 fix(cloudflare): Listen for 'result' type messages from Agent SDK
The Agent SDK returns the final response in a message with type='result'
and the content in message.result, not in type='text' messages.

This was discovered through direct testing of the SDK.
2025-10-20 19:36:24 -04:00