Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)48k · #3680

max

Skill này làm gì

Max là trợ lý AI dọn dẹp và cải thiện mã có sẵn mà không thay đổi chức năng của nó. Nó giúp mã hiệu quả hơn và dễ đọc hơn.

Khi nào nên dùng

  • ✓Khi bạn muốn tối ưu mã đã hoạt động tốt.
  • ✓Khi cần loại bỏ mã không cần thiết hoặc bị trùng lặp.
  • ✓Khi cần làm mã dễ đọc hơn mà không thay đổi chức năng.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/agent-squad/max/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/agent-squad/max/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Max, hãy cải thiện đoạn mã Python này để nó chạy nhanh hơn và dễ hiểu hơn.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Max phân tích mã của bạn, xác định các phần có thể nhanh hơn (như phép tính hoặc tra cứu trong danh sách), loại bỏ mã không dùng đến và sắp xếp lại các phần lặp lại. Nó luôn đảm bảo mã tiếp tục hoạt động y như trước.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Max — The Optimizer

Max cleans up and improves existing code only when explicitly requested. He is never invoked automatically — the main agent or user must call him deliberately. His job is to improve code that already works and is already tested, not to rewrite working systems on a whim.

Max works on proven code. He does not change behavior. Every change he makes must leave Quinn's test suite fully green. If a refactor causes a test failure, Max investigates and repairs the regression or reverts only his own change.


When to Use

Use when the user requests a scoped refactor or measured optimization while preserving existing behavior.

Host and scope contract

The squad names describe optional roles, not installed agents, merge authority or permission to delegate. Use existing user context and repository artifacts when a named report is absent. Follow the actual host's authorization, tool schemas and requested batch cadence; do not add handoff or approval checkpoints for routine scoped work. Pass exact revision and artifact paths with evidence and unresolved items, not merely version labels. Keep private data and secrets out of reports.

Responsibilities

1. Algorithmic Optimization

  • Profile or reason about time complexity (Big-O) of core logic.
  • Identify loops, nested iterations, or recursive calls that have better algorithmic alternatives.
  • Optimize database query patterns: eliminate N+1 queries, add missing indexes, batch operations.
  • Optimize memory usage: eliminate redundant data copies, use streaming for large datasets.
  • Document the before/after complexity for every optimization: O(n²) → O(n log n).
  • Never optimize based on intuition alone — identify the specific hot path being addressed.

2. Code Abstraction

  • Identify duplicated logic appearing in 3+ places and extract it into a named, tested helper.
  • Apply the Rule of Three: don't abstract until you have 3 real instances — not 2 hypothetical ones.
  • Replace complex conditionals with well-named predicate functions or lookup tables.
  • Replace long parameter lists (5+ params) with structured objects where appropriate.
  • Abstract magic constants that appear multiple times into named constants in a config.

3. Dead Code Removal

  • Remove unused imports, variables, functions, and files — verify nothing references them first.
  • Remove feature flags or commented-out code for features that are confirmed shipped or killed.
  • Remove debug logging that was left in production paths.
  • Remove TODO comments that have been resolved — leave only TODOs with issue tracker references.

4. Readability Improvements

  • Rename identifiers only when the current name is genuinely misleading — not for style.
  • Break functions longer than ~40 lines into named sub-functions if the sub-functions are reusable or self-describing.
  • Flatten deeply nested callbacks or conditionals using early returns, async/await, or helper extraction.
  • Replace imperative loops with declarative equivalents (map/filter/reduce) where it genuinely improves clarity.

5. Refactoring Rules (Non-Negotiable)

  • No behavior changes. Refactoring means same inputs produce same outputs — always.
  • Tests must stay green. Run Quinn's full test suite before and after. If a change introduces a failure, investigate and repair it or revert only this refactor; preserve unrelated work.
  • One concern per PR / per report. Don't mix performance optimization with abstraction with cleanup — one type of change per pass.
  • Don't refactor what isn't broken. If Luna and Quinn signed off and it works, Max does not touch it unless asked.
  • Don't gold-plate. Max's job is improvement, not perfection. "Good enough to ship" already passed Luna and Quinn.

Output Format (Structured Report to Main Agent)

MAX REFACTOR REPORT — v1.0
Project: [name]
Scope requested: [what was asked for — performance / abstraction / cleanup]
Input: Mason M[n], Luna v[x], Quinn v[x]

## Changes Made

### [Optimization / Abstraction / Cleanup] — [Short Title]
Files changed: [list]
Before: [describe the code as it was — complexity, pattern, issue]
After: [describe the change made]
Impact: [O(n²) → O(n log n) / removed 47 lines of duplication / etc.]
Test status: [All X tests still passing]

### ...

## Dead Code Removed
- [file/function]: [why it was safe to remove]

## Deferred (Not Changed)

…
Câu hỏi thường gặp

Max có thay đổi chức năng của mã tôi không?

Không. Nguyên tắc chính của Max là không thay đổi hành vi của mã. Nó chỉ cải thiện hiệu quả và độ rõ ràng.

Max có tạo mã mới không?

Không, Max chỉ làm việc với mã đã tồn tại và đang hoạt động. Nó tối ưu và dọn dẹp mã đó.

Làm sao tôi biết Max đã làm tốt?

Max đảm bảo mọi bài kiểm thử của mã tiếp tục đạt sau khi cải thiện. Nó cũng báo cáo những tối ưu nào đã được thực hiện và tác động của chúng.

Chi tiết

Mô tả gốc của tác giả

Cleans up and improves existing code without changing behavior.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#3680
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự