| title | LightSpeed Global AI Rules | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| description | Organisation-wide AI agent rules, coding standards, and contribution guidelines for all LightSpeed WordPress projects. | |||||||||||||||
| version | v1.1 | |||||||||||||||
| last_updated | 2025-12-07 | |||||||||||||||
| file_type | agents-index | |||||||||||||||
| maintainer | LightSpeed Team | |||||||||||||||
| authors |
|
|||||||||||||||
| license | GPL-3.0 | |||||||||||||||
| tags |
|
|||||||||||||||
| domain | governance | |||||||||||||||
| stability | stable | |||||||||||||||
| references |
|
- Use UK English; optimise for clarity, scalability, maintainability and profitable outcomes.
- Prefer minimal, modular solutions; justify heavier tools with return on investment and maintenance cost.
- Follow WordPress Coding Standards (CSS, HTML, JavaScript, PHP) and inline‑documentation standards at all times.
- All code changes must include lint fixes, relevant tests and a short rationale summarising the change.
- Before creating or pushing branch changes, verify the target branch already exists and matches the PR branch; never create a new remote branch when the work is intended for an existing pull request.
- Any new scripts, modules, or utilities must have related tests in a matching
__tests__/subtree with the smallest focused coverage that exercises the changed behaviour. - Never output secrets. Treat production and customer data as sensitive. Follow the OWASP top 10 for web security.
- Accessibility and performance are non‑negotiable; highlight potential issues during reviews.
- Prefer
theme.jsonand block components over bespoke code when feasible to avoid vendor lock‑in. - When unsure, propose safe defaults and ask one focused question to clarify requirements.
- Core instructions consolidated: see
instructions/{languages,documentation-formats,quality-assurance,automation,community-standards}.instructions.md(mapping inMIGRATION_GUIDE.md).
- See Main Agent Index for all agent implementations and specs.
- Each agent must have both a code file (
.js,.py, etc.) and a spec (.md) following the template. - All contributors must follow the org Coding Standards.
| Agent | Tests | Notes |
|---|---|---|
| TBD | ⏳ | Awaiting test implementation |
Note: As agents are developed and tested, this table will be updated with their status. ✅ indicates passing tests, ❌ indicates failing tests, and ⏳ indicates tests pending implementation.
ALL repository scripts MUST be placed in scripts/ at the root, NOT in .github/scripts/.
✅ scripts/automation/ - Automation and workflow scripts
✅ scripts/metrics/ - Metrics collection and analysis
✅ scripts/telemetry/ - Telemetry instrumentation
✅ scripts/release/ - Release preparation and validation
✅ scripts/validation/ - Validation and linting scripts
✅ scripts/badges/ - Badge generation scripts
✅ scripts/agents/ - Agent runner scripts
✅ scripts/workflows/ - Agentic workflow orchestration
❌ .github/scripts/ - DO NOT CREATE - Reserved for GitHub governance only
.github/website/src/scripts/- Website browser-specific JavaScript that runs client-side.github/agentic-workflows/- Agent specifications for repository governance automation
.github/is for GitHub-native governance files (templates, workflows, configs)scripts/is for executable code that powers the repository- Mixing these creates confusion about file ownership and purpose
- Import paths become inconsistent when scripts are in the wrong location
When creating any new script:
- Check the script type: Is it automation, metrics, telemetry, release, etc.?
- Place in correct subfolder:
scripts/{category}/script-name.js - Known exceptions:
.github/website/src/scripts/(browser),.github/agentic-workflows/(repo governance agents) - Never use
.github/scripts/- This directory should not exist for new work - Update imports: Ensure all imports use correct paths from
scripts/
| You're Creating | Put It In | NOT In |
|---|---|---|
| A telemetry client | scripts/telemetry/ |
.github/scripts/telemetry/ |
| An automation script | scripts/automation/ |
.github/scripts/automation/ |
| A metrics collector | scripts/metrics/ |
.github/scripts/metrics/ |
| A release validator | scripts/release/ |
.github/scripts/release/ |
| A workflow orchestrator | scripts/workflows/ |
.github/scripts/workflows/ |
| Website JS (browser) | .github/website/src/scripts/ |
✅ Exception - correct location |
All branches MUST follow this pattern: {type}/{scope}-{title}
This is enforced globally across all LightSpeed projects. See CLAUDE.md — Branch Naming for complete details, 34 allowed type values, examples, and why this matters.
✅ Correct:
feat/governance-audit-implementationfix/pr-template-routing-bugdocs/branching-strategy-guide
❌ Forbidden (never use):
claude/something— Reserved for Claude Code internal sessionscopilot/something— Reserved for GitHub Copilot integrationopenai/something— Reserved for OpenAI integration
Incorrect branch names cause:
- PR template assignment failures
- GitHub Actions workflow failures
- Validation check failures
- Downstream automation breaks
npm run validate:branch-name -- --branch <your-branch>- Complete guidance: CLAUDE.md — Branch Naming (34 types, examples, consequences)
- Detailed rules: .github/instructions/branch-naming.instructions.md
- Strategy doc: docs/BRANCHING_STRATEGY.md
- Copilot-specific: .github/custom-instructions.md
| Area | File Reference | Notes / Usage |
|---|---|---|
| Coding Standards | instructions/coding-standards.instructions.md | Unified standards for all code |
| File Organisation | instructions/file-organisation.instructions.md | Where to create reports, tasks, and project files (CRITICAL) |
| Quality Assurance | instructions/quality-assurance.instructions.md | Testing pyramid, Jest, coverage, CI/CD (3 files consolidated) |
| Languages & Linting | instructions/languages.instructions.md | JS/TS, JSON, YAML, JSDoc, linting (4 files consolidated) |
| Documentation Formats | instructions/documentation-formats.instructions.md | Markdown, YAML frontmatter, Mermaid (3 files consolidated) |
| Automation | instructions/automation.instructions.md | Agents, labeling, release, metrics (8 files consolidated) |
| Community Standards | instructions/community-standards.instructions.md | Files, naming, README, replies (4 files consolidated) |
Consolidated Instructions (5 Files):
- languages.instructions.md - JS/TS, JSON, YAML, JSDoc, linting (consolidated 4 files)
- documentation-formats.instructions.md - Markdown, frontmatter, Mermaid, A11y (consolidated 3 files)
- quality-assurance.instructions.md - Testing, Jest, coverage, CI/CD (consolidated 3 files)
- automation.instructions.md - Agents, labeling, release, metrics (consolidated 8 files)
- community-standards.instructions.md - Files, naming, README, saved replies (consolidated 4 files)
When your code creates issues via gh issue create or GitHub API:
- Always validate labels against canonical set (
.github/labels.yml) - All labels MUST include family prefix:
type:*for issue classification (bug, feature, documentation, task, design, etc.)status:*for workflow state (needs-triage, ready, in-progress, blocked, done, etc.)priority:*for urgency (critical, important, normal, minor)area:*for domain/component (ci, docs, security, labels, tests, scripts, etc.)meta:*for automation markers (needs-changelog, has-pr, duplicate, etc.)
# ✅ CORRECT — All labels use required prefixes
gh issue create \
--title "Add support for new widget configuration" \
--body "Users need to configure widgets via JSON..." \
--label "type:feature" \
--label "area:block-editor" \
--label "priority:normal" \
--label "status:needs-triage"
# ❌ INCORRECT — Bare labels without prefixes
gh issue create \
--title "Add support for new widget configuration" \
--body "Users need to configure widgets via JSON..." \
--label "feature" \
--label "block-editor" \
--label "normal" \
--label "needs-triage"Before creating any issue programmatically:
- Each label exists in
.github/labels.yml - Each label includes its family prefix (
type:,status:,area:, etc.) - No bare labels (labels without colons are invalid)
Reference: .github/scripts/validation/validate-labels-before-creation.cjs
- Use the default PR template: .github/PULL_REQUEST_TEMPLATE.md
- Additional PR templates are available in: .github/PULL_REQUEST_TEMPLATE/
- Use the template most relevant to your change (e.g. feature, fix, documentation, etc.)
Start here for all key standards:
- Coding Standards Index: Unified standards, best practices, and documentation for all LightSpeed projects.
- Linting Instructions Index: Primary index and guidance for all linting rules, tools, and file-type-specific standards.
| Resource Name | Reference | Purpose / Notes |
|---|---|---|
| Instructions Guide | instructions/instructions.instructions.md | Guide for authoring and maintaining instruction files |
| Custom Instructions | .github/custom-instructions.md | Repo-local Copilot instructions and .github boundary rules |
| Claude Instructions | CLAUDE.md | Claude-specific project instructions; companion to this file |
| Main Agent Index | agents/agent.md | Directory of agent specs, stubs, usage, implementation |
| Prompts Index | .github/prompts/prompts.md | Legacy prompt index pending skills/cookbook migration |
| Instruction Migration | MIGRATION_GUIDE.md | Mapping from legacy instruction files to the 5 consolidated guides |
When your code creates issues or PRs via gh issue create, gh pr create, or GitHub API:
- Always validate labels against the canonical set (
.github/labels.yml) - ALL labels MUST include family prefix — never apply bare labels
- Prefix families and examples:
type:*— bug, feature, documentation, task, design, security, performance, a11ystatus:*— needs-triage, ready, in-progress, blocked, review, donepriority:*— critical, high, normal, lowarea:*— ci, docs, security, labels, tests, scripts, automation, etc.meta:*— needs-changelog, has-pr, duplicate, needs-audit
# ✅ CORRECT — All labels use required prefixes
gh issue create \
--title "Add support for new widget configuration" \
--body "Users need to configure widgets via JSON..." \
--label "type:feature" \
--label "area:core" \
--label "priority:normal" \
--label "status:needs-triage"
# ❌ INCORRECT — Bare labels without prefixes (DO NOT USE)
gh issue create \
--title "Add support for new widget configuration" \
--body "Users need to configure widgets via JSON..." \
--label "feature" \
--label "core" \
--label "normal" \
--label "needs-triage"Before creating any issue or PR programmatically:
- Each label exists in
.github/labels.yml - Each label includes its family prefix (
type:,status:,area:,priority:,meta:) - No bare labels without colons
- Canonical case (lowercase, hyphens for spaces)
- Canonical labels:
.github/labels.yml(158 prefixed labels) - Label taxonomy:
docs/LABEL_STRATEGY.md - Labeling guide:
docs/LABELING.md - Governance audit: Issue #1592 — Label Prefix Enforcement
- Contributing Guidelines - For human contributors
- Main Documentation - Project overview
- Frontmatter Schema - Schema validation
This file is the canonical reference for all AI agent rules and coding standards in LightSpeedWP projects. All contributors, agents, and AI assistants must comply with these standards.
This page brought to you by the 🦄 Magic Automation Unicorns of LightSpeedWP. Automation Docs