Engineering Better Prompts for AI Assisted Development
Presented By Jeremy Curcio
About Me
Jeremy Curcio
Integration Engineer
Fearless - Login.gov
Baltimore, Maryland
Prior Speaking Engagements
Baltimore PHP • OpenWest
B’More on Rails • DC PHP
Languages & Platforms
Ruby • PHP • JavaScript • Swift • iOS/macOS
Gamer
Rubyist
Preferred AI - Claude
About Me
Jeremy Curcio
Integration Engineer
Fearless - Login.gov
Baltimore, Maryland
Prior Speaking Engagements
Baltimore PHP • OpenWest
B’More on Rails • DC PHP
Languages & Platforms
Ruby • PHP • JavaScript • Swift • iOS/macOS
Gamer
Rubyist
Preferred AI - Claude
About Me
Jeremy Curcio
Integration Engineer
Fearless - Login.gov
Baltimore, Maryland
Prior Speaking Engagements
Baltimore PHP • OpenWest
B’More on Rails • DC PHP
Languages & Platforms
Ruby • PHP • JavaScript • Swift • iOS/macOS
Gamer
Rubyist
Preferred AI - Claude
About Me
Jeremy Curcio
Integration Engineer
Fearless - Login.gov
Baltimore, Maryland
Javascript Bingo�
Has run a marathon
Knows the Konami code
Can name 5 DC sports teams
Been on TV
Pushed code to production today
Anatomy of a Good Prompt
Role
Who the AI should act as
"You are a senior software engineer"
Task
What should the AI do
"Create a database table schema..."
Tone
How should the output sound
"Be clear and concise"
Topic
What is the content about
"Used to create product recommendations"
Details
Specific requirements
"Our database is Postgres 18.1"
Format
Output structure
"Show schema in a table..."
Why Does This Matter?
The output is wildly inconsistent
Sometimes thoughtful and idiomatic. Other times technically correct but awkward, unmaintainable, or misaligned with intent.
This inconsistency isn't random
It's driven by how we frame problems and communicate expectations to the model.
You already have this skill
Clear communication: Writing expressive code, crafting commit messages, giving constructive feedback in code review.
Anatomy of a Bad Prompt
Not Being Concise
Don't ramble on. Just include the information the AI needs to know to generate the output.
It doesn't have feelings... yet. 🤖
Missing Context
Asking to fix a bug, without including details such as possible causes, where in the application it is occurring, and potential relevant code.
Passive Voice
Being passive gives the AI room to meander. Active voice gives clearer direction to the end goal.
How to Build A Prompt Think DEEPER
D
Define your goal
Be as specific as possible about what you want.
E
Explain the context
Languages, tools, purpose — narrow the output.
E
Establish a persona
Who should the AI act as?
P
Provide examples
Include similar content or code to guide output.
E
Enable questions
Let the AI ask for clarification first.
R
Refine and iterate
Tweak and expand based on the response.
A structured approach turns vague requests into precise, actionable prompts.
From Bad Prompt to Good
Each level adds more context, specificity, and structure
★☆☆☆☆
Add user registration.
★★☆☆☆
Add user registration to a Ruby application, require an email, display name, and password.
★★★☆☆
...include a registration and sign in view. Store credentials in the database.
★★★★☆
...use the Devise gem. Ensure views are generated. Include tests for registration and sign in.
★★★★★
As a Senior Rails Engineer... use Devise... include tests... ask for clarification if needed.
But is the 5-star version actually the best approach? What's wrong with it?
The Full 5-Star Prompt
Is this too much?
As a Senior Ruby on Rails Engineer, add user registration to this Ruby application. Require an email, display name, and password. Include a registration and sign in view. Store credentials in the database. Use the Devise gem. Ensure views are generated. Include tests for registration and sign in. Ask for clarification as needed.
At some point, I’m just rambling.
So what can be done to make this prompt better?
Iterative Prompting
That was a lot for a single prompt. Break it apart into focused steps.
1
I want you to, as a Senior Ruby on Rails Engineer, add user registration to this application. The user will need to log in to access some areas. I will provide follow up prompts with more details. Stop and ask for clarification if you have any questions.
2
Use the Devise gem to add user registration. When a new user registers require an email, display name, and password.
3
Ensure the registration and sign in views are properly generated and match the theming of the rest of the application.
4
Include tests to verify users are able to register and sign in, including tests that all fields are required.
Each follow-up builds on the previous response — giving you more control and better results.
How Can We Make This Easier?
AGENTS.md
A markdown file with specific instructions for your agent to follow. Use them both globally and at the project level.
AI Skills
AI skills are reusable instruction sets that teach an agent how to perform a specific task well. They act as pre-built expertise the agent can reference on demand, so you don't have to re-explain the same process every time.
Think of them as playbooks: you write the best approach once, and the agent follows it consistently across projects.
Using AGENTS.md
Global
~/.config/agents/AGENTS.md
Instructions that always apply, regardless of project.
Project
/path/to/project/AGENTS.md
Instructions specific to a single project.
Global AGENTS.md
Instructions that always apply, regardless of project.
Guardrails
What is the agent not allowed to do? What files can it never read, modify, or delete?
Testing Expectations
What types of tests should be written? How detailed should test cases be?
Communication Preferences
When should the agent stop and ask? How verbose should responses and explanations be?
Code Conventions
Naming conventions, preferred patterns, and specific anti-patterns to avoid.
Project AGENTS.md
Instructions specific to a single project.
Project Context
What the project does at a high level. Tech stack: language, database, frameworks, dependencies.
Directory Structure
How the project is laid out. Where do assets, tests, and configs live?
Workflow
How to build, test, and lint the application. Git conventions.
Domain Knowledge
What do common acronyms and project-specific terms mean? Known edge cases.
Non-Functional Requirements
The AI will write code that works. Your job is to make sure it writes code that's good.
Readability
Specify naming conventions, comment expectations, and how self-documenting you want the code to be.
Performance
"This runs on every request" or "This processes 10k+ records" changes the approach entirely.
Maintainability
Ask for code that follows existing patterns. Reference specific files or modules as examples.
Idiomacy
"Write this the way a senior Ruby developer would" produces very different output than "write this in Ruby."
Without these, the AI optimizes for "technically correct", the lowest bar you can set.
Failure Modes
AI tools fail in predictable ways. Learn to spot them.
Overconfidence
The AI will present hallucinated methods, gems, or APIs with complete certainty. If you don't recognize it, verify it.
Hallucinated Architecture
Ask for too much at once and the AI will invent abstractions, services, or patterns your project doesn't use.
Style Drift
Over a long conversation the AI loses context and drifts from your conventions. Watch for it.
Plausible but Wrong
The code runs, the tests pass, but the logic is subtly incorrect. AI is great at looking right.
Know when to bail. If you've spent more time correcting the AI than writing it yourself, close the chat.
Evaluating AI Output
You are the Human-In-The-Loop. Treat AI-generated code with the same rigor you'd apply in code review.
Read it first
Don't copy-paste blindly. Read every line like you're reviewing a junior developer's PR.
Run the tests
Do the tests actually test meaningful behavior, or just assert that the code does what it does?
Check for hallucinations
Do the methods, gems, and APIs it referenced actually exist?
Look for shortcuts
Did it skip error handling, validation, or edge cases you'd flag in review?
Does it match the codebase?
Correct code in the wrong style is still a problem.
Practical Applications
Where prompt engineering pays off in day-to-day development.
Debugging Flaky Specs
Paste the test, the failure output, and the relevant code. Ask the AI to identify the race condition or timing issue — not just fix the test.
Generating Boilerplate
Migrations, serializers, form objects, API clients. Give it one example from your project and ask it to follow the pattern.
Understanding Unfamiliar Code
Paste a method or module and ask "What does this do, step by step?" Great for onboarding onto a new codebase.
Refactoring
"Refactor this to use X pattern" with a concrete before/after example produces better results than "make this cleaner."
Amplify, Don't Replace
AI is a tool, not a teammate. It doesn't understand your system, your users, or your deadlines.
The best results come from developers who already know what good code looks like and use AI to get there faster.
Prompt engineering is a skill. Like testing, debugging, or code review. It gets better with deliberate practice.
Turn AI from an unreliable assistant into a productive partner in everyday development.
Questions?
Thank You!
Slides Available
https://jcurcioconsulting.com/posts/llmday-nyc-engineering-better-prompts-for-ai-assisted-development
Actually, here is a QR code!