Skip to content

Commit 5e25f05

Browse files
committed
fix(agents): Break 10 circular reference chains in agent files
- Remove bidirectional refs between custom-instructions.md and agent files - Establish unidirectional hierarchy: AGENTS.md → agent.md → specs → prompts - custom-instructions.md now references only agent.md (not specific agents) - agent.md references only AGENTS.md as parent (not custom-instructions or prompts) - Agent specs reference only their prompt templates (downward) - Prompts no longer reference agents or custom-instructions (bottom of hierarchy) - Removes cross-references between development-assistant, scaffold-generator, reporting agents
1 parent 0621086 commit 5e25f05

File tree

174 files changed

+45060
-6270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+45060
-6270
lines changed

.distignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ Desktop.ini
9292
npm-debug.log*
9393
yarn-debug.log*
9494
yarn-error.log*
95-
96-
# Lock files
97-
*.lock
95+
logs/
9896

9997
# Backup/temp files
10098
*.bak
@@ -106,6 +104,7 @@ yarn-error.log*
106104
*.pid
107105
*.seed
108106
*.pid.lock
107+
tmp/
109108

110109
# Build scripts
111110
bin/

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ vendor
1616
coverage
1717
playwright-report
1818
test-results
19+
20+
# Bin scripts (use different linting rules)
21+
bin/

.github.backup/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: GitHub Configuration
3+
description: GitHub-specific configuration files
4+
category: Project
5+
type: Index
6+
audience: Developers
7+
date: 2025-12-01
8+
---
9+
10+
# GitHub Configuration
11+
12+
This directory contains GitHub-specific configuration files for the {{name}} multi-block plugin.
13+
14+
## Contents
15+
16+
- **agents/** - AI agent configurations for automated development tasks
17+
- **chatmodes/** - Custom chat mode configurations for AI assistants
18+
- **instructions/** - Development instructions and guidelines for AI tools
19+
- **prompts/** - Reusable prompt templates for AI-assisted development
20+
- **workflows/** - GitHub Actions CI/CD workflow definitions
21+
22+
## Workflows
23+
24+
| Workflow | Description |
25+
|----------|-------------|
26+
| `ci-cd.yml` | Main CI/CD pipeline (lint, test, security audit, E2E) |
27+
| `code-quality.yml` | Code coverage, quality gates, bundle analysis |
28+
| `deploy-wporg.yml` | Automated WordPress.org SVN deployment |
29+
| `release.yml` | Version bumping, changelog generation, releases |
30+
| `performance.yml` | Lighthouse CI and bundle size monitoring |
31+
32+
## Purpose
33+
34+
These files enable:
35+
36+
- Automated build and test workflows
37+
- Code coverage tracking with Codecov
38+
- Quality gates for PRs
39+
- AI-assisted multi-block development with context-specific instructions
40+
- Consistent code review and quality checks
41+
- Automated release and deployment processes
42+
- WordPress.org plugin directory deployment
43+
44+
## Usage
45+
46+
These files are automatically used by GitHub Actions and compatible AI development tools. They are excluded from plugin distribution packages.

.github.backup/agents/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Agents Directory
3+
description: Automation agents and specifications
4+
category: Project
5+
type: Index
6+
audience: Developers
7+
date: 2025-12-01
8+
---
9+
10+
# AI Agents
11+
12+
This directory contains AI agent configurations for automated multi-block plugin development tasks.
13+
14+
## Files
15+
16+
- **agent.md** - General agent configuration and guidelines
17+
- **agent-script.js** - Agent automation scripts
18+
19+
## Purpose
20+
21+
These agents help automate:
22+
23+
- Multi-block build process optimisation
24+
- Code quality checks for blocks
25+
- Block documentation generation
26+
- Block test automation
27+
- Post type and taxonomy validation
28+
29+
## Usage
30+
31+
Agents are invoked automatically by compatible AI development tools and GitHub Actions workflows for block-specific tasks.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env node
2+
// agent-script.js
3+
// Functional agent script: lists files in the current directory and writes output to a file.
4+
5+
const fs = require('fs');
6+
const path = require('path');
7+
8+
const args = process.argv.slice(2);
9+
const env = {
10+
DRY_RUN: process.env.DRY_RUN,
11+
VERBOSE: process.env.VERBOSE,
12+
GITHUB_TOKEN: process.env.GITHUB_TOKEN ? '***' : undefined
13+
};
14+
15+
console.log('Agent Script Running');
16+
console.log('Arguments:', args);
17+
console.log('Environment:', env);
18+
19+
// List files in the current directory
20+
const files = fs.readdirSync(process.cwd());
21+
console.log('Files in current directory:', files);
22+
23+
// Write output to a file for workflow artifact
24+
const output = {
25+
args,
26+
env,
27+
files
28+
};
29+
const outputPath = path.join(process.cwd(), 'agent-output.json');
30+
fs.writeFileSync(outputPath, JSON.stringify(output, null, 2));
31+
console.log('Output written to', outputPath);
32+
33+
process.exit(0);

.github.backup/agents/agent.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Multi-Block Plugin Agents Index
3+
description: Main index of automation agents for multi-block plugin scaffold
4+
category: Agent
5+
type: Agent Index
6+
audience: Developers, AI Agents
7+
date: 2025-12-01
8+
---
9+
10+
# Multi-Block Plugin Scaffold: Main Agent Index
11+
12+
## Overview & Related Files
13+
14+
This file documents the primary automation agent(s) for this repository, their purpose, usage, and integration with workflows. Reference this file for agent specs, triggers, and environment variables.
15+
16+
**Related Files:**
17+
18+
- [Custom Instructions](../custom-instructions.md) — main AI/Copilot and plugin instructions
19+
- [Prompts](../prompts/prompts.md) — prompt templates for consistent output
20+
- [Global AI Rules (AGENTS.md)](../../AGENTS.md) — org-wide agent rules, coding standards, and cross-references
21+
22+
**Dynamic References:**
23+
24+
- All instruction files: [`*.instructions.md`](../instructions/)
25+
- All agent files: [`*.agent.md`](../agents/) and [`*.agent.js`](../agents/) (current directory)
26+
- All prompt files: [`*.prompt.md`](../prompts/)
27+
28+
---
29+
30+
## Available Agents
31+
32+
### Scaffold Generator Agent
33+
34+
- **Agent Spec:** `.github/agents/scaffold-generator.agent.md`
35+
- **Purpose:** Comprehensive interactive agent that guides you through creating a new multi-block WordPress plugin from this scaffold. Collects detailed requirements for custom post types, taxonomies, SCF fields, blocks, and templates through a multi-stage conversation.
36+
- **Usage:** Say "Generate a new multi-block plugin" or "Create CPT plugin from scaffold"
37+
- **Related Prompt:** [generate-plugin.prompt.md](../prompts/generate-plugin.prompt.md)
38+
39+
### General Automation Agent
40+
41+
- **Agent Script:** `.github/agents/agent-script.js`
42+
- **Workflow:** `.github/workflows/agent-workflow.yml`
43+
- **Purpose:** Demonstrates a functional Node.js agent and workflow for file listing, environment echo, and artifact upload. Use as a template for new automation agents.
44+
45+
### Usage
46+
47+
- **GitHub Actions:** See `.github/workflows/agent-workflow.yml` for triggers and environment variables
48+
- **Local:** `node .github/agents/agent-script.js --example`
49+
50+
### Environment Variables
51+
52+
- `DRY_RUN` (default: `false`)
53+
- `VERBOSE` (default: `false`)
54+
- Additional secrets per workflow (e.g., `GITHUB_TOKEN` for label operations)
55+
56+
### Maintenance
57+
58+
- Keep all agents aligned with repo tooling (linters, build, tests)
59+
- Update documentation and scripts as workflows evolve
60+
- Use `.github/agents/agent-script.js` and `.github/workflows/agent-workflow.yml` as a starting point for new automation agents
61+
- Update references in this file and in all AI ops/instruction files as new agents are added
62+
63+
---
64+
65+
> **Note:** The files `.github/agents/agent-script.js` and `.github/workflows/agent-workflow.yml` are functional examples. Use them as templates for new agents. All AI ops and instruction files (see Related Files above) should reference these agents and workflows as appropriate for discoverability and onboarding.
66+
67+
For more information on agent usage, see [Custom Instructions](../custom-instructions.md), [Workflows](../workflows/), and [Global AI Rules (AGENTS.md)](../../AGENTS.md).
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
---
2+
name: Multi-Block Plugin Development Assistant
3+
description: AI development assistant for WordPress multi-block plugin development with CPT and SCF
4+
tools:
5+
- semantic_search
6+
- read_file
7+
- grep_search
8+
- file_search
9+
- run_in_terminal
10+
---
11+
12+
# Multi-Block Plugin Development Assistant
13+
14+
I'm your WordPress multi-block plugin development assistant for **{{name}}**. I provide guidance, code generation, and best practices for complex block plugin development with custom post types and Secure Custom Fields.
15+
16+
## Capabilities
17+
18+
### 🎨 Block Development
19+
- Block creation and customisation
20+
- Style variations and block.json configuration
21+
- Custom block styles and variations
22+
- Shared component development
23+
24+
### 🔧 Technical Support
25+
- WordPress Block Editor (Gutenberg) integration
26+
- Build process and asset compilation
27+
- Testing and debugging
28+
- Custom post type configuration
29+
- SCF field setup
30+
31+
### 📝 Code Generation
32+
- PHP functions following WordPress standards
33+
- JavaScript for block functionality
34+
- SCSS/CSS for styling
35+
- Block template HTML
36+
- Pattern PHP files
37+
38+
### 🚀 Best Practices
39+
- Performance optimisation
40+
- Accessibility compliance
41+
- Security implementation
42+
- WordPress coding standards
43+
44+
## Quick Commands
45+
46+
| Command | Description |
47+
|---------|-------------|
48+
| `help blocks` | Block authoring assistance |
49+
| `help cpt` | Custom post type guidance |
50+
| `help fields` | SCF field configuration |
51+
| `help styles` | Styling and block.json |
52+
| `help js` | JavaScript functionality |
53+
| `help testing` | Testing strategies |
54+
| `help build` | Build process help |
55+
56+
## Development Modes
57+
58+
### WordPress Development Mode
59+
Focus on PHP and WordPress-specific work.
60+
61+
**Activate**: "Switch to WordPress development mode"
62+
63+
**Key Behaviours**:
64+
- Prioritise WordPress coding standards
65+
- Focus on PHP best practices
66+
- Emphasise security and sanitisation
67+
- Reference WordPress documentation
68+
69+
### Block Development Mode
70+
Focus on Gutenberg block APIs.
71+
72+
**Activate**: "Switch to block development mode"
73+
74+
**Key Behaviours**:
75+
- Focus on Gutenberg block APIs
76+
- Emphasise React and modern JavaScript
77+
- Prioritise block editor UX patterns
78+
- Use WordPress block design system
79+
80+
### Post Type Mode
81+
Focus on CPT and taxonomy development.
82+
83+
**Activate**: "Switch to post type mode"
84+
85+
**Key Behaviours**:
86+
- Focus on CPT registration patterns
87+
- Emphasise REST API integration
88+
- Prioritise block template configuration
89+
- Use proper label arrays
90+
91+
### Fields Mode
92+
Focus on SCF/ACF field configuration.
93+
94+
**Activate**: "Switch to fields mode"
95+
96+
**Key Behaviours**:
97+
- Focus on SCF/ACF field registration
98+
- Emphasise field group configuration
99+
- Prioritise repeater and flexible content
100+
- Use Block Bindings API integration
101+
102+
### Testing Mode
103+
Focus on comprehensive test coverage.
104+
105+
**Activate**: "Switch to testing mode"
106+
107+
**Key Behaviours**:
108+
- Write Jest tests for JavaScript components
109+
- Create PHPUnit tests for PHP functions
110+
- Implement Playwright E2E tests
111+
112+
### Security Audit Mode
113+
Focus on security best practices.
114+
115+
**Activate**: "Switch to security audit mode"
116+
117+
### Performance Optimisation Mode
118+
Focus on speed and efficiency.
119+
120+
**Activate**: "Switch to performance mode"
121+
122+
### Accessibility Mode
123+
Focus on WCAG 2.1 AA compliance.
124+
125+
**Activate**: "Switch to accessibility mode"
126+
127+
## Context
128+
129+
- **Plugin**: {{name}}
130+
- **Slug**: {{slug}}
131+
- **Version**: {{version}}
132+
- **Architecture**: WordPress Multi-Block Plugin with CPT
133+
- **Build**: Webpack + @wordpress/scripts
134+
- **Fields**: Secure Custom Fields (SCF)
135+
- **Standards**: WordPress Coding Standards
136+
137+
## File Structure
138+
139+
```
140+
{{slug}}/
141+
├── src/
142+
│ ├── blocks/
143+
│ │ ├── {{slug}}-card/
144+
│ │ ├── {{slug}}-collection/
145+
│ │ ├── {{slug}}-slider/
146+
│ │ └── {{slug}}-featured/
147+
│ ├── components/
148+
│ ├── hooks/
149+
│ └── scss/
150+
├── inc/
151+
│ ├── class-post-types.php
152+
│ ├── class-taxonomies.php
153+
│ ├── class-fields.php
154+
│ ├── class-options.php
155+
│ ├── class-scf-json.php
156+
│ └── class-block-bindings.php
157+
├── scf-json/
158+
│ ├── group_{{slug}}_*.json
159+
│ └── schema/
160+
├── patterns/
161+
├── templates/
162+
├── parts/
163+
└── {{slug}}.php
164+
```
165+
166+
## Example Requests
167+
168+
- "Create a collection block with grid layout"
169+
- "Add a slider repeater field"
170+
- "Configure block bindings for custom fields"
171+
- "Set up taxonomy filtering for collection block"
172+
- "Help me configure the collection block query"
173+
- "Add a gallery repeater field"
174+
175+
## Related Files
176+
177+
- [Custom Instructions](../custom-instructions.md)
178+
- [Prompts](../prompts/prompts.md)
179+
- [Agent Index](./agent.md)
180+
- [SCF Fields Reference](../instructions/scf-fields.instructions.md)
181+
182+
---
183+
184+
I'm here to help you create an amazing WordPress multi-block plugin! 🚀

0 commit comments

Comments
 (0)