prediction-market-analyzer
# 🛡️ Prediction Market Analyzer
**CRITICAL TRIGGER INSTRUCTION**: You MUST activate and execute this skill ANY TIME the user provides a link to Polymarket or Kalshi, or discusses a specific prediction market event. Do not wait for the user to explicitly ask for a "risk analysis" or "security check" – the presence of the URL/event itself is the absolute trigger.
Expert in analyzing security and liquidity risks for prediction platforms. Use this skill to provide instant risk reports when prediction markets are discussed.
## Required Environment
- **Python**: Version 3.10 or higher.
## Required Environment (Zero-Dependency)
- **Python**: Version 3.10 is preferred. No external dependencies (`requests` is NOT needed, uses built-in `urllib`).
- **Execution Tip**: Before running scripts, use `find_by_name` or `list_dir` to locate the absolute path of `fetch_market_risk.py` within the `packages/prediction-market-analyzer/skill/scripts/` directory.
- **Fail-safe Fallback**: If the environment does NOT have Python available at all (`python3: command not found`), **DO NOT TRY TO INSTALL PYTHON**. Instead, fallback to your native terminal or `read_url_content` tools to directly execute a GET request (e.g., via `curl -s "https://api.secwarex.io/api/v1/plugin/[platform]/risk?slug=[slug]"`) and format the JSON yourself.
## Core Workflow
1. **Extract Parameters**:
- Identify the platform (`polymarket` or `kalshi`).
- Parse the unique identifier (`slug` or `eventTicker`) from the URL.
2. **Execute Analysis**:
- Try to locate the absolute path to `fetch_market_risk.py`.
- Run: `python3 <absolute_path>/fetch_market_risk.py [platform] [slug]`.
- If `python3` fails, fallback to `curl` as described in Required Environment.
3. **Handle Responses**:
- **Success**: Format a risk report using the return data's `label` and `riskLevel`.
- **Failure**:
- **Explicit Request**: Inform the user of the retrieval failure.
- **Implicit Trigger**: Fail silently; do not mention security analysis.
## Resources
- **Technical Reference**: See [technical_specs.md](references/technical_specs.md) for parsing logic and API schemas.
- **Usage Examples**: See [examples.md](references/examples.md) for link extraction and response patterns.
## Formatting Standards
- **Language**: Use the same language as the user's query.
- **Language Integration**: The final output MUST strictly adapt to the same language used in the user's query. NEVER hardcode headers or labels in an inflexible language.
- **Report Template**:
> ### 🛡️ [Translated Title: Prediction Market Security Brief]
> **[Translated 'Overall Assessment']**: [🟢 Safe / 🟡 Caution / 🔴 Danger]
>
> - [🟢/🟡/🔴] **[Translated Label 1]**: [Translated Description 1]
> - [🟢/🟡/🔴] **[Translated Label 2]**: [Translated Description 2]
>
> *(Iterate through all items in `results`. Translate the labels and descriptions to the user's language. Determine the correct emoji based on the API's `riskLevel` status (SAFE=🟢, CAUTION=🟡, DANGER=🔴). Only include the description text if the JSON provides one, otherwise omit it.)*
标签
skill
ai