Skip to content

Render AGENT.md template parameters from work item state #56

Description

@devzeebo

Summary

Task Agent AGENT.md files declare template.parameters and use {{token}} placeholders in the prompt body. Today the parser validates that tokens are declared, but nothing substitutes values from work item state at run time.

Current behavior

  • agent-parser.ts validates {{tokens}} against template.parameters at parse time
  • ? suffix marks optional parameters in declarations only — no runtime enforcement
  • verifyIsTaskAgentState checks workingDir, instructions, engineName, and sessionId — not template parameters
  • Engines pass raw agent.promptBody to the model with literal {{...}} still in the text (cursor-engine.ts, prompt.ts)

Desired behavior

  1. Render — substitute {{parameterName}} in promptBody from work item state before the engine builds the final prompt
  2. Validate — parameters without a ? suffix are required in state; missing required parameters should fail before engine execution
  3. Optional — parameters declared with ? may be omitted from state

Docs

Usage guide describes this as planned behavior: using-task-agents.md

Out of scope

Workflow child enrichment (instructions, engineName, template params on task steps) — that remains the job of step decorators, not the workflow framework.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions