Skip to content

Commit a39bb7a

Browse files
committed
chore(automation/agents,lint): reorganize automation docs/config into .github/automation; add branding agent; tighten package-json linting
- Move and expand automation, branching, labels, issue-types, PR labeling and discussion docs/config into .github/automation/ - Remove legacy root-level labeler/labels/issue-types/project-pr-labeler files (now consolidated under .github/automation/) - Add branding agent: .github/agents/branding.agent.js and spec .github/agents/branding.agent.md; register in agents index - Update .github/workflows/lint.yml to run npm-package-json-lint step with granular env toggles; add NPMPKGJSONLINT_REQUIRE_FIELDS env - Update docs and npmpackagejsonlint.config.cjs to reflect granular NPMPKGJSONLINT flags and remove template-scaffold ignores - Minor tweaks to LINTING.md (timestamps, guidance) and agent index formatting
1 parent 053bcc9 commit a39bb7a

16 files changed

+118
-15
lines changed

.github/agents/agent.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This document serves as the master index for all agent specifications, templates
1515

1616
> **Label Reference:**
1717
> Agents, agent specs, and agent-related issues should use or reference the label:
18+
>
1819
> - `ai-ops:agents` (for agent definitions and specs)
1920
> - `ai-ops:chat-modes` (for chatmode-related agents)
2021
> - `ai-ops:prompts` (for prompt agents or reusable prompt logic)
@@ -40,9 +41,11 @@ All agent specs, templates, and stubs should be placed in the `.github/agents/`
4041
| [template.agent.js](./template.agent.js) | JS template for new agent implementations |
4142
| [template.agent.py](./template.agent.py) | Python template for new agent implementations|
4243
| [template.agent.sh](./template.agent.sh) | Shell script template for agent integrations |
44+
| [branding.agent.js](./branding.agent.js) | Unified branding agent: header, footer, badges|
45+
| [branding.agent.md](./branding.agent.md) | Spec for unified branding agent |
4346
| *(Add additional agent files below as needed)* | |
4447

45-
> _To add new agents, create a file in `.github/agents/` and update this table. Use descriptive filenames and provide a brief purpose/notes column for each._
48+
> *To add new agents, create a file in `.github/agents/` and update this table. Use descriptive filenames and provide a brief purpose/notes column for each._
4649
4750
---
4851

.github/agents/branding.agent.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// branding.agent.js - Unified agent for automating header, footer, and badge insertion in Markdown files.
2+
// See .github/agents/branding.agent.md for spec.
3+
4+
const { insertHeaderFooter } = require('../../scripts/includes/header-footer');
5+
const { updateBadgesInReadme } = require('../../scripts/includes/badges');
6+
const path = require('path');
7+
const Ajv = require('ajv');
8+
9+
// Unified config and schema
10+
const brandingConfig = require('../../schemas/header-footer-agent/agent-config.schema.json');
11+
12+
function validateConfig(config, schema) {
13+
const ajv = new Ajv();
14+
const validate = ajv.compile(schema);
15+
if (!validate(config)) {
16+
throw new Error(
17+
`Branding config validation failed: ${JSON.stringify(validate.errors, null, 2)}`
18+
);
19+
}
20+
}
21+
22+
async function main() {
23+
// Validate branding config
24+
validateConfig(brandingConfig, brandingConfig, 'Branding');
25+
26+
// Example usage: update all README.md files
27+
await insertHeaderFooter(
28+
'README.md',
29+
{ headers: brandingConfig.headers, footers: brandingConfig.footers },
30+
{ backup: true }
31+
);
32+
await updateBadgesInReadme(
33+
path.join(process.cwd(), 'README.md'),
34+
'.github/workflows',
35+
{ backup: true }
36+
);
37+
console.log('Headers, footers, and badges updated.');
38+
}
39+
40+
if (require.main === module)
41+
main().catch((err) => (console.error(err), process.exit(1)));

.github/agents/branding.agent.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
file_type: "agent"
3+
title: "Branding Agent"
4+
description: "Unified agent for automating insertion and management of headers, footers, and badges in Markdown documentation files."
5+
version: "v1.0"
6+
last_updated: "2025-10-26"
7+
owners: ["LightSpeedWP Engineering"]
8+
tags: ["branding", "header", "footer", "badges", "automation", "documentation"]
9+
category: "automation"
10+
status: "active"
11+
references:
12+
- "../../schemas/header-footer-agent/agent-config.schema.json"
13+
- "../../scripts/includes/header-footer.js"
14+
- "../../scripts/includes/badges.js"
15+
- "./branding.agent.js"
16+
- "./branding.instructions.md"
17+
- "./branding.prompt.md"
18+
- "../../README.md"
19+
- "../../BADGES.md"
20+
---
21+
22+
## Branding Agent Specification
23+
24+
## Purpose
25+
26+
Automate the insertion, update, and management of headers, footers, and badges in Markdown documentation files, using a unified schema-driven config.
27+
28+
## Triggers
29+
30+
- On README or doc update
31+
- On CI or workflow_dispatch
32+
- On branding config change
33+
34+
## Inputs/Outputs
35+
36+
- **Input:** File path, branding config, schema
37+
- **Output:** Updated doc with selected/random header, footer, and badges
38+
39+
## Actions
40+
41+
- Read unified branding config (headers, footers, badges) in JSON/YAML
42+
- Validate config against [agent-config.schema.json](../../schemas/header-footer-agent/agent-config.schema.json)
43+
- Select appropriate category/variant (random or by file type/tag)
44+
- Insert/update header, footer, and badge blocks in the doc
45+
46+
## Guardrails
47+
48+
- Never overwrite main content
49+
- Validate config before applying
50+
- Always backup before changes
51+
- Only update designated blocks (header, footer, badges)
52+
53+
## References
54+
55+
- [agent-config.schema.json](../../schemas/header-footer-agent/agent-config.schema.json)
56+
- [header-footer.js](../../scripts/includes/header-footer.js)
57+
- [badges.js](../../scripts/includes/badges.js)
58+
- [README.md](../../README.md)
59+
- [BADGES.md](../../BADGES.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)