Repository: https://github.com/Leapswitch-Networks/vendor-bills
Claude Code MUST follow this workflow for EVERY task:
# 1. Check current branch
git branch --show-current
# 2. If not on main, switch to main
git checkout main
git pull origin main
# 3. Create feature branch for this task
git checkout -b feature/<descriptive-name>Branch naming conventions:
- Features:
feature/rbac-system,feature/image-marketplace - Bug fixes:
fix/billing-calculation,fix/vm-provisioning-error - Hotfixes:
hotfix/critical-auth-bug - Refactoring:
refactor/api-response-format
- Make atomic commits with clear messages
- Commit frequently as work progresses
- Push to remote periodically:
git push -u origin feature/<name>
Ask user before merging: "Work complete. Should I merge to main and push?"
If user confirms (applies to ALL branch types: feature/, fix/, hotfix/, refactor/):
# 1. Push final changes to branch
git push origin <branch-name>
# 2. Switch to main
git checkout main
git pull origin main
# 3. Squash merge branch (combines all commits into one)
git merge --squash <branch-name>
# 4. Commit with a summary message
git commit -m "Feature/fix description"
# 5. Push main
git push origin main
# 6. (Only if user requests) Delete branch
git branch -D <branch-name>
git push origin --delete <branch-name>Why squash merge? Keeps main branch history clean with one commit per feature/fix, instead of polluting it with all intermediate commits from the working branch.
Note: Do NOT delete the branch unless the user explicitly requests it.
NEVER Commit without explicit user approval.
- Do NOT add Claude co-authorship or attribution footer to commits
- Do NOT include "Generated with Claude Code" in commit messages
- Do NOT include "Co-Authored-By: Claude" in commit messages
When user prompts to deploy a release, Claude MUST ask for confirmation at each step so user can review.
- "deploy release", "release", "publish release", "ship it", "release v"
CURRENT_BRANCH=$(git branch --show-current)
git add -A && git commit -m "Prepare release" --allow-empty
git push origin $CURRENT_BRANCH⏸️ Confirm: "Branch pushed. Proceed to squash merge to main?"
git checkout main && git pull origin main
git merge --squash $CURRENT_BRANCH
git commit -m "Release: v - "⏸️ Confirm: "Squash merged. Proceed to update CHANGELOG.md?"
Generate entry from commits since last tag:
## [v<version>] - YYYY-MM-DD
### Added
- New features
### Changed
- Modifications
### Fixed
- Bug fixes
git add CHANGELOG.md
git commit --amend --no-edit⏸️ Confirm: "CHANGELOG updated. Proceed to update docs?"
Find and update related documentation files:
-
Scan docs/ folder for files mentioning the feature/bug name
-
Update version badge/status in related docs:
- Add/update
Version: v<version> - Update
Status: ImplementedorStatus: Released - Add release date if applicable
- Add/update
-
Example updates:
<!-- Before --> ## Feature: RBAC System Status: In Progress <!-- After --> ## Feature: RBAC System Status: Released Version: v1.2.0 Release Date: 2026-01-09
git add docs/
git commit --amend --no-edit⏸️ Confirm: "Docs updated. Review changes and proceed to push main?"
git push origin main⏸️ Confirm: "Main pushed. Proceed to create tag and GitHub release?"
git tag -a v -m "Release v"
git push origin v
gh release create v --generate-notes --title "Release v"✅ Complete: "Release v published."
- CONFIRM EACH STEP - Wait for user approval before proceeding
- SQUASH MERGE ONLY - Always
git merge --squash - UPDATE CHANGELOG.md - Generate from commits since last tag
- UPDATE DOCS - Update related docs/*/.md with version & status
- VERSION - Use user-specified version, or check
package.json/pyproject.toml, or ask once
- Extract changes from commits between last tag and HEAD
- Categorize: Added, Changed, Fixed, Removed, Security
- Use conventional commit prefixes (feat:, fix:, etc.) if available
- Create CHANGELOG.md if it doesn't exist
- Search
docs/**/*.mdfor files related to current branch name/feature - Update fields:
Status,Version,Release Date - Status values:
Planned→In Progress→Released - List all updated doc files for user review before committing
This is the hitechloud WHMCS Module. It enables WHMCS resellers to provision and manage virtual machines through hitechloud's OpenStack-based infrastructure.
- Uses OpenStack Application Credentials (NOT username/password)
- Credentials are scoped to specific Project + Region combinations
- Auth URL pattern:
https://{hostname}/{project_path}/v3/auth/tokens - IMPORTANT: The Access Hash field contains the project path (e.g.,
/openstack/14)
modules/
├── addons/hitechloud_admin/ # Admin management module
│ └── hitechloud_admin.php # Config options, updates, resource management
└── servers/hitechloud/ # Provisioning module
├── hitechloud.php # WHMCS hooks (create, suspend, terminate, etc.)
├── hooks.php # Client area hooks
├── lib/
│ ├── hitechloudAPI.php # OpenStack API client
│ └── hitechloudHelper.php # Utility functions
└── templates/ # Client area templates
// In constructor:
$this->serverUrl = $protocol . rtrim($hostname, '/');
if (!empty($accessHash)) {
$this->serverUrl .= '/' . ltrim($accessHash, '/');
}
if (strpos($this->serverUrl, '/v3') === false) {
$this->serverUrl .= '/v3';
}
// Auth URL is then:
$this->serverUrl . '/auth/tokens'
// Result: https://hostname/openstack/14/v3/auth/tokensAfter authentication, service endpoints come from the token catalog and are used directly:
- Compute:
{catalog_url}/servers - Network:
{catalog_url}/v2.0/networks - Image:
{catalog_url}/v2/images - Volume:
{catalog_url}/volumes
- Add method to
hitechloudAPI.php - Use
$this->getEndpoint('service_type')for the base URL - Use
$this->apiRequest($url, 'METHOD', $data)for requests - Always wrap in try/catch
- Return
['success' => bool, 'data' => ...]
- Update
hitechloud_MODULE_VERSIONinhitechloud_admin.php - Update
@versioninhitechloudAPI.phpheader - Update
version.jsonin repository root - Update
CHANGELOG.md
- Update all version numbers
- Create release ZIP:
zip -r hitechloud-whmcs-module-vX.XX.zip modules/ - Create GitHub release with the ZIP
- Update
version.jsondownload_url
- WHMCS Admin → Setup → Servers → Test Connection
- Should return "Connected successfully. Project ID: ..."
- Addons → hitechloud Manager → Flavors/Images/Networks tabs
- Click "Load from API" buttons
- Resources should populate
- Create a test product with hitechloud module
- Place a test order
- Check provisioning logs
- 405 Error: Usually means the auth URL is wrong. Check Access Hash includes project path.
- 401 Error: Invalid credentials or expired.
- Empty Resources: Check server connection first, then API permissions.
- VNC Console: Tries multiple methods (remote-consoles, os-getVNCConsole, etc.)
- PHP 7.4+ (uses typed properties)
- WHMCS 8.0+
- cURL extension
- ZipArchive (for updates)
Key OpenStack APIs used:
- Identity v3:
/v3/auth/tokens - Nova (Compute):
/servers,/flavors - Neutron (Network):
/v2.0/networks,/v2.0/security-groups - Glance (Image):
/v2/images - Cinder (Volume):
/volumes,/types