Modular Design
Domain: Prompt Engineering
π― Motivation
Breaking prompts into reusable modules (instructions, examples, constraints) that can be mixed and matched for different tasks.
π Concrete Example
Module A: βYou are a Python tutor.β Module B: βExplain [concept].β Module C: βInclude a code example.β Module D: βMax 200 words.β For different tasks, swap modules: use Module A + B + D for a brief explanation, A + B + C + D for a full one.
π Analogy
Lego blocks - you have different pieces (modules) that snap together. A car chassis + wheels + steering wheel = a car. Swap wheels for tank treads = a tank. Modular design lets you build different prompts from reusable parts.