Pathfinder skill for Claude

Map a codebase into feature-grouped flowcharts, identify duplicated concerns across features, and propose a unified architecture.

When Claude uses it

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.

Pathfinder SKILL.md

The full skill file from thedotmack/claude-mem (Apache-2.0).

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:

  1. State the target unified component and its single entry point
  2. List the exact call sites to rewrite (from Phase 2 evidence)
  3. Cite the relevant flowchart file from 01-flowcharts/
  4. Include anti-pattern guards specific to this system

Format each as a fenced code block the user can copy directly into /make-plan.

Key Principles

  • Evidence over intuition — every diagram node and duplication claim cites file:line
  • Current state before ideal state — Phases 0–2 describe what IS; Phase 3 describes what SHOULD BE
  • Simplest unification wins — prefer deletion over abstraction; prefer one path over configurable paths
  • Specialization is not duplication — two components serving different trust models or data sources are legitimate even if their code looks similar
  • Handoff, don't implement — Pathfinder ends at plan prompts; /make-plan and /do take it from there

Failure Modes to Prevent

  • Drawing flowcharts from memory instead of source — redeploy subagent with grep evidence requirement
  • Proposing unification of legitimately specialized components — re-examine trust/data-source divergence
  • Handoff prompts that lack concrete call sites — rewrite with Phase 2 evidence
  • Skipping Phase 0 boundary review — fanning out on bad feature boundaries wastes all of Phase 1

How to install Pathfinder

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit thedotmack/claude-mem/plugin/skills/pathfinder#main ~/.claude/skills/pathfinder

Codex

npx degit thedotmack/claude-mem/plugin/skills/pathfinder#main ~/.codex/skills/pathfinder

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Pathfinder skill do?

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.

+How do I install Pathfinder in Claude Code?

Copy the skill folder into ~/.claude/skills/pathfinder, for example with "npx degit thedotmack/claude-mem/plugin/skills/pathfinder#main ~/.claude/skills/pathfinder". Claude Code loads it automatically and uses it when a task matches.

+Does Pathfinder work with ChatGPT or Codex?

Yes. Pathfinder uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/pathfinder. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Pathfinder free?

Pathfinder is published on GitHub by thedotmack under the Apache-2.0 license, which allows free use.

Related software development skills

  1. Code Review

    Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's…

    mattpocock/skills★ 327k
  2. Using Agent Skills

    Discovers and invokes agent skills. Use when starting a session, or when you need to decide which skill or workflow applies to the piece of…

    addyosmani/agent-skills★ 119k
  3. Build

    Fully automate a coding task with make-plan, do, and babysit.

    thedotmack/claude-mem★ 118k
  4. Smart Explore

    Token-optimized structural code search using tree-sitter AST parsing.

    thedotmack/claude-mem★ 118k
  5. Standup

    Facilitate a read-only standup across git worktrees, branches, or PRs to compare changes and produce one consolidation plan.

    thedotmack/claude-mem★ 118k
  6. Timeline Report

    Generate a "Journey Into [Project]" narrative report analyzing a project's entire development history from claude-mem's timeline.

    thedotmack/claude-mem★ 118k
  7. Version Bump

    Maintainer release workflow for the thedotmack/claude-mem repository only.

    thedotmack/claude-mem★ 118k
  8. What The

    What the? Use when the user wants a plain-English breakdown of something technical — the who, what, where, why, and when.

    thedotmack/claude-mem★ 118k
  9. Connect Apps

    Connect Claude to external apps like Gmail, Slack, GitHub. Use this skill when the user wants to send emails, create issues, post messages,…

    ComposioHQ/awesome-claude-skills★ 80k

See all software development skills →

More skills from thedotmack

  1. Request Progress

    Group recent conversations into overall requests, review each one's progress from memory, sort each into one of the owner's focus areas,…

    thedotmack/claude-mem★ 118k
  2. Screenpipe

    Search screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem.

    thedotmack/claude-mem★ 118k

All skills by thedotmack →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.