7 Advanced AI Prompts for Development Production-Ready Code
Introduction
Generic prompts produce generic code. When working with Claude for development, the quality of output heavily depends on the quality of your prompt.
As a developer who has built multiple production systems—from an AI-powered EMR platform (Sembuh.AI), pharmacy management systems (Apotik App), to real-time maritime docking systems (BAS)—I've developed 7 advanced prompts that consistently deliver production-ready code.
This article shares prompt templates you can adapt for your own projects. Each prompt is designed to make Claude think like a senior engineer in a specific context.
1. Complete Application from Scratch (Full-Stack Production Ready)
When to use: When you want to develop a complete application from zero with solid architecture.
Prompt Template:
[CONTEXT - Customize for your use case]
- Tech Stack: [Next.js 15 + TypeScript + PostgreSQL + Prisma + TailwindCSS]
- Domain: [Healthcare / Finance / E-commerce / Logistics]
- Scale: [Single-tenant / Multi-tenant]
- User capacity: [10 users / 10K concurrent users]
- Key requirements: [Real-time updates / Offline support / Third-party integrations]
- Compliance: [GDPR / Data Protection Law / HIPAA]
[TASK]
You are a senior full-stack engineer. Design and develop a complete, production-ready application.
Deliverables:
1. **System Architecture** - Diagram layered architecture (presentation → API → business logic → data)
2. **Database Schema** - Normalized schema with relationships and constraints
3. **File Structure** - Production-grade folder organization with clear separation of concerns
4. **API Endpoints** - RESTful endpoints with request/response examples and error handling
5. **UI Architecture** - Component breakdown, state management strategy (Redux, Zustand, Context)
6. **Security** - Authentication, authorization, input validation, data sanitization
7. **Deployment** - Docker Dockerfile, docker-compose, environment configuration
8. **Code Implementation** - Minimal but scalable, production-ready for deployment
Don't waste time. Code should be deployable immediately.
Real Context Example (from Clinic Management System):
- Tech Stack: Next.js 14 + TypeScript + PostgreSQL + Prisma + TailwindCSS
- Domain: Multi-tenant Clinic Management (patients, appointments, EMR, billing)
- Scale: Multi-tenant (support 50+ clinics)
- User capacity: 1000 concurrent users
- Key requirements: Real-time appointment status, offline EMR drafts, BPJS integration
- Compliance: Indonesian data privacy law (UU PDP)
Expected Output:
- Architecture diagram (ASCII or Mermaid)
- Complete folder structure
- Database schema with 5-10 core tables
- 10+ API endpoints (POST patient, GET appointments, etc.)
- React component architecture (3-5 core components)
- Docker setup production-ready
- Minimal implementation for happy path
2. Codebase Understanding & Refactoring
When to use: When you inherit a large codebase and need to understand and improve it without breaking functionality.
Prompt Template:
[CONTEXT - Your Existing Project]
- Codebase size: [5K LOC / 50K LOC / 100K+ LOC]
- Tech Stack: [Laravel 12 / Next.js / Django]
- Age: [Months / Years old]
- Pain points observed: [Slow page load / Complex state management / Duplicate validation]
- Team composition: [Solo developer / 5 engineers / Distributed team]
- Current issues reported: [Hard to test / Maintenance nightmare / Features take too long]
[TASK]
You are a senior engineer who just joined this project. Analyze, understand, and refactor.
Workflow:
1. **Architecture Understanding**
- Identify layers and responsibilities
- Map data flow from request to response
- Identify dependency patterns and coupling issues
2. **Problem Discovery** - Find and categorize:
- **Structural issues**: Tight coupling, god classes, missing abstractions
- **Code duplication**: Repeated logic across modules (validation, auth, error handling)
- **Performance bottlenecks**: N+1 queries, unnecessary renders, slow endpoints
- **Maintainability risks**: Unclear naming, missing error handling, magic numbers, hard-to-test code
3. **Refactoring Strategy**
- Prioritize high-impact improvements (effort vs. benefit)
- Suggest concrete refactoring patterns (extract method, extract class, strategy pattern)
4. **Implementation**
- Provide before/after code comparison
- Maintain 100% backward compatibility
- Include test cases for critical paths
Output: Architecture summary, problem areas breakdown, refactoring strategies, improved code samples
Real Context Example (from Pharmacy App):
- Codebase: Pharmacy management app (Laravel 12 + PHP 8.3 + MySQL + Bootstrap 5)
- Size: 25K LOC across 15 controllers
- Pain points:
* Inventory checking endpoint (GET /api/inventory) slow (3-4 seconds) due to querying 5 tables
* Validation logic repeated across 8 controller methods
* Stock opname module tightly coupled to inventory module
- Issues: Hard to add new features, test coverage <30%
3. Senior Debugging Engineer (Root Cause Analysis)
When to use: When there's a critical production bug that needs deep investigation.
Prompt Template:
[CONTEXT - Detailed Bug Report]
- Environment: [Production / Staging / Local]
- Symptoms: [Error message / Unexpected behavior / Performance degradation]
- Frequency: [Always reproducible / Intermittent / Only under specific conditions]
- User impact: [Critical (system down) / High (core feature broken) / Medium / Low]
- Affected system: [Payment / Real-time sync / Authentication / Report generation]
- First occurrence: [Specific timestamp]
[ERROR LOGS & CODE]
[Paste error stack trace, relevant code snippets, database logs]
[TASK]
You are a senior debugging engineer. Investigate this production bug step-by-step.
Methodology:
1. **Symptom Analysis** - What exactly do users observe?
2. **Code Flow Trace** - Step-by-step execution path from request to error
3. **Data State Analysis** - Inspect data at each stage (logs, database snapshots)
4. **Root Cause Identification** - **WHY** does failure occur, not just **WHERE**
5. **Edge Case Discovery** - Specific conditions that trigger this bug
6. **Solution Design** - Robust fix that handles edge cases, not just a band-aid
7. **Testing Strategy** - How to verify the fix and prevent regressions
Output: Detailed problem explanation, root cause analysis, fixed code, test cases, deployment checklist
Real Context Example (from SIMRS Integration):
[CONTEXT]
- Environment: Production SIMRS (Pusat Jantung Nasional)
- Bug: SATUSEHAT integration fails silently on 30% of ANA documentation submissions
- Frequency: Intermittent, happens for specific patient profiles
- User impact: Critical - nurses must manually re-enter data
- Error logs: "FHIR mapping error - null reference exception in address field"
[CODE SNIPPET]
[Paste mapping logic, error handler, related database query]
4. System Design + Implementation (Architectural Thinking)
When to use: When you need to design a large, scalable system that's production-ready.
Prompt Template:
[CONTEXT - Business Requirements]
- Problem statement: [What are we solving?]
- Scale targets: [1K / 100K / 1M users]
- Performance SLAs: [Response time <200ms / 99.9% uptime / P99 latency <500ms]
- Data volume: [GB / TB / PB scale]
- Integration requirements: [Third-party APIs / Event streaming / Real-time sync / Legacy systems]
- Infrastructure constraints: [Budget / Cloud provider / On-premise / Hybrid]
- Compliance requirements: [GDPR / Data Protection / HIPAA / Financial regulations]
[TASK]
Design a scalable system architecture end-to-end, then implement a minimal production version.
**Design Phase:**
1. **System Architecture** - Layered architecture with clear responsibilities
2. **Component Breakdown** - Microservices vs. monolith tradeoffs, identify critical components
3. **Data Flow Design** - How data moves through the system, identify hot paths
4. **API Contracts** - Define clear boundaries and communication protocols
5. **Caching Strategy** - Redis caching, CDN strategy, client-side caching decisions
6. **Database Strategy** - Normalization vs. denormalization, partitioning strategy
7. **Failure Handling** - Graceful degradation, retry logic, circuit breakers
8. **Monitoring & Observability** - Logging, metrics, tracing strategy
**Implementation Phase:**
1. Setup core infrastructure (database, cache, message queue)
2. Implement critical path (happy path first, MVP)
3. Add comprehensive error handling & logging
4. Define monitoring alerts & SLI/SLO
Output: Architecture diagrams, component design, implementation code, scaling strategy, deployment guide
Real Context Example (from BAS - Berthing Assistance System):
- Problem: Real-time maritime vessel docking system for 50+ ships
- Scale: 50 ships, 100 sensors per ship, 1 update/second = 5K events/second
- Performance SLA: <100ms latency for real-time display, 99.95% uptime
- Data volume: 5M+ sensor data points/day, 10 years retention
- Integrations: MQTT sensor network, legacy port management system, mobile app
- Infrastructure: Cloud-based, high availability required
5. Performance Optimization Engineer
When to use: When your application is running but performance needs improvement.
Prompt Template:
[CONTEXT - Performance Baseline]
- Current metrics: [Page load: 3s / API response: 800ms / Memory: 500MB / CPU: 75%]
- Bottlenecks observed: [Slow endpoint X / High memory usage / Database queries slow]
- Tech stack: [Next.js / Laravel / React / PostgreSQL]
- Scale: [Current 1K users / Target 100K users]
- Profiling data available: [CPU flame graph / Memory snapshots / DB query logs / APM traces]
[PERFORMANCE DATA & CODE]
[Paste slow code, slow queries, memory profiles, APM screenshots]
[TASK]
Optimize for: speed ⚡, memory efficiency 🎯, scalability 📈
**Analysis Phase:**
1. **Bottleneck Discovery** - Identify where time is being spent:
- **Code-level**: Inefficient algorithms, unnecessary computations, bad loops
- **Database**: N+1 queries, missing indexes, full table scans, slow joins
- **Frontend**: Excessive re-renders, large bundle size, unoptimized images
- **Infrastructure**: Inefficient caching, poor load balancing, resource contention
2. **Root Cause Analysis** - Why does each bottleneck exist?
3. **Impact Assessment** - Prioritize by effort vs. benefit ratio
**Implementation Phase:**
1. Database optimization (strategic indexing, query rewriting, connection pooling)
2. Backend caching strategy (Redis, query result caching, HTTP caching)
3. Frontend optimization (code splitting, lazy loading, virtual scrolling, image optimization)
4. Infrastructure optimization (CDN, edge caching, load balancing, autoscaling)
Output: Performance issues breakdown, optimization strategies, improved code, before/after metrics
Real Context Example (from Clinic Patient Search):
- Current: Patient search endpoint = 2.5s load time (unacceptable)
- Issue: Full table scan on patient_medical_records (200K records)
- Tech: Laravel 12 + PostgreSQL + Vue.js 3
- Target: <300ms search response time
- Current queries: 5 separate database calls for 1 search
6. Claude Multi-Agent Workflow (Collaborative Design)
When to use: For complex projects that require multiple perspectives (architecture, engineering, quality, performance).
Prompt Template:
[CONTEXT - Complex Project Requirements]
- Scope: [New feature / System redesign / Complex integration / Critical infrastructure]
- Stakeholders: [Product / Engineering / DevOps / Security]
- Constraints: [Timeline (weeks) / Budget / Technical debt]
- Success criteria: [Measurable outcomes - latency, uptime, user satisfaction]
- Risks identified: [Technical risks / Integration risks / Scaling risks]
[TASK]
Deploy 4-agent collaborative workflow:
🏗️ **ARCHITECT** (System Design):
- Design comprehensive system architecture
- Define component boundaries and communication patterns
- Plan data flow & integrations
- Document assumptions, tradeoffs, and alternative approaches
→ Output: Architecture document, component diagrams, data flow diagrams
👨💻 **ENGINEER** (Implementation):
- Develop based on architect's design (strictly follow specs)
- Implement core functionality for happy path
- Write unit tests for critical logic
- Write documentation (code comments, README, API docs)
→ Output: Production-ready code, test suite, deployment guide
🔍 **REVIEWER** (Quality Control):
- Verify architecture alignment - does code follow architect's design?
- Code quality check - standards, patterns, security best practices
- Test coverage verification - sufficient tests for critical paths?
- Identify design flaws or implementation issues
→ Output: Review report, feedback items, risk assessment
⚡ **OPTIMIZER** (Performance & Scalability):
- Identify bottlenecks in design & implementation
- Propose optimization strategies with metrics
- Review database efficiency, caching strategy, algorithm complexity
- Suggest scalability improvements
→ Output: Optimization report, improved code, performance projections
**Workflow:**
1. Architect designs and presents to reviewer (iterate until aligned)
2. Engineer implements based on final architecture
3. Reviewer quality-gates code (feedback loop with engineer)
4. Optimizer reviews for performance (suggest improvements)
5. Final iteration until all agents approve
Output: Final architecture, production-ready code, quality report, optimization analysis, deployment checklist
Real Context Example (from Sembuh.AI):
- Scope: AI EMR documentation platform (Sembuh.AI)
- Stakeholders: Hospital (Pusat Jantung Nasional), clinical staff, IT department
- Timeline: 12 weeks to pilot phase
- Success criteria: 80% of SOAP/ANA forms auto-filled, <3s response time, 99% accuracy
- Risks: Privacy compliance (Indonesian data protection law), integration with legacy SIMRS, clinical validation
7. Production-Level UI Component Builder
When to use: When you need to build reusable, accessible, production-grade UI components.
Prompt Template:
[CONTEXT - Component Requirements]
- Component type: [Form input / Data table / Modal / Chart / Real-time feed / List with filtering]
- Use cases: [Desktop / Mobile / Both]
- Design system: [Existing component library / Brand guidelines / Accessibility requirements]
- Framework & version: [React 19 / Next.js 15 / Vue 3]
- Browser support: [Modern browsers / IE11]
- Accessibility level: [WCAG 2.1 Level AA / AAA]
- Performance constraints: [Virtual scrolling for 10K+ items? / Real-time updates?]
[TASK]
Build a production-ready UI component with depth & polish.
**Component Design:**
1. **Props Interface**
- Type-safe (TypeScript interfaces)
- Flexible API (composition over props hell)
- Well-documented with JSDoc
- Support for common variants (size, color, state, etc.)
2. **State Management**
- Normal state (default)
- Loading state (skeleton, spinner)
- Error state (error message, retry button)
- Empty state (no data message)
- Disabled state (visual + interaction feedback)
- Selected/active state
3. **Edge Cases**
- Very long text (truncation, tooltip)
- No data / empty state
- Mobile/responsive viewports
- Keyboard navigation
- Screen reader compatibility
- High-contrast mode support
4. **Accessibility (a11y)**
- ARIA labels & roles
- Keyboard navigation (Tab, Enter, Escape, Arrow keys)
- Screen reader support
- Focus management & visual focus indicators
- Semantic HTML
5. **Performance**
- Virtualization for lists (if 1000+ items)
- React.memo for expensive computations
- Lazy loading for images
- Debouncing for search/filter inputs
6. **Responsive Design**
- Mobile-first approach
- Touch-friendly (min 44px tap target)
- Flexible layouts (Flexbox, Grid)
- Breakpoint strategy
**Implementation Requirements:**
1. Component structure (composition-focused)
2. Prop validation & TypeScript types
3. Error boundaries & fallback UI
4. Storybook stories for each state
5. Unit tests (Jest) & integration tests (React Testing Library)
6. Comprehensive documentation & usage examples
Output: Component code (production-ready), Props documentation, Storybook stories, Usage examples, Test suite
Real Context Example (from EMR System):
- Component: PatientDataTable with inline edit & real-time sync
- Use cases: Desktop EMR system (doctors, nurses viewing patient medical records)
- Framework: Next.js 14 + TypeScript + TailwindCSS + shadcn/ui
- Accessibility: WCAG 2.1 Level AA
- Data scale: 10K+ patient records (need virtual scrolling)
- Features: Inline edit, sort, filter, multi-select, keyboard navigation, real-time sync from multiple doctors
Pro Tips & Best Practices
1. Context is Everything The more detailed context you provide, the better Claude's output. Include:
- Tech stack specifics (framework versions, databases, libraries)
- Real constraints (scale, performance targets, compliance requirements)
- Business context (why build this? who are the users?)
- Existing systems that need integration
2. Role-Based Thinking Prompting Claude with specific roles ("Think like senior full-stack engineer") triggers more sophisticated thinking patterns.
3. Iteration & Feedback Your first prompts are rarely perfect. Provide feedback:
- "This approach is good, but doesn't consider X"
- "Refactor this with readability priority over performance"
- "Add error handling for edge case Y"
4. Combine Prompts Use multiple prompts in your workflow:
- Design → System Design prompt → architecture
- Implement → Complete App prompt → initial code
- Improve → Refactoring prompt → code quality
- Optimize → Performance prompt → final optimization
5. Validate Output Don't blindly trust. Always:
- Review code for security issues
- Test in staging before production
- Verify architecture decisions with your team
Conclusion
As a developer who has built production systems in healthcare (Sembuh.AI, SIMRS integration), e-commerce (Apotik App), and real-time systems (BAS), I can confirm that prompt quality significantly impacts output quality.
The prompts above aren't just "good prompts"—they're proven thinking frameworks in production systems. Each prompt transforms Claude from a generic chatbot into a specialized engineer with specific expertise.
Next steps:
- Adapt these prompts for your projects
- Add real context from your codebase/requirements
- Iterate based on output quality
- Build a custom prompt library for your team
Production-ready code isn't an accident—it's the result of clarity in thinking. These prompts are tools to clarify your thinking and maximize AI assistance.
Happy coding!