# Unify Duplicated Architecture

Maps features into flowcharts and proposes one unified architecture before a refactor.

- Repository: https://github.com/thedotmack/claude-mem (109099 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add thedotmack/claude-mem --skill pathfinder -g -a claude-code -y`
Codex: `npx skills add thedotmack/claude-mem --skill pathfinder -g -a codex -y`
Cursor: `npx skills add thedotmack/claude-mem --skill pathfinder -g -a cursor -y`
Gemini CLI: `npx skills add thedotmack/claude-mem --skill pathfinder -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add thedotmack/claude-mem`

## 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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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)

The rest: https://github.com/thedotmack/claude-mem/blob/HEAD/plugin/skills/pathfinder/SKILL.md
