Skill: etherstrings/justice-plutus (version 2.1.0)

--- name: justice-plutus description: Local A-share analysis with Markdown/JSON reports, optional Feishu notifications, and optional iFinD enhancement. version: "2.1.0" homepage: https://github.com/Etherstrings/JusticePlutus#donate metadata: openclaw: requires: bins: ["python3"] env: ["OPENAI_API_KEY"] primaryEnv: OPENAI_API_KEY --- # JusticePlutus Local A-share Analysis ## Payment / Donation Notice This skill is free to install on ClawHub, but it is donation-supported. If JusticePlutus helps you save time, please support ongoing use and maintenance here: - Donate / Sponsor: <https://github.com/Etherstrings/JusticePlutus#donate> - ClawHub page: <https://clawhub.ai/Etherstrings/justice-plutus> ## Purpose Run the local JusticePlutus pipeline for one or more A-share stock codes and produce structured Markdown and JSON reports. This skill stays local-first: - it runs the local repository on the current machine - it does not convert the workflow into a hosted service - it does not replace your existing cron or GitHub Actions setup ## Inputs - Stock codes: comma-separated 6-digit A-share codes - Optional runtime mode: - local report only - local report + notifications - dry-run data fetch - local report + iFinD enhancement ## Outputs - `reports/YYYY-MM-DD/stocks/<code>.md` - `reports/YYYY-MM-DD/stocks/<code>.json` - `reports/YYYY-MM-DD/summary.md` - `reports/YYYY-MM-DD/summary.json` - `reports/YYYY-MM-DD/run_meta.json` ## Current Capabilities Base capabilities: - daily + realtime market data analysis - chip-distribution aware decision dashboard - structured Markdown / JSON report generation - local single-run execution for one or more stock codes Optional enhancements when configured: - search enhancement through Bocha / Tavily / SerpAPI - chip enhancement through Wencai / HSCloud and fallback sources - iFinD financial enhancement for fundamentals, valuation, and consensus forecast - notifications to configured channels, including Feishu and Telegram ## Commands ### Analyze now Trigger phrases: "analyze stock", "analyze A-share", "JP analyze" Command: ```bash sh justice-plutus/scripts/run_analysis.sh "<codes>" ``` This keeps the run local and writes reports without sending notifications. ### Analyze and notify Trigger phrases: "analyze and notify", "run with notifications" Command: ```bash sh justice-plutus/scripts/run_analysis.sh "<codes>" --notify ``` If Feishu, Telegram, or other supported channels are configured in the local environment, notifications will be sent. ### Data-only check Trigger phrases: "dry run", "data only" Command: ```bash sh justice-plutus/scripts/run_analysis.sh "<codes>" --dry-run ``` ### Analyze with iFinD enhancement Trigger phrases: "run with ifind", "fundamental enhancement", "financial enhancement" Command: ```bash sh justice-plutus/scripts/run_analysis.sh "<codes>" --ifind ``` This enables: - `ENABLE_IFIND=true` - `ENABLE_IFIND_ANALYSIS_ENHANCEMENT=true` for the current run only. ### Analyze with notifications and iFinD Command: ```bash sh justice-plutus/scripts/run_analysis.sh "<codes>" --ifind --notify ``` ## Notes Core runtime requirement: - a working local JusticePlutus repository - Python runtime - at least one usable LLM key path such as: - `OPENAI_API_KEY` - `AIHUBMIX_KEY` - `GEMINI_API_KEY` - `ANTHROPIC_API_KEY` - `DEEPSEEK_API_KEY` Optional enhancement configuration: - search enhancement: - `BOCHA_API_KEYS` - `TAVILY_API_KEYS` - `SERPAPI_API_KEYS` - chip enhancement: - `WENCAI_COOKIE` - `HSCLOUD_AUTH_TOKEN` or `HSCLOUD_APP_KEY` + `HSCLOUD_APP_SECRET` - iFinD enhancement: - `IFIND_REFRESH_TOKEN` - optional run flags `--ifind` - Feishu notifications: - `FEISHU_WEBHOOK_URL` Behavior guarantees: - this skill operates on the local repository and does not call GitHub Actions - iFinD is enhancement-only and does not replace the main analysis chain - missing optional enhancement keys should not block the core local run - notifications are optional and only fire when channels are configured and `--notify` is used - the skill is donation-supported; the donate page includes GitHub Sponsor, Alipay, and WeChat options ## Support - Support ongoing development: <https://github.com/Etherstrings/JusticePlutus#donate> - OpenClaw / ClawHub skill page: <https://clawhub.ai/Etherstrings/justice-plutus> ### Donate Alipay: ![Alipay QR](https://raw.githubusercontent.com/Etherstrings/JusticePlutus/main/docs/assets/donate/alipay_clawhub.jpg) WeChat Pay: ![WeChat Pay QR](https://raw.githubusercontent.com/Etherstrings/JusticePlutus/main/docs/assets/donate/wechat_clawhub.jpg)

path: references/overview.md
content: # JusticePlutus Skill Overview

`justice-plutus` is the local OpenClaw / ClawHub entry point for running the
JusticePlutus A-share analysis pipeline on the current machine.

## What It Does

It runs a single local analysis job for one or more stock codes and produces:

- per-stock Markdown reports
- per-stock JSON reports
- summary Markdown
- summary JSON
- run metadata

## Inputs

Primary input:

- one or more 6-digit A-share stock codes, comma-separated

Optional runtime modes:

- report-only run
- report + notification run
- dry-run data fetch
- iFinD-enhanced run

## Runtime Flow

1. Load the requested stock list.
2. Fetch base market data, including daily and realtime fields.
3. Pull optional search enhancement when search keys are configured.
4. Pull optional chip-distribution enhancement when supported providers are configured.
5. Pull optional iFinD financial enhancement when enabled for the current run.
6. Run LLM-based structured analysis.
7. Write Markdown and JSON reports into the `reports/` folder.
8. Optionally send notifications if channels are configured and notification mode is enabled.

## Optional Enhancements

### Search enhancement

When configured, JusticePlutus can enrich analysis with news, sentiment,
industry, and earnings-related search results from providers such as:

- Bocha
- Tavily
- SerpAPI

### Chip enhancement

When configured, JusticePlutus can improve chip-distribution analysis using:

- Wencai
- HSCloud
- project fallbacks already built into the main pipeline

### iFinD enhancement

When enabled, iFinD adds structured financial context to the existing analysis,
including:

- financial statement summary
- valuation summary
- consensus forecast summary
- financial-quality cues for the LLM prompt

iFinD is enhancement-only. It does not replace the main local analysis flow.

## Notifications

When channels are configured and the run is started with notification mode, the
pipeline can send results through configured channels such as:

- Feishu webhook
- Telegram
- other supported project channels already configured locally

Feishu is especially useful when `FEISHU_WEBHOOK_URL` is set and the user wants
results pushed out directly after the local run.

## Non-Intrusive Behavior

This skill follows the same non-intrusive model as the repository:

- missing optional enhancement credentials should not block a normal run
- missing iFinD credentials should only skip iFinD enhancement
- notification channels do nothing unless configured and explicitly enabled
- the skill remains a local executor and does not change cron jobs or call GitHub Actions

## Outputs

Typical output paths:

- `reports/YYYY-MM-DD/stocks/<code>.md`
- `reports/YYYY-MM-DD/stocks/<code>.json`
- `reports/YYYY-MM-DD/summary.md`
- `reports/YYYY-MM-DD/summary.json`
- `reports/YYYY-MM-DD/run_meta.json`


path: scripts/run_analysis.sh
content: #!/bin/sh
set -e

usage() {
  echo "Usage: run_analysis.sh <codes> [--notify] [--ifind] [--dry-run]" >&2
}

if [ "$#" -lt 1 ]; then
  usage
  exit 2
fi

codes="$1"
shift

if [ -z "$codes" ]; then
  usage
  exit 2
fi

notify="false"
enable_ifind="false"
dry_run="false"

while [ "$#" -gt 0 ]; do
  case "$1" in
    --notify)
      notify="true"
      ;;
    --ifind)
      enable_ifind="true"
      ;;
    --dry-run)
      dry_run="true"
      ;;
    --help|-h)
      usage
      exit 0
      ;;
    *)
      echo "Unknown flag: $1" >&2
      usage
      exit 2
      ;;
  esac
  shift
done

if [ -z "${AIHUBMIX_KEY:-}${OPENAI_API_KEY:-}${OPENAI_API_KEYS:-}${GEMINI_API_KEY:-}${GEMINI_API_KEYS:-}${ANTHROPIC_API_KEY:-}${ANTHROPIC_API_KEYS:-}${DEEPSEEK_API_KEY:-}${DEEPSEEK_API_KEYS:-}" ]; then
  echo "A usable LLM API key is required for analysis. Set OPENAI_API_KEY, AIHUBMIX_KEY, GEMINI_API_KEY, ANTHROPIC_API_KEY, or DEEPSEEK_API_KEY." >&2
  exit 1
fi

echo "JusticePlutus is donation-supported: https://github.com/Etherstrings/JusticePlutus#donate" >&2

if [ "$enable_ifind" = "true" ]; then
  export ENABLE_IFIND=true
  export ENABLE_IFIND_ANALYSIS_ENHANCEMENT=true
fi

if [ -x ".venv/bin/python" ]; then
  python_cmd=".venv/bin/python"
elif command -v python3 >/dev/null 2>&1; then
  python_cmd="python3"
elif command -v python >/dev/null 2>&1; then
  python_cmd="python"
else
  echo "Python runtime not found. Install python3 or create .venv before using this skill." >&2
  exit 1
fi

set -- run --stocks "$codes"

if [ "$dry_run" = "true" ]; then
  set -- "$@" --dry-run
fi

if [ "$notify" != "true" ]; then
  set -- "$@" --no-notify
fi

"$python_cmd" -m justice_plutus "$@"


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)