Reference Artifact as Spec
Every sentence you write to describe what you want leaves room for interpretation. So point at an artifact that already exists and state only the delta. ⚠ Where a primary source names a reference target, it is an existing implementation inside your own codebase — the sources do not reach external artifacts (sources in the practice section).
Problem
You write "add a calendar widget." As a sentence it is complete. From the receiving end, a great deal is still undecided — how the month gets picked, whether paging across years exists, whether it should be assembled the way the rest of the screen is, whether a new library may be introduced.
So you add more. Paragraphs accumulate. It still is not enough. Constructing a spec out of prose has the property that the more you write, the more unwritten premises come into view. The conventions an existing screen is built on cannot be conveyed without writing all of them down, and writing all of them down usually costs more than the implementation.
The unfilled parts do not stay empty, either. The agent fills them from its own defaults. You look at what comes back, notice it is not what you meant, and correct it — in prose again. Each round trip surfaces another gap between the spec you constructed in words and the artifact you had in mind.
And sometimes the artifact you had in mind already exists somewhere. A similar screen lives in the same repository. The style you want to follow sits in another file. In that case prose is not conveying information; it is losing it. The artifact carries every convention. Transcribing it into words drops them.
Context
Apply when:
- Something similar already exists — an implementation in the same repository, a procedure you got right before, a style you want followed. This condition is the pattern's premise
- Writing it out in prose gets long — formatting, naming, structure, dependency conventions, and other premises that were never written down
- The differences reduce to a few points — you can say "like this, except here"
Do not apply when:
- There is no artifact to point at. If what you are building resembles nothing at hand, this pattern has nothing to work with
- The reference is a bad example. Its conventions come along with it, so pointing at the thing you want fixed will not fix it
- The delta is bigger than the body. "Like this, except almost all of it" is not a reference
Boundaries with adjacent patterns:
- Making the Output Contract Explicit — that pattern contracts the shape of the output (length, structure, manner) in words. This one replaces words with an artifact where constructing in prose is expensive. The direction is inverted, and the two are a pair — when there is nothing to point at, contract in words; when there is, point
- Referent Before Label — that pattern settles what a word the agent produces refers to. This one settles what an instruction a person gives refers to, using an artifact instead of prose. Both fix the referent first; the directions are opposite (output side versus input side)
- Preemptive Plan Review — that pattern has the agent state what it will do before it edits. This one, a step earlier, supplies what it should resemble. With the reference fixed, the plan is read mainly for the delta
- Diff Review and Incremental Adoption — that pattern receives what comes out as a diff. This one states what goes in as a diff. The same unit, placed at the exit or at the entrance
- Designing for Portable Procedures — once you point at the same thing every time, it is no longer an artifact to reference but a procedure to extract. Hand it over to that pattern
Solution
Recast the instruction from "constructed in prose" to "artifact plus delta."
Three steps.
- Fix on one reference. "Match the existing ones" is not pointing. Name which one. If several, separate what each contributes
- Leave the inherited part unstated. The conventions the reference carries — structure, naming, the range of dependencies — are not transcribed. Transcribing them drops whatever you fail to transcribe
- State only the delta. What differs, and how far it may be changed. This part, and only this part, is written in prose
Why it works. A prose description underdetermines the spec — a finite number of sentences cannot settle an unbounded number of details, so unfilled parts always remain. An artifact that exists, by contrast, is already fully determined. Pointing at it hands over a settled spec wholesale, and the only indeterminacy left is what you stated as the delta. The amount you write scales not with the size of the spec but with the size of the difference.
An Anthropic primary source normalizes exactly this contrast as a Before / After pair: the "before" states the goal in a single phrase, the "after" names an existing implementation and then states the delta (Official; sources in the practice section). The same vendor states the reason for handing over an artifact — when a description in words would be unclear or cumbersome (Official, same).
⚠ This is not few-shot prompting. Input/output pairs demonstrate a desired behavior by example. What this pattern hands over is a reference to the desired artifact itself. The primary sources keep the two as separate items (sources in the practice section).
⚠ Do not run "recreate this" and "change only this" together. The grounds for handing over an artifact cover both, but only the Anthropic side normalizes the delta form within what we checked (same).
Trade-offs
- The reference's quality becomes the result's quality. Point at an implementation written badly and the bad style is inherited. Never make the thing you want fixed the reference — the unfixed version is handed over as the answer
- References go stale. If the artifact you point at rests on old conventions, what gets built inherits them. A reference is something to re-question each time you point at it
- Because what travels is implicit, no one can see what travelled. The inherited conventions cannot be enumerated. Properties you never intended can come along, and you find out by looking at the output
- Reading the reference costs context. The agent has to read what you pointed at, and the larger the reference the higher that cost. Sometimes prose is cheaper — when the delta is small and the reference is enormous. That judgment has the same shape as The Break-Even Point of Delegation
- It does not fit spoken instruction. Pointing requires the reference to be at hand in a pointable form — a filename, a URL, an image
GitHub Copilot in Practice
⚠ What follows differs by surface (VS Code / github.com / Copilot CLI / cloud agent).
GitHub — handing over examples of similar work
On the github.com surface, as guidance for what to put in a Copilot Space (source: Speed up development work, retrieved 2026-08-01) Official:
Provide examples of how similar tasks have been handled in the codebase.
⚠ This is an illustration of what the Spaces feature is for, not a norm about how to phrase instructions. Neither the Before / After contrast this pattern describes nor any "state only the delta" norm was found on the GitHub side (Absence Confirmed; checked prompt engineering, get-started best practices, the cloud agent's get-the-best-results, and the refactor-design-patterns cookbook, all retrieved 2026-08-01; search terms: mockup / screenshot / visual / reference / existing / similar to / example of the output / mock / design / URL).
⚠ The cloud agent surface points the other way. What its guidance asks for is a clear description of the problem, complete acceptance criteria, and directions about which files to change. "Both vendors say the same thing" is not writable here.
Anthropic — naming an existing implementation and stating the delta
Source: Claude Code best practices, retrieved 2026-08-01 Official. The page presents instruction-writing as a Before / After table; this is the heading of the row:
Reference existing patterns
The "after" instruction names an existing family of widgets and one example of it, then states the delta:
follow the pattern to implement a new calendar widget
⚠ What is named as the reference is an existing implementation inside the user's own codebase. It is not about pointing at external sites, products, or videos.
The same vendor states the reason for handing over an artifact, in the section on images (source: Common workflows, retrieved 2026-08-01) Official:
Use images when text descriptions would be unclear or cumbersome
⚠ The examples in that same section are recreation — generate CSS to match a design mockup, ask what HTML structure would recreate a component. That grounds handing over an artifact, but not changing only a delta from it.
⚠ Few-shot is a separate item. "Give examples" in GitHub's prompt engineering documentation means example inputs and outputs, and Anthropic's multishot prompting likewise covers input/output pairs. On the Anthropic side, "Reference existing patterns" is placed as a distinct item from those.
Also Known As
| Name | Provenance |
|---|---|
| Reference Artifact as Spec | Descriptive — this catalog's descriptive name; no primary source uses it |
| "References" | The material's word for the thing handed over, not for the pattern |
| "Reference existing patterns" | A row heading in an Anthropic table, not a circulating term |
⚠ Few-shot / multishot prompting is not an alias for this pattern. It names a different type: supplying input/output pairs.
Related
Work in progress
This catalog is published incrementally. Items without links have not landed yet.
- Making the Output Contract Explicit — contracts the shape of output in words; the paired opposite of this pattern
- Referent Before Label — also fixes the referent first, in the opposite direction (output side rather than input side)
- Preemptive Plan Review — with the reference fixed, the plan is read mainly for the delta
- Diff Review and Incremental Adoption — the diff unit placed at the exit; this pattern places it at the entrance
- Designing for Portable Procedures — once you point at the same thing every time, extract it as a procedure
- The Break-Even Point of Delegation — whether reading the reference or writing the prose is cheaper is the same judgment
- Taking Inventory of Resident Context — make the agent read a reference every time and it has become resident context