x-analyze-telemetry-trends
Detect cross-epic P95 regressions (>= threshold %) and rank top-10 slowest skills from the global telemetry index. Single-responsibility partner of /x-analyze-telemetry focused on trend detection, not point-in-time reporting. Use to answer 'is skill X getting slower over the last N epics?' with evidence.
- License 许可
- MIT
- 最近更新
- 2026-10-27
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- x-analyze-telemetry-trends
- description
- Detect cross-epic P95 regressions (>= threshold %) and rank top-10 slowest skills from the global telemetry index. Single-responsibility partner of /x-analyze-telemetry focused on trend detection, not point-in-time reporting. Use to answer 'is skill X getting slower over the last N epics?' with evidence.
- allowed-tools
- Read, Write, Bash, Grep, Glob
- argument-hint
- [--last N] [--threshold-pct P] [--baseline mean|median] [--format md|json] [--out path]
- context-budget
- light
- requires-capabilities
- []
03 SKILL.md 正文
Global Output Policy
- Language: English ONLY.
- Tone: Technical, Direct, and Concise.
- Efficiency: Remove all conversational fillers and greetings to save tokens.
Skill: Telemetry Trend
Purpose
Detect performance regressions across multiple epics using the append-only
NDJSON telemetry logs. /x-analyze-telemetry-trends complements /x-analyze-telemetry:
analyze answers "which phase is the bottleneck in epic X"; trend answers
"is skill X getting slower over the last N epics?".
The skill consumes the global index at .claude/telemetry/index.json
(on-demand; gitignored), aggregates P95 per skill per epic, and emits:
- Top-10 regressions whose P95 delta vs. a moving baseline exceeds the configured threshold.
- Top-10 slowest skills by mean-of-P95 across the analyzed window.
- An interpretive observations block.
When to Use
- Periodic performance audit after a batch of merged stories.
- Before a refactor: confirm that a slow skill is trending up (not a fluke).
- In a CI job that should flag sustained regressions across epics.
Arguments
| Argument | Behaviour |
|---|---|
--last N |
Analyze the most-recent N epics (default 5). |
--threshold-pct P |
Minimum delta % to classify as a regression (default 20). |
--baseline mean|median |
Baseline aggregation (default median — outlier-robust). |
--format md|json |
Output format (default md). |
--out path |
Destination path. When omitted, writes to stdout (RULE-007). |
--base-dir path |
Override plans/ (test-only). |
--index-path path |
Override the cache path (test-only). |
--rebuild-index |
Force rebuild ignoring the cache. |
Invocation
java -cp target/classes:target/dependency/* \
dev.iadev.telemetry.trend.TelemetryTrendCli \
--last 5 --threshold-pct 20 --baseline median
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success. Report emitted to stdout or --out path. |
| 1 | Validation error (bad --last, --baseline, or --format value). |
| 5 | Fewer than 2 epics with data — trend analysis needs a comparable series. |
| 6 | --threshold-pct is negative. |
Algorithm
- Build (or refresh) the per-skill per-epic P95 index by scanning
ai/epics/epic-*\/telemetry/events.ndjson. The index is persisted at.claude/telemetry/index.jsonand invalidated when an epic's NDJSON mtime changes. - Restrict to the most-recent
--last Nepics (natural ID order). - For each skill, compute the baseline (mean or median) of the N-1 oldest samples and compare against the current (latest) sample.
- If
deltaPct >= threshold, emit a regression entry; sort regressions by deltaPct descending, cap at top-10. - Rank skills by mean-of-P95 across the window; cap at top-10.
Output Layout (Markdown)
- Header — generated-at, epics analyzed, threshold, baseline.
- Top-10 regressions table (skill, baseline P95, current P95, delta%, epics).
- Top-10 slowest skills table (skill, avg P95, invocations).
- Observations — interpretive notes (regressions count, slowest skill).
Performance Contract
- 5 epics × 10 000 events → report in < 10 s (hard SLA, story §3.5).
The index builder uses TelemetryReader.streamSkippingInvalid() so memory
stays bounded in the per-skill duration arrays.
Examples
# Default: last 5 epics, threshold 20 %, baseline median → stdout
/x-analyze-telemetry-trends
# Strict: threshold 10 %, mean baseline, write JSON to disk
/x-analyze-telemetry-trends --threshold-pct 10 --baseline mean --format json \
--out ai/epics/epic-XXXX/reports/trends.json
# Historical deep dive: last 10 epics, report to a custom path
/x-analyze-telemetry-trends --last 10 --out reports/quarterly-trends.md
04 同仓库更多 Skills
x-parallel-eval
Detects and classifies file-collision risks between work units (tasks, stories, or epic phases) before parallel execution. Reads ## File Footprint blocks produced by x-task-plan / x-story-plan, applies the parallelism-heuristics knowledge pack (hard / regen / soft categories + hotspot overrides), and emits a collision matrix + serialization recommendation in Markdown (default) or JSON.
parallelism-heuristics
Canonical catalog of file-collision heuristics for parallel task, story, and epic execution. Defines the File Footprint block format, the three Conflict Categories (hard / regen / soft), a hotspot list of high-contention paths, and the degrade-with-warning policy. Consumed by x-task-plan, x-story-plan, x-epic-map, x-parallel-eval, and x-dev-*-implement.
x-watch-pr-ci
Polls a PR's CI checks and Copilot review status, blocking until checks complete or timeout. Returns one of 8 stable exit codes (SUCCESS=0, CI_PENDING_PROCEED=10, CI_FAILED=20, TIMEOUT=30, PR_ALREADY_MERGED=40, NO_CI_CONFIGURED=50, PR_CLOSED=60, PR_NOT_FOUND=70). Writes a versioned state-file for session resume.
x-validate-docs
Documentation freshness gate: validates 6 dimensions (readme, api-specs, grpc-proto, adr, skill-docs, system-architecture) against code changes in a PR. Stack-aware — only validates targets declared/auto-detected from ProjectConfig.documentation.targets. Returns exit non-zero on staleness; produces structured report.
x-update-system-architecture
Incrementally updates docs/architecture/system.md after an epic completes. Appends new entries to the Decision Log (§11) using x-internal-write-report --append (dedup by ## ID: marker) and surgically inserts component/integration changes into sections 1-10 via Edit. Idempotent: re-running with the same epic produces a byte-identical system.md.
x-update-architecture
Incrementally updates the service architecture document with changes from architecture plans. Adds new components, integrations, flows, and ADR references without rewriting existing content. Use after implementation to keep architecture documentation current.