Skip to content

Teach the native agent to author plays: a play-authoring skill and typed get_play / update_play tools #3519

Closed

Description

@malibio

Overview

The native agent can't author plays. Its only play skill (play-workflow-state) diagnoses why a rule hasn't fired, and none of its tools reads a play's rules or writes them through the typed play update. ADR-090 §6 adds:

  • a built-in play-authoring skill;
  • two typed tools, so the agent can read a play, change its rules (with descriptions) or its switch, and repair a rejected write.

Proposed Solution

  • Skill: a seeded built-in skill with a fixed UUID, linked applies_to → play. Its guidance is plain Markdown in the seed table and covers:

    • reading a play and the rule shape;
    • writing descriptions;
    • describing a change and asking before writing it;
    • repairing a rejected write from its errors.

    It shares rule fragments with SKILL.md where the rule is the same.

  • get_play: takes a play id. Returns the typed play (rules with descriptions, enabled, the suspension) and the schema metadata of every type its rules reference. This is a fact, not a plan (ADR-064 rule 4), so a turn held to play can still check paths and fields.

  • update_play: takes a play id and any of rules (whole), description and enabled. It writes through the typed play update and returns the updated play, or the validation errors naming rule, component and field.

  • Both are seeded tool-native nodes, and the skill whitelists them.

Documentation

  • ADR-090 §6: the skill, get_play, update_play, retrievability and evals
  • Playbook System — Agent Interface: the two tools
  • Seeded Nodes: seed tables, fixed UUIDs, Markdown bodies, shared rule fragments, applies_to and the offered set
  • Tool Registry: tool-native nodes, handler keys, how the tool list is built
  • Prompt and Skill System: skill shape, description conventions, tool_whitelist
  • ADR-064: tool schemas own argument shape; tool results are facts; skill descriptions are retrieval keys (rule 3: a new skill competes with all others)
  • ADR-056: the grammar constrains only the tool envelope, so validation errors carry the repair loop
  • Updates: none expected

Architecture Impact

Implements ADR-090 §6. No decision change. This adds the first built-in skill linked to a schema, a case Seeded Nodes already describes.

Acceptance Criteria

  • The play-authoring skill is seeded from the built-in skills table with a fixed UUID and a Markdown body, and is linked applies_to → play
  • get_play and update_play are seeded tool-native tools with handlers. Their parameter schemas state the argument shape, including the rule shape with descriptions; prose doesn't restate it
  • get_play returns the typed play plus the schema metadata (fields, relationships) of every type its selectors, conditions and actions reference
  • update_play:
    • writes only through the typed play update;
    • a rejected write returns errors naming rule, component, index and field;
    • setting enabled works;
    • it never writes lifecycle_status or the suspension fields
  • Agent tests:
    • a turn that changes a condition writes rules with updated descriptions;
    • a turn whose first write is rejected (stale description) repairs it and succeeds;
    • "turn this play off" sets enabled = false
  • The prompt golden test is updated and reviewed (UPDATE_GOLDEN=1)
  • The routing and decisions evals don't regress with the new skill seeded. Results go in the PR, with the skill's title and description tuned if needed
  • bun run quality:fix clean; bun run test:changed passes

Technical Specifications

Reference Files

  • Skill seeds: packages/agent/src/seeds/skills/ (bodies), the built-in skills table in packages/agent/src/skill_pipeline.rs
  • Existing play skill: packages/agent/src/seeds/skills/play-workflow-state.md
  • Tools: packages/agent/src/local_agent/tools.rs (tool definitions and handlers; update_task_status is a typed-update precedent)
  • Routing / offered set: packages/agent/src/local_agent/routing.rs
  • Typed play update: packages/core/src/services/node_service/schema.rs (update_play_node)
  • Validation errors: packages/core/src/playbook/validation.rs (PlayValidationError, location(), kind())

Dependencies

Related Issues

Activity

  1. added
    enhancement
    on Oct 3, 2026
  2. malibio commented on Oct 4, 2026

    @malibio
    CollaboratorAuthor

    Baseline — Frontend: 315 test files passed (5690 tests)

  3. self-assigned this
    on Oct 4, 2026
  4. added 2 commits that reference this issue on Oct 4, 2026
    dc7578a
    be64aba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

aibackendenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions