Observation

From XiaoLuoLYG/GOD · View interactive version

Observation is an AI agent skill from the GitHub repository XiaoLuoLYG/GOD. Fetch the current world observation for this tick.

How to use this skill

Skill file

Observation

You are a situated agent in a simulated world. This skill fetches the latest sensory observation for the current tick—what you can see, hear, and perceive around you.

When to Use

Activate this skill when you need fresh perception for the current tick. Other skills may read state/observation.txt / state/observation_ctx.json if those files exist—there is no hard activation order.

Workflow

  1. Call codegen with instruction: "<observe>" and ctx: {"id": <your_agent_id>} (replace <your_agent_id> with your actual agent ID from the Agent Identity section).
  2. Parse the response:
  1. If the response contains status: "in_progress": the environment is still processing. Call done and resume next tick.
  2. Write the observation to workspace for downstream skills:
workspace_write("state/observation.txt", <stdout text>)
  1. If ctx contains useful structured data, also write it:
workspace_write("state/observation_ctx.json", <ctx as JSON string>)

Persisting perception

After a successful observe, if you want a durable trace, append one line to memory.jsonl with type: "observation" (or event) and a short factual summary. Skip if this tick’s perception duplicates the latest entry.

What Observation Contains

The observation text typically includes:

Location Information

Nearby Entities

Environmental Context

Available Actions

Re-observation After Actions

Do not re-observe repeatedly in the same step. After a meaningful environment action, end the step and observe on the next tick unless the tool result is ambiguous and immediate clarification is necessary.

  1. Execute action via codegen.
  2. Check the response status.
  3. If status is success or in_progress, call done.
  4. Observe again on the next tick and update state/observation.txt / state/observation_ctx.json.

This keeps the agent's internal state aligned with the environment without turning one step into an observation loop.

Observation Context Structure

The state/observation_ctx.json typically contains:

{
  "agent_id": 1,
  "position": {"x": 100, "y": 200},
  "location": "park_entrance",
  "nearby_agents": [
    {"id": 2, "name": "Alice", "distance": 5.2}
  ],
  "nearby_objects": [
    {"id": "bench_01", "type": "bench", "distance": 2.0}
  ],
  "time": {"hour": 10, "minute": 30},
  "weather": "sunny",
  "available_actions": ["move", "interact", "wait"]
}

Important Notes

Notes on State

This skill only produces observation artifacts (state/observation.txt, optional state/observation_ctx.json).

Higher-level “agent state snapshot / replay logging” is considered system functionality rather than a human-like capability skill, and should be handled by the runtime/framework if needed.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.