windhamdavid 4 days ago
parent
commit
bf3ba880d7
7 changed files with 143 additions and 0 deletions
  1. 17 0
      .claude/settings.json
  2. 2 0
      .gitignore
  3. 75 0
      CLAUDE.md
  4. 19 0
      _claude/README.md
  5. 0 0
      _claude/notes/.gitkeep
  6. 30 0
      _claude/notes/db-sync.md
  7. 0 0
      _claude/plans/.gitkeep

+ 17 - 0
.claude/settings.json

@@ -0,0 +1,17 @@
+{
+  "permissions": {
+    "allow": [
+      "Bash(wp:*)",
+      "Bash(gulp:*)",
+      "Bash(npm run:*)",
+      "Bash(npx gulp:*)",
+      "Bash(composer:*)",
+      "Bash(git status)",
+      "Bash(git diff:*)",
+      "Bash(git log:*)",
+      "Bash(git add:*)",
+      "Bash(git commit:*)",
+      "Bash(php -l:*)"
+    ]
+  }
+}

+ 2 - 0
.gitignore

@@ -8,3 +8,5 @@ node_modules/
 
 
 .idea/
 .idea/
 .vscode/
 .vscode/
+
+_claude/scratch/

+ 75 - 0
CLAUDE.md

@@ -0,0 +1,75 @@
+# CLAUDE.md
+
+Guidance for Claude Code when working in this repository.
+
+## What this is
+
+`daw` — the custom WordPress theme behind [davidawindham.com](https://davidawindham.com),
+running since 2004. This git repo covers **the theme only**
+(`wp-content/themes/daw`), not the full WordPress install. It is a classic
+(non-block) PHP theme with a hand-rolled gulp build. Expect cruft: ~22 years of
+accumulated pages, libraries, and dead code. Confirm before deleting anything
+you didn't write — old code here is often load-bearing in non-obvious ways.
+
+## Environment
+
+- **Local URL:** https://daw.ovid (Apache via Homebrew, self-signed cert)
+- **WP install root:** `/Users/david/Sites/daw` (theme is `wp-content/themes/daw`)
+- **PHP:** 8.3 · **Node:** 22 · **WP-CLI:** 2.12 (`wp` on PATH)
+- **Plugins in play:** Gravity Forms (+ Stripe/Signature/PDF), Akismet,
+  WP Super Cache, WP Sweep, `dw-guten` (custom Gutenberg sidebar/metaboxes)
+
+## Build (gulp 4, task-based — there is no default task)
+
+Run from the theme directory:
+
+| Command        | What it does                                                        |
+|----------------|---------------------------------------------------------------------|
+| `gulp copy`    | Pull vendor assets out of `node_modules` into `js/` and `css/` (`v4-*`) |
+| `gulp mixin`   | Compile `css/**/*.scss` → `.css`                                     |
+| `gulp build`   | Concat + minify the main stylesheet → `v4-style.min.css`             |
+| `gulp cssf`    | Minify front-page CSS → `css/v4-front.min.css`                       |
+| `gulp js`      | Concat + minify main scripts → `js/v4-script.min.js`                 |
+| `gulp jsf`     | Concat + minify front-page scripts → `js/v4-front.min.js`            |
+| `gulp run`     | BrowserSync proxy of https://daw.ovid + watch (scss/css/php/js)      |
+
+Edit **source** (`style.css`, `css/*.scss`, `css/*.css`, `js/scripts.js`,
+`js/front-page.js`), then rebuild. Never hand-edit the generated `v4-*.min.*`
+files — they are clobbered on the next build.
+
+## Layout
+
+- **Templates:** standard WP hierarchy at theme root (`front-page.php`,
+  `single.php`, `archive.php`, `page-{slug}.php`, etc.). Many `page-*.php` map to
+  specific pages by slug (`about`, `studio`, `music`, `art`, `contact`, `desk`…).
+- **`inc/`:** theme PHP loaded from `functions.php` —
+  `utils.php`, `template.php`, `tweaks.php` (always), plus `smtp.php`, `form.php`,
+  `analytics.php` loaded conditionally. `inc/lib/` holds vendored helpers
+  (Twilio call/SMS, simple_html_dom).
+- **`header-*.php` / `footer-*.php`:** page-specific variants (`-home`, `-studio`).
+- Asset loading is centralized in `dw_scripts()` in `functions.php` — a big
+  per-page `if/elseif` ladder keyed on `is_page('slug')`. Add new page assets there.
+
+## Conventions
+
+- Function/handle prefix is `dw_`. Match it.
+- `.editorconfig` is the standard: **2-space indent**, LF, UTF-8, final newline,
+  trim trailing whitespace. (Older files have mixed tabs — follow editorconfig
+  for new/edited code.)
+- jQuery is deregistered globally and re-enqueued only where needed; don't assume
+  it's present.
+- Analytics is self-hosted Matomo (`/wik/`), injected in `wp_footer`.
+
+## Working notes
+
+Scratch space, plans, and investigation notes live in `_claude/` — see
+`_claude/README.md`. Keep generated artifacts and throwaway scripts there, not at
+the theme root.
+
+## Gotchas
+
+- `style.css` is both the WP theme manifest (header comment) **and** real CSS —
+  don't strip the header.
+- `img/` and `inc/lib/call/auth.php` are gitignored (secrets/assets).
+- Two minified stylesheets exist (`style.min.css`, `v4-style.min.css`); the theme
+  enqueues **`v4-style.min.css`**. `style.min.css` is legacy.

+ 19 - 0
_claude/README.md

@@ -0,0 +1,19 @@
+# _claude
+
+Working directory for Claude Code — scratch space, plans, and investigation
+notes that shouldn't clutter the theme root or end up in the deployed theme.
+
+## Layout
+
+- `plans/` — implementation plans and design notes for in-progress work
+  (DB sync, MCP adapter, abilities plugin, cruft cleanup).
+- `notes/` — findings worth keeping: how a subsystem works, decisions made, why.
+- `scratch/` — throwaway scripts, one-off queries, DB dumps, experiments.
+  **Gitignored.** Nothing here is durable.
+
+## Conventions
+
+- Anything in `scratch/` can be deleted at any time — don't put the only copy of
+  something there.
+- `plans/` and `notes/` are committed so the reasoning survives across sessions.
+- Don't reference files in here from theme PHP — it's not loaded by WordPress.

+ 0 - 0
_claude/notes/.gitkeep


+ 30 - 0
_claude/notes/db-sync.md

@@ -0,0 +1,30 @@
+# Remote DB sync (production → local)
+
+Config lives in `/Users/david/Sites/daw/wp-cli.yml` (`@production` alias). Set the
+real SSH `user@host:/path` there first; needs WP-CLI on the remote + SSH key.
+
+## Pull production into local
+
+```bash
+# 1. Back up local first
+wp db export _claude/scratch/local-backup-$(date +%F).sql   # run from theme dir
+
+# 2. Stream prod DB straight into local (no intermediate file)
+wp @production db export - | wp db import -
+
+# 3. Rewrite URLs (and fix serialized data safely)
+wp search-replace 'https://davidawindham.com' 'https://daw.ovid' --skip-columns=guid
+
+# 4. Flush caches (WP Super Cache is active)
+wp cache flush
+```
+
+## Notes / gotchas
+
+- **`--skip-columns=guid`** — never rewrite GUIDs; they're permanent identifiers.
+- This is a **one-way pull** (prod → local). Never run an import against prod.
+- Large `wp_options` autoload / transients can bloat the dump — consider
+  `wp transient delete --all` on local after import.
+- Matomo analytics + Gravity Forms entries come down with the DB; fine for a dev
+  copy, but don't push this DB anywhere public.
+- Uploads (`wp-content/uploads`) are a separate sync (rsync), not part of the DB.

+ 0 - 0
_claude/plans/.gitkeep