Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

pathfinder — Claude Code skill for architecture audits

This skill maps feature flows, finds duplicated concerns, and proposes a unified architecture. Use it to inspect a codebase before a refactor.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add thedotmack/claude-mem --skill pathfinder -a claude-code
Open on GitHub

What pathfinder does

Pathfinder first explores the project structure and proposes feature boundaries. Subagents then trace each feature into Mermaid flowcharts, including side effects and external dependencies. Reports need file-and-line citations; unsupported duplication claims are rejected.

The output goes into PATHFINDER-<YYYY-MM-DD>/: a feature inventory, flowcharts, a duplication report, an architecture proposal, and handoff prompts for /make-plan. Pathfinder does not write implementation code. You will need a separate step to carry out the proposed changes.

What it helps with

  • map project features and their entry points
  • trace each feature's main execution path
  • find repeated logic across subsystems
  • propose a unified design while preserving legitimate specializations
  • prepare /make-plan prompts for consolidated systems

Example prompts for the agent

  • Use pathfinder to map this codebase into feature flowcharts with file-and-line citations.
  • Run pathfinder to find duplicated storage logic across features and propose a unified design.
  • Audit the architecture before a refactor and prepare `/make-plan` prompts for the systems that should be consolidated.

How to install pathfinder

1Skills CLI (Vercel)

npx skills add thedotmack/claude-mem --skill pathfinder -a claude-code

2Manually: put the files in place

~/.claude/skills/pathfinder/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/pathfinder/

From the same set15

The whole set →
mem-search thedotmack Searches memory for solutions and context from previous coding sessions when you need to recall past work. Claude Code CX Codex Cursor +1 8,900installs smart-explore thedotmack Uses tree-sitter to map code structure and find symbols. Useful when you need to explore a codebase without loading every full file. Claude Code CX Codex Cursor +1 7,300installs make-plan thedotmack Turns a feature request into a phased plan built on real documentation instead of guesses. Useful right before you run do. Claude Code CX Codex Cursor +1 7,200installs do thedotmack The skill runs an implementation plan in phases through subagents. Use it when a plan needs execution with checks after each phase. Claude Code CX Codex Cursor +1 7,000installs knowledge-agent thedotmack Builds focused knowledge corpora from claude-mem observations and lets you query them in an AI session. Useful for reviewing past work by topic or project. Claude Code CX Codex Cursor +1 5,700installs learn-codebase thedotmack Instructs the agent to read every source file in full before starting work. Built for onboarding on unfamiliar repositories. Claude Code CX Codex Cursor +1 5,300installs how-it-works thedotmack Explains how claude-mem works behind the scenes. It covers tool observation logging, local file storage, and memory injection timing. Claude Code CX Codex Cursor +1 5,100installs wowerpoint thedotmack Turns a single text document into a kawaii NotebookLM slide deck via CLI. Helpful when you need to render an architecture doc or report into clear, shareable slides. Claude Code CX Codex Cursor +1 4,400installs

Similar

hexagonal-architecture affaan-m Guides you in structuring Ports and Adapters systems across TypeScript, Java, Kotlin, and Go. Helps isolate domain logic when code gets tangled with I/O. Claude Code CX Codex Cursor +1 4,700installs frontend-a11y affaan-m Accessibility patterns for React and Next.js covering forms, ARIA, keyboard input, and focus. Use it during implementation or code review. Claude Code CX Codex Cursor +1 4,700installs flutter-dart-code-review affaan-m A review checklist for Flutter and Dart code: widgets, state management, Dart idioms, performance and security. Works with any state library. Claude Code CX Codex Cursor +1 4,700installs migrate-ai-sdk-v6-to-v7 vercel Migrates applications from Vercel AI SDK 6.x to 7.0. It updates dependencies, fixes breaking API changes, and rewrites step-handling patterns. Claude Code CX Codex Cursor +1 5,500installs production-audit affaan-m Checks whether an app is ready to ship and what will break in production. Runs on local evidence, so repo data stays on your machine. Claude Code CX Codex Cursor +1 4,600installs make-interfaces-feel-better affaan-m This skill helps review and refine interface details such as spacing, typography, interaction states, and motion. Use it when a component feels unfinished or visually off. Claude Code CX Codex Cursor +1 4,600installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. Claude Code 1,141,062installs

Questions about pathfinder

How do I install pathfinder in Claude Code?

Run npx skills add thedotmack/claude-mem --skill pathfinder -a claude-code.

What does the pathfinder skill do?

It maps features, creates Mermaid flowcharts, identifies duplicated concerns, and drafts a unified architecture proposal. It does not implement code changes.

Does pathfinder modify project code?

No. It produces reports and /make-plan handoff prompts; implementation happens in a later step.

Source text

SKILL.md · Apache-2.0
---
name: pathfinder
description: 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.
---

# 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

© thedotmack · Apache-2.0 · thedotmack/claude-mem

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor