Skip to content

docs: codify issue template frontmatter policy (#880)#893

Open
ashleyshaw wants to merge 3 commits into
developfrom
codex/880-template-frontmatter-decision
Open

docs: codify issue template frontmatter policy (#880)#893
ashleyshaw wants to merge 3 commits into
developfrom
codex/880-template-frontmatter-decision

Conversation

@ashleyshaw

@ashleyshaw ashleyshaw commented Jun 7, 2026

Copy link
Copy Markdown
Member

Linked issues

Changelog

Added

  • Added a validator smoke test for the issue-template frontmatter and template-to-type mapping contract.

Changed

  • Updated issue creation guidance to say broader numbered templates must still state the intended canonical type in the issue body.
  • Updated repo-local Copilot instructions to reflect the same template-selection rule.
  • Clarified the automation guidance so issue templates are guidance-driven rather than pre-populating deterministic type labels.
  • Extended the template-label validator to enforce issue-template frontmatter and the numbered template-to-type mapping.

Fixed

  • Clarified that issue templates do not rely on deterministic type-label frontmatter for routing.

Removed

  • None.

Risk Assessment

  • Low risk (documentation and validation only; no runtime issue-field automation changes).

How to Test

Prerequisites

  • npm ci completed in the checkout.

Test Steps

  1. Run node scripts/agents/includes/check-template-labels.js.
  2. Run npx jest scripts/agents/includes/__tests__/check-template-labels.test.js --runInBand.
  3. Review the updated issue creation guidance in docs/ISSUE_CREATION_GUIDE.md and .github/custom-instructions.md.

Expected Results

  • The validator reports valid template frontmatter, labels, and type mappings.
  • The guidance docs state that broader templates must still name the intended canonical type.
  • The PR remains scoped to the template-frontmatter decision only.

Edge Cases to Verify

  • A template with missing frontmatter still fails validation.
  • An unknown label or issue type in template metadata still fails validation.

Checklist (Global DoD / PR)

  • Issue-880 decision captured
  • Validator updated
  • Regression test added
  • Guidance updated

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

✅ Template check passed after update. Thanks for fixing the PR description.

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ashleyshaw, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 38 minutes and 44 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 0c51d390-7aed-4f67-9054-5acf4a527862

📥 Commits

Reviewing files that changed from the base of the PR and between 0df73b6 and 04b4d5f.

📒 Files selected for processing (1)
  • .github/custom-instructions.md
📝 Walkthrough

Walkthrough

This PR updates issue template validation and documentation to reflect a new canonical issue type structure. Documentation clarifies the new type count (35), whilst the validation script gains template-to-type mapping and comprehensive YAML frontmatter inspection with a corresponding test.

Changes

Template type validation and documentation alignment

Layer / File(s) Summary
Documentation updates for type count and template guidance
.github/custom-instructions.md, docs/AUTOMATION.md, docs/ISSUE_CREATION_GUIDE.md
Custom instructions, automation guide, and issue creation guide update to reflect 35 canonical types (previously 29), clarify that multiple types intentionally share broader templates, and instruct contributors to specify their intended type when a numbered template is broader than their request.
Template validation implementation with type mapping and frontmatter parsing
scripts/agents/includes/check-template-labels.js
Introduces TEMPLATE_TYPE_MAP associating templates to primary and secondary types, adds extractFrontmatter() to parse YAML frontmatter blocks, tightens template filename discovery to two-digit-prefixed markdown files, and implements multi-stage validation: required frontmatter keys, canonical labels existence, type existence in issue-types.yml, and compatibility between declared types and type mappings.
Smoke test for template validation script
scripts/agents/includes/__tests__/check-template-labels.test.js
Jest test suite executes the validation script as a Node subprocess and asserts the success message confirming frontmatter, labels, and type mappings are valid.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • lightspeedwp/.github#418: Adds type:question and type:support labels, which this PR's enhanced validation script now validates against issue-types.yml and template mappings.

Suggested labels

priority:normal, status:needs-review, meta:needs-changelog, type:documentation, area:tests, area:scripts, lang:md, lang:js, area:labels

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarises the main change: codifying the issue template frontmatter policy and its validator implementation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed PR description follows the template structure with all key sections completed: linked issues, comprehensive changelog (Added/Changed/Fixed/Removed), risk assessment, testing instructions with prerequisites and steps, edge cases, and checklist marked complete.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/880-template-frontmatter-decision

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added area:labels Label governance and routing area:documentation Docs & guides area:tests Test suites & harnesses area:scripts Scripts & tooling lang:js JavaScript/TypeScript lang:md Markdown content/docs status:needs-review Awaiting code review priority:normal Default priority type:chore Chore / small hygiene change type:bug Bug or defect meta:needs-changelog Requires a changelog entry before merge labels Jun 7, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates documentation to reflect an increase in canonical issue types from 29 to 35, and enhances the check-template-labels.js script to validate template frontmatter, labels, and template-to-type mappings, supported by a new smoke test. The review feedback suggests improving cross-platform compatibility by supporting CRLF line endings in the frontmatter extraction regex, and implementing bidirectional validation on the template map to prevent potential unhandled file-not-found crashes.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

}

function extractFrontmatter(content) {
const match = content.match(/^---\n([\s\S]*?)\n---\n?/);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The regular expression used to extract frontmatter expects Unix-style line endings (\n). If the repository is checked out on Windows with core.autocrlf enabled, the files will have CRLF (\r\n) line endings, causing this match to fail and return null. This will lead to false validation failures. Updating the regex to support optional carriage returns (\r?) ensures cross-platform compatibility.

Suggested change
const match = content.match(/^---\n([\s\S]*?)\n---\n?/);
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);

Comment on lines +277 to +284
const missingMappedFiles = templateFiles.filter(
(file) => !TEMPLATE_TYPE_MAP[file],
);
if (missingMappedFiles.length > 0) {
console.error("Missing template-to-type mapping entries:");
for (const file of missingMappedFiles) console.error(` - ${file}`);
process.exit(1);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The current validation only checks if all existing template files are defined in TEMPLATE_TYPE_MAP. However, it does not verify the reverse: if TEMPLATE_TYPE_MAP contains a file that does not exist in the filesystem, fs.readFileSync on line 293 will throw an unhandled ENOENT error and crash the script. Implementing bidirectional validation ensures the mapping is kept perfectly in sync and prevents unhandled crashes.

  const templateFilesSet = new Set(templateFiles);
  const missingMappedFiles = templateFiles.filter(
    (file) => !TEMPLATE_TYPE_MAP[file],
  );
  const extraMappedFiles = templateMapEntries
    .map(([file]) => file)
    .filter((file) => !templateFilesSet.has(file));

  if (missingMappedFiles.length > 0 || extraMappedFiles.length > 0) {
    if (missingMappedFiles.length > 0) {
      console.error("Missing template-to-type mapping entries:");
      for (const file of missingMappedFiles) console.error(\`  - \${file}\`);
    }
    if (extraMappedFiles.length > 0) {
      console.error("Template-to-type mapping contains non-existent files:");
      for (const file of extraMappedFiles) console.error(\`  - \${file}\`);
    }
    process.exit(1);
  }

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0df73b60cb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
}

const unknownMappedTypes = [...mappedTypes].filter((typeLabel) => !issueTypeLabels.has(typeLabel));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add a reverse coverage check for canonical types

When a new canonical issue type is added to .github/issue-types.yml without updating TEMPLATE_TYPE_MAP, this validator still passes because it only verifies that mapped types exist in issueTypeLabels; it never checks for issueTypeLabels that are absent from mappedTypes. That leaves the new template-to-type mapping contract unable to catch exactly the drift it is meant to guard against, so future canonical types can be introduced without any broader-template assignment.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot added the type:documentation Documentation label Jun 7, 2026
@github-actions github-actions Bot removed type:documentation Documentation type:chore Chore / small hygiene change labels Jun 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
docs/AUTOMATION.md (1)

5-6: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Please bump version and last_updated after this doc edit.

The validator is failing because metadata on Line 5 and Line 6 still reflects the previous revision.

✅ Suggested patch
-version: "v1.0.1"
-last_updated: "2026-06-01"
+version: "v1.0.2"
+last_updated: "2026-06-07"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/AUTOMATION.md` around lines 5 - 6, Update the metadata in AUTOMATION.md
by bumping the version field and updating the last_updated timestamp: change the
"version" value (currently "v1.0.1") to the new release version and set
"last_updated" (currently "2026-06-01") to today's date (or the appropriate new
date) so the file's metadata matches the current revision.

Source: Pipeline failures

.github/custom-instructions.md (1)

6-7: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Frontmatter freshness needs a quick version/date bump to unblock CI.

Tiny gremlin, big blocker: the body changed, but Line 6 (version) and Line 7 (last_updated) stayed unchanged, so the frontmatter validator fails.

✅ Suggested patch
-version: v1.1
-last_updated: '2026-06-05'
+version: v1.2
+last_updated: '2026-06-07'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/custom-instructions.md around lines 6 - 7, Update the frontmatter in
.github/custom-instructions.md by incrementing the version value and setting
last_updated to today's date; specifically edit the "version" key (currently
v1.1) and the "last_updated" key so the frontmatter validator passes (ensure the
version string and ISO date format match project conventions).

Source: Pipeline failures

docs/ISSUE_CREATION_GUIDE.md (3)

5-7: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Frontmatter freshness is out of date, so validation is red.

Line 5 (version) and Line 7 (last_updated) need updating because the body changed in this PR.

✅ Suggested patch
-version: "1.0.1"
-last_updated: '2026-06-03'
+version: "1.0.2"
+last_updated: '2026-06-07'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/ISSUE_CREATION_GUIDE.md` around lines 5 - 7, Update the frontmatter
fields in ISSUE_CREATION_GUIDE.md to reflect the PR changes: bump the version
value (the "version" frontmatter key) to the new semantic version appropriate
for this change and set the "last_updated" frontmatter key to today's date (ISO
format) so the file metadata matches the body edits in this PR.

Source: Pipeline failures


20-20: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a single H1 so heading structure starts correctly.

This file begins at H2 (## Overview) and never defines an H1, which hurts document structure and accessibility.

As per coding guidelines, “Use one H1 (#) per file; keep heading levels sequential (never skip from H2 to H4)”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/ISSUE_CREATION_GUIDE.md` at line 20, This file starts with an H2 "##
Overview" but needs a single H1 at the top; add one H1 (for example "# Issue
Creation Guide") immediately above the existing "## Overview" heading, ensure no
other H1s exist in the file, and keep all subsequent headings sequential (do not
change "## Overview" text itself).

Source: Coding guidelines


142-160: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Give this fenced block an explicit language tag.

The code fence is currently untyped (```), so markdown lint/style rules are missed for that block.

As per coding guidelines, “Use fenced code blocks with explicit language tags (bash, yaml, markdown, etc.)”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/ISSUE_CREATION_GUIDE.md` around lines 142 - 160, The fenced code block
that starts with "**Describe the bug**" is missing a language tag; update the
opening fence from ``` to ```markdown (so the block is ```markdown ... ```) to
satisfy the lint/style rule for explicit fenced code block language tags and
keep the closing ``` unchanged.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/agents/includes/check-template-labels.js`:
- Line 206: The regex in the label normalization call
label.replace(/['"\[\]]/gu, "") triggers ESLint's no-useless-escape for the
escaped "["; update the regex used in
scripts/agents/includes/check-template-labels.js within the map callback (the
label.replace(...) call) to remove the unnecessary backslash before "[" and only
escape the closing bracket, e.g. use /['"[\]]/gu so the character class is valid
and ESLint no-useless-escape is satisfied.

---

Outside diff comments:
In @.github/custom-instructions.md:
- Around line 6-7: Update the frontmatter in .github/custom-instructions.md by
incrementing the version value and setting last_updated to today's date;
specifically edit the "version" key (currently v1.1) and the "last_updated" key
so the frontmatter validator passes (ensure the version string and ISO date
format match project conventions).

In `@docs/AUTOMATION.md`:
- Around line 5-6: Update the metadata in AUTOMATION.md by bumping the version
field and updating the last_updated timestamp: change the "version" value
(currently "v1.0.1") to the new release version and set "last_updated"
(currently "2026-06-01") to today's date (or the appropriate new date) so the
file's metadata matches the current revision.

In `@docs/ISSUE_CREATION_GUIDE.md`:
- Around line 5-7: Update the frontmatter fields in ISSUE_CREATION_GUIDE.md to
reflect the PR changes: bump the version value (the "version" frontmatter key)
to the new semantic version appropriate for this change and set the
"last_updated" frontmatter key to today's date (ISO format) so the file metadata
matches the body edits in this PR.
- Line 20: This file starts with an H2 "## Overview" but needs a single H1 at
the top; add one H1 (for example "# Issue Creation Guide") immediately above the
existing "## Overview" heading, ensure no other H1s exist in the file, and keep
all subsequent headings sequential (do not change "## Overview" text itself).
- Around line 142-160: The fenced code block that starts with "**Describe the
bug**" is missing a language tag; update the opening fence from ``` to
```markdown (so the block is ```markdown ... ```) to satisfy the lint/style rule
for explicit fenced code block language tags and keep the closing ``` unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 3ab88ec9-1249-46a0-a8f2-ef28632b9816

📥 Commits

Reviewing files that changed from the base of the PR and between e4f237b and 0df73b6.

📒 Files selected for processing (5)
  • .github/custom-instructions.md
  • docs/AUTOMATION.md
  • docs/ISSUE_CREATION_GUIDE.md
  • scripts/agents/includes/__tests__/check-template-labels.test.js
  • scripts/agents/includes/check-template-labels.js
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: coderabbit-gate
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{php,js,jsx,ts,tsx,css,scss,html}

📄 CodeRabbit inference engine (AGENTS.md)

Follow WordPress Coding Standards (CSS, HTML, JavaScript, PHP) and inline-documentation standards at all times

Files:

  • scripts/agents/includes/__tests__/check-template-labels.test.js
  • scripts/agents/includes/check-template-labels.js
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{js,ts,jsx,tsx}: Follow ESLint/Prettier standards for JavaScript and TypeScript files
Avoid unnecessary JavaScript, defer/lazy-load where possible, and prefer native blocks

Files:

  • scripts/agents/includes/__tests__/check-template-labels.test.js
  • scripts/agents/includes/check-template-labels.js
**/*.{js,ts}

⚙️ CodeRabbit configuration file

**/*.{js,ts}: Review JavaScript/TypeScript:

  • Ensure code is linted and follows project style guides.
  • Check for dead code, unused variables, and clear function naming.
  • Validate accessibility and performance optimisations.
  • Ensure tests are isolated and do not depend on external state.
  • Check for descriptive test names and clear test structure.

Files:

  • scripts/agents/includes/__tests__/check-template-labels.test.js
  • scripts/agents/includes/check-template-labels.js
.github/custom-instructions.md

⚙️ CodeRabbit configuration file

.github/custom-instructions.md: Review custom-instructions.md:

  • Ensure the file is easy to navigate and up to date with org standards.
  • Validate YAML frontmatter for completeness and accuracy.
  • Confirm cross-references to prompts.md, agent.md, AGENTS.md, and instruction files.
  • Check for up-to-date cross-references and clear documentation of Copilot usage.

Files:

  • .github/custom-instructions.md
**/*.md

📄 CodeRabbit inference engine (.github/instructions/markdown.instructions.md)

**/*.md: Use one H1 (#) per file; keep heading levels sequential (never skip from H2 to H4)
Use fenced code blocks with explicit language tags (bash, yaml, markdown, etc.)
Keep links relative for in-repo files; verify they resolve before merging
Use 1. for ordered lists and - for unordered lists
Keep all wording in UK English (optimise, organisation, colour, behaviour, analyse)
Do not add a references: frontmatter field — use inline links or a footer section instead
Blank lines before and after headings, code blocks, and block-level elements
Maximum line length: 120 characters (soft limit; prefer wrapping at natural sentence boundaries)
All .md files in this repository should include YAML frontmatter with required fields: file_type, title, description, version, last_updated, owners, tags, status, stability, domain
Every image (![]()) must have descriptive alt text explaining the image's purpose, not its appearance. Empty alt (![ ]()) is valid only for purely decorative images
Link text must describe the destination — never use 'click here', 'read more', or bare URLs as visible text
Every table must have a header row (| Header |). Avoid merged cells
Use headings to communicate document structure, not for visual styling
Do not rely on colour alone to convey information in diagrams or callout blocks
Mermaid diagrams must include accTitle and accDescr attributes for accessibility
Specify language in frontmatter; use plain language, avoid jargon where possible

Files:

  • docs/ISSUE_CREATION_GUIDE.md
  • docs/AUTOMATION.md
**/docs/**/*.md

⚙️ CodeRabbit configuration file

**/docs/**/*.md: Review documentation files:

  • Ensure markdown is linted and formatted per project style guides.
  • Flag illogical folder structures, file naming, or misplaced content.
  • Confirm documentation is up to date, accurate, and cross-referenced.
  • Ensure accessibility (heading hierarchy, alt text for images, UK English).

Files:

  • docs/ISSUE_CREATION_GUIDE.md
  • docs/AUTOMATION.md
🧠 Learnings (5)
📚 Learning: 2026-06-03T17:57:58.761Z
Learnt from: CR
Repo: lightspeedwp/.github PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-03T17:57:58.761Z
Learning: Run `npm ci` to install dependencies, `npm test` to run all tests, `npm run lint:md` to lint Markdown files, `npm run lint:js` to lint JS/TS files, `npm run format` to format files, and `npm run validate:frontmatter` to validate frontmatter

Applied to files:

  • scripts/agents/includes/__tests__/check-template-labels.test.js
  • docs/AUTOMATION.md
  • scripts/agents/includes/check-template-labels.js
📚 Learning: 2026-06-03T15:59:30.973Z
Learnt from: CR
Repo: lightspeedwp/.github PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-03T15:59:30.973Z
Learning: Use the default PR template at .github/pull_request_template.md and select the most relevant additional template from .github/PULL_REQUEST_TEMPLATE/ for your change type

Applied to files:

  • .github/custom-instructions.md
  • docs/ISSUE_CREATION_GUIDE.md
📚 Learning: 2026-06-03T15:59:30.973Z
Learnt from: CR
Repo: lightspeedwp/.github PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-03T15:59:30.973Z
Learning: Ensure core instructions are consolidated and reference the appropriate instruction files in `instructions/{languages,documentation-formats,quality-assurance,automation,community-standards}.instructions.md`

Applied to files:

  • .github/custom-instructions.md
📚 Learning: 2026-06-03T17:57:58.761Z
Learnt from: CR
Repo: lightspeedwp/.github PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-03T17:57:58.761Z
Learning: All PRs must target `develop` by default, NOT `main`. Only `release/*` and `hotfix/*` branches are allowed to merge to `main`.

Applied to files:

  • docs/AUTOMATION.md
📚 Learning: 2026-06-03T15:59:30.973Z
Learnt from: CR
Repo: lightspeedwp/.github PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-03T15:59:30.973Z
Learning: Applies to agents/**/*.{js,py,ts} : Each agent must have both a code file (`.js`, `.py`, etc.) and a spec (`.md`) following the template

Applied to files:

  • docs/AUTOMATION.md
🪛 ESLint
scripts/agents/includes/__tests__/check-template-labels.test.js

[error] 4-4: 'require' is not defined.

(no-undef)


[error] 5-5: 'require' is not defined.

(no-undef)

scripts/agents/includes/check-template-labels.js

[error] 206-206: Unnecessary escape character: [.

(no-useless-escape)

🪛 GitHub Actions: CI / 0_check.txt
scripts/agents/includes/check-template-labels.js

[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)

🪛 GitHub Actions: CI / check
scripts/agents/includes/check-template-labels.js

[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape).

🪛 GitHub Actions: CI • Unified Checks (Lint, Test, Validate) / 2_Linting.txt
scripts/agents/includes/check-template-labels.js

[error] 206-206: ESLint (no-useless-escape): Unnecessary escape character: [ (step: npm run lint:js / eslint --fix)

🪛 GitHub Actions: CI • Unified Checks (Lint, Test, Validate) / Linting
scripts/agents/includes/check-template-labels.js

[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)

🪛 GitHub Actions: lint / 0_lint.txt
scripts/agents/includes/check-template-labels.js

[error] 206-206: ESLint error: Unnecessary escape character: [. (no-useless-escape)

🪛 GitHub Actions: lint / lint
scripts/agents/includes/check-template-labels.js

[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)

🪛 GitHub Actions: Meta Agent / 2_front-matter-validate.txt
.github/custom-instructions.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-05).


[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (v1.1).

docs/ISSUE_CREATION_GUIDE.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-03).


[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (1.0.1).

docs/AUTOMATION.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-01).


[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (v1.0.1).

🪛 GitHub Actions: Meta Agent / front-matter-validate
.github/custom-instructions.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-05).


[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (v1.1).

docs/ISSUE_CREATION_GUIDE.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-03).


[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (1.0.1).

docs/AUTOMATION.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-06-01).


[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (v1.0.1).

🪛 GitHub Check: check
scripts/agents/includes/check-template-labels.js

[failure] 206-206:
Unnecessary escape character: [

🪛 GitHub Check: lint
scripts/agents/includes/check-template-labels.js

[failure] 206-206:
Unnecessary escape character: [

🪛 GitHub Check: Linting
scripts/agents/includes/check-template-labels.js

[failure] 206-206:
Unnecessary escape character: [

🪛 LanguageTool
.github/custom-instructions.md

[uncategorized] ~62-~62: The official name of this software platform is spelled with a capital “H”.
Context: ...te: - Canonical issue types = 35 (from .github/issue-types.yml). - Numbered templates...

(GITHUB)

🔇 Additional comments (1)
scripts/agents/includes/__tests__/check-template-labels.test.js (1)

1-5: Drop the eslint-env jest, node suggestion—ESLint isn’t flagging require in scripts/agents/includes/__tests__/check-template-labels.test.js.
The current lint failure is instead the unrelated no-useless-escape error in scripts/agents/includes/check-template-labels.js (:206:41).

			> Likely an incorrect or invalid review comment.

if (typeof labelsValue === "string") {
return labelsValue
.split(",")
.map((label) => label.replace(/['"\[\]]/gu, "").trim())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify this specific lint failure is resolved
npm run lint:js -- scripts/agents/includes/check-template-labels.js

Repository: lightspeedwp/.github

Length of output: 6089


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="scripts/agents/includes/check-template-labels.js"
echo "---- Current snippet around line 206 ----"
nl -ba "$FILE" | sed -n '190,220p'

echo "---- Rerun targeted lint ----"
npm run lint:js -- "$FILE"

Repository: lightspeedwp/.github

Length of output: 167


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="scripts/agents/includes/check-template-labels.js"

echo "---- Current snippet around line 206 (with awk line numbers) ----"
awk 'NR>=190 && NR<=220 {printf "%d:%s\n", NR, $0}' "$FILE"

echo "---- Rerun targeted lint ----"
npm run lint:js -- "$FILE"

Repository: lightspeedwp/.github

Length of output: 6881


Fix the no-useless-escape regex at label normalisation (line 206)

Line 206 in scripts/agents/includes/check-template-labels.js still uses label.replace(/['"\[\]]/gu, ""), which keeps failing ESLint with no-useless-escape for the \[.

✅ Suggested patch
-      .map((label) => label.replace(/['"\[\]]/gu, "").trim())
+      .map((label) => label.replace(/['"[\]]/gu, "").trim())
🧰 Tools
🪛 ESLint

[error] 206-206: Unnecessary escape character: [.

(no-useless-escape)

🪛 GitHub Actions: CI / 0_check.txt

[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)

🪛 GitHub Actions: CI / check

[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape).

🪛 GitHub Actions: CI • Unified Checks (Lint, Test, Validate) / 2_Linting.txt

[error] 206-206: ESLint (no-useless-escape): Unnecessary escape character: [ (step: npm run lint:js / eslint --fix)

🪛 GitHub Actions: CI • Unified Checks (Lint, Test, Validate) / Linting

[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)

🪛 GitHub Actions: lint / 0_lint.txt

[error] 206-206: ESLint error: Unnecessary escape character: [. (no-useless-escape)

🪛 GitHub Actions: lint / lint

[error] 206-206: ESLint: Unnecessary escape character: [ (no-useless-escape)

🪛 GitHub Check: check

[failure] 206-206:
Unnecessary escape character: [

🪛 GitHub Check: lint

[failure] 206-206:
Unnecessary escape character: [

🪛 GitHub Check: Linting

[failure] 206-206:
Unnecessary escape character: [

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/agents/includes/check-template-labels.js` at line 206, The regex in
the label normalization call label.replace(/['"\[\]]/gu, "") triggers ESLint's
no-useless-escape for the escaped "["; update the regex used in
scripts/agents/includes/check-template-labels.js within the map callback (the
label.replace(...) call) to remove the unnecessary backslash before "[" and only
escape the closing bracket, e.g. use /['"[\]]/gu so the character class is valid
and ESLint no-useless-escape is satisfied.

Sources: Linters/SAST tools, Pipeline failures

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #893

CI Status:success
Files changed: 5
Risk Distribution: 0 critical, 1 high, 1 medium, 3 low

Recommendations

  • Ready to proceed pending human review

@ashleyshaw ashleyshaw force-pushed the codex/880-template-frontmatter-decision branch 2 times, most recently from 13bcfe2 to 4f5bc09 Compare June 9, 2026 12:27
@ashleyshaw ashleyshaw force-pushed the codex/880-template-frontmatter-decision branch from 4181311 to 04b4d5f Compare June 9, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:documentation Docs & guides area:labels Label governance and routing area:scripts Scripts & tooling area:tests Test suites & harnesses lang:js JavaScript/TypeScript lang:md Markdown content/docs meta:needs-changelog Requires a changelog entry before merge priority:normal Default priority status:needs-review Awaiting code review type:bug Bug or defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants