All posts
test case 3 new
hehehihikaka

test case 3 new

Hieu Tran H.'s avatarHieu Tran H.2 min read
On this page25 sections

Hướng dẫn sử dụng Claude Code

Claude Code là gì?

Claude Code là công cụ AI chạy trong terminal, giúp lập trình viên:

  • Phân tích source code

  • Tạo và chỉnh sửa file

  • Refactor code

  • Viết test

  • Debug lỗi

  • Tự động hóa tác vụ phát triển phần mềm


Cài đặt

Cài đặt Claude Code

npm install -g @anthropic-ai/claude-code

Đăng nhập

claude

Các lệnh cơ bản

Giải thích source code

Explain this project structure

Tìm lỗi tiềm ẩn

Find potential bugs in this module

Sinh code mới

Create a Magento 2 module named HieuTran_HelloWorld

Refactor code

Refactor this class using dependency injection

Sử dụng Claude Code với Magento 2

Phân tích module

Analyze this Magento 2 module and explain:

- Purpose
- Architecture
- Flow
- Dependencies
- Potential issues

Điều tra module trước khi disable

Analyze the impact of disabling this Magento module.

Please identify:
- Direct dependencies
- Indirect dependencies
- Database impact
- Frontend impact
- Admin impact
- External API impact

Sinh Plugin

Create a Magento 2 plugin for ProductRepository::save()

Sinh Observer

Create an observer that logs customer login events

Điều tra Event

List all events dispatched by this module and explain their purposes.

Điều tra Cron Job

Find all cron jobs in this module and explain what they do.

Review Code

Review Pull Request

Review the following code changes and identify:

- Bugs
- Security issues
- Performance concerns
- Magento best practice violations
- Suggested improvements

Review kiến trúc

Analyze this implementation and suggest improvements based on Magento 2 best practices.

Điều tra Dependency

Tìm nơi sử dụng class

Find every place where this class is used and explain the call flow.

Tìm dependency của module

List all dependencies of this Magento 2 module.

Include:
- composer dependencies
- module dependencies
- runtime dependencies

Best Practices

  1. Luôn cung cấp context rõ ràng.

  2. Chia task lớn thành các task nhỏ.

  3. Kiểm tra lại code được sinh ra.

  4. Chạy test trước khi commit.

  5. Không merge code mà chưa review.

  6. Xác minh lại logic business trước khi deploy.


Workflow đề xuất

1. Phân tích yêu cầu
2. Điều tra source code
3. Sinh code
4. Review code
5. Chạy test
6. Refactor
7. Commit
8. Deploy

Kết luận

Claude Code giúp tăng tốc quá trình phát triển phần mềm và điều tra source code. Tuy nhiên mọi thay đổi vẫn cần được developer review, test và xác nhận trước khi đưa lên môi trường production.