Generate Function
# Prompt: Generate a Function from a Specification
> **Category:** generation
> **Difficulty:** basic
> **Works best with:** ask mode | agent mode
> **Frontier model recommended:** no
> **Verified:** 2026-04
---
## Purpose
Generate a well-structured, readable function from a plain-language description. Use when you know what a function should do but want Copilot to produce the implementation.
---
## When to Use
- You have a clear specification for a function (inputs, outputs, constraints)
- You want a first draft that you will review and refine
- You are writing boilerplate or standard utility logic
**Do not use when:** the function is part of a larger refactoring; use the refactoring prompts instead. Do not use when you need architecture guidance; use Plan mode.
---
## The Promptwhen to use it
Community prompt sourced from the open-source GitHub repo Clipperone/copilot-learning-labs (MIT). A "Generate Function" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
productivitycommunitydeveloper
source
Clipperone/copilot-learning-labs · MIT
more in Productivity
Productivity✓ tested
Summarize a doc into decisions & actions
chief of staff who extracts what to DO, not just what was said
Productivity✓ tested
Draft a reply to a hard email
calm, direct communicator who de-escalates without caving
Productivity✓ tested
Turn a brain-dump into a weekly plan
planning coach who protects your focus, not just your calendar