Skip to content

Add kanon.yaml schema reference to READMEΒ #25

Description

@kelos-bot

πŸ€– Kelos User Agent @gjkim42

Problem

There is no documented reference for the kanon.yaml schema anywhere β€” not in the README, not as a kanon schema command, not as Go doc comments on the exported types, and not as inline comments in the scaffold produced by kanon init.

The sampleConfig written by kanon init (internal/core/init.go) is a bare 6-line skeleton with no comments:

version: 1
instructions:
  files:
    - instructions/shared.md
skills: []
mcp:
  servers: {}
hooks: []

A new user who wants to go beyond that skeleton β€” add an MCP server, configure a hook for only one agent, use a skill with a custom path, set a bearer token, or use environment variable interpolation β€” has no authoritative reference. They must read internal/core/types.go alongside the renderer code in internal/core/render.go to discover what fields exist and how they behave.

Why this blocks adoption

Kanon's core value proposition is that users hand-edit kanon.yaml as their single source of truth. The schema is non-trivial: MCPServer alone has ~15 fields, several of which are agent-specific with no documentation:

  • env_vars, bearer_token_env_var, tool_timeout_sec, tools, default_approval β€” Codex-only, silently ignored for Claude
  • startup_timeout_sec β€” rendered as timeout for Claude, as startup_timeout_sec for Codex
  • type β€” overridden at render time for Claude (auto-inferred from url/command), making an explicit value advisory-only
  • env_headers β€” renders differently per agent
  • Hook.name doubles as event if event is empty (tracked in Hook 'name' silently used as 'event' fallback β€” undocumented and misconfiguration goes undetectedΒ #15 as a separate bug, but the behavior is still undocumented)
  • targets field β€” appears on skills, MCP servers, and hooks; valid values all, codex, claude; empty = all agents β€” nowhere documented

Without a schema reference, every field a user tries to configure beyond the scaffold requires source-diving.

Concrete suggestion

Add a ## kanon.yaml reference section to the README with a fully annotated example. At minimum, document:

  • version β€” only 1 is currently supported
  • instructions.files β€” paths to markdown files concatenated into AGENTS.md / CLAUDE.md; supports ${VAR} and ${VAR:-default} interpolation
  • skills[] β€” name (required), path (optional, defaults to skills/<name>), targets, enabled
  • mcp.servers.<name> β€” distinguish which fields apply to all agents vs Codex-only vs Claude-only; document the type auto-inference
  • hooks[] β€” name, event (defaults to name if omitted), matcher, command, args, timeout, async, targets
  • targets semantics β€” valid values and what empty means
  • Environment variable interpolation β€” ${VAR_NAME} (fails validation if unset) and ${VAR_NAME:-default}

A fully annotated kanon.yaml with YAML comments in the README would serve as the canonical reference with no code changes required. A longer-term improvement could be a kanon schema command or adding Go doc comments to the exported types in internal/core/types.go.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions