Practice and reinforce the concepts from Lesson 3
By completing these activities, you will:
Your team has hired a new developer. Create a seamless AI onboarding experience!
Set up a shared repository structure:
Create folder structure:
team-ai-prompts/
├── frontend/
│ ├── react-component-template.md
│ ├── vue-component-template.md
│ └── styling-guidelines.md
├── backend/
│ ├── api-endpoint-template.md
│ ├── database-migration.md
│ └── service-layer.md
├── testing/
│ ├── unit-test-template.md
│ ├── integration-test.md
│ └── e2e-test.md
├── standards/
│ ├── naming-conventions.md
│ ├── error-handling.md
│ └── security-checklist.md
└── README.md
Example: frontend/react-component-template.md
# React Component Template
Use this prompt for all new React components:
## Standard Prompt
"Create a React component that:
- Uses TypeScript with strict types
- Follows our naming convention (PascalCase for components)
- Includes PropTypes or TypeScript interfaces
- Has error boundaries
- Implements accessibility (ARIA labels, semantic HTML)
- Uses our CSS-in-JS library (styled-components)
- Includes loading and error states
- Has comprehensive JSDoc comments
- Includes unit tests with React Testing Library
- Follows our company's component structure pattern"
## Example Usage
[Component Name]: UserProfileCard
[Purpose]: Display user information with avatar and contact details
[Props]: user object, onEdit callback, loading state
## Quality Checklist
- [ ] TypeScript interfaces defined
- [ ] Accessibility compliant
- [ ] Error handling included
- [ ] Tests written
- [ ] Documentation complete
Create team-config.json
:
{
"team": "Frontend Development",
"aiStandards": {
"model": "claude-3.5-sonnet",
"temperature": 0.1,
"maxTokens": 2000
},
"codeStandards": {
"language": "TypeScript",
"framework": "React",
"testing": "Jest + React Testing Library",
"styling": "styled-components",
"linting": "ESLint + Prettier"
},
"promptTemplates": {
"component": "./frontend/react-component-template.md",
"api": "./backend/api-endpoint-template.md",
"test": "./testing/unit-test-template.md"
},
"reviewProcess": {
"aiReview": true,
"humanReview": true,
"securityCheck": true
}
}
You and your teammate need to build a "User Dashboard" feature. Practice collaborative prompting!
Developer A (Frontend Focus): "We need a user dashboard. I'm thinking responsive design with cards for different metrics."
Developer B (Backend Focus):
"Good idea. We'll need API endpoints for user data, metrics, and preferences. What about real-time updates?"
Developer A: "Yes! And we should include filtering and sorting options."
Combined Prompt Creation:
Team Planning Session Results:
Build a comprehensive user dashboard feature with these requirements:
FRONTEND REQUIREMENTS (Developer A):
- Responsive card-based layout
- Real-time data updates via WebSocket
- Advanced filtering and sorting options
- Dark/light theme support
- Accessibility compliance
- Mobile-first design
- Loading skeleton screens
- Error boundaries with retry options
BACKEND REQUIREMENTS (Developer B):
- RESTful API endpoints for user data
- WebSocket integration for real-time updates
- Database optimization for dashboard queries
- Caching layer for frequently accessed data
- Rate limiting for API protection
- Comprehensive logging and monitoring
- Data validation and sanitization
COLLABORATION FEATURES:
- Shared TypeScript interfaces between frontend/backend
- Consistent error handling patterns
- Matching API response formats
- Synchronized data models
- Joint testing strategy
QUALITY STANDARDS:
- Follow our team's coding conventions (see team-config.json)
- Include comprehensive tests for both layers
- Add performance monitoring
- Implement security best practices
- Document all APIs and components
Practice this workflow:
Developer A generates frontend:
Using our team's React component template, create the dashboard UI components following the collaborative requirements above.
Developer B generates backend:
Using our team's API endpoint template, create the backend services following the collaborative requirements above.
Integration prompt:
Now integrate these frontend and backend parts, ensuring:
- API contracts match exactly
- Error handling is consistent
- TypeScript types are shared
- WebSocket communication works correctly
✅ Both developers can work simultaneously
✅ Code integrates without conflicts
✅ Maintains team standards throughout
✅ Documentation is comprehensive
Practice reviewing code with AI assistance using realistic examples.
Generate this "problematic" code with AI, then review it:
Initial AI Generation:
Create a user registration system with these potential issues:
- Some security vulnerabilities
- Performance problems
- Code style inconsistencies
- Missing error handling
- Accessibility issues
Make it realistic but flawed for review practice.
Review Prompt Template:
Perform a team code review for this user registration system:
REVIEW CRITERIA (From team standards):
✅ Security: Check for vulnerabilities, input validation, authentication
✅ Performance: Identify bottlenecks, optimize queries, reduce bundle size
✅ Code Quality: Follow naming conventions, proper structure, documentation
✅ Testing: Unit tests, integration tests, edge cases covered
✅ Accessibility: ARIA labels, keyboard navigation, screen reader support
✅ Team Standards: Matches our established patterns and conventions
REVIEW FORMAT:
1. Overall Assessment (Approve/Request Changes/Comment)
2. Critical Issues (must fix before merge)
3. Suggestions (nice to have improvements)
4. Security Concerns (detailed analysis)
5. Performance Optimizations (specific recommendations)
6. Testing Gaps (what tests are missing)
7. Code Quality Score (1-10 with justification)
DELIVERABLES:
- Detailed review comments
- Refactored code examples
- Security fix implementations
- Performance improvement code
- Missing test cases
Practice this team workflow:
Primary Reviewer uses AI:
First pass review focusing on security and critical bugs
Secondary Reviewer uses AI:
Second pass review focusing on code quality and performance
Team Lead uses AI:
Final architectural review and team standards compliance
Author responds with AI:
Address all review comments and implement suggested improvements
Your team's application has a mysterious bug in production. Work together to solve it!
The Bug Report:
PRODUCTION ISSUE #2847
Priority: HIGH
Reporter: Customer Support
Description:
Users report that the shopping cart occasionally loses items when switching between pages. The issue is intermittent and hard to reproduce.
Environment:
- Production environment only
- Multiple users affected
- Happens on both desktop and mobile
- No clear pattern in timing
Error Logs:
[Timestamp] ERROR: CartService - Failed to persist cart data
[Timestamp] WARN: SessionManager - Session timeout detected
[Timestamp] ERROR: Database - Connection pool exhausted
Team Lead coordinates with AI:
Analyze this production bug report and create a debugging strategy:
ISSUE: Shopping cart losing items intermittently
SYMPTOMS: [paste bug report above]
DEBUGGING PLAN NEEDED:
1. Root cause analysis approach
2. Divide investigation tasks between 3 developers
3. Prioritize most likely causes
4. Create reproduction steps
5. Design fix validation strategy
TEAM RESOURCES:
- Developer A: Frontend specialist
- Developer B: Backend/Database expert
- Developer C: DevOps/Infrastructure focus
OUTPUT:
- Detailed investigation plan
- Task assignments for each developer
- Tools and queries needed
- Timeline for resolution
Developer A (Frontend):
Investigate the frontend cart management system:
FOCUS AREAS:
- Local storage persistence
- State management issues
- Page transition handling
- Session management
- Network request failures
ANALYZE:
- Cart state synchronization code
- Browser storage mechanisms
- Error handling in cart operations
- Performance issues causing timeouts
PROVIDE:
- Code review of cart-related components
- Potential race conditions
- Browser compatibility issues
- Suggested fixes with implementations
Developer B (Backend):
Investigate the backend cart persistence:
FOCUS AREAS:
- Database connection issues
- Session timeout problems
- Cart service reliability
- Data consistency problems
ANALYZE:
- Cart API endpoint implementation
- Database connection pooling
- Session management logic
- Transaction handling
- Error logging patterns
PROVIDE:
- Database query optimizations
- Connection pool configuration fixes
- Session timeout adjustments
- Data integrity improvements
Developer C (Infrastructure):
Investigate the infrastructure and deployment:
FOCUS AREAS:
- Database connection pool settings
- Load balancer configuration
- Session store reliability
- Network timeouts
- Resource constraints
ANALYZE:
- Server resource utilization
- Database performance metrics
- Network latency issues
- Auto-scaling behavior
- Monitoring and alerting gaps
PROVIDE:
- Infrastructure optimization recommendations
- Monitoring improvements
- Deployment configuration fixes
- Performance tuning suggestions
Team Integration Prompt:
Combine our team's investigation findings into a comprehensive solution:
FRONTEND FINDINGS:
[Developer A's analysis]
BACKEND FINDINGS:
[Developer B's analysis]
INFRASTRUCTURE FINDINGS:
[Developer C's analysis]
INTEGRATION REQUIREMENTS:
1. Root cause identification
2. Prioritized fix implementation plan
3. Testing strategy for validation
4. Deployment rollout plan
5. Monitoring improvements to prevent recurrence
DELIVERABLES:
- Complete bug fix implementation
- Test cases to prevent regression
- Deployment checklist
- Post-fix monitoring plan
Create enforceable AI development standards for your team.
Draft your team's AI policy:
Create a comprehensive AI development policy for our team:
POLICY AREAS:
1. Approved AI tools and models
2. Code quality standards for AI-generated code
3. Security requirements and sensitive data handling
4. Code review process for AI-assisted development
5. Documentation requirements
6. Testing standards for AI-generated code
7. Intellectual property and licensing considerations
ENFORCEMENT MECHANISMS:
- Pre-commit hooks for standards checking
- Automated code review integration
- Training requirements for team members
- Regular policy review and updates
TEAM CONTEXT:
- 5-person development team
- Full-stack web application development
- Agile methodology with 2-week sprints
- Cloud-based deployment (AWS)
- High security requirements (financial data)
OUTPUT:
- Complete policy document
- Implementation checklist
- Training plan for team adoption
- Measurement metrics for policy effectiveness
Create enforcement tools:
Build automated tools to enforce our AI development standards:
TOOLS NEEDED:
1. Pre-commit hook that validates AI-generated code
2. Pull request template for AI usage disclosure
3. Code quality checker for AI patterns
4. Security scanner for common AI code issues
5. Documentation generator for AI-assisted functions
TECHNICAL REQUIREMENTS:
- Integrate with our Git workflow
- Support both Cursor and Windsurf IDEs
- Provide clear feedback for violations
- Allow for approved exceptions
- Generate compliance reports
IMPLEMENTATION:
- Shell scripts for Git hooks
- GitHub/GitLab integration
- IDE plugins/extensions
- Automated testing integration
- Metrics dashboard
Design AI training curriculum:
Create a comprehensive AI training program for our development team:
TRAINING MODULES:
1. AI IDE Fundamentals (2 hours)
2. Advanced Prompting Techniques (3 hours)
3. Team Collaboration with AI (2 hours)
4. Security Best Practices (1.5 hours)
5. Code Quality and Review (2 hours)
6. Debugging with AI Assistance (1.5 hours)
DELIVERY FORMAT:
- Interactive workshops with hands-on exercises
- Peer learning sessions
- AI pair programming practice
- Real project application
- Assessment and certification
LEARNING OUTCOMES:
- Team members can effectively use AI for development
- Consistent code quality across all team members
- Reduced onboarding time for new developers
- Improved productivity metrics
- Enhanced code review quality
MATERIALS NEEDED:
- Interactive training exercises
- Assessment criteria
- Certification process
- Reference documentation
- Progress tracking system
Rate your team's AI collaboration maturity:
Team Capability | Maturity Level |
---|---|
Shared prompt libraries | ⭐⭐⭐⭐⭐ |
Consistent AI coding standards | ⭐⭐⭐⭐⭐ |
AI-powered code reviews | ⭐⭐⭐⭐⭐ |
Collaborative debugging with AI | ⭐⭐⭐⭐⭐ |
Team AI training program | ⭐⭐⭐⭐⭐ |
Automated standards enforcement | ⭐⭐⭐⭐⭐ |
Cross-team knowledge sharing | ⭐⭐⭐⭐⭐ |
Team Productivity Indicators:
Quality Indicators:
Congratulations! You now have the framework to transform your entire team into AI-powered development experts. You can:
You're now ready to lead the AI development revolution in your organization!
Impact: Your team will be 300% more productive and deliver higher quality code than traditional development teams.
Next Step: Apply these collaboration techniques in your real projects and watch your team's capabilities soar!