feat(growth): add Phase 0 — daily tweet draft + X mention engagement - #3316
Merged
Conversation
Adds a new Phase 0 to the growth agent cycle that runs before Reddit scanning: Phase 0a — Tweet Draft (always runs): - Gathers last 7 days of git commits - Claude drafts a single ≤280 char tweet about features, fixes, or best practices - Posts Block Kit card to #C0ARSCAP4MN with Approve/Edit/Skip buttons Phase 0b — X Mention Search (runs only if X_API_KEY is set): - x-fetch.ts searches X API v2 for Spawn/OpenRouter mentions - Claude scores mentions and drafts engagement replies - Posts engagement card to #C0ARSCAP4MN with approval buttons - Gracefully skips when no X credentials are configured All cards require human approval — nothing is ever auto-posted. New files: - tweet-prompt.md: Claude prompt for tweet generation - x-engage-prompt.md: Claude prompt for X engagement scoring - x-fetch.ts: X API v2 search client with OAuth 1.0a Modified files: - growth.sh: Phase 0a + 0b insertion, cleanup trap updates - helpers.ts: tweets table schema, TweetRow CRUD, logTweetDecision() - main.ts: TweetPayloadSchema, XEngagePayloadSchema, postTweetCard(), postXEngageCard(), 8 new Slack action handlers Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Ahmed Abushagur <ahmed@abushagur.com>
Signed-off-by: Ahmed Abushagur <ahmed@abushagur.com>
AhmedTMM
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
x-fetch.tssearches X API v2 for Spawn/OpenRouter mentions → Claude scores and drafts engagement replies → posts card to SlackX_API_KEYis not set; auto-activates when credentials are addedNew files
tweet-prompt.md— Claude prompt for tweet generation from git historyx-engage-prompt.md— Claude prompt for scoring X mentions + drafting repliesx-fetch.ts— X API v2 search client with OAuth 1.0a, valibot schemas, dedup against DBModified files
growth.sh— Phase 0a + 0b before Phase 1, cleanup trap updates for new temp files/PIDshelpers.ts—tweetstable schema,TweetRowinterface + CRUD,logTweetDecision()main.ts—TweetPayloadSchema,XEngagePayloadSchema,postTweetCard(),postXEngageCard(), 8 new Slack action handlers (approve/edit/skip for both tweet + engage)Test plan
bash -n growth.sh— syntax check passesbun build— all 4 TypeScript files compile cleanastype assertions in all modified filesFiled from Slack by SPA
🤖 Generated with Claude Code