8.4 KiB
Client Fork Creation Workflow
This document explains how to use the automated client fork creation tools to set up a new client-specific fork of MokoCassiopeia.
Overview
The client fork creation workflow automates the process of preparing a repository for a client-specific fork. It performs the following actions:
- ✅ Copies
templates/colors_custom.csstosrc/media/css/colors/light/colors_custom.css - ✅ Copies
templates/colors_custom.csstosrc/media/css/colors/dark/colors_custom.css - ✅ Replaces
README.mdwith customizedCLIENT_FORK_README.md - ✅ Removes
CLIENT_FORK_README.mdfrom root - ✅ Removes
templates/CLIENT_FORK_README_TEMPLATE.md - ✅ Updates
templates/README.mdto remove fork template references - ✅ Keeps
templates/colors_custom.cssas a template for reference
Method 1: GitHub Actions Workflow (Recommended)
Prerequisites
- Repository admin or maintainer access
- GitHub Actions enabled for the repository
Steps
-
Navigate to Actions
- Go to your repository on GitHub
- Click on the "Actions" tab
-
Run the Workflow
- Select "Create Client Fork" from the workflow list
- Click "Run workflow"
- Fill in the required inputs:
- Client Name: Full client name (e.g., "Acme Corporation")
- Confirm: Type "CONFIRM" to proceed
- Click "Run workflow" button
-
Monitor Progress
- The workflow will create a new branch named
client-fork/{client-slug} - You can monitor the progress in the Actions tab
- Once complete, you'll see a summary of changes
- The workflow will create a new branch named
-
Review the Branch
- Navigate to the new branch:
client-fork/{client-slug} - Review the changes made
- The README will be customized with the client name
- Custom color files will be in place
- Navigate to the new branch:
-
Create Client Repository
- Create a new repository for the client
- Push the branch to the new repository:
git remote add client-repo <CLIENT_REPO_URL> git push client-repo client-fork/{client-slug}:main
Workflow Features
- ✅ Safe Confirmation: Requires typing "CONFIRM" to prevent accidental runs
- ✅ Automated Branch Creation: Creates a properly named branch automatically
- ✅ Customized README: Automatically fills in client name and date
- ✅ Git Tracking: Commits all changes with a descriptive message
- ✅ Summary Report: Provides a complete summary of actions taken
Method 2: Local Bash Script
Prerequisites
- Git installed on your local machine
- Bash shell (Linux, macOS, or Git Bash on Windows)
- Local clone of the MokoCassiopeia repository
Steps
-
Clone the Repository
git clone https://github.com/mokoconsulting-tech/MokoCassiopeia.git cd MokoCassiopeia -
Make Script Executable
chmod +x scripts/create-client-fork.sh -
Run the Script
./scripts/create-client-fork.sh "Client Name"Example:
./scripts/create-client-fork.sh "Acme Corporation" -
Confirm Actions
- The script will show you what it will do
- Type "yes" to proceed
- Review the changes shown
- Type "yes" to commit
-
Push to New Repository
# Add the client's repository as a remote git remote add client-repo <CLIENT_REPO_URL> # Push the branch git push client-repo client-fork/{client-slug}:main
Script Features
- 🎨 Colored Output: Easy-to-read colored terminal output
- ✅ Interactive Confirmation: Asks for confirmation before making changes
- ✅ Safety Checks: Verifies you're in the correct directory
- ✅ Progress Indicators: Shows each step as it completes
- ✅ Git Status: Shows what files changed before committing
- ✅ Summary: Provides a complete summary at the end
What Gets Changed
Files Created
src/media/css/colors/light/colors_custom.css [NEW]
src/media/css/colors/dark/colors_custom.css [NEW]
Files Modified
README.md [REPLACED]
templates/README.md [UPDATED]
Files Removed
CLIENT_FORK_README.md [DELETED]
templates/CLIENT_FORK_README_TEMPLATE.md [DELETED]
Files Kept
templates/colors_custom.css [UNCHANGED]
Post-Setup Steps
After running the workflow or script, you should:
-
Customize Brand Colors
- Edit
src/media/css/colors/light/colors_custom.css - Edit
src/media/css/colors/dark/colors_custom.css - Update CSS variables to match client branding
- Edit
-
Update README
- Fill in client-specific contact information
- Add custom notes or configurations
- Update fork URL references
-
Test Locally
- Install the template in a local Joomla instance
- Test light and dark modes
- Verify custom colors appear correctly
-
Create Client Repository
- Create a new repository for the client
- Push the prepared branch to the new repo
- Set up appropriate access controls
-
Enable Custom Palette in Joomla
- Log into Joomla admin
- Navigate to System → Site Templates → MokoCassiopeia
- Under Theme tab, set palette to "Custom"
- Save and test
Troubleshooting
Workflow Fails with "CONFIRM" Error
Problem: Workflow stops immediately with confirmation error.
Solution: Make sure you type "CONFIRM" (in all caps) in the confirmation field.
Script Says "CLIENT_FORK_README.md not found"
Problem: Script can't find required files.
Solution: Make sure you're running the script from the repository root directory:
cd /path/to/MokoCassiopeia
./scripts/create-client-fork.sh "Client Name"
Colors Don't Appear After Setup
Problem: Custom colors don't show in Joomla.
Solution:
- Enable custom palette in template settings
- Clear Joomla cache (System → Clear Cache)
- Clear browser cache (Ctrl+Shift+R / Cmd+Shift+R)
Branch Already Exists
Problem: Branch name conflicts with existing branch.
Solution: Either delete the old branch or choose a different client name:
# Delete old branch
git branch -D client-fork/{client-slug}
# Or use a more specific client name
./scripts/create-client-fork.sh "Client Name - Division"
Examples
Example 1: Simple Client Fork
# Using the script
./scripts/create-client-fork.sh "Acme Corporation"
This creates:
- Branch:
client-fork/acme-corporation - README title: "Acme Corporation - MokoCassiopeia Custom Fork"
Example 2: Client with Multiple Words
# Using the script
./scripts/create-client-fork.sh "Global Tech Solutions Inc"
This creates:
- Branch:
client-fork/global-tech-solutions-inc - README title: "Global Tech Solutions Inc - MokoCassiopeia Custom Fork"
Example 3: Using GitHub Actions
- Go to Actions → Create Client Fork
- Enter: "Mountain View Medical Center"
- Enter: "CONFIRM"
- Click "Run workflow"
Result:
- Branch:
client-fork/mountain-view-medical-center - README title: "Mountain View Medical Center - MokoCassiopeia Custom Fork"
Best Practices
-
Naming Convention: Use the official client name as it should appear in documentation
-
Branch Management:
- Keep the branch until the client repository is set up
- Don't merge client fork branches back to main
-
Custom Colors:
- Document color choices in README
- Keep a backup of custom color files
- Test in both light and dark modes
-
Version Tracking:
- Note the upstream version in fork README
- Track when you last synced with upstream
-
Security:
- Don't commit client-specific credentials
- Review custom code before deployment
- Keep client forks private if they contain sensitive branding
Related Documentation
- CLIENT_FORK_README.md - Full client fork guide
- CSS Variables - Complete CSS variable reference
- Main README - MokoCassiopeia documentation
Support
For issues with the workflow or script:
- Check this documentation first
- Review error messages carefully
- Contact: hello@mokoconsulting.tech
Document Version: 1.0
Last Updated: 2026-02-20
Maintained by: Moko Consulting