Strategic reasoning methods — Game Theory (Nash equilibria, payoff matrices, cooperative/non-cooperative games), Optimization (objective functions, constraints, feasible regions), and Constraint Satisfaction (CSP formulation, arc consistency, backtracking). Use when the user invokes `/think gametheory`, `/think optimization`, or `/think constraint`, or asks about strategic multi-agent interaction, resource allocation, or satisfying a set of rules simultaneously.
$ARGUMENTS
Parse these arguments. The first word should be gametheory, optimization, or constraint. The rest is the problem to reason about. If invoked via the think router, $ARGUMENTS is the same string the user originally typed after /think.
This category skill contains three strategic reasoning methods: Game Theory (multi-agent strategic interaction and equilibria), Optimization (finding the best solution subject to constraints), and Constraint Satisfaction (finding any feasible assignment that satisfies all hard rules).
Game Theory models situations where multiple rational agents make decisions that affect each other's outcomes. The central question is not "what is best for me in isolation?" but "what is best for me given what others will rationally do?" This interdependence is the core distinction from single-agent decision-making.
Do not use Game Theory when:
The most important structural distinction:
A Nash equilibrium is a strategy profile where no single player can improve their payoff by unilaterally changing their strategy, holding all others fixed. Key properties:
A payoff matrix represents a two-player normal-form game by listing each player's payoff for every combination of strategies:
Player 2: Cooperate Player 2: Defect
Player 1: Cooperate (-1, -1) (-3, 0)
Player 1: Defect (0, -3) (-2, -2)
Each cell is (Player 1's payoff, Player 2's payoff). To find Nash equilibria, look for cells where neither player can improve by switching rows or columns. In the Prisoner's Dilemma above, (Defect, Defect) is the unique Nash equilibrium.
See reference/output-formats/gametheory.md for the authoritative JSON schema.
{
"mode": "gametheory",
"game": {
"name": "<game name>",
"type": "non_cooperative",
"isZeroSum": false
},
"players": [
{ "id": "p1", "name": "<Player 1>", "strategies": ["<s1>", "<s2>"] },
{ "id": "p2", "name": "<Player 2>", "strategies": ["<s1>", "<s2>"] }
],
"payoffMatrix": {
"description": "<what each payoff means>",
"entries": [
{ "strategies": ["<p1_strategy>", "<p2_strategy>"], "payoffs": [0, 0] }
]
},
"nashEquilibria": [
{
"strategyProfile": ["<p1_strategy>", "<p2_strategy>"],
"payoffs": [0, 0],
"type": "pure",
"isStrict": true
}
],
"dominantStrategies": [],
"analysis": "<natural-language interpretation>"
}
mode is exactly "gametheory"players has at least two entries — game theory requires multiple agentspayoffMatrix.entries covers every strategy combination (n × m entries for a 2-player game with n and m strategies)nashEquilibria entry genuinely satisfies the no-unilateral-deviation condition — verify by checking each player's payoff against alternatives in the matrixtype is "cooperative" only when binding coalitions and fair division are the focus; otherwise use "non_cooperative"analysis explains the strategic implication, not just restates the payoffsInput: "Two competing streaming services (Alpha and Beta) are both considering whether to set their cache TTL to short (2 min) or long (30 min). Short TTL is more expensive but delivers fresher content. If both go short, users notice no difference and both pay high costs. If both go long, users notice no difference and both save costs. But if one goes short and the other long, the short-TTL service wins users and earns more revenue."
{
"mode": "gametheory",
"game": {
"name": "Cache TTL Competition",
"type": "non_cooperative",
"isZeroSum": false
},
"players": [
{ "id": "alpha", "name": "Alpha Streaming", "strategies": ["short_ttl", "long_ttl"] },
{ "id": "beta", "name": "Beta Streaming", "strategies": ["short_ttl", "long_ttl"] }
],
"payoffMatrix": {
"description": "Net profit index (higher = better). Short TTL costs 3 units; competitive win on differentiation earns 5 units.",
"entries": [
{ "strategies": ["short_ttl", "short_ttl"], "payoffs": [-2, -2] },
{ "strategies": ["short_ttl", "long_ttl"], "payoffs": [3, -5] },
{ "strategies": ["long_ttl", "short_ttl"], "payoffs": [-5, 3] },
{ "strategies": ["long_ttl", "long_ttl"], "payoffs": [1, 1] }
]
},
"nashEquilibria": [
{
"strategyProfile": ["short_ttl", "short_ttl"],
"payoffs": [-2, -2],
"type": "pure",
"isStrict": false
}
],
"dominantStrategies": [
{
"playerId": "alpha",
"strategy": "short_ttl",
"type": "strictly_dominant",
"justification": "If Beta plays short_ttl: -2 > -5. If Beta plays long_ttl: 3 > 1. Short dominates regardless."
},
{
"playerId": "beta",
"strategy": "short_ttl",
"type": "strictly_dominant",
"justification": "Symmetric payoffs — short_ttl strictly dominates for Beta as well."
}
],
"analysis": "This is a Prisoner's Dilemma structure. Short TTL strictly dominates for both players, so (short, short) is the unique Nash equilibrium — but it yields (-2, -2) versus the mutually beneficial (long, long) at (1, 1). The competitive pressure to differentiate drives both services to the costly equilibrium. Resolution requires either a binding agreement (cooperative game) or a platform-level commitment device."
}
Optimization formalizes problems where you seek the best possible outcome — maximum profit, minimum cost, shortest path — subject to a set of constraints that bound the feasible region. The key distinction from Constraint Satisfaction is directionality: Optimization has a ranked preference over solutions; Constraint Satisfaction merely asks whether a valid assignment exists.
f(x) subject to g(x) ≤ b"Do not use Optimization when:
f(x): the quantity to minimize or maximize. There must be exactly one primary objective, or multiple objectives combined into a weighted sum or analyzed via Pareto dominance.x: the quantities you control. Each has a domain (continuous, integer, binary) and represents a meaningful choice.g(x) ≤ b: conditions the solution must satisfy. Hard constraints define the feasible region — any solution outside it is inadmissible. Soft constraints carry penalty weights.Both are equivalent: maximize f(x) ≡ minimize -f(x). Always state which direction is intended. When optimizing cost, latency, or error — minimize. When optimizing revenue, accuracy, or throughput — maximize.
See reference/output-formats/optimization.md for the authoritative JSON schema.
{
"mode": "optimization",
"problem": {
"name": "<problem name>",
"type": "linear",
"description": "<what is being optimized>"
},
"variables": [
{ "id": "x1", "name": "<variable>", "type": "continuous", "lowerBound": 0 }
],
"objective": {
"type": "maximize",
"formula": "<f(x)>",
"description": "<what the objective represents>"
},
"constraints": [
{
"id": "c1",
"name": "<constraint name>",
"formula": "<g(x) <= b>",
"isHard": true,
"rationale": "<why this limit exists>"
}
],
"solution": {
"status": "optimal",
"variableValues": {},
"objectiveValue": 0,
"bindingConstraints": []
},
"analysis": "<interpretation of results, sensitivity notes>"
}
mode is exactly "optimization"objective.type is either "minimize" or "maximize" — never both simultaneouslyformula fields use the declared variable ids — no undeclared variablessolution.status reflects actual feasibility: "optimal" only if a global optimum is confirmedanalysis addresses which constraints are binding (active at the optimum) — these have zero slack and are the limiting factorsInput: "A cloud team has a weekly budget of $10,000. They need to provision CPU-heavy (type A) and memory-heavy (type B) instances. Type A costs $200/instance and delivers 8 performance units; Type B costs $500/instance and delivers 15 performance units. They need at least 10 instances total for redundancy. How many of each to maximize total performance?"
{
"mode": "optimization",
"problem": {
"name": "Cloud Instance Allocation",
"type": "integer",
"description": "Maximize total performance units subject to budget and minimum instance count"
},
"variables": [
{
"id": "a",
"name": "Type A instances",
"type": "integer",
"lowerBound": 0,
"description": "CPU-heavy instances at $200 each, 8 perf units"
},
{
"id": "b",
"name": "Type B instances",
"type": "integer",
"lowerBound": 0,
"description": "Memory-heavy instances at $500 each, 15 perf units"
}
],
"objective": {
"type": "maximize",
"formula": "8*a + 15*b",
"description": "Total performance units across all provisioned instances"
},
"constraints": [
{
"id": "c1",
"name": "Budget limit",
"formula": "200*a + 500*b <= 10000",
"isHard": true,
"rationale": "Weekly cloud spend ceiling is $10,000"
},
{
"id": "c2",
"name": "Minimum redundancy",
"formula": "a + b >= 10",
"isHard": true,
"rationale": "Minimum 10 instances required for HA redundancy"
}
],
"solution": {
"status": "optimal",
"variableValues": { "a": 0, "b": 20 },
"objectiveValue": 300,
"bindingConstraints": ["c1"]
},
"analysis": "Setting a=0 and b=20 maximizes performance at 300 units while exactly exhausting the $10,000 budget (c1 binding). The redundancy constraint (c2) is satisfied with 20 instances. Type A instances are never worth provisioning given the superior performance-per-dollar ratio of Type B (0.03 units/$ vs. 0.04 units/$). If the budget were reduced below $5,000, we would need to provision some Type A to satisfy the redundancy floor — the shadow price of c2 would become relevant there."
}
Constraint Satisfaction (CSP) asks a fundamentally different question than Optimization: not "what is the best solution?" but "does a solution exist, and what is it?" A CSP has no objective function. All solutions that satisfy all constraints are equally valid.
Do not use Constraint Satisfaction when:
Every CSP has three components:
X = {x₁, x₂, ..., xₙ}: the unknowns to assign values toD = {D₁, D₂, ..., Dₙ}: the set of legal values each variable may takeC = {c₁, c₂, ..., cₘ}: relations that must hold between variable valuesA solution is a complete assignment of values from each variable's domain such that all constraints are satisfied simultaneously.
Before (and during) search, constraint propagation prunes domains to eliminate values that cannot participate in any solution:
When propagation alone doesn't solve the CSP, backtracking extends a partial assignment one variable at a time:
See reference/output-formats/constraint.md for the authoritative JSON schema.
{
"mode": "constraint",
"problem": "<description of the CSP>",
"variables": [
{ "id": "x1", "name": "<variable>", "domain": ["<v1>", "<v2>"] }
],
"constraints": [
{
"id": "c1",
"type": "<not_equal|before|alldiff|capacity|custom>",
"variables": ["x1", "x2"],
"expression": "<formal expression>",
"description": "<human-readable rule>"
}
],
"propagation": {
"method": "arc_consistency",
"reducedDomains": {}
},
"solution": {
"status": "found",
"assignments": {},
"backtracks": 0
},
"analysis": "<explanation of how constraints interacted, any near-infeasibility>"
}
mode is exactly "constraint"variables has at least two entries — a single-variable problem is trivially just domain filteringvariables array references valid variable ids from the variables listsolution.status is "found", verify each assignment satisfies every constraint by substitutionsolution.status is "infeasible", identify which constraint(s) caused the empty domainanalysis distinguishes CSP (feasibility only) from Optimization — do not claim this is the "best" solutionInput: "Assign three engineers — Alice, Bob, and Carol — to three project roles: Frontend, Backend, and DevOps. Rules: (1) Alice cannot do DevOps (lacking cert). (2) Bob must do Backend (only one with the database specialization). (3) Each person gets exactly one role."
{
"mode": "constraint",
"problem": "Assign three engineers to three project roles with hard eligibility constraints",
"variables": [
{ "id": "alice", "name": "Alice's role", "domain": ["frontend", "backend", "devops"] },
{ "id": "bob", "name": "Bob's role", "domain": ["frontend", "backend", "devops"] },
{ "id": "carol", "name": "Carol's role", "domain": ["frontend", "backend", "devops"] }
],
"constraints": [
{
"id": "c1",
"type": "not_in",
"variables": ["alice"],
"expression": "alice != devops",
"description": "Alice lacks DevOps certification"
},
{
"id": "c2",
"type": "equals",
"variables": ["bob"],
"expression": "bob == backend",
"description": "Bob is the only engineer with database specialization"
},
{
"id": "c3",
"type": "alldiff",
"variables": ["alice", "bob", "carol"],
"expression": "alldiff(alice, bob, carol)",
"description": "Each person gets exactly one distinct role"
}
],
"propagation": {
"method": "arc_consistency",
"reducedDomains": {
"alice": ["frontend", "backend"],
"bob": ["backend"],
"carol": ["frontend", "backend", "devops"]
},
"steps": [
"c2 fixes bob=backend; bob's domain reduced to [backend]",
"c3 (alldiff) removes backend from alice and carol's domains via arc consistency",
"c1 removes devops from alice's domain",
"alice's domain: [frontend]; carol's domain: [devops]"
]
},
"solution": {
"status": "found",
"assignments": {
"alice": "frontend",
"bob": "backend",
"carol": "devops"
},
"backtracks": 0
},
"analysis": "Arc consistency alone fully solved this CSP without backtracking. The hard constraint on Bob (c2) propagated immediately to eliminate backend from all other domains via alldiff. This left alice with only frontend and carol with only devops. The solution is unique — no alternative satisfies all three constraints simultaneously. Note: this is a feasibility result, not an optimality claim. If preferences existed (e.g., Carol prefers Frontend), Optimization with soft constraints would be the appropriate tool."
}