# Complete Rebrand: Patherly → ResolutionFlow

> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.

**Goal:** Replace every remaining "Patherly" reference in the codebase with "ResolutionFlow" so the brand is consistent across frontend, backend, docs, and comments.

**Architecture:** The frontend rebrand is already complete (PR #26). This plan covers the backend (config, API metadata, log messages, model docstrings, seed scripts), the root README, and CLAUDE.md. No database schema changes — the database name `patherly` and Docker container `patherly_postgres` stay as-is (infrastructure identifiers, not user-facing brand).

**Tech Stack:** Python/FastAPI backend, Markdown docs

---

## Scope Summary

| Area | Files | Type of Change |
|------|-------|---------------|
| Backend config | `config.py` | APP_NAME value |
| Backend API | `main.py` | OpenAPI metadata, log messages, root endpoint |
| Backend models | `user.py`, `category.py`, `step_category.py` | Docstring/comment text |
| Seed scripts | `seed_data.py`, `seed_trees.py` | Comments and print output |
| Root docs | `README.md` | Full rewrite of heading and tagline |
| Project context | `CLAUDE.md` | Update branding table and env var example |

**NOT changed** (infrastructure identifiers):
- Database name `patherly`, Docker container `patherly_postgres`
- Repository directory name `patherly/`
- Production URLs `app.patherly.com` / `api.patherly.com`
- Railway service name `patherly`
- File paths like `C:\Dev\Projects\patherly`

---

### Task 1: Backend Config — APP_NAME

**Files:**
- Modify: `backend/app/core/config.py:8`

**Step 1: Update APP_NAME**

Change line 8 from:
```python
APP_NAME: str = "Patherly"
```
to:
```python
APP_NAME: str = "ResolutionFlow"
```

**Step 2: Verify no other references in config.py**

Search `config.py` for "Patherly" — should return 0 matches after the edit.

---

### Task 2: Backend API — main.py

**Files:**
- Modify: `backend/app/main.py:21,28,33,47,74`

**Step 1: Update startup log (line 21)**

```python
# FROM:
logger.info("Starting Patherly API server...")
# TO:
logger.info("Starting ResolutionFlow API server...")
```

**Step 2: Update shutdown log (line 28)**

```python
# FROM:
logger.info("Shutting down Patherly API server...")
# TO:
logger.info("Shutting down ResolutionFlow API server...")
```

**Step 3: Update OpenAPI description (line 33)**

```python
# FROM:
description="Patherly - Take the path MOST traveled. Guided troubleshooting with automatic documentation.",
# TO:
description="ResolutionFlow - Take the path MOST traveled. Guided troubleshooting with automatic documentation.",
```

**Step 4: Update CORS comment (line 47)**

```python
# FROM:
# PLUS the explicit allowed_origins list (for custom domains like app.patherly.com)
# TO:
# PLUS the explicit allowed_origins list (for custom domains like app.resolutionflow.com)
```

Note: The actual CORS origin values in `config.py` are correct as-is (they use the real domain). This is just a comment.

**Step 5: Update root endpoint response (line 74)**

```python
# FROM:
"message": "Patherly API",
# TO:
"message": "ResolutionFlow API",
```

**Step 6: Run backend tests**

Run: `cd backend && python -m pytest -x -q`
Expected: All tests pass (no test references "Patherly" in assertions)

**Step 7: Commit**

```bash
git add backend/app/core/config.py backend/app/main.py
git commit -m "feat: Rebrand backend config and API metadata to ResolutionFlow"
```

---

### Task 3: Backend Model Docstrings

**Files:**
- Modify: `backend/app/models/user.py:53`
- Modify: `backend/app/models/category.py:19`
- Modify: `backend/app/models/step_category.py:18`

**Step 1: Update user.py docstring (line 53)**

```python
# FROM:
"""Returns True if user is a global (Patherly) admin."""
# TO:
"""Returns True if user is a global (ResolutionFlow) admin."""
```

**Step 2: Update category.py docstring (line 19)**

```python
# FROM:
- Global (team_id=NULL): Created by Patherly admins, visible to all
# TO:
- Global (team_id=NULL): Created by ResolutionFlow admins, visible to all
```

**Step 3: Update step_category.py docstring (line 18)**

```python
# FROM:
- Global (team_id=NULL): Created by Patherly admins, visible to all
# TO:
- Global (team_id=NULL): Created by ResolutionFlow admins, visible to all
```

**Step 4: Commit**

```bash
git add backend/app/models/user.py backend/app/models/category.py backend/app/models/step_category.py
git commit -m "docs: Update backend model docstrings from Patherly to ResolutionFlow"
```

---

### Task 4: Seed Scripts

**Files:**
- Modify: `backend/scripts/seed_data.py:3,409,461`
- Modify: `backend/scripts/seed_trees.py:5,3437`

**Step 1: Update seed_data.py docstring (line 3)**

```python
# FROM:
Seed data script for Patherly decision trees.
# TO:
Seed data script for ResolutionFlow decision trees.
```

**Step 2: Update seed_data.py print output (line 409)**

```python
# FROM:
print("\n[*] Patherly Database Seeder")
# TO:
print("\n[*] ResolutionFlow Database Seeder")
```

**Step 3: Update seed_data.py argparse description (line 461)**

```python
# FROM:
parser = argparse.ArgumentParser(description="Seed the Patherly database with example trees")
# TO:
parser = argparse.ArgumentParser(description="Seed the ResolutionFlow database with example trees")
```

**Step 4: Update seed_trees.py docstring (line 5)**

```python
# FROM:
This script populates Patherly with realistic troubleshooting decision trees
# TO:
This script populates ResolutionFlow with realistic troubleshooting decision trees
```

**Step 5: Update seed_trees.py argparse description (line 3437)**

```python
# FROM:
description="Seed the Patherly database with MSP/SMB troubleshooting trees"
# TO:
description="Seed the ResolutionFlow database with MSP/SMB troubleshooting trees"
```

**Step 6: Commit**

```bash
git add backend/scripts/seed_data.py backend/scripts/seed_trees.py
git commit -m "docs: Update seed script references from Patherly to ResolutionFlow"
```

---

### Task 5: README.md

**Files:**
- Modify: `README.md` (full update)

**Step 1: Update README heading and tagline (lines 1-2)**

```markdown
# FROM:
# Patherly

> Take the path MOST traveled.

# TO:
# ResolutionFlow

> Take the path MOST traveled.
```

**Step 2: Search the rest of README for "Patherly"**

The README is a legacy planning doc from early in the project. It doesn't reference "Patherly" elsewhere in the body text. Only the heading needs updating.

**Step 3: Commit**

```bash
git add README.md
git commit -m "docs: Update README heading from Patherly to ResolutionFlow"
```

---

### Task 6: CLAUDE.md — Branding Table and Env Var

**Files:**
- Modify: `CLAUDE.md:25,236`

**Step 1: Update branding table (line 25)**

The branding table row for Backend APP_NAME should now reflect the change:

```markdown
# FROM:
| Backend (FastAPI, env vars, APP_NAME) | Patherly |
# TO:
| Backend (FastAPI, env vars, APP_NAME) | ResolutionFlow |
```

**Step 2: Update env var example (line 236)**

```bash
# FROM:
APP_NAME=Patherly
# TO:
APP_NAME=ResolutionFlow
```

**Step 3: Update CORS comment references (lines 471, 476)**

These reference `app.patherly.com` which is the current production URL. Keep as-is — they're accurate infrastructure references, not brand names.

**Step 4: Commit**

```bash
git add CLAUDE.md
git commit -m "docs: Update CLAUDE.md to reflect backend rebrand to ResolutionFlow"
```

---

### Task 7: Final Verification

**Step 1: Search entire codebase for remaining "Patherly" references**

Run: `grep -r "Patherly" --include="*.py" --include="*.ts" --include="*.tsx" --include="*.md" --include="*.html" --include="*.css" --include="*.json" .`

**Expected remaining matches (all legitimate):**
- `CLAUDE.md` — only in the branding table context rows (repo name, database, URLs) and historical rebrand description
- `REBRAND-IMPLEMENTATION-GUIDE.md` — historical guide documenting the rebrand process
- `docs/plans/2026-02-04-complete-rebrand.md` — this plan file itself

**No matches should appear in:**
- `backend/app/**/*.py`
- `frontend/src/**/*`
- `README.md`

**Step 2: Run frontend build**

Run: `cd frontend && npm run build`
Expected: Build succeeds with no errors

**Step 3: Run backend tests**

Run: `cd backend && python -m pytest -x -q`
Expected: All tests pass

**Step 4: Push**

```bash
git push origin main
```

---

## Risk Assessment

**Risk: Backend tests break after APP_NAME change**
- Likelihood: Low — no tests assert on APP_NAME or the root endpoint message
- Mitigation: Run `pytest` after Task 2

**Risk: Production deployment affected**
- Likelihood: None — APP_NAME only affects OpenAPI metadata and log messages
- Mitigation: Railway auto-deploys on merge, no config change needed (APP_NAME is a code default, not an env var override)

**Risk: `.env` file has `APP_NAME=Patherly` hardcoded**
- Note: The `.env` file may override the code default. If so, update `.env` to `APP_NAME=ResolutionFlow` locally. Railway env vars may also need updating in the dashboard.
- This plan updates the code default. The `.env` file and Railway dashboard are manual steps flagged below.

## Manual Steps (Not in Git)

1. **Local `.env`**: If `backend/.env` has `APP_NAME=Patherly`, update to `APP_NAME=ResolutionFlow`
2. **Railway Dashboard**: If `APP_NAME` is set as an env var in Railway, update it there too
3. **Domain rename** (future): If/when `patherly.com` → `resolutionflow.com`, update production URLs in CLAUDE.md, config.py CORS, and Railway settings
