Game Development Resource Transaction System
Use this skill when the hard part is not command dispatch or behavior choice alone, but how gameplay resources are checked, reserved, spent, refunded, committed, or rolled back without every action path inventing a slightly different economy law.
This skill is for designing, reviewing, or refactoring a reusable resource-transaction model in gameplay, AI, interaction, and action-heavy systems. Its job is to define where resource checks belong, when affordability is evaluated, when value is reserved versus immediately consumed, how failed or canceled actions affect resources, and how transaction outcomes stay consistent enough to review and debug.
If the engine is unspecified, keep the recommendation engine-agnostic first. Only use engine-native guidance when the task explicitly depends on runtime features such as Godot resources and node ownership, Unity ScriptableObject-driven data authoring, or equivalent framework constraints.
For reusable transaction shapes, reservation models, and commit-versus-rollback trade-offs, see references/transaction-models.md.
Purpose
This skill is used to:
- determine whether a reusable resource-transaction model is justified at all
- define the boundary between one-off cost checks and shared transaction semantics
- choose immediate spend versus reservation versus staged commit deliberately
- make affordability timing, failure handling, and refund semantics explicit enough to review
- return a structured resource-transaction design or review artifact another agent can implement incrementally
Use this skill when
Invoke this skill for requests such as:
- several systems need to pay the same kinds of costs but currently check and spend resources differently
- gameplay actions need explicit rules for affordability, reservation, refund, or cancellation
- action flow, AI, UI, or interaction systems all touch the same resource types and keep drifting out of sync
- the team needs to separate
can pay, reserve, commit, and refund semantics instead of collapsing them into one hidden helper
- requests that explicitly mention
cost, resource spend, reservation, refund, rollback, transaction, mana, stamina, charges, or affordability
Trigger examples
- "Our abilities all spend stamina a little differently and the rules keep drifting"
- "Should this system reserve resources before execution instead of paying up front?"
- "How do we handle refunds when an action is canceled after validation?"
- "We need shared cost semantics across UI previews, AI choices, and gameplay execution"
Do not use this skill when
Do not use this skill when:
- the hard problem is still choosing command flow, event topology, or behavior architecture; use the narrower skill first
- the task is primarily inventory structure, item storage, or broad economy balancing rather than transaction semantics
- one local cost check is already sufficient and no shared contract is needed
- the task is primarily cooldown timing or reevaluation cadence rather than resource commit behavior
- the task is a localized runtime bug investigation rather than resource-transaction design or review
Pattern
- Primary pattern: Tool Wrapper
- Secondary pattern: Generator
Related skills and routing notes
- Start with
game-development-command-flow if the main problem is request-vs-execution ownership rather than cost semantics themselves.
- Pair with
game-development-time-source-and-tick-policy when reservations expire, costs lock for a window, or commit timing depends on a shared clock policy.
- Pair with
game-development-world-state-facts when affordability depends on stale observations, planner-readable availability, or truth-source drift.
- Pair with
game-development-condition-rule-engine when the hard part is reusable eligibility logic and the resource effect is only one input to that decision.
- Hand off to
game-development-goap or game-development-utility-ai once the transaction model is clear and the next question is planning, scoring, or action selection.
Diagnostic checklist
Evaluate these questions before recommending or refining a resource-transaction design:
| Question |
Healthy sign |
Warning sign |
| Is there real shared transaction pressure? |
Several systems need the same spend semantics |
One local cost check is being over-abstracted |
| Is resource ownership clear? |
The source of truth for each resource can be named |
Different systems all mutate the same resource casually |
| Does timing matter? |
It matters when value is checked, reserved, or committed |
Timing is hand-waved and differs per caller |
| Is cancellation meaningful? |
Actions may fail, be interrupted, or be rolled back after validation |
The system assumes every validated action always completes |
| Are failure modes explicit? |
Not-affordable, stale reservation, canceled, and invalid-input cases are distinguishable |
All failures collapse into vague booleans or silent no-ops |
| Is auditability needed? |
Reviews or debugging need to explain what changed and why |
Resource mutations happen invisibly inside unrelated logic |
Decision rules
Before recommending a reusable resource-transaction model, ask whether the smaller honest answer is:
- one local affordability check at a legitimate call site
- one command-validation boundary that does not need shared reservation semantics
- one cooldown or timing rule rather than a resource rule
- one inventory or economy-structure problem rather than a transaction problem
- one balance-tuning problem rather than a consistency-of-semantics problem
Reject a shared transaction layer if it mostly renames a single direct spend without improving consistency, failure handling, or multi-system coordination.
Prefer a local spend check when
- the cost is simple and used in one place
- there is no need for shared preview, reservation, or rollback semantics
- abstraction would mostly rename one obvious subtraction
Prefer immediate spend semantics when
- action validation and execution are effectively one step
- interruption after validation is negligible or impossible
- rollback is not meaningful enough to justify more ceremony
Prefer reservation semantics when
- validation and execution are separated in time
- multiple actors or systems may compete for the same resource window
- UI previews, AI planning, or queued actions need provisional resource claims
- cancellation or timeout can happen after a provisional success
Prefer staged commit or rollback semantics when
- an action may validate successfully but still fail before completion
- partial execution and cancellation need explicit treatment
- the design needs to distinguish provisional success from committed success
- reviews need to reason about refunds, forfeits, or stale reservations explicitly
Escalate to adjacent foundations when
- the real issue is timing cadence rather than transaction semantics
- the real issue is world-fact truth or stale observations rather than spend contracts
- the real issue is condition composition rather than resource commitment behavior
Workflow
Follow this sequence every time.
1. Identify the transaction boundary
State what resource-changing question the system is trying to answer before naming accounts, ledgers, or services.
Examples:
- whether an action can afford to start
- whether resources should be reserved before execution
- whether value is committed only on success
- whether cancellation should refund fully, partially, or not at all
2. Separate affordability, reservation, and commit stages
List the important stages explicitly rather than letting them blur together.
Typical stages:
- affordability check
- reservation or provisional hold
- commit on success
- rollback or refund on failure or cancellation
3. Define the resource ownership model
For each resource family, specify:
- source of truth
- mutation owner
- read-only observers
- whether previews use the same data or a derived projection
- what happens if the owner disappears or changes before commit
4. Choose the transaction model
For each important action path, decide whether the system uses:
- direct immediate spend
- reserve then commit
- reserve with timeout or invalidation
- staged partial commit
- explicit refund or rollback policy
5. Define failure, cancellation, and refund semantics
Specify:
- what not-affordable means
- what stale-reservation means
- what happens if execution fails after reservation
- whether refunds are full, partial, or none
- how cancellation differs from hard failure
6. Define observability and auditability
Specify:
- whether transaction reasons or tags should be visible
- what minimum logs or traces are needed
- whether UI previews and debug tools should expose provisional versus committed state
- what evidence helps reviewers confirm resource consistency
7. Separate transaction rules from adjacent concerns
Clarify what stays outside the transaction model, such as:
- broad inventory layout
- economy tuning and balance formulas
- timing cadence in full
- world-fact truth ownership
- event delivery topology
8. Plan the rollout
Migrate incrementally: isolate one repeated cost family, define ownership, choose the transaction shape, add cancellation and refund rules, replace divergent callers gradually, and verify before widening the model.
Output contract
Return the result using assets/transaction-brief-template.md in this section order.
If the best answer is not a reusable transaction model, still use the template and say that explicitly instead of wrapping one honest cost check in financial theater.
Return the result in these sections:
- Transaction boundary
- Local spend vs shared transaction decision
- Resource ownership model
- Affordability, reservation, and commit design
- Failure, cancellation, and refund model
- Auditability and UI exposure notes
- Related foundations and handoff notes
- Engine integration notes
- Migration plan
- Verification notes
Keep the section order stable so resource-transaction recommendations are easy to compare across reviews and refactor passes.
Engine-specific notes
Godot / .NET
- Keep resource ownership separate from whichever node happens to trigger the action.
- If transaction data is authored as resources, make runtime ownership and mutation boundaries explicit rather than relying on scene-tree convenience.
- Be careful when provisional reservations depend on transient nodes, scene reloads, or object pooling; stale owners should not silently commit value.
Unity
- Keep ScriptableObject-authored cost data separate from runtime transaction ownership.
- Avoid making inspector-authored data the implicit transaction ledger unless the mutation story is genuinely clear.
- Keep preview and commit paths aligned so UI, AI, and execution do not drift into parallel spend semantics.
Generic C# / engine-neutral
- Prefer explicit transaction stages over giant helpers with hidden flags.
- Keep provisional and committed state distinguishable where cancellation matters.
- Use structured transaction reasons only where they materially improve debugging, UX, or reviewability.
Common pitfalls
- abstracting one local spend into a shared ledger framework with no reuse benefit
- checking affordability in one place and spending elsewhere with no clear contract
- letting several systems mutate the same resource with incompatible timing assumptions
- treating reservation and commit as the same thing when interruption clearly exists
- silently refunding or silently forfeiting value without policy clarity
- mixing economy balancing concerns into transaction-boundary design
- making UI previews use different cost semantics than actual execution
- hiding resource mutations inside unrelated command, animation, or effect code
Companion files
references/transaction-models.md — reusable heuristics for immediate spend, reservation, staged commit, rollback, refund, and ownership trade-offs
references/failure-cases.md — reusable failure and cancellation cases for reviewing transaction semantics before they spread
assets/transaction-brief-template.md — reusable output template for returning the resource-transaction design or review artifact
Validation
A good result should satisfy all of the following:
- a simpler local-spend alternative was considered first
- the transaction boundary is explicit
- affordability, reservation, and commit semantics are distinguished clearly
- ownership and mutation rights are concrete enough to review
- failure, cancellation, and refund behavior are stated explicitly
- auditability or UI exposure needs are addressed where relevant
- rollout steps are incremental enough to verify safely
- the design does not quietly expand into inventory architecture, balance doctrine, or timing policy by accident
Completion rule
This skill is complete when the agent has:
- decided whether a reusable resource-transaction model is justified at all
- identified the transaction boundary and ownership model
- defined affordability, reservation, commit, and refund semantics
- specified failure handling, auditability, and observability expectations
- described engine integration notes where relevant
- returned a concrete migration and verification brief
1---2name: game-development-resource-transaction-system3description: Use when a cross-engine gameplay task needs a Layer 1 foundation for cost, spend, reservation, refund, or commit-and-rollback semantics, and the agent must define or review a reusable resource-transaction model with explicit ownership, affordability timing, reservation semantics, failure handling, auditability, and integration boundaries.4---56# Game Development Resource Transaction System78Use this skill when the hard part is not command dispatch or behavior choice alone, but **how gameplay resources are checked, reserved, spent, refunded, committed, or rolled back without every action path inventing a slightly different economy law**.910This skill is for designing, reviewing, or refactoring a reusable resource-transaction model in gameplay, AI, interaction, and action-heavy systems. Its job is to define where resource checks belong, when affordability is evaluated, when value is reserved versus immediately consumed, how failed or canceled actions affect resources, and how transaction outcomes stay consistent enough to review and debug.1112If the engine is unspecified, keep the recommendation engine-agnostic first. Only use engine-native guidance when the task explicitly depends on runtime features such as Godot resources and node ownership, Unity ScriptableObject-driven data authoring, or equivalent framework constraints.1314For reusable transaction shapes, reservation models, and commit-versus-rollback trade-offs, see `references/transaction-models.md`.1516## Purpose1718This skill is used to:1920- determine whether a reusable resource-transaction model is justified at all21- define the boundary between one-off cost checks and shared transaction semantics22- choose immediate spend versus reservation versus staged commit deliberately23- make affordability timing, failure handling, and refund semantics explicit enough to review24- return a structured resource-transaction design or review artifact another agent can implement incrementally2526## Use this skill when2728Invoke this skill for requests such as:2930- several systems need to pay the same kinds of costs but currently check and spend resources differently31- gameplay actions need explicit rules for affordability, reservation, refund, or cancellation32- action flow, AI, UI, or interaction systems all touch the same resource types and keep drifting out of sync33- the team needs to separate `can pay`, `reserve`, `commit`, and `refund` semantics instead of collapsing them into one hidden helper34- requests that explicitly mention `cost`, `resource spend`, `reservation`, `refund`, `rollback`, `transaction`, `mana`, `stamina`, `charges`, or `affordability`3536### Trigger examples3738- "Our abilities all spend stamina a little differently and the rules keep drifting"39- "Should this system reserve resources before execution instead of paying up front?"40- "How do we handle refunds when an action is canceled after validation?"41- "We need shared cost semantics across UI previews, AI choices, and gameplay execution"4243## Do not use this skill when4445Do not use this skill when:4647- the hard problem is still choosing command flow, event topology, or behavior architecture; use the narrower skill first48- the task is primarily inventory structure, item storage, or broad economy balancing rather than transaction semantics49- one local cost check is already sufficient and no shared contract is needed50- the task is primarily cooldown timing or reevaluation cadence rather than resource commit behavior51- the task is a localized runtime bug investigation rather than resource-transaction design or review5253## Pattern5455- Primary pattern: **Tool Wrapper**56- Secondary pattern: **Generator**5758## Related skills and routing notes5960- Start with `game-development-command-flow` if the main problem is request-vs-execution ownership rather than cost semantics themselves.61- Pair with `game-development-time-source-and-tick-policy` when reservations expire, costs lock for a window, or commit timing depends on a shared clock policy.62- Pair with `game-development-world-state-facts` when affordability depends on stale observations, planner-readable availability, or truth-source drift.63- Pair with `game-development-condition-rule-engine` when the hard part is reusable eligibility logic and the resource effect is only one input to that decision.64- Hand off to `game-development-goap` or `game-development-utility-ai` once the transaction model is clear and the next question is planning, scoring, or action selection.6566## Diagnostic checklist6768Evaluate these questions before recommending or refining a resource-transaction design:6970| Question | Healthy sign | Warning sign |71| --- | --- | --- |72| Is there real shared transaction pressure? | Several systems need the same spend semantics | One local cost check is being over-abstracted |73| Is resource ownership clear? | The source of truth for each resource can be named | Different systems all mutate the same resource casually |74| Does timing matter? | It matters when value is checked, reserved, or committed | Timing is hand-waved and differs per caller |75| Is cancellation meaningful? | Actions may fail, be interrupted, or be rolled back after validation | The system assumes every validated action always completes |76| Are failure modes explicit? | Not-affordable, stale reservation, canceled, and invalid-input cases are distinguishable | All failures collapse into vague booleans or silent no-ops |77| Is auditability needed? | Reviews or debugging need to explain what changed and why | Resource mutations happen invisibly inside unrelated logic |7879## Decision rules8081Before recommending a reusable resource-transaction model, ask whether the smaller honest answer is:8283- one local affordability check at a legitimate call site84- one command-validation boundary that does not need shared reservation semantics85- one cooldown or timing rule rather than a resource rule86- one inventory or economy-structure problem rather than a transaction problem87- one balance-tuning problem rather than a consistency-of-semantics problem8889Reject a shared transaction layer if it mostly renames a single direct spend without improving consistency, failure handling, or multi-system coordination.9091### Prefer a local spend check when9293- the cost is simple and used in one place94- there is no need for shared preview, reservation, or rollback semantics95- abstraction would mostly rename one obvious subtraction9697### Prefer immediate spend semantics when9899- action validation and execution are effectively one step100- interruption after validation is negligible or impossible101- rollback is not meaningful enough to justify more ceremony102103### Prefer reservation semantics when104105- validation and execution are separated in time106- multiple actors or systems may compete for the same resource window107- UI previews, AI planning, or queued actions need provisional resource claims108- cancellation or timeout can happen after a provisional success109110### Prefer staged commit or rollback semantics when111112- an action may validate successfully but still fail before completion113- partial execution and cancellation need explicit treatment114- the design needs to distinguish provisional success from committed success115- reviews need to reason about refunds, forfeits, or stale reservations explicitly116117### Escalate to adjacent foundations when118119- the real issue is timing cadence rather than transaction semantics120- the real issue is world-fact truth or stale observations rather than spend contracts121- the real issue is condition composition rather than resource commitment behavior122123## Workflow124125Follow this sequence every time.126127### 1. Identify the transaction boundary128129State what resource-changing question the system is trying to answer before naming accounts, ledgers, or services.130131Examples:132133- whether an action can afford to start134- whether resources should be reserved before execution135- whether value is committed only on success136- whether cancellation should refund fully, partially, or not at all137138### 2. Separate affordability, reservation, and commit stages139140List the important stages explicitly rather than letting them blur together.141142Typical stages:143144- affordability check145- reservation or provisional hold146- commit on success147- rollback or refund on failure or cancellation148149### 3. Define the resource ownership model150151For each resource family, specify:152153- source of truth154- mutation owner155- read-only observers156- whether previews use the same data or a derived projection157- what happens if the owner disappears or changes before commit158159### 4. Choose the transaction model160161For each important action path, decide whether the system uses:162163- direct immediate spend164- reserve then commit165- reserve with timeout or invalidation166- staged partial commit167- explicit refund or rollback policy168169### 5. Define failure, cancellation, and refund semantics170171Specify:172173- what not-affordable means174- what stale-reservation means175- what happens if execution fails after reservation176- whether refunds are full, partial, or none177- how cancellation differs from hard failure178179### 6. Define observability and auditability180181Specify:182183- whether transaction reasons or tags should be visible184- what minimum logs or traces are needed185- whether UI previews and debug tools should expose provisional versus committed state186- what evidence helps reviewers confirm resource consistency187188### 7. Separate transaction rules from adjacent concerns189190Clarify what stays outside the transaction model, such as:191192- broad inventory layout193- economy tuning and balance formulas194- timing cadence in full195- world-fact truth ownership196- event delivery topology197198### 8. Plan the rollout199200Migrate incrementally: isolate one repeated cost family, define ownership, choose the transaction shape, add cancellation and refund rules, replace divergent callers gradually, and verify before widening the model.201202## Output contract203204Return the result using `assets/transaction-brief-template.md` in this section order.205206If the best answer is **not** a reusable transaction model, still use the template and say that explicitly instead of wrapping one honest cost check in financial theater.207208Return the result in these sections:2092101. **Transaction boundary**2112. **Local spend vs shared transaction decision**2123. **Resource ownership model**2134. **Affordability, reservation, and commit design**2145. **Failure, cancellation, and refund model**2156. **Auditability and UI exposure notes**2167. **Related foundations and handoff notes**2178. **Engine integration notes**2189. **Migration plan**21910. **Verification notes**220221Keep the section order stable so resource-transaction recommendations are easy to compare across reviews and refactor passes.222223## Engine-specific notes224225### Godot / .NET226227- Keep resource ownership separate from whichever node happens to trigger the action.228- If transaction data is authored as resources, make runtime ownership and mutation boundaries explicit rather than relying on scene-tree convenience.229- Be careful when provisional reservations depend on transient nodes, scene reloads, or object pooling; stale owners should not silently commit value.230231### Unity232233- Keep ScriptableObject-authored cost data separate from runtime transaction ownership.234- Avoid making inspector-authored data the implicit transaction ledger unless the mutation story is genuinely clear.235- Keep preview and commit paths aligned so UI, AI, and execution do not drift into parallel spend semantics.236237### Generic C# / engine-neutral238239- Prefer explicit transaction stages over giant helpers with hidden flags.240- Keep provisional and committed state distinguishable where cancellation matters.241- Use structured transaction reasons only where they materially improve debugging, UX, or reviewability.242243## Common pitfalls244245- abstracting one local spend into a shared ledger framework with no reuse benefit246- checking affordability in one place and spending elsewhere with no clear contract247- letting several systems mutate the same resource with incompatible timing assumptions248- treating reservation and commit as the same thing when interruption clearly exists249- silently refunding or silently forfeiting value without policy clarity250- mixing economy balancing concerns into transaction-boundary design251- making UI previews use different cost semantics than actual execution252- hiding resource mutations inside unrelated command, animation, or effect code253254## Companion files255256- `references/transaction-models.md` — reusable heuristics for immediate spend, reservation, staged commit, rollback, refund, and ownership trade-offs257- `references/failure-cases.md` — reusable failure and cancellation cases for reviewing transaction semantics before they spread258- `assets/transaction-brief-template.md` — reusable output template for returning the resource-transaction design or review artifact259260## Validation261262A good result should satisfy all of the following:263264- a simpler local-spend alternative was considered first265- the transaction boundary is explicit266- affordability, reservation, and commit semantics are distinguished clearly267- ownership and mutation rights are concrete enough to review268- failure, cancellation, and refund behavior are stated explicitly269- auditability or UI exposure needs are addressed where relevant270- rollout steps are incremental enough to verify safely271- the design does not quietly expand into inventory architecture, balance doctrine, or timing policy by accident272273## Completion rule274275This skill is complete when the agent has:276277- decided whether a reusable resource-transaction model is justified at all278- identified the transaction boundary and ownership model279- defined affordability, reservation, commit, and refund semantics280- specified failure handling, auditability, and observability expectations281- described engine integration notes where relevant282- returned a concrete migration and verification brief