Dynamic Code Generation Skills
Dynamic Code Generation Skills are the family used when the system must retain more local flexibility than a stable Code Skill can offer, while still allowing computation to become executable code when a textual answer would be less reliable.
Ephemeral Computation Under a Skill Contract
Some requests are too transient, too open-ended, or too context-dependent to justify a stable specification-driven module under src/. In such cases, the problem is not long-term maintainability of one fixed capability, but proportionality of effort. A useful subsystem should be able to answer directly when that is sufficient, yet still shift into executable computation when a precise local procedure is safer than free-form text.
Dynamic Code Generation Skills address this need by combining a light descriptor contract with a runtime that can choose between direct textual output and temporary JavaScript execution. In this family, the skill remains bounded by its descriptor and by the subsystem’s execution path, but the local computational form is intentionally less fixed than in Code Skills. The result is a more flexible regime for short-lived or situational logic.
This makes Dynamic Code Generation Skills appropriate when the capability should remain adaptive rather than crystallized into a maintained module family. They are still discovered, registered, and routed through the same top-level agent, but they preserve more room for local synthesis at execution time.
How the Subsystem Works in Practice
A skill of this family is discovered through dcgskill.md. During preparation, the subsystem reads the descriptor, records the prompt guidance, normalizes the declared LLM mode, and prepares one dynamic executor. That executor always follows the same decision contract at runtime: ask the LLM for a structured text versus code response, then either return text directly or execute the returned JavaScript snippet.
Nothing in this family resembles the Code Skills generation pipeline. There is no automatic derivation into src/ and no module entrypoint loaded from the skill folder. The subsystem remains descriptor-driven and request-local: each execution either returns direct text or runs temporary code produced for that request. The exact execution rules are described in Runtime.
src/ pipeline of Code Skills.Dynamic Code Generation Skills do not use the src/ entrypoint contract of Code Skills and do not load local executable modules from the skill directory. Runtime behavior is driven by descriptor guidance plus the text/code decision response.