Goal
Add a generate-context subcommand that produces an AGENTS.md file from the CLI's
registered subcommands, parameter definitions, and optional author-defined annotations. The
file encodes usage invariants that agents cannot intuit from --help.
Motivation
Agents need invariants made explicit: which operations are destructive,
which parameters require special formatting, which resource kinds exist, and how credentials should be provided.
A context file answers these questions at near-zero token cost because it is loaded once
per conversation rather than reconstructed each time. A skill file is cheaper than a
hallucination.
Task
A generate-context subcommand needs to be added that introspects all registered subcommands
and generates structured Markdown. The output should include tool names, descriptions,
parameter tables with types and allowed values, and an authentication section listing
environment variables for sensitive params.
CLI authors should be able to attach agent-specific guidance to subcommands and parameters
(e.g. "always specify --kind to limit scope") that gets included in the generated file.
This guidance is not something the framework can infer automatically, so it requires an
annotation API.
The command should write to stdout by default, with an optional -o flag for file output.
Optionally, the command could support YAML frontmatter output for compatibility with agent
frameworks that consume structured skill files.
Acceptance criteria
Goal
Add a
generate-contextsubcommand that produces anAGENTS.mdfile from the CLI'sregistered subcommands, parameter definitions, and optional author-defined annotations. The
file encodes usage invariants that agents cannot intuit from
--help.Motivation
Agents need invariants made explicit: which operations are destructive,
which parameters require special formatting, which resource kinds exist, and how credentials should be provided.
A context file answers these questions at near-zero token cost because it is loaded once
per conversation rather than reconstructed each time. A skill file is cheaper than a
hallucination.
Task
A
generate-contextsubcommand needs to be added that introspects all registered subcommandsand generates structured Markdown. The output should include tool names, descriptions,
parameter tables with types and allowed values, and an authentication section listing
environment variables for sensitive params.
CLI authors should be able to attach agent-specific guidance to subcommands and parameters
(e.g. "always specify
--kindto limit scope") that gets included in the generated file.This guidance is not something the framework can infer automatically, so it requires an
annotation API.
The command should write to stdout by default, with an optional
-oflag for file output.Optionally, the command could support YAML frontmatter output for compatibility with agent
frameworks that consume structured skill files.
Acceptance criteria
generate-contextsubcommand generatesAGENTS.mdcontent-ofor file output