Skip to main content
Back to Library
Prompt Engineering Guide

Mastering Poetry generation
on Claude 3.5 Sonnet

Stop guessing. See how professional prompt engineering transforms Claude 3.5 Sonnet's output for specific technical tasks.

The "Vibe" Prompt

"Write a poem about a cloudy day. Make it feel a bit melancholic but also beautiful."
Low specificity, inconsistent output

Optimized Version

STABLE
You are a highly skilled poet specialized in evocative imagery and nuanced emotional expression. Your task is to compose a 12-line poem, divided into three quatrains (four-line stanzas), about a cloudy day. The poem should convey a melancholic tone, yet simultaneously highlight the subtle beauty inherent in such a day. **Constraint Checklist:** 1. 12 lines total: Yes 2. Three quatrains: Yes 3. Melancholic tone: Yes 4. Subtle beauty: Yes 5. Cloudy day as central theme: Yes 6. Evocative imagery: Yes 7. Nuanced emotional expression: Yes **Thought Process for Poem Generation:** 1. **Deconstruct Request**: Cloudy day, melancholic, beautiful, 12 lines, quatrains. Focus on sensory details for cloudy days. 2. **Brainstorm Melancholy Imagery**: Gray skies, muted light, quietness, introspection, a sense of waiting, veiled world. 3. **Brainstorm Beauty Imagery**: Soft light, diffused colors, hidden sun, earth's embrace, gentle rain, serene moments, silver linings. 4. **Structure - Stanza 1 (Introduction/Setting the Scene):** Focus on the initial impression of the cloudy day – the gray, the quiet, the general mood. "Veiled sun," "soft gray cloak." 5. **Structure - Stanza 2 (Developing Melancholy and Internal Reflection):** Introduce the melancholic aspect more deeply, perhaps linking it to introspection or a subtle yearning. "Heavy sigh," "world slows down." 6. **Structure - Stanza 3 (Finding Beauty/Resolution):** Shift to finding the beauty within the melancholic setting. "Gentle light," "silvered edge," "quiet grace." 7. **Rhyme Scheme/Rhythm (Optional but considered):** Aim for a consistent, perhaps AABB or ABCB, to aid flow, but prioritize meaning and imagery. Let's try AABB for simplicity and gentle flow. 8. **Drafting - Stanza 1:** The sky wears robes of softest gray, The sun a ghost, held far away. A hush descends, a world subdued, In quiet, contemplative mood. 9. **Drafting - Stanza 2:** No dazzling bright, just muted light, That draws the shadows from the night. A gentle weight upon the air, A subtle whisper, always there. 10. **Drafting - Stanza 3:** Yet in this veil, a beauty lies, Reflected deep in weary eyes. A thoughtful peace, a soft embrace, The clouds impart their quiet grace. 11. **Review and Refine**: Check against constraints. Is it 12 lines, 3 quatrains? Yes. Melancholic yet beautiful? Yes. Evocative imagery? Yes. Nuanced emotion? Yes. Adjust word choices for stronger impact (e.g., 'robes of softest gray,' 'ghost, held far away'). Ensure flow. Compose the poem following these steps and constraints.
Structured, task-focused, reduced hallucinations

Engineering Rationale

The optimized prompt works by providing a highly detailed and structured set of instructions, essentially walking the model through the creative process. It establishes a clear persona ('highly skilled poet'), defines specific constraints (line count, stanza structure, tone, theme), and includes an explicit 'Constraint Checklist' for self-validation. Crucially, the 'Thought Process for Poem Generation' section acts as a chain-of-thought, guiding the model through brainstorming, structuring, drafting, and refining. This mini-plan helps the model understand the desired output's qualities and how to achieve them, significantly increasing the likelihood of a high-quality, on-topic, and well-structured poem. It reduces ambiguity and forces the model to deliberate on its choices, mimicking human creative workflow.

0%
Token Efficiency Gain
The generated poem will adhere strictly to the 12-line, three-quatrain structure.
The poem will consistently maintain both a melancholic and subtly beautiful tone.
The poem will use evocative imagery related to a cloudy day.

Ready to stop burning tokens?

Join 5,000+ developers using Prompt Optimizer to slash costs and boost LLM reliability.

Optimize My Prompts