ETH Alpha Comment Assistant Design

Goal

Build a Chrome extension that helps a Chinese ETH opportunity account find useful X posts to comment on and draft high-quality replies. The extension must keep the final publishing action under human control.

Scope

The first version analyzes only tweets already loaded on the current X timeline or search page. It does not auto-scroll, auto-like, auto-follow, or auto-publish replies.

User Flow

  1. The user opens an X timeline or search page.
  2. The extension injects an Alpha button into each loaded tweet.
  3. The user opens the side panel and clicks Scan current page, or clicks an individual tweet’s Alpha button.
  4. The extension ranks loaded tweets by ETH opportunity value.
  5. The user selects a tweet and generates three Chinese reply candidates.
  6. The user clicks Fill reply to open the X reply box and insert a selected candidate.
  7. The user reviews the text and manually posts the reply.

Architecture

  • src/core.js: Pure scoring, parsing, and prompt-building functions.
  • src/content.js: X DOM scanning, tweet button injection, reply-box filling, and runtime messaging.
  • src/background.js: OpenAI Responses API call, API key storage access, and message routing.
  • src/sidepanel.html / src/sidepanel.js: Ranking UI and comment candidate UI.
  • src/options.html / src/options.js: Local API key and model settings.
  • tests/core.test.js: Node tests for core behavior.

Scoring

Each tweet receives a score from ETH relevance, money-opportunity relevance, engagement, freshness, and commentability. Suspicious giveaway, seed phrase, wallet-drainer, guaranteed-profit, and contract-address bait wording lowers the score.

Safety Boundary

The extension may generate and fill reply text, but it must not click the final X publish button. This preserves human review and reduces account-health risk.

Error Handling

Missing API key, empty tweet text, unavailable X reply controls, OpenAI request failure, and malformed model output are shown as explicit side-panel errors. The extension keeps local state in memory and chrome.storage.sync only for settings.

Testing

Core logic is covered by Node’s built-in test runner. DOM-specific behavior is kept small and manually verifiable by loading the unpacked extension in Chrome.