Skip to content

Phase 2: kleene-play Updates #5

@discreteds

Description

@discreteds

Overview

Update kleene-play skill to use yq for optimized scenario loading.

Tasks

  • Update lazy loading to use yq
    • Replace 200-line header read with surgical extraction
    • Replace grep -A 80 node loading with yq '.nodes.{node_id}'
  • Add node prefetching for improvise outcomes
    • Single query fetches both outcome nodes
  • Cache node metadata in saves
    • Add current_node_title and current_node_preview fields
    • Extract at save time for rich save listings

Token Savings

Operation Current yq Savings
Load header ~4k tokens ~1k tokens ~75%
Load node ~1.5k tokens ~0.5k tokens ~67%

Acceptance Criteria

  • Header loading uses yq when available
  • Node loading uses yq when available
  • Improvise outcomes prefetched in single query
  • Save files include node metadata
  • Graceful fallback when yq unavailable

References

  • Plan: kleene/docs/plans/yq-scenario-optimization.md (Phase 2, lines 97-131)
  • Templates: Game Initialization, Turn Context, Improvise Prefetch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions