# New Project SOP

Purpose: every new Local Reach Web Design project should start portable, versioned, and ready for Codex, iCloud, GitHub, WARP, and future deployment automation.

## 1. Create The Workspace

Create the project under iCloud `Shared Projects`:

```text
~/Library/Mobile Documents/com~apple~CloudDocs/Shared Projects/<category>/<project-name>/
```

Recommended categories:

- `LRWD/` for internal Local Reach properties and systems
- `client-projects/` for client projects
- `traveltechus/`, `alohachallengecoins/`, or another brand folder when a brand has multiple related repos
- `archived-projects/` only for inactive or historical work

## 2. Standard Folder Shape

Use this baseline:

```text
project-name/
AGENTS.md
README.md
deployment.md
SOP.md
.gitignore
docs/
assets/
backups/
src/
```

Only create folders that make sense. Do not put large backup archives in `backups/` unless explicitly required; TrueNAS/Backblaze are the durable backup lanes.

## 3. Default `.gitignore`

Use:

```gitignore
node_modules/
.next/
dist/
.cache/
.env
.env.local
*.zip
*.sql
*.sql.gz
*.tgz
.DS_Store
wp-config.php
```

Add project-specific ignores for uploads, cache folders, generated exports, local scratch files, and secret-bearing artifacts.

## 4. Initialize Git

```bash
git init -b main
git add .
git commit -m "Initial project standardization"
```

Never commit:

- API keys
- secrets
- tokens
- `.env` files
- SSH keys
- `wp-config.php`
- database dumps
- customer form submissions
- full WordPress uploads

## 5. Create Private GitHub Repo

Use private repos under `localreachwd`.

For projects with no existing server/deploy remote:

```bash
gh repo create localreachwd/<repo-name> --private
git remote add origin https://github.com/localreachwd/<repo-name>.git
git push -u origin main
```

For projects with an existing deployment remote named `origin`, preserve it and use:

```bash
gh repo create localreachwd/<repo-name> --private
git remote add github https://github.com/localreachwd/<repo-name>.git
git push -u github main
```

Current standard: GitHub remotes use HTTPS with the `gh` credential helper until broad account-level SSH auth is corrected.

## 6. Write `AGENTS.md`

Include:

- project overview
- current source of truth
- stack/framework
- live/deployment targets
- WARP/Zero Trust notes
- VPS/server notes
- important commands
- known constraints
- AI assistant instructions
- client/business context where useful

For live websites, state clearly whether live production is authoritative and which local source folders are filtered live-derived copies.

## 7. Write `README.md`

Include:

- what the project is
- canonical iCloud path
- setup workflow
- install/build/run commands when applicable
- where source lives
- where production lives
- troubleshooting basics

## 8. Write `deployment.md`

Include:

- deployment target
- GitHub remote
- server/deploy remote if any
- WARP SSH aliases
- Cloudflare/DNS/CDN dependencies
- PM2/build/restart commands when applicable
- rollback path
- verification checklist

## 9. Write `SOP.md`

Include:

- normal start checklist
- sync across devices
- GitHub workflow
- backup/restore workflow
- onboarding a new Mac/device
- WARP access workflow
- deployment checklist
- troubleshooting sync conflicts
- naming conventions
- maintenance schedule

## 10. Verify

Before calling the project standardized:

```bash
git status --short --branch
git remote -v
```

Confirm:

- iCloud path is canonical
- Git status is clean
- private GitHub remote exists
- `AGENTS.md`, `README.md`, `deployment.md`, and `SOP.md` exist
- secrets and backups are excluded
- live/deployment source of truth is documented
