Mô tả chi tiết
Càng chi tiết càng tốt khi describe requirements:
# ❌ Vague> Tạo app blog
# ✅ Detailed> Tạo blog app với Next.js 14, Markdown posts, tag system, search, và RSS feedHướng dẫn này giới thiệu các tính năng cơ bản và cách sử dụng Galaxy CLI hiệu quả.
Khi khởi động, Galaxy hiển thị ASCII art banner:
____ _ ____ _ ___ / ___| __ _| | __ ___ ___ _ / ___| | |_ _| | | _ / _` | |/ _` \ \/ / | | || | | | | | | |_| | (_| | | (_| |> <| |_| || |___| |___ | | \____|\__,_|_|\__,_/_/\_\\__, | \____|_____|___| |___/
Version: 2.0.0ENTER to send • \ + ENTER for new line • @ to mention filesCurrent folder: /path/to/projectAgent=auto Git=OFF Test=OFF Review=OFF
> _> _ # Cursor chờ inputBạn có thể:
/)Galaxy có thể trả lời câu hỏi về programming:
> React hooks là gì?> So sánh Next.js App Router và Pages Router> Cách optimize performance cho React app?Yêu cầu Galaxy phân tích cấu trúc và tech stack:
> Phân tích dự án nàyGalaxy sẽ:
file_tree)package.json, README.mdExample Output:
📊 Phân tích dự án: My Next.js App
🏗️ Tech Stack:- Next.js 14 (App Router)- TypeScript- Tailwind CSS- Prisma + PostgreSQL
✨ Features:1. User Authentication2. Blog Posts (CRUD)3. Comment System
📁 Cấu trúc:- app/ - Next.js pages- components/ - React components- lib/ - Utilities- prisma/ - Database schema
💡 Đề xuất:1. Add API documentation2. Implement caching layer3. Add E2E tests4. Setup CI/CDMô tả dự án muốn tạo
> Tạo app todo list với React và TypeScriptGalaxy phân tích và đề xuất
BA Agent sẽ phân tích requirements
Xác nhận plan
> yes, làm điGalaxy tự động implement
Từng step sẽ được execute với progress tracking
Thêm feature mới vào dự án hiện có:
> Thêm search functionality với debouncing> Implement real-time notifications với WebSocketYêu cầu Galaxy refactor code:
> Refactor components folder để dễ maintain hơn> Extract reusable hooks từ component này> Tại sao component này re-render nhiều lần?> Làm sao fix lỗi "hydration mismatch" trong Next.js?Để nhập nhiều dòng, dùng \ + Enter:
> Tạo app với features sau: \ - User authentication \ - Post CRUD \ - Comment systemDùng ↑ / ↓ để duyệt lịch sử input:
> /history # Xem 10 input gần nhất
Recent inputs:1. Tạo app Next.js2. Thêm authentication3. Phân tích dự ánKhi gõ /, Galaxy hiển thị suggestions:
> /h┌─────────────────────────────────────┐│ /help Hiển thị lệnh ││ /history Xem lịch sử │└─────────────────────────────────────┘Dùng Tab hoặc ↓ để chọn, Enter để execute.
Galaxy hiển thị progress khi đang làm việc:
⠋ Thinking...⚡ EXECUTE (npm install react)↳ ✓ Success. Output: 12 lines.📝 APPLY PATCH (src/App.tsx)↳ Succeeded. File edited. (+15 added, -3 removed)📋 Implementation Plan:☐ Step 1: Initialize project☒ Step 2: Install dependencies - Completed⚙ Step 3: Implement Feature A - In progress...☐ Step 4: Implement Feature BGalaxy làm việc trong current working directory:
> /pwd⚙ Working directory: /Users/you/projects/my-appĐể đổi directory, thoát Galaxy và cd:
> /exit$ cd ../another-project$ bun run startbun run start> /clear✅ Cleared conversation and progress> /exit⚙ Goodbye!Hoặc Ctrl+C.
Galaxy lưu progress vào file .galaxy/progress.json:
{ "projectName": "My App", "createdAt": "2025-01-10T10:00:00Z", "steps": [ { "step": 1, "action": "Initialize project", "status": "completed" }, { "step": 2, "action": "Implement Feature A", "status": "in-progress" } ]}Xem progress location:
> /progress📄 Progress file: /path/to/project/.galaxy/progress.jsonMô tả chi tiết
Càng chi tiết càng tốt khi describe requirements:
# ❌ Vague> Tạo app blog
# ✅ Detailed> Tạo blog app với Next.js 14, Markdown posts, tag system, search, và RSS feedConfirm before execute
Luôn review plan trước khi confirm:
# Review plan📋 Implementation Plan:☐ Step 1: ...☐ Step 2: ...
# Adjust if needed> Thêm step test vào plan
# Then confirm> yesIncremental work
Làm từng phần thay vì all-at-once:
# Session 1> Tạo basic structure
# Session 2> Thêm authentication
# Session 3> Thêm admin panelReview generated code
Luôn review code được generate:
git diff# Review changes
npm run dev# Test functionality# Commit trước khi Galaxy làm việcgit add .git commit -m "Before Galaxy changes"
# Chạy Galaxy> Thêm feature X
# Review changesgit diff
# Commit hoặc rollbackgit commit -m "Added feature X"# orgit reset --hard HEAD# Backup trướccp -r . ../backup
# Chạy Galaxy> Refactor codebase này
# Test thoroughlynpm testnpm run buildDùng Galaxy để học:
> Giải thích code này và cách improve nó> [paste code]
> Viết lại component này theo best practices| Phím | Chức năng |
|---|---|
Enter | Send message |
\ + Enter | New line |
↑ / ↓ | Browse history |
Tab | Next suggestion |
Shift+Tab | Previous suggestion |
Esc | Close suggestions |
Ctrl+C | Exit Galaxy |
# Check Ollama runningollama list
# Check Gemini API keyecho $GEMINI_API_KEY# Check terminal output# Galaxy hiển thị error details
# Try again hoặc skip step> skip step này, làm tiếp# Clear và restart> /clear> Bắt đầu lại từ đầu