Skip to content
Development
Skill

/analytics

Analytics and metrics for SpecWeave usage — token consumption, cache efficiency, agent spawn counts.

From plugin
specweave
15651 skills20 agents73 commands
Install
$ npx -y skills add anton-abyzov/specweave --skill analytics --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/analytics

Context preview

The summary Claude sees to decide when to auto-load this skill.

Analytics and metrics for SpecWeave usage — token consumption, cache efficiency, agent spawn counts.

SKILL.md

analytics.SKILL.md
name: sw/analytics
description: "Analytics and metrics for SpecWeave usage — token consumption, cache efficiency, agent spawn counts."
version: 1.0.0
allowed-tools: Read, Bash

Tool-Use Rationale

  • **Read**: Load metrics snapshots, increment history, and config to compute analytics.
  • **Bash**: Run `specweave metrics` CLI commands to gather live telemetry data.

Usage

sw:analytics [--cache-stats] [--spawn-count] [--token-usage]

--cache-stats

Displays prompt cache hit rates per skill for the current session.

**Output format**:

Cache Statistics (current session)
───────────────────────────────────
sw/grill         hit rate: 78% (1,240 tokens from cache)
sw/judge-llm     hit rate: 65% (980 tokens from cache)
sw/code-reviewer hit rate: 82% (1,560 tokens from cache)
───────────────────────────────────
Overall:         hit rate: 75%

**Requirements**:

  • Cache must be enabled (`cache.staticContextFiles` non-empty in config)
  • Minimum 2 invocations per skill for meaningful hit rate

**Enable persistent metrics**: Set `analytics.cacheMetrics.enabled: true` in `.specweave/config.json`.

--spawn-count

Reports agent spawn counts per team session. Use to verify that Opus 4.7 fan-out reduction is working (target: ≤ 50% of pre-1.1.0 baseline).

--token-usage

Reports total token consumption per skill across the session.

Ships withspecweave

Spec-first AI development: describe a feature → AI creates spec + plan + tasks, builds autonomously, syncs to GitHub/JIRA. Domain-expert skills for PM, Architect, Frontend, QA learn your patterns permanently. Claude Code, Codex, Cursor, Copilot & more.

Get the whole plugin