Skip to content

docs: document all builtin hooks in schema and hooks page#2555

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/update-docs-and-schema-for-new-builtin-h-ed796b9b
Apr 28, 2026
Merged

docs: document all builtin hooks in schema and hooks page#2555
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/update-docs-and-schema-for-new-builtin-h-ed796b9b

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented Apr 27, 2026

The hooks page and JSON schema only mentioned three builtins (add_date,
add_environment_info, add_prompt_files) even though the runtime now ships
nine. This brings the docs back in sync with pkg/hooks/builtins.

Changes:

  • agent-schema.jsonHookDefinition.type description now lists every
    shipped builtin with its target event and arg semantics; args description
    was extended with concrete examples for builtins that accept parameters
    (add_prompt_files, add_recent_commits, add_git_diff, max_iterations).
  • docs/configuration/hooks/index.md – New Built-in Hooks section
    with a YAML example, a reference table of all 9 builtins (event + args +
    behavior), and callouts explaining per-turn vs. per-session semantics, the
    agent-flag shorthands (`add_date: true` etc.), and the difference between
    the `max_iterations` agent field and the same-name builtin hook.
  • `examples/hooks.yaml` – Replaced the stale "Three are shipped"
    comment with the full list of shipped builtins and their events/args.

Validation: `go test ./pkg/config/... ./pkg/hooks/...` (incl.
`TestJsonSchemaWorksForExamples`).

@dgageot dgageot requested a review from a team as a code owner April 27, 2026 17:02
@dgageot dgageot merged commit b48c15b into docker:main Apr 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants