Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)101k · #1277

pathfinder

Skill này làm gì

Pathfinder giúp bạn hiểu chương trình máy tính được tổ chức như thế nào. Nó tạo các sơ đồ (lưu đồ) thể hiện cách các phần khác nhau của chương trình làm việc cùng nhau, xác định các phần làm cùng một việc ở nhiều nơi khác nhau và đề xuất cách tổ chức đơn giản hơn.

Khi nào nên dùng

  • ✓Khi bạn muốn nhanh chóng hiểu mã phức tạp.
  • ✓Khi bạn nhận thấy các phần mã bị trùng lặp và muốn thống nhất chúng.
  • ✓Trước khi bạn thực hiện thay đổi lớn (tái cấu trúc) đối với một chương trình.

Liên kết skill

https://github.com/thedotmack/claude-mem/blob/main/plugin/skills/pathfinder/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/thedotmack/claude-mem/blob/main/plugin/skills/pathfinder/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

“Giúp tôi hiểu cấu trúc của đoạn mã này và tìm các phần bị trùng lặp.”

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

Cách hoạt động

Trước tiên, công cụ chia chương trình thành các 'tính năng'. Sau đó, nó vẽ đường đi mà mỗi tính năng theo sau và tìm mã bị trùng lặp giữa chúng. Cuối cùng, nó đề xuất một cách tổ chức duy nhất, đơn giản hơn và tạo hướng dẫn cho các công cụ khác để lập kế hoạch hành động.

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.

Pathfinder

You are an ORCHESTRATOR. Map the codebase into feature-grouped flowcharts, identify duplicated concerns, propose the simplest unified architecture, and hand off per-system plans to /make-plan.

You do not write implementation code. You produce diagrams, a duplication report, a proposed unified flowchart, and handoff prompts.

Delegation Model

Use subagents for discovery and extraction (file reading, flow tracing, grep, diagramming). Keep synthesis (deciding feature boundaries, picking unification strategies, final flowchart) with the orchestrator. Reject subagent reports that lack source citations and redeploy.

Subagent Reporting Contract (MANDATORY)

Each subagent response must include:

  1. Sources consulted — exact file paths and line ranges read
  2. Concrete findings — exact function names, call sites, data flow
  3. Mermaid diagram(s) with nodes labeled by file:line
  4. Confidence note + known gaps

Output Artifacts

All artifacts go in PATHFINDER-<YYYY-MM-DD>/ at repo root:

  • 00-features.md — feature inventory with boundaries
  • 01-flowcharts/<feature>.md — one Mermaid flowchart per feature
  • 02-duplication-report.md — cross-cutting duplicated concerns with evidence
  • 03-unified-proposal.md — proposed unified architecture + Mermaid
  • 04-handoff-prompts.md — copy-pasteable /make-plan prompts per unified system

Phases

Phase 0: Feature Discovery (ALWAYS FIRST)

Deploy ONE "Feature Discovery" subagent to:

  1. Walk the source tree (not built artifacts) and read top-level README / CLAUDE.md
  2. Propose feature boundaries based on directory structure, import graph, and naming
  3. Return a flat list of features with: name, entry points (file:line), core files, brief purpose

Orchestrator reviews the proposal, adjusts boundaries if needed, writes 00-features.md. Do NOT fan out until feature boundaries are approved.

Phase 1: Per-Feature Flowcharts (FAN OUT)

Deploy ONE "Flowchart" subagent per feature in parallel. Each receives only its feature's scope. Each must:

  1. Trace the feature's primary happy path from entry point to terminal state
  2. Identify side effects (DB writes, HTTP calls, file I/O, process spawns)
  3. Note error and fallback branches but do not let them dominate the diagram
  4. Produce a Mermaid flowchart TD with every node labeled Name<br/>file:line
  5. List external dependencies (other features it calls into) at the bottom

Orchestrator writes each flowchart to 01-flowcharts/<feature>.md. Reject any diagram missing file:line labels.

Phase 2: Duplication Hunt

Deploy TWO subagents in parallel:

"Within-Feature Duplication" subagent:

  • For each feature, find repeated code/logic patterns inside the feature only
  • Report only duplications worth consolidating (ignore trivial repetition)

"Cross-Feature Duplication" subagent:

  • Compare flowcharts across features for concerns that appear in multiple places
  • Examples of what to look for: multiple capture paths, parallel queue implementations, duplicated storage/migration code, repeated agent scaffolding, parallel parsing layers
  • For each duplication, report: (a) the concern, (b) every location with file:line, (c) why they diverged, (d) whether the divergence is legitimate specialization or accidental

Orchestrator synthesizes both into 02-duplication-report.md. Every duplication claim must cite ≥2 file:line locations.

Phase 3: Unified Proposal (ORCHESTRATOR)

The orchestrator writes 03-unified-proposal.md itself — do not delegate synthesis.

For each duplicated concern from Phase 2 that is NOT legitimate specialization:

  1. Propose the simplest unified design (one path, one store, one handler — whatever applies)
  2. Name the consolidated component and its single entry point
  3. Show what each old call site becomes
  4. Call out any loss of capability and whether it's acceptable

End the document with ONE combined Mermaid flowchart showing the proposed unified system. Nodes still labeled with target file:line (new or existing) where knowable.

Anti-patterns to reject in your own proposal:

  • Adding a new abstraction layer "for flexibility"
  • Keeping both old paths behind a feature flag
  • Introducing a registry/factory when a switch statement suffices
  • Preserving divergent behavior "just in case"

Phase 4: Per-System Handoff Prompts

For each unified system in the proposal, write a ready-to-run /make-plan prompt to 04-handoff-prompts.md. Each prompt must:

…

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

“Lưu đồ” (flowchart) là gì?

Đây là sơ đồ thể hiện luồng công việc hoặc trình tự các bước trong một quy trình hoặc chương trình.

“Unify architecture” nghĩa là gì?

Nghĩa là tìm cách đơn giản hơn và có tổ chức hơn để xử lý các tác vụ đang được làm lặp đi lặp lại hoặc phức tạp ở nhiều phần khác nhau của chương trình.

Pathfinder có viết mã để sửa chương trình không?

Không, nó chỉ phân tích mã hiện có, xác định vấn đề và tạo kế hoạch (hướng dẫn) để các công cụ khác thực hiện việc sửa.

Chi tiết

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

Map a codebase into feature-grouped flowcharts, identify duplicated concerns across features, and propose a unified architecture. Use when asked to "find the ideal path," unify duplicated systems, or audit architecture before a refactor. Emits a proposed unified flowchart plus per-system /make-plan prompts.

repo: thedotmack/claude-mem

Độ phổ biến

Sao GitHub
101k
Vị trí xếp hạng
#1277
Giấy phép
Apache-2.0
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ự