📝 Effective AI Agent Prompts
Now that you understand how AI agents work, let's learn to write prompts that get you exactly what you need for your Web Dev II projects. Each example shows how to provide context and be specific about your goals.
⚙️ Configuration + Prompts = Maximum Effectiveness
These prompt examples work even better when you've set up Agent Configuration files. With configuration, you can skip repeating basic context (like "HTML/CSS only") and focus on your specific request. If you haven't set up configuration yet, include the essential context shown in each example.
💡 Remember: Context + Specificity = Better Results
Every effective prompt should include: your skill level, what you want to achieve, your constraints (HTML/CSS only), and how it fits your project.
🏗️ Layout and Structure Prompts
Use these patterns when you need help with CSS Grid, Flexbox, and responsive layouts for your portfolio projects.
Context Checklist for Layout Prompts
- ✅ Mention your current HTML structure
- ✅ Specify responsive breakpoints you need
- ✅ Include accessibility requirements
- ✅ Reference existing CSS that should be preserved
❌ Instead of: "Make my site better"
"Make my site better"
✅ Try this with context:
"Add CSS Grid to my portfolio section with hover effects and ensure it's responsive on mobile. I have 6 portfolio projects in my HTML as article elements with class 'project-card'. I need 3 columns on desktop, 2 on tablet, and 1 on mobile with 20px gaps."
❌ Instead of: "Create a layout"
"Create a layout"
✅ Try this with context:
"Design a three-column responsive layout using CSS Grid for my About Me page. I have header, main, and aside elements in my HTML. The layout should stack to single-column on mobile while keeping my existing typography styles from styles.css."
❌ Instead of: "Make it responsive"
"Make it responsive"
✅ Try this with context:
"Implement mobile-first responsive design for my photo gallery in gallery.html. I'm using CSS Grid with .gallery-item divs. I need 1 column on mobile (320px+), 2 on tablet (768px+), and 3 on desktop (1024px+) with consistent 16px gaps."
🎯 Pro Tip: Reference Your Files
Always mention specific files, classes, or elements you're working with. This helps the agent understand your existing code structure and provide suggestions that fit seamlessly.
♿ Accessibility and Semantic HTML Prompts
Web Dev II emphasizes accessibility. Use these prompts to ensure your projects work for all users.
Context Checklist for Accessibility Prompts
- ✅ Specify what assistive technologies you're targeting
- ✅ Mention existing accessibility features to preserve
- ✅ Include WCAG level you need to meet (usually AA)
- ✅ Reference specific form elements or interactive components
❌ Instead of: "Fix my code"
"Fix my code"
✅ Try this with context:
"Review my contact form in contact.html for accessibility issues and suggest semantic improvements. I need to meet WCAG AA standards and ensure the form works with screen readers. The form has name, email, and message fields."
❌ Instead of: "Make it accessible"
"Make it accessible"
✅ Try this with context:
"Add proper ARIA labels, skip links, and semantic HTML elements to my portfolio homepage. I need screen reader compatibility for my navigation menu and project showcase section. My current navigation uses ul/li elements."
❌ Instead of: "Use better HTML"
"Use better HTML"
✅ Try this with context:
"Replace the divs in my About Me page with semantic HTML5 elements like article, section, aside, and nav. I have content sections for bio, hobbies, and contact info that should use proper semantic structure for SEO and screen readers."
🎨 Styling and Visual Design Prompts
Create cohesive, professional designs with these context-rich prompting strategies.
Context Checklist for Styling Prompts
- ✅ Share your color palette or brand preferences
- ✅ Mention existing CSS custom properties
- ✅ Specify design style (minimalist, vibrant, professional, etc.)
- ✅ Include typography requirements
❌ Instead of: "Make it look good"
"Make it look good"
✅ Try this with context:
"Create a cohesive color scheme using CSS custom properties with a professional blue palette (#2c3e50, #3498db). Ensure 4.5:1 contrast ratio for WCAG AA compliance and add subtle shadows for depth. I want a clean, modern look for my portfolio."
❌ Instead of: "Add animations"
"Add animations"
✅ Try this with context:
"Implement CSS keyframe animations for my portfolio cards in index.html that fade in on page load with a stagger effect. Add hover transitions that scale (1.05x) and add a subtle glow. Keep animations under 0.3s for good UX."
❌ Instead of: "Improve typography"
"Improve typography"
✅ Try this with context:
"Establish a typographic hierarchy using system fonts with fluid typography (clamp values) for my headings. I need h1-h3 scaling from 1.2rem to 3rem, optimal line-height ratios (1.4 for body, 1.2 for headings), and consistent spacing scales using CSS custom properties."
⚡ Interactive Elements Prompts
Create engaging CSS-only interactions without JavaScript. Perfect for Web Dev II requirements!
Context Checklist for Interactive Prompts
- ✅ Specify CSS-only requirement (no JavaScript)
- ✅ Mention existing hover states to build upon
- ✅ Include keyboard accessibility needs
- ✅ Reference specific elements that need interactivity
❌ Instead of: "Add interactivity"
"Add interactivity"
✅ Try this with context:
"Create CSS-only image hover effects for my portfolio gallery thumbnails in gallery.html. Each .gallery-item should show overlay text with project title, scale transform (1.1x), and smooth transitions (0.3s). Ensure keyboard focus works for accessibility."
❌ Instead of: "Make a dropdown"
"Make a dropdown"
✅ Try this with context:
"Build a CSS-only dropdown navigation menu using :hover and :focus selectors for my header nav. I need smooth height transitions and keyboard accessibility. My current nav structure uses ul/li elements with .nav-item classes."
❌ Instead of: "Add modal"
"Add modal"
✅ Try this with context:
"Create a CSS-only modal popup using :target selector for project details. I need backdrop blur, scale animation entrance, and proper focus management for accessibility. Each portfolio item should link to its modal section."
🔧 Performance and Organization Prompts
Build maintainable, professional codebases with these organizational and optimization strategies.
Context Checklist for Organization Prompts
- ✅ Describe your current file structure
- ✅ Mention existing CSS organization patterns
- ✅ Specify naming conventions you prefer
- ✅ Include performance goals or constraints
❌ Instead of: "Optimize my CSS"
"Optimize my CSS"
✅ Try this with context:
"Reorganize my styles.css file using logical sections (reset, typography, layout, components, utilities), CSS custom properties for consistent values, and mobile-first media queries. I have about 300 lines currently with no clear organization."
❌ Instead of: "Make it faster"
"Make it faster"
✅ Try this with context:
"Optimize my portfolio site for web delivery: implement CSS containment for my gallery section, reduce layout shifts in the hero area, and add preload hints for critical CSS and fonts. Currently loading at 3.2s on 3G."
❌ Instead of: "Clean up code"
"Clean up code"
✅ Try this with context:
"Refactor my CSS using BEM naming methodology for my portfolio components, group related properties logically, remove unused styles (I have duplicate margin declarations), and add documentation comments for each major section."
💼 Portfolio-Specific Prompts
These prompts are tailored specifically for the portfolio projects typical in Web Dev II courses.
Context Checklist for Portfolio Prompts
- ✅ Mention your target audience (employers, clients, etc.)
- ✅ Specify your personal brand or style goals
- ✅ Include the types of projects you want to showcase
- ✅ Reference any existing portfolio content
❌ Instead of: "Create a portfolio"
"Create a portfolio"
✅ Try this with context:
"Build a responsive portfolio homepage targeting entry-level web developer positions. I need a hero section with my photo, skills grid showcasing HTML/CSS/Git, project showcase using CSS Grid, contact form, and smooth scroll navigation. Professional but creative style."
❌ Instead of: "Show my projects"
"Show my projects"
✅ Try this with context:
"Design a project showcase for my 4 Web Dev I projects (About Me, Gallery, Business Site, Contact Form). Use CSS Grid with filter buttons that show/hide projects using :target selectors and smooth transitions. Each project needs title, description, tech used, and GitHub link."
🎯 Portfolio Success Tip
Always mention your career goals and target audience in portfolio prompts. This helps the agent suggest designs and content that will actually help you get hired!
🔍 Debugging and Problem-Solving Prompts
When things aren't working as expected, use these diagnostic prompting strategies.
Context Checklist for Debugging Prompts
- ✅ Describe the specific problem you're seeing
- ✅ Mention what you expected to happen
- ✅ Include browser/device where problem occurs
- ✅ Reference relevant CSS and HTML sections
❌ Instead of: "This doesn't work"
"This doesn't work"
✅ Try this with context:
"My CSS Grid layout breaks on mobile - the portfolio items are overlapping instead of stacking in a single column. Help me debug the grid-template-columns in my .portfolio-grid class. Expected: 1 column on mobile, seeing: items crowded horizontally."
❌ Instead of: "Fix the spacing"
"Fix the spacing"
✅ Try this with context:
"The vertical rhythm is inconsistent between my h2 headings and paragraphs in the About section. Help me establish a baseline grid using margin and line-height values. Currently using random margin values (10px, 15px, 20px) with no pattern."
❌ Instead of: "Colors look wrong"
"Colors look wrong"
✅ Try this with context:
"My color contrast is failing WCAG tests - WebAIM shows 3.1:1 ratio for my blue text (#3498db) on white background. Help me adjust these blue tones to meet AA standards (4.5:1) while maintaining my brand consistency and professional appearance."
🚀 Putting It All Together
Ready to practice? Here's how to build effective prompts using everything you've learned:
The Perfect Prompt Formula
📝 Prompt Template
Context: "I'm a Web Dev II student with [skill level]. I'm working on [project type]."
Goal: "I want to [specific outcome] for [specific element/section]."
Constraints: "I can only use HTML/CSS, need [accessibility/responsive requirements]."
Context: "My current code has [existing structure/classes/files]."
Specifics: "The result should [visual/functional requirements]."
Your Next Steps
- Practice with one category: Pick layout, accessibility, or styling prompts to start
- Use your real project: Apply these patterns to your actual Web Dev II work
- Build context files: Ready to learn about agent memory and documentation?
- Share and learn: Discuss your prompt experiences with classmates
🎯 Challenge: Write Your First Perfect Prompt
Take something you're working on right now and write a prompt using the formula above. Include your skill level, specific goal, constraints, current code context, and desired outcome. Then try it with an AI agent!