diff --git a/CLAUDE.md b/CLAUDE.md index 83c432b..5d12aa6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,47 +1,59 @@ -# CLAUDE.md +# MokoSuiteSupport -This file provides guidance to Claude Code when working with this repository. +Multi-channel customer support for Joomla 6 — website chat, Facebook Messenger, WhatsApp, unified agent inbox, CSAT. -## Project Overview - -**Template-Joomla** -- Unified Joomla extension scaffolding templates — plugin, template, module, component, package, library +## Quick Reference | Field | Value | |---|---| -| **Platform** | template | -| **Language** | Markdown | -| **Default branch** | main | -| **License** | GPL-3.0-or-later | -| **Wiki** | [Template-Joomla Wiki](https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla/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 -``` +| **Package** | `pkg_mokosuitesupport` | +| **Layer** | Standalone (optional CRM integration) | +| **Language** | PHP 8.3+ | +| **Branch** | develop on `dev`, merge to `main` (protected) | +| **Wiki** | [MokoSuiteSupport Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteSupport/wiki) | ## Architecture -This is a project template. Files are copied when creating new repos. -- Edit files here to change defaults for new projects -- `.mokogitea/workflows/` -- CI/CD workflow templates -- `Makefile` -- build targets inherited by new projects +Joomla **package** (`pkg_mokosuitesupport`) — standalone module, no MokoSuite dependencies required. + +### Optional Integrations +- MokoSuiteClient (Layer 0) — base platform features +- MokoSuiteCRM (Layer 1) — contact linking, ticket escalation +- Uses `class_exists()` checks to gracefully degrade when CRM not present + +### Channels +Website Chat · Facebook Messenger · WhatsApp Business · Instagram Direct (planned) · Email IMAP (planned) + +### Helpers (5) +- `ConversationHelper` — create, message, unified inbox, assign, close with CSAT +- `AgentHelper` — availability, auto-assign (least-busy), performance metrics +- `CannedResponseHelper` — quick replies, keyword search, categories +- `WebhookChannelHelper` — Facebook + WhatsApp inbound, conversation continuity +- `CsatHelper` — scoring, by-channel breakdown, weekly trend + +### Key Patterns +- Webhook handlers use `FOR UPDATE` transaction to prevent duplicate conversations on concurrent inbound +- Auto-assign picks agent with lowest active conversation count +- CSAT rating captured on conversation close (1-5 scale) + +## Source Directory + +- `source/pkg_mokosuitesupport.xml` — package manifest +- `source/packages/` — sub-extensions ## 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) and runtime (MokoMinifyHelper for Joomla templates) -- **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) +- **Never commit** `.claude/`, `.mcp.json`, `TODO.md`, `*.min.css`/`*.min.js` +- **Attribution**: `Authored-by: Moko Consulting` +- **Workflow directory**: `.mokogitea/` +- **Wiki**: documentation lives in the Gitea wiki, not `docs/` files +- **Standards**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoCLI/wiki) +- **Changelog**: `[Unreleased]` only — release system assigns versions +- **No mass email**: use Mailchimp/external services for bulk sending + +## Coding Standards + +- PHP 8.3+ / Joomla 6 patterns +- `$this->getDatabase()` in models, `Factory::getContainer()->get(DatabaseInterface::class)` in helpers +- `Factory::getApplication()->getIdentity()` for user +- `FOR UPDATE` inside transactions for race-condition-prone operations