Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
309 changes: 240 additions & 69 deletions .github/scripts/validate-footers.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
- run: npm run validate:json
- run: npm run validate:issue-fields
- run: npm run validate:retired-doc-links
- run: npm run validate:footers -- --changed-only
- run: npm run validate:frontmatter:changed -- --base ${{ github.event.merge_group.base_sha || github.event.pull_request.base.sha || github.event.before }} --head ${{ github.event.merge_group.head_sha || github.event.pull_request.head.sha || github.sha }}

# Composite status check: ensures all checks pass before merge
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **Automation governance for Dependabot PRs and branding footers** — Stopped the metadata sync flow from auto-creating a milestone for each Dependabot PR, switched footer detection to the canonical branding config with tail-aware matching, and backfilled branded markdown footers across the repository. Updated the related CI, workflow, and documentation surfaces to keep the behaviour durable. ([#1010](https://github.com/lightspeedwp/.github/issues/1010), [#1013](https://github.com/lightspeedwp/.github/pull/1013))

- **Metadata governance automation for issues and pull requests** — Added and hardened the GitHub automation that assigns project items, milestones, assignees, issue/PR relationships, project field values, and labelling behaviour for new issues and pull requests. Also updated the related docs, workflow guards, and test coverage to match the current codebase. ([#974](https://github.com/lightspeedwp/.github/pull/974))

- **Community health audit — PR templates, governance docs, and README alignment** — Completed a comprehensive audit of all community health files: updated WCAG version references from 2.1 to 2.2 AA in `pr_bug.md`, `pr_chore.md`, `pr_ci.md`, and `pr_dep_update.md`; added 15 missing branch-prefix rows to the default `pull_request_template.md` quick-selector table to align with `PULL_REQUEST_TEMPLATE/config.yml`; expanded `AGENTS.md` issue template list from 10 to 23 entries and added Saved Replies section; expanded `CLAUDE.md` issue template list to match; fixed template count, range, and parity note in `.github/custom-instructions.md`; completely rewrote `.github/workflows/README.md` with an accurate inventory of all 27 real workflows (removed 4 phantom workflow references); updated `.github/README.md` version date; added 20 missing files to `.github/SAVED_REPLIES/README.md`; added template index table to `.github/ISSUE_TEMPLATE/README.md`; replaced generic category list with the 9 actual YAML file inventory in `.github/DISCUSSION_TEMPLATE/README.md`; updated `docs/ISSUE_CREATION_GUIDE.md` to 25-template parity and corrected label values. ([#966](https://github.com/lightspeedwp/.github/pull/966))
Expand Down
1 change: 1 addition & 0 deletions config/footers.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,5 @@ validation_rules:
max_footer_lines: 5
max_duplicates_allowed: 0 # Zero duplicates allowed
require_category_in_frontmatter: true
require_footer_in_document: true
allow_multiple_footers_per_document: false # ONE footer per document maximum
12 changes: 9 additions & 3 deletions docs/AUTOMATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
file_type: "documentation"
title: "Automation & Workflows"
description: "Strategy, governance, and workflow documentation for GitHub automation in LightSpeed repositories."
version: "v1.0.5"
version: "v1.0.6"
last_updated: "2026-06-19"
owners: ["LightSpeedWP Team"]
tags: ["automation", "workflows", "governance", "agents"]
Expand Down Expand Up @@ -72,7 +72,8 @@ If your project allows hotfixes directly to `main`, ensure validation workflows
| --- | --- | --- | --- |
| **labeling.yml** | develop | Unified labelling, status/priority, and type automation | labeling.agent.js |
| **changelog-validate.yml** | develop | Enforce changelog requirements and PR labelling standards | changelog validation |
| **metadata-governance.yml** | issues / pull_request_target | Apply assignee, milestone, and relationship metadata | issue-pr-metadata.cjs |
| **metadata-governance.yml** | issues / pull_request_target | Apply assignee and relationship metadata; inherit milestones only when explicitly linked | issue-pr-metadata.cjs |
| **validate-footers** | validation step | Enforce branded footers on changed Markdown and catch missing footer drift | `.github/scripts/validate-footers.js` |
| **planner.yml** | develop | Post merge-readiness checklists and exit criteria to PRs | planner.agent.js |
| **reviewer.yml** | develop | Automated PR review and quality feedback | reviewer.agent.js |
| **project-meta-sync.yml** | issues / pull_request | Sync project board fields from labels, title/body fallbacks, and kickoff metadata | derive-project-fields.cjs |
Expand Down Expand Up @@ -156,7 +157,8 @@ Issue types are defined once in `.github/issue-types.yml` and used by both:
### Metadata Governance

- Issues and PRs are assigned to the repository project automatically on create.
- New issues and PRs should receive an assignee, milestone, and relationship metadata where relevant.
- New issues and PRs should receive an assignee and relationship metadata where relevant.
- Milestones are only applied when explicitly inherited from linked work or already present; the automation no longer invents a milestone per issue or PR.
- `Start date` and `Target date` remain empty until the item is explicitly marked `status:ready` or `status:in-progress`.
- Template enforcement must flag incomplete issues, apply `status:needs-more-info`, and keep the item open.

Expand Down Expand Up @@ -264,3 +266,7 @@ All configuration files are validated:
- [Agent Specifications](../.github/agents/)

---

*Maintained by the 🤖 LightSpeedWP Automation Team*

[📋 AI Governance](https://github.com/lightspeedwp/.github/blob/develop/docs/AUTOMATION.md) · [🧠 Agents](https://github.com/lightspeedwp/.github/blob/develop/AGENTS.md) · [📞 Contact](https://lightspeedwp.agency/contact)
8 changes: 6 additions & 2 deletions docs/BRANCHING_STRATEGY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
file_type: documentation
title: Org-wide Git Branching Strategy
description: Canonical branch naming, protection, merge discipline, and automation rules for LightSpeedWP repositories.
last_updated: '2026-06-09'
last_updated: '2026-06-19'
owners:
- LightSpeed Team
version: v1.5
version: v1.5.1
status: active
stability: stable
domain: governance
Expand Down Expand Up @@ -389,3 +389,7 @@ reused so automation stays predictable.
- Add cheat sheets and workflow diagrams to internal wiki.

---

*Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit!*

[🔗 Website](https://lightspeedwp.agency) · [📧 Contact](https://lightspeedwp.agency/contact) · [👥 Contributors](https://github.com/lightspeedwp/.github/graphs/contributors)
20 changes: 15 additions & 5 deletions docs/BRANDING_AGENT_USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
title: "Unified Branding Agent — Usage Guide"
description: "Complete guide for using the unified branding agent to apply category-aware branding to documents"
file_type: "documentation"
version: "1.0.0"
version: "1.0.1"
created_date: "2026-05-29"
last_updated: "2026-06-03"
last_updated: "2026-06-19"
category: "docs"
owners: ["LightSpeedWP Automation Team"]
---

# Unified Branding Agent — Usage Guide

**Document Version**: 1.0.0
**Last Updated**: 2026-05-29
**Document Version**: 1.0.1
**Last Updated**: 2026-06-19
**Related Issues**: #555 (Wave 4E Implementation)

---
Expand All @@ -21,7 +21,7 @@ owners: ["LightSpeedWP Automation Team"]

The **Unified Branding Agent** automates the application of category-aware branding (headers, footers, and badges) to Markdown documents across the repository.

It reads from the Wave 4D configuration (`config/footers.config.yaml` and `.schemas/branding-schema.json`) and applies consistent branding rules based on:
It reads from the canonical branding configuration (`config/footers.config.yaml` and `.schemas/branding-schema.json`) with a legacy fallback for older automation paths, and applies consistent branding rules based on:

- **Document category** (explicitly in frontmatter or inferred from file path)
- **Predefined footer templates** per category
Expand Down Expand Up @@ -284,6 +284,16 @@ footers:
*Built by 🧱 LightSpeedWP*
```

### Validation

The repository validator now treats missing branded footers in changed Markdown as a failure and can backfill them from the category default via `npm run validate:footers -- --fix`.

Run the validator after bulk edits or agent changes to make sure changed docs are not left unbranded:

```bash
npm run validate:footers
```

### `.schemas/branding-schema.json`

Comprehensive JSON Schema for validation and IDE autocomplete.
Expand Down
14 changes: 8 additions & 6 deletions docs/BRANDING_CONFIG_SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
title: "Branding Configuration Specification"
description: "Complete specification for category-aware branding, frontmatter validation, and header/footer management"
file_type: "documentation"
version: "1.0.0"
version: "1.0.1"
created_date: "2026-05-29"
last_updated: "2026-06-03"
last_updated: "2026-06-19"
category: "governance"
owners: ["LightSpeedWP Automation Team"]
---

# Branding Configuration Specification

**Document Version**: 1.0.0
**Last Updated**: 2026-05-29
**Document Version**: 1.0.1
**Last Updated**: 2026-06-19
**Related Issues**: #33 (Parent Spec), #554 (Schema Implementation), #555 (Agent Implementation), #556 (Remediation)

---
Expand Down Expand Up @@ -413,6 +413,8 @@ The configuration is used in:
- CodeRabbit configuration
- Linting and validation scripts

Missing branded footers are now treated as a validation failure via `npm run validate:footers`, which can also backfill the category default when run with `--fix`.

### 9.3 For Documentation Generation

Category-aware tools use configuration to:
Expand Down Expand Up @@ -529,6 +531,6 @@ governance-footer:

---

*Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit!*
⚖️ *Governance policy maintained by LightSpeedWP*

[🔗 Website](https://lightspeedwp.agency) · [📧 Contact](https://lightspeedwp.agency/contact) · [👥 Contributors](https://github.com/lightspeedwp/.github/graphs/contributors)
[📋 Full Governance Docs](https://github.com/lightspeedwp/.github/blob/develop/AGENTS.md) · [🔒 Security](https://github.com/lightspeedwp/.github/blob/develop/SECURITY.md)
16 changes: 8 additions & 8 deletions docs/FOOTER_REMEDIATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Footer Remediation Guide"
description: "How to identify, fix, and prevent duplicate footers in Markdown files"
version: "v1.0.1"
version: "v1.0.2"
created_date: "2026-05-28"
type: "guide"
category: "governance"
Expand Down Expand Up @@ -54,13 +54,13 @@ Currently, footers are:

1. **`schema/footer-config.schema.json`** — JSON Schema defining valid footer structure
2. **`config/footers.config.yaml`** — Predefined footer library with 13 category-specific templates
3. **`.github/scripts/validate-footers.js`** — Validation script to detect and fix violations
3. **`.github/scripts/validate-footers.js`** — Validation script to detect, fix, and backfill violations

### Key Principles

✅ **One footer per document** — Validation enforces this
✅ **Predefined templates** — Choose from validated, category-specific footers
✅ **Schema validation** — Prevent duplicates and invalid footers
✅ **Schema validation** — Prevent duplicates, missing footers, and invalid footers
✅ **Automation-ready** — Footer insertion can be automated via agent

---
Expand Down Expand Up @@ -342,7 +342,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: node .github/scripts/validate-footers.js
- run: npm run validate:footers -- --changed-only
```

This ensures every PR is validated before merge.
Expand Down Expand Up @@ -453,10 +453,10 @@ Action: Replace and note in commit
4. ⬜ **Validate changes** — Confirm no violations remain
5. ⬜ **Commit & push** — Create PR with fixes
6. ⬜ **Set up CI validation** — Add footer-validation.yml workflow
7. ⬜ **Plan automation** — Implement branding meta agent (issue #33)
7. ⬜ **Plan automation** — Implement branding meta agent and footer validation hardening (issue #33)

---

**Created**: 2026-05-28
**Status**: Active guidance for footer remediation
**Related issues**: #33 (branding meta agent), #46 (templates), #49 (schema)
⚖️ *Governance policy maintained by LightSpeedWP*

[📋 Full Governance Docs](https://github.com/lightspeedwp/.github/blob/develop/AGENTS.md) · [🔒 Security](https://github.com/lightspeedwp/.github/blob/develop/SECURITY.md)
9 changes: 7 additions & 2 deletions docs/ISSUE_CREATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: GitHub Issue Creation Guide
description: How to create well-formed issues, select templates, and trigger automation
file_type: documentation
version: "1.0.6"
version: "1.0.7"
created_date: "2026-05-31"
last_updated: "2026-06-19"
author: Claude Code
Expand Down Expand Up @@ -128,7 +128,8 @@ Click **Submit new issue**. Your issue is now visible to the team and ready for

- Issue outcomes are still driven by the body content and canonical labels, so keep the template complete and specific.
- Incomplete templates are flagged and labelled for correction rather than closed.
- Metadata governance now handles the project item, assignee, milestone, and relationship metadata automatically when it can infer them safely.
- Metadata governance now handles the project item, assignee, and relationship metadata automatically when it can infer them safely.
- Milestones are no longer created per issue or PR by default; use a shared milestone deliberately when batching related work.

### AI / Automation Issue Creation

Expand Down Expand Up @@ -222,3 +223,7 @@ When creating an issue:
- [Issue Types](./ISSUE_TYPES.md)

---

*Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit!*

[🔗 Website](https://lightspeedwp.agency) · [📧 Contact](https://lightspeedwp.agency/contact) · [👥 Contributors](https://github.com/lightspeedwp/.github/graphs/contributors)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"validate:frontmatter:changed": "node scripts/validation/validate-frontmatter-freshness.js",
"validate:branch-name": "node scripts/validation/validate-branch-name.js",
"validate:workflows": "node scripts/validation/validate-workflows.js",
"validate:footers": "node .github/scripts/validate-footers.js",
"validate:labeling-configs": "node scripts/validation/validate-labeling-configs.cjs",
"validate:retired-doc-links": "node scripts/validation/validate-retired-doc-links.cjs",
"validate:issue-fields": "node scripts/validation/validate-issue-fields.cjs",
Expand All @@ -110,7 +111,7 @@
"validate:readme-links": "node scripts/validation/validate-readme-links.js",
"validate:wceu:phase1": "node scripts/verify-wceu-readiness.js",
"validate:wceu:phase2": "node scripts/validate-phase2-completion.js",
"validate:all": "npm run validate:branch-name && npm run validate:structure && npm run validate:skill-manifests && npm run validate:plugins && npm run validate:links && npm run validate:frontmatter && npm run validate:agents && npm run validate:issue-fields && npm run validate:workflows && npm run validate:memory && npm run validate:mermaid && npm run validate:json:all",
"validate:all": "npm run validate:branch-name && npm run validate:structure && npm run validate:skill-manifests && npm run validate:plugins && npm run validate:links && npm run validate:frontmatter && npm run validate:agents && npm run validate:issue-fields && npm run validate:workflows && npm run validate:footers && npm run validate:memory && npm run validate:mermaid && npm run validate:json:all",
"eslint:delta:wave-1": "node scripts/compute-eslint-delta-wave-1.js",
"sync-version": "node scripts/sync-version.js",
"metrics:run": "node metrics/frontmatter-metrics.js",
Expand Down
59 changes: 59 additions & 0 deletions scripts/agents/includes/__tests__/header-footer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
const fs = require("fs");
const os = require("os");
const path = require("path");

describe("header-footer", () => {
test("ensureFooter appends the canonical docs footer", async () => {
const { ensureFooter } = await import("../header-footer.js");
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "branding-footer-"));
const filePath = path.join(tmpDir, "branching-strategy.md");

fs.writeFileSync(
filePath,
[
"---",
"title: Org-wide Git Branching Strategy",
"description: Canonical branch naming and merge discipline.",
"file_type: documentation",
"---",
"",
"# Org-wide Git Branching Strategy",
"",
"Primary operations reference.",
"",
].join("\n"),
);

expect(ensureFooter(filePath, { category: "docs" })).toBe(true);

const output = fs.readFileSync(filePath, "utf8");
expect(output).toContain("Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit!");
expect(output).toContain("https://lightspeedwp.agency/contact");
});

test("ensureFooter ignores footer text mentioned in the body", async () => {
const { ensureFooter } = await import("../header-footer.js");
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "branding-footer-body-"));
const filePath = path.join(tmpDir, "branding-note.md");

fs.writeFileSync(
filePath,
[
"---",
"title: Branding note",
"description: Body text mentions the footer phrase.",
"file_type: documentation",
"---",
"",
"This note mentions Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit! in the body.",
"",
].join("\n"),
);

expect(ensureFooter(filePath, { category: "docs" })).toBe(true);

const output = fs.readFileSync(filePath, "utf8");
const footerMatches = output.match(/Built by 🧱 LightSpeedWP with ☕, 🚀, and open-source spirit!/g) || [];
expect(footerMatches).toHaveLength(2);
});
});
Loading
Loading