Skip to content
Merged
33 changes: 33 additions & 0 deletions .github/automation/badges.schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Canonical badge definitions and mapping rules
version: 1
badges:
workflow:
front-matter-schema:
label: "Front-Matter"
icon: "🧩"
source: "github-actions"
job: "front-matter-validate"
success_text: "Schema OK"
failure_text: "Schema Fail"
meta:
license:
label: "License"
icon: "📄"
values:
mit: "MIT"
gpl-2.0: "GPL-2.0"
mapping:
# Deterministic mapping from front matter and repo state to badges
- when:
has_front_matter: true
add:
- workflow.front-matter-schema
- when:
front_matter.license: ["mit","gpl-2.0"]
add:
- meta.license
render:
order:
- title
- badges
- description
15 changes: 15 additions & 0 deletions .github/automation/emoji.schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 1
apply_to: ["h1","h2"]
skip:
# formal docs where emojis are not used
- "CHANGELOG.md"
- "CODE_OF_CONDUCT.md"
map:
# keyword -> emoji (first match wins)
design: "🎨"
workflow: "🛠"
release: "🚀"
governance: "🏛"
fallbacks:
generic: "✨" # used only if no keyword matched and page not in skip
notes: "Conservative: 0–1 emoji per heading; never on h3+."
31 changes: 31 additions & 0 deletions .github/automation/footers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 1
categories:
docs:
phrases:
- "Made with ❤️ by the LightSpeed team."
- "Questions? Open an issue; we're listening."
- "Prefer a guided setup? Book a consult."
- "Clarity first, then code. Thanks for reading."
- "Improvements welcome—PRs encouraged."
prompts:
phrases:
- "Copy, adapt, and keep shipping."
- "Tweak the variables, get results fast."
- "Your feedback shapes the next iteration."
- "Reuse beats rework. Share improvements."
- "Keep prompts versioned for sanity."
saved-replies:
phrases:
- "Use responsibly; tailor to the thread."
- "Keep tone human, clear, and kind."
- "Update when guidance changes."
- "Link policies; avoid assumptions."
- "Thanks for helping contributors."
default:
phrases:
- "Made with ❤️ by the LightSpeed team."
- "Need help? Say hi—work with us."
selection:
strategy: "seeded"
seed: "file.path_slug" # stable per file
# Deterministic selection algorithm not yet implemented. This section is non-functional.
14 changes: 14 additions & 0 deletions .github/automation/front-matter.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Front Matter",
"type": "object",
"additionalProperties": true,
"properties": {
"title": { "type": "string" },
"slug": { "type": "string" },
"series": { "type": ["object","string"] },
"tags": { "type": "array", "items": { "type": "string" } },
"no_branding": { "type": "boolean" },
"category": { "type": "string" }
}
}
9 changes: 9 additions & 0 deletions .github/metrics/branding-log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: 'Branding Metrics Log'
description: 'Historical log of branding automation metrics'
---
Comment on lines +1 to +4
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Add required frontmatter fields to pass validation.

The file is missing critical frontmatter fields required by the coding guidelines. The pipeline failure confirms this: file_type must be a string. Per guidelines, all Markdown files require: version, last_updated, owners, file_type, and category.

Apply this diff to add the missing frontmatter fields:

 ---
 title: 'Branding Metrics Log'
 description: 'Historical log of branding automation metrics'
+version: 'v1.0'
+last_updated: '2025-11-13'
+owners: ['ashleyshaw']
+file_type: 'metrics-log'
+category: 'metrics'
 ---

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 GitHub Actions: Frontmatter Validation

[error] 1-1: Frontmatter validation failed: tag 'file_type' must be a string in .github/metrics/branding-log.md.

🤖 Prompt for AI Agents
In .github/metrics/branding-log.md lines 1-4 the YAML frontmatter is missing
required fields which causes validation to fail; add the following frontmatter
keys with appropriate values and types: version (string, e.g. "1.0"),
last_updated (ISO date string, e.g. "2025-11-13"), owners (array of strings or
single string), file_type (string, e.g. "metrics"), and category (string, e.g.
"branding"); ensure the frontmatter is valid YAML at the top of the file
(between --- markers) and that file_type is explicitly a string.


# Branding Metrics Log

| timestamp | coverage | changes | errors | optouts |
|---|---:|---:|---:|---:|
7 changes: 7 additions & 0 deletions .github/metrics/branding.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ts": null,
"coverage": 0,
"changes": 0,
"errors": 0,
"optouts": 0
}
142 changes: 142 additions & 0 deletions .github/workflows/branding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
name: Branding Agent

on:
workflow_dispatch:
pull_request:
branches: [develop]
paths:
- "**/*.md"
- ".github/automation/**"
- ".github/agents/**"
push:
branches: [develop]
paths:
- "**/*.md"
- ".github/automation/**"
- ".github/agents/**"
schedule:
- cron: "0 3 * * 1" # weekly metrics roll-up (Mon 03:00 UTC)

concurrency:
group: "branding-${{ github.ref }}"
cancel-in-progress: true

permissions:
contents: write
pull-requests: write

jobs:
front-matter-validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Validate Front Matter
run: |
npm i -g ajv-cli
if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then
BASE_REF="${{ github.base_ref }}"
HEAD_REF="${{ github.sha }}"
elif [ "${GITHUB_EVENT_NAME}" = "push" ]; then
BASE_REF="${{ github.event.before }}"
HEAD_REF="${{ github.sha }}"
else
BASE_REF="HEAD~1"
HEAD_REF="${{ github.sha }}"
npm install --prefix .github/scripts js-yaml ajv
FILES=$(git diff --name-only ${{ github.sha }} ${{ github.base_ref || 'HEAD~1' }} | grep -E '\.md$' || true)
for f in $FILES; do
node .github/scripts/validate-frontmatter.js "$f"
done

lint-and-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: avto-dev/markdown-lint@v1
with:
config: 'markdownlint.config.js'
args: '**/*.md'

- name: Check Links
uses: lycheeverse/lychee-action@v2
with:
args: --no-progress --verbose './**/*.md' --exclude-mail

apply-branding:
if: ${{ github.event_name != 'pull_request' }}
needs: [front-matter-validate, lint-and-links]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Run Branding Agent
run: |
node .github/agents/branding.agent.js
Comment on lines +85 to +87
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

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

The branding.agent.js file referenced in line 77 and in the documentation does not exist in this PR. The workflow will fail when it attempts to execute this missing file. Either include the agent implementation in this PR or update the workflow to use a placeholder/stub until the agent is implemented.

Copilot uses AI. Check for mistakes.

- name: Commit changes (content-only)
run: |
git config user.name "lightspeed-bot"
git config user.email "[email protected]"
git add -A
if ! git diff --cached --quiet; then
git commit -m "chore(branding): apply header/badges/refs/banner/footer [skip ci]"
git push
fi

metrics-update:
needs: [apply-branding]
if: ${{ success() || failure() }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Update Metrics Snapshot
run: |
mkdir -p .github/metrics
# Read metrics from branding agent output (branding-metrics.json)
if [ -f .github/metrics/branding-metrics.json ]; then
node -e "
const fs = require('fs');
const m = JSON.parse(fs.readFileSync('.github/metrics/branding-metrics.json', 'utf8'));
m.ts = new Date().toISOString();
fs.writeFileSync('.github/metrics/branding.json', JSON.stringify(m, null, 2));
const logLine = \`| \${m.ts} | coverage:\${m.coverage} | changes:\${m.changes} | errors:\${m.errors} | optouts:\${m.optouts} |\n\`;
fs.appendFileSync('.github/metrics/branding-log.md', logLine);
"
else
echo "Warning: .github/metrics/branding-metrics.json not found. Writing zeroed metrics."
node -e "
const fs = require('fs');
let m = { ts: new Date().toISOString(), coverage: 0, changes: 0, errors: 0, optouts: 0 };
fs.writeFileSync('.github/metrics/branding.json', JSON.stringify(m, null, 2));
const logLine = \`| \${m.ts} | coverage:0 | changes:0 | errors:0 | optouts:0 |\n\`;
fs.appendFileSync('.github/metrics/branding-log.md', logLine);
"
fi
- name: Commit metrics
run: |
git config user.name "lightspeed-bot"
git config user.email "[email protected]"
git add .github/metrics/branding.json .github/metrics/branding-log.md
if ! git diff --cached --quiet; then
git commit -m "chore(branding): update metrics snapshot [skip ci]"
git push
fi
Loading
Loading