S4h Game Theory Prisoners Dilemma logo

S4h Game Theory Prisoners Dilemma

Organization
human-avatar
s4h-game-theory-prisoners-dilemma

Analyses cooperation problems where individual rationality produces collective irrationality. Triggers: 'cooperation problem', 'prisoner's dilemma', 'everyone defects even though cooperation is better', 'race to the bottom', 'should I cooperate or defect', 'why won't anyone cooperate', 'collective action failure', 'why do we all end up worse off'.

Overview

Publisherhuman-avatar
Repositoryskills-for-humanity
Skill names4h-game-theory-prisoners-dilemma
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 Prisoners Dilemma 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-prisoners-dilemma
  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-prisoners-dilemma .claude/skills/s4h-game-theory-prisoners-dilemma
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable S4h Game Theory Prisoners Dilemma 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 Prisoners Dilemma 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 Prisoners Dilemma 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: Prisoner's Dilemma

The prisoner's dilemma is the central problem of cooperation. Its structure: each player has an individual incentive to defect regardless of what the other does, so both defect — and both end up worse than if they had cooperated. Individual rationality produces collective irrationality.

This structure appears everywhere: countries competing on subsidies both nations would be better without, companies in a price war that erodes margins for everyone, colleagues who each underinvest in shared infrastructure, advertisers who would all benefit if no one ran ads but each is tempted to run them. Recognising the structure is the first move; it tells you why the situation is hard and what the real leverage points are.

Robert Axelrod's computer tournaments (1984) produced one of the most important empirical results in social science: in repeated prisoners' dilemmas, Tit for Tat — cooperate first, then mirror your opponent's previous move — consistently outperformed every more complex strategy. Its winning properties: nice (cooperates first), retaliatory (immediately punishes defection), forgiving (returns to cooperation as soon as the opponent does), and clear (easy to understand and predict). The lesson: cooperation is achievable without altruism, if the game is repeated and players are patient.


Your Process

Step 1: Structure verification Confirm the three conditions that define a prisoner's dilemma:

  • (a) Mutual cooperation dominates mutual defection: if both cooperate, both do better than if both defect
  • (b) Defection is individually rational: each player does better defecting regardless of what the other does (defection is a dominant strategy)
  • (c) The temptation to defect is real: there is a genuine payoff advantage to defecting on a cooperating partner

If all three hold: this is a genuine prisoner's dilemma. If (a) fails, cooperation isn't actually better — the analysis changes. If (b) fails, there's no defection temptation — cooperation is already individually rational.

Framing check: Confirm the specific cooperation problem before continuing. State the players involved, what constitutes cooperation vs. defection for each, and why individual incentives diverge from collective interest in one sentence, then use AskUserQuestion:

  • Question: "I'm reading this as: [your one-sentence framing of the specific situation — who the players are, what cooperation and defection look like, and the collective action tension]. 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: One-shot vs. repeated Is this a single interaction or an ongoing relationship? This is the most important structural question. In a one-shot game, defection is the rational dominant strategy and there is no mechanism for cooperation. In a repeated game, the future creates incentives for today's cooperation.

Step 3: Shadow of the future In repeated games, assess how much each player values future interactions. The discount factor (δ) captures how much tomorrow's payoff is worth today — high δ means future interactions matter a great deal; low δ means players are impatient or uncertain the relationship will continue. Cooperation is sustainable in repeated play if δ is above a threshold that depends on the payoff structure. Practically: ask how much each player needs the relationship to continue, how visible their defection will be, and how quickly punishment can be applied.

Step 4: Trigger conditions In a cooperative equilibrium, cooperation is sustained by the threat of punishment. What action would constitute defection? How quickly would it be detected? How severe is the punishment, and is it credible? A cooperation equilibrium is only stable if the punishment threat is believable and proportionate.

Step 5: Structural prescriptions If cooperation is failing or fragile, what changes to the structure could make cooperation individually rational?

  • Repeat the game: turn a one-shot interaction into an ongoing relationship
  • Increase transparency: make defection immediately visible so punishment can follow quickly
  • Change the payoffs: increase the value of mutual cooperation or add penalties for defection (bonds, enforcement, regulation)
  • Reduce the temptation: lower the short-run gain from defection
  • Build shared identity: reframe the game so defection feels like a cost to a shared project, not just a strategic choice
  • Third-party enforcement: external authority makes commitments binding

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

Prisoner's Dilemma Analysis

Structure Verification

  • Mutual cooperation better than mutual defection: [Yes / No / Partial]
  • Defection individually rational (dominant strategy): [Yes / No]
  • Genuine temptation to defect: [Yes / No]
  • Verdict: [Confirmed prisoner's dilemma / Modified structure / Not a PD — see alternative framing]

Payoff Map [The four key outcomes: mutual cooperation / you cooperate, they defect / you defect, they cooperate / mutual defection — with approximate payoffs or ordinal rankings]

One-Shot vs. Repeated Assessment [Is this a single interaction or an ongoing relationship? How many rounds are expected? Does either player expect to exit soon?]

Shadow of the Future Analysis [How much do players value continued interaction? What is the discount factor — high (cooperation sustainable) or low (cooperation fragile)? What would cause either player to reduce their valuation of the relationship?]

Trigger Conditions [What constitutes defection? How quickly detected? Is punishment credible and proportionate?]

Structural Prescriptions [Specific recommendations for changing the game structure to make cooperation individually rational — ranked by feasibility and impact]


Notes

The prisoner's dilemma is the one-shot cooperation problem. For formal analysis of how cooperation can be sustained in repeated interactions, including specific strategy recommendations, use /s4h-game-theory-iterated.

If the structure is right but the rules are wrong — you want to change the game itself — use /s4h-game-theory-mechanism-design, which designs payoffs and rules specifically to align individual and collective incentives.

For analysis of the stable outcome of the one-shot version (and confirmation that defection is indeed the Nash equilibrium), use /s4h-game-theory-equilibrium.

Pairs with: /s4h-social-incentive-analysis (the social and power dynamics around the same incentive problem), /s4h-strategy-alliance (the strategic logic of forming cooperative relationships).


What's Next

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

  • Question: "Dilemma analysed. What's next?"
  • Header: "Next"
  • Options:
    • /s4h-game-theory-mechanism-design — Design away from mutual defection
    • /s4h-social-incentive-analysis — Align incentives to encourage cooperation
    • /s4h-game-theory-iterated — Test whether cooperation emerges with repeated interaction
    • Done — Wrap up and synthesise what we have so far

Frequently asked questions

What does the S4h Game Theory Prisoners Dilemma AI skill do?

Analyses cooperation problems where individual rationality produces collective irrationality. Triggers: 'cooperation problem', 'prisoner's dilemma', 'everyone defects even though cooperation is better', 'race to the bottom', 'should I cooperate or defect', 'why won't anyone cooperate', 'collective action failure', 'why do we all end up worse off'.

Why use S4h Game Theory Prisoners Dilemma on TypingMind?

Because you install it once and use it with any model. S4h Game Theory Prisoners Dilemma 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 Prisoners Dilemma 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-prisoners-dilemma. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use S4h Game Theory Prisoners Dilemma?

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 Prisoners Dilemma?

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

Is the S4h Game Theory Prisoners Dilemma 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 👇