diff --git a/.mokogitea/CLAUDE.md b/.mokogitea/CLAUDE.md new file mode 100644 index 0000000..8aefbbf --- /dev/null +++ b/.mokogitea/CLAUDE.md @@ -0,0 +1,67 @@ +# MokoJoomOpenGraph + +Open Graph, Twitter Card, and social sharing meta tag management for Joomla. Per-article SEO with auto-generation fallback. + +## Quick Reference + +| Field | Value | +|---|---| +| **Package** | `pkg_mokoog` | +| **Language** | PHP 8.1+ | +| **Branch** | develop on `dev`, merge to `main` (protected) | +| **Wiki** | [MokoJoomOpenGraph Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomOpenGraph/wiki) | + +## Commands + +```bash +make build # Build package ZIP +make lint # Run linters +make validate # Validate structure +make release # Full release pipeline +make clean # Clean build artifacts +composer install # Install PHP dependencies +``` + +## Architecture + +Joomla **package** with three sub-extensions: + +### com_mokoog (Component) +- Admin backend for viewing/managing all OG tag records +- Joomla 4/5 MVC: `Controller/DisplayController`, `Model/TagsModel`, `View/Tags/HtmlView`, `Table/TagTable` +- Namespace: `Joomla\Component\MokoOG\Administrator` + +### plg_system_mokoog (System Plugin) +- Hooks `onBeforeCompileHead` to inject `` and `` +- Auto-generates tags from article title, description, images when no custom tags exist +- Supports articles (`com_content`), menu items, extensible content types + +### plg_content_mokoog (Content Plugin) +- Hooks `onContentPrepareForm` to add OG fields tab to article/menu editors +- Hooks `onContentAfterSave`/`onContentAfterDelete` to persist/clean OG data + +### Database Schema + +Single table `#__mokoog_tags`: +- `content_type` + `content_id` = unique key for any content item +- `og_title`, `og_description`, `og_image`, `og_type` = custom OG overrides +- `published` flag for per-item enable/disable + +## Rules + +- **Never commit** `.claude/`, `.mcp.json`, `TODO.md`, `*.min.css`/`*.min.js` +- **Attribution**: `Authored-by: Moko Consulting` +- **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`) +- **Minification**: handled at build time (CI) +- **Wiki**: documentation lives in the Gitea wiki, not `docs/` files +- **Standards**: [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 diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index cdaa011..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,78 +0,0 @@ -# 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