Community Management
Manage community presence across Discord, GitHub, X/Twitter, Bluesky, LinkedIn, and Hacker News. Detects enabled platforms from environment variables (or always-on for GitHub and HN) and delegates data collection to platform-specific scripts.
Arguments
$ARGUMENTS is parsed for a sub-command and optional flags:
community [sub-command] [--headless] [--platform PLATFORM]
community engage [--max-results N] [--headless]
If $ARGUMENTS is empty or unrecognized, present the sub-command menu below.
If --headless is present, skip all interactive prompts and approval gates.
Platform Detection
Platform detection is centralized in [community-router.sh](./scripts/community-router.sh). Run at the start of every sub-command:
bash "${CLAUDE_PLUGIN_ROOT}/skills/community/scripts/community-router.sh" platforms
The anchor is bare and quoted (ADR-179 decision 1), not ${CLAUDE_PLUGIN_ROOT:-plugins/soleur} and not a bare plugins/soleur/… path. The router dispatches to the scripts that consume DISCORD_BOT_TOKEN, X_API_SECRET and LINKEDIN_ACCESS_TOKEN, so a CWD-relative resolution would hand those credentials to whatever skills/community/scripts/community-router.sh exists in the tree the session happens to sit in.
The same applies to the four *-setup.sh invocations under platforms below — those were bare repo-relative until #7450 review, which is strictly worse than the :- form removed here, since a bare path is CWD-relative unconditionally. All five are pinned by redact-sentinel.test.sh Test 24, which discovers credential-acquiring scripts on disk and asserts none is reachable through a CWD-relative path.
This prints each platform's name, enabled/disabled status, and script filename. The router's PLATFORMS array is the single source of truth for platform names, required env vars, and auth checks. To add a new platform, add one entry to the array and create the script.
Scripts
Platform scripts are located at plugins/soleur/skills/community/scripts/:
- [community-router.sh](./scripts/community-router.sh) -- Platform dispatch router (single source of truth for platform detection)
- [discord-community.sh](./scripts/discord-community.sh) -- Discord Bot API wrapper (messages, members, guild-info, channels)
- [discord-setup.sh](./scripts/discord-setup.sh) -- Discord credential setup and validation
- [github-community.sh](./scripts/github-community.sh) -- GitHub API wrapper (activity, contributors, discussions, repo-stats)
- [x-community.sh](./scripts/x-community.sh) -- X/Twitter API v2 wrapper (fetch-metrics, fetch-mentions, fetch-timeline, fetch-user-timeline, post-tweet)
- [x-setup.sh](./scripts/x-setup.sh) -- X/Twitter credential setup and validation
- [bsky-community.sh](./scripts/bsky-community.sh) -- Bluesky AT Protocol wrapper (create-session, post, get-metrics, get-notifications)
- [bsky-setup.sh](./scripts/bsky-setup.sh) -- Bluesky credential setup and validation
- [linkedin-community.sh](./scripts/linkedin-community.sh) -- LinkedIn API wrapper (post-content, fetch-metrics stub, fetch-activity stub)
- [linkedin-setup.sh](./scripts/linkedin-setup.sh) -- LinkedIn credential setup, token introspection, and OAuth token generation
- [hn-community.sh](./scripts/hn-community.sh) -- Hacker News Algolia API wrapper (mentions, trending, thread)
Sub-Commands
digest
Generate a multi-platform community digest. Spawns the community-manager agent with digest instructions.
- Run platform detection
- Spawn agent:
community-managerwith prompt: "Generate a community digest covering the last 7 days. Enabled platforms: [list]. Collect data from each enabled platform and produce a unified digest." - The agent writes the digest to
knowledge-base/support/community/YYYY-MM-DD-digest.md
If --headless is set, skip the Discord posting approval gate (the agent handles this).
health
Display community health metrics across all enabled platforms. Spawns the community-manager agent with health instructions.
- Run platform detection
- Spawn agent:
community-managerwith prompt: "Display community health metrics. Enabled platforms: [list]. Show metrics from each enabled platform." - Metrics are displayed inline (no file output)
platforms
List all platforms with their configuration status. Does NOT spawn an agent -- runs directly.
- Run
bash "${CLAUDE_PLUGIN_ROOT}/skills/community/scripts/community-router.sh" platforms - For disabled platforms, run the platform's setup script for the operator — do not print
the command for them to paste. These are execution sites, not display strings: the anchor below is loader-substituted for the AGENT, but CLAUDE_PLUGIN_ROOT is unset in the operator's own shell, so a pasted bash "${CLAUDE_PLUGIN_ROOT}/…" resolves to /skills/… and fails. Run it and relay what it asks for:
- Discord: Run
bash "${CLAUDE_PLUGIN_ROOT}/skills/community/scripts/discord-setup.sh"to configure - X/Twitter: Run
bash "${CLAUDE_PLUGIN_ROOT}/skills/community/scripts/x-setup.sh" validate-credentialsto verify, or runbash "${CLAUDE_PLUGIN_ROOT}/skills/community/scripts/x-setup.sh" write-envto save credentials - Bluesky: Run
bash "${CLAUDE_PLUGIN_ROOT}/skills/community/scripts/bsky-setup.sh" write-envto save credentials, or runbash "${CLAUDE_PLUGIN_ROOT}/skills/community/scripts/bsky-setup.sh" verifyto test - LinkedIn: Run
bash "${CLAUDE_PLUGIN_ROOT}/skills/community/scripts/linkedin-setup.sh" generate-tokento set up credentials, or runbash "${CLAUDE_PLUGIN_ROOT}/skills/community/scripts/linkedin-setup.sh" verifyto test
engage
Reply to recent mentions on X/Twitter or Bluesky using brand-voice drafts with human approval. Spawns the community-manager agent with engagement instructions.
Platform selection: The --platform flag specifies which platform to engage on. If --platform is not provided, use AskUserQuestion to prompt the user to choose from enabled platforms that support engagement (X/Twitter, Bluesky).
The selected platform must be enabled. If not configured, report the missing credentials and stop.
Flow (X/Twitter):
- Run platform detection -- verify X/Twitter is enabled
- Read the since-id state file (
.soleur/x-engage-since-id, resolved viagit rev-parse --show-toplevel). If the file exists and contains a valid numeric ID, pass it as--since-idto the fetch command. If missing or non-numeric, skip (fetches last N mentions). - Spawn agent:
community-managerwith prompt: "Engage with recent X/Twitter mentions. Use Capability 4: Mention Engagement. Max results: [N]. Since ID: [ID or none]." - The agent fetches mentions via
community-router.sh x fetch-mentions - For each mention, the agent drafts a reply following brand guide voice (
knowledge-base/marketing/brand-guide.mdsections## Voiceand## Channel Notes > ### X/Twitter). If the brand guide is missing, the agent warns but proceeds with a professional, declarative tone. - Each draft is presented via AskUserQuestion with options:
- Accept -- post this reply via
community-router.sh x post-tweet --reply-to <mention_id> - Edit -- modify the reply text (validate 280-character limit; re-prompt if over)
- Skip -- move to the next mention
- Skip all remaining -- end the session (available after the first mention)
- After all mentions are processed, the agent updates the since-id state file with the
newest_idfrom the fetch response and displays a session summary (processed, posted, skipped counts).
Since-id state file:
- Path:
.soleur/x-engage-since-id(relative to repo root) - Format: plain text, single line containing the tweet ID
- Created on first run with
mkdir -p .soleur && chmod 600before writing - Updated only after all mentions are processed (not per-reply)
Free tier degradation: If fetch-mentions returns 403 (client-not-enrol