opponent-archetype-classifier
Classifies an opposing player, manager, or agent into one of a configurable archetype set using Bayesian inference over observed behavior (roster composition, transaction pattern, lineup moves, trade activity). Domain-neutral scaffold -- callers supply the archetype taxonomy (names, priors, characteristic feature distributions) and observed features; the skill returns a normalized posterior, MAP archetype, classification confidence, feature-contribution breakdown, and best-response hints. Use when modeling opponents, classifying player types, performing Bayesian archetype inference, producing opponent posteriors, or when user mentions opponent archetype, classify opponent, Bayesian archetype inference, player type classification, opponent modeling, or archetype posterior.
What this skill does
# Opponent Archetype Classifier
## Table of Contents
- [Example](#example)
- [Workflow](#workflow)
- [Common Patterns](#common-patterns)
- [Guardrails](#guardrails)
- [Quick Reference](#quick-reference)
## Example
**Scenario**: Fantasy baseball league, Week 5. Classify opponent "Manager A" into one of six archetypes -- `balanced`, `stars_and_scrubs`, `punt_sv`, `punt_sb`, `punt_wins_qs`, `hitter_heavy`.
**Inputs** (abbreviated; full taxonomy in [resources/template.md](resources/template.md#worked-example-6-archetype-fantasy-baseball-taxonomy)):
```yaml
archetype_taxonomy:
balanced: {prior: 0.30, feature_distributions: {sp_roster_share: {mean: 0.40, std: 0.06}, closer_count: {mean: 2.0, std: 0.6}, sb_speed_count: {mean: 3.0, std: 1.0}, moves_per_week: {mean: 2.5, std: 1.0}, bid_aggression: {low: 0.5, high: 0.5}}}
stars_and_scrubs: {prior: 0.15, ...}
punt_sv: {prior: 0.15, feature_distributions: {closer_count: {mean: 0.3, std: 0.4}, ...}}
punt_sb: {prior: 0.15, feature_distributions: {sb_speed_count: {mean: 0.8, std: 0.7}, ...}}
punt_wins_qs: {prior: 0.10, feature_distributions: {sp_roster_share: {mean: 0.20, std: 0.05}, closer_count: {mean: 3.0, std: 0.8}, moves_per_week: {mean: 4.0, std: 1.2}, ...}}
hitter_heavy: {prior: 0.15, feature_distributions: {sp_roster_share: {mean: 0.28, std: 0.05}, ...}}
observed_features:
sp_roster_share: 0.22 # low -- thin on starters
closer_count: 3 # heavy RP
sb_speed_count: 2 # moderate speed
moves_per_week: 4.2 # high activity
bid_aggression: high # active FAAB bidder
observation_weight: 0.7 # ~4 weeks of data
```
**Computation (per-feature log-likelihood, summed, exponentiated, multiplied by prior, normalized)**:
| Archetype | log L(features) | L * prior | Normalized Posterior |
|-----------|-----------------|-----------|---------------------|
| balanced | -14.8 | 1.1e-7 | 0.04 |
| stars_and_scrubs | -12.5 | 5.6e-7 | 0.21 |
| punt_sv | -18.2 | 1.8e-9 | 0.00 |
| punt_sb | -22.6 | 2.3e-11 | 0.00 |
| **punt_wins_qs** | **-10.1** | **1.8e-6** | **0.68** |
| hitter_heavy | -13.2 | 4.2e-7 | 0.16 |
**Outputs**:
```yaml
posterior:
balanced: 0.04
stars_and_scrubs: 0.21
punt_sv: 0.00
punt_sb: 0.00
punt_wins_qs: 0.68
hitter_heavy: 0.16
map_archetype: punt_wins_qs
classification_confidence: 47.6 # = max_posterior (0.68) * observation_weight (0.7) * 100
best_response_hints:
- "Concede K and QS; lock 6 of remaining 8 cats"
- "Don't stream starting pitchers against them"
- "They will dominate SV and ratios via all-RP staff; push hitting cats hard"
feature_contribution_breakdown:
sp_roster_share: {map_likelihood: 0.92, alternative_max: 0.15, likelihood_ratio: 6.1} # low SP share -- strong punt_wins_qs signal
closer_count: {map_likelihood: 0.52, alternative_max: 0.46, likelihood_ratio: 1.1} # 3 closers fits several archetypes
sb_speed_count: {map_likelihood: 0.38, alternative_max: 0.41, likelihood_ratio: 0.9} # not discriminating
moves_per_week: {map_likelihood: 0.33, alternative_max: 0.28, likelihood_ratio: 1.2}
bid_aggression: {map_likelihood: 0.70, alternative_max: 0.60, likelihood_ratio: 1.2}
assumptions_flagged:
- "Conditional independence across features assumed -- sp_roster_share and moves_per_week may be correlated (active punt strategy drives both)"
- "Feature distributions are SME priors, not empirically fit -- refresh after season 1 with posterior data"
```
**Note on confidence**: posterior peaks at 0.68 but `observation_weight=0.7` (only 4 weeks of data) dampens confidence to 47.6. Above the 40 threshold, so MAP is reported; but caller is advised that another 2-3 weeks of observation will sharpen the call.
## Workflow
Copy this checklist and track progress:
```
Opponent Archetype Classification Progress:
- [ ] Step 1: Load archetype taxonomy (names, priors, feature distributions)
- [ ] Step 2: Collect observed features for the target opponent
- [ ] Step 3: Compute per-feature likelihood under each archetype
- [ ] Step 4: Combine likelihoods (assume conditional independence; flag it)
- [ ] Step 5: Apply Bayes rule, normalize posterior
- [ ] Step 6: Select MAP archetype; compute confidence
- [ ] Step 7: Check inconclusive threshold; report or defer
- [ ] Step 8: Produce feature-contribution breakdown and best-response hints
```
**Step 1: Load archetype taxonomy**
The caller supplies the taxonomy. See [resources/template.md](resources/template.md#archetype-taxonomy-schema) for required fields.
- [ ] Each archetype has a name, a prior probability, and a feature distribution per observable
- [ ] Priors sum to 1.0 (normalize if not)
- [ ] Each feature has either a parametric distribution (Gaussian with mean/std) or a categorical (value -> probability)
- [ ] Each archetype has a documented `best_response` string array
**Step 2: Collect observed features**
Observed features must match feature names in the taxonomy. Missing features are dropped (not imputed) and flagged.
- [ ] Feature names match taxonomy keys exactly
- [ ] Numeric features in the taxonomy's expected units
- [ ] Categorical features use the taxonomy's category labels
- [ ] `observation_weight` (0-1) supplied; rises with sample size -- see [methodology.md](resources/methodology.md#observation-weight-calibration)
**Step 3: Compute per-feature likelihood**
For each (archetype, feature) pair compute `P(feature_value | archetype)`. See [methodology.md](resources/methodology.md#likelihood-function-design).
- [ ] Gaussian feature: `L = (1/(std*sqrt(2*pi))) * exp(-0.5 * ((x - mean)/std)^2)`
- [ ] Categorical feature: `L = P_archetype[category]` with Laplace smoothing if zero
- [ ] Work in log-space (`log L`) to avoid underflow when combining 5+ features
**Step 4: Combine likelihoods (conditional independence)**
First-approximation assumption: features are conditionally independent given archetype. This is rarely exactly true; flag it.
- [ ] Sum log-likelihoods across features per archetype
- [ ] Flag correlated feature pairs (e.g., `sp_roster_share` and `moves_per_week` in fantasy baseball)
- [ ] If two features are strongly correlated, consider merging them or down-weighting one; document the choice
**Step 5: Apply Bayes rule, normalize**
```
posterior_unnorm[a] = exp(sum_log_L[a]) * prior[a]
posterior[a] = posterior_unnorm[a] / sum_a(posterior_unnorm[a])
```
- [ ] Compute in log-space for numerical stability, then subtract max before exponentiating
- [ ] Verify `sum(posterior) == 1.0` within rounding
- [ ] Document any archetype with posterior < 1e-6 as "ruled out"
**Step 6: Select MAP archetype; compute confidence**
```
map_archetype = argmax(posterior)
classification_confidence = max(posterior) * observation_weight * 100
```
- [ ] MAP is the most likely archetype, not the only possibility
- [ ] Confidence blends how peaked the posterior is with how much we trust the observation
**Step 7: Inconclusive threshold**
If `classification_confidence < 40`:
- [ ] Return `map_archetype: "inconclusive"`
- [ ] Return the full posterior anyway (caller may still act on the top-2)
- [ ] Advise: "Collect 2-3 more weeks of observation before committing to a classification"
**Step 8: Feature-contribution breakdown + best-response hints**
- [ ] For each feature compute likelihood ratio: `L(feature | MAP) / max_{a != MAP} L(feature | a)`
- [ ] Pull `best_response_hints` from the MAP archetype's documented string array
- [ ] Return alongside the posterior so caller sees *why* this archetype was selected
## Common Patterns
**Pattern 1: Fantasy sports (baseball, basketball, hockey) manager archetypes**
- **Taxonomy**: 5-8 archetypes like `balanced`, `punt_<cat>`, `stars_and_scrubs`, `inactive` covering category-league strategy.
- **Features**: roster composition by position, transaction frequency, FAAB aggression, lineup-setting accuracy.
- **Conditional-independence risk**: several featRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.