# Apidance Twitter Team Discovery Skill

This Skill helps Codex discover and verify the direct team and related ecosystem accounts behind an official X/Twitter account.

Use `SKILL.md` as the agent-facing entry point. This README is a human-facing package overview.

## What It Does

- Resolves an official X/Twitter account through Apidance.
- Collects direct affiliated accounts from `UserBusinessProfileTeamTimeline`.
- Falls back to `Following` accounts with matching BusinessLabel evidence when needed.
- Confirms current roles with profile, timeline, and search evidence.
- Collects direct-member timelines with cursor pagination.
- Ranks related ecosystem candidates from reply, quote, mention, and retweet interactions.
- Produces review files and final `report.json` / `report.md` artifacts.

## Run

From the `@apidance/mcp` package root:

```bash
node skills/apidance-discover-twitter-team/scripts/run-discovery.mjs --help
```

Stage 1:

```bash
node skills/apidance-discover-twitter-team/scripts/run-discovery.mjs \
  collect-team --account @RobinhoodApp --output-dir RobinhoodApp
```

Stage 2:

```bash
node skills/apidance-discover-twitter-team/scripts/run-discovery.mjs \
  discover-ecosystem \
  --team-evidence RobinhoodApp/team-evidence.json \
  --team-review RobinhoodApp/team-review.json
```

Finalize:

```bash
node skills/apidance-discover-twitter-team/scripts/run-discovery.mjs \
  finalize \
  --team-evidence RobinhoodApp/team-evidence.json \
  --team-review RobinhoodApp/team-review.json \
  --ecosystem-evidence RobinhoodApp/ecosystem-evidence.json \
  --ecosystem-review RobinhoodApp/ecosystem-review.json
```

## Authentication

Set `APIDANCE_API_KEY` in the environment. For local Codex use, the service can also read it from `[mcp_servers.apidance_mcp.env]` in `CODEX_HOME/config.toml` or `~/.codex/config.toml`.

Do not pass keys on the command line.

## Shared Data-Cleaning Code

The Skill does not keep a private copy of Twitter normalization helpers. It loads:

```text
public-scripts/data-cleaning/twitter-normalize.mjs
```

That shared module provides normalized user/tweet extraction and `extractBottomCursor()` for GraphQL timeline pagination.

If this Skill folder is copied outside the npm package, set `APIDANCE_MCP_PACKAGE_ROOT` to the `@apidance/mcp` package root before running scripts.
