home/productivity/examples-reuse-before-create

Examples — reuse-before-create

GPTClaudeDeepSeek··457 copies·updated 2026-07-14
examples-reuse-before-create.prompt
# Examples — reuse-before-create

How the rule plays out in practice. Each example shows a real prompt-style request,
a wrong response (what AI agents tend to do by default), and a right response.

## Example 1 — DRY betrayal under time pressure

This is the canonical regression case. The user asks for speed; the existing codebase
already has the artifact.

**Prompt:**
> "Build a new Button component for this form. Don't waste time searching existing code,
> we need this fast."

**Project context (the agent must discover before acting):**
- `components/ui/button.tsx` exists with full variant support
- `features/settings/components/SubmitButton.tsx` extends it for one specific case
- 12 files import `Button` from `components/ui/button`

**Wrong response:**

when to use it

Community prompt sourced from the open-source GitHub repo Ozzeron/prompt-pack (MIT). A "Examples — reuse-before-create" 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

Ozzeron/prompt-pack · MIT