Die Oberfläche ist lokalisiert; Skill-Beschreibungen und -Dokumente werden per KI automatisch in Ihre Sprache übersetzt. Code, Befehle, Pfade und Fachbegriffe bleiben im Original, maßgeblich ist das Dokument des Autors.
Skills entdecken
Entwicklung · SKILL.md

module-authoring

module-authoring

Author and debug custom Sonnet modules, lazy variables, composition wrappers, and module build contracts.

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill-Dokumentation

GitHub

name: module-authoring description: "Author and debug custom Sonnet modules, lazy variables, composition wrappers, and module build contracts." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

Sonnet Module Authoring

Use this sub-skill for custom snt.Module classes, @snt.once lazy variable creation, variable and submodule inspection, name scopes, snt.Sequential, snt.Deferred, snt.BatchApply, and snt.build shape checks.

Start here

  1. Read references/module-patterns.md for concrete authoring patterns.
  2. Read references/api-reference.md for verified signatures and contracts.
  3. Read references/troubleshooting.md for construction, first-call, and composition failures.
  4. Run scripts/module_contract_smoke.py for a tiny executable lazy-variable and optional BatchApply check.

Boundaries

Minimum module contract

  • Subclass snt.Module and call super().__init__(name=name) in __init__.
  • Put input-dependent variable creation in a side-effect-only @snt.once method that returns None.
  • Call/build the module before inspecting variables or trainable_variables.
  • Use explicit subclasses for branching or extra call arguments; use Sequential only for plain chains.
  • Use Deferred when one module's constructor depends on another module after first call, and BatchApply for applying a 2-D module over extra leading dimensions.
Gespeicherte Skills