[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71FZWAP8GGX8F0VA6VD1G4B":3,"skill-same:01M71FZWAP8GGX8F0VA6VD1G4B":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":53,"install":54,"resources":67},"01M71FZWAP8GGX8F0VA6VD1G4B","sql-cli",null,"Token-efficient MySQL\u002FPostgreSQL operations using mycli and native CLI tools (Windows\u002FMac\u002FLinux compatible). Replaces Artisan Tinker for database queries with 87% token savings.","JSGforever\u002Fskillguard","JSGforever","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F85541948?v=4","01M71FQD3E132VMR5F4TAYX3YS","01M71FQD4DYW0XJ4XQ4YQH75Y9",2,"GPL-3.0","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__Interstellar-code--sql-cli\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"cli","sql","sql cli","count","Tinker","Tools","data","token","subscription","native","artisan","structure","postgresql","mysql","query","database","database queries","expert","postgres","show","2026-11-10 10:12:30",false,"---\nname: sql-cli\ndescription: Token-efficient MySQL\u002FPostgreSQL operations using mycli and native CLI tools (Windows\u002FMac\u002FLinux compatible). Replaces Artisan Tinker for database queries with 87% token savings.\nactivation_keywords: database, sql, mysql, postgres, query, tables, schema, count rows, subscription data, user data, database structure, show tables, artisan tinker\ntoken_savings: 87% vs agent approach (200 vs 1,500+ tokens)\nreplaces: Artisan Tinker, database-query-expert agent\nversion: 1.0.0\n---\n\n# SQL-CLI Skill\n\n**Purpose**: Fast, efficient database operations without agent overhead\n\n## Auto-Activation Triggers\n\n**Primary Keywords**:\n- \"database\", \"sql\", \"mysql\", \"postgres\", \"query database\"\n- \"show tables\", \"count rows\", \"table structure\"\n- \"subscription data\", \"user data\", \"payment data\"\n- \"run query\", \"execute sql\", \"database schema\"\n\n**Context-Aware Triggers**:\n- User asks to check data: \"show active subscriptions\"\n- User needs counts: \"how many users are active\"\n- User wants schema info: \"what fields does users table have\"\n- User mentions Artisan Tinker: automatically suggest sql-cli instead\n\n**Example Activations**:\n- \"Show me all active subscriptions\" → Use sql-cli skill\n- \"Count users registered in last 30 days\" → Use sql-cli skill\n- \"What tables are in the database?\" → Use sql-cli skill\n- \"Describe the users table structure\" → Use sql-cli skill\n\n---\n\n## 🎨 **VISUAL OUTPUT FORMATTING**\n\n**CRITICAL: All sql-cli output MUST use the colored-output formatter skill!**\n\n### Use Colored-Output Skill\n\n**Every response MUST start with:**\n```bash\nbash .claude\u002Fskills\u002Fcolored-output\u002Fcolor.sh skill-header \"sql-cli\" \"Message here...\"\n```\n\n**Example formatted output:**\n```bash\nbash .claude\u002Fskills\u002Fcolored-output\u002Fcolor.sh skill-header \"sql-cli\" \"Executing database query...\"\nbash .claude\u002Fskills\u002Fcolored-output\u002Fcolor.sh progress \"\" \"Connecting to database\"\nbash .claude\u002Fskills\u002Fcolored-output\u002Fcolor.sh info \"\" \"Found 142 rows\"\nbash .claude\u002Fskills\u002Fcolored-output\u002Fcolor.sh success \"\" \"Query completed successfully\"\n```\n\n**WHY:** Using the centralized formatter ensures consistent colors across ALL components!\n\n---\n\n## Replaces\n\n### ❌ Old Method: Artisan Tinker\n```bash\nphp artisan tinker\n> User::where('status', 'active')->count()\n> Subscription::latest()->limit(10)->get()\n\nProblems:\n- 1,500+ tokens to load Eloquent context\n- 100-200ms overhead\n- Requires PHP\u002FLaravel knowledge\n- No syntax highlighting\n- Slow interactive REPL\n```\n\n### ✅ New Method: SQL-CLI Skill\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT COUNT(*) FROM users WHERE status='active'\"\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT * FROM subs_subscriptions ORDER BY created_at DESC LIMIT 10\"\n\nBenefits:\n- 200 tokens (87% reduction)\n- 10-20ms execution (10x faster)\n- Direct SQL (universal knowledge)\n- Syntax highlighting with bat\n- Instant results\n```\n\n## Commands\n\n### Interactive Mode (mycli)\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh interactive\n# Opens mycli with:\n# - Auto-completion for tables\u002Fcolumns\n# - Syntax highlighting\n# - Smart query suggestions\n# - History navigation\n```\n\n**When to Use**: Exploring unfamiliar tables, experimenting with queries\n\n### Query Execution\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT * FROM users WHERE status='active' LIMIT 10\"\n```\n\n**When to Use**: One-off data checks, answering user questions about data\n\n### List Tables\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh tables\n```\n\n**Output**: Table name, row count, data size, index size (sorted by rows)\n\n**When to Use**: Understanding database structure, finding tables\n\n### Describe Table\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh describe users\n```\n\n**Output**: Column names, types, nullability, keys, defaults\n\n**When to Use**: Understanding schema before writing queries\n\n### Count Rows\n```bash\n# All rows\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh count subs_subscriptions\n\n# With WHERE clause\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh count users \"status='active'\"\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh count subs_subscriptions \"renewal_date > NOW()\"\n```\n\n**When to Use**: Quick data statistics, answering \"how many\" questions\n\n### Export to CSV\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh export-csv \"SELECT * FROM users WHERE created_at >= '2025-01-01'\" users_2025.csv\n```\n\n**When to Use**: Generating reports, data analysis, sharing data\n\n### Explain Query\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh explain \"SELECT * FROM users WHERE email='test@example.com'\"\n```\n\n**Output**: Execution plan, index usage, row estimates\n\n**When to Use**: Performance debugging, optimizing slow queries\n\n## Workflow Integration\n\n### Pattern 1: User Asks for Data\n```\nUser: \"How many active subscriptions do we have?\"\n\nClaude:\n1. Auto-activates sql-cli skill (keyword: \"active subscriptions\")\n2. Runs: bash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh count subs_subscriptions \"status='active'\"\n3. Shows result: \"✅ You have 1,247 active subscriptions\"\n\nToken Usage: 200 tokens (vs 1,500+ with Tinker)\nTime: 15ms (vs 150ms with Tinker)\n```\n\n### Pattern 2: Schema Exploration\n```\nUser: \"What fields does the users table have?\"\n\nClaude:\n1. Auto-activates sql-cli skill (keyword: \"users table\")\n2. Runs: bash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh describe users\n3. Shows formatted table structure with bat highlighting\n\nToken Usage: 180 tokens\nTime: 12ms\n```\n\n### Pattern 3: Complex Analysis\n```\nUser: \"Show me users who joined in the last 7 days\"\n\nClaude:\n1. Auto-activates sql-cli skill (keyword: \"users\")\n2. Runs: bash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT id, email, created_at FROM users WHERE created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY) ORDER BY created_at DESC\"\n3. Results displayed with syntax highlighting\n\nToken Usage: 220 tokens\nTime: 18ms\n```\n\n## Credential Handling\n\n**Automatic .env Extraction**:\n- Reads DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD from project .env\n- No manual configuration needed\n- Works from any Laravel project directory\n- Secure (never logs passwords)\n\n**Required .env Variables**:\n```env\nDB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_DATABASE=subshero_reloaded\nDB_USERNAME=root\nDB_PASSWORD=\n```\n\n**Error Handling**:\n- If .env not found: Shows clear error, asks to run from project root\n- If credentials invalid: MySQL error message shown\n- If table doesn't exist: SQL error with suggestion\n\n## Integration with Other Tools\n\n### With bat (Syntax Highlighting)\n```bash\n# Automatic when bat is installed\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT * FROM users LIMIT 10\"\n# → Output automatically syntax-highlighted\n```\n\n### With watchexec (Auto-Query on Changes)\n```bash\n# Watch migrations, auto-verify schema\nwatchexec -w database\u002Fmigrations\u002F \\\n  \"php artisan migrate && bash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh tables\"\n```\n\n### With mycli (Enhanced Interactive Mode)\n```bash\n# If mycli installed: auto-completion, syntax highlighting\n# If not: falls back to standard mysql CLI\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh interactive\n```\n\n## Token Efficiency Comparison\n\n| Operation | Artisan Tinker | SQL-CLI Skill | Savings |\n|-----------|---------------|---------------|---------|\n| Count rows | 1,500 tokens | 180 tokens | **88%** |\n| List tables | 1,200 tokens | 160 tokens | **87%** |\n| Describe table | 1,400 tokens | 170 tokens | **88%** |\n| Complex query | 1,800 tokens | 220 tokens | **88%** |\n| **Average** | **1,475 tokens** | **183 tokens** | **88%** |\n\n## Performance Comparison\n\n| Operation | Artisan Tinker | SQL-CLI Skill | Improvement |\n|-----------|---------------|---------------|-------------|\n| Startup | 150ms | 5ms | **30x faster** |\n| Query execution | 50ms | 10ms | **5x faster** |\n| Result formatting | 30ms | 5ms | **6x faster** |\n| **Total** | **230ms** | **20ms** | **11.5x faster** |\n\n## Best Practices\n\n### ✅ DO Use SQL-CLI For:\n- Quick data checks (\"how many active users?\")\n- Schema exploration (\"what tables exist?\")\n- Data analysis (\"users by registration date\")\n- Report generation (CSV exports)\n- Performance debugging (EXPLAIN queries)\n- Testing data setup (counts, verifications)\n\n### ❌ DON'T Use SQL-CLI For:\n- Complex Eloquent relationships (use Laravel models)\n- Transactional operations requiring rollback (use Artisan Tinker)\n- Operations needing PHP business logic (use controllers\u002Fservices)\n- Seeding data (use Laravel seeders)\n\n### When SQL-CLI vs Artisan Tinker:\n- **SQL-CLI**: Simple data queries, counts, schema checks (95% of cases)\n- **Artisan Tinker**: Complex Eloquent queries with relationships, business logic\n\n## Requirements\n\n**Required**:\n- MySQL client (`mysql` command) - Usually installed with MySQL server\n\n**Optional** (Enhanced Features):\n- **mycli**: Auto-completion, syntax highlighting (`pip install mycli`)\n- **bat**: Syntax-highlighted output (`scoop install bat` on Windows)\n\n**Installation Check**:\n```bash\n# Check if required tools are available\nmysql --version          # Required\nmycli --version          # Optional (enhanced features)\nbat --version            # Optional (syntax highlighting)\n```\n\n## SubsHero-Specific Examples\n\n### Check Active Subscriptions\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh count subs_subscriptions \"status='active'\"\n```\n\n### Recent Subscriptions\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT * FROM subs_subscriptions WHERE created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY) ORDER BY created_at DESC\"\n```\n\n### User Registration Stats\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT DATE(created_at) as date, COUNT(*) as signups FROM users WHERE created_at >= DATE_SUB(NOW(), INTERVAL 30 DAY) GROUP BY DATE(created_at)\"\n```\n\n### Payment Summary\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT status, COUNT(*) as total, SUM(amount) as total_amount FROM shop_orders GROUP BY status\"\n```\n\n### Export Active Users\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh export-csv \"SELECT id, email, created_at FROM users WHERE status='active'\" active_users.csv\n```\n\n## Troubleshooting\n\n### \"Error: .env file not found\"\n**Solution**: Run command from Laravel project root directory where .env exists\n\n### \"Access denied for user\"\n**Solution**: Check DB_USERNAME and DB_PASSWORD in .env file\n\n### \"Unknown database\"\n**Solution**: Verify DB_DATABASE exists, check spelling in .env\n\n### \"Command not found: bat\"\n**Solution**: Install bat (`scoop install bat`) or output works without highlighting\n\n### \"Command not found: mycli\"\n**Solution**: Install mycli (`pip install mycli`) or use standard mysql (still works)\n\n## Summary\n\n**SQL-CLI Skill provides:**\n- ✅ **87% token savings** vs Artisan Tinker\n- ✅ **11x faster execution** than traditional methods\n- ✅ **Universal compatibility** - works across all Laravel projects\n- ✅ **Auto-activation** on database keywords\n- ✅ **Zero configuration** - reads .env automatically\n- ✅ **Enhanced UX** - syntax highlighting, auto-completion\n- ✅ **Simple API** - 7 commands cover 95% of use cases\n\n**Use this skill for all database queries in SubsHero development!**\n","# SQL-CLI Skill\n\n**Purpose**: Fast, efficient database operations without agent overhead\n\n## Auto-Activation Triggers\n\n**Primary Keywords**:\n- \"database\", \"sql\", \"mysql\", \"postgres\", \"query database\"\n- \"show tables\", \"count rows\", \"table structure\"\n- \"subscription data\", \"user data\", \"payment data\"\n- \"run query\", \"execute sql\", \"database schema\"\n\n**Context-Aware Triggers**:\n- User asks to check data: \"show active subscriptions\"\n- User needs counts: \"how many users are active\"\n- User wants schema info: \"what fields does users table have\"\n- User mentions Artisan Tinker: automatically suggest sql-cli instead\n\n**Example Activations**:\n- \"Show me all active subscriptions\" → Use sql-cli skill\n- \"Count users registered in last 30 days\" → Use sql-cli skill\n- \"What tables are in the database?\" → Use sql-cli skill\n- \"Describe the users table structure\" → Use sql-cli skill\n\n---\n\n## 🎨 **VISUAL OUTPUT FORMATTING**\n\n**CRITICAL: All sql-cli output MUST use the colored-output formatter skill!**\n\n### Use Colored-Output Skill\n\n**Every response MUST start with:**\n```bash\nbash .claude\u002Fskills\u002Fcolored-output\u002Fcolor.sh skill-header \"sql-cli\" \"Message here...\"\n```\n\n**Example formatted output:**\n```bash\nbash .claude\u002Fskills\u002Fcolored-output\u002Fcolor.sh skill-header \"sql-cli\" \"Executing database query...\"\nbash .claude\u002Fskills\u002Fcolored-output\u002Fcolor.sh progress \"\" \"Connecting to database\"\nbash .claude\u002Fskills\u002Fcolored-output\u002Fcolor.sh info \"\" \"Found 142 rows\"\nbash .claude\u002Fskills\u002Fcolored-output\u002Fcolor.sh success \"\" \"Query completed successfully\"\n```\n\n**WHY:** Using the centralized formatter ensures consistent colors across ALL components!\n\n---\n\n## Replaces\n\n### ❌ Old Method: Artisan Tinker\n```bash\nphp artisan tinker\n> User::where('status', 'active')->count()\n> Subscription::latest()->limit(10)->get()\n\nProblems:\n- 1,500+ tokens to load Eloquent context\n- 100-200ms overhead\n- Requires PHP\u002FLaravel knowledge\n- No syntax highlighting\n- Slow interactive REPL\n```\n\n### ✅ New Method: SQL-CLI Skill\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT COUNT(*) FROM users WHERE status='active'\"\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT * FROM subs_subscriptions ORDER BY created_at DESC LIMIT 10\"\n\nBenefits:\n- 200 tokens (87% reduction)\n- 10-20ms execution (10x faster)\n- Direct SQL (universal knowledge)\n- Syntax highlighting with bat\n- Instant results\n```\n\n## Commands\n\n### Interactive Mode (mycli)\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh interactive\n# Opens mycli with:\n# - Auto-completion for tables\u002Fcolumns\n# - Syntax highlighting\n# - Smart query suggestions\n# - History navigation\n```\n\n**When to Use**: Exploring unfamiliar tables, experimenting with queries\n\n### Query Execution\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT * FROM users WHERE status='active' LIMIT 10\"\n```\n\n**When to Use**: One-off data checks, answering user questions about data\n\n### List Tables\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh tables\n```\n\n**Output**: Table name, row count, data size, index size (sorted by rows)\n\n**When to Use**: Understanding database structure, finding tables\n\n### Describe Table\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh describe users\n```\n\n**Output**: Column names, types, nullability, keys, defaults\n\n**When to Use**: Understanding schema before writing queries\n\n### Count Rows\n```bash\n# All rows\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh count subs_subscriptions\n\n# With WHERE clause\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh count users \"status='active'\"\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh count subs_subscriptions \"renewal_date > NOW()\"\n```\n\n**When to Use**: Quick data statistics, answering \"how many\" questions\n\n### Export to CSV\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh export-csv \"SELECT * FROM users WHERE created_at >= '2025-01-01'\" users_2025.csv\n```\n\n**When to Use**: Generating reports, data analysis, sharing data\n\n### Explain Query\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh explain \"SELECT * FROM users WHERE email='test@example.com'\"\n```\n\n**Output**: Execution plan, index usage, row estimates\n\n**When to Use**: Performance debugging, optimizing slow queries\n\n## Workflow Integration\n\n### Pattern 1: User Asks for Data\n```\nUser: \"How many active subscriptions do we have?\"\n\nClaude:\n1. Auto-activates sql-cli skill (keyword: \"active subscriptions\")\n2. Runs: bash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh count subs_subscriptions \"status='active'\"\n3. Shows result: \"✅ You have 1,247 active subscriptions\"\n\nToken Usage: 200 tokens (vs 1,500+ with Tinker)\nTime: 15ms (vs 150ms with Tinker)\n```\n\n### Pattern 2: Schema Exploration\n```\nUser: \"What fields does the users table have?\"\n\nClaude:\n1. Auto-activates sql-cli skill (keyword: \"users table\")\n2. Runs: bash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh describe users\n3. Shows formatted table structure with bat highlighting\n\nToken Usage: 180 tokens\nTime: 12ms\n```\n\n### Pattern 3: Complex Analysis\n```\nUser: \"Show me users who joined in the last 7 days\"\n\nClaude:\n1. Auto-activates sql-cli skill (keyword: \"users\")\n2. Runs: bash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT id, email, created_at FROM users WHERE created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY) ORDER BY created_at DESC\"\n3. Results displayed with syntax highlighting\n\nToken Usage: 220 tokens\nTime: 18ms\n```\n\n## Credential Handling\n\n**Automatic .env Extraction**:\n- Reads DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD from project .env\n- No manual configuration needed\n- Works from any Laravel project directory\n- Secure (never logs passwords)\n\n**Required .env Variables**:\n```env\nDB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_DATABASE=subshero_reloaded\nDB_USERNAME=root\nDB_PASSWORD=\n```\n\n**Error Handling**:\n- If .env not found: Shows clear error, asks to run from project root\n- If credentials invalid: MySQL error message shown\n- If table doesn't exist: SQL error with suggestion\n\n## Integration with Other Tools\n\n### With bat (Syntax Highlighting)\n```bash\n# Automatic when bat is installed\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT * FROM users LIMIT 10\"\n# → Output automatically syntax-highlighted\n```\n\n### With watchexec (Auto-Query on Changes)\n```bash\n# Watch migrations, auto-verify schema\nwatchexec -w database\u002Fmigrations\u002F \\\n  \"php artisan migrate && bash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh tables\"\n```\n\n### With mycli (Enhanced Interactive Mode)\n```bash\n# If mycli installed: auto-completion, syntax highlighting\n# If not: falls back to standard mysql CLI\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh interactive\n```\n\n## Token Efficiency Comparison\n\n| Operation | Artisan Tinker | SQL-CLI Skill | Savings |\n|-----------|---------------|---------------|---------|\n| Count rows | 1,500 tokens | 180 tokens | **88%** |\n| List tables | 1,200 tokens | 160 tokens | **87%** |\n| Describe table | 1,400 tokens | 170 tokens | **88%** |\n| Complex query | 1,800 tokens | 220 tokens | **88%** |\n| **Average** | **1,475 tokens** | **183 tokens** | **88%** |\n\n## Performance Comparison\n\n| Operation | Artisan Tinker | SQL-CLI Skill | Improvement |\n|-----------|---------------|---------------|-------------|\n| Startup | 150ms | 5ms | **30x faster** |\n| Query execution | 50ms | 10ms | **5x faster** |\n| Result formatting | 30ms | 5ms | **6x faster** |\n| **Total** | **230ms** | **20ms** | **11.5x faster** |\n\n## Best Practices\n\n### ✅ DO Use SQL-CLI For:\n- Quick data checks (\"how many active users?\")\n- Schema exploration (\"what tables exist?\")\n- Data analysis (\"users by registration date\")\n- Report generation (CSV exports)\n- Performance debugging (EXPLAIN queries)\n- Testing data setup (counts, verifications)\n\n### ❌ DON'T Use SQL-CLI For:\n- Complex Eloquent relationships (use Laravel models)\n- Transactional operations requiring rollback (use Artisan Tinker)\n- Operations needing PHP business logic (use controllers\u002Fservices)\n- Seeding data (use Laravel seeders)\n\n### When SQL-CLI vs Artisan Tinker:\n- **SQL-CLI**: Simple data queries, counts, schema checks (95% of cases)\n- **Artisan Tinker**: Complex Eloquent queries with relationships, business logic\n\n## Requirements\n\n**Required**:\n- MySQL client (`mysql` command) - Usually installed with MySQL server\n\n**Optional** (Enhanced Features):\n- **mycli**: Auto-completion, syntax highlighting (`pip install mycli`)\n- **bat**: Syntax-highlighted output (`scoop install bat` on Windows)\n\n**Installation Check**:\n```bash\n# Check if required tools are available\nmysql --version          # Required\nmycli --version          # Optional (enhanced features)\nbat --version            # Optional (syntax highlighting)\n```\n\n## SubsHero-Specific Examples\n\n### Check Active Subscriptions\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh count subs_subscriptions \"status='active'\"\n```\n\n### Recent Subscriptions\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT * FROM subs_subscriptions WHERE created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY) ORDER BY created_at DESC\"\n```\n\n### User Registration Stats\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT DATE(created_at) as date, COUNT(*) as signups FROM users WHERE created_at >= DATE_SUB(NOW(), INTERVAL 30 DAY) GROUP BY DATE(created_at)\"\n```\n\n### Payment Summary\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh query \"SELECT status, COUNT(*) as total, SUM(amount) as total_amount FROM shop_orders GROUP BY status\"\n```\n\n### Export Active Users\n```bash\nbash .claude\u002Fskills\u002Fsql-cli\u002Fsql-cli.sh export-csv \"SELECT id, email, created_at FROM users WHERE status='active'\" active_users.csv\n```\n\n## Troubleshooting\n\n### \"Error: .env file not found\"\n**Solution**: Run command from Laravel project root directory where .env exists\n\n### \"Access denied for user\"\n**Solution**: Check DB_USERNAME and DB_PASSWORD in .env file\n\n### \"Unknown database\"\n**Solution**: Verify DB_DATABASE exists, check spelling in .env\n\n### \"Command not found: bat\"\n**Solution**: Install bat (`scoop install bat`) or output works without highlighting\n\n### \"Command not found: mycli\"\n**Solution**: Install mycli (`pip install mycli`) or use standard mysql (still works)\n\n## Summary\n\n**SQL-CLI Skill provides:**\n- ✅ **87% token savings** vs Artisan Tinker\n- ✅ **11x faster execution** than traditional methods\n- ✅ **Universal compatibility** - works across all Laravel projects\n- ✅ **Auto-activation** on database keywords\n- ✅ **Zero configuration** - reads .env automatically\n- ✅ **Enhanced UX** - syntax highlighting, auto-completion\n- ✅ **Simple API** - 7 commands cover 95% of use cases\n\n**Use this skill for all database queries in SubsHero development!**\n",{"name":5,"version":43,"replaces":44,"description":7,"token_savings":45,"activation_keywords":46},"1.0.0","Artisan Tinker, database-query-expert agent","87% vs agent approach (200 vs 1,500+ tokens)","database, sql, mysql, postgres, query, tables, schema, count rows, subscription data, user data, database structure, show tables, artisan tinker","main","f2ec4b3b9133d34eeaf9b38e4b0a97e8e5705a7f","benchmarks\u002Ffinal\u002Fskills\u002Fasset1__Interstellar-code--sql-cli",0,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard","https:\u002F\u002Fgithub.com\u002FJSGforever","2026-08-29 18:27:56",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add JSGforever\u002Fskillguard --skill sql-cli",{"tool":60,"command":61},"bunx","bunx skills add JSGforever\u002Fskillguard --skill sql-cli",{"tool":63,"command":64},"pnpm","pnpm dlx skills add JSGforever\u002Fskillguard --skill sql-cli","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__Interstellar-code--sql-cli\u002FSKILL.md",true,[68,74],{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"README.md","REFERENCE","参考文档",2616,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__Interstellar-code--sql-cli\u002FREADME.md",{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"sql-cli.sh","SCRIPT","脚本",7563,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__Interstellar-code--sql-cli\u002Fsql-cli.sh",[81,108,118,145,163,183],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":38},"01M71HY2SNXBA9Q00WZDTZQ31Z","skillguard-codex-scanner","Hybrid deterministic+LLM agent-skill security scanner. Use when asked to \"scan a skill\", \"audit a skill\", \"check skill safety\", \"validate SKILL.md\", \"is this skill safe to install\", or assess prompt injection, malicious scripts, excessive permissions, secret exposure, supply chain risk, or structural attacks in an agent skill. Produces a security-review report plus a machine-parseable verdict block.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fsrc\u002Fskillguard\u002Fstatic_scanner\u002Fskillguard-codex-scanner\u002FSKILL.md",[],[88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107],"scanner","skillguard codex scanner","skillguard","codex","chain","skill security","security-review","review report","structural","secret","prompt injection","security scanner","when","review","malicious","permissions","exposure","audit","scripts","safe",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":112,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":38},"01M71HY0SPKTT3S27BC2HPAC5M","data-exfiltrator","Analyzes data files","MIT","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Fsmoke-one-skill\u002Fasset1__cisco-ai-defense--data-exfiltrator\u002FSKILL.md",[],[24,116,117],"data exfiltrator","files",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":38},"01M71HXVS9EMN44BGDW215FZ72","real-time-collaboration-engine","Build real-time collaborative editing with WebSockets, OT\u002FCRDT conflict resolution, and presence awareness. Implements cursor tracking, optimistic updates, and offline sync. Use for collaborative editors, whiteboards, video editing. Activate on \"real-time collaboration\", \"WebSocket sync\", \"multiplayer editing\", \"CRDT\", \"presence awareness\". NOT for simple chat, request-response APIs, or single-user apps.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--real-time-collaboration-engine\u002FSKILL.md",[],[125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144],"time","real time collaboration engine","real time collaboration","collaboration","engine","real time","Video","reliability","video editing","performance","conflict resolution","presence","access","apps","updates","Bash","activate","optimizer","react","streaming",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":38},"01M71HXP6CTY4KFN0QVMMN0V7J","react-performance-optimizer","Optimize React apps for 60fps performance. Implements memoization, virtualization, code splitting, bundle optimization. Use for slow renders, large lists, bundle bloat. Activate on \"React performance\", \"slow render\", \"useMemo\", \"bundle size\", \"virtualization\". NOT for backend optimization, non-React frameworks, or premature optimization.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--react-performance-optimizer\u002FSKILL.md",[],[134,152,142,143,153,154,155,156,35,157,125,158,159,138,140,160,141,144,161,162],"react performance optimizer","react performance","performance optimizer","app","nextjs","re","render","2025","code","router","strategies",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":169,"publishedAt":38},"01M71HXH7QXSQB4QTDZ7SP7YXQ","llm-streaming-response-handler","Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI\u002FAnthropic\u002FClaude streaming APIs. Use for chatbots, AI assistants, real-time text generation. Activate on \"LLM streaming\", \"SSE\", \"token stream\", \"chat UI\", \"real-time AI\". NOT for batch processing, non-streaming APIs, or WebSocket bidirectional chat.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--llm-streaming-response-handler\u002FSKILL.md",[],[170,144,171,172,173,174,134,125,175,176,177,140,141,142,178,143,179,180,181,182],"llm streaming response handler","handler","error","processing","retry","chat ui","error recovery","critical","batch","display","text","server","read",{"skillNo":184,"name":185,"nameZh":6,"description":186,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":187,"categories":188,"keywords":189,"publishedAt":38},"01M71HXCB0E1YRKYW1Y8T0Y106","github-actions-pipeline-builder","Build production CI\u002FCD pipelines with GitHub Actions. Implements matrix builds, caching, deployments, testing, security scanning. Use for automated testing, deployments, release workflows. Activate on \"GitHub Actions\", \"CI\u002FCD\", \"workflow\", \"deployment pipeline\", \"automated testing\". NOT for Jenkins\u002FCircleCI, manual deployments, or non-GitHub repositories.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--github-actions-pipeline-builder\u002FSKILL.md",[],[190,191,192,193,194,195,196,132,35,197,198,199,141,162,200,182,201,202,203,204],"github actions pipeline builder","actions","github actions","pipeline builder","github","builder","pipeline","testing","ci","workflows","run","release","write","edit","git"]