S4h Game Theory Iterated logo

S4h Game Theory Iterated

Organization
human-avatar
s4h-game-theory-iterated

Analyses long-run repeated interactions — how cooperation forms, how trust is built, how defection spirals start, and which strategies sustain cooperation. Triggers: 'repeated game', 'iterated strategy', 'long-run relationship', 'reputation effects', 'how do I sustain cooperation', 'tit for tat', 'shadow of the future', 'will they defect', 'ongoing relationship after betrayal', 'how do we recover from this'.

Overview

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

Use it in TypingMind

Enable S4h Game Theory Iterated 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 Iterated 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 Iterated 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: Iterated Games

Robert Axelrod's 1984 computer tournament is one of the most important results in social science. He invited game theorists to submit strategies for an iterated prisoners' dilemma — a repeated game where the same two players interact over and over. The simplest strategy submitted, Tit for Tat (cooperate on the first move, then do exactly what your opponent did on the previous move), won both rounds of the tournament, beating every more complex strategy.

Why Tit for Tat wins: it is nice (starts by cooperating, never the first to defect), retaliatory (immediately punishes defection — there is no free lunch), forgiving (returns to cooperation as soon as the opponent does — does not hold grudges), and clear (the strategy is transparent and easy for the opponent to understand). Opponents who try to exploit it get punished; opponents who cooperate get rewarded. It is the most robust known strategy for sustained cooperation without trust.

The folk theorem establishes the theoretical foundation: in infinitely (or indefinitely) repeated games with sufficiently patient players, almost any outcome — including full cooperation — can be sustained as a Nash equilibrium, because the threat of future punishment makes defection unprofitable. The key variable is the discount factor (how much players value future payoffs relative to present ones), and whether punishment is credible and observable.


Your Process

Step 1: Stage game Describe the single-period interaction — what are the two players' choices in any given round, and what are the payoffs? Map the four key payoffs: mutual cooperation (CC), mutual defection (DD), exploitation (one cooperates, one defects), and being exploited. This identifies whether repetition can help: if the stage game already has cooperation as a Nash equilibrium, repetition changes little. If cooperation is not a Nash equilibrium of the stage game, repetition may enable it.

Framing check: Confirm the repeated interaction before continuing. State what you've identified — the two parties involved, the recurring choice or tension, and the relationship context — in one sentence, then use AskUserQuestion:

  • Question: "I'm reading this as: [your one-sentence framing of the specific repeated interaction, the parties, and what cooperation/defection looks like in this context]. 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: Is cooperation a stage-game equilibrium? Check whether cooperation would be chosen in a one-shot interaction. If yes, the repeated game is not necessary to explain or enable it. If no (cooperation requires an ongoing relationship to be rational), proceed with the shadow-of-the-future analysis.

Step 3: Discount factor assessment How much do the players value continued interaction? Assess:

  • Time horizon: is the relationship expected to continue indefinitely, or does it have a known end-point? (Known-endpoint problem: rational players defect on the last period, which unravels backward)
  • Relationship value: how important is continued cooperation to each player? How much would they lose if the relationship ended?
  • Uncertainty about continuation: what is the probability each period that the interaction continues? Higher probability → higher effective discount factor → cooperation more sustainable
  • Impatience: are either player under short-term pressure that discounts future benefits?

Step 4: Folk theorem conditions Assess whether the conditions for sustained cooperation are met:

  • Discount factor is sufficiently high (both players value future interactions enough)
  • Defection is observable (players can detect when cooperation breaks down)
  • Punishment is credible (the punishing party would actually carry it out — it must be in their interest to do so)

Step 5: Strategy recommendation Based on the discount factor and relationship context, recommend the best strategy from the following:

Before narrowing: Show all candidate strategies to the user first. Use AskUserQuestion:

  • Question: "I've identified the following strategies as applicable given the discount factor and relationship context: [list all candidate strategies by name]. Before I select the best fit, are there any you'd flag as especially important given constraints I may have missed, or any I've overlooked?"

  • Header: "Prioritise"

  • Options:

    • Proceed with your selection — the candidate set looks right
    • Flag one — user will name a specific strategy to prioritise
    • Add a missing one — user will describe a constraint or dynamic not yet captured
  • Tit for Tat: cooperate first, then mirror the opponent's last move. Best for stable, ongoing relationships where misunderstandings are rare.

  • Generous Tit for Tat: like Tit for Tat but occasionally cooperates even after a defection (with low probability). Better when there is noise — accidental defections or miscommunications — that could trigger unnecessary retaliation spirals.

  • Grim Trigger: cooperate until the opponent defects once, then defect forever. Maximum punishment credibility; best when the relationship is asymmetric and one defection is catastrophic. Risk: one mistake ends everything.

  • Win-Stay, Lose-Shift: if last round's outcome was good (for you), repeat your choice; if it was bad, switch. Simpler to execute, surprisingly robust in noisy environments.

  • Unconditional cooperation: only rational if you have strong external enforcement, the discount factor is extremely high, or you are trying to unilaterally rebuild a relationship.


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

Iterated Game Analysis

Stage Game [One-shot interaction: choices, payoffs at each combination — CC / DD / CD / DC]

Cooperation in Stage Game [Is cooperation a Nash equilibrium of the one-shot game? Yes / No — and why this matters for the iterated analysis]

Discount Factor Assessment [Time horizon, relationship value, continuation probability, and impatience — overall rating: high (cooperation sustainable) / moderate (cooperation fragile) / low (cooperation unlikely)]

Folk Theorem Conditions

  • Discount factor sufficient: [Yes / No / Marginal]
  • Defection observable: [Yes / No / Delayed — and by how much]
  • Punishment credible: [Yes / No — and what makes it credible or not]

Recommended Strategy [Specific strategy from the set above, with the reasoning for this context]

Defection Spiral Warning Signs [Specific indicators that cooperation is breaking down — what to watch for and how to respond before full defection occurs]

Recovery Path (if trust has already broken down) [How to re-establish cooperation after defection — the sequence of signals, concessions, and credible commitments required]


Notes

The iterated analysis is the temporal complement to the one-shot prisoners' dilemma analysis. If you need to understand why the one-shot game produces defection in the first place, use /s4h-game-theory-prisoners-dilemma. The iterated skill focuses on how to sustain cooperation in ongoing relationships.

The shadow of the future is the mechanism, not the effect. Future cooperation is only valuable if players believe the relationship will continue. Actions that reduce confidence in continuation — signalling you might exit, visibly shortening your time horizon, threatening to end the relationship — also reduce the incentive for today's cooperation. Handle with care.

Pairs with: /s4h-game-theory-prisoners-dilemma (the one-shot structure this analysis builds on), /s4h-game-theory-signaling (in long-run relationships, reputation is a signal — how to maintain and repair it), /s4h-strategy-timing (when to cooperate, when to test, and when to act on defection).


What's Next

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

  • Question: "Iterated game analysed. What's next?"
  • Header: "Next"
  • Options:
    • /s4h-game-theory-equilibrium — Identify the equilibrium that emerges over iterations
    • /s4h-social-incentive-analysis — Map how incentives shift over repeated interactions
    • /s4h-strategy-timing — Determine when to cooperate and when to defect
    • Done — Wrap up and synthesise what we have so far

Frequently asked questions

What does the S4h Game Theory Iterated AI skill do?

Analyses long-run repeated interactions — how cooperation forms, how trust is built, how defection spirals start, and which strategies sustain cooperation. Triggers: 'repeated game', 'iterated strategy', 'long-run relationship', 'reputation effects', 'how do I sustain cooperation', 'tit for tat', 'shadow of the future', 'will they defect', 'ongoing relationship after betrayal', 'how do we recover from this'.

Why use S4h Game Theory Iterated on TypingMind?

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

Which AI models can use S4h Game Theory Iterated?

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 Iterated?

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

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