Talk

Build a Manifest V3 Chrome extension: Tweet Sniper

From Wikiprompt, the free prompt encyclopedia

Build a Manifest V3 Chrome extension: Tweet Sniper A comprehensive prompt to build a Chrome extension that snipes X posts to Trello and bookmarks them, with detailed UI, capture, and acceptance criteria.

Prompt ContentSave

🌐
Build a Manifest V3 Chrome extension called "Tweet Sniper". GOAL On https://t.co/Wk6QtXaVt7, one click "snipes" a post. It saves the post as a card in the "Sniped" list on my Trello board and bookmarks it on X. That is the extension's entire job. The research happens later, and it is NOT part of this build. A separate assistant (Grok Bot) works the queue on the board: 1. It picks up new cards in Sniped (label "Needs research"). 2. It researches each one and writes a recommendation on the card (Build or Keep as reference, with reasons). 3. It moves the card to "Ready for Review". 4. When I say "let's review my research queue", it walks me through the Ready for Review cards one at a time. Build moves the card into the right app or Projects list. Keep as reference moves it to "Reference". So the extension must only create clean, consistent cards in Sniped. Don't build any analysis, scoring or review UI. UI - A crosshair icon (SVG, plus 16/32/48/128 PNGs) goes in the toolbar. - The same crosshair is injected into each post's action bar on https://t.co/Wk6QtXaVt7, next to the native bookmark button. It must match X's icon size, spacing and hover color in light and dark mode. - Clicking the in-post crosshair snipes that post. Clicking the toolbar icon snipes the post currently open at /status/<id>. - Feedback states: idle, sending (spinner), done (filled crosshair plus a 2-second toast "Sniped to queue"), and error (toast with the reason and a retry option). - Sniping the same post twice must not create a duplicate card. Search the whole board by post ID, not just Sniped. CAPTURE (content script, read from the DOM) - Post URL (canonical https://t.co/jk8ICiDMjr<handle>/status/<id>), post ID, author name and @handle. - Full text. Expand "Show more" if it's there. - Timestamp, links in the post (resolve https://t.co/0y6fZyUyQp to the real URL where the anchor shows it), and image URLs. - If it's a quote post, the quoted post's URL and text. - X's markup changes often. Use data-testid selectors (article[data-testid="tweet"], [data-testid="bookmark"], [data-testid="User-Name"], [data-testid="tweetText"]) with fallbacks, and keep every selector in one selectors.ts file. BOOKMARK ON X - Programmatically click the post's native bookmark button, but only if it isn't already bookmarked ([data-testid="removeBookmark"] means it already is). - Don't use X's private API or copy any tokens. Use the button only. TRELLO - Use the Trello REST API (https://t.co/Xg2Etp7fYt) with a user API key and token entered on an Options page. Store them in https://t.co/Eav76KcqKl.local, never in source. - The Options page has inputs for key and token, a "Test connection" button, and dropdowns that load my boards and then the lists on the chosen board. - Default board: https://t.co/dQkHgQVNdq. The target list is "Sniped". - The Options page has a "Set up queue" button. It creates any of the "Sniped", "Ready for Review" and "Reference" lists that are missing, in that order, and the labels "Needs research", "Ready for review", "Build" and "Reference". It never touches existing lists or cards. - Card format (keep it exactly this, because another agent parses it): - Name: "@handle: first 80 characters of the text" - Description, in this order: ## Post <full text> ## Source Author: <name> (@handle) Posted: <ISO timestamp> URL: <post URL> Post ID: <id> ## Links - <each outbound link> ## Quoted post <url and text, or "none"> ## Recommendation (pending) - Attach the post URL and the first image as attachments. Add the label "Needs research". - All network calls go through the service worker (background.ts), not the content script. - Handle 401 (send me to Options), 429 (back off and retry), and offline (queue in storage and send when back online). TECH - TypeScript, Vite + CRXJS (or plain esbuild), no frameworks beyond what's needed. - Permissions: storage, activeTab. host_permissions: https://t.co/jk8ICiDMjr*, https://t.co/de1ubRgJnx*, https://t.co/gu4uWgU4eD*. Nothing broader. - No analytics and no remote code. DELIVERABLES - Source repo with a README: how to get a Trello key and token, how to load it unpacked, how to build it, and a short section explaining the Sniped, Ready for Review and Reference queue. - An installable dist/ folder plus a zipped build. - Unit tests for the parser using saved https://t.co/Wk6QtXaVt7 HTML fixtures (normal post, long post with Show more, quote post, post with images, already-bookmarked post), and tests for the Trello client and card formatter with mocked fetch. - Screenshots of each state: idle crosshair in the action bar, sending, done toast, error toast, and the Options page. ACCEPTANCE - "Set up queue" creates the three lists and four labels without duplicating any that already exist. - Loaded unpacked in Chrome and logged into X, sniping a real post creates exactly one card in Sniped, in the exact format above. The post shows as bookmarked on X. - Sniping it again creates no second card, even after the card has moved to Ready for Review or Reference. - With a bad token, the extension shows a clear error and creates no card. - Tests and the build pass.

Sign in to see the full prompt

Continue with:

By logging in, you agree to our Terms of Use and Privacy Policy

Usage

This prompt is designed for use with coding. Copy the prompt content above and paste it into your preferred AI tool.

For best results, you may customize the placeholders (indicated by square brackets or capital letters) with your specific requirements.

References

Categories:coding| twitter| chrome-extension| manifest-v3

Talk