Chat on WhatsApp

What is an "output contract" in a prompt?

The contract pins down the shape of the response so you can verify it programmatically. Example for a Magento scaffold prompt: "Output exactly these files in this order: 1) etc/module.xml, 2) etc/di.xml, 3) Api/<Entity>RepositoryInterface.php, 4) Model/<Entity>Repository.php. Each file in its own <file> block with the absolute path as the first line. No prose between files." This lets a downstream script extract files with regex and write them straight to disk — no copy-paste, no hallucinated filenames. Combine with a hook that runs php -l on each extracted PHP file as the eval loop.

Was this helpful?