Skip to content

Commit b310ace

Browse files
committed
Agent, docs and instructions file clean up
1 parent d724d78 commit b310ace

37 files changed

+1325
-1345
lines changed

.github/agents/labeling.agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,4 @@ Maps issue template types to labels:
205205
- [labeling.agent.js](../../scripts/agents/labeling.agent.js) - Main implementation
206206
- [Labeling Documentation](../../docs/LABELING.md) - Complete labeling system docs
207207
- [Label Strategy](../../docs/LABEL_STRATEGY.md) - Label philosophy and best practices
208-
- [Coding Standards](../.github/instructions/coding-standards.instructions.md) - Development guidelines
208+
- [Coding Standards](../instructions/coding-standards.instructions.md) - Development guidelines

.github/agents/planner.agent.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ Comprehensive planning agent supporting three complementary modes:
315315

316316
## Reference Documentation
317317

318-
- [Spec-Driven Workflow](.github/instructions/spec-driven-workflow.instructions.md)
319-
- [Architecture Guide](docs/ARCHITECTURE.md)
320-
- [Contributing Guidelines](CONTRIBUTING.md)
321-
- [Coding Standards](.github/instructions/coding-standards.instructions.md)
318+
- [Spec-Driven Workflow](../instructions/spec-driven-workflow.instructions.md)
319+
- [Architecture Guide](../../docs/ARCHITECTURE.md)
320+
- [Contributing Guidelines](../../CONTRIBUTING.md)
321+
- [Coding Standards](../instructions/coding-standards.instructions.md)

.github/agents/reporting.agent.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ First, what category does this report belong to?
123123
- issue-metrics (GitHub issue analytics, trends)
124124
- labeling (label automation, sync logs)
125125
- linting (ESLint, code quality reports)
126+
- mermaid (diagram coverage, accessibility checks, rendering/contrast audits)
126127
- meta (documentation metadata: badges, references, footers)
127128
- metrics (general metrics, weekly summaries)
128129
- optimisation (performance optimisation, token reduction)

.github/agents/reviewer.agent.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
name: "Reviewer"
3+
description: "Automated PR review agent that posts review summaries, CI status checks, and actionable recommendations for pull requests."
4+
file_type: "agent"
5+
version: "v1.0"
6+
created_date: "2025-12-10"
7+
last_updated: "2025-12-10"
8+
author: "LightSpeed Team"
9+
maintainer: "Ash Shaw"
10+
category: "automation"
11+
status: "active"
12+
visibility: "public"
13+
tags: ["pr-review", "automation", "ci", "quality-gate", "pull-requests"]
14+
language: "en"
15+
references:
16+
- path: "../../scripts/agents/reviewer.agent.js"
17+
description: "Main implementation script"
18+
- path: "../workflows/reviewer.yml"
19+
description: "GitHub Actions workflow"
20+
- path: "../instructions/pull-requests.instructions.md"
21+
description: "PR standards and guidelines"
22+
- path: "../instructions/coding-standards.instructions.md"
23+
description: "Coding standards reference"
24+
owners: ["lightspeedwp/maintainers"]
25+
---
26+
27+
# Reviewer Agent
28+
29+
## Purpose
30+
31+
Automatically review pull requests and post comprehensive summaries including CI status, file analysis, changelog presence, and actionable recommendations to help maintainers make informed merge decisions.
32+
33+
## Responsibilities
34+
35+
- **CI Status Monitoring**: Check and report combined CI/CD pipeline status
36+
- **File Analysis**: Review changed files and identify potential issues
37+
- **Changelog Validation**: Verify changelog entries are present when required
38+
- **Review Summary**: Post structured comment with all findings
39+
- **Quality Gates**: Flag PRs that don't meet quality standards
40+
41+
## Workflow Integration
42+
43+
Triggered by the `.github/workflows/reviewer.yml` workflow on:
44+
45+
- Pull request opened
46+
- Pull request synchronized (new commits pushed)
47+
- Pull request ready for review
48+
49+
## Implementation
50+
51+
**Script**: `scripts/agents/reviewer.agent.js`
52+
53+
### Key Functions
54+
55+
1. **run()** - Main orchestrator
56+
- Fetches PR context
57+
- Checks CI/CD status
58+
- Analyses changed files
59+
- Posts review summary comment
60+
61+
2. **CI Status Check**
62+
- Queries GitHub combined status API
63+
- Reports: success, pending, failure, error, or unknown
64+
65+
3. **File Analysis**
66+
- Lists changed files
67+
- Identifies file types
68+
- Flags high-risk changes
69+
70+
4. **Changelog Validation**
71+
- Checks for CHANGELOG.md updates
72+
- Can be required or optional (configurable)
73+
74+
### Review Summary Format
75+
76+
```markdown
77+
## 🤖 Automated Review Summary
78+
79+
### CI/CD Status
80+
✅ All checks passing
81+
⏳ Checks pending
82+
❌ Some checks failed
83+
84+
### Changed Files
85+
- `file1.js` - Modified
86+
- `file2.md` - Added
87+
- `file3.test.js` - Modified
88+
89+
### Changelog
90+
✅ Changelog updated
91+
⚠️ No changelog entry found
92+
93+
### Recommendations
94+
- Review test coverage
95+
- Update documentation
96+
- Consider adding migration notes
97+
```
98+
99+
## Configuration
100+
101+
The workflow accepts these inputs:
102+
103+
- `github-token`: GitHub token for API access (required)
104+
- `require-changelog`: Whether to enforce changelog entries (default: `false`)
105+
106+
## Best Practices
107+
108+
1. **Review Automation**: This agent assists reviewers but doesn't replace human code review
109+
2. **CI Integration**: Always wait for CI to complete before merging
110+
3. **Changelog**: Update CHANGELOG.md for user-facing changes
111+
4. **Quick Feedback**: Agent provides instant feedback to PR authors
112+
113+
## Error Handling
114+
115+
- Gracefully handles missing PR context
116+
- Reports API errors without failing the workflow
117+
- Provides dry-run mode for testing
118+
119+
## Related Agents
120+
121+
- [Testing Agent](./testing.agent.md) - Runs test suites
122+
- [Linting Agent](./linting.agent.md) - Code quality checks
123+
- [Labeling Agent](./labeling.agent.md) - PR label automation
124+
- [Release Agent](./release.agent.md) - Release preparation
125+
126+
## Reference Documentation
127+
128+
- [Pull Request Process](../instructions/pull-requests.instructions.md)
129+
- [Coding Standards](../instructions/coding-standards.instructions.md)
130+
- [GitHub Actions Workflows](../../docs/WORKFLOWS.md)
131+
132+
---
133+
134+
*Reviewer Agent - Automated PR quality gates and review assistance*

.github/agents/testing.agent.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,10 @@ tags:
2929
]
3030
language: "en"
3131
references:
32-
- path: ".github/agents/testing.agent.js"
33-
description: "Implementation script"
3432
- path: ".github/workflows/testing.yml"
35-
description: "GitHub Actions testing workflow"
36-
- path: ".github/instructions/testing.instructions.md"
37-
description: "Master testing standards index"
38-
- path: ".github/instructions/tests.instructions.md"
39-
description: "Test framework standards"
33+
description: "GitHub Actions testing workflow (uses npm scripts)"
34+
- path: "package.json"
35+
description: "Test scripts configuration (npm run check, npm run test, npm run lint:all)"
4036
- path: ".github/instructions/coding-standards.instructions.md"
4137
description: "Unified coding standards"
4238
owners: ["lightspeedwp/maintainers"]
@@ -50,6 +46,8 @@ metadata:
5046

5147
Automate test execution, coverage reporting, and quality validation across all testing frameworks used in LightSpeed projects.
5248

49+
**Implementation Note:** This agent uses npm scripts defined in `package.json` rather than a dedicated `.agent.js` script file. The workflow executes `npm run check` which orchestrates linting and testing via package.json scripts.
50+
5351
## Responsibilities
5452

5553
- Execute unit tests using Jest for JavaScript/TypeScript

.github/custom-instructions.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The files are organised under the `.github/` directory:
1616
- [`AGENTS.md`](../AGENTS.md): Global AI rules applicable to all projects. Defines language, security, accessibility, modularity, and review requirements. Reference this file for central guidance on frontmatter schemas ([schemas/frontmatter.schema.json](../schemas/frontmatter.schema.json))
1717
- [`agents/agent.md`](./agents/agent.md): Main agent index. Links all agent specs, stubs, and explains local/dry-run usage. Reference this for agent implementation and testing.
1818
- [`instructions/`](./instructions/): Modular `.instructions.md` files scoped by language, file type, or topic. Each file includes YAML frontmatter describing its scope, mission, guidelines, checklists, and references. See below for a full index.
19-
- **[file-output-organization.instructions.md](./instructions/file-output-organization.instructions.md)**: **CRITICAL** - Defines where Copilot/agents should create reports, task files, and project artifacts. Always follow these rules to prevent file organization drift.
19+
- **[file-organisation.instructions.md](./instructions/file-organisation.instructions.md)**: **CRITICAL** - Defines where Copilot/agents should create reports, task files, and project artefacts. Always follow these rules to prevent file organisation drift.
2020
- [`prompts/prompts.md`](./prompts/prompts.md): Master prompt index and guidance. Reference this for prompt authoring conventions and to locate all available prompts.
2121
- [`prompts/`](./prompts/): Reusable `.prompt.md` files for Copilot Chat and GitHub Actions. Each prompt describes a specific task (e.g. audit docs, fix lint, author JSON schema, generate workflow, increase test coverage). See below for a full index.
2222
- [`reports/`](./reports/): Generated reports, analysis outputs, and audit files. All Copilot/agent reports must be created here, not in docs/ or repository root.
@@ -119,4 +119,9 @@ Use comprehensive inline documentation following WordPress standards (see [codin
119119
- Update as standards evolve or new best practices emerge
120120
- Document significant changes in commit messages
121121

122+
## Community Health Assets (Shared vs Repository-Scoped)
123+
124+
- **Shared across the organisation:** discussion templates (`.github/DISCUSSION_TEMPLATE/`), saved replies (`.github/SAVED_REPLIES/`), issue templates (`.github/ISSUE_TEMPLATE/`), pull request templates (branch-specific) (`.github/PULL_REQUEST_TEMPLATE/`), default PR template (`.github/PULL_REQUEST_TEMPLATE.md`).
125+
- **Repository-scoped only:** issue types (`.github/issue-types.yml`) and labels (`.github/labels.yml`) are defined per repository and are **not** shared organisation-wide.
126+
122127
For more details, see the README files in the `instructions` and `prompts` folders.

0 commit comments

Comments
 (0)