Files
MokoJoomOpenGraph/CLAUDE.md
T
Jonathan Miller c9fe15c90c
Universal: Cascade Main → Dev / Cascade main → branches (push) Successful in 2s
feat: initial MokoOpenGraph package scaffold
Joomla package (pkg_mokoog) with three sub-extensions:
- com_mokoog: Admin component with tag manager, MVC, database schema
- plg_system_mokoog: OG + Twitter Card meta tag injection via onBeforeCompileHead
- plg_content_mokoog: Per-article and per-menu-item OG fields in editor

Includes CI/CD workflows, issue templates, 12 feature issues, and
full Joomla 4/5 DI container architecture.

Authored-by: Moko Consulting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 17:10:17 -05:00

3.0 KiB

CLAUDE.md

This file provides guidance to Claude Code when working with this repository.

Project Overview

MokoOpenGraph -- 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 MokoOpenGraph Wiki
Standards MokoStandards

Common Commands

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
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 <meta property="og:*"> and <meta name="twitter:*"> 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

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