---
title: "Discussion on \"Generate code from the spec, not the spec from the code\" | Hashnode"
description: "Discussion on \"Generate code from the spec, not the spec from the code\". Agents guess field names when they never see the contract. Serve the spec over MCP, generate one verified vertical slice at a time, run scenarios against localhost, and rescan to catch drift."
url: "https://hashnode.com/posts/generating-code-from-the-spec-not-reverse-engineering-it/6aca0827645a621880c2b695"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Generate code from the spec, not the spec from the code](https://blogs.powerduck.com/generating-code-from-the-spec-not-reverse-engineering-it?utm_source=hashnode&utm_medium=feed)

Agents guess field names when they never see the contract. Serve the spec over MCP, generate one verified vertical slice at a time, run scenarios against localhost, and rescan to catch drift.

Oct 2 · 6 min read · blogs.powerduck.com  
Read the article

-   [#ai-agents](https://hashnode.com/tag/ai-agents)
-   [#workflow](https://hashnode.com/tag/workflow)
-   [#openapi](https://hashnode.com/tag/openapi)

## Written by

[Powerduck](https://hashnode.com/@powerduck)

@powerduck · hon

  
[View profile](https://hashnode.com/@powerduck)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
