AI assistants have become an essential part of the modern development workflow. In this chapter, we explore how tools like GitHub Copilot, Cursor, and Claude enhance your productivity by generating code, refactoring safely, helping with debugging, and accelerating both Java Spring Boot and Angular development.
This README provides a structured reference for everything covered in the chapter, including comparisons of the tools, configuration steps, code examples, and best practices.
- Chapter 03 — Setting Up Your AI Development Assistant
- Table of Contents
- Chapter Overview
- ✅ Before You Run This Chapter
- 📦 Chapter Source Code Availability
- The Rise of AI Development Assistants
- Comparing Leading Tools: Cursor, Claude & GitHub Copilot
- Why GitHub Copilot Works Best with VS Code
- Installing & Configuring GitHub Copilot in VS Code
- Using GitHub Copilot in Spring Boot & Angular Projects
- Prompt Engineering for Developers
- Best Practices for AI Pair Programming
- Limitations & Future Directions of GenAI
- Installation & Setup Steps
- Resources & References
This chapter introduces the modern GenAI toolset that supports you while building the Bookstore application. You'll learn:
- How AI assistants evolved
- The strengths and limitations of Cursor, Claude, and Copilot
- Why VS Code + Copilot is the most productive environment
- How to configure Copilot properly
- How to use Copilot to write controllers, repositories, DTOs, and Angular services
- Essential prompt engineering patterns
- Best practices & pitfalls when pairing with AI
Please confirm the required runtime dependencies before running this chapter:
- Confirm the database is started (if this chapter uses one).
- Confirm any infrastructure dependencies are running (for example Docker services, if used).
- Confirm any dependencies from previous chapters are running as needed for your flow.
The final source code for this chapter is already uploaded in this directory.
Use this folder as the reference implementation for the completed chapter state.
AI coding tools have transformed development from simple autocomplete to full contextual assistance.
- Generates boilerplate code (DTOs, controllers, services)
- Suggests tests (JUnit, Mockito)
- Explains unfamiliar Spring or Angular APIs
- Helps onboard faster into large codebases
- Improves readability and code quality
- Bridges backend–frontend workflows
| Feature / Use Case | Cursor IDE | Claude | GitHub Copilot |
|---|---|---|---|
| Project-wide context | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
| Inline code generation | ⭐⭐⭐⭐⭐ | Not supported | ⭐⭐⭐⭐⭐ |
| Refactoring support | Strong | Insightful | Suggestive |
| Architecture reasoning | Good | Excellent | Moderate |
| IDE Integration | Cursor | Standalone app | VS Code, IntelliJ |
Copilot is optimized for VS Code because:
- Native inline completion ("ghost text")
- Strong integration with Java, Spring, Angular extensions
- Access to multi-file project context
- Smooth Copilot Chat sidebar
- Works perfectly with Spring Boot project structure (pom.xml, controllers, repos)
In VS Code:
Ctrl+Shift+X → Search "GitHub Copilot"
Ctrl+Shift+X → Search "GitHub Copilot Chat"
Install both official extensions.
Ctrl+Shift+P → Copilot: Sign In
Login through GitHub in your browser.
From VS Code Settings:
- ✔ Enable Inline Suggestions
- ✔ Enable Copilot Chat
- ✔ Enable for all file types (.java, .ts, .html, .yaml, .md…)
// Get all books
@GetMapping
public ResponseEntity<List<BookDTO>> getAllBooks() {
return ResponseEntity.ok(bookService.getAllBooks());
}// Find books by author (case-insensitive)
List<Book> findByAuthorIgnoreCase(String author);// Get books from backend
getBooks(): Observable<Book[]> {
return this.http.get<Book[]>(`${this.baseUrl}/books`);
}REST Controller prompt:
// Create a GET endpoint to fetch all booksService method prompt:
// Add a method to find books by category and price rangeRepository prompt:
// Spring Data method to find books by title (case insensitive)Unit Test prompt:
// Write a test for getBooksByAuthor endpoint- Be specific with prompts
- Use comments inside code files
- Validate suggestions before accepting
- Request multiple suggestions when needed
- Let AI scaffold repetitive code
- Blindly trusting generated code
- Overloaded prompts ("make it secure, fast, scalable, clean…")
- Large unclear requests
- Occasional hallucinations
- Limited context window (~150 lines)
- May produce outdated API calls
- Needs human validation
- Will improve with larger context & repository-wide reasoning
https://github.com/features/copilot
- Extension Pack for Java
- Spring Boot Tools
- Angular Essentials
- TypeScript + Web Tools
git clone https://github.com/PacktPublishing/Spring-Boot-and-Angular-2E_Backend
git clone https://github.com/PacktPublishing/Spring-Boot-and-Angular-2E_Frontend- GitHub Copilot Documentation: https://docs.github.com/en/copilot
- VS Code Documentation: https://code.visualstudio.com/docs
- Cursor IDE: https://cursor.com
- Claude AI: https://claude.ai