# Analysis Patterns

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-brody-0125-my-claude-skills-analysis-patterns`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [brody-0125](https://agentstack.voostack.com/s/brody-0125)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [brody-0125](https://github.com/brody-0125)
- **Source:** https://github.com/brody-0125/my-claude-skills/tree/main/plugins/plugin-introspector/skills/analysis-patterns

## Install

```sh
agentstack add skill-brody-0125-my-claude-skills-analysis-patterns
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Analysis Patterns — Reusable Heuristics

> Standardized analysis methods used by multiple agents.

## Tool Sequence Patterns

### Productive Sequences (high correlation with quality score ≥4)

| Pattern | Description | Expected Token Cost |
|---------|-------------|-------------------|
| `Read→Edit→Bash(pass)` | Read file, edit, verify | ~1500 tokens |
| `Glob→Read→Edit` | Find file, read, edit | ~1800 tokens |
| `Read→Task(sub)→Edit` | Read, delegate, apply | ~2500 tokens |

### Anti-Patterns (high correlation with quality score ≤3)

| Pattern | Description | Token Waste |
|---------|-------------|------------|
| `Read→Read→Read(same)` | Repeated reads of same file | ~1000 tokens/repeat |
| `Bash(fail)→Bash(fail)→Edit` | Build-before-edit | ~800 tokens wasted |
| `Edit→Bash(fail)→Edit→Bash(fail)` | Edit-test loop without reading error | ~1500 tokens/cycle |

## Statistical Methods

### Z-Score Calculation

```
z = (x - μ) / σ
Threshold: |z| > 2.0 → anomaly
Minimum data points: 5 (for reliable σ)
```

### Moving Average

```
MA(n) = sum(last_n_values) / n
Window: 5 sessions (default)
Alert if: current > MA × 1.5
```

### Efficiency Ratio

```
efficiency = productive_calls / total_calls
productive_call = call that contributed to final output (no retry, no revert)
Target: ≥ 0.85
```

## Token Estimation Baselines

Expected token usage per tool (for waste detection):

| Tool | Expected Range | Flag If |
|------|---------------|---------|
| Read | 200-1500 | >2000 (large file, use offset) |
| Edit | 100-500 | >800 (complex edit, consider split) |
| Write | 200-2000 | >3000 (generated file too large) |
| Bash | 50-500 | >1000 (verbose output, use --quiet) |
| Glob | 50-200 | >500 (too many matches) |
| Grep | 50-300 | >800 (broad search pattern) |
| Task | 500-5000 | >8000 (sub-agent context explosion) |

## Plugin Phase Patterns

Phase detection and per-plugin baselines are loaded dynamically from plugin profiles:
`~/.claude/plugin-introspector/plugin-profiles/{plugin}/profile.json`

When baselines unavailable ( Phase-Generic Anti-Patterns (PG-001~PG-007) are defined in
> [improvement-pipeline.md](../plugin-introspector/resources/improvement-pipeline.md) Layer 2.

## Improvement Signal Extraction

### From Quality Evaluator

Field names match quality-evaluator.md `improvement_signals[]` output:

```
IF dimension.score ≤ 3:
  signal = {
    dimension: dimension.name,
    score: dimension.score,
    score_gap: 5 - dimension.score,
    what: "description of the issue",
    root_cause: "underlying cause",
    quantified_impact: {tokens, cost_usd, percentage_of_session},
    trace_evidence: ["trace_id: description", ...],
    suggested_change: {target_file, change_type, description},
    priority: score_gap × dimension.weight
  }
```

### From Token Optimizer

```
IF waste_source.tokens_wasted > total_tokens × 0.05:
  signal = {
    type: waste_source.type,
    impact: waste_source.tokens_wasted,
    priority: impact / total_tokens
  }
```

### From Anomaly Detector

```
IF alert.severity == "HIGH":
  signal = {
    type: alert.type,
    recurrence: count(similar_alerts_in_history),
    priority: recurrence > 2 ? "CRITICAL" : "HIGH"
  }
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [brody-0125](https://github.com/brody-0125)
- **Source:** [brody-0125/my-claude-skills](https://github.com/brody-0125/my-claude-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-brody-0125-my-claude-skills-analysis-patterns
- Seller: https://agentstack.voostack.com/s/brody-0125
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
