home / skills / simhacker / moollm / goal

goal skill

/skills/goal

This skill helps you define and track adventure goals to drive narrative, measure progress, and unlock rewards.

npx playbooks add skill simhacker/moollm --skill goal

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
3.0 KB
---
name: goal
description: Quest objectives that drive narrative — the WANTS of adventure
allowed-tools:
  - read_file
  - write_file
tier: 1
protocol: SCHEMA-MECHANISM
tags: [moollm, quest, objective, narrative, game]
related: [adventure, character, needs, hero-story]
adversary: aimlessness
---

# Goal

> *"A goal is not always meant to be reached. Often it serves simply as something to aim at."*
> — Bruce Lee

---

## What Is It?

A **Goal** is a quest objective that drives the adventure forward. It defines what the player is trying to achieve and when they've succeeded (or failed).

Goals create **narrative tension** — the gap between current state and desired state.

---

## Schema Mechanism Connection

From Gary Drescher's theory:

```
Context → Action → Result
```

Goals define the desired **Result** that motivates **Action**. The adventure is a laboratory for learning causal chains that achieve goals.

---

## Goal Properties

| Property | Purpose |
|----------|---------|
| `id` | Unique identifier |
| `name` | Short display name |
| `description` | What you're trying to achieve |
| `status` | pending, active, complete, failed |
| `complete_when` | Natural language condition |
| `fail_when` | When goal becomes impossible |
| `reward` | What you get on completion |
| `progress` | Partial completion tracking |

---

## Completion Conditions

Natural language conditions that compile to JS/PY:

```yaml
complete_when: "player has the treasure"
complete_when_js: "(ctx) => ctx.player.inventory.includes('treasure')"
```

---

## Rewards

Goals can grant various rewards:

```yaml
reward:
  buff: "Hero's Glory"           # Temporary effect
  item: "champion-medal"         # Object
  unlock: "secret-room"          # New access
  narrative: "The kingdom celebrates!"  # Story beat
```

---

## Progress Tracking

For multi-step goals:

```yaml
progress:
  collected: 3
  needed: 5
```

---

## Goal Hierarchies

Goals can nest:

```yaml
parent: defeat-dragon
children:
  - find-magic-sword
  - learn-dragon-weakness
  - reach-dragon-lair
```

Complete all children to complete the parent.

---

## Failure Conditions

Goals can fail:

```yaml
fail_when: "time reaches midnight AND prisoner is not freed"
fail_message: "You were too late."
```

---

## Examples

### Simple Quest

```yaml
goal:
  id: find-treasure
  name: "Find the Treasure"
  complete_when: "player has the treasure"
```

### Timed Challenge

```yaml
goal:
  id: rescue-mission
  name: "Save the Prisoner"
  complete_when: "prisoner is freed"
  fail_when: "10 turns pass without rescue"
  priority: urgent
```

### Collection Quest

```yaml
goal:
  id: gather-keys
  name: "Collect All Keys"
  complete_when: "player has 5 enchanted keys"
  progress:
    collected: 2
    needed: 5
```

---

## Related Skills

- [adventure](../adventure/) — Contains active goals
- [hero-story](../hero-story/) — Narrative structure
- [needs](../needs/) — Internal motivations

---

## Protocol Symbol

```
SCHEMA-MECHANISM — Goals drive causal learning
```

Overview

This skill models quest objectives that drive an adventure — the WANTS of play. It defines clear success and failure conditions, rewards, progress tracking, and hierarchical relationships so narratives gain measurable tension and momentum. Use it to turn desires into actionable, testable game goals.

How this skill works

The skill represents goals with properties like id, name, description, status, complete_when, fail_when, reward, and progress. Natural-language completion and failure conditions compile into executable checks (JS/PY) so the engine can evaluate goal state. Goals can nest, grant rewards, and track partial progress to support multi-step quests and dynamic failure handling.

When to use it

  • Define what players must achieve to advance the story or unlock content.
  • Model time-limited or conditional challenges with explicit fail conditions.
  • Track multi-step collection or progress-based objectives.
  • Compose complex objectives by nesting child goals under a parent goal.
  • Attach tangible or narrative rewards to outcomes.

Best practices

  • Write complete_when and fail_when as clear, testable conditions that can compile to code.
  • Keep goal descriptions concise and player-facing; use machine fields for logic.
  • Use progress fields for multi-step goals instead of many separate goals when steps are tightly coupled.
  • Nest goals when subtasks must all be completed to satisfy a larger objective.
  • Provide informative fail_message and reward text to preserve narrative continuity.

Example use cases

  • Simple fetch quest: complete_when 'player has the treasure' and grant an item reward.
  • Timed rescue: fail_when '10 turns pass without rescue' with urgent priority and a fail_message.
  • Collection quest: progress tracked with collected/needed for gathering enchanted keys.
  • Goal hierarchy: parent 'defeat-dragon' with children to find sword, learn weakness, and reach lair.
  • Unlockable narrative: reward unlocks a secret room or a ceremonial celebration scene.

FAQ

How do natural language conditions become executable checks?

Conditions are written in clear phrases and also provided as compiled expressions (JS/PY) so the runtime can evaluate goal state reliably.

Can goals fail permanently?

Yes — fail_when expresses when a goal becomes impossible. You can provide fail_message and handle downstream effects in the adventure system.