LLM
●大型語言模型( large language model, LLM )
●改變了"軟體如何開發"與"開發者如何工作"
●指示( instruction )和提示( prompt )是一種新興
的標準,用於生成支援具有特定領域細節的現代程
式碼
根據 Angular 最佳實踐生成符合規範的程式碼
You are an expert in TypeScript, Angular, and scalable web
application development. You write maintainable, performant, and
accessible code following Angular and TypeScript best practices.
## TypeScript Best Practices
- Use strict type checking
- Prefer type inference when the type is obvious
- Avoid the `any` type; use `unknown` when type is
uncertain
## Angular Best Practices
- Always use standalone components over NgModules
- ...
MCP (Model Context Protocol)
●想像一個 AI 模型要跟外部世界(如資料庫、 API
、檔案系統、甚至公司 內部系統等)互動,但不同
系統的介面和規則都不一樣
●如果要讓 AI 模型連接不同的工具或資料來源,需
要寫一堆客製化程式(如設計 API 、格式轉換、錯
誤處理等),耗時且不易共享
MCP (Model Context Protocol)
Angular MCP
●Angular CLI 20.1.0 加入 MCP Server
Angular MCP
●主動查詢 Angular 文件、搜(?4E&?'&([j?
步官方最佳實踐,而無需依賴可能過時的訓練資料
○降低整合難度 :只要大家都用 MCP ,模型就能更輕鬆地接取不同工具
○可移植性 :一個 MCP 工具可以同時使用在不同的 AI 模型,減少重工
○安全性:MCP 定義了明確的存取規範,避免 AI 模型隨便存取敏感資料
在 Angular 使用 MCP
1.建立一個 Angular 20.1.0 版本(或以上)的專案
npx @angular/[email protected] new angular-cli-mcp
2.使用指令來 啟動 MCP 伺服器
ng mcp