abhuva/email-agent — reverse-engineered prompt
Reverse engineered prompt
Build me a Python command line email assistant that can connect to multiple IMAP email accounts, read new messages, and use an AI model through OpenRouter or another compatible provider to decide how important or spammy each email is. It should support both password login and OAuth for Google and Microsoft, including token refresh.
I want simple commands so I can process one account, process all accounts, process one exact email, run in dry run mode, show the final config for an account, and clean up any flags the tool added. Each account should have its own config and state so work and personal inboxes don’t get mixed up.
Please include a rules system where I can blacklist obvious junk before AI runs, whitelist important senders after scoring, convert HTML emails into readable text, generate simple notes from templates, and log everything clearly for debugging and auditing. Add safe error handling, retries for AI calls, and tests for the important parts.
Want more depth? Deep Reverse