Contributing to Liferay AI Commerce Accelerator¶
Thank you for your interest in contributing to the Liferay AI Commerce Accelerator! Contributions from the team and community are what make this project successful.
By contributing to this repository, you agree to abide by our Code of Conduct.
๐ Getting Started¶
1. Prerequisites¶
Ensure you have the following installed on your local machine:
- Node.js (v22.x or later, managed via
.nvmrc) - Yarn (v1.22.x)
- Java (v17 or v21, required for Liferay Workspace/Gradle)
- Docker (Required for the LLD/LDM local server stacks)
- Liferay Docker Manager (LDM) (
npm install -g @google/gemini-clior similar developer setup)
2. Fork & Clone¶
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/liferay-ai-commerce-accelerator.git
cd liferay-ai-commerce-accelerator
- Set up the upstream remote:
๐ ๏ธ Development Workflow¶
We use a monorepo structure managed by Gradle (Liferay Workspace) with Node/Yarn workspaces under client-extensions/.
๐ฆ Project Structure¶
/client-extensions/ai-commerce-accelerator-frontend/โ React SPA Dashboard/client-extensions/ai-commerce-accelerator-microservice/โ Node/Express Backend API/client-extensions/ai-commerce-accelerator-configuration/โ OSGi Caddy configuration element/client-extensions/liferay-accelerator-sdk/โ Shared SDK for Liferay APIs & contracts
๐จ Compilation and Building¶
To install all dependencies and build all client extensions in one command, run from the root:
This deploys compiled client extension .zip archives into /bundles/osgi/client-extensions/ ready for Liferay.
๐งช Running Unit Tests¶
All packages have dedicated Vitest suites. You can run the entire unit test suite across all subprojects:
Or run them directly inside a specific folder (e.g. client-extensions/liferay-accelerator-sdk):
๐ก๏ธ End-to-End (E2E) Testing¶
We use Liferay Docker Manager (LDM) and Playwright to run comprehensive E2E tests against a real DXP container. To run the full E2E suite locally:
๐ Styling & Standards¶
To ensure consistency, we enforce strict linting, formatting, and commit rules.
Code Formatting¶
We use Prettier and ESLint. Code is automatically formatted and validated during git commits via Husky and lint-staged. You can format your changes manually:
Commit Messages¶
We enforce Conventional Commits. Commit messages must follow this structure:
Allowed types:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Formatting, missing semi-colons, etc. (no production code change)refactor: Refactoring production code (neither fixes a bug nor adds a feature)test: Adding missing tests or correcting existing testschore: Updating grunt tasks, build configurations, etc. (no production code change)
Shared docs files¶
Six files in this repository are copies, not originals. Their canonical versions live on
the main branch of
ai-agent-template, which seeds them
into every project built with --docs-site, so the three Liferay tools sites render the same
way:
| Here | Upstream |
|---|---|
overrides/main.html |
same path |
overrides/partials/copyright.html |
same path |
scripts/mkdocs_github_alerts.py |
same path |
scripts/check_docs_rendered.py |
same path |
scripts/check_template_drift.py |
same path |
docs/assets/stylesheets/liferay-blue.css |
.agents/templates/docs-profiles/liferay/liferay-blue.css |
Never edit a copy. Change the canonical file in the template, through a pull request there,
then copy it back unchanged. scripts/check_template_drift.py --docs-site --fail-on-drift runs
on every pull request and fails on any difference, so a local edit cannot survive review.
Everything this site needs to say for itself goes in mkdocs.yml instead โ under
extra.docs_standard for the shared checks, or in a second stylesheet listed after
liferay-blue.css in extra_css. The rule, and what the standard requires of a page, are in
the template's CONTRIBUTING.md ("Shared docs files") and
.agents/skills/docs-site-standard/SKILL.md.
See #1335.
๐ฅ Submitting a Pull Request¶
- Create a Branch: Always branch from
masterand name it logically matching the Conductor Track IDs:
- Commit Changes: Ensure your commit messages are conventional and all linting/testing passes.
- Sync with Upstream: Keep your branch up to date:
- Push & PR: Push to your fork and submit a PR to the upstream repository. Ensure you describe what changed and why (include test logs or manual steps to verify).
๐ Issue-Driven & Peer-Review Flow (Strict Requirements)¶
This repository enforces a strict process for all contributors (humans and agents alike):
- GitHub Issues for Recording: All tasks (bugs, enhancements, feature requests, documentation, tooling) MUST be recorded in a GitHub issue before any code changes are made.
- Impact Analysis & Plan: For every issue, the contributor must analyze the issue details against the codebase and write out a detailed implementation plan.
- PR-Issue Linkage: All Pull Requests must link back to their originating GitHub issue using conventional keywords in the description (e.g.
Closes #123,Resolves #123, orFollows up on #123). - Peer Review: A review from another contributor (human developer or peer AI agent) is encouraged before merging whenever a second contributor is available. This repository is not currently branch-protection-enforced for review count (
required_approving_review_count: 0), since it's presently solo-maintained โ merging still requires a PR with a passingCI/build-and-testcheck, just not a second approver.
๐ก๏ธ Repository Branching & PR Rulesets (Strict Gates)¶
To maintain absolute code quality, stability, and a logical git history as the accelerator expands, this repository enforces the following strict engineering gates:
1. Feature Branch Isolation¶
- Direct pushes to the remote
masterbranch are strictly prohibited for new roadmap items. - All new developments, refactoring, or track features MUST be developed on isolated branches named
feature/<track-id>(matching active items in the Conductor Tracks Registry, e.g.,feature/persona-orders).
2. Local Pre-flight Gatekeeper (verify:all)¶
- Before pushing any branch or opening/updating a Pull Request, developers (and AI assistants) MUST ensure the required
CI/build-and-testcheck passes: Prettier, ESLint, markdownlint, a Gradle build, and the full unit test suite (yarn test). This runs automatically on every PR via.github/workflows/ci.yml; run it locally first (yarn prettier --check . && yarn workspaces run eslint . && yarn lint:md && ./gradlew build -x test && yarn test) to catch failures before pushing. - The full Playwright E2E suite is not a per-PR gate โ against a real Liferay DXP container it takes on the order of 1.5 hours, which is untenable to run on every PR. It instead runs nightly via
.github/workflows/e2e-verification.yml(schedule-only, and skips itself automatically if nothing has landed onmastersince the last successful run), plus on-demand viaworkflow_dispatchorrelease: published. - Still, run it yourself before opening a PR that touches generator/workflow logic, LDM integration, or anything else the Playwright suite exercises โ a regression there won't be caught until the next nightly run otherwise:
3. Squash and Merge Policy¶
- All Pull Requests merged into
masterMUST be squashed into exactly one linear commit. - This keeps our master git log clean, logical, and highly parseable.
4. Squash Message Conventional Spec¶
- The final squashed commit message upon PR merge must follow conventional spec mapping to the track or component scope:
(e.g., feat(persona-orders): implement intelligent AI persona order seeding)
Thank you for contributing!
Last Updated: 2026-10-16 | Last Reviewed: 2026-10-16
Last Reviewed: 2026-10-15