AGENT SKILL

phargus-rules

Create and replay Phargus collector alerts or sandboxed diagnostic rules from an observed Node.js runtime problem. Use when defining a threshold, sustained condition, or custom diagnostic finding.

License 许可
Apache-2.0
最近更新
2026-11-13
Stars
★ 0
Forks
0

01 前言 Front Matter

name
phargus-rules
license
Apache-2.0
description
Create and replay Phargus collector alerts or sandboxed diagnostic rules from an observed Node.js runtime problem. Use when defining a threshold, sustained condition, or custom diagnostic finding.
compatibility
Node.js >=22.18.0; a compatible Phargus application; isolated-vm only for sandbox rules.

02 资源文件 12

03 SKILL.md 正文

Phargus Rules

Turn an observed condition into an executable, replay-tested diagnostic rule. Read rules, data semantics and compatibility. Use tools for replay.

  1. Establish the condition and select representative normal and incident data. Resolve this skill's absolute directory before invoking scripts/phargus.mjs.
  2. Prefer collector alert JSON for a single metric threshold. Choose comparison and forWindows deliberately, with thresholds in the metric's native units.
  3. Use a sandbox .js function body for multi-metric/trend logic. Return findings with windowStart and message; the host must not evaluate or import rule text.
  4. Run rules on normal and incident data. Inspect equality boundaries, sustained-window behavior, firing/resolved transitions and false alarms. Explain any input gaps.
  5. Treat missing isolated-vm or ok: false as execution failures. Close runners and provide the actual collector/plugin activation recipe after replay passes.

Return the rule files, threshold rationale, both replay results and activation steps. Avoid describing a heuristic finding (such as rising heap) as proof of a root cause.

Example request: "Alert when event-loop delay exceeds 50 ms for three windows without flagging this normal recording."

04 同仓库更多 Skills

pharn-dev
pharn-dev/pharn-cli

broken

暂无简介

★ 0
pharn-dev
pharn-dev/pharn-cli

example

暂无简介

★ 0
pharn-dev
pharn-dev/pharn-cli

pharn-cli

Operate the PHARN CLI (@pharn-dev/pharn 0.10.0+, best on 0.16.0, with a fallback for 0.9.x) on a project that has PHARN installed. Use when the person asks whether PHARN is up to date, what an update would change, to update it, what is installed, or to add or remove a capability (griller or lens), or when pharn.config.json exists and they mention updating PHARN. When they ask to set up or uninstall PHARN, it tells them how to do it themselves. Read-only checks and a dry-run preview first; never overwrites their edits.

★ 0
pharn-dev
pharn-dev/pharn-cli

pharn-ci-install

Add the pharn-ci pull request check (the pharn-dev/pharn-ci GitHub Action) to a repository, writing pharn-ci 0.9.1 (Report v2, with the test-integrity check and dependency safety) and recognising an existing 0.1.x to 0.9.x setup and what upgrading it changes - lcov or Cobertura coverage output from the project's own test run, checked locally the way pharn-ci reads it, a .pharn/ci.yml with the threshold, and a workflow pinned to a full commit SHA with the test-integrity input. Asks before writing a workflow for a repository on a private registry, because dependency safety flags off-registry sources (D05). Use when the person asks to set up, add, install, update or wire in pharn-ci, a diff coverage gate or test integrity for pull requests, including on fork PRs or in an existing CI job. Never uses pull_request_target, never writes a tag pin, asks before installing anything, never creates or applies the accept label, never switches dependency safety off on its own, never commits. Not for explaining a pharn-ci result (pharn-ci-explain), covering reported lines (pharn-ci-cover) or the PHARN CLI (pharn-cli).

★ 0
pharn-dev
pharn-dev/pharn-cli

pharn-ci-explain

Explain a pharn-ci result (the pharn-dev/pharn-ci GitHub Action or the `pharn-ci check` CLI, 0.1.x to 0.9.x) - why a pull request's pharn-ci check failed or warned, what a message code such as COVERAGE_PATHS_UNMATCHED, TEST_INTEGRITY_TI03, POLICY_P13, AGENT_CONFIG_SECRET_S01, INJECTION_PI01 or DEPENDENCY_D05 means, what its diff coverage number covers, what a test-integrity, org policy, prompt-injection, dependency or stale-instruction finding asks a reviewer to look at, and what to change in this repository. Use when the person asks about a pharn-ci comment, verdict, report.json, diff coverage gate, test integrity, policy, secret, injection, dependency or flaky-test finding or agent setup message, or asks to loosen a policy, add or apply the pharn/accepted accept label or otherwise get past a block. Read-only unless asked; never applies the accept label, changes a policy, turns dependency safety off or quarantines a test to get a PR through, and never repeats a secret or the text of an injection finding. Not for adding pharn-ci (pharn-ci-install), writing a policy (pharn-ci-policy), acting on fix hints (pharn-ci-fix) or the PHARN CLI (`pharn`, pharn.config.json), which is the pharn-cli skill.

★ 0
pharn-dev
pharn-dev/pharn-cli

pharn-ci-cover

Write tests for the added lines that a pharn-ci report (the pharn-dev/pharn-ci GitHub Action or the `pharn-ci check` CLI, 0.1.x with Report v1 or 0.2.x to 0.9.x with Report v2) lists as uncovered, so a pull request's diff coverage meets its threshold. Use when pharn-ci fails with DIFF_COVERAGE_BELOW_THRESHOLD, or the person asks to cover the lines pharn-ci reports, raise diff coverage, get the pharn-ci coverage check passing, or exclude a file from, lower or switch off the pharn-ci coverage gate (it explains what that changes and asks first). Adds tests only - never lowers the threshold, excludes files, edits the pharn-ci config or workflow (including the test-integrity, dependencies and accept-label inputs), adds coverage-ignore comments, skips or focuses tests, weakens test scripts, adds a dependency or edits a lockfile to satisfy a test, adds a test to a quarantine list, imports a changed file into an unrelated test, or applies the accept label. From a 0.9.x report it acts only on fix hints of kind add-test. Not for adding pharn-ci to a repository (pharn-ci-install) or the PHARN CLI (pharn-cli).

★ 0