#!/usr/bin/env -S ai --haiku --skipRead metrics.json and output only:- users- revenue - signups- churnFormat as CSV (no headers).
analyze.md:
#!/usr/bin/env -S ai --haikuThe stdin contains CSV: users,revenue,signups,churnCalculate:- Revenue per user- Retention rate- Growth rateOutput: One line summary.
format-report.md:
#!/usr/bin/env -S ai --haikuFormat the analysis from stdin as a professional email to executives.Keep it under 3 paragraphs.
#!/usr/bin/env -S ai --haikuAnalyze the API response on stdin (JSON format):1. Response structure validity2. Expected fields present?3. Data types correct?4. Any error indicators?5. Performance metrics (if present)Output: VALID or INVALID with explanation.
# Test API endpointcurl -s https://api.example.com/v1/users | ./validate-response.md
#!/usr/bin/env -S ai --sonnetAnalyze the nginx access logs on stdin:1. Request volume and patterns2. Top 10 endpoints by traffic3. Error rate (4xx, 5xx)4. Response time distribution5. Unusual patterns or potential attacksFocus on actionable insights.
#!/usr/bin/env -S ai --haikuAnalyze the database query results on stdin (CSV format).Identify:- Trends in the data- Outliers- Missing or null values- Data quality issuesSuggest next steps for data cleanup.
psql -d mydb -c "SELECT * FROM metrics WHERE date > NOW() - INTERVAL '7 days'" \ --csv | ./analyze-db-results.md
#!/usr/bin/env -S ai --haikuAnalyze the git commit history on stdin:1. Most active areas of the codebase2. Commit message quality3. Commit frequency patterns4. Authors and contribution patterns5. Any concerning trends?
#!/usr/bin/env -S ai --haikuConvert the JSON array on stdin to a Markdown table.Auto-detect columns from the first object.Format numbers with proper separators.
#!/usr/bin/env -S ai --haikuClean the CSV data on stdin:1. Remove duplicate rows2. Fix inconsistent formatting3. Handle missing values (use "N/A")4. Standardize date formats to YYYY-MM-DD5. Trim whitespaceOutput: Cleaned CSV.
#!/usr/bin/env -S ai --sonnetEnrich the user data on stdin (CSV).For each row:1. Read: user_id, email, signup_date2. Infer: likely timezone from email domain3. Calculate: days since signup4. Determine: user lifecycle stage (new/active/at-risk)Output: Enriched CSV with new columns.
#!/usr/bin/env -S ai --sonnetDetect anomalies in the time-series data on stdin (CSV).Columns: timestamp, valueUse statistical methods:- 3-sigma rule for outliers- Moving average for trend- Sudden spikes or dropsOutput: CSV with only anomalous rows + explanation column.
#!/usr/bin/env -S ai --sonnet --liveAnalyze the log stream on stdin.Print a summary every 100 lines:- Error count- Warning count- Unusual patternsContinue until EOF.
Process multiple files in one prompt (saves API calls):
#!/usr/bin/env -S ai --haiku --skipAnalyze all JSON files in data/ directory.For each file:1. Read contents2. Extract key metrics3. One-line summaryOutput: Markdown list of summaries.
#!/usr/bin/env -S ai --haikuValidate the data pipeline output on stdin (JSON).Checks:1. Valid JSON structure2. Required fields present: [timestamp, value, status]3. No null values4. Timestamp in ISO 8601 format5. Status in [active, pending, completed]Output: PASS or FAIL with specific issues.