# Free-Text Game Actions & Settlement

> Turn free-text player actions into validated game outcomes, with timeout and duplicate-submit handling.

Free-Text Game Actions & Settlement is a free AI agent skill on Agensi by Whaocai, in Game Development. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Whaocai](https://www.agensi.io/creators/creator-567)
- Category: [Game Development](https://www.agensi.io/skills/game-development)
- Uses: 3
- Version: 1.0
- Last updated: 2026-10-13
- Security: scan passed (2026-10-13); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/free-text-game-actions-settlement
- Tags: gaming, llm-ops, testing, free-text-actions, game-development, interactive-fiction, javascript, llm-integration

## About this skill

### Give players a third option: their own idea

Players do not always want to choose from predefined buttons. This skill helps connect a player's typed action to a complete gameplay result: understandable feedback, legal resource changes, and progression when the game's rules allow it.

### Recorded browser demo: Crossing the Frozen Ridge

See the six screenshots in this listing for an English H5 prototype built with this skill. The recorded session uses real model interpretation and rule-owned settlement: a careful move advances, a spent thermal wrap cannot be reused, and Rowan cannot reveal an unseen secret route. The journal shows character cards, recent accepted dialogue and scoped memories.

The model-assisted prototype is a separate case application. The skill ZIP contains the reusable workflow and tested helpers. The screenshots provide a recorded walkthrough; a public playable model service is not bundled.

### What it helps you build

- A clear boundary between model interpretation and game-state authority.
- Validation of response structure and gameplay rules before settlement.
- Readable outcomes for short, empty, noisy, or impossible actions.
- Bounded waiting and a validated fallback when requests fail or time out.
- One local settlement for an in-flight action, even when the player submits twice.
- Invalidation of old responses after restart or a relevant state change.
- Character-card constraints: stable identity and voice, actor capabilities, NPC knowledge visibility, and separation from mutable game state.
- Context policies: a project-specific recent-dialogue window, token budget, summary provenance, and protected facts when pruning.
- Memory policies: short-term versus durable facts, player/save/character scope, current-state priority, and idempotent updates after successful settlement.
- An explicit degradation ladder under one total deadline, with optional bounded repair and no state change when even the fallback is invalid.

### Character, history, and memory constraints

A typed claim cannot grant an ability, reveal a secret an NPC has not learned, or overwrite a character card. Current authoritative inventory, resources, relationships, and quest flags take precedence over old dialogue or retrieved memories.

Choose the recent-turn window and token limits for the actual game and provider. A turn is one committed action and its accepted result; transport retries do not add game history. Summaries and retrieved memories carry sources and scope, and pruning keeps the current action, essential rules, character boundaries, and authoritative state.

Record accepted memories only after a successful state commit. Ignore speculative candidates, invalid results, and late responses from a previous run. Define save/restart behavior and player/character visibility; indexing failures recover without replaying gameplay settlement.

The package supplies English workflow contracts, a per-project decision template, and host acceptance scenarios for these features. It does not include a character database, token accountant, summarizer, retrieval backend, or persistent-memory engine. The included tests cover the controller and local example, not those host implementations.

### What is included

- English SKILL.md, action contract, integration guide, and acceptance checklist.
- Context and memory contract plus a configurable decision template for character cards, history budgets, memory scope, and degradation.
- A JavaScript controller with injectable request, validation, timing, and commit callbacks.
- Traversal result validation and the original Chinese-keyword fallback helper.
- Original runnable integration example and 18 controller behavior tests.
- Crossing the Frozen Ridge: an English case adapted from the earlier fictional H5 project Aotai Crossing, with a runnable nine-case demonstration.
- MIT license and distribution change notes.

### The case

A fictional mountain-crossing game offers two predefined responses and “I have my own idea.” A careful action can advance the player; rushing has a cost; stopping or attempting an impossible shortcut gives a complete result without granting unauthorized progress. Duplicate submissions, invalid responses, timeouts, and restart are also exercised.

The bundled command-line demonstration uses deterministic local rules and simulated failures. That command-line example makes no model requests and requires no API key. It is an adaptation of the historical project, not a replay of a live model session or proof that this skill alone generated the original game.

### How to use it

Ask a compatible agent to use free-input-output on your existing game. Supply the current state schema, legal actions, costs, progression rules, request endpoint, and desired waiting behavior. Request a design, an implementation, or verification of an existing flow.

Run the bundled examples and tests with Node.js 18+:

```sh
node examples/frozen-ridge-demo.cjs
node --test tests/test-free-input.cjs
```

### Requirements and boundaries

This package provides workflow instructions and tested JavaScript helpers. It does not bundle a game engine, model-provider backend, paid model access, or the complete historical H5 game. A real model integration requires the project's server-side adapter and separately configured credentials. Cross-client idempotency and persistent transactions belong to the host server.

The entrypoint, guides, and new demonstration are in English. Original Chinese-keyword helpers and fixtures are retained for compatibility. Neither local classifier provides general language understanding.

### Open source

Created and maintained by Whaocaii. Package license: MIT. Public base repository:
https://github.com/Whaocaii/ai-game-skills

This English distribution adds localized documentation and the case demonstration to the public base version; those additions have not yet been pushed to GitHub.

## Requires

- Node.js

## Known limitations

The skill ZIP includes limited local keyword examples and simulated requests; its original traversal helper matches Chinese keywords. The screenshot gallery documents a separate live-model H5 application, with browser layout, single-use supplies, role boundaries, per-run memory and fallback checks. This is not a formal model-quality benchmark or real-device Host certification. The controller handles one local in-flight settlement; server/cross-client idempotency, authentication and persistent transactions belong to the host. The shown six intents, costs and three-segment story are project choices. Character-card storage, token accounting, summaries, retrieval and durable memory are workflow contracts and host responsibilities. The gallery prototype implements a bounded estimated context window and run-scoped memory, not cross-session memory. The skill ZIP does not bundle Framework, the H5 game, a public playable endpoint, provider credentials or paid model access.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Free-Text Game Actions & Settlement skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Does this package include a working LLM service?

No. It includes workflow instructions, a controller, validation helpers, and local demonstrations. Connect a server-side model adapter for real language understanding.

### Is the skill available in English?

The entrypoint, guides, and new fictional-crossing demonstration are in English. Original Chinese-keyword helpers and fixtures are retained and clearly labeled.

### Does every typed action advance the player?

No. The game decides whether an action is legal and advances. Empty, unclear, or impossible input can receive a complete readable outcome without advancement.

### Can I use a different state schema or game genre?

Yes. Inject your own validation, fallback, and commit callbacks. The three-stat crossing contract is an example, not a required game design.

### Does it guarantee server-side exactly-once transactions?

No. It handles one controller’s in-flight local settlement. Persistent resources and multiple clients need host-server idempotency and transactions.

### Is the full Aotai Crossing game included?

No. The package contains an English case adaptation and reproducible action-settlement example. The historical H5 game is not bundled.

### What license does the package carry?

The package includes the author’s MIT license. Agensi separately applies its platform terms to acquisition and delivery; consult those terms for platform-specific conditions.

### Does the skill constrain character cards and NPC knowledge?

Yes. Its English workflow contract separates stable identity, voice, capabilities, and knowledge from mutable state. A player claim cannot grant abilities or make an NPC know hidden facts. The host implements card storage, visibility checks, and relevant acceptance tests.

### How are dialogue history and long-term memory bounded?

Choose per-game turn and token budgets, summary triggers, and retrieval limits. Memories retain source events and player/save/character scope. Current state wins conflicts. Only committed events create accepted memories, and restart/load behavior is explicit. A policy template is included; storage and summarization are not implemented by the package.

### What happens when interpretation or memory services fail?

Use the configured ladder under one total deadline: primary interpretation, optional bounded repair or authorized alternative, validated local fallback, then a recoverable no-commit error if no legal fallback exists. Optional memory failure follows a declared project policy. Retries and indexing failures never replay gameplay settlement.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
