# Solomon Schema — Claude Development Guide

**Version:** 3.0.0-babel  
**Status:** Phase 6 Complete  
**Last Updated:** 2026-08-06  
**Plugin Slug:** bw-schema  
**Code Prefix:** bw_schema_

---

## Quick Start for Claude

This plugin is being built from scratch with a focus on clean architecture and maintainability.

### Before You Start

1. Read `/home/adi/BW_SCHEMA_PLUGIN_REFACTOR_PLAN.md` for the full vision
2. Read `docs/BABEL-BUILD.md` for current progress and architecture
3. Check what phase we're in (see below)

### What This Plugin Does

**Solomon Schema** unifies schema markup (structured data) for AI systems and search engines.

**Key Features:**
- Organization schema (business identity)
- Multi-location support
- Author/team management
- 15+ schema types (Article, Product, Event, etc.)
- Survey workflow (collect team info from visitors)
- Configuration export/import
- Caching and conflict detection

### Key Architecture Decisions

✅ **Services Layer** — Pure business logic, reusable, testable
✅ **Form Builder** — Declarative forms (data-driven, not code-driven)
✅ **Page Classes** — Modular admin pages, single responsibility
✅ **Fresh Codebase** — Not refactoring the old plugin; starting clean
✅ **Modern Patterns** — Following WordPress best practices

### Plugin Constants

```php
BW_SCHEMA_VERSION           // '3.0.0-babel'
BW_SCHEMA_PLUGIN_DIR        // Plugin directory path
BW_SCHEMA_PLUGIN_URL        // Plugin directory URL
BW_SCHEMA_PLUGIN_FILE       // Main plugin file path
BW_SCHEMA_PREFIX            // 'bw_schema_' (for options, hooks, etc.)
```

### Autoloader

Classes are auto-loaded from:
- `includes/class-bw-schema-*.php` → `BW_Schema_*`
- `admin/services/class-bw-schema-service-*.php` → `BW_Schema_Service_*`

Example:
```php
// This automatically loads admin/services/class-bw-schema-service-organization.php
$org = BW_Schema_Service_Organization::get();
```

---

## Plugin Naming Convention

**Important:** This plugin uses two naming conventions for different purposes:

1. **Code-level (Internal):** `bw-schema`, `bw_schema_`, `BW_Schema_*`
   - Used for folder names, file names, class prefixes, function prefixes, database option keys
   - Makes the code clear about what the plugin does
   - Easier for developers to understand

2. **User-facing (Branding):** "Solomon Schema"
   - What users see in the WordPress admin menu and page titles
   - The marketing/brand name for the plugin
   - Professional, memorable, connects to the concept of wisdom + structured data

The separation means:
- Code stays technical and clear (`bw-schema` prefix tells you it's schema-related)
- Users get a memorable brand name (`Solomon Schema`)

---

## Current Status: Phase 6 Complete ✅

**What's Done:**
- ✅ Services Layer (5 services: Organization, Locations, People, Survey, Cache)
- ✅ Form Builder with 13+ field types
- ✅ Admin Pages (7 pages: Dashboard, Organization, Locations, People, Content, Tools, Help)
- ✅ Schema Rendering (13+ schema types)
- ✅ Database Migration & Setup
- ✅ Frontend Schema Output
- ✅ Full error handling with Throwable
- ✅ Support classes (FAQ, Review, Rating, Hours, Location, Media, WebPage)

**Total:** 48 PHP files, 60+ features, 80+ schema properties

---

## Working with Services

[Rest of content same as before...]
