Skip to content

[codex] standardise front matter contracts#1016

Merged
ashleyshaw merged 8 commits into
developfrom
chore/frontmatter-standardization
Jun 19, 2026
Merged

[codex] standardise front matter contracts#1016
ashleyshaw merged 8 commits into
developfrom
chore/frontmatter-standardization

Conversation

@ashleyshaw

@ashleyshaw ashleyshaw commented Jun 19, 2026

Copy link
Copy Markdown
Member

Chore Pull Request

This repository enforces changelog, release, and label automation for all PRs and issues.
See the organisation-wide Automation Governance & Release Strategy for required rules.

Linked issues

Closes #1012
Closes #1015

Summary

  • Standardise markdown issue templates on name + about and remove the duplicated description field.
  • Align schema, validators, docs, instructions, prompts, and workflow helpers with the GitHub-supported template contract.
  • Add regression coverage for issue template contract enforcement and the issue-template creation workflow map.

Changes

  • Updated all numbered issue templates to keep about as the canonical front matter field.
  • Tightened frontmatter and template validation so issue templates reject duplicated description and PR templates reject duplicated about.
  • Reworked the issue-creation workflow and supporting docs/instructions to point at the actual canonical templates.
  • Added a prompt for future frontmatter migrations and test coverage for the template contract.

Impact / Compatibility

  • Runtime/behaviour changes: issue template metadata is now validated consistently across scripts and docs.
  • Build/dev-experience impact: template-enforcement checks now fail when the wrong front matter field is used, which prevents future drift.

Verification

  • CI passes locally for the targeted validation suites
  • Local frontmatter validation completed against the changed docs, instructions, prompts, and templates
  • Docs/readme/changelog updated where user-facing guidance changed

Risk & Rollback

  • Risk level: Low
  • Rollback plan: revert the merge commit if any template or workflow regression appears

Changelog

Added

  • Added a reusable frontmatter migration prompt for future template normalisation.

Changed

  • Standardised issue template front matter on about and updated validation, workflow, and documentation references.

Fixed

  • Removed duplicated issue-template description fields and aligned PR template front matter with the repo’s template contract.

Removed

  • Removed stale issue-template workflow references that pointed at non-existent template files.

Checklist (Global DoD / PR)

  • All AC met and demonstrated
  • Tests added/updated (unit/E2E as appropriate)
  • Accessibility checklist completed (where relevant):
    • Semantic HTML and heading order verified
    • Keyboard navigation and visible focus states verified
    • ARIA used only where needed
    • Contrast and non-colour cues reviewed (WCAG 2.2 AA or higher)
  • Docs/readme/changelog updated (if user-facing)
  • Security checklist completed (where relevant):
    • Untrusted input validated and sanitised
    • Output escaped for its rendering context
    • Privileged actions enforce nonce and capability checks
    • No secrets/sensitive data introduced; OWASP risks reviewed
  • Code/design reviews approved
  • CI green; linked issues closed; release notes prepared (if shipping)

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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 13 minutes and 46 seconds. Learn how PR review limits work.

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

⌛ 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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

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: 9e2b34d0-0af4-47ff-bcf6-742521269de2

📥 Commits

Reviewing files that changed from the base of the PR and between bd43ba3 and 3aab04e.

⛔ Files ignored due to path filters (1)
  • schema/frontmatter.schema.json is excluded by !schema/**
📒 Files selected for processing (39)
  • .github/ISSUE_TEMPLATE/01-task.md
  • .github/ISSUE_TEMPLATE/02-bug.md
  • .github/ISSUE_TEMPLATE/03-feature.md
  • .github/ISSUE_TEMPLATE/04-design.md
  • .github/ISSUE_TEMPLATE/05-epic.md
  • .github/ISSUE_TEMPLATE/06-story.md
  • .github/ISSUE_TEMPLATE/07-improvement.md
  • .github/ISSUE_TEMPLATE/08-chore.md
  • .github/ISSUE_TEMPLATE/09-code-refactor.md
  • .github/ISSUE_TEMPLATE/10-build-ci.md
  • .github/ISSUE_TEMPLATE/11-automation.md
  • .github/ISSUE_TEMPLATE/12-testing-coverage.md
  • .github/ISSUE_TEMPLATE/13-performance.md
  • .github/ISSUE_TEMPLATE/14-a11y.md
  • .github/ISSUE_TEMPLATE/15-security.md
  • .github/ISSUE_TEMPLATE/16-compatibility.md
  • .github/ISSUE_TEMPLATE/17-integration-issue.md
  • .github/ISSUE_TEMPLATE/18-release.md
  • .github/ISSUE_TEMPLATE/19-maintenance.md
  • .github/ISSUE_TEMPLATE/20-documentation.md
  • .github/ISSUE_TEMPLATE/21-research.md
  • .github/ISSUE_TEMPLATE/22-audit.md
  • .github/ISSUE_TEMPLATE/23-code-review.md
  • .github/ISSUE_TEMPLATE/24-ai-ops.md
  • .github/ISSUE_TEMPLATE/25-content-modelling.md
  • .github/ISSUE_TEMPLATE/README.md
  • .github/PULL_REQUEST_TEMPLATE/README.md
  • .github/workflows/issue-create-from-template.yml
  • CHANGELOG.md
  • docs/FRONTMATTER_SCHEMA.md
  • docs/ISSUE_CREATION_GUIDE.md
  • docs/WORKFLOW_COORDINATION.md
  • instructions/issues.instructions.md
  • instructions/pull-requests.instructions.md
  • prompts/README.md
  • prompts/update-frontmatter.prompt
  • scripts/agents/includes/check-template-labels.js
  • scripts/validation/__tests__/issue-template-contract.test.js
  • scripts/validation/validate-frontmatter.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/frontmatter-standardization

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 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

Metadata governance

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🎨 Mermaid Diagram Validation

✅ All Mermaid diagram checks passed.

Check Result
✅ Syntax (diagram type, direction, bracket matching) Passed
✅ Accessibility (accTitle / accDescr present) Passed
✅ Colour contrast (WCAG 2.2 AA ≥ 4.5:1) Passed

@github-actions github-actions Bot added status:needs-review Awaiting code review type:chore Chore / small hygiene change priority:normal Default priority area:ci Build and CI pipelines 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 lang:json JSON config/content labels Jun 19, 2026
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #1016

CI Status:success
Files changed: 40
Risk Distribution: 1 critical, 29 high, 1 medium, 9 low

Recommendations

  • ⚠️ 1 critical-risk file(s) modified (workflows, secrets)
  • ⚠️ Security-sensitive files modified (review carefully)

@github-actions github-actions Bot added type:bug Bug or defect meta:needs-changelog Requires a changelog entry before merge labels Jun 19, 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 standardizes the repository's front matter contract, ensuring Markdown issue templates use name and about while pull request templates use title and description. It updates the schema, validators, documentation, and adds a new test suite to enforce these rules. The review feedback suggests adding a null/undefined guard in the validator to prevent crashes, making the test's front matter parser robust against Windows line endings, aligning the test's key-presence check with the validator's logic, and documenting this migration in /docs/MIGRATION.md.

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.

Comment on lines +286 to +306
if (
fileType === "issue_template" &&
Object.prototype.hasOwnProperty.call(frontmatter, "description")
) {
this.logger.error(
"Issue template frontmatter must use `about` instead of `description` to match GitHub's Markdown issue template contract.",
filePath,
);
this.stats.errors++;
}

if (
fileType === "pull_request_template" &&
Object.prototype.hasOwnProperty.call(frontmatter, "about")
) {
this.logger.error(
"Pull request template frontmatter must use `description` instead of `about` to keep repo-local template metadata consistent.",
filePath,
);
this.stats.errors++;
}

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.

high

If frontmatter is null or undefined (which can happen if the YAML block is empty or invalid), calling Object.prototype.hasOwnProperty.call(frontmatter, ...) will throw a TypeError and crash the validation script. Adding a guard at the beginning of this block ensures the validator reports the schema validation error gracefully instead of crashing.

    if (!frontmatter || typeof frontmatter !== "object") {
      return;
    }

    if (
      fileType === "issue_template" &&
      Object.prototype.hasOwnProperty.call(frontmatter, "description")
    ) {
      this.logger.error(
        "Issue template frontmatter must use 'about' instead of 'description' to match GitHub's Markdown issue template contract.",
        filePath,
      );
      this.stats.errors++;
    }

    if (
      fileType === "pull_request_template" &&
      Object.prototype.hasOwnProperty.call(frontmatter, "about")
    ) {
      this.logger.error(
        "Pull request template frontmatter must use 'description' instead of 'about' to keep repo-local template metadata consistent.",
        filePath,
      );
      this.stats.errors++;
    }


function readFrontmatter(filePath) {
const content = fs.readFileSync(filePath, "utf8");
const match = content.match(/^---\n([\s\S]*?)\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 regex ^---\n expects exactly \n after ---. If the file has Windows line endings (\r\n), this match will fail and throw an error. Using \r?\n makes the frontmatter extraction robust across different operating systems.

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


const violations = templateFiles.filter((file) => {
const frontmatter = readFrontmatter(path.join(templateDir, file));
return !frontmatter.about || Boolean(frontmatter.description);

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

Using Boolean(frontmatter.description) will not flag cases where description is present but has a falsy value (like an empty string "" or false). However, the actual validators use hasOwnProperty and will reject those files. Aligning the test check with the validator's logic ensures consistent enforcement.

Suggested change
return !frontmatter.about || Boolean(frontmatter.description);
return !frontmatter.about || "description" in frontmatter;

Comment on lines +22 to +26
Update every affected file so the repository uses one canonical front matter contract:

- Markdown issue templates in `.github/ISSUE_TEMPLATE/*.md` use `name` + `about`
- PR templates use `title` + `description`
- Documentation, instructions, and prompts keep `description` as the summary field

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

According to the repository's general rules, migration maps and notes should be documented in a central /docs/MIGRATION.md file. Please ensure that this front matter contract migration is documented there so contributors can easily follow the migration rules.

References
  1. Document migration maps and notes in a central /docs/MIGRATION.md file to ensure contributors can follow migration rules mentioned in README files across the repository.

@github-actions github-actions Bot added type:chore Chore / small hygiene change and removed type:chore Chore / small hygiene change labels Jun 19, 2026
@github-actions github-actions Bot removed the type:chore Chore / small hygiene change label Jun 19, 2026
@github-actions github-actions Bot added the type:chore Chore / small hygiene change label Jun 19, 2026
@github-actions github-actions Bot removed the type:chore Chore / small hygiene change label Jun 19, 2026
@github-actions github-actions Bot added the type:chore Chore / small hygiene change label Jun 19, 2026
@github-actions github-actions Bot removed the type:chore Chore / small hygiene change label Jun 19, 2026
@ashleyshaw ashleyshaw enabled auto-merge (squash) June 19, 2026 11:04
@ashleyshaw ashleyshaw merged commit 5916712 into develop Jun 19, 2026
28 of 29 checks passed
@ashleyshaw ashleyshaw deleted the chore/frontmatter-standardization branch June 19, 2026 11:04
@ashleyshaw ashleyshaw mentioned this pull request Jun 19, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci Build and CI pipelines area:documentation Docs & guides area:labels Label governance and routing area:scripts Scripts & tooling area:tests Test suites & harnesses lang:js JavaScript/TypeScript lang:json JSON config/content 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

1 participant