Skip to content

Add LightSpeed WordPress block plugin starter repo scaffold#1

Merged
ashleyshaw merged 5 commits intomainfrom
copilot/create-light-speed-plugin-starter-repo
Mar 30, 2026
Merged

Add LightSpeed WordPress block plugin starter repo scaffold#1
ashleyshaw merged 5 commits intomainfrom
copilot/create-light-speed-plugin-starter-repo

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

Bootstraps a lean, production-aware GitHub template repository for LightSpeed WordPress plugin development — block-ready, AI-workflow-aware, intentionally lighter than block-plugin-scaffold.

Plugin skeleton

  • {{PLUGIN_SLUG}}.php — valid WP plugin header, ABSPATH guard, version/path constants, plugins_loaded hook stub
  • uninstall.php — conservative stub, no data deletion by default
  • Placeholder tokens ({{PLUGIN_NAME}}, {{PLUGIN_SLUG}}, {{NAMESPACE}}, etc.) used consistently across all files

Tooling

  • plugin-utils.mjs — Node CLI with validate-plugin, validate-schema, security-scan, scan-placeholders commands; security scanner uses exclusion patterns to suppress false positives for known sanitisation wrappers
  • package.json@wordpress/scripts-based with build, start, lint, i18n, and all validation scripts
  • composer.json — PHPCS + PHPCBF + WordPress Coding Standards + PHPCompatibility-WP

Folder structure

  • src/blocks/, blocks/, assets/, inc/, patterns/, templates/, languages/, docs/ — all scaffolded with .gitkeep
  • docs/ — end-user docs only; developer reports go to .github/reports/

GitHub / AI infrastructure

  • .github/copilot-instructions.md + five instructions/*.instructions.md files (php, blocks, plugin-structure, assets, workflows)
  • Four prompt files: cleanup, audit-plugin, new-block, release
  • .github/reports/ and .github/tasks/ with README conventions and starter task-list.md
  • CI workflows (ci.yml, code-quality.yml, release.yml) — all scoped to permissions: contents: read
  • .agents/skills/block-plugin-audit/SKILL.md and .agents/agents/plugin-architect.md for portable agent use
Original prompt

LightSpeed WordPress Block Plugin Starter Repo — Generation Prompt

You are a senior WordPress plugin engineer, repository architect, and AI workflow designer.

Your task is to generate a lean, production-aware starter GitHub template repository for LightSpeed’s GitHub organisation for building custom WordPress plugins, with a strong bias toward block-ready plugins for client and commercial work.

This is not a WordPress.org submission starter.
Do not over-engineer it.
Stay close to WordPress plugin best practices, security, accessibility, maintainability, and block development guidelines where sensible, but do not add unnecessary WordPress.org-only bureaucracy.

The repository must support both:

  1. WordPress plugin development
  2. AI-assisted workflows inside the repo

The repository should feel like a clean starter for developers and a structured workspace for AI agents.


Core Intent

Build a reusable starter repo that:

  • gives LightSpeed a clean plugin scaffold
  • supports block plugin work without forcing a huge multi-block framework
  • includes essential plugin files and folders, mostly light or empty
  • includes practical validation and linting
  • includes clear AI instructions and prompt infrastructure
  • includes folders for AI reports, task lists, skills, agents, and instructions
  • includes a docs/ folder for end-user documentation
  • uses consistent placeholders across the repo
  • keeps complexity low unless there is strong justification

This starter is intentionally simpler than LightSpeed’s existing block-plugin-scaffold.
Do not reproduce the full generator-heavy scaffold unless a specific feature is genuinely required.


Reference Material To Review First

Use these references as source material and inspiration before generating anything.

LightSpeed plugin scaffold references

LightSpeed theme scaffold references

WordPress / ecosystem inspiration

Changelog standards


What To Learn From The Existing Scaffolds

Review the current LightSpeed scaffolds and deliberately adapt only what is useful.

From block-plugin-scaffold

Borrow the useful ideas, but reduce the overall surface area.

Useful ideas to preserve in spirit:

  • placeholder consistency across files
  • clear README and docs structure
  • Composer + Node tooling
  • practical linting and validation
  • release/changelog discipline
  • AI instructions and prompt organisation
  • support for block development
  • support for future JSON schema validation

Things to avoid copying wholesale into this starter unless clearly justified:

  • full generator infrastructure
  • multi-stage mustache generator workflows
  • heavy schema libraries
  • large SCF-specific systems
  • Playwright / E2E by default
  • PHPStan by default unless kept very light
  • large numbers of scripts and automation layers
  • scaffold-management files that only make sense for the scaffold repo itself

From block-theme-scaffold

Borrow the useful structural discipline:

  • root documentation clarity
  • AI instruction files
  • CodeRabbit setup style
  • .editorconfig
  • .gitattributes
  • CODEOWNERS
  • practical repo hygiene

But do not turn this plugin starter into a theme repo.


Design Principles

  • Plugin-first, not monorepo
  • One plugin in one repo
  • Block-ready, but not forced into a large multi-block architecture
  • Keep PHP architecture minimal
  • Keep security in mind
  • Keep accessibility in mind
  • Use semantic, native WordPress conventions
  • Prefer stable WordPress APIs before extra abstraction
  • Use @wordpress/scripts only if it clearly helps
  • Avoid a heavy JS toolchain unless clearly justified
  • Do not add webpack config, Vite, Playwright, Storybook, Docker, or CI c...

Copilot AI changed the title [WIP] Create starter repository for LightSpeed WordPress block plugins Add LightSpeed WordPress block plugin starter repo scaffold Mar 30, 2026
Copilot AI requested a review from ashleyshaw March 30, 2026 15:48
@ashleyshaw ashleyshaw requested a review from Copilot March 30, 2026 15:55
@ashleyshaw ashleyshaw marked this pull request as ready for review March 30, 2026 15:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Bootstraps a lean starter GitHub template repository for LightSpeed WordPress block-first plugin development, including a minimal plugin skeleton, validation/lint tooling, and AI/workflow scaffolding.

Changes:

  • Added core plugin scaffold files ({{PLUGIN_SLUG}}.php, uninstall.php, readme.txt) plus standard folder layout via .gitkeep.
  • Added Node/Composer tooling (plugin-utils.mjs, package.json, composer.json) and CI workflows for validation and code quality.
  • Added AI/workflow infrastructure (AGENTS.md, .github/ instructions/prompts/reports/tasks, .agents/ skills/personas).

Reviewed changes

Copilot reviewed 41 out of 57 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
{{PLUGIN_SLUG}}.php Main plugin bootstrap skeleton with constants and hooks.
uninstall.php Conservative uninstall stub (no data deletion by default).
readme.txt WP-style readme placeholder with versioning metadata.
README.md Template repo documentation and getting-started guidance.
CHANGELOG.md Keep a Changelog + SemVer scaffold.
package.json @wordpress/scripts-based build/lint scripts and CLI wiring.
plugin-utils.mjs Repo CLI for scaffold validation, JSON checks, security scan, placeholder scan.
composer.json PHPCS/WPCS + PHPCompatibility-WP dev tooling and scripts.
.nvmrc Pins Node major version for contributors/CI.
.editorconfig Enforces tabs for PHP and 2-space indentation for JS/CSS/JSON/YAML.
.gitignore Ignores vendor/node_modules and build artefacts; documents lockfile policy.
.gitattributes Line-ending normalisation and export-ignore rules for release archives.
.lintstagedrc.json Pre-commit staged-file lint configuration.
CODEOWNERS Default ownership placeholder.
CLAUDE.md Points Claude users to AGENTS.md.
AGENTS.md Primary AI agent guidance and repo conventions.
.coderabbit.yml CodeRabbit review configuration and path-specific instructions.
.github/README.md Explains GitHub-specific AI/workflow folder purpose.
.github/copilot-instructions.md High-level Copilot guidance and links to scoped instruction files.
.github/instructions/README.md Index of instruction files and how they work.
.github/instructions/php.instructions.md PHP/WPCS, escaping, sanitisation rules for Copilot.
.github/instructions/blocks.instructions.md Block structure and block.json conventions for Copilot.
.github/instructions/plugin-structure.instructions.md Repo structure rules and bootstrap expectations.
.github/instructions/assets.instructions.md Source vs built vs static asset conventions.
.github/instructions/workflows.instructions.md Workflow expectations (CI/release) for Copilot.
.github/prompts/README.md Index of reusable Copilot prompt files.
.github/prompts/cleanup.prompt.md Prompt scaffold for safe clean-ups.
.github/prompts/audit-plugin.prompt.md Prompt scaffold for security/quality audits.
.github/prompts/new-block.prompt.md Prompt scaffold for new block creation.
.github/prompts/release.prompt.md Prompt scaffold for preparing a release.
.github/reports/README.md Conventions for AI/dev reports storage and naming.
.github/reports/.gitkeep Keeps reports folder in version control.
.github/tasks/README.md Conventions for task lists and AI work tracking.
.github/tasks/task-list.md Starter task list template.
.github/tasks/.gitkeep Keeps tasks folder in version control.
.github/workflows/ci.yml CI job running Node validation, schema checks, security scan, and lint.
.github/workflows/code-quality.yml PHP lint + PHPCS job.
.github/workflows/release.yml Tag-triggered validation workflow for releases.
.agents/README.md Explains portable agent assets vs GitHub-specific assets.
.agents/skills/README.md Describes skill structure and indexing.
.agents/skills/block-plugin-audit/SKILL.md Portable audit skill definition aligned to repo prompts.
.agents/agents/README.md Describes persona definitions and indexing.
.agents/agents/plugin-architect.md Plugin architect persona definition for agent usage.
inc/.gitkeep Keeps inc/ tracked for optional PHP includes.
languages/.gitkeep Keeps languages/ tracked for translations.
docs/README.md End-user docs guidance and suggested structure.
src/.gitkeep Keeps src/ tracked for source assets.
src/blocks/.gitkeep Keeps src/blocks/ tracked for block source.
src/js/.gitkeep Keeps src/js/ tracked for JS source.
src/css/.gitkeep Keeps src/css/ tracked for CSS source.
blocks/.gitkeep Keeps blocks/ tracked for built block assets.
assets/js/.gitkeep Keeps assets/js/ tracked for static JS.
assets/css/.gitkeep Keeps assets/css/ tracked for static CSS.
assets/images/.gitkeep Keeps assets/images/ tracked for images.
assets/icons/.gitkeep Keeps assets/icons/ tracked for icons.
patterns/.gitkeep Keeps patterns/ tracked for block patterns.
templates/.gitkeep Keeps templates/ tracked for optional templates/template parts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +2 to +3
"*.php": ["composer run phpcs --", "composer run phplint --"],
"src/**/*.js": ["npm run lint:js --"],
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

composer run phplint -- is not compatible with the current phplint composer script (it uses find … | xargs php -l). When lint-staged appends filenames, they will be passed through to php -l (including a literal --), which is likely to break the lint step. Consider providing a phplint script that can accept a file list, or avoid passing staged filenames for this command.

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +40
function {{PLUGIN_SLUG}}_load_textdomain() {
load_plugin_textdomain(
'{{TEXT_DOMAIN}}',
false,
dirname( plugin_basename( __FILE__ ) ) . '/languages'
);
}
add_action( 'init', '{{PLUGIN_SLUG}}_load_textdomain' );
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder {{PLUGIN_SLUG}} is intended to be a hyphenated slug (e.g. my-awesome-plugin), but it is used here in PHP function names and hook callbacks. Hyphens are invalid in PHP identifiers, so replacing placeholders as documented will produce a fatal parse error. Use a separate placeholder for a PHP-safe function prefix (e.g. an underscored variant) and update both the function declaration and add_action() callback accordingly.

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +49
function {{PLUGIN_SLUG}}_init() {
// Example: require_once {{NAMESPACE}}_PLUGIN_DIR . 'inc/class-{{PLUGIN_SLUG}}-example.php';
}
add_action( 'plugins_loaded', '{{PLUGIN_SLUG}}_init' );
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same {{PLUGIN_SLUG}} placeholder is also used in the {{PLUGIN_SLUG}}_init() function name and its plugins_loaded callback, which will also break when the slug contains hyphens. Please switch to a PHP-identifier-safe prefix placeholder for function names/callbacks here as well.

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +22
// Prevent direct access.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ABSPATH guard does not follow the repo’s own stated convention (defined( 'ABSPATH' ) || exit;) and the exit; line is not indented. Align this with WordPress Coding Standards (tabs) and the documented one-liner guard to keep the bootstrap consistent.

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +16
"lint": "npm run lint:js && npm run lint:css && npm run lint:json",
"lint:js": "wp-scripts lint-js src",
"lint:css": "wp-scripts lint-style src",
"lint:json": "wp-scripts lint-md-docs . --ext=.json || true",
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint:json currently runs wp-scripts lint-md-docs and then forces success with || true, so npm run lint will not fail even when JSON is invalid. Either replace this with a command that actually validates JSON (or reuse schema:validate), and remove the unconditional success so CI can catch broken JSON.

Copilot uses AI. Check for mistakes.
Comment on lines +189 to +191
- This repo is **not** packaged specifically for WordPress.org submission.
- `composer.lock` is not committed (this is a plugin, not a deployment artefact).
- `package-lock.json` is committed to pin Node dependencies. No newline at end of file
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README states that package-lock.json is committed, but there is no package-lock.json in this scaffold. Either add and commit the lockfile (preferred if you want reproducible installs) or update this note (and any related export-ignore entries) to match reality.

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +38
function {{PLUGIN_SLUG}}_load_textdomain() {
load_plugin_textdomain(
'{{TEXT_DOMAIN}}',
false,
dirname( plugin_basename( __FILE__ ) ) . '/languages'
);
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plugin bootstrap isn’t indented using tabs (e.g. the load_plugin_textdomain() call arguments and closing paren). This will fail or at least fight PHPCS/WPCS in a repo that enforces WordPress Coding Standards; please format these blocks with tab indentation.

Copilot uses AI. Check for mistakes.
ashleyshaw and others added 2 commits March 30, 2026 18:07
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
@ashleyshaw ashleyshaw merged commit c4aa96b into main Mar 30, 2026
0 of 2 checks passed
@ashleyshaw ashleyshaw deleted the copilot/create-light-speed-plugin-starter-repo branch March 30, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants