├── .claude └── commands │ ├── create_image.md │ ├── echo.md │ ├── edit_image.md │ ├── finance_categorizer.md │ ├── more_training_data.md │ ├── morning_debrief.md │ └── prime.md ├── .env.sample ├── .gemini └── settings.json.sample ├── .gitignore ├── .mcp.json.sample ├── README.md ├── ai_docs ├── ai_docs.md ├── astral-uv-single-file-scripts.md ├── claude-code-python-sdk.md └── watch-dog-python-docs.md ├── drops.yaml ├── edit_image_input_files └── cat_sitting_in_chair.jpg ├── example_input_files ├── bank_statement.csv ├── cats.txt ├── cats_edit.json ├── cats_enhanced.txt ├── echo.txt ├── twitter_classification_dataset.csv └── yt_script_5_agent_interaction_patterns_4m.mp4 ├── images └── arch.png ├── sfs_agentic_drop_zone.py └── specs └── simple_multi_processing_solution.md /.claude/commands/create_image.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Create Image 3 | allowed-tools: Bash, mcp__replicate__create_models_predictions, mcp__replicate__get_predictions 4 | description: Generate image(s) via Replicate 5 | --- 6 | 7 | # Create Image 8 | 9 | This command generates image(s) based on the provided prompt using Replicate. 10 | 11 | ## Variables 12 | 13 | DROPPED_FILE_PATH: [[FILE_PATH]] 14 | DROPPED_FILE_PATH_ARCHIVE: agentic_drop_zone/generate_images_zone/drop_zone_file_archive/ 15 | IMAGE_OUTPUT_DIR: agentic_drop_zone/generate_images_zone/image_output// 16 | - This is the directory where all images will be saved 17 | - The date_time is the current date and time in the format YYYY-MM-DD_HH-MM-SS 18 | MODEL: google/nano-banana 19 | ASPECT_RATIO: 16:9 20 | 21 | ## Workflow 22 | 23 | - First, read `DROPPED_FILE_PATH`. 24 | - Create output directory: `IMAGE_OUTPUT_DIR//` 25 | - IMPORTANT: For every image prompt detailed in the `DROPPED_FILE_PATH` do the following: 26 | 27 | 28 | - Use `mcp__replicate__create_models_predictions` with the MODEL specified above 29 | - Pass image prompt as the prompt input 30 | - Use ASPECT_RATIO for the image dimensions 31 | - Wait for completion by polling `mcp__replicate__get_predictions` 32 | - Save the executed prompts to `IMAGE_OUTPUT_DIR//image_prompt_.txt` 33 | - Use the exact prompt that was executed in the `mcp__replicate__create_models_predictions` call 34 | - Download the image: `IMAGE_OUTPUT_DIR//_.jpg` 35 | - Display: 36 | - Generation time 37 | - File size 38 | - Full path to saved image 39 | 40 | - After all images are generated, open the output directory: `open IMAGE_OUTPUT_DIR//` 41 | - When you finish generating images, move the `DROPPED_FILE_PATH` into a `DROPPED_FILE_PATH_ARCHIVE` directory -------------------------------------------------------------------------------- /.claude/commands/echo.md: -------------------------------------------------------------------------------- 1 | # Echo Command 2 | 3 | Echo the contents of the file at DROPPED_FILE_PATH and provide a brief summary. 4 | 5 | ## Variables 6 | 7 | DROPPED_FILE_PATH: [[FILE_PATH]] 8 | DROPPED_FILE_PATH_ARCHIVE: agentic_drop_zone/echo_zone/drop_zone_file_archive/ 9 | 10 | ## Workflow 11 | 1. Read the file contents at DROPPED_FILE_PATH 12 | 2. Write out the file in between a markdown code block 13 | 3. Below log the total number of characters in the file and the file name 14 | 4. Move the file to the archive: `mv DROPPED_FILE_PATH DROPPED_FILE_PATH_ARCHIVE/` 15 | 16 | ## Example Output Format 17 | 18 | ``` 19 | 20 | 21 | total characters: 22 | file name: 23 | ``` 24 | -------------------------------------------------------------------------------- /.claude/commands/edit_image.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Edit Image 3 | allowed-tools: Bash, Read 4 | description: Edit existing images via Replicate using direct curl API calls 5 | --- 6 | 7 | # Edit Image 8 | 9 | This command edits existing images based on provided edit prompts using Replicate's API directly via curl. 10 | 11 | ## Prerequisites 12 | 13 | - REPLICATE_API_TOKEN must be exported in the environment 14 | - Requires base64 command for inline image encoding 15 | 16 | ## Variables 17 | 18 | DROPPED_FILE_PATH: [[FILE_PATH]] 19 | DROPPED_FILE_PATH_ARCHIVE: agentic_drop_zone/edit_images_zone/drop_zone_file_archive/ 20 | IMAGE_OUTPUT_DIR: agentic_drop_zone/edit_images_zone/image_output// 21 | - This is the directory where all images will be saved 22 | - The date_time is the current date and time in the format YYYY-MM-DD_HH-MM-SS 23 | MODEL: google/nano-banana 24 | API_ENDPOINT: https://api.replicate.com/v1/models/google/nano-banana/predictions 25 | 26 | ## Workflow 27 | 28 | - Note: REPLICATE_API_TOKEN will be available, don't search for it and NEVER read the .env file directly. 29 | - IMPORTANT: If for some reason you run into issues with authentication, abort immediately - do not continue with any image processing. Mention that the REPLICATE_API_TOKEN might be missing. 30 | - First, read `DROPPED_FILE_PATH`. 31 | - Create output directory: `IMAGE_OUTPUT_DIR//` 32 | - IMPORTANT: For every image edit detailed in the `DROPPED_FILE_PATH` do the following: 33 | 34 | 35 | - Extract the source image path and edit prompt from the dropped file 36 | - Use curl with inline base64 encoding to send image directly to Replicate API: 37 | ```bash 38 | curl -s -X POST \ 39 | -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ 40 | -H "Content-Type: application/json" \ 41 | -H "Prefer: wait" \ 42 | -d '{ 43 | "input": { 44 | "prompt": "YOUR_EDIT_PROMPT_HERE", 45 | "image_input": ["data:image/jpeg;base64,'$(base64 -i /path/to/source/image.jpg)'"], 46 | "output_format": "jpg" 47 | } 48 | }' \ 49 | https://api.replicate.com/v1/models/google/nano-banana/predictions 50 | ``` 51 | - IMPORTANT: Replace `YOUR_EDIT_PROMPT_HERE` with the actual edit instruction 52 | - IMPORTANT: Replace `/path/to/source/image.jpg` with the actual source image path which should be detailed in the `DROPPED_FILE_PATH` 53 | - IMPORTANT: The base64 encoding happens inline using `$(base64 -i /path/to/image.jpg)` 54 | - Parse JSON response to extract the `output` URL field for the generated image 55 | - Response format: `{"id":"...", "output":"https://replicate.delivery/...jpg", "status":"succeeded"}` 56 | - Extract URL with `jq -r '.output'` 57 | - Save the executed edit prompts to `IMAGE_OUTPUT_DIR//edit_prompt_.txt` 58 | - Include both the source image path and the exact edit prompt that was executed 59 | - Download the edited image from the output URL: `curl -o IMAGE_OUTPUT_DIR//_edited_.jpg "OUTPUT_URL"` 60 | - Display: 61 | - Source image path 62 | - Edit prompt used 63 | - Generation time (if available in response) 64 | - File size of downloaded image 65 | - Full path to saved edited image 66 | - Replicate output URL for reference 67 | 68 | 69 | - After all images are edited, copy all original source images to the output directory for reference: 70 | - For each source image that was processed, copy it with "original_" prefix 71 | - Example: `cp /path/to/cat.jpg IMAGE_OUTPUT_DIR//original_cat.jpg` 72 | - This allows easy before/after comparison in the same directory 73 | - After copying originals, open the output directory: `open IMAGE_OUTPUT_DIR//` 74 | - When you finish editing images, move the `DROPPED_FILE_PATH` into a `DROPPED_FILE_PATH_ARCHIVE` directory 75 | 76 | ## Example Usage 77 | 78 | ```bash 79 | # The REPLICATE_API_TOKEN is sourced from the .env file 80 | 81 | 82 | # Execute image edit with inline base64 encoding 83 | RESPONSE=$(curl -s -X POST \ 84 | -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ 85 | -H "Content-Type: application/json" \ 86 | -H "Prefer: wait" \ 87 | -d '{ 88 | "input": { 89 | "prompt": "Make the cat blue", 90 | "image_input": ["data:image/jpeg;base64,'$(base64 -i ./source_image.jpg)'"], 91 | "output_format": "jpg" 92 | } 93 | }' \ 94 | https://api.replicate.com/v1/models/google/nano-banana/predictions) 95 | 96 | # Extract output URL and download 97 | OUTPUT_URL=$(echo "$RESPONSE" | jq -r '.output') 98 | curl -o edited_image.jpg "$OUTPUT_URL" 99 | ``` -------------------------------------------------------------------------------- /.claude/commands/finance_categorizer.md: -------------------------------------------------------------------------------- 1 | # Finance Categorizer 2 | 3 | This command analyzes bank statement CSV files, corrects missing or incorrect categorizations, and generates comprehensive spending reports with visual indicators for high spending areas. 4 | 5 | ## Instructions 6 | 7 | - IMPORTANT: Use inline astral uv python code (with any libraries you need) to calculate the totals and percentages. Use `uv run python --with pandas --with -c "import pandas as pd; print(\"whatever you want here\")"` to test your code. 8 | - Example: `uv run --with rich python -c "from rich.console import Console; Console().print('Hello', style='bold red')"` 9 | - IMPORTANT: Think hard about your calculations ALWAYS double check your work as you go along. 10 | - IMPORTANT: After you generate your report, review your numbers comprehensively with python. Also, make sure you write emojis and not unicode characters. 11 | - In your finance_report.yaml file, do not use yaml anchors or aliases and do not use !!python tags. Write everything out as primitive types even if it means duplicating data. 12 | 13 | ## Variables 14 | 15 | DROPPED_FILE_PATH: [[FILE_PATH]] 16 | DROPPED_FILE_PATH_ARCHIVE: agentic_drop_zone/finance_zone/drop_zone_file_archive/ 17 | FINANCE_OUTPUT_DIR: agentic_drop_zone/finance_zone/finance_output// 18 | - This is the directory where all processed files and reports will be saved 19 | - The date_time is the current date and time in the format YYYY-MM-DD_HH-MM-SS 20 | 21 | ### Output File Paths 22 | CATEGORIZED_STATEMENT: FINANCE_OUTPUT_DIR//categorized_statement.csv 23 | - The cleaned and properly categorized bank statement 24 | FINANCE_REPORT: FINANCE_OUTPUT_DIR//finance_report.yaml 25 | - The comprehensive financial analysis report in YAML format 26 | SPENDING_PIE_CHART: FINANCE_OUTPUT_DIR//spending_by_category.png 27 | - Pie chart visualization of spending by category 28 | BALANCE_LINE_CHART: FINANCE_OUTPUT_DIR//balance_over_time.png 29 | - Line chart showing account balance progression over time 30 | 31 | ### Spending Thresholds (per category monthly spending) 32 | LOW_SPENDING_THRESHOLD: 500 33 | - Categories under this amount get 💰 emoji 34 | MODERATE_SPENDING_THRESHOLD: 1000 35 | - Categories between LOW and MODERATE get 🔥 emoji 36 | HIGH_SPENDING_THRESHOLD: 2000 37 | - Categories between MODERATE and HIGH get 🔥🔥 emoji 38 | - Categories over HIGH get 🔥🔥🔥 emoji 39 | 40 | ### Individual Transaction Alerts 41 | LARGE_TRANSACTION: 500 42 | - Single transactions over this get 🚨 flag 43 | UNUSUAL_TRANSACTION: 1000 44 | - Single transactions over this get ⚠️ flag 45 | MAJOR_PURCHASE: 2500 46 | - Single transactions over this get 🔴 flag 47 | 48 | ### Budget Warning Percentages 49 | HOUSING_WARNING_PCT: 30 50 | - Alert if housing > this % of monthly income 51 | DINING_ENTERTAINMENT_WARNING_PCT: 20 52 | - Alert if dining/entertainment > this % of total expenses 53 | SHOPPING_WARNING_PCT: 15 54 | - Alert if shopping > this % of total expenses 55 | TRANSPORTATION_WARNING_PCT: 20 56 | - Alert if transportation > this % of total expenses 57 | SUBSCRIPTION_WARNING_PCT: 10 58 | - Alert if subscriptions > this % of total expenses 59 | 60 | ## Workflow 61 | 62 | ### Setup Phase 63 | - Create output directory: `mkdir -p FINANCE_OUTPUT_DIR//` 64 | - Copy original file to preserve it: `cp DROPPED_FILE_PATH FINANCE_OUTPUT_DIR//original_statement.csv` 65 | - Create working copy: `cp FINANCE_OUTPUT_DIR//original_statement.csv FINANCE_OUTPUT_DIR//categorized_statement.csv` 66 | 67 | ### Analysis & Categorization Phase 68 | - Read the working copy: `FINANCE_OUTPUT_DIR//categorized_statement.csv` 69 | - For each transaction row: 70 | - Check if category is missing or incorrect 71 | - Apply categorization rules from "How to Categorize" section 72 | - Track which categories need updating 73 | - Use MultiEdit to update all categories at once in the working copy 74 | - Verify all transactions now have appropriate categories 75 | 76 | ### Calculation Phase 77 | - Calculate totals: 78 | - Total income = sum of all deposits 79 | - Total expenses = sum of all withdrawals 80 | - Net cash flow = income - expenses 81 | - Group expenses by category and calculate: 82 | - Total spending per category 83 | - Number of transactions per category 84 | - Percentage of total expenses per category 85 | - Identify top 5 spending categories 86 | - Identify top 5 largest individual transactions 87 | - Count transactions exceeding alert thresholds 88 | 89 | ### Report Generation Phase 90 | - Create report file: `FINANCE_OUTPUT_DIR//finance_report.yaml` 91 | - Generate visualization charts as PNG files (use matplotlib with optional seaborn for styling): 92 | 1. **Spending Pie Chart** (`FINANCE_OUTPUT_DIR//spending_by_category.png`): 93 | - Use matplotlib or plotly to create a pie chart 94 | - Show top 10 categories by spending amount 95 | - Include percentages and dollar amounts on labels 96 | - Use distinct colors for each category 97 | - Title: "Monthly Spending by Category - [Month Year]" 98 | - Figure size: 12x8 inches 99 | - DPI: 150 for high quality 100 | - Add legend with category names and amounts 101 | - Explode the largest spending category slightly for emphasis 102 | - Example command: 103 | ```bash 104 | uv run --with pandas --with matplotlib python -c " 105 | import pandas as pd 106 | import matplotlib.pyplot as plt 107 | # Read categorized data 108 | df = pd.read_csv('categorized_statement.csv') 109 | # Group by category and sum withdrawals 110 | # Create pie chart with top 10 categories 111 | # plt.figure(figsize=(12, 8)) 112 | # plt.savefig('spending_by_category.png', dpi=150, bbox_inches='tight') 113 | " 114 | ``` 115 | 116 | 2. **Account Balance Chart** (`FINANCE_OUTPUT_DIR//balance_over_time.png`): 117 | - Create a line chart showing balance progression through the month 118 | - X-axis: dates (formatted as MM/DD) 119 | - Y-axis: running balance (formatted with $ and commas) 120 | - Mark major transactions (>$1000) with red dots and annotations 121 | - Add horizontal dashed line for starting balance 122 | - Add horizontal dotted line for ending balance 123 | - Include grid for better readability 124 | - Title: "Account Balance Over Time - [Month Year]" 125 | - Figure size: 14x7 inches 126 | - DPI: 150 for high quality 127 | - Use gradient fill below the line (green for positive, red for negative if applicable) 128 | - Add min/max balance annotations 129 | - Example command: 130 | ```bash 131 | uv run --with pandas --with matplotlib python -c " 132 | import pandas as pd 133 | import matplotlib.pyplot as plt 134 | import matplotlib.dates as mdates 135 | # Read categorized data 136 | df = pd.read_csv('categorized_statement.csv') 137 | # Convert date column to datetime 138 | # plt.figure(figsize=(14, 7)) 139 | # Plot balance over time with styling 140 | # Annotate major transactions 141 | # plt.savefig('balance_over_time.png', dpi=150, bbox_inches='tight') 142 | " 143 | ``` 144 | 145 | - Generate YAML report with the following structure: 146 | 147 | ```yaml 148 | report_date: YYYY-MM-DD HH:MM:SS 149 | month_analyzed: August 2025 150 | 151 | financial_summary: 152 | total_income: 20000.00 153 | total_expenses: 74567.89 154 | net_cash_flow: -54567.89 155 | cash_flow_status: negative # positive or negative 156 | transactions_analyzed: 87 157 | 158 | top_spending_categories: 159 | - category: "AI Services" 160 | amount: 45678.90 161 | emoji: "🔥🔥🔥" # Based on thresholds 162 | percentage: 61.2 163 | transaction_count: 23 164 | - category: "Technology - Cloud" 165 | amount: 12345.67 166 | emoji: "🔥🔥🔥" 167 | percentage: 16.5 168 | transaction_count: 15 169 | # ... top 5 170 | 171 | largest_transactions: 172 | - date: "2025-08-29" 173 | description: "ANTHROPIC CLAUDE-OPUS-4-1-API" 174 | amount: 6789.01 175 | category: "AI Services" 176 | alert: "🔴" # Based on individual thresholds 177 | - date: "2025-08-22" 178 | description: "AWS MONTHLY BILLING 866-216-1072" 179 | amount: 5678.90 180 | category: "Technology" 181 | alert: "🔴" 182 | # ... top 5 183 | 184 | all_categories: 185 | - category: "AI Services" 186 | amount: 45678.90 187 | transactions: 23 188 | percentage: 61.2 189 | - category: "Amazon" 190 | amount: 23456.78 191 | transactions: 18 192 | percentage: 31.4 193 | # ... all categories sorted by amount 194 | 195 | budget_warnings: 196 | - type: "Housing" 197 | actual_percentage: 21.0 198 | recommended_max: 30 199 | status: "OK" 200 | - type: "Shopping" 201 | actual_percentage: 31.4 202 | recommended_max: 15 203 | status: "⚠️ EXCEEDED" 204 | # ... check all warning categories 205 | 206 | transaction_alerts: 207 | major_purchases: # Over MAJOR_PURCHASE threshold 208 | count: 12 209 | total: 45678.90 210 | unusual_transactions: # Over UNUSUAL_TRANSACTION threshold 211 | count: 28 212 | total: 67890.12 213 | large_transactions: # Over LARGE_TRANSACTION threshold 214 | count: 45 215 | total: 89012.34 216 | 217 | insights: 218 | highest_spending_day: 219 | date: "2025-08-29" 220 | amount: 9234.56 221 | most_frequent_merchant: 222 | name: "AMAZON" 223 | count: 18 224 | total_amazon_spending: 23456.78 225 | subscription_count: 6 226 | 227 | subscriptions_detected: 228 | - name: "Netflix" 229 | amount: 15.99 230 | - name: "Spotify" 231 | amount: 9.99 232 | - name: "AWS" 233 | amount: 5678.90 234 | # ... all recurring charges 235 | 236 | recommendations: 237 | - "AI Services spending (61.2%) is extremely high - review API usage and consider optimization" 238 | - "Shopping exceeds budget by 16.4% - consider reducing Amazon purchases" 239 | - "Multiple AWS charges detected - consolidate billing or review unused services" 240 | 241 | visualizations: 242 | spending_pie_chart: "spending_by_category.png" 243 | balance_line_chart: "balance_over_time.png" 244 | ``` 245 | 246 | ### Completion Phase 247 | - Save the categorized statement and report 248 | - Display summary in console: 249 | ``` 250 | ✅ Processing Complete 251 | - Transactions processed: XX 252 | - Categories fixed: XX 253 | - Files created: 254 | - categorized_statement.csv 255 | - finance_report.yaml 256 | - spending_by_category.png 257 | - balance_over_time.png 258 | ``` 259 | - Open output directory: `open FINANCE_OUTPUT_DIR//` 260 | - Archive the original: `mv DROPPED_FILE_PATH DROPPED_FILE_PATH_ARCHIVE/` 261 | 262 | ## How to Categorize 263 | 264 | Apply these rules in order of priority: 265 | 266 | ### Priority 1: Merchant-Specific Mappings 267 | - AMAZON (any mention including AMZN but not AWS) → `Amazon` 268 | - AWS (Amazon Web Services) → `Technology - Cloud` 269 | - ANTHROPIC, CLAUDE → `AI Services` 270 | - OPENAI, GPT, DALL-E → `AI Services` 271 | - GOOGLE NANO-BANANA → `AI Services` 272 | - GOOGLE COMPUTE, COMPUTE ENGINE, EC2, VM, INSTANCE → `Compute` 273 | - TARGET → `Retail Shopping` 274 | - WALMART, COSTCO, SAM'S CLUB → `Wholesale Shopping` 275 | - SAFEWAY, KROGER, WHOLE FOODS, TRADER JOE'S → `Groceries` 276 | - UBER (not UBER EATS), LYFT, TAXI → `Transportation - Rideshare` 277 | - SHELL, CHEVRON, EXXON, GAS STATION → `Transportation - Gas` 278 | - TESLA, CAR PAYMENT → `Transportation - Auto` 279 | - NETFLIX, HULU, SPOTIFY, APPLE MUSIC → `Entertainment - Streaming` 280 | - STARBUCKS, COFFEE, CAFE, BLUE BOTTLE, PHILZ → `Dining - Coffee` 281 | - RESTAURANT, BISTRO, SUSHI, PIZZA → `Dining - Restaurant` 282 | - UBER EATS, DOORDASH, GRUBHUB → `Dining - Delivery` 283 | - CHIPOTLE, MCDONALD'S, SUBWAY → `Dining - Fast Food` 284 | 285 | ### Priority 2: Keyword-Based Rules 286 | - MORTGAGE, RENT → `Housing - Primary` 287 | - ELECTRIC, PG&E, WATER, UTILITY → `Utilities` 288 | - INSURANCE → `Insurance - [Type]` (Auto/Health/Life based on context) 289 | - GYM, FITNESS, EQUINOX, YOGA → `Health - Fitness` 290 | - DOCTOR, DENTIST, MEDICAL, DR → `Health - Medical` 291 | - PHARMACY, CVS, WALGREENS → `Health - Pharmacy` 292 | - PAYROLL, SALARY, DIRECT DEPOSIT, ACH CREDIT → `Income - Salary` 293 | - TAX, IRS, COUNTY TAX → `Taxes` 294 | - INVESTMENT, SCHWAB, FIDELITY, VANGUARD → `Investment` 295 | - PHONE, VERIZON, AT&T, T-MOBILE → `Utilities - Phone` 296 | - INTERNET, XFINITY, COMCAST → `Utilities - Internet` 297 | - PET, VET, PETCO → `Pet Care` 298 | - HOME DEPOT, LOWE'S → `Home Improvement` 299 | - PARKING METER, PARKING → `Transportation - Parking` 300 | - AIRLINE, HOTEL, AIRBNB → `Travel` 301 | - APPLE STORE, BEST BUY → `Shopping - Electronics` 302 | - NORDSTROM, GAP, H&M → `Shopping - Clothing` 303 | 304 | ### Priority 3: Default Categories 305 | - Deposits without clear source → `Income - Other` 306 | - Withdrawals without clear purpose → `Cash Withdrawal` 307 | - Any Amazon not categorized → `Amazon` 308 | - Food-related uncategorized → `Groceries` 309 | - Service-related uncategorized → `Services` 310 | - Retail uncategorized → `Shopping - General` 311 | 312 | ## My Categories 313 | 314 | - `AI Services` 315 | - `Amazon` 316 | - `Banking Fees` 317 | - `Cash Withdrawal` 318 | - `Cloud Computing` 319 | - `Compute` 320 | - `Dining - Coffee` 321 | - `Dining - Delivery` 322 | - `Dining - Fast Food` 323 | - `Dining - Restaurant` 324 | - `Entertainment - General` 325 | - `Entertainment - Streaming` 326 | - `Groceries` 327 | - `Health - Fitness` 328 | - `Health - Medical` 329 | - `Health - Pharmacy` 330 | - `Home Improvement` 331 | - `Housing - Primary` 332 | - `Income - Other` 333 | - `Income - Salary` 334 | - `Insurance - Auto` 335 | - `Insurance - Health` 336 | - `Insurance - Life` 337 | - `Investment` 338 | - `Miscellaneous` 339 | - `Pet Care` 340 | - `Retail Shopping` 341 | - `Services` 342 | - `Shopping - Clothing` 343 | - `Shopping - Electronics` 344 | - `Shopping - General` 345 | - `Taxes` 346 | - `Technology - Cloud` 347 | - `Technology - Software` 348 | - `Transportation - Auto` 349 | - `Transportation - Gas` 350 | - `Transportation - Parking` 351 | - `Transportation - Rideshare` 352 | - `Travel` 353 | - `Utilities` 354 | - `Utilities - Internet` 355 | - `Utilities - Phone` 356 | - `Wholesale Shopping` -------------------------------------------------------------------------------- /.claude/commands/more_training_data.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Generate More Training Data 3 | allowed-tools: Bash, Read, Write 4 | description: Analyze data patterns and generate additional synthetic training data 5 | --- 6 | 7 | # Generate More Training Data 8 | 9 | This command analyzes patterns in existing data files (CSV, JSONL) and generates additional synthetic training data based on those patterns. Uses bash commands or inline uv python to append data efficiently without loading large files into memory. 10 | 11 | ## Instructions 12 | 13 | - IMPORTANT: You can use inline astral uv python code (with any libraries you need) for data processing. Use `uv run python --with pandas --with -c "import pandas as pd; print(\"whatever you want here\")"` 14 | - Example: `uv run --with pandas --with faker python -c "import pandas as pd; from faker import Faker; fake = Faker(); print(fake.name())"` 15 | - IMPORTANT: Both bash commands and uv python are acceptable - choose the most efficient approach for each task 16 | - IMPORTANT: When generating synthetic data, ensure variety and realistic patterns 17 | 18 | ## Variables 19 | 20 | DROPPED_FILE_PATH: [[FILE_PATH]] 21 | DROPPED_FILE_PATH_ARCHIVE: agentic_drop_zone/training_data_zone/drop_zone_file_archive/ 22 | DATA_OUTPUT_DIR: agentic_drop_zone/training_data_zone/data_output// 23 | - This is the directory where all generated data will be saved 24 | - The date_time is the current date and time in the format YYYY-MM-DD_HH-MM-SS 25 | NUM_NEW_ROWS: 25 26 | - Default number of new data rows to generate 27 | - Can be overridden if specified in the dropped file 28 | SAMPLE_SIZE: 50 29 | - Number of rows to sample for pattern analysis (keeps context window small) 30 | - Use Read with only a specific number of rows to keep the context window small 31 | 32 | ## Workflow 33 | 34 | - Create output directory: `DATA_OUTPUT_DIR//` 35 | - Determine file format by extension (.csv or .jsonl) 36 | - Copy the original file to output directory: `cp DROPPED_FILE_PATH DATA_OUTPUT_DIR//original_` 37 | 38 | ### Pattern Analysis Phase 39 | 40 | - Extract a sample for analysis (to keep context window small): 41 | 42 | **Option 1: Using bash commands** 43 | - For CSV: `head -n SAMPLE_SIZE DROPPED_FILE_PATH > DATA_OUTPUT_DIR//sample.csv` 44 | - For JSONL: `head -n SAMPLE_SIZE DROPPED_FILE_PATH > DATA_OUTPUT_DIR//sample.jsonl` 45 | 46 | **Option 2: Using uv python** 47 | ```bash 48 | # For CSV 49 | uv run --with pandas python -c " 50 | import pandas as pd 51 | df = pd.read_csv('DROPPED_FILE_PATH', nrows=100) 52 | df.to_csv('DATA_OUTPUT_DIR//sample.csv', index=False) 53 | print(f'Sampled {len(df)} rows for analysis') 54 | " 55 | 56 | # For JSONL 57 | uv run --with pandas python -c " 58 | import pandas as pd 59 | df = pd.read_json('DROPPED_FILE_PATH', lines=True, nrows=100) 60 | df.to_json('DATA_OUTPUT_DIR//sample.jsonl', orient='records', lines=True) 61 | print(f'Sampled {len(df)} rows for analysis') 62 | " 63 | ``` 64 | 65 | - Read and analyze ONLY the sample file to determine: 66 | - Data schema/structure 67 | - Field types and patterns 68 | - Value distributions and constraints 69 | - Any relationships between fields 70 | 71 | **For CSV files:** 72 | - Identify column headers from first line 73 | - Detect data types for each column (numeric, text, date, boolean, etc.) 74 | - Analyze value ranges for numeric columns 75 | - Identify patterns in text fields (emails, phone numbers, IDs, etc.) 76 | - Check for categorical values and their distributions 77 | 78 | **For JSONL files:** 79 | - Parse each line as a separate JSON object 80 | - Identify all keys and their data types 81 | - Detect enumerated values and their frequencies 82 | - Identify any ID patterns or sequences 83 | - Note: Each line must be a complete, valid JSON object 84 | 85 | ### Data Generation Phase 86 | 87 | - Based on the pattern analysis, generate `NUM_NEW_ROWS` new data entries 88 | - Write the new data to a separate file: 89 | - For CSV: `DATA_OUTPUT_DIR//new_rows.csv` (without headers) 90 | - For JSONL: `DATA_OUTPUT_DIR//new_rows.jsonl` 91 | 92 | **Example using uv python with faker:** 93 | ```bash 94 | # Generate synthetic CSV data 95 | uv run --with pandas --with faker python -c " 96 | import pandas as pd 97 | from faker import Faker 98 | import random 99 | fake = Faker() 100 | 101 | # Generate 25 rows of synthetic data based on analyzed patterns 102 | data = [] 103 | for i in range(25): 104 | row = { 105 | 'id': i + 1000, # Continue from existing IDs 106 | 'name': fake.name(), 107 | 'email': fake.email(), 108 | 'age': random.randint(22, 65), 109 | 'department': random.choice(['Engineering', 'Marketing', 'Sales', 'Support']) 110 | } 111 | data.append(row) 112 | 113 | df = pd.DataFrame(data) 114 | df.to_csv('DATA_OUTPUT_DIR//new_rows.csv', index=False, header=False) 115 | print(f'Generated {len(df)} new rows') 116 | " 117 | ``` 118 | 119 | - Generated data should: 120 | - Follow the same structure as the original 121 | - Maintain realistic value distributions 122 | - Preserve relationships between fields 123 | - Use similar patterns for IDs, dates, etc. 124 | - Include variation to avoid exact duplicates 125 | - Maintain data integrity constraints observed in original 126 | 127 | ### Append Phase 128 | 129 | - Create the extended dataset by appending new rows to a copy of the original: 130 | 131 | **Option 1: Using bash commands** 132 | 133 | For CSV: 134 | ```bash 135 | # Copy original to extended file 136 | cp DATA_OUTPUT_DIR//original_ DATA_OUTPUT_DIR//extended_data.csv 137 | 138 | # Append new rows (skip header if present in new_rows.csv) 139 | tail -n +2 DATA_OUTPUT_DIR//new_rows.csv >> DATA_OUTPUT_DIR//extended_data.csv 140 | ``` 141 | 142 | For JSONL: 143 | ```bash 144 | # Copy original to extended file 145 | cp DATA_OUTPUT_DIR//original_ DATA_OUTPUT_DIR//extended_data.jsonl 146 | 147 | # Append new rows 148 | cat DATA_OUTPUT_DIR//new_rows.jsonl >> DATA_OUTPUT_DIR//extended_data.jsonl 149 | ``` 150 | 151 | **Option 2: Using uv python** 152 | 153 | For CSV: 154 | ```bash 155 | uv run --with pandas python -c " 156 | import pandas as pd 157 | 158 | # Read original and new data 159 | original = pd.read_csv('DATA_OUTPUT_DIR//original_') 160 | new_rows = pd.read_csv('DATA_OUTPUT_DIR//new_rows.csv', header=None, names=original.columns) 161 | 162 | # Combine and save 163 | extended = pd.concat([original, new_rows], ignore_index=True) 164 | extended.to_csv('DATA_OUTPUT_DIR//extended_data.csv', index=False) 165 | print(f'Extended dataset: {len(original)} -> {len(extended)} rows') 166 | " 167 | ``` 168 | 169 | For JSONL: 170 | ```bash 171 | uv run --with pandas python -c " 172 | import pandas as pd 173 | 174 | # Read original and new data 175 | original = pd.read_json('DATA_OUTPUT_DIR//original_', lines=True) 176 | new_rows = pd.read_json('DATA_OUTPUT_DIR//new_rows.jsonl', lines=True) 177 | 178 | # Combine and save 179 | extended = pd.concat([original, new_rows], ignore_index=True) 180 | extended.to_json('DATA_OUTPUT_DIR//extended_data.jsonl', orient='records', lines=True) 181 | print(f'Extended dataset: {len(original)} -> {len(extended)} rows') 182 | " 183 | ``` 184 | 185 | ### Reporting Phase 186 | 187 | - Count rows in original and extended files: 188 | ```bash 189 | # For CSV (subtract 1 for header) 190 | ORIGINAL_COUNT=$(($(wc -l < DATA_OUTPUT_DIR//original_) - 1)) 191 | EXTENDED_COUNT=$(($(wc -l < DATA_OUTPUT_DIR//extended_data.csv) - 1)) 192 | 193 | # For JSONL 194 | ORIGINAL_COUNT=$(wc -l < DATA_OUTPUT_DIR//original_) 195 | EXTENDED_COUNT=$(wc -l < DATA_OUTPUT_DIR//extended_data.jsonl) 196 | ``` 197 | 198 | - Create analysis report `DATA_OUTPUT_DIR//data_analysis_report.md`: 199 | - Original file name and format 200 | - Sample size analyzed 201 | - Detected schema/structure 202 | - Field types and patterns identified 203 | - Value distributions observed 204 | - Generation strategy used 205 | - Number of rows: original vs extended 206 | 207 | - Create metadata file `DATA_OUTPUT_DIR//generation_metadata.json`: 208 | ```json 209 | { 210 | "source_file": "path/to/original", 211 | "generation_timestamp": "ISO-8601 timestamp", 212 | "rows_generated": 25, 213 | "original_row_count": X, 214 | "extended_row_count": Y, 215 | "file_format": "csv|jsonl", 216 | "sample_size_analyzed": 100, 217 | "fields_analyzed": ["field1", "field2", ...] 218 | } 219 | ``` 220 | 221 | - Display summary: 222 | - Original file analyzed 223 | - Number of rows in original 224 | - Number of new rows generated 225 | - Total rows in extended file 226 | - Output files created 227 | - Processing time 228 | 229 | - Open the output directory: `open DATA_OUTPUT_DIR//` 230 | - When finished, move the `DROPPED_FILE_PATH` into `DROPPED_FILE_PATH_ARCHIVE` directory 231 | 232 | ## Important Notes 233 | 234 | - **CSV Format:** Must have headers in first row, data starts from row 2 235 | - **JSONL Format:** Each line is a complete JSON object, not a JSON array 236 | - **Large Files:** This approach keeps large files out of the agent's context window by: 237 | - Only reading a sample for analysis 238 | - Generating to separate files 239 | - Using bash commands for appending 240 | - **Performance:** Bash append operations are fast and memory-efficient 241 | - **Data Integrity:** The extended file preserves all original data unchanged 242 | 243 | ## Example Patterns to Recognize 244 | 245 | **CSV Example:** 246 | ```csv 247 | id,name,email,age,department 248 | 1,John Doe,john@example.com,28,Engineering 249 | 2,Jane Smith,jane@example.com,32,Marketing 250 | ``` 251 | → Generate: Sequential IDs, realistic names, email patterns, age ranges, department categories 252 | 253 | **JSONL Example:** 254 | ```jsonl 255 | {"user_id": "USR001", "score": 85.5, "tags": ["python", "ml"], "active": true} 256 | {"user_id": "USR002", "score": 92.0, "tags": ["javascript"], "active": false} 257 | ``` 258 | → Generate: USR-prefixed IDs, scores in similar range, relevant tags, boolean values 259 | 260 | ## Special Handling 261 | 262 | - **Look for override instructions:** Check if the dropped file contains a comment like `# generate_rows: 50` or `"generate_rows": 50` to override NUM_NEW_ROWS 263 | - **Preserve formatting:** Maintain consistent decimal places, date formats, etc. 264 | - **Handle edge cases:** Empty files, malformed data should be reported gracefully 265 | - **Memory efficiency:** Never load the full extended dataset into memory -------------------------------------------------------------------------------- /.claude/commands/morning_debrief.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Morning Debrief 3 | allowed-tools: Bash, Read, Write 4 | description: Transcribe morning debrief audio and analyze for engineering ideas and priorities 5 | --- 6 | 7 | # Morning Debrief Analyzer 8 | 9 | This prompt transcribes morning debrief audio recordings using OpenAI Whisper and analyzes the transcript to extract and organize key engineering ideas discussed. It creates a structured summary with the current date and quarter, identifies the top 3 priorities, lists all key ideas from the debrief, and generates novel extensions based on those ideas, and generates leading questions that can guide our work today with ideas for potential answers and next steps. Then it creates a transcript section with the full transcript of the debrief with every sentence as an individual item in a bulleted list. The output follows a clear hierarchical structure that makes it easy to reference during the workday. See the `Instructions` section for the detailed process. Output your results in a new markdown file with an alphanumeric + underscore name based on the original transcript file name. 10 | 11 | ## Prerequisites 12 | 13 | - OpenAI Whisper must be installed 14 | - If you encounter installation errors, STOP and notify the user: 15 | ``` 16 | Whisper is not installed. Please run: 17 | uv tool install openai-whisper 18 | ``` 19 | 20 | ## Variables 21 | 22 | AUDIO_FILE_PATH: [[FILE_PATH]] 23 | DEBRIEF_OUTPUT_DIR: agentic_drop_zone/morning_debrief_zone/debrief_output// 24 | DEBRIEF_ARCHIVE_DIR: DEBRIEF_OUTPUT_DIR/drop_zone_file_archive/ 25 | 26 | ## Instructions 27 | - First, check if whisper is available by running: `which whisper` 28 | - If whisper is not found, notify the user to install it with: `uv tool install openai-whisper` 29 | - Create output directory: `DEBRIEF_OUTPUT_DIR//` 30 | - `date_time` is the current date and time in the format YYYY-MM-DD_HH-MM-SS 31 | - Transcribe the audio file using: `whisper "[[FILE_PATH]]" --model tiny --language en --output_format txt --output_dir DEBRIEF_OUTPUT_DIR/` 32 | - The `--model tiny` is fast and suitable for English transcription 33 | - You can use `--model base` or `--model small` for better accuracy if needed 34 | - The transcription will generate a .txt file in the output directory 35 | - IMPORTANT: Run this command with a 5 minute timeout. If it doesn't finish, notify the user and stop. 36 | - Read the generated transcript file (it will have the same base name as the audio file but with .txt extension) 37 | - Read the generated transcript file 38 | - Determine the current date and quarter (Q1: Jan-Mar, Q2: Apr-Jun, Q3: Jul-Sep, Q4: Oct-Dec) 39 | - Analyze the transcript to identify all engineering ideas and priorities mentioned 40 | - Extract the top 3 most important priorities from the discussion 41 | - List all key ideas concisely, focusing on actionable engineering concepts 42 | - Generate novel extensions by: 43 | - Combining related ideas in new ways 44 | - Identifying potential optimizations or improvements 45 | - Suggesting complementary features or approaches 46 | - Proposing innovative solutions based on the discussed concepts 47 | - Extrapolate from the key ideas to add your own tasteful extensions 48 | - Push the ideas further based on your own experience and knowledge 49 | - Structure the output with clear sections and bullet points for readability 50 | - Keep descriptions concise but informative 51 | - Focus on actionable aspects 52 | - IMPORTANT: Output your results in a new markdown file in the output directory: `DEBRIEF_OUTPUT_DIR//debrief__<3 letter month>_<2 digit day>_<4 digit year>.md` 53 | - Copy the original audio file to the output directory for reference: `cp AUDIO_FILE_PATH DEBRIEF_OUTPUT_DIR//original_audio.` 54 | - IMPORTANT: Once you finish, open the new file with `code DEBRIEF_OUTPUT_DIR//debrief__<3 letter month>_<2 digit day>_<4 digit year>.md` 55 | - Ultra Think as you work through this process. 56 | - When finished, move the original audio file to the archive: `mv AUDIO_FILE_PATH DEBRIEF_ARCHIVE_DIR/` 57 | 58 | ## Output Structure 59 | The analysis should be formatted as follows: 60 | 1. **Title** - A descriptive title based on the debrief content 61 | 2. **Date** - Current date with quarter (e.g., "2025-01-29 (Q1 2025)") 62 | 3. **Top 3 Priorities** - Numbered list of the most important items 63 | 4. **Key Ideas** - Bulleted list of all ideas from the transcript 64 | 5. **Extensions** - Novel ideas derived from the key ideas 65 | 6. **Leading Questions** - Questions to guide today's work with potential answers 66 | 7. **Transcript** - Full transcript with each sentence as a bullet point 67 | 68 | -------------------------------------------------------------------------------- /.claude/commands/prime.md: -------------------------------------------------------------------------------- 1 | # Prime 2 | 3 | Understand the files in the `Read` section, and execute the `Run` commands then `Report` your findings. 4 | 5 | ## Read 6 | 7 | - README.md 8 | - sfs_agentic_drop_zone.py 9 | - drops.yaml 10 | - .claude/commands/ 11 | 12 | ## Execute 13 | 14 | git ls-files 15 | 16 | ## Report 17 | 18 | Report your understanding of this codebase in this format: 19 | 20 | For each file, report the following: 21 | ` - ` 22 | 23 | Then provide an overall summary of the codebase. -------------------------------------------------------------------------------- /.env.sample: -------------------------------------------------------------------------------- 1 | ANTHROPIC_API_KEY= 2 | OPENAI_API_KEY= 3 | GEMINI_API_KEY= 4 | # Claude Code CLI path (defaults to 'claude') 5 | # If already installed locally, try: 6 | # export PATH="$HOME/node_modules/.bin:$PATH" 7 | # If installed locally, set to: /path/to/node_modules/.bin/claude 8 | CLAUDE_CODE_PATH=claude 9 | REPLICATE_API_TOKEN= 10 | -------------------------------------------------------------------------------- /.gemini/settings.json.sample: -------------------------------------------------------------------------------- 1 | { 2 | "mcpServers": { 3 | "replicate": { 4 | "command": "npx", 5 | "args": [ 6 | "-y", 7 | "replicate-mcp" 8 | ], 9 | "env": { 10 | "REPLICATE_API_TOKEN": "" 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | adw/ 2 | *zone/ 3 | *.pyc 4 | *.pyo 5 | *.pyd 6 | *.pyw 7 | *.pyz 8 | *.pywz 9 | *.pyzw 10 | .env 11 | .mcp.json 12 | !sfs_agentic_drop_zone.py 13 | output/ 14 | .DS_Store 15 | 16 | **private/ 17 | .gemini/settings.json 18 | .codex/settings.json -------------------------------------------------------------------------------- /.mcp.json.sample: -------------------------------------------------------------------------------- 1 | { 2 | "mcpServers": { 3 | "replicate": { 4 | "command": "npx", 5 | "args": ["-y", "replicate-mcp"], 6 | "env": { 7 | "REPLICATE_API_TOKEN": "" 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Agentic Drop Zone 2 | > See what you can do with the Agentic Drop Zone [in this video](https://youtu.be/gyjoXC8lzIw). 3 | 4 | Automated file processing system that monitors directories and triggers agents (Claude Code, Gemini CLI, Codex CLI) when files are dropped. 5 | 6 | ## Features 7 | 8 | - 📝 Simple single file script: `sfs_agentic_drop_zone.py` 9 | - ⚙️ Configurable drop zones in `drops.yaml` 10 | - 🤖 Agent agnostic implementation: Claude Code, Gemini CLI, Codex CLI (unimplemented) 11 | - 🧩 Run multiple agents in parallel 12 | - 🚀 Run arbitrary agentic workflows: Do 'anything' your agent can do 13 | 14 | System Architecture Diagram 15 | 16 | ## System Architecture 17 | 18 | ```mermaid 19 | graph LR 20 | subgraph "Agentic Drop Zone System" 21 | A[File Dropped] --> B[Watchdog Detects Event] 22 | B --> C{Matches Pattern?} 23 | C -->|Yes| D[Load Prompt Template] 24 | C -->|No| E[Ignore] 25 | D --> F[Replace FILE_PATH Variable] 26 | F --> G{Select Agent} 27 | G -->|claude_code| H[Claude Code
Full tool access
MCP servers] 28 | G -->|gemini_cli| I[Gemini CLI
Google AI
] 29 | G -->|codex_cli| J[Codex CLI
OpenAI
unimplemented] 30 | H --> K[Stream Response] 31 | I --> K 32 | J --> K 33 | K --> L[Display in Console] 34 | L --> B 35 | end 36 | ``` 37 | 38 | 39 | ## How It Works 40 | 41 | 1. **Watch** - Monitors configured directories for file events (create/modify/delete/move) 42 | 2. **Match** - Checks if dropped files match configured patterns (*.txt, *.json, etc.) 43 | 3. **Process** - Executes Claude Code with custom prompts to process the files 44 | 4. **Output** - Rich console display with streaming responses in styled panels 45 | 46 | ## Quick Start 47 | 48 | ```bash 49 | # Install uv (if not already installed) 50 | curl -LsSf https://astral.sh/uv/install.sh | sh 51 | 52 | # Setup environment variables (at least Claude Code API key) 53 | export ANTHROPIC_API_KEY="your-claude-api-key" 54 | export CLAUDE_CODE_PATH="path-to-claude-cli" # default to claude, may need to run which claude to find the path 55 | 56 | # Run with uv 57 | uv run sfs_agentic_drop_zone.py 58 | 59 | # Drag and drop (copy to reuse) files from example_input_files folder into the drop zone directories 60 | cp example_input_files/echo.txt agentic_drop_zone/echo_zone/ 61 | ``` 62 | 63 | ## MCP Support 64 | 65 | - Claude Code supports MCP servers, run `cp .mcp.json.sample .mcp.json` and edit the file with your API keys 66 | - Gemini CLI supports MCP servers, run `cp .gemini/settings.json.sample .gemini/settings.json` and edit the file with your API keys 67 | - Codex CLI does not support MCP servers without modifying root level `~/.codex/config.toml` (untested) 68 | 69 | ## ⚠️ Dangerous Agent Execution 70 | 71 | **IMPORTANT:** Agents are given complete control over your system with dangerous execution capabilities. Agent permissions are as follows: 72 | 73 | - Claude Code runs with `bypassPermissions` mode, which allows all tools without prompting 74 | - Gemini CLI runs with `yolo` flag with the `--sandbox` flag, which auto-approves all actions but prevents moving outside of the sandbox directory 75 | - Codex CLI (not implemented) 76 | 77 | **By using this system, you acknowledge the risks and take full responsibility for any actions performed by the agents.** 78 | 79 | ## Configuration (drops.yaml) 80 | 81 | ```yaml 82 | drop_zones: 83 | - name: "Image Generation Drop Zone" 84 | file_patterns: ["*.txt", "*.md"] # File types to watch 85 | reusable_prompt: ".claude/commands/create_image.md" # Prompt template 86 | zone_dirs: ["generate_images_zone"] # Directories to monitor 87 | events: ["created"] # Trigger on file creation 88 | agent: "claude_code" # Agent type 89 | model: "sonnet" # Claude model 90 | mcp_server_file: ".mcp.json" # MCP tools config (optional) 91 | create_zone_dir_if_not_exists: true # Auto-create directories 92 | ``` 93 | 94 | ## Agents 95 | 96 | The system supports multiple AI agents with different capabilities: 97 | 98 | ### Claude Code (Most Capable) 99 | - 100 | - **Status**: ✅ Fully implemented 101 | - **SDK**: Native Python, Typescript, and CLI SDK with streaming support 102 | - **Output**: Clean, formatted panels with real-time streaming 103 | - **Models**: `sonnet`, `opus`, `haiku` 104 | - **MCP Support**: Full MCP tool integration 105 | - **Best For**: Complex tasks requiring tool use, SOTA performance 106 | - [Documentation](https://docs.anthropic.com/en/docs/claude-code/sdk/sdk-overview) 107 | 108 | ### Gemini CLI 109 | - **Status**: 🟡 Implemented with subprocess streaming 110 | - **SDK**: No SDK - uses CLI via subprocess 111 | - **Output**: Line-by-line streaming in panels (due to CLI limitations) 112 | - **Models**: `gemini-2.5-pro` (default), `gemini-2.5-flash` 113 | - **Flags**: `--yolo` (auto-approve), `--sandbox` (sandboxing) 114 | - **Best For**: Quick tasks, alternative models outside of Anthropic models 115 | - [Documentation](https://github.com/google-gemini/gemini-cli) 116 | 117 | ### Codex CLI 118 | - **Status**: ❌ Not yet implemented 119 | - **SDK**: Would use CLI via subprocess 120 | - **Output**: TBD 121 | - **Models**: `gpt-5` 122 | - **Best For**: Future implementation (Up for a challenge?) 123 | - [Documentation](https://github.com/openai/codex) 124 | 125 | ### Configuration Example 126 | See `drops.yaml` for agent setup: 127 | 128 | ```yaml 129 | - name: "Claude Zone" 130 | agent: "claude_code" 131 | model: "sonnet" 132 | mcp_server_file: ".mcp.json" # specify this or it won't use MCP tools 133 | 134 | - name: "Gemini Zone" 135 | agent: "gemini_cli" 136 | model: "gemini-2.5-pro" 137 | ``` 138 | 139 | ## Claude Code SDK Integration 140 | 141 | Uses `ClaudeSDKClient` with streaming responses: 142 | 143 | ```python 144 | async with ClaudeSDKClient(options=ClaudeCodeOptions( 145 | permission_mode="bypassPermissions", 146 | model="sonnet", 147 | mcp_servers=".mcp.json" # Optional MCP tools 148 | )) as client: 149 | await client.query(prompt) 150 | async for message in client.receive_response(): 151 | # Stream responses in Rich panels 152 | ``` 153 | 154 | ## Agentic Workflows 155 | 156 | The system comes with several pre-configured workflows. Each requires specific setup and environment variables: 157 | 158 | ### 🎨 Image Generation Drop Zone 159 | **Directory:** `generate_images_zone/` 160 | **File Types:** `*.txt`, `*.md` 161 | **Purpose:** Generate images from text prompts using Replicate AI models 162 | 163 | **Requirements:** 164 | - Environment variable: `REPLICATE_API_TOKEN` (required) 165 | - MCP server configuration: `.mcp.json` (copy from `.mcp.json.sample`) 166 | - Claude Code with Replicate MCP tools 167 | 168 | **Usage:** Drop a text file containing image prompts. The system will: 169 | - Read each prompt from the file 170 | - Generate images using Replicate's models (default: google/nano-banana) 171 | - Save images with descriptive names and metadata 172 | - Archive the original prompt file 173 | - Open the output directory automatically 174 | 175 | ### 🖼️ Image Edit Drop Zone 176 | **Directory:** `edit_images_zone/` 177 | **File Types:** `*.txt`, `*.md`, `*.json` 178 | **Purpose:** Edit existing images using AI models 179 | 180 | **Requirements:** 181 | - Environment variable: `REPLICATE_API_TOKEN` (required) 182 | - MCP server configuration: `.mcp.json` 183 | - Image URLs or paths in the dropped files 184 | 185 | **Usage:** Drop files containing image paths/URLs and editing instructions. 186 | 187 | ### 📊 Training Data Generation Zone 188 | **Directory:** `training_data_zone/` 189 | **File Types:** `*.csv`, `*.jsonl` (JSON Lines format) 190 | **Purpose:** Analyze data patterns and generate synthetic training data 191 | 192 | **Requirements:** 193 | - No external API keys required 194 | - Uses Claude Code's built-in analysis capabilities 195 | 196 | **Usage:** Drop data files to: 197 | - Analyze a sample (100 rows) to understand patterns 198 | - Generate 25 additional rows (configurable) 199 | - Append new data using efficient bash commands 200 | - Create extended datasets without loading into memory 201 | - Preserve all original data unchanged 202 | 203 | **Optimization:** Uses bash append operations to handle large files efficiently 204 | 205 | ### 🎙️ Morning Debrief Zone 206 | **Directory:** `morning_debrief_zone/` 207 | **File Types:** `*.mp3`, `*.wav`, `*.m4a`, `*.flac`, `*.ogg`, `*.aac`, `*.mp4` 208 | **Purpose:** Transcribe morning debrief audio recordings and analyze content for engineering ideas and priorities 209 | 210 | **Requirements:** 211 | - OpenAI Whisper installed: `uv tool install openai-whisper` 212 | - No API keys required (runs locally) 213 | 214 | **Usage:** Drop audio files to: 215 | - Transcribe using Whisper's tiny model (fast, English) 216 | - Extract top 3 priorities from discussions 217 | - Identify key engineering ideas 218 | - Generate novel extensions and leading questions 219 | - Create structured debrief documents with: 220 | - Date and quarter tracking 221 | - Formatted transcript with bulleted sentences 222 | - Direct commands extracted from transcript 223 | - Archive original audio files after processing 224 | 225 | **Output:** Generates markdown debrief files with comprehensive analysis in `morning_debrief_zone/debrief_output//` 226 | 227 | ## Improvements 228 | 229 | - The `zone_dirs` should be a single directory (`zone_dir`), and this should be passed into each prompt as a prompt variable (## Variables) and used to create the output directory. Right now it's static in the respective prompts. 230 | - Get Codex CLI working (they don't have support for local .codex/config.toml at the time of writing) 231 | - Improve `Gemini CLI` streaming output to be more readable and less line by line based. They don't have an SDK, so we're using the CLI. 232 | 233 | ## Master AI Coding 234 | 235 | Learn to code with AI with foundational [Principles of AI Coding](https://agenticengineer.com/principled-ai-coding?y=adrzone) 236 | 237 | Follow the [IndyDevDan youtube channel](https://www.youtube.com/@indydevdan) for more Agentic Coding tips and tricks. -------------------------------------------------------------------------------- /ai_docs/ai_docs.md: -------------------------------------------------------------------------------- 1 | # Agentic Drop Zone Documentation 2 | 3 | ## Reference Links 4 | - https://docs.anthropic.com/en/docs/claude-code/sdk/sdk-python 5 | - https://github.com/gorakhargosh/watchdog?tab=readme-ov-file#example-api-usage 6 | - https://pythonhosted.org/watchdog/api.html 7 | - https://docs.astral.sh/uv/guides/scripts/#next-steps 8 | - https://replicate.com/docs/reference/mcp 9 | - https://docs.astral.sh/uv/guides/scripts/#running-a-script-with-dependencies 10 | - https://docs.astral.sh/uv 11 | - https://github.com/openai/whisper 12 | - https://github.com/openai/openai-python 13 | 14 | ## Recent Updates 15 | 16 | ### Rich Console Output 17 | Integrated Rich library for beautiful console output: 18 | - Claude Code responses displayed in individual styled panels as content streams in 19 | - Each response block appears in its own panel with title and subtitle 20 | - Color-coded file system events (create, modify, delete, move) 21 | - Structured logging with icons and color formatting 22 | - Clean, segmented display of streaming responses 23 | 24 | ### MCP Server Integration Support 25 | Added support for Model Context Protocol (MCP) servers through the `mcp_server_file` field in drop zone configuration. This allows integration with external tools and services. The file path is passed directly to ClaudeCodeOptions, which handles loading the configuration. 26 | 27 | ### PromptArgs Type System 28 | Introduced a structured `PromptArgs` Pydantic model to manage prompt-related arguments cleanly: 29 | - `reusable_prompt`: Path to the reusable prompt file 30 | - `file_path`: Path to the file being processed 31 | - `model`: Optional model specification 32 | - `mcp_server_file`: Optional path to MCP server configuration file 33 | 34 | ### Configuration Schema Updates 35 | The `DropZone` model now includes: 36 | - `mcp_server_file`: Optional path to MCP server configuration file (JSON or YAML) 37 | 38 | Example configuration: 39 | ```yaml 40 | drop_zones: 41 | - name: "Advanced Zone" 42 | file_patterns: ["*.py"] 43 | reusable_prompt: ".claude/commands/analyze.md" 44 | zone_dirs: ["src/"] 45 | events: ["created", "modified"] 46 | agent: "claude_code" 47 | model: "sonnet" 48 | mcp_server_file: ".mcp/servers.json" # New field for MCP integration 49 | ``` 50 | 51 | ### MCP Server File Format 52 | MCP server files can be in JSON or YAML format. The ClaudeCodeOptions class handles loading these files automatically: 53 | 54 | ```json 55 | { 56 | "database": { 57 | "command": "npx", 58 | "args": ["-y", "@modelcontextprotocol/server-postgres"], 59 | "env": {"DATABASE_URL": "postgresql://localhost:5432/mydb"} 60 | } 61 | } 62 | ``` 63 | 64 | ### Implementation Notes 65 | - The `mcp_server_file` path is passed directly to `ClaudeCodeOptions` as the `mcp_servers` parameter 66 | - ClaudeCodeOptions natively supports file paths (`dict | str | Path`) for MCP configurations 67 | - No manual file parsing is required - the SDK handles JSON/YAML loading internally 68 | 69 | ### Visual Output Features 70 | The application now uses Rich console for enhanced visual feedback: 71 | 72 | #### File System Events 73 | - ✨ Green for file creation 74 | - 📝 Yellow for file modification 75 | - 🗑️ Red for file deletion 76 | - 📦 Blue for file moves 77 | 78 | #### Claude Code Response Panel 79 | - Displays responses in a styled panel with cyan border 80 | - Shows "🤖 Claude Code" as the title 81 | - Includes the processing file name as subtitle 82 | - Live streaming updates as the response arrives 83 | - Clean padding and formatting for readability 84 | 85 | #### Status Messages 86 | - 🚀 Startup banner with application name 87 | - ✅ Green confirmation for started monitors 88 | - 🎯 Cyan summary of active observers 89 | - 🛑 Yellow stop notifications 90 | - ⚡ Keyboard interrupt handling -------------------------------------------------------------------------------- /ai_docs/astral-uv-single-file-scripts.md: -------------------------------------------------------------------------------- 1 | Guides 2 | Running scripts 3 | A Python script is a file intended for standalone execution, e.g., with python