S4h Game Theory Coalition logo

S4h Game Theory Coalition

Organization
human-avatar
s4h-game-theory-coalition

Analyses which coalitions form and how to divide gains fairly using cooperative game theory and the Shapley value. Triggers: 'coalition formation', 'who should we partner with', 'cooperative game theory', 'Shapley value', 'fair division', 'stable coalition', 'which coalition will form', 'equity split', 'power in a coalition', 'how should we divide this up fairly'.

Overview

Publisherhuman-avatar
Repositoryskills-for-humanity
Skill names4h-game-theory-coalition
Stars
234
Forks
24
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by human-avatar on GitHub. Read the source before you install it.

Installation

Install the S4h Game Theory Coalition AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/human-avatar/skills-for-humanity/tree/main/skills/s4h-game-theory-coalition
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/human-avatar/skills-for-humanity.git /tmp/skills-for-humanity
mkdir -p .claude/skills
cp -r /tmp/skills-for-humanity/skills/s4h-game-theory-coalition .claude/skills/s4h-game-theory-coalition
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable S4h Game Theory Coalition in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads S4h Game Theory Coalition on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so S4h Game Theory Coalition is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Game Theory: Coalition Analysis

Cooperative game theory asks a different question from strategic (non-cooperative) game theory. Rather than asking what rational self-interested players will do when they can't coordinate, it asks: when players can form binding agreements and share gains, which coalitions will form, and how should the value be divided?

Lloyd Shapley's answer to the division question — the Shapley value (1953, Nobel Prize 2012) — is remarkable for its mathematical precision and moral intuition. Each player's fair share is their average marginal contribution across all possible orderings of coalition formation. Formally: for each permutation of all players, calculate how much value player i adds when they join the coalition that has formed before them. Average this marginal contribution across all permutations. The result is the Shapley value — the uniquely fair allocation given four axioms: efficiency (the grand coalition's total value is fully distributed), symmetry (identical players receive equal shares), dummy (players who contribute nothing receive nothing), and additivity (allocations across independent games add correctly).

The core captures coalition stability: an allocation is in the core if no subset of players can collectively do better by breaking away and forming their own coalition. If an allocation is in the core, no group has an incentive to defect — the grand coalition is stable. If the core is empty, no allocation is fully stable and some defection pressure is unavoidable.

These two concepts are complementary but distinct. The Shapley value is always unique and always exists — it answers "what is fair?" The core may be empty — it answers "what is stable?"


Your Process

Step 1: Player-value map List all players and, for each possible coalition (every subset), specify the value that coalition can generate on its own. This is the characteristic function of the game — v(S) for every subset S. For small groups (3–4 players), enumerate all subsets. For larger groups, focus on the most relevant coalitions: the grand coalition, each individual player alone, and the likely competing sub-coalitions.

Framing check: Confirm the specific coalition situation before continuing. State what you've identified — the players, what value they can jointly create, and the core question (who should form a coalition and how should gains be divided) — in one sentence, then use AskUserQuestion:

  • Question: "I'm reading this as: [your one-sentence framing of the players, their potential joint value, and the key coalition question]. Is that right?"
  • Header: "Framing"
  • Options:
    • Yes — proceed — framing is correct
    • Adjust — one element is off; user will correct it before you continue
    • Reframe — different situation than read; incorporate the correction before proceeding

Step 2: Grand coalition assessment Is the grand coalition (all players together) the most efficient arrangement? Check whether v(everyone) ≥ v(any subgroup) + v(remaining players). If yes, the grand coalition maximises total value and the question is only how to divide it. If no, some smaller coalition creates more value, and the question is which one forms.

Step 3: Shapley value calculation For each player, calculate their average marginal contribution:

  • List all permutations of player ordering (for n players, there are n! permutations — for 3 players: 6; for 4 players: 24)
  • For each permutation, identify what coalition exists just before player i is added, and calculate v(coalition + i) − v(coalition)
  • Average this marginal contribution across all permutations
  • The result is player i's Shapley value

For practical purposes with more than 4 players, compute the Shapley value for the players of primary interest using a representative subset of permutations, or use the formula: φᵢ(v) = Σ [|S|!(n−|S|−1)!/n!] × [v(S∪{i}) − v(S)] summed over all subsets S not containing i.

Step 4: Core analysis An allocation x = (x₁, x₂, ..., xₙ) is in the core if:

  • It is efficient: Σxᵢ = v(all players)
  • No coalition can do better: for every subset S, Σᵢ∈S xᵢ ≥ v(S)

Check whether the proposed allocation satisfies the blocking constraint for every relevant coalition. If no such allocation exists, the core is empty — identify which coalitions have the most credible defection threat.

Step 5: Stability analysis Even with a core allocation, identify threats:

  • Which players are most tempted to defect to a subcoalition?
  • What external conditions (new opportunities, changing valuations, information revelations) could shift the characteristic function?
  • What governance or enforcement mechanisms could reinforce stability?

Human Check-in

Before proceeding, use the AskUserQuestion tool. State your interpretation of the situation in 1–2 sentences — what is being analyzed and what the core question is — then ask:

  • Question: "My read: [your 1–2 sentence interpretation]. How do you want to proceed?"
  • Header: "Scope"
  • Options:
    • Full analysis — Complete all steps, reasoning shown throughout
    • Key findings only — Bottom-line output, skip step-by-step detail
    • Specific focus — Zoom in on one aspect of this analysis
    • Reframe — The read is off; correct it and the analysis will follow the corrected framing

Proceed based on their selection. If the user reframes, incorporate the correction before running any analysis.


Output Format

Coalition Analysis

Player-Value Map [All relevant coalitions and the value each generates — v(S) for each subset S]

Grand Coalition Assessment [Is the grand coalition efficient? Is total value maximised by full cooperation? Y/N and why]

Shapley Values [Each player's Shapley value — their average marginal contribution and what this means for the fair allocation]

Core [The set of stable allocations — or "core is empty" with identification of the most credible defection threat]

Stability Threats [Which subcoalitions pose the greatest defection risk, under what conditions, and what would trigger instability]

Recommended Structure and Allocation [The specific coalition and allocation that balances fairness (Shapley) with stability (core), with practical implementation notes]


Notes

The Shapley value answers "what is fair" — it does not predict what will happen. What actually happens depends on bargaining power, outside options, timing, and negotiating skill. The Shapley value is most useful as a reference point: a principled allocation that no player can argue violates fairness criteria.

When the core is empty, no fully stable allocation exists. In practice this means: allocations will always face some coalition's objection. The goal shifts to finding the allocation with the smallest objection — the one that minimises the maximum advantage any blocking coalition could gain.

For the rules governing how a coalition is formed and how players reveal their contributions — the design of the process rather than the analysis of the outcome — use /s4h-game-theory-mechanism-design.

For analysis of the strategic (non-cooperative) interactions happening inside the coalition — after it forms — use /s4h-game-theory-equilibrium or /s4h-game-theory-iterated.

Pairs with: /s4h-strategy-alliance (strategic and contextual dimension of partnership decisions), /s4h-social-coalition-mapping (the social and power dynamics of alliance building), /s4h-game-theory-mechanism-design (designing the process for fair coalition formation).


What's Next

After delivering this output, use AskUserQuestion to offer the next move:

  • Question: "Coalition dynamics analysed. What's next?"
  • Header: "Next"
  • Options:
    • /s4h-social-coalition-mapping — Map social dynamics within the coalition in practice
    • /s4h-game-theory-mechanism-design — Design rules to stabilise the coalition
    • /s4h-strategy-alliance — Turn coalition analysis into concrete alliance strategy
    • Done — Wrap up and synthesise what we have so far

Frequently asked questions

What does the S4h Game Theory Coalition AI skill do?

Analyses which coalitions form and how to divide gains fairly using cooperative game theory and the Shapley value. Triggers: 'coalition formation', 'who should we partner with', 'cooperative game theory', 'Shapley value', 'fair division', 'stable coalition', 'which coalition will form', 'equity split', 'power in a coalition', 'how should we divide this up fairly'.

Why use S4h Game Theory Coalition on TypingMind?

Because you install it once and use it with any model. S4h Game Theory Coalition is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install S4h Game Theory Coalition in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/human-avatar/skills-for-humanity/tree/main/skills/s4h-game-theory-coalition. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use S4h Game Theory Coalition?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with S4h Game Theory Coalition?

As many as you like. As long as a model supports skills, you can use S4h Game Theory Coalition with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the S4h Game Theory Coalition AI skill free?

Yes. It is published on GitHub by human-avatar under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇