| file_type | documentation | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| title | Development Setup | |||||||||||||||
| description | Developer setup guide and repository contribution instructions for the LightSpeed community health repository | |||||||||||||||
| version | 1.1 | |||||||||||||||
| last_updated | 2026-08-29 | |||||||||||||||
| owners |
|
|||||||||||||||
| tags |
|
|||||||||||||||
| references |
|
This document provides guidance for contributing to and maintaining this community health repository for the LightSpeed organization.
Note: This repository requires Node.js 24 following the completion of the Node.js 24 Upgrade Project on 2026-08-29. All workflows and scripts are configured for Node.js 24 via
.nvmrc. Using an older version may cause compatibility issues.
-
Clone the repository:
git clone https://github.com/lightspeedwp/.github.git cd .github -
Install dependencies:
npm install
-
Review
package.json: Before getting started, check thepackage.jsonfile to understand available scripts, dependencies, and tooling relevant to this repository.
This repository provides linting tools for JavaScript, TypeScript, YAML, JSON, and Markdown, run through Node scripts. The fast feedback path is Oxlint; the authoritative JS/TS quality gate is ESLint; Prettier runs as a standalone formatter (not as an ESLint rule).
-
Fast lint (Oxlint, non-blocking):
npm run lint:fast
-
Lint JavaScript/TypeScript (ESLint, read-only):
npm run lint:js
-
Lint JavaScript/TypeScript (ESLint, auto-fix):
npm run lint:js:fix
-
Type-check (TypeScript):
npm run typecheck
-
Lint GitHub Actions workflows (actionlint). This needs
actionlinton your PATH (brew install actionlint,scoop install actionlint, or a release from https://github.com/rhysd/actionlint/releases). On x86-64 Linux the checked-in binary is used when none is installed:npm run lint:actionlint
-
Run all linters (JS + YAML + package JSON, in parallel):
npm run lint
-
Check formatting (Prettier):
npm run format:check
npm run format:check is repo-wide and informational: the repository carries a
large backlog of pre-existing formatting drift (626 files), so it is not
enforced as a required CI check. Format only the files you touch, with
npx prettier --write path/to/file.js, or let lint-staged do it at commit time.
npm run format:js rewrites every JS and TS file in the repository, so use it
only for an intentional repository-wide formatting change.
npm run lint:js is read-only. Use npm run lint:js:fix to apply ESLint fixes
and the format:* scripts to apply Prettier formatting. ESLint runs with a
content-based cache (.eslintcache, gitignored) for fast repeat runs.
npm run typecheck runs tsc against two real tsconfig.json files (strict,
noEmit, skipLibCheck):
tsconfig.json— the repository's standalone TypeScript: thepackages/metadata-agent/typesdefinitions andwebsite/src/scripts.website/tsconfig.json— the Astro website module (website/src/lib,website/src/content.config.ts). It addsastro:contentandmarkedmodule shims (website/src/env.d.ts) so the module type-checks without the Astro toolchain installed.
tsc cannot read .astro files, so a type error in a page's markup or inline
script passes npm run typecheck. npm run typecheck:astro runs astro check
over the website's .astro and .ts files. It needs the website's own
dependencies (npm ci --prefix website), which is why it is not part of
npm run typecheck. It currently reports 36 existing findings, mostly untyped
DOM access in inline scripts, so CI runs it as an informational step that does
not fail the Typecheck job. Remove continue-on-error from the "Astro check"
step in .github/workflows/lint.yml once they are cleared.
This repository uses Husky to automate code quality checks via Git hooks. Husky runs automatically when you commit or push code, ensuring all changes meet quality standards before they're shared.
Husky is configured to run automatically when you install dependencies (npm install). Two Git hooks are configured:
- pre-commit: Runs linting and formatting checks on staged files before each commit
- pre-push: Validates the name of every branch being pushed
The pre-commit hook uses lint-staged to run checks only on files you've staged for commit. This keeps the process fast and focused:
-
JavaScript/TypeScript files (
*.{js,jsx,ts,tsx}):- ESLint with auto-fix
- Prettier formatting
-
Markdown files (
*.{md,mdx}):- Changed-line Markdownlint (only violations on lines the commit touches, via
scripts/validation/lint-md-staged.cjs)
- Changed-line Markdownlint (only violations on lines the commit touches, via
-
JSON files (
*.json):- Prettier formatting
-
YAML files (
*.{yml,yaml}):- Prettier formatting
If any checks fail, the commit will be blocked until you fix the issues.
The pre-push hook validates the branch names being pushed, not the test suite. Git feeds the hook one ref-update record per branch on standard input, and each pushed branch is checked against the repository's naming policy before the push is allowed:
node lib/hooks/pre-pushdocs/HUSKY_PRECOMMITS.md documents the policy in full. Running the test suite locally before pushing is still worth doing, but it is not what this hook does — the full suite runs in CI, which is the gate that matters.
In rare cases where you need to bypass hooks (e.g., work-in-progress commits), you can use:
git commit --no-verify -m "WIP: description"
git push --no-verifyNote: Bypassing hooks should be avoided in most cases, as it may introduce code quality issues or failing tests into the repository.
If hooks aren't running:
- Ensure dependencies are installed:
npm install - Check that
.husky/directory exists - Verify hooks are executable:
ls -la .husky/ - Re-initialize Husky:
npm run prepare
A scripts/ folder is used to contain shared functions for agents.
Agents are written in JavaScript, and reusable logic or utilities should be placed here for maintainability and collaboration across the organization.
-
Create a feature branch for your work:
git checkout -b feature/your-feature-name
-
Make your changes and commit them:
git add . git commit -m "Your descriptive commit message"
-
Push your changes and create a pull request:
git push origin feature/your-feature-name
-
Reference any related issues in your pull request description. Please use the pull request template for summaries.
- Check the repository documentation and README files
- Review the GitHub Copilot custom instructions
- Use the prompt files in
.github/prompts/for guidance
We welcome contributions! Please review our Contributing Guidelines and Code of Conduct.
This project is licensed under the GNU General Public License v3.0 — see the LICENSE file for details.
- BRANCHING_STRATEGY.md: Org-wide branch naming, merge discipline, and automation mapping.
- CHANGELOG.md: Changelog format, release notes, and versioning.
- CONTRIBUTING.md: Contribution guidelines, templates, coding standards.
- AUTOMATION_GOVERNANCE.md: Org-wide automation, branching, labeling, and release strategy.
- Org-wide Issue Labels: Default labels and usage guidance.
- Pull Request Labels: PR classification labels and automation standards.
- Canonical Issue Types YAML: Machine-readable issue types for workflow and automation.
- Canonical Label Definitions: Label names, colours, and descriptions.
- Automated Label Assignment Rules: Automation for applying labels based on file changes and branch patterns.
This page brought to you by the 🦄 Magic Automation Unicorns of LightSpeedWP. Automation Docs