# CLAUDE.md
This file provides guidance to Claude Code when working with this repository.
## Project Overview
**MokoJoomOpenGraph** -- Open Graph, Twitter Card, and social sharing meta tag management for Joomla
| Field | Value |
|---|---|
| **Platform** | joomla |
| **Language** | PHP |
| **Default branch** | main |
| **License** | GPL-3.0-or-later |
| **Wiki** | [MokoJoomOpenGraph Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomOpenGraph/wiki) |
| **Standards** | [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home) |
## Common Commands
```bash
make build # Build the project
make lint # Run linters
make validate # Validate structure
make release # Full release pipeline
make minify # Minify CSS/JS assets
make clean # Clean build artifacts
```
```bash
composer install # Install PHP dependencies
```
## Architecture
This is a Joomla **package** extension (`pkg_mokoog`) containing three sub-extensions:
### com_mokoog (Component)
- Admin backend for viewing and managing all OG tag records
- Joomla 4/5 MVC: `Controller/DisplayController`, `Model/TagsModel`, `View/Tags/HtmlView`, `Table/TagTable`
- Namespace: `Joomla\Component\MokoOG\Administrator`
- Database table: `#__mokoog_tags` — stores custom OG data per content item
### plg_system_mokoog (System Plugin)
- Hooks `onBeforeCompileHead` to inject `` and `` tags
- Auto-generates tags from article title, description, and images when no custom tags exist
- Supports articles (`com_content`), menu items, and extensible content types
- Namespace: `Joomla\Plugin\System\MokoOG`
### plg_content_mokoog (Content Plugin)
- Hooks `onContentPrepareForm` to add OG fields tab to article and menu item editors
- Hooks `onContentAfterSave` / `onContentAfterDelete` to persist/clean OG data
- Namespace: `Joomla\Plugin\Content\MokoOG`
### Database Schema
Single table `#__mokoog_tags`:
- `content_type` + `content_id` = unique key identifying any content item
- `og_title`, `og_description`, `og_image`, `og_type` = custom OG overrides
- `published` flag for enabling/disabling per-item
## Rules
- **Never commit** `.claude/`, `.mcp.json`, `TODO.md`, or `*.min.css`/`*.min.js`
- **Attribution**: use `Authored-by: Moko Consulting` in commits
- **Branch strategy**: develop on `dev`, merge to `main` for release
- **Minification**: handled at build time (CI)
- **Wiki**: documentation lives in the Gitea wiki, not in `docs/` files
- **Standards**: this repo follows [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)
## Coding Standards
- PHP 8.1+ minimum
- Joomla 4/5 DI container pattern: `services/provider.php` → Extension class
- Legacy stub `.php` file required for plugin loader but empty
- `SubscriberInterface` for event subscription (not `on*` method naming)
- `bind() → check() → store()` for Table operations (not `save()`)
- Language file placement: site (no `folder`) vs admin (`folder="administrator"`)
- SPDX license headers on all PHP files