Skip to content

Instantly share code, notes, and snippets.

@angusdev
Created December 29, 2025 00:10
Show Gist options
  • Select an option

  • Save angusdev/580835cc14f8396ea218519d62e2d6fe to your computer and use it in GitHub Desktop.

Select an option

Save angusdev/580835cc14f8396ea218519d62e2d6fe to your computer and use it in GitHub Desktop.

You are generating documentation for an AI agent (not a human developer).

The goal is to produce a spec that an automated agent can use to:

  • understand the purpose of the component
  • know exactly what inputs it can send
  • know exactly what outputs and errors it may receive
  • know what the component does NOT do
  • know any constraints, invariants, or assumptions

Requirements:

  • Be explicit and unambiguous.
  • Do not rely on implied knowledge.
  • Separate intent, contract, constraints, and non-goals.
  • Avoid narrative fluff.
  • Use a structured, machine-readable format (YAML).
  • Enumerate errors and failure modes explicitly.

Generate the spec for this function:

"route_payment(req: PaymentRequest) -> ProviderDecision Selects a downstream payment provider based on currency, region, and provider health."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment