Skip to content

[feature] Agent Context File Generation #44

@Kukkerem

Description

@Kukkerem

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

  • generate-context subcommand generates AGENTS.md content
  • Generated content includes tool names, descriptions, parameter tables, and enum values
  • CLI authors can attach agent-specific guidance to subcommands and parameters
  • Sensitive params are listed in an authentication section with env var names
  • Output goes to stdout by default with optional -o for file output
  • Tests assert the generated markdown structure and content

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliffordxp-clifford framework

    Type

    No type

    Projects

    Status

    Validation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions