Chuyển đến nội dung
Skillpedia
Lập trình chung29k · #9586

focused-fix

Skill này làm gì

Skill này lần theo các file, dependency, log và test của một tính năng trước khi đề xuất sửa, để toàn bộ khu vực được sửa thay vì vá từng phần. Dành cho khi một tính năng hoặc module cần được sửa có hệ thống, chứ không phải chỉ sửa một lỗi nhỏ nhanh.

Khi nào nên dùng

  • ✓Khi cả một tính năng hoặc module bị hỏng và cần hoạt động trở lại.
  • ✓Khi bạn yêu cầu agent làm cho một khu vực cụ thể của ứng dụng hoạt động đúng.
  • ✓Khi sửa nhanh một lỗi đơn lẻ là chưa đủ vì vấn đề trải rộng nhiều phần.

Liên kết skill

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/focused-fix/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/alirezarezvani/claude-skills/blob/main/engineering/skills/focused-fix/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

“Module thanh toán bị hỏng từ đầu đến cuối. Tôi cần bạn lần theo mọi thứ nó phụ thuộc vào rồi làm cho nó hoạt động.”

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

Cách hoạt động

Agent lập bản đồ các file và dependency của tính năng, đọc log và test, rồi chẩn đoán nguyên nhân gốc trước khi đề xuất bất kỳ sửa đổi nào. Việc sửa chỉ diễn ra sau khi phạm vi đã được lần theo đầy đủ.

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.

Focused Fix — Deep-Dive Feature Repair

When to Use

Activate when the user asks to fix, debug, or make a specific feature/module/area work. Key triggers:

  • "make X work"
  • "fix the Y feature"
  • "the Z module is broken"
  • "focus on [area]"
  • "this feature needs to work properly"

This is NOT for quick single-bug fixes (use systematic-debugging for that). This is for when an entire feature or module needs systematic repair — tracing every dependency, reading logs, checking tests, mapping the full dependency graph.

digraph when_to_use {
    "User reports feature broken" [shape=diamond];
    "Single bug or symptom?" [shape=diamond];
    "Use systematic-debugging" [shape=box];
    "Entire feature/module needs repair?" [shape=diamond];
    "Use focused-fix" [shape=box];
    "Something else" [shape=box];

    "User reports feature broken" -> "Single bug or symptom?";
    "Single bug or symptom?" -> "Use systematic-debugging" [label="yes"];
    "Single bug or symptom?" -> "Entire feature/module needs repair?" [label="no"];
    "Entire feature/module needs repair?" -> "Use focused-fix" [label="yes"];
    "Entire feature/module needs repair?" -> "Something else" [label="no"];
}

The Iron Law

NO FIXES WITHOUT COMPLETING SCOPE → TRACE → DIAGNOSE FIRST

If you haven't finished Phase 3, you cannot propose fixes. Period.

Violating the letter of these phases is violating the spirit of focused repair.

Protocol — STRICTLY follow these 5 phases IN ORDER

digraph phases {
    rankdir=LR;
    SCOPE [shape=box, label="Phase 1\nSCOPE"];
    TRACE [shape=box, label="Phase 2\nTRACE"];
    DIAGNOSE [shape=box, label="Phase 3\nDIAGNOSE"];
    FIX [shape=box, label="Phase 4\nFIX"];
    VERIFY [shape=box, label="Phase 5\nVERIFY"];

    SCOPE -> TRACE -> DIAGNOSE -> FIX -> VERIFY;
    FIX -> DIAGNOSE [label="fix broke\nsomething else"];
    FIX -> ESCALATE [label="3+ fixes\ncreate new issues"];
    ESCALATE [shape=doubleoctagon, label="STOP\nQuestion Architecture\nDiscuss with User"];
}

Phase 1: SCOPE — Map the Feature Boundary

Before touching any code, understand the full scope of the feature.

  1. Ask the user: "Which feature/folder should I focus on?" if not already clear
  2. Identify the PRIMARY folder/files for this feature
  3. Map EVERY file in that folder — read each one, understand its purpose
  4. Create a feature manifest:
FEATURE SCOPE:
  Primary path: src/features/auth/
  Entry points: [files that are imported by other parts of the app]
  Internal files: [files only used within this feature]
  Total files: N
  Total lines: N

Phase 2: TRACE — Map All Dependencies (Inside AND Outside)

Trace every connection this feature has to the rest of the codebase.

INBOUND (what this feature imports):

  1. For every import statement in every file in the feature folder:
    • Trace it to its source
    • Verify the source file exists
    • Verify the imported entity (function, type, component) exists and is exported
    • Check if the types/signatures match what the feature expects
  2. Check for:
    • Environment variables used (grep for process.env, import.meta.env, os.environ, etc.)
    • Config files referenced
    • Database models/schemas used
    • API endpoints called
    • Third-party packages imported

OUTBOUND (what imports this feature):

  1. Search the entire codebase for imports from this feature folder
  2. For each consumer:
    • Verify they're importing entities that actually exist
    • Check if they're using the correct API/interface
    • Note if any consumers are using deprecated patterns

Output format:

DEPENDENCY MAP:
  Inbound (this feature depends on):
    src/lib/db.ts → used in auth/repository.ts (getUserById, createUser)
    src/lib/jwt.ts → used in auth/service.ts (signToken, verifyToken)
    @prisma/client → used in auth/repository.ts
    process.env.JWT_SECRET → used in auth/service.ts
    process.env.DATABASE_URL → used via prisma

  Outbound (depends on this feature):
    src/app/api/login/route.ts → imports { login } from auth/service
    src/app/api/register/route.ts → imports { register } from auth/service
    src/middleware.ts → imports { verifyToken } from auth/service

  Env vars required: JWT_SECRET, DATABASE_URL
  Config files: prisma/schema.prisma (User model)

Phase 3: DIAGNOSE — Find Every Issue

Systematically check for problems. Run ALL of these checks:

CODE QUALITY:

  • Every import resolves to a real file/export
  • No circula
Câu hỏi thường gặp

Khi nào tôi không nên dùng nó?

Với một lỗi nhỏ đơn lẻ, một cách gỡ lỗi đơn giản hơn sẽ phù hợp hơn.

Nó có thay đổi code trước khi chẩn đoán không?

Không. Nó hoàn thành các bước xác định phạm vi, lần theo và chẩn đoán trước khi đề xuất sửa.

Nó lần theo những gì?

Mọi file và dependency trong khu vực bị ảnh hưởng, cùng log và test.

Chi tiết

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

Use when a whole feature or module is broken and needs fixing end to end ('make X work', 'the Y module is broken'). Maps every file and dependency of the area before changing anything. Single quick bug fixes do not need it.

repo: alirezarezvani/claude-skills

Độ phổ biến

Sao GitHub
29k
Vị trí xếp hạng
#9586
Giấy phép
MIT
Cập nhật
2/11/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ự