Skip to content

srpadrono/Pathfinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧭 Pathfinder

Map every user journey. See what's tested. Fill the gaps.

An AI-agent skill that discovers user journeys in any codebase, visualizes test coverage with interactive Mermaid diagrams, and generates framework-correct UI tests to close the gaps.

License: MIT Python 3 Tests-20 passing

Works with: Claude Code (plugin) Β· Codex Β· Gemini CLI Β· Cursor

Installation Β· How It Works Β· Supported Frameworks Β· Commands


🎯 The Problem

You have tests. But can you answer: "Which user journeys are actually covered?"

Line coverage says 78%. But can a user sign up, upload a file, and view the result end-to-end? Nobody knows. There's no map.

Pathfinder fixes this. It crawls your codebase, discovers every user journey, and produces a living coverage map β€” so you can see exactly where the gaps are and fill them systematically.

Pathfinder_Journey_Coverage.mp4

πŸ” How It Works

Pathfinder runs in four phases, each named after trail exploration:

πŸ—ΊοΈ Map

Discover the terrain

Deep dives into routes, screens, components, and API calls. Groups them into user journeys. Checks which steps already have tests.

πŸ”₯ Blaze

Mark the trail

Generates Mermaid flowcharts with βœ… tested and ❌ untested markers. Produces a coverage summary table.

πŸ”­ Scout

Explore the gaps

Generates framework-correct test skeletons for every ❌ step. Appends to existing files or creates new ones matching your patterns.

⛰️ Summit

Reach the peak

Runs all tests, reconciles results, updates the diagrams, and computes a coverage score. ❌ β†’ βœ…

flowchart LR
    MAP["**/map**\nDiscover journeys"]
    BLAZE["**/blaze**\nVisualize coverage"]
    SCOUT["**/scout**\nWrite tests"]
    SUMMIT["**/ summit**\nRun & verify"]
    J[("journeys.json\n\nSource of truth")]

    MAP ==> BLAZE ==> SCOUT ==> SUMMIT
    SUMMIT -.->|"Repeat"| MAP

    MAP --- J
    BLAZE --- J
    SCOUT --- J
    SUMMIT --- J

    style MAP fill:#1f6feb,stroke:#1158c7,color:#fff,stroke-width:2px
    style BLAZE fill:#e3b341,stroke:#b8860b,color:#000,stroke-width:2px
    style SCOUT fill:#2ea043,stroke:#1a7f37,color:#fff,stroke-width:2px
    style SUMMIT fill:#8957e5,stroke:#6e40c9,color:#fff,stroke-width:2px
    style J fill:#161b22,stroke:#30363d,color:#c9d1d9,stroke-width:2px

    linkStyle 4 stroke:#1f6feb,stroke-width:1px,stroke-dasharray:4
    linkStyle 5 stroke:#e3b341,stroke-width:1px,stroke-dasharray:4
    linkStyle 6 stroke:#2ea043,stroke-width:1px,stroke-dasharray:4
    linkStyle 7 stroke:#8957e5,stroke-width:1px,stroke-dasharray:4
Loading

The cycle repeats. New code β†’ /map β†’ new ❌ steps β†’ /scout β†’ /summit. The diagram always reflects reality.


πŸ“Š What You Get

Journey Flowcharts

Every user journey becomes a visual flowchart β€” green = tested, red = gap:

flowchart TD
    subgraph /login
        AUTH_01(βœ… Open login page)
        AUTH_02(βœ… Enter credentials)
        AUTH_03[❌ See error on wrong password]
    end
    subgraph /dashboard
        AUTH_04(βœ… See dashboard after login)
        AUTH_05[❌ Logout]
    end
    AUTH_01 --> AUTH_02
    AUTH_02 --> AUTH_03
    AUTH_03 -.-> AUTH_04
    AUTH_04 --> AUTH_05
    style AUTH_01 fill:#2ea043,stroke:#1a7f37,color:#fff
    style AUTH_02 fill:#2ea043,stroke:#1a7f37,color:#fff
    style AUTH_03 fill:#f85149,stroke:#da3633,color:#fff
    style AUTH_04 fill:#2ea043,stroke:#1a7f37,color:#fff
    style AUTH_05 fill:#f85149,stroke:#da3633,color:#fff
Loading

Coverage Table

| Journey            | Steps | Tested | Coverage    |
|--------------------|-------|--------|-------------|
| πŸ” Authentication  | 5     | 3      | 🟑 60.0%   |
| πŸ“€ File Upload     | 8     | 0      | πŸ”΄ 0.0%    |
| πŸ“„ Reports         | 12    | 7      | 🟑 58.3%   |
| πŸ’¬ Chat            | 6     | 6      | 🟒 100.0%  |
| **Total**          | **31**| **16** | **51.6%**   |

Coverage Score

Score Status Meaning
🟒 80%+ Excellent Ship it
🟑 50–79% Acceptable Document the gaps
πŸ”΄ <50% Insufficient Keep scouting

πŸͺ Example

Here's Pathfinder on a food delivery app's checkout module β€” 5 journeys, 28 steps, taken from 52% to 100% coverage in one session.

πŸ“Έ Before (52%)

flowchart TD
    ENTRY{{"πŸ”€ Cart type?"}}
    STANDARD("βœ… Standard delivery items")
    PICKUP["❌ Pickup order - no address needed"]
    ENTRY -->|"Delivery"| STANDARD
    ENTRY -->|"Pickup"| PICKUP
    CHECKOUT("βœ… User sees order summary")
    STANDARD --> CHECKOUT
    PICKUP --> CHECKOUT
    CHECKOUT_decision{{"πŸ”€ User action?"}}
    CHECKOUT --> CHECKOUT_decision
    PAY("βœ… User taps Pay Now")
    CHECKOUT_decision -->|"Pay"| PAY
    PAY_LOADING[/"⚠️ Payment processing"/]
    PAY --> PAY_LOADING
    PAY_OK("βœ… Order confirmed screen")
    PAY_LOADING -.-> PAY_OK
    PAY_OK_decision{{"πŸ”€ Tip enabled?"}}
    PAY_OK --> PAY_OK_decision
    TRACK["❌ Tap Track My Order"]
    PAY_OK_decision -->|"Always"| TRACK
    TIP["❌ Tap Add Tip"]
    PAY_OK_decision -->|"Flag on"| TIP
    EDIT("βœ… User taps Edit Order")
    CHECKOUT_decision -->|"Edit"| EDIT
    PROMO("βœ… User applies promo code")
    EDIT --> PROMO
    PROMO_OK("βœ… Discount applied")
    PROMO --> PROMO_OK
    PROMO_FAIL["❌ Invalid promo alert"]
    PROMO -.->|"⚑ Invalid"| PROMO_FAIL
    ERR_PAY["❌ Payment fails - card declined"]
    PAY_LOADING -.->|"⚑ Error"| ERR_PAY
    ERR_ALERT["❌ Error alert with Retry"]
    ERR_PAY --> ERR_ALERT
    ERR_RETRY["❌ User taps Retry"]
    ERR_ALERT --> ERR_RETRY
    style ENTRY fill:#1f6feb,stroke:#1158c7,color:#fff
    style STANDARD fill:#2ea043,stroke:#1a7f37,color:#fff
    style PICKUP fill:#f85149,stroke:#da3633,color:#fff
    style CHECKOUT fill:#2ea043,stroke:#1a7f37,color:#fff
    style CHECKOUT_decision fill:#1f6feb,stroke:#1158c7,color:#fff
    style PAY fill:#2ea043,stroke:#1a7f37,color:#fff
    style PAY_LOADING fill:#d29922,stroke:#b87d14,color:#fff
    style PAY_OK fill:#2ea043,stroke:#1a7f37,color:#fff
    style PAY_OK_decision fill:#1f6feb,stroke:#1158c7,color:#fff
    style TRACK fill:#f85149,stroke:#da3633,color:#fff
    style TIP fill:#f85149,stroke:#da3633,color:#fff
    style EDIT fill:#2ea043,stroke:#1a7f37,color:#fff
    style PROMO fill:#2ea043,stroke:#1a7f37,color:#fff
    style PROMO_OK fill:#2ea043,stroke:#1a7f37,color:#fff
    style PROMO_FAIL fill:#f85149,stroke:#da3633,color:#fff
    style ERR_PAY fill:#f85149,stroke:#da3633,color:#fff
    style ERR_ALERT fill:#f85149,stroke:#da3633,color:#fff
    style ERR_RETRY fill:#f85149,stroke:#da3633,color:#fff
Loading

πŸš€ After (100%)

flowchart TD
    ENTRY{{"πŸ”€ Cart type?"}}
    STANDARD("βœ… Standard delivery items")
    PICKUP("βœ… Pickup order - no address needed")
    ENTRY -->|"Delivery"| STANDARD
    ENTRY -->|"Pickup"| PICKUP
    CHECKOUT("βœ… User sees order summary")
    STANDARD --> CHECKOUT
    PICKUP --> CHECKOUT
    CHECKOUT_decision{{"πŸ”€ User action?"}}
    CHECKOUT --> CHECKOUT_decision
    PAY("βœ… User taps Pay Now")
    CHECKOUT_decision -->|"Pay"| PAY
    PAY_LOADING("βœ… Payment processing")
    PAY --> PAY_LOADING
    PAY_OK("βœ… Order confirmed screen")
    PAY_LOADING -.-> PAY_OK
    PAY_OK_decision{{"πŸ”€ Tip enabled?"}}
    PAY_OK --> PAY_OK_decision
    TRACK("βœ… Tap Track My Order")
    PAY_OK_decision -->|"Always"| TRACK
    TIP("βœ… Tap Add Tip")
    PAY_OK_decision -->|"Flag on"| TIP
    EDIT("βœ… User taps Edit Order")
    CHECKOUT_decision -->|"Edit"| EDIT
    PROMO("βœ… User applies promo code")
    EDIT --> PROMO
    PROMO_OK("βœ… Discount applied")
    PROMO --> PROMO_OK
    PROMO_FAIL("βœ… Invalid promo alert")
    PROMO -.->|"⚑ Invalid"| PROMO_FAIL
    ERR_PAY("βœ… Payment fails - card declined")
    PAY_LOADING -.->|"⚑ Error"| ERR_PAY
    ERR_ALERT("βœ… Error alert with Retry")
    ERR_PAY --> ERR_ALERT
    ERR_RETRY("βœ… User taps Retry")
    ERR_ALERT --> ERR_RETRY
    style ENTRY fill:#1f6feb,stroke:#1158c7,color:#fff
    style STANDARD fill:#2ea043,stroke:#1a7f37,color:#fff
    style PICKUP fill:#2ea043,stroke:#1a7f37,color:#fff
    style CHECKOUT fill:#2ea043,stroke:#1a7f37,color:#fff
    style CHECKOUT_decision fill:#1f6feb,stroke:#1158c7,color:#fff
    style PAY fill:#2ea043,stroke:#1a7f37,color:#fff
    style PAY_LOADING fill:#2ea043,stroke:#1a7f37,color:#fff
    style PAY_OK fill:#2ea043,stroke:#1a7f37,color:#fff
    style PAY_OK_decision fill:#1f6feb,stroke:#1158c7,color:#fff
    style TRACK fill:#2ea043,stroke:#1a7f37,color:#fff
    style TIP fill:#2ea043,stroke:#1a7f37,color:#fff
    style EDIT fill:#2ea043,stroke:#1a7f37,color:#fff
    style PROMO fill:#2ea043,stroke:#1a7f37,color:#fff
    style PROMO_OK fill:#2ea043,stroke:#1a7f37,color:#fff
    style PROMO_FAIL fill:#2ea043,stroke:#1a7f37,color:#fff
    style ERR_PAY fill:#2ea043,stroke:#1a7f37,color:#fff
    style ERR_ALERT fill:#2ea043,stroke:#1a7f37,color:#fff
    style ERR_RETRY fill:#2ea043,stroke:#1a7f37,color:#fff
Loading

πŸ“Š Coverage Delta

Journey Before After Delta
πŸ›’ Checkout (Pay) 50% 100% +3 steps
✏️ Edit Order (Promo) 75% 100% +1 step
πŸš— Pickup variant 0% 100% +1 step
πŸ’³ Payment errors 0% 100% +3 steps
πŸ’° Tip feature flag 0% 100% +1 step
Total 52% βœ… 100% +9 steps, 22 tests

All generated in one /map β†’ /blaze β†’ /scout β†’ /summit session.


πŸ› οΈ Supported Frameworks

Pathfinder auto-detects your UI test framework and generates tests with the correct selectors, waits, and patterns:

Framework Platform Selectors Auto-detected from
Playwright Web getByRole, getByTestId playwright.config.ts
Cypress Web cy.get('[data-cy=]') cypress.config.ts
Maestro Mobile id:, text: Expo app.json
Detox React Native by.id(), by.label() .detoxrc.js
XCUITest iOS app.buttons[""] .xcodeproj
Espresso Android withId(), withText() build.gradle
Flutter Flutter find.byKey() integration_test/

Each framework has a dedicated reference guide with selector strategies, wait patterns, and test templates β€” loaded only when needed.


🧠 Smart Test Generation

The test generator adapts to your project's existing patterns:

# Auto-detect: appends to existing auth.spec.ts or creates new file
python3 ~/.agents/skills/pathfinder/scripts/generate-ui-test.py \
  AUTH-05 "Logout redirects to login" playwright --route /dashboard --auto
Feature How it works
Auto-append Finds existing journey file β†’ inserts inside test.describe() block
Auto-create No existing file β†’ creates with proper imports, describe wrapper, auth setup
Test directory Reads from playwright.config.ts / cypress.config.ts β€” no hardcoded paths
Auth detection Detects storageState pattern and includes authenticated setup
Selectors Accessibility-first: getByRole > getByTestId > getByText > CSS (last resort)
Waits Condition-based only: waitForLoadState, waitForExistence β€” never sleep()
Visual regression Screenshot baseline capture + pixel-level diff comparison

Installation

bash <(curl -fsSL https://raw.githubusercontent.com/srpadrono/Pathfinder/main/install/install.sh)

One command β€” installs the repo, symlinks skills, and registers the Claude Code plugin. Supports update, uninstall, and --version flags. See docs/installation.md for details.


πŸ’» Commands

Agent Commands

Command What happens
/map Discover all user journeys in the codebase
/blaze Generate Mermaid flowcharts
/scout Write UI tests for untested steps
/summit Run tests, update diagrams, compute score

πŸ“ Project Structure

~/.agents/pathfinder/ (repo clone)

Path Purpose
.claude-plugin/ Plugin + marketplace manifest (plugin.json, marketplace.json)
skills/pathfinder/ Main skill β€” auto-triggers on coverage questions
skills/pathfinder/SKILL.md Entry point
skills/pathfinder/references/ 8 framework + testing reference docs
skills/pathfinder/scripts/ 10 Python CLI tools
skills/pathfinder/assets/ Starter templates
skills/map/, blaze/, scout/, summit/ /map, /blaze, /scout, /summit command skills
install/ Installer
tests/ 55 self-tests
.githooks/ pre-commit, post-commit, pre-push

~/.agents/skills/ (symlinks)

Symlink Target
pathfinder ~/.agents/pathfinder/skills/pathfinder
map ~/.agents/pathfinder/skills/map
blaze ~/.agents/pathfinder/skills/blaze
scout ~/.agents/pathfinder/skills/scout
summit ~/.agents/pathfinder/skills/summit

πŸ”— Git Hooks

Enable with: git config core.hooksPath ~/.agents/pathfinder/.githooks

Hook What it does
pre-commit Validates journeys.json is valid JSON
post-commit Auto-regenerates diagrams when journeys.json changes
pre-push Blocks direct push to main / master

πŸ“‹ Requirements

Requirement Purpose
Python 3 Runs all scripts
Git Version control for journey maps
UI test framework Auto-detected, or specify in config
Pillow (optional) Pixel-level visual regression

πŸ“„ License

MIT License β€” see LICENSE for details.

Copyright (c) 2026 Sergio Padron and Pathfinder contributors.


Map the terrain. Blaze the markers. Scout the gaps. Reach the summit.

πŸ—ΊοΈ β†’ πŸ”₯ β†’ πŸ”­ β†’ ⛰️

Get Started Β· View on GitHub

About

AI-agent skill that maps user journeys, visualizes test coverage with Mermaid diagrams, and generates UI tests to close gaps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages