agent-zero/extensions/python/AGENTS.md
frdel 175baa49db Add AGENTS.md DOX files and migrate docs
Introduce DOX (AGENTS.md) contracts across the repository to formalize ownership and local work contracts: adds .github/AGENTS.md plus AGENTS.md files for agents, api, conf, docker, docs, extensions, helpers, knowledge, lib, plugins, prompts, scripts, skills, tests, tools, usr, webui (and several subfolders). Update root AGENTS.md (content and last-updated date) to include DOX framework guidance and a child DOX index. Update .gitignore to allow usr/ and usr/plugins AGENTS.md files. Remove legacy deep-dive files under docs/agents (banners, components, modals, plugins) and migrate frontend/plugin references to webui/ and plugins/ DOX locations. Also adjust plugins/README.md and several skills/*/SKILL.md files to align with the new DOX layout.
2026-06-01 13:55:07 +02:00

1.4 KiB

Python Extensions DOX

Purpose

  • Own built-in backend lifecycle extensions under extensions/python/.
  • Keep Python hook behavior compatible with helpers.extension.call_extensions_async and call_extensions_sync.

Ownership

  • Each direct subdirectory is one named extension point.
  • Python files inside an extension point are loaded in deterministic filename order.
  • Implicit @extensible hook implementations use _functions/<module>/<qualname>/<start|end>/ layout when present.

Local Contracts

  • Extension functions must match the arguments supplied by their hook point.
  • Preserve numeric prefixes when ordering affects prompt construction, stream masking, persistence, or cleanup.
  • Use AgentContext from agent when context access is needed.
  • Do not log unmasked secrets, raw hidden prompt sections, or private user data.

Work Guidance

  • Keep extension modules import-light; many hooks run during hot paths.
  • Use mutable ctx or data dictionaries according to the hook contract when rewriting content.
  • Add or update tests when a hook changes prompt content, message history, tool output, streaming, or persistence behavior.

Verification

  • Run targeted tests for the affected lifecycle area.
  • Run a startup smoke check for agent_init, startup_migration, or system_prompt changes when practical.

Child DOX Index

No child DOX files.