Metrics and Root-Cause Analysis

VerifiedCaution

Expertise in analyzing repository health metrics, investigating root causes, and proposing proactive workflow improvements.

Sby Skills Guide Bot
DevOpsAdvanced
8/29/2026
Claude Code
#metrics-analysis#root-cause-analysis#repository-health#time-series#ci-observability

Recommended for

Automated summary

Analyzes time-series repository health metrics to surface trends and anomalies, then investigates root causes and proposes workflow improvements.

Strengths

  • Enforces an explicit priority order: security and quality, maintainer workload, community collaboration, then productivity and cost
  • Requires competing hypotheses and evidence gathered through gh CLI, GraphQL, or temporary scripts before picking a root cause
  • Constrains LLM usage tightly: classification only, never execution or decision-making, using default repository policies
  • Looks for proactive opportunities even when metrics are stable, rather than reacting only to anomalies

Limitations

  • Assumes specific file paths and a CSV schema under tools/gemini-cli-bot/history/ that are specific to this bot
  • Covers only the analysis phase; staging changes depends on an orchestrator directive and the separate 'prs' skill
  • Findings are only as good as the metrics and history actually available in the repository
When to use it

Use it when you need to explain a drift in repository metrics such as rising PR latency or growing issue backlogs, or to justify a workflow improvement with data.

When not to use it

Avoid it on a repository with no usable metrics history, or when the task is a one-off code fix rather than a trend analysis.

Security analysis

Caution
Quality score84/100

The skill is an analysis workflow for repository health metrics and does not contain destructive commands, secret exfiltration, obfuscated payloads, or safety-disabling instructions. However, it explicitly authorizes use of network-facing CLI tools (`gh`, GraphQL), local script generation, Gemini CLI classification, and conditional PR staging, so it warrants caution rather than a purely safe rating.

Findings
  • •Instructs use of `gh` CLI, GraphQL, temporary local scripts, and Gemini CLI for repository analysis, which are powerful tools even though used legitimately.
  • •Conditionally instructs staging changes and creating a PR if enabled by the orchestrator; this could modify repository state.
  • •References invoking another skill (`prs`) and internal automation policies; trust boundaries depend on the surrounding orchestrator.
How this analysis is made

Examples

Diagnose PR latency drift
Read tools/gemini-cli-bot/history/metrics-timeseries.csv and figure out why latency_pr_overall_hours has been climbing over the last 30 days. Form competing hypotheses, test each one with the gh CLI, pick the best-supported root cause, and propose a fix.
Proactive maintainability review
Our repository metrics look stable, but dig into the history anyway and propose one concrete maintainability or productivity improvement, backed by evidence from the data.
Actions cost anomaly
Check actions_spend_minutes in the metrics history for anomalies and recommend cost savings, but only after confirming that PR latency and maintainer workload priorities are not harmed.

name: metrics description: Expertise in analyzing time-series repository health metrics, investigating root causes, and proposing proactive workflow improvements.

Phase: The Brain (Metrics & Root-Cause Analysis)

Goal

Analyze time-series repository metrics and current repository state to identify trends, anomalies, and opportunities for proactive improvement. You are empowered to formulate hypotheses, rigorously investigate root causes, and propose changes that safely improve repository health, productivity, and maintainability.

Context

  • Time-series repository metrics are stored in tools/gemini-cli-bot/history/metrics-timeseries.csv.
  • Recent point-in-time metrics are in tools/gemini-cli-bot/history/metrics-before-prev.csv and the current run's metrics.
  • Preservation Status: The orchestrator will provide a System Directive telling you whether PR creation is enabled for this run. If enabled, your proposed changes may be automatically promoted to a Pull Request. In this case, you MUST activate the 'prs' skill to generate a PR description and stage your changes. If PR creation is NOT enabled, you MUST NOT stage file changes or attempt to create a patch. Instead, simply report your findings.

Repo Policy Priorities

When analyzing data and proposing solutions, prioritize the following in order:

  1. Security & Quality: Security fixes, product quality, and release blockers.
  2. Maintainer Workload: Keeping a manageable and focused workload for core maintainers.
  3. Community Collaboration: Working effectively with the external contributor community, maintaining a close collaborative relationship, and treating them with respect.
  4. Productivity & Maintainability: Proactively recommending changes that improve the developer experience or simplify repository maintenance, even if no immediate "anomaly" is detected.

LLM-Powered Classification

You are explicitly authorized to use the Gemini CLI (bundle/gemini.js) within your proposed scripts to perform classification tasks (e.g., sentiment analysis, advanced triage, or semantic labeling).

  • Preference for Determinism: Always prefer deterministic TypeScript/Git logic (System 1) when it can achieve equivalent quality and reliability. Use the LLM only when heuristic or semantic understanding is required.
  • Strict Role Separation: Use Gemini CLI ONLY for classification (data labeling). Do not use it for execution or decision-making.
  • Default Policy Enforcement: When generating scripts that invoke Gemini CLI, they MUST NOT use the specialized tools/gemini-cli-bot/ci-policy.toml. They should rely on the default repository policies.

Instructions

1. Read & Identify Trends (Time-Series Analysis)

  • Load and analyze tools/gemini-cli-bot/history/metrics-timeseries.csv.
  • Identify significant anomalies or deteriorating trends over time (e.g., latency_pr_overall_hours steadily increasing, open_issues growing faster than closure rates).
  • Proactive Opportunities: Even if metrics are stable, identify areas where maintainability or productivity could be improved.
  • Cost Savings (Lowest Priority): Monitor actions_spend_minutes and Gemini usage for significant anomalies. You may proactively recommend cost savings for both Actions and Gemini usage, provided that other repository health and latency priorities are satisfied first.

2. Hypothesis Testing & Deep Dive

For the single most significant identified trend or opportunity (or a small set of highly related ones):

  • Develop Competing Hypotheses: Brainstorm multiple potential root causes or improvement strategies.
  • Gather Evidence: Use your tools (e.g., gh CLI, GraphQL) to collect data that supports or refutes EACH hypothesis. You may write temporary local scripts to slice the data.
  • Select Root Cause: Identify the hypothesis or strategy most strongly supported by the data.

3. Maintainer Workload Assessment

Before blaming or proposing reflexes that rely on maintainer action:

  • Quantify Capacity: Assess the volume of open, unactioned work (untriaged issues, review requests) against the number of active maintainers.
  • If the ratio indicates overload, do not propose solutions that simply generate more pings. Instead, prioritize systemic triage, automated routing, or auto-closure reflexes.

4. Actor-Aware Bottleneck Identification

Before proposing an intervention, accurately identify the blocker:

  • Waiting on Author: Needs a polite nudge or closure grace period.
  • Waiting on Maintainer: Needs routing, aggregated reports, or escalation.
  • Waiting on System (CI/Infra): Needs tooling fixes or reporting.

5. Policy Critique & Evaluation

  • Review Existing Policies: Examine the existing automation in .github/workflows/ and scripts in tools/gemini-cli-bot/reflexes/scripts/.
  • Analyze Effectiveness: Determine if current policies are achieving their goals.

6. Investigation Conclusion

  • Summarize your findings for the Orchestrator. When modifying scripts in tools/gemini-cli-bot/metrics/scripts/, you MUST NEVER change the output format (comma-separated values to stdout).

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/metrics-and-root-cause-analysis-mte1lizs/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/metrics-and-root-cause-analysis-mte1lizs' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/metrics-and-root-cause-analysis-mte1lizs/download' --output '.skill-downloads/metrics-and-root-cause-analysis-mte1lizs/SKILL.md.part' && mv '.skill-downloads/metrics-and-root-cause-analysis-mte1lizs/SKILL.md.part' '.skill-downloads/metrics-and-root-cause-analysis-mte1lizs/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/metrics-and-root-cause-analysis-mte1lizs/SKILL.md' && test -s '.skill-downloads/metrics-and-root-cause-analysis-mte1lizs/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/metrics' && cp -R '.skill-downloads/metrics-and-root-cause-analysis-mte1lizs' '.claude/skills/metrics'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/metrics-and-root-cause-analysis-mte1lizs'

openskills read 'metrics-and-root-cause-analysis-mte1lizs'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/metrics-and-root-cause-analysis-mte1lizs/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills