log-anomaly-detect: Worker-State-Oriented Behavioral Log Anomaly Detection Skill

Introduction

Operations and scheduling teams often need to determine if “workers” are healthy: whether task pending is piling up, if there is output for the day, or if there is no response for a long time. Purely manual dashboard checking or writing temporary scripts leads to inconsistent rules and makes it hard to reuse the same judgment logic in Agent conversations. Below is an introduction to the SkillHub community Skill log-anomaly-detect (handle @user_f12a44b7/log-anomaly-detect), which encapsulates “fetch worker status → tag anomalies by rules → optional alerting” into a generic SKILL.md and workflow, making it easy to trigger and use in clients that support Skills like Cursor and Claude Code.

What is this

One-sentence positioning: Perform pattern checks on worker behavior and task status data, and output a list of anomalies or a report.

The introduction is consistent with the description inside the package: Log Anomaly Detection: Analyze behavior log patterns and detect abnormal states; the implementation focuses on metrics from the “worker” dimension such as pending, done, and todayDone (see the included SKILL.md and scripts/log_anomaly.py). The SkillHub tag is requires_api_key=true, indicating that execution depends on external API authentication (see environment variables below).

Core Features

According to the included SKILL.md, the Skill is triggered in the following scenarios:

  • Need to determine worker health status during regular inspections
  • When discovering worker pending pile-up or done=0
  • When needing to generate an anomaly report

Anomaly Determination Rules (as documented):

  1. Severe backlog: pending>10 and done=0
  2. Possibly offline: lastActive exceeds 2 hours
  3. Task backlog: pending>5
  4. Zero output: todayDone=0 and pending>0

Core Logic:

  1. Call the Dashboard API to get all workers data
  2. Apply the above rules to each worker
  3. Summarize the list of anomalies
  4. Optional: Send alerts to a group chat

API Dependencies (recorded in SKILL.md):

  • Dashboard API: GET https://dashboard.yunjinhong.cn/api/worker-dashboard
  • Auth Header: Authorization: Bearer {TOKEN}

The included script scripts/log_anomaly.py implements the pending, done, todayDone related items in the rules above; the lastActive offline determination is explained in the documentation, but the corresponding field validation is not currently seen in the script. If the business requires it, it must be extended according to your own data model.

Installation and Enablement

The Skill follows the generic SKILL.md format. When installing on SkillHub, the package needs to be placed into the skills directory that the current Agent actually reads (see official installation instructions at skillhub.cn/install/skillhub.md).

1. Install SkillHub CLI (if not installed yet)

command -v skillhub && skillhub --version

If there is no CLI, you can execute the full installation according to the SkillHub documentation:

curl -fsSL https://skillhub.cn/install/install.sh | bash

2. Install this Skill

When installing, you need to use --dir to point to the current client’s skills directory to avoid it falling into ./skills/ by default and failing to load. Use the handle @user_f12a44b7/log-anomaly-detect published on the page.

skillhub install @user_f12a44b7/log-anomaly-detect --dir ~/.cursor/skills/

Common directories (refer to the documentation for the client you are using):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ in the project

You can also ask the Agent to install the same handle according to the official installation documentation in a conversation. After installation, restart or reload the skills as required by the client.

3. Configure API Credentials

The tag requires_api_key=true. The script reads the token from environment variables:

export DASHBOARD_TOKEN="<your Bearer Token>"

Use Authorization: Bearer to communicate with the Dashboard API when making requests.

Typical Usage

Once enabled in the Agent

When the conversation context meets the trigger conditions in SKILL.md, the Agent can organize inspections based on the Skill description: fetch the worker list, apply rules, and generate a report or suggest follow-up actions.

Directly run the included script

In the Skill directory that has been unpacked or cloned locally (path depends on your local installation result):

python3 scripts/log_anomaly.py          # Detect and output report
python3 scripts/log_anomaly.py --alert  # Detect anomalies and attempt group chat alert
python3 scripts/log_anomaly.py --json   # JSON format output

--alert will send a POST alert to https://dashboard.yunjinhong.cn/api/worker-dashboard?action=send (requires a valid DASHBOARD_TOKEN). The default text report will print the number of people checked and the anomaly entries.

Suitable Scenarios and Notes

Who is this suitable for

  • Teams that use the Dashboard API mentioned above to manage worker status and need a unified anomaly standard in inspections or Agent workflows
  • Readers interested in operation signals like task backlog and zero output under the it-ops-security category

Limitations and Notes

  • Data and alert endpoints point to dashboard.yunjinhong.cn, Token and network setup are up to you; API calls will fail without a Token.
  • The “possibly offline (lastActive)” rule in the documentation can only be fully implemented at the script level when data fields are complete.
  • SkillHub page statistics (as of data scraping): Rating 100000, Downloads 806, Category it-ops-security; specific numbers are subject to the official website.
  • As a community-source Skill, it is recommended to conduct your own assessment regarding security scanning and internal network compliance requirements before integrating into production.

Conclusion

log-anomaly-detect writes common anomaly patterns of worker task status into a reusable Skill and optional CLI, reducing the cost of rewriting rules for every inspection. When you need to view the version and metadata, please visit the SkillHub Skills Page or API address https://api.skillhub.cn/user_f12a44b7/log-anomaly-detect.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye